|
2 | 2 | // Use of this source code is governed by a BSD-style
|
3 | 3 | // license that can be found in the LICENSE file.
|
4 | 4 |
|
5 |
| -(AddPtr x y) -> (ADD x y) |
6 |
| -(Add32 x y) -> (ADD x y) |
7 |
| -(Add16 x y) -> (ADD x y) |
8 |
| -(Add8 x y) -> (ADD x y) |
9 |
| -(Add32F x y) -> (ADDF x y) |
10 |
| -(Add64F x y) -> (ADDD x y) |
11 |
| - |
| 5 | +(Add(Ptr|32|16|8) x y) -> (ADD x y) |
| 6 | +(Add(32|64)F x y) -> (ADD(F|D) x y) |
12 | 7 | (Add32carry x y) -> (ADDS x y)
|
13 | 8 | (Add32withcarry x y c) -> (ADC x y c)
|
14 | 9 |
|
15 |
| -(SubPtr x y) -> (SUB x y) |
16 |
| -(Sub32 x y) -> (SUB x y) |
17 |
| -(Sub16 x y) -> (SUB x y) |
18 |
| -(Sub8 x y) -> (SUB x y) |
19 |
| -(Sub32F x y) -> (SUBF x y) |
20 |
| -(Sub64F x y) -> (SUBD x y) |
21 |
| - |
| 10 | +(Sub(Ptr|32|16|8) x y) -> (SUB x y) |
| 11 | +(Sub(32|64)F x y) -> (SUB(F|D) x y) |
22 | 12 | (Sub32carry x y) -> (SUBS x y)
|
23 | 13 | (Sub32withcarry x y c) -> (SBC x y c)
|
24 | 14 |
|
25 |
| -(Mul32 x y) -> (MUL x y) |
26 |
| -(Mul16 x y) -> (MUL x y) |
27 |
| -(Mul8 x y) -> (MUL x y) |
28 |
| -(Mul32F x y) -> (MULF x y) |
29 |
| -(Mul64F x y) -> (MULD x y) |
30 |
| - |
31 |
| -(Hmul32 x y) -> (HMUL x y) |
32 |
| -(Hmul32u x y) -> (HMULU x y) |
33 |
| - |
| 15 | +(Mul(32|16|8) x y) -> (MUL x y) |
| 16 | +(Mul(32|64)F x y) -> (MUL(F|D) x y) |
| 17 | +(Hmul(32|32u) x y) -> (HMU(L|LU) x y) |
34 | 18 | (Mul32uhilo x y) -> (MULLU x y)
|
35 | 19 |
|
36 | 20 | (Div32 x y) ->
|
|
44 | 28 | (Div16u x y) -> (Div32u (ZeroExt16to32 x) (ZeroExt16to32 y))
|
45 | 29 | (Div8 x y) -> (Div32 (SignExt8to32 x) (SignExt8to32 y))
|
46 | 30 | (Div8u x y) -> (Div32u (ZeroExt8to32 x) (ZeroExt8to32 y))
|
47 |
| -(Div32F x y) -> (DIVF x y) |
48 |
| -(Div64F x y) -> (DIVD x y) |
| 31 | +(Div(32|64)F x y) -> (DIV(F|D) x y) |
49 | 32 |
|
50 | 33 | (Mod32 x y) ->
|
51 | 34 | (SUB (XOR <typ.UInt32> // negate the result if x is negative
|
|
62 | 45 | // (x + y) / 2 with x>=y -> (x - y) / 2 + y
|
63 | 46 | (Avg32u <t> x y) -> (ADD (SRLconst <t> (SUB <t> x y) [1]) y)
|
64 | 47 |
|
65 |
| -(And32 x y) -> (AND x y) |
66 |
| -(And16 x y) -> (AND x y) |
67 |
| -(And8 x y) -> (AND x y) |
68 |
| - |
69 |
| -(Or32 x y) -> (OR x y) |
70 |
| -(Or16 x y) -> (OR x y) |
71 |
| -(Or8 x y) -> (OR x y) |
72 |
| - |
73 |
| -(Xor32 x y) -> (XOR x y) |
74 |
| -(Xor16 x y) -> (XOR x y) |
75 |
| -(Xor8 x y) -> (XOR x y) |
| 48 | +(And(32|16|8) x y) -> (AND x y) |
| 49 | +(Or(32|16|8) x y) -> (OR x y) |
| 50 | +(Xor(32|16|8) x y) -> (XOR x y) |
76 | 51 |
|
77 | 52 | // unary ops
|
78 |
| -(Neg32 x) -> (RSBconst [0] x) |
79 |
| -(Neg16 x) -> (RSBconst [0] x) |
80 |
| -(Neg8 x) -> (RSBconst [0] x) |
81 |
| -(Neg32F x) -> (NEGF x) |
82 |
| -(Neg64F x) -> (NEGD x) |
| 53 | +(Neg(32|16|8) x) -> (RSBconst [0] x) |
| 54 | +(Neg(32|64)F x) -> (NEG(F|D) x) |
83 | 55 |
|
84 |
| -(Com32 x) -> (MVN x) |
85 |
| -(Com16 x) -> (MVN x) |
86 |
| -(Com8 x) -> (MVN x) |
| 56 | +(Com(32|16|8) x) -> (MVN x) |
87 | 57 |
|
88 | 58 | (Sqrt x) -> (SQRTD x)
|
89 | 59 |
|
|
225 | 195 | (Cvt32Fto64F x) -> (MOVFD x)
|
226 | 196 | (Cvt64Fto32F x) -> (MOVDF x)
|
227 | 197 |
|
228 |
| -(Round32F x) -> x |
229 |
| -(Round64F x) -> x |
| 198 | +(Round(32|64)F x) -> x |
230 | 199 |
|
231 | 200 | // comparisons
|
232 | 201 | (Eq8 x y) -> (Equal (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
233 | 202 | (Eq16 x y) -> (Equal (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
234 | 203 | (Eq32 x y) -> (Equal (CMP x y))
|
235 | 204 | (EqPtr x y) -> (Equal (CMP x y))
|
236 |
| -(Eq32F x y) -> (Equal (CMPF x y)) |
237 |
| -(Eq64F x y) -> (Equal (CMPD x y)) |
| 205 | +(Eq(32|64)F x y) -> (Equal (CMP(F|D) x y)) |
238 | 206 |
|
239 | 207 | (Neq8 x y) -> (NotEqual (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
240 | 208 | (Neq16 x y) -> (NotEqual (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
241 | 209 | (Neq32 x y) -> (NotEqual (CMP x y))
|
242 | 210 | (NeqPtr x y) -> (NotEqual (CMP x y))
|
243 |
| -(Neq32F x y) -> (NotEqual (CMPF x y)) |
244 |
| -(Neq64F x y) -> (NotEqual (CMPD x y)) |
| 211 | +(Neq(32|64)F x y) -> (NotEqual (CMP(F|D) x y)) |
245 | 212 |
|
246 | 213 | (Less8 x y) -> (LessThan (CMP (SignExt8to32 x) (SignExt8to32 y)))
|
247 | 214 | (Less16 x y) -> (LessThan (CMP (SignExt16to32 x) (SignExt16to32 y)))
|
248 | 215 | (Less32 x y) -> (LessThan (CMP x y))
|
249 |
| -(Less32F x y) -> (GreaterThan (CMPF y x)) // reverse operands to work around NaN |
250 |
| -(Less64F x y) -> (GreaterThan (CMPD y x)) // reverse operands to work around NaN |
| 216 | +(Less(32|64)F x y) -> (GreaterThan (CMP(F|D) y x)) // reverse operands to work around NaN |
251 | 217 |
|
252 | 218 | (Less8U x y) -> (LessThanU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
253 | 219 | (Less16U x y) -> (LessThanU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
|
256 | 222 | (Leq8 x y) -> (LessEqual (CMP (SignExt8to32 x) (SignExt8to32 y)))
|
257 | 223 | (Leq16 x y) -> (LessEqual (CMP (SignExt16to32 x) (SignExt16to32 y)))
|
258 | 224 | (Leq32 x y) -> (LessEqual (CMP x y))
|
259 |
| -(Leq32F x y) -> (GreaterEqual (CMPF y x)) // reverse operands to work around NaN |
260 |
| -(Leq64F x y) -> (GreaterEqual (CMPD y x)) // reverse operands to work around NaN |
| 225 | +(Leq(32|64)F x y) -> (GreaterEqual (CMP(F|D) y x)) // reverse operands to work around NaN |
261 | 226 |
|
262 | 227 | (Leq8U x y) -> (LessEqualU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
263 | 228 | (Leq16U x y) -> (LessEqualU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
|
266 | 231 | (Greater8 x y) -> (GreaterThan (CMP (SignExt8to32 x) (SignExt8to32 y)))
|
267 | 232 | (Greater16 x y) -> (GreaterThan (CMP (SignExt16to32 x) (SignExt16to32 y)))
|
268 | 233 | (Greater32 x y) -> (GreaterThan (CMP x y))
|
269 |
| -(Greater32F x y) -> (GreaterThan (CMPF x y)) |
270 |
| -(Greater64F x y) -> (GreaterThan (CMPD x y)) |
| 234 | +(Greater(32|64)F x y) -> (GreaterThan (CMP(F|D) x y)) |
271 | 235 |
|
272 | 236 | (Greater8U x y) -> (GreaterThanU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
273 | 237 | (Greater16U x y) -> (GreaterThanU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
|
276 | 240 | (Geq8 x y) -> (GreaterEqual (CMP (SignExt8to32 x) (SignExt8to32 y)))
|
277 | 241 | (Geq16 x y) -> (GreaterEqual (CMP (SignExt16to32 x) (SignExt16to32 y)))
|
278 | 242 | (Geq32 x y) -> (GreaterEqual (CMP x y))
|
279 |
| -(Geq32F x y) -> (GreaterEqual (CMPF x y)) |
280 |
| -(Geq64F x y) -> (GreaterEqual (CMPD x y)) |
| 243 | +(Geq(32|64)F x y) -> (GreaterEqual (CMP(F|D) x y)) |
281 | 244 |
|
282 | 245 | (Geq8U x y) -> (GreaterEqualU (CMP (ZeroExt8to32 x) (ZeroExt8to32 y)))
|
283 | 246 | (Geq16U x y) -> (GreaterEqualU (CMP (ZeroExt16to32 x) (ZeroExt16to32 y)))
|
|
0 commit comments