10
10
// 4K (smallest case) page size offset mask for PPC64.
11
11
#define PAGE_OFFSET 4095
12
12
13
- // TODO: At writing , ISEL and BC do not support CR bit type arguments ,
14
- // define them here for readability.
15
- #define CR0LT 4 * 0 + 0
16
- #define CR0EQ 4 * 0 + 2
17
- #define CR1LT 4 * 1 + 0
18
- #define CR6LT 4 * 6 + 0
19
-
20
13
// Likewise, the BC opcode is hard to read, and no extended
21
14
// mnemonics are offered for these forms.
22
15
#define BGELR_CR6 BC 4 , CR6LT, (LR)
@@ -90,7 +83,7 @@ loop64:
90
83
ADD $64 ,R4
91
84
BDNZ loop64
92
85
93
- ISEL $ CR0EQ , R11 , R3 , R3 // If no tail , return 1 , otherwise R3 remains 0 .
86
+ ISEL CR0EQ, R11, R3, R3 // If no tail, return 1, otherwise R3 remains 0.
94
87
BEQLR // return if no tail.
95
88
96
89
ADD $-64 , R9, R8
@@ -110,7 +103,7 @@ loop64:
110
103
LXVD2X (R8+R16), V0
111
104
LXVD2X (R4+R16), V1
112
105
VCMPEQUBCC V0, V1, V2
113
- ISEL $ CR6LT , R11 , R0 , R3
106
+ ISEL CR6LT, R11, R0, R3
114
107
RET
115
108
116
109
check33_64:
@@ -138,30 +131,38 @@ check17_32:
138
131
LXVD2X (R8+R0), V0
139
132
LXVD2X (R4+R0), V1
140
133
VCMPEQUBCC V0, V1, V2
141
- ISEL $ CR6LT , R11 , R0 , R5
134
+ ISEL CR6LT, R11, R0, R5
142
135
143
136
// Load sX[len(sX)-16:len(sX)] and compare.
144
137
ADD $-16 , R9
145
138
ADD $-16 , R10
146
139
LXVD2X (R9+R0), V0
147
140
LXVD2X (R10+R0), V1
148
141
VCMPEQUBCC V0, V1, V2
149
- ISEL $ CR6LT , R5 , R0 , R3
142
+ ISEL CR6LT, R5, R0, R3
150
143
RET
151
144
152
145
check0_16:
146
+ #ifdef GOPPC64_power10
147
+ SLD $56 , R5, R7
148
+ LXVL R8, R7, V0
149
+ LXVL R4, R7, V1
150
+ VCMPEQUDCC V0, V1, V2
151
+ ISEL CR6LT, R11, R0, R3
152
+ RET
153
+ #else
153
154
CMP R5, $8
154
155
BLT check0_7
155
156
// Load sX[0:7] and compare.
156
157
MOVD (R8), R6
157
158
MOVD (R4), R7
158
159
CMP R6, R7
159
- ISEL $ CR0EQ , R11 , R0 , R5
160
+ ISEL CR0EQ, R11, R0, R5
160
161
// Load sX[len(sX)-8:len(sX)] and compare.
161
162
MOVD -8 (R9), R6
162
163
MOVD -8 (R10), R7
163
164
CMP R6, R7
164
- ISEL $ CR0EQ , R5 , R0 , R3
165
+ ISEL CR0EQ, R5, R0, R3
165
166
RET
166
167
167
168
check0_7:
@@ -183,8 +184,8 @@ check0_7:
183
184
CMPU R9, R12, CR0
184
185
SUB R12, R8, R6 // compute lower load address
185
186
SUB R12, R4, R9
186
- ISEL $ CR1LT , R8 , R6 , R8 // R8 = R6 < 0 ? R8 (&s1) : R6 (&s1 - ( 8 - len))
187
- ISEL $ CR0LT , R4 , R9 , R4 // Similar for s2
187
+ ISEL CR1LT, R8, R6, R8 // R8 = R6 < 0 ? R8 (&s1) : R6 (&s1 - (8-len))
188
+ ISEL CR0LT, R4, R9, R4 // Similar for s2
188
189
MOVD (R8), R15
189
190
MOVD (R4), R16
190
191
SLD R14, R15, R7
@@ -194,12 +195,13 @@ check0_7:
194
195
SRD R14, R15, R6 // Clear the lower (8-len) bytes
195
196
SRD R14, R16, R9
196
197
#ifdef GOARCH_ppc64le
197
- ISEL $ CR1LT , R7 , R6 , R8 // Choose the correct len bytes to compare based on alignment
198
- ISEL $ CR0LT , R17 , R9 , R4
198
+ ISEL CR1LT, R7, R6, R8 // Choose the correct len bytes to compare based on alignment
199
+ ISEL CR0LT, R17, R9, R4
199
200
#else
200
- ISEL $ CR1LT , R6 , R7 , R8
201
- ISEL $ CR0LT , R9 , R17 , R4
201
+ ISEL CR1LT, R6, R7, R8
202
+ ISEL CR0LT, R9, R17, R4
202
203
#endif
203
204
CMP R4, R8
204
- ISEL $ CR0EQ , R11 , R0 , R3
205
+ ISEL CR0EQ, R11, R0, R3
205
206
RET
207
+ #endif // tail processing if !defined(GOPPC64_power10)
0 commit comments