summaryrefslogtreecommitdiff
path: root/scripts/gen-s-parser.py
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/gen-s-parser.py')
-rwxr-xr-xscripts/gen-s-parser.py162
1 files changed, 81 insertions, 81 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index ea96f3d49..7e9e70a7c 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -30,11 +30,11 @@ instructions = [
("call_indirect", "makeCallIndirect(s)"),
("drop", "makeDrop(s)"),
("select", "makeSelect(s)"),
- ("get_local", "makeGetLocal(s)"),
- ("set_local", "makeSetLocal(s)"),
- ("tee_local", "makeTeeLocal(s)"),
- ("get_global", "makeGetGlobal(s)"),
- ("set_global", "makeSetGlobal(s)"),
+ ("local.get", "makeGetLocal(s)"),
+ ("local.set", "makeSetLocal(s)"),
+ ("local.tee", "makeTeeLocal(s)"),
+ ("global.get", "makeGetGlobal(s)"),
+ ("global.set", "makeSetGlobal(s)"),
("i32.load", "makeLoad(s, i32, /*isAtomic=*/false)"),
("i64.load", "makeLoad(s, i64, /*isAtomic=*/false)"),
("f32.load", "makeLoad(s, f32, /*isAtomic=*/false)"),
@@ -162,31 +162,31 @@ instructions = [
("f64.min", "makeBinary(s, BinaryOp::MinFloat64)"),
("f64.max", "makeBinary(s, BinaryOp::MaxFloat64)"),
("f64.copysign", "makeBinary(s, BinaryOp::CopySignFloat64)"),
- ("i32.wrap/i64", "makeUnary(s, UnaryOp::WrapInt64)"),
- ("i32.trunc_s/f32", "makeUnary(s, UnaryOp::TruncSFloat32ToInt32)"),
- ("i32.trunc_u/f32", "makeUnary(s, UnaryOp::TruncUFloat32ToInt32)"),
- ("i32.trunc_s/f64", "makeUnary(s, UnaryOp::TruncSFloat64ToInt32)"),
- ("i32.trunc_u/f64", "makeUnary(s, UnaryOp::TruncUFloat64ToInt32)"),
- ("i64.extend_s/i32", "makeUnary(s, UnaryOp::ExtendSInt32)"),
- ("i64.extend_u/i32", "makeUnary(s, UnaryOp::ExtendUInt32)"),
- ("i64.trunc_s/f32", "makeUnary(s, UnaryOp::TruncSFloat32ToInt64)"),
- ("i64.trunc_u/f32", "makeUnary(s, UnaryOp::TruncUFloat32ToInt64)"),
- ("i64.trunc_s/f64", "makeUnary(s, UnaryOp::TruncSFloat64ToInt64)"),
- ("i64.trunc_u/f64", "makeUnary(s, UnaryOp::TruncUFloat64ToInt64)"),
- ("f32.convert_s/i32", "makeUnary(s, UnaryOp::ConvertSInt32ToFloat32)"),
- ("f32.convert_u/i32", "makeUnary(s, UnaryOp::ConvertUInt32ToFloat32)"),
- ("f32.convert_s/i64", "makeUnary(s, UnaryOp::ConvertSInt64ToFloat32)"),
- ("f32.convert_u/i64", "makeUnary(s, UnaryOp::ConvertUInt64ToFloat32)"),
- ("f32.demote/f64", "makeUnary(s, UnaryOp::DemoteFloat64)"),
- ("f64.convert_s/i32", "makeUnary(s, UnaryOp::ConvertSInt32ToFloat64)"),
- ("f64.convert_u/i32", "makeUnary(s, UnaryOp::ConvertUInt32ToFloat64)"),
- ("f64.convert_s/i64", "makeUnary(s, UnaryOp::ConvertSInt64ToFloat64)"),
- ("f64.convert_u/i64", "makeUnary(s, UnaryOp::ConvertUInt64ToFloat64)"),
- ("f64.promote/f32", "makeUnary(s, UnaryOp::PromoteFloat32)"),
- ("i32.reinterpret/f32", "makeUnary(s, UnaryOp::ReinterpretFloat32)"),
- ("i64.reinterpret/f64", "makeUnary(s, UnaryOp::ReinterpretFloat64)"),
- ("f32.reinterpret/i32", "makeUnary(s, UnaryOp::ReinterpretInt32)"),
- ("f64.reinterpret/i64", "makeUnary(s, UnaryOp::ReinterpretInt64)"),
+ ("i32.wrap_i64", "makeUnary(s, UnaryOp::WrapInt64)"),
+ ("i32.trunc_f32_s", "makeUnary(s, UnaryOp::TruncSFloat32ToInt32)"),
+ ("i32.trunc_f32_u", "makeUnary(s, UnaryOp::TruncUFloat32ToInt32)"),
+ ("i32.trunc_f64_s", "makeUnary(s, UnaryOp::TruncSFloat64ToInt32)"),
+ ("i32.trunc_f64_u", "makeUnary(s, UnaryOp::TruncUFloat64ToInt32)"),
+ ("i64.extend_i32_s", "makeUnary(s, UnaryOp::ExtendSInt32)"),
+ ("i64.extend_i32_u", "makeUnary(s, UnaryOp::ExtendUInt32)"),
+ ("i64.trunc_f32_s", "makeUnary(s, UnaryOp::TruncSFloat32ToInt64)"),
+ ("i64.trunc_f32_u", "makeUnary(s, UnaryOp::TruncUFloat32ToInt64)"),
+ ("i64.trunc_f64_s", "makeUnary(s, UnaryOp::TruncSFloat64ToInt64)"),
+ ("i64.trunc_f64_u", "makeUnary(s, UnaryOp::TruncUFloat64ToInt64)"),
+ ("f32.convert_i32_s", "makeUnary(s, UnaryOp::ConvertSInt32ToFloat32)"),
+ ("f32.convert_i32_u", "makeUnary(s, UnaryOp::ConvertUInt32ToFloat32)"),
+ ("f32.convert_i64_s", "makeUnary(s, UnaryOp::ConvertSInt64ToFloat32)"),
+ ("f32.convert_i64_u", "makeUnary(s, UnaryOp::ConvertUInt64ToFloat32)"),
+ ("f32.demote_f64", "makeUnary(s, UnaryOp::DemoteFloat64)"),
+ ("f64.convert_i32_s", "makeUnary(s, UnaryOp::ConvertSInt32ToFloat64)"),
+ ("f64.convert_i32_u", "makeUnary(s, UnaryOp::ConvertUInt32ToFloat64)"),
+ ("f64.convert_i64_s", "makeUnary(s, UnaryOp::ConvertSInt64ToFloat64)"),
+ ("f64.convert_i64_u", "makeUnary(s, UnaryOp::ConvertUInt64ToFloat64)"),
+ ("f64.promote_f32", "makeUnary(s, UnaryOp::PromoteFloat32)"),
+ ("i32.reinterpret_f32", "makeUnary(s, UnaryOp::ReinterpretFloat32)"),
+ ("i64.reinterpret_f64", "makeUnary(s, UnaryOp::ReinterpretFloat64)"),
+ ("f32.reinterpret_i32", "makeUnary(s, UnaryOp::ReinterpretInt32)"),
+ ("f64.reinterpret_i64", "makeUnary(s, UnaryOp::ReinterpretInt64)"),
("i32.extend8_s", "makeUnary(s, UnaryOp::ExtendS8Int32)"),
("i32.extend16_s", "makeUnary(s, UnaryOp::ExtendS16Int32)"),
("i64.extend8_s", "makeUnary(s, UnaryOp::ExtendS8Int64)"),
@@ -210,64 +210,64 @@ instructions = [
("i64.atomic.store16", "makeStore(s, i64, /*isAtomic=*/true)"),
("i64.atomic.store32", "makeStore(s, i64, /*isAtomic=*/true)"),
("i64.atomic.store", "makeStore(s, i64, /*isAtomic=*/true)"),
- ("i32.atomic.rmw8_u.add", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.add", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.add_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.add_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.add", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.add", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.add", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.add", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.add_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.add_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.add_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.add", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.sub", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.sub", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.sub_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.sub_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.sub", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.sub", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.sub", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.sub", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.sub_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.sub_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.sub_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.sub", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.and", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.and", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.and_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.and_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.and", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.and", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.and", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.and", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.and_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.and_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.and_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.and", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.or", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.or", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.or_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.or_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.or", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.or", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.or", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.or", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.or_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.or_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.or_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.or", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.xor", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.xor", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.xor_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.xor_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.xor", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.xor", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.xor", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.xor", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.xor_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.xor_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.xor_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.xor", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.xchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.xchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.xchg_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.xchg_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.xchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.xchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.xchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.xchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.xchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.xchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.xchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.xchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i32.atomic.rmw8_u.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i32.atomic.rmw16_u.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw8.cmpxchg_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
+ ("i32.atomic.rmw16.cmpxchg_u", "makeAtomicRMWOrCmpxchg(s, i32)"),
("i32.atomic.rmw.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i32)"),
- ("i64.atomic.rmw8_u.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw16_u.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
- ("i64.atomic.rmw32_u.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw8.cmpxchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw16.cmpxchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
+ ("i64.atomic.rmw32.cmpxchg_u", "makeAtomicRMWOrCmpxchg(s, i64)"),
("i64.atomic.rmw.cmpxchg", "makeAtomicRMWOrCmpxchg(s, i64)"),
# nontrapping float-to-int instructions
- ("i32.trunc_s:sat/f32", "makeUnary(s, UnaryOp::TruncSatSFloat32ToInt32)"),
- ("i32.trunc_u:sat/f32", "makeUnary(s, UnaryOp::TruncSatUFloat32ToInt32)"),
- ("i32.trunc_s:sat/f64", "makeUnary(s, UnaryOp::TruncSatSFloat64ToInt32)"),
- ("i32.trunc_u:sat/f64", "makeUnary(s, UnaryOp::TruncSatUFloat64ToInt32)"),
- ("i64.trunc_s:sat/f32", "makeUnary(s, UnaryOp::TruncSatSFloat32ToInt64)"),
- ("i64.trunc_u:sat/f32", "makeUnary(s, UnaryOp::TruncSatUFloat32ToInt64)"),
- ("i64.trunc_s:sat/f64", "makeUnary(s, UnaryOp::TruncSatSFloat64ToInt64)"),
- ("i64.trunc_u:sat/f64", "makeUnary(s, UnaryOp::TruncSatUFloat64ToInt64)"),
+ ("i32.trunc_sat_f32_s", "makeUnary(s, UnaryOp::TruncSatSFloat32ToInt32)"),
+ ("i32.trunc_sat_f32_u", "makeUnary(s, UnaryOp::TruncSatUFloat32ToInt32)"),
+ ("i32.trunc_sat_f64_s", "makeUnary(s, UnaryOp::TruncSatSFloat64ToInt32)"),
+ ("i32.trunc_sat_f64_u", "makeUnary(s, UnaryOp::TruncSatUFloat64ToInt32)"),
+ ("i64.trunc_sat_f32_s", "makeUnary(s, UnaryOp::TruncSatSFloat32ToInt64)"),
+ ("i64.trunc_sat_f32_u", "makeUnary(s, UnaryOp::TruncSatUFloat32ToInt64)"),
+ ("i64.trunc_sat_f64_s", "makeUnary(s, UnaryOp::TruncSatSFloat64ToInt64)"),
+ ("i64.trunc_sat_f64_u", "makeUnary(s, UnaryOp::TruncSatUFloat64ToInt64)"),
# SIMD ops
("v128.load", "makeLoad(s, v128, /*isAtomic=*/false)"),
("v128.store", "makeStore(s, v128, /*isAtomic=*/false)"),
@@ -401,14 +401,14 @@ instructions = [
("f64x2.div", "makeBinary(s, BinaryOp::DivVecF64x2)"),
("f64x2.min", "makeBinary(s, BinaryOp::MinVecF64x2)"),
("f64x2.max", "makeBinary(s, BinaryOp::MaxVecF64x2)"),
- ("i32x4.trunc_s/f32x4:sat", "makeUnary(s, UnaryOp::TruncSatSVecF32x4ToVecI32x4)"),
- ("i32x4.trunc_u/f32x4:sat", "makeUnary(s, UnaryOp::TruncSatUVecF32x4ToVecI32x4)"),
- ("i64x2.trunc_s/f64x2:sat", "makeUnary(s, UnaryOp::TruncSatSVecF64x2ToVecI64x2)"),
- ("i64x2.trunc_u/f64x2:sat", "makeUnary(s, UnaryOp::TruncSatUVecF64x2ToVecI64x2)"),
- ("f32x4.convert_s/i32x4", "makeUnary(s, UnaryOp::ConvertSVecI32x4ToVecF32x4)"),
- ("f32x4.convert_u/i32x4", "makeUnary(s, UnaryOp::ConvertUVecI32x4ToVecF32x4)"),
- ("f64x2.convert_s/i64x2", "makeUnary(s, UnaryOp::ConvertSVecI64x2ToVecF64x2)"),
- ("f64x2.convert_u/i64x2", "makeUnary(s, UnaryOp::ConvertUVecI64x2ToVecF64x2)")
+ ("i32x4.trunc_sat_f32x4_s", "makeUnary(s, UnaryOp::TruncSatSVecF32x4ToVecI32x4)"),
+ ("i32x4.trunc_sat_f32x4_u", "makeUnary(s, UnaryOp::TruncSatUVecF32x4ToVecI32x4)"),
+ ("i64x2.trunc_sat_f64x2_s", "makeUnary(s, UnaryOp::TruncSatSVecF64x2ToVecI64x2)"),
+ ("i64x2.trunc_sat_f64x2_u", "makeUnary(s, UnaryOp::TruncSatUVecF64x2ToVecI64x2)"),
+ ("f32x4.convert_i32x4_s", "makeUnary(s, UnaryOp::ConvertSVecI32x4ToVecF32x4)"),
+ ("f32x4.convert_i32x4_u", "makeUnary(s, UnaryOp::ConvertUVecI32x4ToVecF32x4)"),
+ ("f64x2.convert_i64x2_s", "makeUnary(s, UnaryOp::ConvertSVecI64x2ToVecF64x2)"),
+ ("f64x2.convert_i64x2_u", "makeUnary(s, UnaryOp::ConvertUVecI64x2ToVecF64x2)")
]