1 ; NOTE: Assertions have been autogenerated by utils/update_llc_test_checks.py
2 ; RUN: llc -mtriple=powerpc64le -mcpu=pwr9 < %s | FileCheck %s
4 define float @frem32(float %a, float %b) {
6 ; CHECK: # %bb.0: # %entry
8 ; CHECK-NEXT: stdu 1, -32(1)
9 ; CHECK-NEXT: std 0, 48(1)
10 ; CHECK-NEXT: .cfi_def_cfa_offset 32
11 ; CHECK-NEXT: .cfi_offset lr, 16
12 ; CHECK-NEXT: bl fmodf
14 ; CHECK-NEXT: addi 1, 1, 32
15 ; CHECK-NEXT: ld 0, 16(1)
19 %rem = frem fast float %a, %b
23 define double @frem64(double %a, double %b) {
24 ; CHECK-LABEL: frem64:
25 ; CHECK: # %bb.0: # %entry
27 ; CHECK-NEXT: stdu 1, -32(1)
28 ; CHECK-NEXT: std 0, 48(1)
29 ; CHECK-NEXT: .cfi_def_cfa_offset 32
30 ; CHECK-NEXT: .cfi_offset lr, 16
33 ; CHECK-NEXT: addi 1, 1, 32
34 ; CHECK-NEXT: ld 0, 16(1)
38 %rem = frem fast double %a, %b
42 define <4 x float> @frem4x32(<4 x float> %a, <4 x float> %b) {
43 ; CHECK-LABEL: frem4x32:
44 ; CHECK: # %bb.0: # %entry
46 ; CHECK-NEXT: stdu 1, -96(1)
47 ; CHECK-NEXT: std 0, 112(1)
48 ; CHECK-NEXT: .cfi_def_cfa_offset 96
49 ; CHECK-NEXT: .cfi_offset lr, 16
50 ; CHECK-NEXT: .cfi_offset v28, -64
51 ; CHECK-NEXT: .cfi_offset v29, -48
52 ; CHECK-NEXT: .cfi_offset v30, -32
53 ; CHECK-NEXT: .cfi_offset v31, -16
54 ; CHECK-NEXT: xxsldwi 0, 34, 34, 3
55 ; CHECK-NEXT: stxv 60, 32(1) # 16-byte Folded Spill
56 ; CHECK-NEXT: xscvspdpn 1, 0
57 ; CHECK-NEXT: xxsldwi 0, 35, 35, 3
58 ; CHECK-NEXT: stxv 61, 48(1) # 16-byte Folded Spill
59 ; CHECK-NEXT: stxv 62, 64(1) # 16-byte Folded Spill
60 ; CHECK-NEXT: stxv 63, 80(1) # 16-byte Folded Spill
61 ; CHECK-NEXT: xscvspdpn 2, 0
62 ; CHECK-NEXT: vmr 31, 3
63 ; CHECK-NEXT: vmr 30, 2
64 ; CHECK-NEXT: bl fmodf
66 ; CHECK-NEXT: xxsldwi 0, 62, 62, 1
67 ; CHECK-NEXT: xscpsgndp 61, 1, 1
68 ; CHECK-NEXT: xscvspdpn 1, 0
69 ; CHECK-NEXT: xxsldwi 0, 63, 63, 1
70 ; CHECK-NEXT: xscvspdpn 2, 0
71 ; CHECK-NEXT: bl fmodf
73 ; CHECK-NEXT: # kill: def $f1 killed $f1 def $vsl1
74 ; CHECK-NEXT: xxmrghd 0, 1, 61
75 ; CHECK-NEXT: xscvspdpn 1, 62
76 ; CHECK-NEXT: xscvspdpn 2, 63
77 ; CHECK-NEXT: xvcvdpsp 60, 0
78 ; CHECK-NEXT: bl fmodf
80 ; CHECK-NEXT: xxswapd 0, 62
81 ; CHECK-NEXT: xscpsgndp 61, 1, 1
82 ; CHECK-NEXT: xscvspdpn 1, 0
83 ; CHECK-NEXT: xxswapd 0, 63
84 ; CHECK-NEXT: xscvspdpn 2, 0
85 ; CHECK-NEXT: bl fmodf
87 ; CHECK-NEXT: # kill: def $f1 killed $f1 def $vsl1
88 ; CHECK-NEXT: xxmrghd 0, 61, 1
89 ; CHECK-NEXT: lxv 63, 80(1) # 16-byte Folded Reload
90 ; CHECK-NEXT: lxv 62, 64(1) # 16-byte Folded Reload
91 ; CHECK-NEXT: lxv 61, 48(1) # 16-byte Folded Reload
92 ; CHECK-NEXT: xvcvdpsp 34, 0
93 ; CHECK-NEXT: vmrgew 2, 2, 28
94 ; CHECK-NEXT: lxv 60, 32(1) # 16-byte Folded Reload
95 ; CHECK-NEXT: addi 1, 1, 96
96 ; CHECK-NEXT: ld 0, 16(1)
100 %rem = frem fast <4 x float> %a, %b
104 define <2 x double> @frem2x64(<2 x double> %a, <2 x double> %b) {
105 ; CHECK-LABEL: frem2x64:
106 ; CHECK: # %bb.0: # %entry
108 ; CHECK-NEXT: stdu 1, -80(1)
109 ; CHECK-NEXT: std 0, 96(1)
110 ; CHECK-NEXT: .cfi_def_cfa_offset 80
111 ; CHECK-NEXT: .cfi_offset lr, 16
112 ; CHECK-NEXT: .cfi_offset v29, -48
113 ; CHECK-NEXT: .cfi_offset v30, -32
114 ; CHECK-NEXT: .cfi_offset v31, -16
115 ; CHECK-NEXT: stxv 62, 48(1) # 16-byte Folded Spill
116 ; CHECK-NEXT: stxv 63, 64(1) # 16-byte Folded Spill
117 ; CHECK-NEXT: vmr 31, 3
118 ; CHECK-NEXT: xscpsgndp 2, 63, 63
119 ; CHECK-NEXT: vmr 30, 2
120 ; CHECK-NEXT: xscpsgndp 1, 62, 62
121 ; CHECK-NEXT: stxv 61, 32(1) # 16-byte Folded Spill
122 ; CHECK-NEXT: bl fmod
124 ; CHECK-NEXT: xscpsgndp 61, 1, 1
125 ; CHECK-NEXT: xxswapd 1, 62
126 ; CHECK-NEXT: xxswapd 2, 63
127 ; CHECK-NEXT: # kill: def $f1 killed $f1 killed $vsl1
128 ; CHECK-NEXT: # kill: def $f2 killed $f2 killed $vsl2
129 ; CHECK-NEXT: bl fmod
131 ; CHECK-NEXT: # kill: def $f1 killed $f1 def $vsl1
132 ; CHECK-NEXT: xxmrghd 34, 61, 1
133 ; CHECK-NEXT: lxv 63, 64(1) # 16-byte Folded Reload
134 ; CHECK-NEXT: lxv 62, 48(1) # 16-byte Folded Reload
135 ; CHECK-NEXT: lxv 61, 32(1) # 16-byte Folded Reload
136 ; CHECK-NEXT: addi 1, 1, 80
137 ; CHECK-NEXT: ld 0, 16(1)
141 %rem = frem fast <2 x double> %a, %b
142 ret <2 x double> %rem