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/ia32/lithium-ia32.h" | 5 #include "src/crankshaft/ia32/lithium-ia32.h" |
6 | 6 |
7 #include <sstream> | 7 #include <sstream> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
(...skipping 1143 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1154 case kMathPowHalf: | 1154 case kMathPowHalf: |
1155 return DoMathPowHalf(instr); | 1155 return DoMathPowHalf(instr); |
1156 case kMathClz32: | 1156 case kMathClz32: |
1157 return DoMathClz32(instr); | 1157 return DoMathClz32(instr); |
1158 default: | 1158 default: |
1159 UNREACHABLE(); | 1159 UNREACHABLE(); |
1160 return NULL; | 1160 return NULL; |
1161 } | 1161 } |
1162 } | 1162 } |
1163 | 1163 |
1164 | |
1165 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { | 1164 LInstruction* LChunkBuilder::DoMathFloor(HUnaryMathOperation* instr) { |
| 1165 DCHECK(instr->value()->representation().IsDouble()); |
1166 LOperand* input = UseRegisterAtStart(instr->value()); | 1166 LOperand* input = UseRegisterAtStart(instr->value()); |
1167 LMathFloor* result = new(zone()) LMathFloor(input); | 1167 if (instr->representation().IsInteger32()) { |
1168 return AssignEnvironment(DefineAsRegister(result)); | 1168 LMathFloorI* result = new (zone()) LMathFloorI(input); |
| 1169 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1170 } else { |
| 1171 DCHECK(instr->representation().IsDouble()); |
| 1172 LMathFloorD* result = new (zone()) LMathFloorD(input); |
| 1173 return DefineAsRegister(result); |
| 1174 } |
1169 } | 1175 } |
1170 | 1176 |
1171 | |
1172 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { | 1177 LInstruction* LChunkBuilder::DoMathRound(HUnaryMathOperation* instr) { |
| 1178 DCHECK(instr->value()->representation().IsDouble()); |
1173 LOperand* input = UseRegister(instr->value()); | 1179 LOperand* input = UseRegister(instr->value()); |
1174 LOperand* temp = FixedTemp(xmm4); | 1180 if (instr->representation().IsInteger32()) { |
1175 LMathRound* result = new(zone()) LMathRound(input, temp); | 1181 LOperand* temp = FixedTemp(xmm4); |
1176 return AssignEnvironment(DefineAsRegister(result)); | 1182 LMathRoundI* result = new (zone()) LMathRoundI(input, temp); |
| 1183 return AssignEnvironment(AssignPointerMap(DefineAsRegister(result))); |
| 1184 } else { |
| 1185 DCHECK(instr->representation().IsDouble()); |
| 1186 LMathRoundD* result = new (zone()) LMathRoundD(input); |
| 1187 return DefineAsRegister(result); |
| 1188 } |
1177 } | 1189 } |
1178 | 1190 |
1179 | |
1180 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { | 1191 LInstruction* LChunkBuilder::DoMathFround(HUnaryMathOperation* instr) { |
1181 LOperand* input = UseRegister(instr->value()); | 1192 LOperand* input = UseRegister(instr->value()); |
1182 LMathFround* result = new (zone()) LMathFround(input); | 1193 LMathFround* result = new (zone()) LMathFround(input); |
1183 return DefineAsRegister(result); | 1194 return DefineAsRegister(result); |
1184 } | 1195 } |
1185 | 1196 |
1186 | 1197 |
1187 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { | 1198 LInstruction* LChunkBuilder::DoMathAbs(HUnaryMathOperation* instr) { |
1188 LOperand* context = UseAny(instr->context()); // Deferred use. | 1199 LOperand* context = UseAny(instr->context()); // Deferred use. |
1189 LOperand* input = UseRegisterAtStart(instr->value()); | 1200 LOperand* input = UseRegisterAtStart(instr->value()); |
(...skipping 1428 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2618 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { | 2629 LInstruction* LChunkBuilder::DoStoreFrameContext(HStoreFrameContext* instr) { |
2619 LOperand* context = UseRegisterAtStart(instr->context()); | 2630 LOperand* context = UseRegisterAtStart(instr->context()); |
2620 return new(zone()) LStoreFrameContext(context); | 2631 return new(zone()) LStoreFrameContext(context); |
2621 } | 2632 } |
2622 | 2633 |
2623 | 2634 |
2624 } // namespace internal | 2635 } // namespace internal |
2625 } // namespace v8 | 2636 } // namespace v8 |
2626 | 2637 |
2627 #endif // V8_TARGET_ARCH_IA32 | 2638 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |