[PATCH] D127157: [WebAssembly][NFC] RelaxedBinary tablegen multiclass for relaxed SIMD
Thomas Lively via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Jun 6 17:56:52 PDT 2022
This revision was automatically updated to reflect the committed changes.
Closed by commit rG576b8245c838: [WebAssembly][NFC] RelaxedBinary tablegen multiclass for relaxed SIMD (authored by tlively).
Repository:
rG LLVM Github Monorepo
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D127157/new/
https://reviews.llvm.org/D127157
Files:
llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
Index: llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
===================================================================
--- llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
+++ llvm/lib/Target/WebAssembly/WebAssemblyInstrSIMD.td
@@ -1347,21 +1347,21 @@
// Relaxed floating-point to int conversions
//===----------------------------------------------------------------------===//
-multiclass SIMD_RELAXED_CONVERT<Vec vec, Vec arg, SDPatternOperator op, string name, bits<32> simdop> {
+multiclass RelaxedConvert<Vec vec, Vec arg, SDPatternOperator op, string name, bits<32> simdop> {
defm op#_#vec :
RELAXED_I<(outs V128:$dst), (ins V128:$vec), (outs), (ins),
[(set (vec.vt V128:$dst), (vec.vt (op (arg.vt V128:$vec))))],
vec.prefix#"."#name#"\t$dst, $vec", vec.prefix#"."#name, simdop>;
}
-defm "" : SIMD_RELAXED_CONVERT<I32x4, F32x4, int_wasm_relaxed_trunc_signed,
- "relaxed_trunc_f32x4_s", 0x101>;
-defm "" : SIMD_RELAXED_CONVERT<I32x4, F32x4, int_wasm_relaxed_trunc_unsigned,
- "relaxed_trunc_f32x4_u", 0x102>;
-defm "" : SIMD_RELAXED_CONVERT<I32x4, F64x2, int_wasm_relaxed_trunc_signed_zero,
- "relaxed_trunc_f64x2_s_zero", 0x103>;
-defm "" : SIMD_RELAXED_CONVERT<I32x4, F64x2, int_wasm_relaxed_trunc_unsigned_zero,
- "relaxed_trunc_f64x2_u_zero", 0x104>;
+defm "" : RelaxedConvert<I32x4, F32x4, int_wasm_relaxed_trunc_signed,
+ "relaxed_trunc_f32x4_s", 0x101>;
+defm "" : RelaxedConvert<I32x4, F32x4, int_wasm_relaxed_trunc_unsigned,
+ "relaxed_trunc_f32x4_u", 0x102>;
+defm "" : RelaxedConvert<I32x4, F64x2, int_wasm_relaxed_trunc_signed_zero,
+ "relaxed_trunc_f64x2_s_zero", 0x103>;
+defm "" : RelaxedConvert<I32x4, F64x2, int_wasm_relaxed_trunc_unsigned_zero,
+ "relaxed_trunc_f64x2_u_zero", 0x104>;
//===----------------------------------------------------------------------===//
// Relaxed Fused Multiply- Add and Subtract (FMA/FMS)
@@ -1408,18 +1408,21 @@
// Relaxed floating-point min and max.
//===----------------------------------------------------------------------===//
-multiclass SIMD_RELAXED_FMINMAX<Vec vec, bits<32> simdopMin, bits<32> simdopMax> {
- defm RELAXED_FMIN_#vec :
- RELAXED_I<(outs V128:$dst), (ins V128:$a, V128:$b), (outs), (ins),
- [(set (vec.vt V128:$dst), (int_wasm_relaxed_min
- (vec.vt V128:$a), (vec.vt V128:$b)))],
- vec.prefix#".relaxed_min\t$dst, $a, $b", vec.prefix#".relaxed_min", simdopMin>;
- defm RELAXED_FMAX_#vec :
- RELAXED_I<(outs V128:$dst), (ins V128:$a, V128:$b), (outs), (ins),
- [(set (vec.vt V128:$dst), (int_wasm_relaxed_max
- (vec.vt V128:$a), (vec.vt V128:$b)))],
- vec.prefix#".relaxed_max\t$dst, $a, $b", vec.prefix#".relaxed_max", simdopMax>;
+multiclass RelaxedBinary<Vec vec, SDPatternOperator node, string name,
+ bits<32> simdop> {
+ defm _#vec : RELAXED_I<(outs V128:$dst), (ins V128:$lhs, V128:$rhs),
+ (outs), (ins),
+ [(set (vec.vt V128:$dst),
+ (node (vec.vt V128:$lhs), (vec.vt V128:$rhs)))],
+ vec.prefix#"."#name#"\t$dst, $lhs, $rhs",
+ vec.prefix#"."#name, simdop>;
}
-defm "" : SIMD_RELAXED_FMINMAX<F32x4, 0x10d, 0x10e>;
-defm "" : SIMD_RELAXED_FMINMAX<F64x2, 0x10f, 0x110>;
+defm SIMD_RELAXED_FMIN :
+ RelaxedBinary<F32x4, int_wasm_relaxed_min, "relaxed_min", 0x10d>;
+defm SIMD_RELAXED_FMAX :
+ RelaxedBinary<F32x4, int_wasm_relaxed_max, "relaxed_max", 0x10e>;
+defm SIMD_RELAXED_FMIN :
+ RelaxedBinary<F64x2, int_wasm_relaxed_min, "relaxed_min", 0x10f>;
+defm SIMD_RELAXED_FMAX :
+ RelaxedBinary<F64x2, int_wasm_relaxed_max, "relaxed_max", 0x110>;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D127157.434658.patch
Type: text/x-patch
Size: 3959 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20220607/11e46f35/attachment.bin>
More information about the llvm-commits
mailing list