Skip to content

Commit

Permalink
Add branch hint to unlikely branch of rem_pio2_large
Browse files Browse the repository at this point in the history
Adds a `@branchHint` to a 1 in 12 branch of the pi/2 remainder calculation.
  • Loading branch information
LiamSwayne authored and andrewrk committed Dec 23, 2024
1 parent 5837147 commit b976e89
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions lib/compiler_rt/rem_pio2_large.zig
Original file line number Diff line number Diff line change
Expand Up @@ -356,6 +356,7 @@ pub fn rem_pio2_large(x: []f64, y: []f64, e0: i32, nx: i32, prec: usize) i32 {
}
}
if (q0 > 0) { // rare case: chance is 1 in 12
@branchHint(.unlikely);
switch (q0) {
1 => iq[@intCast(jz - 1)] &= 0x7fffff,
2 => iq[@intCast(jz - 1)] &= 0x3fffff,
Expand Down

0 comments on commit b976e89

Please sign in to comment.