OLD | NEW |
1 // Copyright 2014 the V8 project authors. All rights reserved. | 1 // Copyright 2014 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 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 5 #ifndef V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 6 #define V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
7 | 7 |
8 #include "src/assembler.h" | 8 #include "src/assembler.h" |
9 #include "src/bailout-reason.h" | 9 #include "src/bailout-reason.h" |
10 #include "src/frames.h" | 10 #include "src/frames.h" |
(...skipping 1045 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1056 // Bit numbering is such that the least significant bit is bit 0 | 1056 // Bit numbering is such that the least significant bit is bit 0 |
1057 // (for consistency between 32/64-bit). | 1057 // (for consistency between 32/64-bit). |
1058 | 1058 |
1059 // Extract consecutive bits (defined by rangeStart - rangeEnd) from src | 1059 // Extract consecutive bits (defined by rangeStart - rangeEnd) from src |
1060 // and place them into the least significant bits of dst. | 1060 // and place them into the least significant bits of dst. |
1061 inline void ExtractBitRange(Register dst, Register src, int rangeStart, | 1061 inline void ExtractBitRange(Register dst, Register src, int rangeStart, |
1062 int rangeEnd, RCBit rc = LeaveRC) { | 1062 int rangeEnd, RCBit rc = LeaveRC) { |
1063 DCHECK(rangeStart >= rangeEnd && rangeStart < kBitsPerPointer); | 1063 DCHECK(rangeStart >= rangeEnd && rangeStart < kBitsPerPointer); |
1064 int rotate = (rangeEnd == 0) ? 0 : kBitsPerPointer - rangeEnd; | 1064 int rotate = (rangeEnd == 0) ? 0 : kBitsPerPointer - rangeEnd; |
1065 int width = rangeStart - rangeEnd + 1; | 1065 int width = rangeStart - rangeEnd + 1; |
| 1066 if (rc == SetRC && rangeEnd == 0 && width <= 16) { |
| 1067 andi(dst, src, Operand((1 << width) - 1)); |
| 1068 } else { |
1066 #if V8_TARGET_ARCH_PPC64 | 1069 #if V8_TARGET_ARCH_PPC64 |
1067 rldicl(dst, src, rotate, kBitsPerPointer - width, rc); | 1070 rldicl(dst, src, rotate, kBitsPerPointer - width, rc); |
1068 #else | 1071 #else |
1069 rlwinm(dst, src, rotate, kBitsPerPointer - width, kBitsPerPointer - 1, rc); | 1072 rlwinm(dst, src, rotate, kBitsPerPointer - width, kBitsPerPointer - 1, |
| 1073 rc); |
1070 #endif | 1074 #endif |
| 1075 } |
1071 } | 1076 } |
1072 | 1077 |
1073 inline void ExtractBit(Register dst, Register src, uint32_t bitNumber, | 1078 inline void ExtractBit(Register dst, Register src, uint32_t bitNumber, |
1074 RCBit rc = LeaveRC) { | 1079 RCBit rc = LeaveRC) { |
1075 ExtractBitRange(dst, src, bitNumber, bitNumber, rc); | 1080 ExtractBitRange(dst, src, bitNumber, bitNumber, rc); |
1076 } | 1081 } |
1077 | 1082 |
1078 // Extract consecutive bits (defined by mask) from src and place them | 1083 // Extract consecutive bits (defined by mask) from src and place them |
1079 // into the least significant bits of dst. | 1084 // into the least significant bits of dst. |
1080 inline void ExtractBitMask(Register dst, Register src, uintptr_t mask, | 1085 inline void ExtractBitMask(Register dst, Register src, uintptr_t mask, |
(...skipping 483 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1564 #define ACCESS_MASM(masm) \ | 1569 #define ACCESS_MASM(masm) \ |
1565 masm->stop(__FILE_LINE__); \ | 1570 masm->stop(__FILE_LINE__); \ |
1566 masm-> | 1571 masm-> |
1567 #else | 1572 #else |
1568 #define ACCESS_MASM(masm) masm-> | 1573 #define ACCESS_MASM(masm) masm-> |
1569 #endif | 1574 #endif |
1570 } | 1575 } |
1571 } // namespace v8::internal | 1576 } // namespace v8::internal |
1572 | 1577 |
1573 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ | 1578 #endif // V8_PPC_MACRO_ASSEMBLER_PPC_H_ |
OLD | NEW |