OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 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 1278 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1289 } | 1289 } |
1290 | 1290 |
1291 | 1291 |
1292 void LCodeGen::DoConstantI(LConstantI* instr) { | 1292 void LCodeGen::DoConstantI(LConstantI* instr) { |
1293 ASSERT(instr->result()->IsRegister()); | 1293 ASSERT(instr->result()->IsRegister()); |
1294 __ mov(ToRegister(instr->result()), Operand(instr->value())); | 1294 __ mov(ToRegister(instr->result()), Operand(instr->value())); |
1295 } | 1295 } |
1296 | 1296 |
1297 | 1297 |
1298 void LCodeGen::DoConstantD(LConstantD* instr) { | 1298 void LCodeGen::DoConstantD(LConstantD* instr) { |
1299 Abort("DoConstantD unimplemented."); | 1299 ASSERT(instr->result()->IsDoubleRegister()); |
| 1300 DwVfpRegister result = ToDoubleRegister(instr->result()); |
| 1301 double v = instr->value(); |
| 1302 __ vmov(result, v); |
1300 } | 1303 } |
1301 | 1304 |
1302 | 1305 |
1303 void LCodeGen::DoConstantT(LConstantT* instr) { | 1306 void LCodeGen::DoConstantT(LConstantT* instr) { |
1304 ASSERT(instr->result()->IsRegister()); | 1307 ASSERT(instr->result()->IsRegister()); |
1305 __ mov(ToRegister(instr->result()), Operand(instr->value())); | 1308 __ mov(ToRegister(instr->result()), Operand(instr->value())); |
1306 } | 1309 } |
1307 | 1310 |
1308 | 1311 |
1309 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { | 1312 void LCodeGen::DoJSArrayLength(LJSArrayLength* instr) { |
(...skipping 1022 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2332 | 2335 |
2333 // Retrieve FPSCR and check for vfp exceptions. | 2336 // Retrieve FPSCR and check for vfp exceptions. |
2334 __ vmrs(scratch); | 2337 __ vmrs(scratch); |
2335 // Restore FPSCR | 2338 // Restore FPSCR |
2336 __ vmsr(prev_fpscr); | 2339 __ vmsr(prev_fpscr); |
2337 __ tst(scratch, Operand(kVFPExceptionMask)); | 2340 __ tst(scratch, Operand(kVFPExceptionMask)); |
2338 DeoptimizeIf(ne, instr->environment()); | 2341 DeoptimizeIf(ne, instr->environment()); |
2339 | 2342 |
2340 // Move the result back to general purpose register r0. | 2343 // Move the result back to general purpose register r0. |
2341 __ vmov(result, single_scratch); | 2344 __ vmov(result, single_scratch); |
| 2345 |
| 2346 // Test for -0. |
| 2347 Label done; |
| 2348 __ cmp(result, Operand(0)); |
| 2349 __ b(ne, &done); |
| 2350 __ vmov(scratch, input.high()); |
| 2351 __ tst(scratch, Operand(HeapNumber::kSignMask)); |
| 2352 DeoptimizeIf(ne, instr->environment()); |
| 2353 __ bind(&done); |
2342 } | 2354 } |
2343 | 2355 |
2344 | 2356 |
2345 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { | 2357 void LCodeGen::DoMathSqrt(LUnaryMathOperation* instr) { |
2346 DoubleRegister input = ToDoubleRegister(instr->input()); | 2358 DoubleRegister input = ToDoubleRegister(instr->input()); |
2347 ASSERT(ToDoubleRegister(instr->result()).is(input)); | 2359 ASSERT(ToDoubleRegister(instr->result()).is(input)); |
2348 __ vsqrt(input, input); | 2360 __ vsqrt(input, input); |
2349 } | 2361 } |
2350 | 2362 |
2351 | 2363 |
(...skipping 850 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3202 | 3214 |
3203 | 3215 |
3204 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { | 3216 void LCodeGen::DoOsrEntry(LOsrEntry* instr) { |
3205 Abort("DoOsrEntry unimplemented."); | 3217 Abort("DoOsrEntry unimplemented."); |
3206 } | 3218 } |
3207 | 3219 |
3208 | 3220 |
3209 #undef __ | 3221 #undef __ |
3210 | 3222 |
3211 } } // namespace v8::internal | 3223 } } // namespace v8::internal |
OLD | NEW |