OLD | NEW |
1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 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/crankshaft/x64/lithium-x64.h" | 5 #include "src/crankshaft/x64/lithium-x64.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_X64 | 9 #if V8_TARGET_ARCH_X64 |
10 | 10 |
(...skipping 1132 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1143 case kMathPowHalf: | 1143 case kMathPowHalf: |
1144 return DoMathPowHalf(instr); | 1144 return DoMathPowHalf(instr); |
1145 case kMathClz32: | 1145 case kMathClz32: |
1146 return DoMathClz32(instr); | 1146 return DoMathClz32(instr); |
1147 default: | 1147 default: |
1148 UNREACHABLE(); | 1148 UNREACHABLE(); |
1149 return NULL; | 1149 return NULL; |
1150 } | 1150 } |
1151 } | 1151 } |
1152 | 1152 |
1153 | |
1154 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1153 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
| 1154 DCHECK(instr->value()->representation().IsDouble()); |
1155 LOperand* input = UseRegisterAtStart(instr->value()); | 1155 LOperand* input = UseRegisterAtStart(instr->value()); |
1156 LMathFloor* result = new(zone()) LMathFloor(input); | 1156 if (instr->representation().IsInteger32()) { |
1157 return AssignEnvironment(DefineAsRegister(result)); | 1157 LMathFloorI* result = new (zone()) LMathFloorI(input); |
| 1158 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1159 } else { |
| 1160 DCHECK(instr->representation().IsDouble()); |
| 1161 LMathFloorD* result = new (zone()) LMathFloorD(input); |
| 1162 return DefineAsRegister(result); |
| 1163 } |
1158 } | 1164 } |
1159 | 1165 |
1160 | |
1161 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { | 1166 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { |
| 1167 DCHECK(instr->value()->representation().IsDouble()); |
1162 LOperand* input = UseRegister(instr->value()); | 1168 LOperand* input = UseRegister(instr->value()); |
1163 LOperand* temp = FixedTemp(xmm4); | 1169 if (instr->representation().IsInteger32()) { |
1164 LMathRound* result = new(zone()) LMathRound(input, temp); | 1170 LOperand* temp = FixedTemp(xmm4); |
1165 return AssignEnvironment(DefineAsRegister(result)); | 1171 LMathRoundI* result = new (zone()) LMathRoundI(input, temp); |
| 1172 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1173 } else { |
| 1174 DCHECK(instr->representation().IsDouble()); |
| 1175 LMathRoundD* result = new (zone()) LMathRoundD(input); |
| 1176 return DefineAsRegister(result); |
| 1177 } |
1166 } | 1178 } |
1167 | 1179 |
1168 | |
1169 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { | 1180 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { |
1170 LOperand* input = UseRegister(instr->value()); | 1181 LOperand* input = UseRegister(instr->value()); |
1171 LMathFround* result = new (zone()) LMathFround(input); | 1182 LMathFround* result = new (zone()) LMathFround(input); |
1172 return DefineAsRegister(result); | 1183 return DefineAsRegister(result); |
1173 } | 1184 } |
1174 | 1185 |
1175 | 1186 |
1176 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { | 1187 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { |
1177 LOperand* context = UseAny(instr->context()); | 1188 LOperand* context = UseAny(instr->context()); |
1178 LOperand* input = UseRegisterAtStart(instr->value()); | 1189 LOperand* input = UseRegisterAtStart(instr->value()); |
(...skipping 1442 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2621 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2632 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
2622 LOperand* context = UseRegisterAtStart(instr->context()); | 2633 LOperand* context = UseRegisterAtStart(instr->context()); |
2623 return new(zone()) LStoreFrameContext(context); | 2634 return new(zone()) LStoreFrameContext(context); |
2624 } | 2635 } |
2625 | 2636 |
2626 | 2637 |
2627 } // namespace internal | 2638 } // namespace internal |
2628 } // namespace v8 | 2639 } // namespace v8 |
2629 | 2640 |
2630 #endif // V8_TARGET_ARCH_X64 | 2641 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |