summaryrefslogtreecommitdiff
path: root/src/wasm-stack.h
diff options
context:
space:
mode:
authorThomas Lively <7121787+tlively@users.noreply.github.com>2018-12-04 10:30:35 -0800
committerGitHub <noreply@github.com>2018-12-04 10:30:35 -0800
commitbebbeb54f177bdc2cfdff71d6a256a35f2f2057b (patch)
tree80609eb177ddab4edae30323d42152e9ab59ba9b /src/wasm-stack.h
parentb4badb815ec844e438a05d501eafb6bb99383bc6 (diff)
downloadbinaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.tar.gz
binaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.tar.bz2
binaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.zip
Implement nontrapping float-to-int instructions (#1780)
Diffstat (limited to 'src/wasm-stack.h')
-rw-r--r--src/wasm-stack.h8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm-stack.h b/src/wasm-stack.h
index 1a937f81d..6e1150981 100644
--- a/src/wasm-stack.h
+++ b/src/wasm-stack.h
@@ -961,6 +961,14 @@ void StackWriter<Mode, Parent>::visitUnary(Unary* curr) {
case ExtendS8Int64: o << int8_t(BinaryConsts::I64ExtendS8); break;
case ExtendS16Int64: o << int8_t(BinaryConsts::I64ExtendS16); break;
case ExtendS32Int64: o << int8_t(BinaryConsts::I64ExtendS32); break;
+ case TruncSatSFloat32ToInt32: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I32STruncSatF32); break;
+ case TruncSatUFloat32ToInt32: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I32UTruncSatF32); break;
+ case TruncSatSFloat64ToInt32: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I32STruncSatF64); break;
+ case TruncSatUFloat64ToInt32: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I32UTruncSatF64); break;
+ case TruncSatSFloat32ToInt64: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I64STruncSatF32); break;
+ case TruncSatUFloat32ToInt64: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I64UTruncSatF32); break;
+ case TruncSatSFloat64ToInt64: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I64STruncSatF64); break;
+ case TruncSatUFloat64ToInt64: o << int8_t(BinaryConsts::TruncSatPrefix) << U32LEB(BinaryConsts::I64UTruncSatF64); break;
case InvalidUnary: WASM_UNREACHABLE();
}
}