fast-jit: Fix const shift and const i64 compare issues (#2969)

This commit is contained in:
Wenyong Huang
2024-01-02 17:56:34 +08:00
committed by GitHub
parent 286ea35508
commit 2ee013faf3
2 changed files with 16 additions and 7 deletions

View File

@ -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;
}