summaryrefslogtreecommitdiff
path: root/scripts
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 /scripts
parentb4badb815ec844e438a05d501eafb6bb99383bc6 (diff)
downloadbinaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.tar.gz
binaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.tar.bz2
binaryen-bebbeb54f177bdc2cfdff71d6a256a35f2f2057b.zip
Implement nontrapping float-to-int instructions (#1780)
Diffstat (limited to 'scripts')
-rwxr-xr-xscripts/gen-s-parser.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/scripts/gen-s-parser.py b/scripts/gen-s-parser.py
index 5f37fd9d5..f33107ea6 100755
--- a/scripts/gen-s-parser.py
+++ b/scripts/gen-s-parser.py
@@ -258,7 +258,16 @@ instructions = [
("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.rmw.cmpxchg", "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)"),
]