@@ -120,6 +120,40 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>(
120
120
_ => fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ,
121
121
} ) ;
122
122
}
123
+ "llvm.x86.sse2.psrli.w" => {
124
+ let ( a, imm8) = match args {
125
+ [ a, imm8] => ( a, imm8) ,
126
+ _ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
127
+ } ;
128
+ let a = codegen_operand ( fx, a) ;
129
+ let imm8 = crate :: constant:: mir_operand_get_const_val ( fx, imm8)
130
+ . expect ( "llvm.x86.sse2.psrli.d imm8 not const" ) ;
131
+
132
+ simd_for_each_lane ( fx, a, ret, & |fx, _lane_ty, _res_lane_ty, lane| match imm8
133
+ . try_to_bits ( Size :: from_bytes ( 4 ) )
134
+ . unwrap_or_else ( || panic ! ( "imm8 not scalar: {:?}" , imm8) )
135
+ {
136
+ imm8 if imm8 < 16 => fx. bcx . ins ( ) . ushr_imm ( lane, i64:: from ( imm8 as u8 ) ) ,
137
+ _ => fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ,
138
+ } ) ;
139
+ }
140
+ "llvm.x86.sse2.pslli.w" => {
141
+ let ( a, imm8) = match args {
142
+ [ a, imm8] => ( a, imm8) ,
143
+ _ => bug ! ( "wrong number of args for intrinsic {intrinsic}" ) ,
144
+ } ;
145
+ let a = codegen_operand ( fx, a) ;
146
+ let imm8 = crate :: constant:: mir_operand_get_const_val ( fx, imm8)
147
+ . expect ( "llvm.x86.sse2.pslli.d imm8 not const" ) ;
148
+
149
+ simd_for_each_lane ( fx, a, ret, & |fx, _lane_ty, _res_lane_ty, lane| match imm8
150
+ . try_to_bits ( Size :: from_bytes ( 4 ) )
151
+ . unwrap_or_else ( || panic ! ( "imm8 not scalar: {:?}" , imm8) )
152
+ {
153
+ imm8 if imm8 < 16 => fx. bcx . ins ( ) . ishl_imm ( lane, i64:: from ( imm8 as u8 ) ) ,
154
+ _ => fx. bcx . ins ( ) . iconst ( types:: I32 , 0 ) ,
155
+ } ) ;
156
+ }
123
157
"llvm.x86.avx.psrli.d" => {
124
158
let ( a, imm8) = match args {
125
159
[ a, imm8] => ( a, imm8) ,
0 commit comments