Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(193)

Unified Diff: src/compiler/wasm-compiler.cc

Issue 2204963002: [wasm] Use the Float64Max/Min machine operators to implement F64Max/Min. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Typo Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: src/compiler/wasm-compiler.cc
diff --git a/src/compiler/wasm-compiler.cc b/src/compiler/wasm-compiler.cc
index 421066ee683682b17d5fee9a02ee7ef55441b951..86c1f973c28f1951aa8f5f033cda27ed91295c09 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -605,11 +605,13 @@ Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
case wasm::kExprF32Min:
return BuildF32Min(left, right);
case wasm::kExprF64Min:
- return BuildF64Min(left, right);
+ op = m->Float64Min();
+ break;
case wasm::kExprF32Max:
return BuildF32Max(left, right);
case wasm::kExprF64Max:
- return BuildF64Max(left, right);
+ op = m->Float64Max();
+ break;
case wasm::kExprF64Pow:
return BuildF64Pow(left, right);
case wasm::kExprF64Atan2:
@@ -1266,46 +1268,6 @@ Node* WasmGraphBuilder::BuildF32Max(Node* left, Node* right) {
Binop(wasm::kExprF32Mul, left, Float32Constant(1.0)))));
}
-Node* WasmGraphBuilder::BuildF64Min(Node* left, Node* right) {
- Diamond left_le_right(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Le, left, right));
-
- Diamond right_lt_left(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Lt, right, left));
-
- Diamond left_is_not_nan(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Eq, left, left));
-
- return left_le_right.Phi(
- wasm::kAstF64, left,
- right_lt_left.Phi(
- wasm::kAstF64, right,
- left_is_not_nan.Phi(
- wasm::kAstF64,
- Binop(wasm::kExprF64Mul, right, Float64Constant(1.0)),
- Binop(wasm::kExprF64Mul, left, Float64Constant(1.0)))));
-}
-
-Node* WasmGraphBuilder::BuildF64Max(Node* left, Node* right) {
- Diamond left_ge_right(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Ge, left, right));
-
- Diamond right_gt_left(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Lt, right, left));
-
- Diamond left_is_not_nan(graph(), jsgraph()->common(),
- Binop(wasm::kExprF64Eq, left, left));
-
- return left_ge_right.Phi(
- wasm::kAstF64, left,
- right_gt_left.Phi(
- wasm::kAstF64, right,
- left_is_not_nan.Phi(
- wasm::kAstF64,
- Binop(wasm::kExprF64Mul, right, Float64Constant(1.0)),
- Binop(wasm::kExprF64Mul, left, Float64Constant(1.0)))));
-}
-
Node* WasmGraphBuilder::BuildI32SConvertF32(Node* input,
wasm::WasmCodePosition position) {
MachineOperatorBuilder* m = jsgraph()->machine();
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/compiler/x64/code-generator-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698