@@ -175,7 +175,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
175175 | MemorySemantics :: SEQUENTIALLY_CONSISTENT
176176 }
177177 } ;
178- let semantics = self . constant_u32 ( self . span ( ) , semantics. bits ( ) ) ;
178+ let semantics = self . constant_bit32 ( self . span ( ) , semantics. bits ( ) ) ;
179179 if invalid_seq_cst {
180180 self . zombie (
181181 semantics. def ( self ) ,
@@ -196,10 +196,10 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
196196 . constant_u16 ( self . span ( ) , memset_fill_u16 ( fill_byte) )
197197 . def ( self ) ,
198198 32 => self
199- . constant_u32 ( self . span ( ) , memset_fill_u32 ( fill_byte) )
199+ . constant_bit32 ( self . span ( ) , memset_fill_u32 ( fill_byte) )
200200 . def ( self ) ,
201201 64 => self
202- . constant_u64 ( self . span ( ) , memset_fill_u64 ( fill_byte) )
202+ . constant_bit64 ( self . span ( ) , memset_fill_u64 ( fill_byte) )
203203 . def ( self ) ,
204204 _ => self . fatal ( format ! (
205205 "memset on integer width {width} not implemented yet"
@@ -314,7 +314,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
314314 self . store ( pat, ptr, Align :: from_bytes ( 0 ) . unwrap ( ) ) ;
315315 } else {
316316 for index in 0 ..count {
317- let const_index = self . constant_u32 ( self . span ( ) , index as u32 ) ;
317+ let const_index = self . constant_bit32 ( self . span ( ) , index as u32 ) ;
318318 let gep_ptr = self . gep ( pat. ty , ptr, & [ const_index] ) ;
319319 self . store ( pat, gep_ptr, Align :: from_bytes ( 0 ) . unwrap ( ) ) ;
320320 }
@@ -428,7 +428,7 @@ impl<'a, 'tcx> Builder<'a, 'tcx> {
428428 } else {
429429 let indices = indices
430430 . into_iter ( )
431- . map ( |idx| self . constant_u32 ( self . span ( ) , idx) . def ( self ) )
431+ . map ( |idx| self . constant_bit32 ( self . span ( ) , idx) . def ( self ) )
432432 . collect :: < Vec < _ > > ( ) ;
433433 self . emit ( )
434434 . access_chain ( leaf_ptr_ty, None , ptr. def ( self ) , indices)
@@ -904,9 +904,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
904904 ) )
905905 } else if signed {
906906 // this cast chain can probably be collapsed, but, whatever, be safe
907- Operand :: LiteralInt32 ( v as u8 as i8 as i32 as u32 )
907+ Operand :: LiteralBit32 ( v as u8 as i8 as i32 as u32 )
908908 } else {
909- Operand :: LiteralInt32 ( v as u8 as u32 )
909+ Operand :: LiteralBit32 ( v as u8 as u32 )
910910 }
911911 }
912912 fn construct_16 ( self_ : & Builder < ' _ , ' _ > , signed : bool , v : u128 ) -> Operand {
@@ -915,9 +915,9 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
915915 "Switches to values above u16::MAX not supported: {v:?}"
916916 ) )
917917 } else if signed {
918- Operand :: LiteralInt32 ( v as u16 as i16 as i32 as u32 )
918+ Operand :: LiteralBit32 ( v as u16 as i16 as i32 as u32 )
919919 } else {
920- Operand :: LiteralInt32 ( v as u16 as u32 )
920+ Operand :: LiteralBit32 ( v as u16 as u32 )
921921 }
922922 }
923923 fn construct_32 ( self_ : & Builder < ' _ , ' _ > , _signed : bool , v : u128 ) -> Operand {
@@ -926,7 +926,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
926926 "Switches to values above u32::MAX not supported: {v:?}"
927927 ) )
928928 } else {
929- Operand :: LiteralInt32 ( v as u32 )
929+ Operand :: LiteralBit32 ( v as u32 )
930930 }
931931 }
932932 fn construct_64 ( self_ : & Builder < ' _ , ' _ > , _signed : bool , v : u128 ) -> Operand {
@@ -935,7 +935,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
935935 "Switches to values above u64::MAX not supported: {v:?}"
936936 ) )
937937 } else {
938- Operand :: LiteralInt64 ( v as u64 )
938+ Operand :: LiteralBit64 ( v as u64 )
939939 }
940940 }
941941 // pass in signed into the closure to be able to unify closure types
@@ -1217,7 +1217,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
12171217 let ( ptr, access_ty) = self . adjust_pointer_for_typed_access ( ptr, ty) ;
12181218
12191219 // TODO: Default to device scope
1220- let memory = self . constant_u32 ( self . span ( ) , Scope :: Device as u32 ) ;
1220+ let memory = self . constant_bit32 ( self . span ( ) , Scope :: Device as u32 ) ;
12211221 let semantics = self . ordering_to_semantics_def ( order) ;
12221222 let result = self
12231223 . emit ( )
@@ -1347,7 +1347,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
13471347 let val = self . bitcast ( val, access_ty) ;
13481348
13491349 // TODO: Default to device scope
1350- let memory = self . constant_u32 ( self . span ( ) , Scope :: Device as u32 ) ;
1350+ let memory = self . constant_bit32 ( self . span ( ) , Scope :: Device as u32 ) ;
13511351 let semantics = self . ordering_to_semantics_def ( order) ;
13521352 self . validate_atomic ( val. ty , ptr. def ( self ) ) ;
13531353 self . emit ( )
@@ -1413,7 +1413,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
14131413 let original_ptr = ptr. def ( self ) ;
14141414 let indices = indices
14151415 . into_iter ( )
1416- . map ( |idx| self . constant_u32 ( self . span ( ) , idx) . def ( self ) )
1416+ . map ( |idx| self . constant_bit32 ( self . span ( ) , idx) . def ( self ) )
14171417 . collect :: < Vec < _ > > ( ) ;
14181418 return self
14191419 . emit ( )
@@ -1433,7 +1433,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
14331433 if idx > u32:: MAX as u64 {
14341434 self . fatal ( "struct_gep bigger than u32::MAX" ) ;
14351435 }
1436- let index_const = self . constant_u32 ( self . span ( ) , idx as u32 ) . def ( self ) ;
1436+ let index_const = self . constant_bit32 ( self . span ( ) , idx as u32 ) . def ( self ) ;
14371437 self . emit ( )
14381438 . access_chain (
14391439 result_type,
@@ -1741,7 +1741,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
17411741 ) {
17421742 let indices = indices
17431743 . into_iter ( )
1744- . map ( |idx| self . constant_u32 ( self . span ( ) , idx) . def ( self ) )
1744+ . map ( |idx| self . constant_bit32 ( self . span ( ) , idx) . def ( self ) )
17451745 . collect :: < Vec < _ > > ( ) ;
17461746 self . emit ( )
17471747 . access_chain ( dest_ty, None , ptr. def ( self ) , indices)
@@ -2292,7 +2292,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
22922292
22932293 self . validate_atomic ( access_ty, dst. def ( self ) ) ;
22942294 // TODO: Default to device scope
2295- let memory = self . constant_u32 ( self . span ( ) , Scope :: Device as u32 ) ;
2295+ let memory = self . constant_bit32 ( self . span ( ) , Scope :: Device as u32 ) ;
22962296 let semantics_equal = self . ordering_to_semantics_def ( order) ;
22972297 let semantics_unequal = self . ordering_to_semantics_def ( failure_order) ;
22982298 // Note: OpAtomicCompareExchangeWeak is deprecated, and has the same semantics
@@ -2328,7 +2328,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
23282328 self . validate_atomic ( access_ty, dst. def ( self ) ) ;
23292329 // TODO: Default to device scope
23302330 let memory = self
2331- . constant_u32 ( self . span ( ) , Scope :: Device as u32 )
2331+ . constant_bit32 ( self . span ( ) , Scope :: Device as u32 )
23322332 . def ( self ) ;
23332333 let semantics = self . ordering_to_semantics_def ( order) . def ( self ) ;
23342334 use AtomicRmwBinOp :: * ;
@@ -2424,7 +2424,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
24242424 // Ignore sync scope (it only has "single thread" and "cross thread")
24252425 // TODO: Default to device scope
24262426 let memory = self
2427- . constant_u32 ( self . span ( ) , Scope :: Device as u32 )
2427+ . constant_bit32 ( self . span ( ) , Scope :: Device as u32 )
24282428 . def ( self ) ;
24292429 let semantics = self . ordering_to_semantics_def ( order) . def ( self ) ;
24302430 self . emit ( ) . memory_barrier ( memory, semantics) . unwrap ( ) ;
@@ -2697,7 +2697,7 @@ impl<'a, 'tcx> BuilderMethods<'a, 'tcx> for Builder<'a, 'tcx> {
26972697
26982698 // HACK(eddyb) avoid the logic below that assumes only ID operands
26992699 if inst. class . opcode == Op :: CompositeExtract {
2700- if let ( Some ( r) , & [ Operand :: IdRef ( x) , Operand :: LiteralInt32 ( i) ] ) =
2700+ if let ( Some ( r) , & [ Operand :: IdRef ( x) , Operand :: LiteralBit32 ( i) ] ) =
27012701 ( inst. result_id , & inst. operands [ ..] )
27022702 {
27032703 return Some ( Inst :: CompositeExtract ( r, x, i) ) ;
0 commit comments