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 1072 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1083 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { | 1083 LInstruction* LChunkBuilder::DoUnaryMathOperation(HUnaryMathOperation* instr) { |
1084 switch (instr->op()) { | 1084 switch (instr->op()) { |
1085 case kMathFloor: | 1085 case kMathFloor: |
1086 return DoMathFloor(instr); | 1086 return DoMathFloor(instr); |
1087 case kMathRound: | 1087 case kMathRound: |
1088 return DoMathRound(instr); | 1088 return DoMathRound(instr); |
1089 case kMathFround: | 1089 case kMathFround: |
1090 return DoMathFround(instr); | 1090 return DoMathFround(instr); |
1091 case kMathAbs: | 1091 case kMathAbs: |
1092 return DoMathAbs(instr); | 1092 return DoMathAbs(instr); |
| 1093 case kMathCos: |
| 1094 return DoMathCos(instr); |
1093 case kMathLog: | 1095 case kMathLog: |
1094 return DoMathLog(instr); | 1096 return DoMathLog(instr); |
1095 case kMathExp: | 1097 case kMathExp: |
1096 return DoMathExp(instr); | 1098 return DoMathExp(instr); |
| 1099 case kMathSin: |
| 1100 return DoMathSin(instr); |
1097 case kMathSqrt: | 1101 case kMathSqrt: |
1098 return DoMathSqrt(instr); | 1102 return DoMathSqrt(instr); |
1099 case kMathPowHalf: | 1103 case kMathPowHalf: |
1100 return DoMathPowHalf(instr); | 1104 return DoMathPowHalf(instr); |
1101 case kMathClz32: | 1105 case kMathClz32: |
1102 return DoMathClz32(instr); | 1106 return DoMathClz32(instr); |
1103 default: | 1107 default: |
1104 UNREACHABLE(); | 1108 UNREACHABLE(); |
1105 return NULL; | 1109 return NULL; |
1106 } | 1110 } |
(...skipping 53 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1160 instr); | 1164 instr); |
1161 } | 1165 } |
1162 | 1166 |
1163 | 1167 |
1164 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { | 1168 LInstruction* LChunkBuilder::DoMathClz32(HUnaryMathOperation* instr) { |
1165 LOperand* input = UseRegisterAtStart(instr->value()); | 1169 LOperand* input = UseRegisterAtStart(instr->value()); |
1166 LMathClz32* result = new(zone()) LMathClz32(input); | 1170 LMathClz32* result = new(zone()) LMathClz32(input); |
1167 return DefineAsRegister(result); | 1171 return DefineAsRegister(result); |
1168 } | 1172 } |
1169 | 1173 |
| 1174 LInstruction* LChunkBuilder::DoMathCos(HUnaryMathOperation* instr) { |
| 1175 DCHECK(instr->representation().IsDouble()); |
| 1176 DCHECK(instr->value()->representation().IsDouble()); |
| 1177 LOperand* input = UseFixedDouble(instr->value(), xmm0); |
| 1178 return MarkAsCall(DefineFixedDouble(new (zone()) LMathCos(input), xmm0), |
| 1179 instr); |
| 1180 } |
1170 | 1181 |
1171 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { | 1182 LInstruction* LChunkBuilder::DoMathExp(HUnaryMathOperation* instr) { |
1172 DCHECK(instr->representation().IsDouble()); | 1183 DCHECK(instr->representation().IsDouble()); |
1173 DCHECK(instr->value()->representation().IsDouble()); | 1184 DCHECK(instr->value()->representation().IsDouble()); |
1174 LOperand* input = UseFixedDouble(instr->value(), xmm0); | 1185 LOperand* input = UseFixedDouble(instr->value(), xmm0); |
1175 return MarkAsCall(DefineFixedDouble(new (zone()) LMathExp(input), xmm0), | 1186 return MarkAsCall(DefineFixedDouble(new (zone()) LMathExp(input), xmm0), |
1176 instr); | 1187 instr); |
1177 } | 1188 } |
1178 | 1189 |
| 1190 LInstruction* LChunkBuilder::DoMathSin(HUnaryMathOperation* instr) { |
| 1191 DCHECK(instr->representation().IsDouble()); |
| 1192 DCHECK(instr->value()->representation().IsDouble()); |
| 1193 LOperand* input = UseFixedDouble(instr->value(), xmm0); |
| 1194 return MarkAsCall(DefineFixedDouble(new (zone()) LMathSin(input), xmm0), |
| 1195 instr); |
| 1196 } |
1179 | 1197 |
1180 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { | 1198 LInstruction* LChunkBuilder::DoMathSqrt(HUnaryMathOperation* instr) { |
1181 LOperand* input = UseAtStart(instr->value()); | 1199 LOperand* input = UseAtStart(instr->value()); |
1182 return DefineAsRegister(new(zone()) LMathSqrt(input)); | 1200 return DefineAsRegister(new(zone()) LMathSqrt(input)); |
1183 } | 1201 } |
1184 | 1202 |
1185 | 1203 |
1186 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { | 1204 LInstruction* LChunkBuilder::DoMathPowHalf(HUnaryMathOperation* instr) { |
1187 LOperand* input = UseRegisterAtStart(instr->value()); | 1205 LOperand* input = UseRegisterAtStart(instr->value()); |
1188 LMathPowHalf* result = new(zone()) LMathPowHalf(input); | 1206 LMathPowHalf* result = new(zone()) LMathPowHalf(input); |
(...skipping 1379 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2568 LOperand* index = UseTempRegister(instr->index()); | 2586 LOperand* index = UseTempRegister(instr->index()); |
2569 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); | 2587 LLoadFieldByIndex* load = new(zone()) LLoadFieldByIndex(object, index); |
2570 LInstruction* result = DefineSameAsFirst(load); | 2588 LInstruction* result = DefineSameAsFirst(load); |
2571 return AssignPointerMap(result); | 2589 return AssignPointerMap(result); |
2572 } | 2590 } |
2573 | 2591 |
2574 } // namespace internal | 2592 } // namespace internal |
2575 } // namespace v8 | 2593 } // namespace v8 |
2576 | 2594 |
2577 #endif // V8_TARGET_ARCH_X64 | 2595 #endif // V8_TARGET_ARCH_X64 |
OLD | NEW |