summaryrefslogtreecommitdiff
path: root/src/ir/cost.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/ir/cost.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/ir/cost.h')
-rw-r--r--src/ir/cost.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir/cost.h b/src/ir/cost.h
index 6dabf2fcb..e28f535e7 100644
--- a/src/ir/cost.h
+++ b/src/ir/cost.h
@@ -141,7 +141,15 @@ struct CostAnalyzer : public Visitor<CostAnalyzer, Index> {
case ExtendS16Int32:
case ExtendS8Int64:
case ExtendS16Int64:
- case ExtendS32Int64: ret = 1; break;
+ case ExtendS32Int64:
+ case TruncSatSFloat32ToInt32:
+ case TruncSatUFloat32ToInt32:
+ case TruncSatSFloat64ToInt32:
+ case TruncSatUFloat64ToInt32:
+ case TruncSatSFloat32ToInt64:
+ case TruncSatUFloat32ToInt64:
+ case TruncSatSFloat64ToInt64:
+ case TruncSatUFloat64ToInt64: ret = 1; break;
case SqrtFloat32:
case SqrtFloat64: ret = 2; break;
case InvalidUnary: WASM_UNREACHABLE();