diff options
| author | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-23 09:35:39 +0000 |
|---|---|---|
| committer | bjorn3 <17426603+bjorn3@users.noreply.github.com> | 2023-06-23 09:35:39 +0000 |
| commit | aef31cb2f3640c0db9ccd4ef26caac6e7672e51c (patch) | |
| tree | 9795621e38f2a4b6d7188bd3d1d5f9b3ec9c69ba /src | |
| parent | bbf45081b716d6cd93df17b5c22729e539db741d (diff) | |
| download | rust-aef31cb2f3640c0db9ccd4ef26caac6e7672e51c.tar.gz rust-aef31cb2f3640c0db9ccd4ef26caac6e7672e51c.zip | |
Implement _mm_srli_epi64
Diffstat (limited to 'src')
| -rw-r--r-- | src/intrinsics/llvm_x86.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/src/intrinsics/llvm_x86.rs b/src/intrinsics/llvm_x86.rs index c5d8bd295ff..980d3262b67 100644 --- a/src/intrinsics/llvm_x86.rs +++ b/src/intrinsics/llvm_x86.rs @@ -299,6 +299,23 @@ pub(crate) fn codegen_x86_llvm_intrinsic_call<'tcx>( _ => fx.bcx.ins().iconst(types::I32, 0), }); } + "llvm.x86.sse2.psrli.q" => { + let (a, imm8) = match args { + [a, imm8] => (a, imm8), + _ => bug!("wrong number of args for intrinsic {intrinsic}"), + }; + let a = codegen_operand(fx, a); + let imm8 = crate::constant::mir_operand_get_const_val(fx, imm8) + .expect("llvm.x86.avx.psrli.q imm8 not const"); + + simd_for_each_lane(fx, a, ret, &|fx, _lane_ty, _res_lane_ty, lane| match imm8 + .try_to_bits(Size::from_bytes(4)) + .unwrap_or_else(|| panic!("imm8 not scalar: {:?}", imm8)) + { + imm8 if imm8 < 32 => fx.bcx.ins().ushr_imm(lane, i64::from(imm8 as u8)), + _ => fx.bcx.ins().iconst(types::I32, 0), + }); + } "llvm.x86.avx.pslli.d" => { let (a, imm8) = match args { [a, imm8] => (a, imm8), |
