Skip to content

Commit 3d97550

Browse files
committed
optimize u128/i128 popcounts further
Don't fall back on breaking apart the popcount operation if 128-bit integers are natively supported. Signed-off-by: Andy Sadler <[email protected]>
1 parent fabdc1a commit 3d97550

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/intrinsic/mod.rs

+3-1
Original file line numberDiff line numberDiff line change
@@ -819,7 +819,9 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
819819
value
820820
};
821821

822-
if value_type.is_u128(&self.cx) {
822+
// only break apart 128-bit ints if they're not natively supported
823+
// TODO(antoyo): remove this if/when native 128-bit integers land in libgccjit
824+
if value_type.is_u128(&self.cx) && !self.cx.supports_128bit_integers {
823825
let sixty_four = self.gcc_int(value_type, 64);
824826
let right_shift = self.gcc_lshr(value, sixty_four);
825827
let high = self.gcc_int_cast(right_shift, self.cx.ulonglong_type);

0 commit comments

Comments
 (0)