xref: /aosp_15_r20/external/llvm/test/CodeGen/PowerPC/fast-isel-conversion-p5.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc < %s -O0 -verify-machineinstrs -fast-isel-abort=1 -mtriple=powerpc64-unknown-linux-gnu -mcpu=pwr5 | FileCheck %s --check-prefix=ELF64
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; Test sitofp
4*9880d681SAndroid Build Coastguard Worker
5*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i32(i32 %a, double %b) nounwind {
6*9880d681SAndroid Build Coastguard Workerentry:
7*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i32
8*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
9*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i32 %a to double
10*9880d681SAndroid Build Coastguard Worker; ELF64: std {{[0-9]+}}, -[[OFFSET:[0-9]+]](1)
11*9880d681SAndroid Build Coastguard Worker; ELF64: lfd {{[0-9]+}}, -[[OFFSET]](1)
12*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
13*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
14*9880d681SAndroid Build Coastguard Worker  ret void
15*9880d681SAndroid Build Coastguard Worker}
16*9880d681SAndroid Build Coastguard Worker
17*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i64(i64 %a, double %b) nounwind {
18*9880d681SAndroid Build Coastguard Workerentry:
19*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i64
20*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
21*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i64 %a to double
22*9880d681SAndroid Build Coastguard Worker; ELF64: std {{[0-9]+}}, -[[OFFSET:[0-9]+]](1)
23*9880d681SAndroid Build Coastguard Worker; ELF64: lfd {{[0-9]+}}, -[[OFFSET]](1)
24*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
25*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
26*9880d681SAndroid Build Coastguard Worker  ret void
27*9880d681SAndroid Build Coastguard Worker}
28*9880d681SAndroid Build Coastguard Worker
29*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i16(i16 %a, double %b) nounwind {
30*9880d681SAndroid Build Coastguard Workerentry:
31*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i16
32*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
33*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i16 %a to double
34*9880d681SAndroid Build Coastguard Worker; ELF64: extsh
35*9880d681SAndroid Build Coastguard Worker; ELF64: std {{[0-9]+}}, -[[OFFSET:[0-9]+]](1)
36*9880d681SAndroid Build Coastguard Worker; ELF64: lfd {{[0-9]+}}, -[[OFFSET]](1)
37*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
38*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
39*9880d681SAndroid Build Coastguard Worker  ret void
40*9880d681SAndroid Build Coastguard Worker}
41*9880d681SAndroid Build Coastguard Worker
42*9880d681SAndroid Build Coastguard Workerdefine void @sitofp_double_i8(i8 %a, double %b) nounwind {
43*9880d681SAndroid Build Coastguard Workerentry:
44*9880d681SAndroid Build Coastguard Worker; ELF64: sitofp_double_i8
45*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca double, align 8
46*9880d681SAndroid Build Coastguard Worker  %conv = sitofp i8 %a to double
47*9880d681SAndroid Build Coastguard Worker; ELF64: extsb
48*9880d681SAndroid Build Coastguard Worker; ELF64: std {{[0-9]+}}, -[[OFFSET:[0-9]+]](1)
49*9880d681SAndroid Build Coastguard Worker; ELF64: lfd {{[0-9]+}}, -[[OFFSET]](1)
50*9880d681SAndroid Build Coastguard Worker; ELF64: fcfid
51*9880d681SAndroid Build Coastguard Worker  store double %conv, double* %b.addr, align 8
52*9880d681SAndroid Build Coastguard Worker  ret void
53*9880d681SAndroid Build Coastguard Worker}
54*9880d681SAndroid Build Coastguard Worker
55*9880d681SAndroid Build Coastguard Worker; Test fptosi
56*9880d681SAndroid Build Coastguard Worker
57*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_float_i32(float %a) nounwind {
58*9880d681SAndroid Build Coastguard Workerentry:
59*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_float_i32
60*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 4
61*9880d681SAndroid Build Coastguard Worker  %conv = fptosi float %a to i32
62*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwz
63*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
64*9880d681SAndroid Build Coastguard Worker; ELF64: lwa
65*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 4
66*9880d681SAndroid Build Coastguard Worker  ret void
67*9880d681SAndroid Build Coastguard Worker}
68*9880d681SAndroid Build Coastguard Worker
69*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_float_i64(float %a) nounwind {
70*9880d681SAndroid Build Coastguard Workerentry:
71*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_float_i64
72*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 4
73*9880d681SAndroid Build Coastguard Worker  %conv = fptosi float %a to i64
74*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
75*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
76*9880d681SAndroid Build Coastguard Worker; ELF64: ld
77*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 4
78*9880d681SAndroid Build Coastguard Worker  ret void
79*9880d681SAndroid Build Coastguard Worker}
80*9880d681SAndroid Build Coastguard Worker
81*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_double_i32(double %a) nounwind {
82*9880d681SAndroid Build Coastguard Workerentry:
83*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_double_i32
84*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 8
85*9880d681SAndroid Build Coastguard Worker  %conv = fptosi double %a to i32
86*9880d681SAndroid Build Coastguard Worker; ELF64: fctiwz
87*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
88*9880d681SAndroid Build Coastguard Worker; ELF64: lwa
89*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 8
90*9880d681SAndroid Build Coastguard Worker  ret void
91*9880d681SAndroid Build Coastguard Worker}
92*9880d681SAndroid Build Coastguard Worker
93*9880d681SAndroid Build Coastguard Workerdefine void @fptosi_double_i64(double %a) nounwind {
94*9880d681SAndroid Build Coastguard Workerentry:
95*9880d681SAndroid Build Coastguard Worker; ELF64: fptosi_double_i64
96*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i64, align 8
97*9880d681SAndroid Build Coastguard Worker  %conv = fptosi double %a to i64
98*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
99*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
100*9880d681SAndroid Build Coastguard Worker; ELF64: ld
101*9880d681SAndroid Build Coastguard Worker  store i64 %conv, i64* %b.addr, align 8
102*9880d681SAndroid Build Coastguard Worker  ret void
103*9880d681SAndroid Build Coastguard Worker}
104*9880d681SAndroid Build Coastguard Worker
105*9880d681SAndroid Build Coastguard Worker; Test fptoui
106*9880d681SAndroid Build Coastguard Worker
107*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_float_i32(float %a) nounwind {
108*9880d681SAndroid Build Coastguard Workerentry:
109*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_float_i32
110*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 4
111*9880d681SAndroid Build Coastguard Worker  %conv = fptoui float %a to i32
112*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
113*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
114*9880d681SAndroid Build Coastguard Worker; ELF64: lwz
115*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 4
116*9880d681SAndroid Build Coastguard Worker  ret void
117*9880d681SAndroid Build Coastguard Worker}
118*9880d681SAndroid Build Coastguard Worker
119*9880d681SAndroid Build Coastguard Workerdefine void @fptoui_double_i32(double %a) nounwind {
120*9880d681SAndroid Build Coastguard Workerentry:
121*9880d681SAndroid Build Coastguard Worker; ELF64: fptoui_double_i32
122*9880d681SAndroid Build Coastguard Worker  %b.addr = alloca i32, align 8
123*9880d681SAndroid Build Coastguard Worker  %conv = fptoui double %a to i32
124*9880d681SAndroid Build Coastguard Worker; ELF64: fctidz
125*9880d681SAndroid Build Coastguard Worker; ELF64: stfd
126*9880d681SAndroid Build Coastguard Worker; ELF64: lwz
127*9880d681SAndroid Build Coastguard Worker  store i32 %conv, i32* %b.addr, align 8
128*9880d681SAndroid Build Coastguard Worker  ret void
129*9880d681SAndroid Build Coastguard Worker}
130*9880d681SAndroid Build Coastguard Worker
131