Skip to content

Commit 2a524af

Browse files
author
TheIronBorn
committed
note range != 0 compiler optimizations
1 parent 8b4296a commit 2a524af

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

src/distributions/uniform.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -568,9 +568,8 @@ macro_rules! uniform_simd_int_impl {
568568
// wrapping addition
569569
let result = self.low + hi;
570570
// `select` here compiles to a blend operation
571-
// TODO: look into how the compiler manages the
572-
// constant case. Are the compare and blend operations
573-
// avoided?
571+
// When `range.eq(0).none()` the compare and blend
572+
// operations are avoided.
574573
let v: $ty = v.cast();
575574
return range.gt($unsigned::splat(0)).select(result, v);
576575
}

0 commit comments

Comments
 (0)