Zig Version
0.12.0-dev.3518+d2be725e4
Steps to Reproduce and Observed Behavior
export fn div(a: i32) i32 {
return @divExact(a, 2);
}
https://godbolt.org/z/zEhYTY1h9
because of @divExacts semantics with safety disabled this should be turned into a shift which happened until 0.12 where it emits %1 = sdiv i32 %0, 2 LLVM IR rather than %1 = ashr exact i32 %0, 1
Expected Behavior
zig should emit a right shift to llvm in unsafe modes
Zig Version
0.12.0-dev.3518+d2be725e4
Steps to Reproduce and Observed Behavior
https://godbolt.org/z/zEhYTY1h9
because of
@divExacts semantics with safety disabled this should be turned into a shift which happened until 0.12 where it emits%1 = sdiv i32 %0, 2LLVM IR rather than%1 = ashr exact i32 %0, 1Expected Behavior
zig should emit a right shift to llvm in unsafe modes