100 lines · plain
1; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py2; RUN: llc --mtriple=loongarch32 --mattr=+32s,+lsx < %s | FileCheck %s3; RUN: llc --mtriple=loongarch64 --mattr=+lsx < %s | FileCheck %s4 5declare <16 x i8> @llvm.loongarch.lsx.vsat.b(<16 x i8>, i32)6 7define <16 x i8> @lsx_vsat_b(<16 x i8> %va) nounwind {8; CHECK-LABEL: lsx_vsat_b:9; CHECK: # %bb.0: # %entry10; CHECK-NEXT: vsat.b $vr0, $vr0, 111; CHECK-NEXT: ret12entry:13 %res = call <16 x i8> @llvm.loongarch.lsx.vsat.b(<16 x i8> %va, i32 1)14 ret <16 x i8> %res15}16 17declare <8 x i16> @llvm.loongarch.lsx.vsat.h(<8 x i16>, i32)18 19define <8 x i16> @lsx_vsat_h(<8 x i16> %va) nounwind {20; CHECK-LABEL: lsx_vsat_h:21; CHECK: # %bb.0: # %entry22; CHECK-NEXT: vsat.h $vr0, $vr0, 123; CHECK-NEXT: ret24entry:25 %res = call <8 x i16> @llvm.loongarch.lsx.vsat.h(<8 x i16> %va, i32 1)26 ret <8 x i16> %res27}28 29declare <4 x i32> @llvm.loongarch.lsx.vsat.w(<4 x i32>, i32)30 31define <4 x i32> @lsx_vsat_w(<4 x i32> %va) nounwind {32; CHECK-LABEL: lsx_vsat_w:33; CHECK: # %bb.0: # %entry34; CHECK-NEXT: vsat.w $vr0, $vr0, 135; CHECK-NEXT: ret36entry:37 %res = call <4 x i32> @llvm.loongarch.lsx.vsat.w(<4 x i32> %va, i32 1)38 ret <4 x i32> %res39}40 41declare <2 x i64> @llvm.loongarch.lsx.vsat.d(<2 x i64>, i32)42 43define <2 x i64> @lsx_vsat_d(<2 x i64> %va) nounwind {44; CHECK-LABEL: lsx_vsat_d:45; CHECK: # %bb.0: # %entry46; CHECK-NEXT: vsat.d $vr0, $vr0, 147; CHECK-NEXT: ret48entry:49 %res = call <2 x i64> @llvm.loongarch.lsx.vsat.d(<2 x i64> %va, i32 1)50 ret <2 x i64> %res51}52 53declare <16 x i8> @llvm.loongarch.lsx.vsat.bu(<16 x i8>, i32)54 55define <16 x i8> @lsx_vsat_bu(<16 x i8> %va) nounwind {56; CHECK-LABEL: lsx_vsat_bu:57; CHECK: # %bb.0: # %entry58; CHECK-NEXT: vsat.bu $vr0, $vr0, 759; CHECK-NEXT: ret60entry:61 %res = call <16 x i8> @llvm.loongarch.lsx.vsat.bu(<16 x i8> %va, i32 7)62 ret <16 x i8> %res63}64 65declare <8 x i16> @llvm.loongarch.lsx.vsat.hu(<8 x i16>, i32)66 67define <8 x i16> @lsx_vsat_hu(<8 x i16> %va) nounwind {68; CHECK-LABEL: lsx_vsat_hu:69; CHECK: # %bb.0: # %entry70; CHECK-NEXT: vsat.hu $vr0, $vr0, 1571; CHECK-NEXT: ret72entry:73 %res = call <8 x i16> @llvm.loongarch.lsx.vsat.hu(<8 x i16> %va, i32 15)74 ret <8 x i16> %res75}76 77declare <4 x i32> @llvm.loongarch.lsx.vsat.wu(<4 x i32>, i32)78 79define <4 x i32> @lsx_vsat_wu(<4 x i32> %va) nounwind {80; CHECK-LABEL: lsx_vsat_wu:81; CHECK: # %bb.0: # %entry82; CHECK-NEXT: vsat.wu $vr0, $vr0, 3183; CHECK-NEXT: ret84entry:85 %res = call <4 x i32> @llvm.loongarch.lsx.vsat.wu(<4 x i32> %va, i32 31)86 ret <4 x i32> %res87}88 89declare <2 x i64> @llvm.loongarch.lsx.vsat.du(<2 x i64>, i32)90 91define <2 x i64> @lsx_vsat_du(<2 x i64> %va) nounwind {92; CHECK-LABEL: lsx_vsat_du:93; CHECK: # %bb.0: # %entry94; CHECK-NEXT: vsat.du $vr0, $vr0, 6395; CHECK-NEXT: ret96entry:97 %res = call <2 x i64> @llvm.loongarch.lsx.vsat.du(<2 x i64> %va, i32 63)98 ret <2 x i64> %res99}100