[FRONTEND] Semantic analysis refactor (#473)
Moved dispatch.cc to semantic.py Integer signedness now moved from C++ to python Cleaner frontend type Co-authored-by: Phil Tillet <phil@openai.com>
This commit is contained in:
@@ -312,8 +312,8 @@ cast_inst *cast_inst::create_integer_cast(value *arg, type *ty, bool is_signed,
|
||||
unsigned arg_bits = arg_ty->get_scalar_ty()->get_integer_bitwidth();
|
||||
unsigned dst_bits = ty->get_scalar_ty()->get_integer_bitwidth();
|
||||
cast_op_t op = (arg_bits == dst_bits ? cast_op_t::BitCast :
|
||||
(arg_bits > dst_bits ? cast_op_t::Trunc :
|
||||
(is_signed ? cast_op_t::SExt : cast_op_t::ZExt)));
|
||||
(arg_bits > dst_bits ? cast_op_t::Trunc :
|
||||
(is_signed ? cast_op_t::SExt : cast_op_t::ZExt)));
|
||||
return create(op, arg, ty, name, next);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user