blob: 99f21a117d571dd0a910a3482872065f38d55afd [file] [log] [blame]
Sanjay Patel594c1542018-03-28 00:49:12 +00001; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2; RUN: llc -mcpu=pwr8 -mtriple=powerpc64le-unknown-unknown -verify-machineinstrs < %s | FileCheck %s
3
4define <4 x float> @truncf32(<4 x float> %a) {
5; CHECK-LABEL: truncf32:
6; CHECK: # %bb.0:
7; CHECK-NEXT: xvcvspsxws 0, 34
8; CHECK-NEXT: xvcvsxwsp 34, 0
9; CHECK-NEXT: blr
10 %t0 = fptosi <4 x float> %a to <4 x i32>
11 %t1 = sitofp <4 x i32> %t0 to <4 x float>
12 ret <4 x float> %t1
13}
14
15define <2 x double> @truncf64(<2 x double> %a) {
16; CHECK-LABEL: truncf64:
17; CHECK: # %bb.0:
18; CHECK-NEXT: xvcvdpsxds 34, 34
19; CHECK-NEXT: xvcvsxddp 34, 34
20; CHECK-NEXT: blr
21 %t0 = fptosi <2 x double> %a to <2 x i64>
22 %t1 = sitofp <2 x i64> %t0 to <2 x double>
23 ret <2 x double> %t1
24}
25
26define <4 x float> @truncf32u(<4 x float> %a) {
27; CHECK-LABEL: truncf32u:
28; CHECK: # %bb.0:
29; CHECK-NEXT: xvcvspuxws 0, 34
30; CHECK-NEXT: xvcvuxwsp 34, 0
31; CHECK-NEXT: blr
32 %t0 = fptoui <4 x float> %a to <4 x i32>
33 %t1 = uitofp <4 x i32> %t0 to <4 x float>
34 ret <4 x float> %t1
35}
36
37define <2 x double> @truncf64u(<2 x double> %a) {
38; CHECK-LABEL: truncf64u:
39; CHECK: # %bb.0:
40; CHECK-NEXT: xvcvdpuxds 34, 34
41; CHECK-NEXT: xvcvuxddp 34, 34
42; CHECK-NEXT: blr
43 %t0 = fptoui <2 x double> %a to <2 x i64>
44 %t1 = uitofp <2 x i64> %t0 to <2 x double>
45 ret <2 x double> %t1
46}
47