|
756 | 756 | (rule (lower (fcmp cc a b @ (value_type (ty_scalar_float ty))))
|
757 | 757 | (lower_fcmp ty cc a b))
|
758 | 758 |
|
| 759 | +(rule 1 (lower (fcmp cc a b @ (value_type (ty_vec128 ty)))) |
| 760 | + (lower_vfcmp ty cc a b)) |
| 761 | + |
759 | 762 | (decl lower_fcmp (Type FloatCC Value Value) XReg)
|
760 | 763 |
|
761 | 764 | (rule (lower_fcmp $F32 (FloatCC.Equal) a b) (pulley_feq32 a b))
|
|
787 | 790 | (if-let true (floatcc_unordered cc))
|
788 | 791 | (pulley_xbxor32_s8 (lower_fcmp ty (floatcc_complement cc) a b) 1))
|
789 | 792 |
|
| 793 | +(decl lower_vfcmp (Type FloatCC Value Value) VReg) |
| 794 | + |
| 795 | +(rule (lower_vfcmp $F32X4 (FloatCC.Equal) a b) (pulley_veqf32x4 a b)) |
| 796 | +(rule (lower_vfcmp $F64X2 (FloatCC.Equal) a b) (pulley_veqf64x2 a b)) |
| 797 | +(rule (lower_vfcmp $F32X4 (FloatCC.NotEqual) a b) (pulley_vneqf32x4 a b)) |
| 798 | +(rule (lower_vfcmp $F64X2 (FloatCC.NotEqual) a b) (pulley_vneqf64x2 a b)) |
| 799 | +(rule (lower_vfcmp $F32X4 (FloatCC.LessThan) a b) (pulley_vltf32x4 a b)) |
| 800 | +(rule (lower_vfcmp $F64X2 (FloatCC.LessThan) a b) (pulley_vltf64x2 a b)) |
| 801 | +(rule (lower_vfcmp $F32X4 (FloatCC.LessThanOrEqual) a b) (pulley_vlteqf32x4 a b)) |
| 802 | +(rule (lower_vfcmp $F64X2 (FloatCC.LessThanOrEqual) a b) (pulley_vlteqf64x2 a b)) |
| 803 | + |
| 804 | +(rule (lower_vfcmp ty (FloatCC.Unordered) a b) |
| 805 | + (pulley_vbor128 |
| 806 | + (lower_vfcmp ty (FloatCC.NotEqual) a a) |
| 807 | + (lower_vfcmp ty (FloatCC.NotEqual) b b))) |
| 808 | + |
| 809 | +;; NB: Pulley doesn't have lowerings for `Ordered` or `Unordered*` `FloatCC` |
| 810 | +;; conditions as that's not needed by wasm at this time. |
| 811 | + |
| 812 | +;; Pulley doesn't have instructions for `>` and `>=`, so we have to reverse the |
| 813 | +;; operation. |
| 814 | +(rule (lower_vfcmp ty (FloatCC.GreaterThan) a b) |
| 815 | + (lower_vfcmp ty (FloatCC.LessThan) b a)) |
| 816 | +(rule (lower_vfcmp ty (FloatCC.GreaterThanOrEqual) a b) |
| 817 | + (lower_vfcmp ty (FloatCC.LessThanOrEqual) b a)) |
| 818 | + |
790 | 819 | ;;;; Rules for `load` and friends ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
791 | 820 |
|
792 | 821 | (decl amode (Value Offset32) Amode)
|
|
1203 | 1232 | (pulley_vfloor32x4 a))
|
1204 | 1233 | (rule (lower (has_type $F64X2 (floor a)))
|
1205 | 1234 | (pulley_vfloor64x2 a))
|
| 1235 | + |
1206 | 1236 | ;;;; Rules for `ceil` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1207 | 1237 |
|
1208 | 1238 | (rule (lower (has_type $F32 (ceil a))) (pulley_fceil32 a))
|
|
1230 | 1260 | (rule (lower (has_type $F64X2 (sqrt a)))
|
1231 | 1261 | (pulley_vsqrt64x2 a))
|
1232 | 1262 |
|
1233 |
| - |
1234 | 1263 | ;;;; Rules for `fneg` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1235 | 1264 |
|
1236 | 1265 | (rule (lower (has_type $F32 (fneg a))) (pulley_fneg32 a))
|
|
1407 | 1436 | (rule (lower (scalar_to_vector a @ (value_type $F64)))
|
1408 | 1437 | (pulley_vinsertf64 (pulley_vconst128 0) a 0))
|
1409 | 1438 |
|
1410 |
| -;;;; Rules for `shuffle` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1439 | +;;;; Rules for `shuffle` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
1411 | 1440 |
|
1412 | 1441 | (rule (lower (has_type $I8X16 (shuffle a b (u128_from_immediate mask))))
|
1413 | 1442 | (pulley_vshuffle a b mask))
|
1414 | 1443 |
|
1415 | 1444 | ;;;; Rules for `swizzle` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
1416 | 1445 |
|
1417 | 1446 | (rule 1 (lower (has_type $I8X16 (swizzle a b))) (pulley_vswizzlei8x16 a b))
|
| 1447 | + |
| 1448 | +;;;; Rules for `fma` ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; |
| 1449 | + |
| 1450 | +(rule (lower (has_type $F32X4 (fma a b c))) (pulley_vfma32x4 a b c)) |
| 1451 | +(rule (lower (has_type $F64X2 (fma a b c))) (pulley_vfma64x2 a b c)) |
0 commit comments