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

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

Issue 2215403002: [turbofan] Make Float32Neg and Float64Neg mandatory operators. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: 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/instruction-selector-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..cebe7cbbb22bee6750e58654de9841d0736dd07b 100644
--- a/src/compiler/wasm-compiler.cc
+++ b/src/compiler/wasm-compiler.cc
@@ -653,12 +653,8 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
op = m->Float32Abs();
break;
case wasm::kExprF32Neg: {
- if (m->Float32Neg().IsSupported()) {
- op = m->Float32Neg().op();
- break;
- } else {
- return BuildF32Neg(input);
- }
+ op = m->Float32Neg();
+ break;
}
case wasm::kExprF32Sqrt:
op = m->Float32Sqrt();
@@ -667,12 +663,8 @@ Node* WasmGraphBuilder::Unop(wasm::WasmOpcode opcode, Node* input,
op = m->Float64Abs();
break;
case wasm::kExprF64Neg: {
- if (m->Float64Neg().IsSupported()) {
- op = m->Float64Neg().op();
- break;
- } else {
- return BuildF64Neg(input);
- }
+ op = m->Float64Neg();
+ break;
}
case wasm::kExprF64Sqrt:
op = m->Float64Sqrt();
@@ -1158,34 +1150,6 @@ Node* WasmGraphBuilder::BuildChangeEndianness(Node* node, MachineType memtype,
return result;
}
-Node* WasmGraphBuilder::BuildF32Neg(Node* input) {
- Node* result =
- Unop(wasm::kExprF32ReinterpretI32,
- Binop(wasm::kExprI32Xor, Unop(wasm::kExprI32ReinterpretF32, input),
- jsgraph()->Int32Constant(0x80000000)));
-
- return result;
-}
-
-Node* WasmGraphBuilder::BuildF64Neg(Node* input) {
-#if WASM_64
- Node* result =
- Unop(wasm::kExprF64ReinterpretI64,
- Binop(wasm::kExprI64Xor, Unop(wasm::kExprI64ReinterpretF64, input),
- jsgraph()->Int64Constant(0x8000000000000000)));
-
- return result;
-#else
- MachineOperatorBuilder* m = jsgraph()->machine();
-
- Node* old_high_word = graph()->NewNode(m->Float64ExtractHighWord32(), input);
- Node* new_high_word = Binop(wasm::kExprI32Xor, old_high_word,
- jsgraph()->Int32Constant(0x80000000));
-
- return graph()->NewNode(m->Float64InsertHighWord32(), input, new_high_word);
-#endif
-}
-
Node* WasmGraphBuilder::BuildF32CopySign(Node* left, Node* right) {
Node* result = Unop(
wasm::kExprF32ReinterpretI32,
« no previous file with comments | « src/compiler/wasm-compiler.h ('k') | src/compiler/x64/instruction-selector-x64.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698