[codegen] add intcc conditions for reading carry flag
Add conditions to IntCC for checking the carry flag (Carry, NotCarry). Fixes: https://github.com/CraneStation/cranelift/issues/980
This commit is contained in:
committed by
Dan Gohman
parent
1431ab5201
commit
6e131e5347
@@ -83,7 +83,11 @@ fn dynamic_addr(
|
||||
// We need an overflow check for the adjusted offset.
|
||||
let access_size_val = pos.ins().iconst(offset_ty, access_size as i64);
|
||||
let (adj_offset, overflow) = pos.ins().iadd_ifcout(offset, access_size_val);
|
||||
pos.ins().trapnz(overflow, ir::TrapCode::HeapOutOfBounds);
|
||||
pos.ins().trapif(
|
||||
isa.unsigned_add_overflow_condition(),
|
||||
overflow,
|
||||
ir::TrapCode::HeapOutOfBounds,
|
||||
);
|
||||
oob = pos
|
||||
.ins()
|
||||
.icmp(IntCC::UnsignedGreaterThan, adj_offset, bound);
|
||||
|
||||
Reference in New Issue
Block a user