1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
2 ; RUN: -mcpu=a2 | FileCheck %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
4 ; RUN: -mcpu=pwr7 -mattr=+vsx | FileCheck -check-prefix=CHECK-VSX %s
5 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
7 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu \
8 ; RUN: -mcpu=pwr9 -mattr=-direct-move | FileCheck -check-prefix=CHECK-P9 %s
9 target datalayout = "E-p:64:64:64-i1:8:8-i8:8:8-i16:16:16-i32:32:32-i64:64:64-f32:32:32-f64:64:64-f128:128:128-v128:128:128-n32:64"
10 target triple = "powerpc64-unknown-linux-gnu"
12 define i64 @foo(float %a) nounwind {
13 %x = fptosi float %a to i64
17 ; CHECK: fctidz [[REG:[0-9]+]], 1
18 ; CHECK: stfd [[REG]],
23 ; CHECK-VSX: xscvdpsxds [[REG:[0-9]+]], 1
24 ; CHECK-VSX: stfd [[REG]],
28 ; CHECK-LABEL-P9: @foo
29 ; CHECK-P9: xscvdpsxds [[REG:[0-9]+]], 1
30 ; CHECK-P9: stfd [[REG]],
35 define i64 @foo2(double %a) nounwind {
36 %x = fptosi double %a to i64
40 ; CHECK: fctidz [[REG:[0-9]+]], 1
41 ; CHECK: stfd [[REG]],
46 ; CHECK-VSX: xscvdpsxds [[REG:[0-9]+]], 1
47 ; CHECK-VSX: stfd [[REG]],
51 ; CHECK-LABEL-P9: @foo2
52 ; CHECK-P9: xscvdpsxds [[REG:[0-9]+]], 1
53 ; CHECK-P9: stfd [[REG]],
58 define i64 @foo3(float %a) nounwind {
59 %x = fptoui float %a to i64
63 ; CHECK: fctiduz [[REG:[0-9]+]], 1
64 ; CHECK: stfd [[REG]],
69 ; CHECK-VSX: xscvdpuxds [[REG:[0-9]+]], 1
70 ; CHECK-VSX: stfd [[REG]],
74 ; CHECK-LABEL-P9: @foo3
75 ; CHECK-P9: xscvdpuxds [[REG:[0-9]+]], 1
76 ; CHECK-P9: stfd [[REG]],
81 define i64 @foo4(double %a) nounwind {
82 %x = fptoui double %a to i64
86 ; CHECK: fctiduz [[REG:[0-9]+]], 1
87 ; CHECK: stfd [[REG]],
92 ; CHECK-VSX: xscvdpuxds [[REG:[0-9]+]], 1
93 ; CHECK-VSX: stfd [[REG]],
97 ; CHECK-LABEL-P9: @foo4
98 ; CHECK-P9: xscvdpuxds [[REG:[0-9]+]], 1
99 ; CHECK-P9: stfd [[REG]],
104 define i32 @goo(float %a) nounwind {
105 %x = fptosi float %a to i32
109 ; CHECK: fctiwz [[REG:[0-9]+]], 1
110 ; CHECK: stfiwx [[REG]],
115 ; CHECK-VSX: xscvdpsxws [[REG:[0-9]+]], 1
116 ; CHECK-VSX: stfiwx [[REG]],
121 define i32 @goo2(double %a) nounwind {
122 %x = fptosi double %a to i32
126 ; CHECK: fctiwz [[REG:[0-9]+]], 1
127 ; CHECK: stfiwx [[REG]],
132 ; CHECK-VSX: xscvdpsxws [[REG:[0-9]+]], 1
133 ; CHECK-VSX: stfiwx [[REG]],
138 define i32 @goo3(float %a) nounwind {
139 %x = fptoui float %a to i32
143 ; CHECK: fctiwuz [[REG:[0-9]+]], 1
144 ; CHECK: stfiwx [[REG]],
149 ; CHECK-VSX: xscvdpuxws [[REG:[0-9]+]], 1
150 ; CHECK-VSX: stfiwx [[REG]],
155 define i32 @goo4(double %a) nounwind {
156 %x = fptoui double %a to i32
160 ; CHECK: fctiwuz [[REG:[0-9]+]], 1
161 ; CHECK: stfiwx [[REG]],
166 ; CHECK-VSX: xscvdpuxws [[REG:[0-9]+]], 1
167 ; CHECK-VSX: stfiwx [[REG]],