From ee05e68052546a692ce93551540c76a6ac0593af Mon Sep 17 00:00:00 2001 From: Dmitry Stogov Date: Thu, 15 Sep 2022 00:01:20 +0300 Subject: [PATCH] Fix mistakes in constant conversion folding rules --- ir_fold.h | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/ir_fold.h b/ir_fold.h index aaf4e0e..f526a90 100644 --- a/ir_fold.h +++ b/ir_fold.h @@ -824,7 +824,7 @@ IR_FOLD(SEXT(C_U8)) IR_FOLD(SEXT(C_BOOL)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_I((int64_t)op1_insn->val.i8); } @@ -832,7 +832,7 @@ IR_FOLD(SEXT(C_I16)) IR_FOLD(SEXT(C_U16)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_I((int64_t)op1_insn->val.i16); } @@ -840,7 +840,7 @@ IR_FOLD(SEXT(C_I32)) IR_FOLD(SEXT(C_U32)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_I((int64_t)op1_insn->val.i32); } @@ -849,7 +849,7 @@ IR_FOLD(ZEXT(C_U8)) IR_FOLD(ZEXT(C_BOOL)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_U((uint64_t)op1_insn->val.u8); } @@ -857,7 +857,7 @@ IR_FOLD(ZEXT(C_I16)) IR_FOLD(ZEXT(C_U16)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_U((uint64_t)op1_insn->val.u16); } @@ -865,7 +865,7 @@ IR_FOLD(ZEXT(C_I32)) IR_FOLD(ZEXT(C_U32)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] > ir_type_size[op1_insn->type]); IR_FOLD_CONST_U((uint64_t)op1_insn->val.u32); } @@ -877,7 +877,7 @@ IR_FOLD(TRUNC(C_U32)) IR_FOLD(TRUNC(C_U64)) { IR_ASSERT(IR_IS_TYPE_INT(IR_OPT_TYPE(opt))); - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] < ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] < ir_type_size[op1_insn->type]); switch (IR_OPT_TYPE(opt)) { case IR_I8: IR_FOLD_CONST_I(op1_insn->val.i8); @@ -908,7 +908,7 @@ IR_FOLD(BITCAST(C_U64)) IR_FOLD(BITCAST(C_FLOAT)) IR_FOLD(BITCAST(C_DOUBLE)) { - IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] == ir_type_size[IR_OPT_TYPE(op1_insn->type)]); + IR_ASSERT(ir_type_size[IR_OPT_TYPE(opt)] == ir_type_size[op1_insn->type]); switch (IR_OPT_TYPE(opt)) { case IR_I8: IR_FOLD_CONST_I(op1_insn->val.i8);