1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 3
2 ; RUN: llc --mtriple=loongarch64 --mattr=+lasx < %s | FileCheck %s
4 define void @fptosi_v8f32_v8i32(ptr %res, ptr %in){
5 ; CHECK-LABEL: fptosi_v8f32_v8i32:
7 ; CHECK-NEXT: xvld $xr0, $a1, 0
8 ; CHECK-NEXT: xvftintrz.w.s $xr0, $xr0
9 ; CHECK-NEXT: xvst $xr0, $a0, 0
11 %v0 = load <8 x float>, ptr %in
12 %v1 = fptosi <8 x float> %v0 to <8 x i32>
13 store <8 x i32> %v1, ptr %res
17 define void @fptosi_v4f64_v4i64(ptr %res, ptr %in){
18 ; CHECK-LABEL: fptosi_v4f64_v4i64:
20 ; CHECK-NEXT: xvld $xr0, $a1, 0
21 ; CHECK-NEXT: xvftintrz.l.d $xr0, $xr0
22 ; CHECK-NEXT: xvst $xr0, $a0, 0
24 %v0 = load <4 x double>, ptr %in
25 %v1 = fptosi <4 x double> %v0 to <4 x i64>
26 store <4 x i64> %v1, ptr %res
30 define void @fptosi_v4f64_v4i32(ptr %res, ptr %in){
31 ; CHECK-LABEL: fptosi_v4f64_v4i32:
33 ; CHECK-NEXT: xvld $xr0, $a1, 0
34 ; CHECK-NEXT: xvpermi.d $xr1, $xr0, 238
35 ; CHECK-NEXT: xvfcvt.s.d $xr0, $xr1, $xr0
36 ; CHECK-NEXT: xvftintrz.w.s $xr0, $xr0
37 ; CHECK-NEXT: vst $vr0, $a0, 0
39 %v0 = load <4 x double>, ptr %in
40 %v1 = fptosi <4 x double> %v0 to <4 x i32>
41 store <4 x i32> %v1, ptr %res
45 define void @fptosi_v4f32_v4i64(ptr %res, ptr %in){
46 ; CHECK-LABEL: fptosi_v4f32_v4i64:
48 ; CHECK-NEXT: vld $vr0, $a1, 0
49 ; CHECK-NEXT: vftintrz.w.s $vr0, $vr0
50 ; CHECK-NEXT: vext2xv.d.w $xr0, $xr0
51 ; CHECK-NEXT: xvst $xr0, $a0, 0
53 %v0 = load <4 x float>, ptr %in
54 %v1 = fptosi <4 x float> %v0 to <4 x i64>
55 store <4 x i64> %v1, ptr %res