summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAlon Zakai <alonzakai@gmail.com>2016-01-30 15:02:58 -0800
committerAlon Zakai <alonzakai@gmail.com>2016-01-30 15:02:58 -0800
commitae918ff5f5746398d0393cf871f6208e582b82d2 (patch)
treebd2240363ab4c619787414dd5e398c86096bdabc /src
parent2d966169a94a5f852491310c4f8868f71ea65631 (diff)
downloadbinaryen-ae918ff5f5746398d0393cf871f6208e582b82d2.tar.gz
binaryen-ae918ff5f5746398d0393cf871f6208e582b82d2.tar.bz2
binaryen-ae918ff5f5746398d0393cf871f6208e582b82d2.zip
refactor some binary writing code
Diffstat (limited to 'src')
-rw-r--r--src/wasm-binary.h28
1 files changed, 14 insertions, 14 deletions
diff --git a/src/wasm-binary.h b/src/wasm-binary.h
index a722f88ea..f89ffa23a 100644
--- a/src/wasm-binary.h
+++ b/src/wasm-binary.h
@@ -873,20 +873,20 @@ public:
case Add: TYPED_CODE(Add);
case Sub: TYPED_CODE(Sub);
case Mul: TYPED_CODE(Mul);
- case DivS: o << int8_t(curr->type == i32 ? BinaryConsts::I32DivS : BinaryConsts::I64DivS); break;
- case DivU: o << int8_t(curr->type == i32 ? BinaryConsts::I32DivU : BinaryConsts::I64DivU); break;
- case RemS: o << int8_t(curr->type == i32 ? BinaryConsts::I32RemS : BinaryConsts::I64RemS); break;
- case RemU: o << int8_t(curr->type == i32 ? BinaryConsts::I32RemU : BinaryConsts::I64RemU); break;
- case And: o << int8_t(curr->type == i32 ? BinaryConsts::I32And : BinaryConsts::I64And); break;
- case Or: o << int8_t(curr->type == i32 ? BinaryConsts::I32Or : BinaryConsts::I64Or); break;
- case Xor: o << int8_t(curr->type == i32 ? BinaryConsts::I32Xor : BinaryConsts::I64Xor); break;
- case Shl: o << int8_t(curr->type == i32 ? BinaryConsts::I32Shl : BinaryConsts::I64Shl); break;
- case ShrU: o << int8_t(curr->type == i32 ? BinaryConsts::I32ShrU : BinaryConsts::I64ShrU); break;
- case ShrS: o << int8_t(curr->type == i32 ? BinaryConsts::I32ShrS : BinaryConsts::I64ShrS); break;
- case Div: o << int8_t(curr->type == f32 ? BinaryConsts::F32Div : BinaryConsts::F64Div); break;
- case CopySign: o << int8_t(curr->type == f32 ? BinaryConsts::F32CopySign : BinaryConsts::F64CopySign); break;
- case Min: o << int8_t(curr->type == f32 ? BinaryConsts::F32Min : BinaryConsts::F64Min); break;
- case Max: o << int8_t(curr->type == f32 ? BinaryConsts::F32Max : BinaryConsts::F64Max); break;
+ case DivS: INT_TYPED_CODE(DivS);
+ case DivU: INT_TYPED_CODE(DivU);
+ case RemS: INT_TYPED_CODE(RemS);
+ case RemU: INT_TYPED_CODE(RemU);
+ case And: INT_TYPED_CODE(And);
+ case Or: INT_TYPED_CODE(Or);
+ case Xor: INT_TYPED_CODE(Xor);
+ case Shl: INT_TYPED_CODE(Shl);;
+ case ShrU: INT_TYPED_CODE(ShrU);
+ case ShrS: INT_TYPED_CODE(ShrS);
+ case Div: FLOAT_TYPED_CODE(Div);
+ case CopySign: FLOAT_TYPED_CODE(CopySign);
+ case Min: FLOAT_TYPED_CODE(Min);
+ case Max: FLOAT_TYPED_CODE(Max);
case Eq: TYPED_CODE(Eq);
case Ne: TYPED_CODE(Ne);
case LtS: INT_TYPED_CODE(LtS);