1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py UTC_ARGS: --version 2
2 ; RUN: llc -mtriple=mips-- -mattr=+soft-float < %s | FileCheck -check-prefix=SOFT %s
4 define float @ldexp_f32(i8 zeroext %x) {
5 ; SOFT-LABEL: ldexp_f32:
7 ; SOFT-NEXT: addiu $sp, $sp, -24
8 ; SOFT-NEXT: .cfi_def_cfa_offset 24
9 ; SOFT-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
10 ; SOFT-NEXT: .cfi_offset 31, -4
11 ; SOFT-NEXT: move $5, $4
12 ; SOFT-NEXT: jal ldexpf
13 ; SOFT-NEXT: lui $4, 16256
14 ; SOFT-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
16 ; SOFT-NEXT: addiu $sp, $sp, 24
17 %zext = zext i8 %x to i32
18 %ldexp = call float @llvm.ldexp.f32.i32(float 1.000000e+00, i32 %zext)
22 define double @ldexp_f64(i8 zeroext %x) {
23 ; SOFT-LABEL: ldexp_f64:
25 ; SOFT-NEXT: addiu $sp, $sp, -24
26 ; SOFT-NEXT: .cfi_def_cfa_offset 24
27 ; SOFT-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
28 ; SOFT-NEXT: .cfi_offset 31, -4
29 ; SOFT-NEXT: move $6, $4
30 ; SOFT-NEXT: lui $4, 16368
31 ; SOFT-NEXT: jal ldexp
32 ; SOFT-NEXT: addiu $5, $zero, 0
33 ; SOFT-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
35 ; SOFT-NEXT: addiu $sp, $sp, 24
36 %zext = zext i8 %x to i32
37 %ldexp = call double @llvm.ldexp.f64.i32(double 1.000000e+00, i32 %zext)
41 define <2 x float> @ldexp_v2f32(<2 x float> %val, <2 x i32> %exp) {
42 ; SOFT-LABEL: ldexp_v2f32:
44 ; SOFT-NEXT: addiu $sp, $sp, -32
45 ; SOFT-NEXT: .cfi_def_cfa_offset 32
46 ; SOFT-NEXT: sw $ra, 28($sp) # 4-byte Folded Spill
47 ; SOFT-NEXT: sw $17, 24($sp) # 4-byte Folded Spill
48 ; SOFT-NEXT: sw $16, 20($sp) # 4-byte Folded Spill
49 ; SOFT-NEXT: .cfi_offset 31, -4
50 ; SOFT-NEXT: .cfi_offset 17, -8
51 ; SOFT-NEXT: .cfi_offset 16, -12
52 ; SOFT-NEXT: move $16, $6
53 ; SOFT-NEXT: move $17, $4
54 ; SOFT-NEXT: lw $5, 52($sp)
55 ; SOFT-NEXT: jal ldexpf
56 ; SOFT-NEXT: move $4, $7
57 ; SOFT-NEXT: lw $5, 48($sp)
58 ; SOFT-NEXT: sw $2, 4($17)
59 ; SOFT-NEXT: jal ldexpf
60 ; SOFT-NEXT: move $4, $16
61 ; SOFT-NEXT: sw $2, 0($17)
62 ; SOFT-NEXT: lw $16, 20($sp) # 4-byte Folded Reload
63 ; SOFT-NEXT: lw $17, 24($sp) # 4-byte Folded Reload
64 ; SOFT-NEXT: lw $ra, 28($sp) # 4-byte Folded Reload
66 ; SOFT-NEXT: addiu $sp, $sp, 32
67 %1 = call <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float> %val, <2 x i32> %exp)
71 define <4 x float> @ldexp_v4f32(<4 x float> %val, <4 x i32> %exp) {
72 ; SOFT-LABEL: ldexp_v4f32:
74 ; SOFT-NEXT: addiu $sp, $sp, -40
75 ; SOFT-NEXT: .cfi_def_cfa_offset 40
76 ; SOFT-NEXT: sw $ra, 36($sp) # 4-byte Folded Spill
77 ; SOFT-NEXT: sw $20, 32($sp) # 4-byte Folded Spill
78 ; SOFT-NEXT: sw $19, 28($sp) # 4-byte Folded Spill
79 ; SOFT-NEXT: sw $18, 24($sp) # 4-byte Folded Spill
80 ; SOFT-NEXT: sw $17, 20($sp) # 4-byte Folded Spill
81 ; SOFT-NEXT: sw $16, 16($sp) # 4-byte Folded Spill
82 ; SOFT-NEXT: .cfi_offset 31, -4
83 ; SOFT-NEXT: .cfi_offset 20, -8
84 ; SOFT-NEXT: .cfi_offset 19, -12
85 ; SOFT-NEXT: .cfi_offset 18, -16
86 ; SOFT-NEXT: .cfi_offset 17, -20
87 ; SOFT-NEXT: .cfi_offset 16, -24
88 ; SOFT-NEXT: move $16, $7
89 ; SOFT-NEXT: move $18, $4
90 ; SOFT-NEXT: lw $4, 60($sp)
91 ; SOFT-NEXT: lw $5, 76($sp)
92 ; SOFT-NEXT: jal ldexpf
93 ; SOFT-NEXT: move $17, $6
94 ; SOFT-NEXT: lw $19, 64($sp)
95 ; SOFT-NEXT: lw $20, 68($sp)
96 ; SOFT-NEXT: lw $5, 72($sp)
97 ; SOFT-NEXT: lw $4, 56($sp)
98 ; SOFT-NEXT: jal ldexpf
99 ; SOFT-NEXT: sw $2, 12($18)
100 ; SOFT-NEXT: sw $2, 8($18)
101 ; SOFT-NEXT: move $4, $16
102 ; SOFT-NEXT: jal ldexpf
103 ; SOFT-NEXT: move $5, $20
104 ; SOFT-NEXT: sw $2, 4($18)
105 ; SOFT-NEXT: move $4, $17
106 ; SOFT-NEXT: jal ldexpf
107 ; SOFT-NEXT: move $5, $19
108 ; SOFT-NEXT: sw $2, 0($18)
109 ; SOFT-NEXT: lw $16, 16($sp) # 4-byte Folded Reload
110 ; SOFT-NEXT: lw $17, 20($sp) # 4-byte Folded Reload
111 ; SOFT-NEXT: lw $18, 24($sp) # 4-byte Folded Reload
112 ; SOFT-NEXT: lw $19, 28($sp) # 4-byte Folded Reload
113 ; SOFT-NEXT: lw $20, 32($sp) # 4-byte Folded Reload
114 ; SOFT-NEXT: lw $ra, 36($sp) # 4-byte Folded Reload
116 ; SOFT-NEXT: addiu $sp, $sp, 40
117 %1 = call <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float> %val, <4 x i32> %exp)
121 define half @ldexp_f16(half %arg0, i32 %arg1) {
122 ; SOFT-LABEL: ldexp_f16:
124 ; SOFT-NEXT: addiu $sp, $sp, -24
125 ; SOFT-NEXT: .cfi_def_cfa_offset 24
126 ; SOFT-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
127 ; SOFT-NEXT: sw $16, 16($sp) # 4-byte Folded Spill
128 ; SOFT-NEXT: .cfi_offset 31, -4
129 ; SOFT-NEXT: .cfi_offset 16, -8
130 ; SOFT-NEXT: move $16, $5
131 ; SOFT-NEXT: jal __gnu_h2f_ieee
132 ; SOFT-NEXT: andi $4, $4, 65535
133 ; SOFT-NEXT: move $4, $2
134 ; SOFT-NEXT: jal ldexpf
135 ; SOFT-NEXT: move $5, $16
136 ; SOFT-NEXT: jal __gnu_f2h_ieee
137 ; SOFT-NEXT: move $4, $2
138 ; SOFT-NEXT: lw $16, 16($sp) # 4-byte Folded Reload
139 ; SOFT-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
141 ; SOFT-NEXT: addiu $sp, $sp, 24
142 %ldexp = call half @llvm.ldexp.f16.i32(half %arg0, i32 %arg1)
146 define x86_fp80 @ldexp_f80(x86_fp80 %arg0, i32 %arg1) {
147 ; SOFT-LABEL: ldexp_f80:
149 ; SOFT-NEXT: addiu $sp, $sp, -24
150 ; SOFT-NEXT: .cfi_def_cfa_offset 24
151 ; SOFT-NEXT: sw $ra, 20($sp) # 4-byte Folded Spill
152 ; SOFT-NEXT: .cfi_offset 31, -4
153 ; SOFT-NEXT: jal ldexpl
154 ; SOFT-NEXT: andi $4, $4, 65535
155 ; SOFT-NEXT: move $4, $2
156 ; SOFT-NEXT: addiu $2, $zero, 0
157 ; SOFT-NEXT: lw $ra, 20($sp) # 4-byte Folded Reload
159 ; SOFT-NEXT: addiu $sp, $sp, 24
160 %ldexp = call x86_fp80 @llvm.ldexp.f80.i32(x86_fp80 %arg0, i32 %arg1)
165 declare double @llvm.ldexp.f64.i32(double, i32) #0
166 declare float @llvm.ldexp.f32.i32(float, i32) #0
167 declare <2 x float> @llvm.ldexp.v2f32.v2i32(<2 x float>, <2 x i32>) #0
168 declare <4 x float> @llvm.ldexp.v4f32.v4i32(<4 x float>, <4 x i32>) #0
169 declare x86_fp80 @llvm.ldexp.f80.i32(x86_fp80, i32)
170 declare half @llvm.ldexp.f16.i32(half, i32) #0
172 attributes #0 = { nocallback nofree nosync nounwind speculatable willreturn memory(none) }