fast-jit: Fix const shift and const i64 compare issues (#2969)
This commit is contained in:
@ -1066,13 +1066,15 @@ DEF_UNI_INT_CONST_OPS(shru)
|
||||
static int32
|
||||
do_i32_const_shl(int32 lhs, int32 rhs)
|
||||
{
|
||||
rhs &= 31;
|
||||
return (int32)((uint32)lhs << (uint32)rhs);
|
||||
}
|
||||
|
||||
static int64
|
||||
do_i64_const_shl(int64 lhs, int64 rhs)
|
||||
{
|
||||
return (int32)((uint64)lhs << (uint64)rhs);
|
||||
rhs &= 63LL;
|
||||
return (uint64)lhs << (uint64)rhs;
|
||||
}
|
||||
|
||||
DEF_BI_INT_CONST_OPS(shrs, >>)
|
||||
@ -1080,12 +1082,14 @@ DEF_BI_INT_CONST_OPS(shrs, >>)
|
||||
static int32
|
||||
do_i32_const_shru(int32 lhs, int32 rhs)
|
||||
{
|
||||
rhs &= 31;
|
||||
return (uint32)lhs >> rhs;
|
||||
}
|
||||
|
||||
static int64
|
||||
do_i64_const_shru(int64 lhs, int64 rhs)
|
||||
{
|
||||
rhs &= 63LL;
|
||||
return (uint64)lhs >> rhs;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user