| OLD | NEW |
| 1 // Copyright 2012 the V8 project authors. All rights reserved. | 1 // Copyright 2012 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 1196 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1207 | 1207 |
| 1208 | 1208 |
| 1209 void LCodeGen::DoMultiplyAddD(LMultiplyAddD* instr) { | 1209 void LCodeGen::DoMultiplyAddD(LMultiplyAddD* instr) { |
| 1210 DoubleRegister addend = ToDoubleRegister(instr->addend()); | 1210 DoubleRegister addend = ToDoubleRegister(instr->addend()); |
| 1211 DoubleRegister multiplier = ToDoubleRegister(instr->multiplier()); | 1211 DoubleRegister multiplier = ToDoubleRegister(instr->multiplier()); |
| 1212 DoubleRegister multiplicand = ToDoubleRegister(instr->multiplicand()); | 1212 DoubleRegister multiplicand = ToDoubleRegister(instr->multiplicand()); |
| 1213 | 1213 |
| 1214 // This is computed in-place. | 1214 // This is computed in-place. |
| 1215 ASSERT(addend.is(ToDoubleRegister(instr->result()))); | 1215 ASSERT(addend.is(ToDoubleRegister(instr->result()))); |
| 1216 | 1216 |
| 1217 CpuFeatureScope scope(masm(), FPU); |
| 1217 __ madd_d(addend, addend, multiplier, multiplicand); | 1218 __ madd_d(addend, addend, multiplier, multiplicand); |
| 1218 } | 1219 } |
| 1219 | 1220 |
| 1220 | 1221 |
| 1221 void LCodeGen::DoMulI(LMulI* instr) { | 1222 void LCodeGen::DoMulI(LMulI* instr) { |
| 1222 Register scratch = scratch0(); | 1223 Register scratch = scratch0(); |
| 1223 Register result = ToRegister(instr->result()); | 1224 Register result = ToRegister(instr->result()); |
| 1224 // Note that result may alias left. | 1225 // Note that result may alias left. |
| 1225 Register left = ToRegister(instr->left()); | 1226 Register left = ToRegister(instr->left()); |
| 1226 LOperand* right_op = instr->right(); | 1227 LOperand* right_op = instr->right(); |
| (...skipping 3665 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4892 | 4893 |
| 4893 Label done; | 4894 Label done; |
| 4894 | 4895 |
| 4895 // The input is a tagged HeapObject. | 4896 // The input is a tagged HeapObject. |
| 4896 // Heap number map check. | 4897 // Heap number map check. |
| 4897 __ lw(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset)); | 4898 __ lw(scratch1, FieldMemOperand(input_reg, HeapObject::kMapOffset)); |
| 4898 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); | 4899 __ LoadRoot(at, Heap::kHeapNumberMapRootIndex); |
| 4899 // This 'at' value and scratch1 map value are used for tests in both clauses | 4900 // This 'at' value and scratch1 map value are used for tests in both clauses |
| 4900 // of the if. | 4901 // of the if. |
| 4901 | 4902 |
| 4903 CpuFeatureScope scope(masm(), FPU); |
| 4902 if (instr->truncating()) { | 4904 if (instr->truncating()) { |
| 4903 CpuFeatureScope scope(masm(), FPU); | |
| 4904 Register scratch3 = ToRegister(instr->temp2()); | 4905 Register scratch3 = ToRegister(instr->temp2()); |
| 4905 FPURegister single_scratch = double_scratch.low(); | 4906 FPURegister single_scratch = double_scratch.low(); |
| 4906 ASSERT(!scratch3.is(input_reg) && | 4907 ASSERT(!scratch3.is(input_reg) && |
| 4907 !scratch3.is(scratch1) && | 4908 !scratch3.is(scratch1) && |
| 4908 !scratch3.is(scratch2)); | 4909 !scratch3.is(scratch2)); |
| 4909 // Performs a truncating conversion of a floating point number as used by | 4910 // Performs a truncating conversion of a floating point number as used by |
| 4910 // the JS bitwise operations. | 4911 // the JS bitwise operations. |
| 4911 Label heap_number; | 4912 Label heap_number; |
| 4912 __ Branch(&heap_number, eq, scratch1, Operand(at)); // HeapNumber map? | 4913 __ Branch(&heap_number, eq, scratch1, Operand(at)); // HeapNumber map? |
| 4913 // Check for undefined. Undefined is converted to zero for truncating | 4914 // Check for undefined. Undefined is converted to zero for truncating |
| (...skipping 1185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 6099 __ Subu(scratch, result, scratch); | 6100 __ Subu(scratch, result, scratch); |
| 6100 __ lw(result, FieldMemOperand(scratch, | 6101 __ lw(result, FieldMemOperand(scratch, |
| 6101 FixedArray::kHeaderSize - kPointerSize)); | 6102 FixedArray::kHeaderSize - kPointerSize)); |
| 6102 __ bind(&done); | 6103 __ bind(&done); |
| 6103 } | 6104 } |
| 6104 | 6105 |
| 6105 | 6106 |
| 6106 #undef __ | 6107 #undef __ |
| 6107 | 6108 |
| 6108 } } // namespace v8::internal | 6109 } } // namespace v8::internal |
| OLD | NEW |