1 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=g5 | FileCheck %s
2 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr6 | FileCheck -check-prefix=CHECK-PWR6 %s
3 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=a2 | FileCheck -check-prefix=CHECK-A2 %s
4 ; RUN: llc -verify-machineinstrs < %s -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr7 -mattr=+vsx | FileCheck -check-prefix=CHECK-VSX %s
5 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"
6 target triple = "powerpc64-unknown-linux-gnu"
8 define float @foo(i32 %a) nounwind {
10 %x = sitofp i32 %a to float
14 ; CHECK: extsw [[REG:[0-9]+]], 3
16 ; CHECK: lfd [[REG2:[0-9]+]],
17 ; CHECK: fcfid [[REG3:[0-9]+]], [[REG2]]
18 ; CHECK: frsp 1, [[REG3]]
23 ; CHECK-PWR6: lfiwax [[REG:[0-9]+]],
24 ; CHECK-PWR6: fcfid [[REG2:[0-9]+]], [[REG]]
25 ; CHECK-PWR6: frsp 1, [[REG2]]
30 ; CHECK-A2: lfiwax [[REG:[0-9]+]],
31 ; CHECK-A2: fcfids 1, [[REG]]
36 ; CHECK-VSX: lfiwax [[REG:[0-9]+]],
37 ; CHECK-VSX: fcfids 1, [[REG]]
41 define double @goo(i32 %a) nounwind {
43 %x = sitofp i32 %a to double
47 ; CHECK: extsw [[REG:[0-9]+]], 3
49 ; CHECK: lfd [[REG2:[0-9]+]],
50 ; CHECK: fcfid 1, [[REG2]]
55 ; CHECK-PWR6: lfiwax [[REG:[0-9]+]],
56 ; CHECK-PWR6: fcfid 1, [[REG]]
61 ; CHECK-A2: lfiwax [[REG:[0-9]+]],
62 ; CHECK-A2: fcfid 1, [[REG]]
67 ; CHECK-VSX: lfiwax [[REG:[0-9]+]],
68 ; CHECK-VSX: xscvsxddp 1, [[REG]]
72 define float @foou(i32 %a) nounwind {
74 %x = uitofp i32 %a to float
79 ; CHECK-A2: lfiwzx [[REG:[0-9]+]],
80 ; CHECK-A2: fcfidus 1, [[REG]]
85 ; CHECK-VSX: lfiwzx [[REG:[0-9]+]],
86 ; CHECK-VSX: fcfidus 1, [[REG]]
90 define double @goou(i32 %a) nounwind {
92 %x = uitofp i32 %a to double
97 ; CHECK-A2: lfiwzx [[REG:[0-9]+]],
98 ; CHECK-A2: fcfidu 1, [[REG]]
103 ; CHECK-VSX: lfiwzx [[REG:[0-9]+]],
104 ; CHECK-VSX: xscvuxddp 1, [[REG]]