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

Side by Side Diff: src/compiler/simplified-lowering.cc

Issue 2294143004: [turbofan] Fix Math.sign. (Closed)
Patch Set: Created 4 years, 3 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 unified diff | Download patch
« no previous file with comments | « no previous file | test/mjsunit/compiler/math-sign.js » ('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 2014 the V8 project authors. All rights reserved. 1 // Copyright 2014 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 #include "src/compiler/simplified-lowering.h" 5 #include "src/compiler/simplified-lowering.h"
6 6
7 #include <limits> 7 #include <limits>
8 8
9 #include "src/address-map.h" 9 #include "src/address-map.h"
10 #include "src/base/bits.h" 10 #include "src/base/bits.h"
(...skipping 2831 matching lines...) Expand 10 before | Expand all | Expand 10 after
2842 Node* const one = jsgraph()->Float64Constant(1.0); 2842 Node* const one = jsgraph()->Float64Constant(1.0);
2843 2843
2844 Node* const input = node->InputAt(0); 2844 Node* const input = node->InputAt(0);
2845 2845
2846 return graph()->NewNode( 2846 return graph()->NewNode(
2847 common()->Select(MachineRepresentation::kFloat64), 2847 common()->Select(MachineRepresentation::kFloat64),
2848 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one, 2848 graph()->NewNode(machine()->Float64LessThan(), input, zero), minus_one,
2849 graph()->NewNode( 2849 graph()->NewNode(
2850 common()->Select(MachineRepresentation::kFloat64), 2850 common()->Select(MachineRepresentation::kFloat64),
2851 graph()->NewNode(machine()->Float64LessThan(), zero, input), one, 2851 graph()->NewNode(machine()->Float64LessThan(), zero, input), one,
2852 zero)); 2852 input));
2853 } 2853 }
2854 2854
2855 Node* SimplifiedLowering::Int32Abs(Node* const node) { 2855 Node* SimplifiedLowering::Int32Abs(Node* const node) {
2856 Node* const input = node->InputAt(0); 2856 Node* const input = node->InputAt(0);
2857 2857
2858 // Generate case for absolute integer value. 2858 // Generate case for absolute integer value.
2859 // 2859 //
2860 // let sign = input >> 31 in 2860 // let sign = input >> 31 in
2861 // (input ^ sign) - sign 2861 // (input ^ sign) - sign
2862 2862
(...skipping 332 matching lines...) Expand 10 before | Expand all | Expand 10 after
3195 isolate(), graph()->zone(), callable.descriptor(), 0, flags, 3195 isolate(), graph()->zone(), callable.descriptor(), 0, flags,
3196 Operator::kNoProperties); 3196 Operator::kNoProperties);
3197 to_number_operator_.set(common()->Call(desc)); 3197 to_number_operator_.set(common()->Call(desc));
3198 } 3198 }
3199 return to_number_operator_.get(); 3199 return to_number_operator_.get();
3200 } 3200 }
3201 3201
3202 } // namespace compiler 3202 } // namespace compiler
3203 } // namespace internal 3203 } // namespace internal
3204 } // namespace v8 3204 } // namespace v8
OLDNEW
« no previous file with comments | « no previous file | test/mjsunit/compiler/math-sign.js » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698