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

Side by Side Diff: src/compiler/wasm-compiler.cc

Issue 1516143004: [wasm] Fixed F32Neg and F64Neg for -0.0. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 the V8 project authors. All rights reserved. 1 // Copyright 2015 the V8 project authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 5
6 #include "src/compiler/access-builder.h" 6 #include "src/compiler/access-builder.h"
7 #include "src/compiler/change-lowering.h" 7 #include "src/compiler/change-lowering.h"
8 #include "src/compiler/common-operator.h" 8 #include "src/compiler/common-operator.h"
9 #include "src/compiler/diamond.h" 9 #include "src/compiler/diamond.h"
10 #include "src/compiler/graph.h" 10 #include "src/compiler/graph.h"
(...skipping 651 matching lines...) Expand 10 before | Expand all | Expand 10 after
662 const Operator* op; 662 const Operator* op;
663 MachineOperatorBuilder* m = jsgraph()->machine(); 663 MachineOperatorBuilder* m = jsgraph()->machine();
664 switch (opcode) { 664 switch (opcode) {
665 case wasm::kExprBoolNot: 665 case wasm::kExprBoolNot:
666 op = m->Word32Equal(); 666 op = m->Word32Equal();
667 return graph()->NewNode(op, input, jsgraph()->Int32Constant(0)); 667 return graph()->NewNode(op, input, jsgraph()->Int32Constant(0));
668 case wasm::kExprF32Abs: 668 case wasm::kExprF32Abs:
669 op = m->Float32Abs(); 669 op = m->Float32Abs();
670 break; 670 break;
671 case wasm::kExprF32Neg: 671 case wasm::kExprF32Neg:
672 op = m->Float32Sub(); 672 op = m->Float32Mul();
673 return graph()->NewNode(op, jsgraph()->Float32Constant(0), input); 673 return graph()->NewNode(op, jsgraph()->Float32Constant(-1), input);
674 case wasm::kExprF32Sqrt: 674 case wasm::kExprF32Sqrt:
675 op = m->Float32Sqrt(); 675 op = m->Float32Sqrt();
676 break; 676 break;
677 case wasm::kExprF64Abs: 677 case wasm::kExprF64Abs:
678 op = m->Float64Abs(); 678 op = m->Float64Abs();
679 break; 679 break;
680 case wasm::kExprF64Neg: 680 case wasm::kExprF64Neg:
681 op = m->Float64Sub(); 681 op = m->Float64Mul();
682 return graph()->NewNode(op, jsgraph()->Float64Constant(0), input); 682 return graph()->NewNode(op, jsgraph()->Float64Constant(-1), input);
683 case wasm::kExprF64Sqrt: 683 case wasm::kExprF64Sqrt:
684 op = m->Float64Sqrt(); 684 op = m->Float64Sqrt();
685 break; 685 break;
686 case wasm::kExprI32SConvertF64: 686 case wasm::kExprI32SConvertF64:
687 op = m->ChangeFloat64ToInt32(); 687 op = m->ChangeFloat64ToInt32();
688 break; 688 break;
689 case wasm::kExprI32UConvertF64: 689 case wasm::kExprI32UConvertF64:
690 op = m->ChangeFloat64ToUint32(); 690 op = m->ChangeFloat64ToUint32();
691 break; 691 break;
692 case wasm::kExprF32ConvertF64: 692 case wasm::kExprF32ConvertF64:
(...skipping 1137 matching lines...) Expand 10 before | Expand all | Expand 10 after
1830 code->Disassemble(buffer, os); 1830 code->Disassemble(buffer, os);
1831 } 1831 }
1832 #endif 1832 #endif
1833 return code; 1833 return code;
1834 } 1834 }
1835 1835
1836 1836
1837 } // namespace compiler 1837 } // namespace compiler
1838 } // namespace internal 1838 } // namespace internal
1839 } // namespace v8 1839 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/cctest/wasm/test-run-wasm.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698