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

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

Issue 2252863003: [turbofan] Add Float32(Max|Min) machine operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Type is number now. 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 d8dddc9422d45a3602e378cdbaff47558138b93c..e92a434d1df4d9700532fbf83df6e5e08ae6f9e6 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -649,12 +649,14 @@ Node* WasmGraphBuilder::Binop(wasm::WasmOpcode opcode, Node* left, Node* right,
std::swap(left, right);
break;
case wasm::kExprF32Min:
- return BuildF32Min(left, right);
+ op = m->Float32Min();
+ break;
case wasm::kExprF64Min:
op = m->Float64Min();
break;
case wasm::kExprF32Max:
- return BuildF32Max(left, right);
+ op = m->Float32Max();
+ break;
case wasm::kExprF64Max:
op = m->Float64Max();
break;
@@ -1238,46 +1240,6 @@ Node* WasmGraphBuilder::BuildF64CopySign(Node* left, Node* right) {
#endif
}
-Node* WasmGraphBuilder::BuildF32Min(Node* left, Node* right) {
- Diamond left_le_right(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Le, left, right));
-
- Diamond right_lt_left(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Lt, right, left));
-
- Diamond left_is_not_nan(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Eq, left, left));
-
- return left_le_right.Phi(
- wasm::kAstF32, left,
- right_lt_left.Phi(
- wasm::kAstF32, right,
- left_is_not_nan.Phi(
- wasm::kAstF32,
- Binop(wasm::kExprF32Mul, right, Float32Constant(1.0)),
- Binop(wasm::kExprF32Mul, left, Float32Constant(1.0)))));
-}
-
-Node* WasmGraphBuilder::BuildF32Max(Node* left, Node* right) {
- Diamond left_ge_right(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Ge, left, right));
-
- Diamond right_gt_left(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Gt, right, left));
-
- Diamond left_is_not_nan(graph(), jsgraph()->common(),
- Binop(wasm::kExprF32Eq, left, left));
-
- return left_ge_right.Phi(
- wasm::kAstF32, left,
- right_gt_left.Phi(
- wasm::kAstF32, right,
- left_is_not_nan.Phi(
- wasm::kAstF32,
- Binop(wasm::kExprF32Mul, right, Float32Constant(1.0)),
- Binop(wasm::kExprF32Mul, left, Float32Constant(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