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 1423 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1434 power = WhichPowerOf2(-divisor); | 1434 power = WhichPowerOf2(-divisor); |
1435 } | 1435 } |
1436 | 1436 |
1437 if (test_value != 0) { | 1437 if (test_value != 0) { |
1438 if (instr->hydrogen()->CheckFlag( | 1438 if (instr->hydrogen()->CheckFlag( |
1439 HInstruction::kAllUsesTruncatingToInt32)) { | 1439 HInstruction::kAllUsesTruncatingToInt32)) { |
1440 Label done, negative; | 1440 Label done, negative; |
1441 __ cmp(dividend, 0); | 1441 __ cmp(dividend, 0); |
1442 __ j(less, &negative, Label::kNear); | 1442 __ j(less, &negative, Label::kNear); |
1443 __ sar(dividend, power); | 1443 __ sar(dividend, power); |
| 1444 if (divisor < 0) __ neg(dividend); |
1444 __ jmp(&done, Label::kNear); | 1445 __ jmp(&done, Label::kNear); |
1445 | 1446 |
1446 __ bind(&negative); | 1447 __ bind(&negative); |
1447 __ neg(dividend); | 1448 __ neg(dividend); |
1448 __ sar(dividend, power); | 1449 __ sar(dividend, power); |
1449 if (divisor > 0) __ neg(dividend); | 1450 if (divisor > 0) __ neg(dividend); |
1450 __ bind(&done); | 1451 __ bind(&done); |
1451 return; // Don't fall through to "__ neg" below. | 1452 return; // Don't fall through to "__ neg" below. |
1452 } else { | 1453 } else { |
1453 // Deoptimize if remainder is not 0. | 1454 // Deoptimize if remainder is not 0. |
(...skipping 4998 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
6452 FixedArray::kHeaderSize - kPointerSize)); | 6453 FixedArray::kHeaderSize - kPointerSize)); |
6453 __ bind(&done); | 6454 __ bind(&done); |
6454 } | 6455 } |
6455 | 6456 |
6456 | 6457 |
6457 #undef __ | 6458 #undef __ |
6458 | 6459 |
6459 } } // namespace v8::internal | 6460 } } // namespace v8::internal |
6460 | 6461 |
6461 #endif // V8_TARGET_ARCH_IA32 | 6462 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |