@@ -38,7 +38,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
38
38
self . cx . context . new_unary_op ( self . location , operation, typ, a)
39
39
} else {
40
40
let element_type = typ. dyncast_array ( ) . expect ( "element type" ) ;
41
- self . from_low_high_rvalues (
41
+ self . concat_low_high_rvalues (
42
42
typ,
43
43
self . cx . context . new_unary_op (
44
44
self . location ,
@@ -112,7 +112,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
112
112
let shift_value = self . gcc_sub ( b, sixty_four) ;
113
113
let high = self . high ( a) ;
114
114
let sign = if a_type. is_signed ( self ) { high >> sixty_three } else { zero } ;
115
- let array_value = self . from_low_high_rvalues ( a_type, high >> shift_value, sign) ;
115
+ let array_value = self . concat_low_high_rvalues ( a_type, high >> shift_value, sign) ;
116
116
then_block. add_assignment ( self . location , result, array_value) ;
117
117
then_block. end_with_jump ( self . location , after_block) ;
118
118
@@ -128,8 +128,11 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
128
128
let casted_low = self . context . new_cast ( self . location , self . low ( a) , unsigned_type) ;
129
129
let shifted_low = casted_low >> self . context . new_cast ( self . location , b, unsigned_type) ;
130
130
let shifted_low = self . context . new_cast ( self . location , shifted_low, native_int_type) ;
131
- let array_value =
132
- self . from_low_high_rvalues ( a_type, ( high << shift_value) | shifted_low, high >> b) ;
131
+ let array_value = self . concat_low_high_rvalues (
132
+ a_type,
133
+ ( high << shift_value) | shifted_low,
134
+ high >> b,
135
+ ) ;
133
136
actual_else_block. add_assignment ( self . location , result, array_value) ;
134
137
actual_else_block. end_with_jump ( self . location , after_block) ;
135
138
@@ -610,7 +613,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
610
613
{
611
614
a ^ b
612
615
} else {
613
- self . from_low_high_rvalues (
616
+ self . concat_low_high_rvalues (
614
617
a_type,
615
618
self . low ( a) ^ self . low ( b) ,
616
619
self . high ( a) ^ self . high ( b) ,
@@ -659,7 +662,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
659
662
self . llbb ( ) . end_with_conditional ( self . location , condition, then_block, else_block) ;
660
663
661
664
let array_value =
662
- self . from_low_high_rvalues ( a_type, zero, self . low ( a) << ( b - sixty_four) ) ;
665
+ self . concat_low_high_rvalues ( a_type, zero, self . low ( a) << ( b - sixty_four) ) ;
663
666
then_block. add_assignment ( self . location , result, array_value) ;
664
667
then_block. end_with_jump ( self . location , after_block) ;
665
668
@@ -677,7 +680,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
677
680
let high_low =
678
681
self . context . new_cast ( self . location , casted_low >> shift_value, native_int_type) ;
679
682
680
- let array_value = self . from_low_high_rvalues (
683
+ let array_value = self . concat_low_high_rvalues (
681
684
a_type,
682
685
self . low ( a) << b,
683
686
( self . high ( a) << b) | high_low,
@@ -706,7 +709,7 @@ impl<'a, 'gcc, 'tcx> Builder<'a, 'gcc, 'tcx> {
706
709
707
710
// NOTE: we also need to swap the two elements here, in addition to swapping inside
708
711
// the elements themselves like done above.
709
- return self . from_low_high_rvalues ( arg_type, swapped_msb, swapped_lsb) ;
712
+ return self . concat_low_high_rvalues ( arg_type, swapped_msb, swapped_lsb) ;
710
713
}
711
714
712
715
// TODO(antoyo): check if it's faster to use string literals and a
@@ -728,7 +731,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
728
731
self . context . new_rvalue_from_long ( typ, int)
729
732
} else {
730
733
// NOTE: set the sign in high.
731
- self . from_low_high ( typ, int, -( int. is_negative ( ) as i64 ) )
734
+ self . concat_low_high ( typ, int, -( int. is_negative ( ) as i64 ) )
732
735
}
733
736
}
734
737
@@ -740,7 +743,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
740
743
} else if self . is_native_int_type_or_bool ( typ) {
741
744
self . context . new_rvalue_from_long ( typ, int as i64 )
742
745
} else {
743
- self . from_low_high ( typ, int as i64 , 0 )
746
+ self . concat_low_high ( typ, int as i64 , 0 )
744
747
}
745
748
}
746
749
@@ -757,7 +760,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
757
760
let shift = high << sixty_four;
758
761
shift | self . context . new_cast ( None , low, typ)
759
762
} else {
760
- self . from_low_high ( typ, low as i64 , high as i64 )
763
+ self . concat_low_high ( typ, low as i64 , high as i64 )
761
764
}
762
765
} else if typ. is_i128 ( self ) {
763
766
// FIXME(antoyo): libgccjit cannot create 128-bit values yet.
@@ -772,7 +775,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
772
775
if self . is_native_int_type_or_bool ( typ) {
773
776
self . context . new_rvalue_zero ( typ)
774
777
} else {
775
- self . from_low_high ( typ, 0 , 0 )
778
+ self . concat_low_high ( typ, 0 , 0 )
776
779
}
777
780
}
778
781
@@ -810,7 +813,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
810
813
"both types should either be native or non-native for or operation"
811
814
) ;
812
815
let native_int_type = a_type. dyncast_array ( ) . expect ( "get element type" ) ;
813
- self . from_low_high_rvalues (
816
+ self . concat_low_high_rvalues (
814
817
a_type,
815
818
self . context . new_binary_op (
816
819
loc,
@@ -855,7 +858,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
855
858
let is_negative =
856
859
self . context . new_comparison ( None , ComparisonOp :: LessThan , value, zero) ;
857
860
let is_negative = self . gcc_int_cast ( is_negative, dest_element_type) ;
858
- self . from_low_high_rvalues (
861
+ self . concat_low_high_rvalues (
859
862
dest_typ,
860
863
self . context . new_cast ( None , value, dest_element_type) ,
861
864
self . context . new_unary_op ( None , UnaryOp :: Minus , dest_element_type, is_negative) ,
@@ -975,7 +978,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
975
978
. to_rvalue ( )
976
979
}
977
980
978
- fn from_low_high_rvalues (
981
+ fn concat_low_high_rvalues (
979
982
& self ,
980
983
typ : Type < ' gcc > ,
981
984
low : RValue < ' gcc > ,
@@ -990,7 +993,7 @@ impl<'gcc, 'tcx> CodegenCx<'gcc, 'tcx> {
990
993
self . context . new_array_constructor ( None , typ, & values)
991
994
}
992
995
993
- fn from_low_high ( & self , typ : Type < ' gcc > , low : i64 , high : i64 ) -> RValue < ' gcc > {
996
+ fn concat_low_high ( & self , typ : Type < ' gcc > , low : i64 , high : i64 ) -> RValue < ' gcc > {
994
997
let ( first, last) = match self . sess ( ) . target . options . endian {
995
998
Endian :: Little => ( low, high) ,
996
999
Endian :: Big => ( high, low) ,
0 commit comments