regression: @divExact
no longer emits *div exact
LLVM IR
#19527
Labels
backend-llvm
The LLVM backend outputs an LLVM IR Module.
bug
Observed behavior contradicts documented or intended behavior
regression
It worked in a previous version of Zig, but stopped working.
Milestone
Zig Version
0.12.0-dev.3518+d2be725e4
Steps to Reproduce and Observed Behavior
https://godbolt.org/z/zEhYTY1h9
because of
@divExact
s 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
The text was updated successfully, but these errors were encountered: