Skip to content

Conversation

@wenyongh
Copy link
Owner

No description provided.

bh_assert(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0]))
#define CHECK_I32_REG_NO(no) \
do { \
if (!(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0]))) \

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!(no >= 0 && (uint32)no < sizeof(regs_i32) / sizeof(regs_i32[0]))) \
if ((uint32)no >= sizeof(regs_i32) / sizeof(regs_i32[0]))) \

just realized, may be we can simplify the condition.

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK, sounds better.

case JIT_REG_KIND_F32:
{
ASSERT_F32_REG_NO(floatpoint_reg_index);
CHECK_F32_REG_NO((int32)floatpoint_reg_index);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe int8 floatpoint_reg_index = 0; -> int floatpoint_reg_no = 0

Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK

Copy link

@lum1n0us lum1n0us left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Btw, if maybe a little heavy when we are sure register allocation always give valid register numbers?

@wenyongh
Copy link
Owner Author

Btw, if maybe a little heavy when we are sure register allocation always give valid register numbers?

It is just for debug version, in release version, CHECK_REG_NO is defined as (void)0.

@wenyongh wenyongh closed this Jul 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants