OLD | NEW |
1 // Copyright 2013 the V8 project authors. All rights reserved. | 1 // Copyright 2013 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 4918 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4929 } | 4929 } |
4930 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0; | 4930 return memcmp(sequence, old, kCodeAgeStubEntryOffset) == 0; |
4931 } | 4931 } |
4932 #endif | 4932 #endif |
4933 | 4933 |
4934 | 4934 |
4935 void MacroAssembler::FlooringDiv(Register result, | 4935 void MacroAssembler::FlooringDiv(Register result, |
4936 Register dividend, | 4936 Register dividend, |
4937 int32_t divisor) { | 4937 int32_t divisor) { |
4938 Register tmp = WTmp0(); | 4938 Register tmp = WTmp0(); |
4939 ASSERT(!AreAliased(dividend, result, tmp)); | 4939 ASSERT(!AreAliased(result, dividend, tmp)); |
| 4940 ASSERT(result.Is32Bits() && dividend.Is32Bits()); |
4940 MultiplierAndShift ms(divisor); | 4941 MultiplierAndShift ms(divisor); |
4941 Mov(tmp, Operand(ms.multiplier())); | 4942 Mov(tmp, Operand(ms.multiplier())); |
4942 Smull(result.X(), dividend, tmp); | 4943 Smull(result.X(), dividend, tmp); |
4943 Mov(result.X(), Operand(result.X(), ASR, 32)); | 4944 Asr(result.X(), result.X(), 32); |
4944 if (divisor > 0 && ms.multiplier() < 0) { | 4945 if (divisor > 0 && ms.multiplier() < 0) Add(result, result, dividend); |
4945 Add(result, result, Operand(dividend)); | 4946 if (divisor < 0 && ms.multiplier() > 0) Sub(result, result, dividend); |
4946 } | 4947 if (ms.shift() > 0) Asr(result, result, ms.shift()); |
4947 if (divisor < 0 && ms.multiplier() > 0) { | |
4948 Sub(result, result, Operand(dividend)); | |
4949 } | |
4950 if (ms.shift() > 0) Mov(result, Operand(result, ASR, ms.shift())); | |
4951 Add(result, result, Operand(dividend, LSR, 31)); | 4948 Add(result, result, Operand(dividend, LSR, 31)); |
4952 } | 4949 } |
4953 | 4950 |
4954 | 4951 |
4955 #undef __ | 4952 #undef __ |
4956 #define __ masm-> | 4953 #define __ masm-> |
4957 | 4954 |
4958 | 4955 |
4959 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg, | 4956 void InlineSmiCheckInfo::Emit(MacroAssembler* masm, const Register& reg, |
4960 const Label* smi_check) { | 4957 const Label* smi_check) { |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4997 } | 4994 } |
4998 } | 4995 } |
4999 | 4996 |
5000 | 4997 |
5001 #undef __ | 4998 #undef __ |
5002 | 4999 |
5003 | 5000 |
5004 } } // namespace v8::internal | 5001 } } // namespace v8::internal |
5005 | 5002 |
5006 #endif // V8_TARGET_ARCH_A64 | 5003 #endif // V8_TARGET_ARCH_A64 |
OLD | NEW |