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 #include "src/base/adapters.h" | 5 #include "src/base/adapters.h" |
6 #include "src/base/bits.h" | 6 #include "src/base/bits.h" |
7 #include "src/compiler/instruction-selector-impl.h" | 7 #include "src/compiler/instruction-selector-impl.h" |
8 #include "src/compiler/node-matchers.h" | 8 #include "src/compiler/node-matchers.h" |
9 #include "src/compiler/node-properties.h" | 9 #include "src/compiler/node-properties.h" |
10 | 10 |
(...skipping 28 matching lines...) Expand all Loading... |
39 case kMipsShl: | 39 case kMipsShl: |
40 case kMipsSar: | 40 case kMipsSar: |
41 case kMipsShr: | 41 case kMipsShr: |
42 return is_uint5(value); | 42 return is_uint5(value); |
43 case kMipsAdd: | 43 case kMipsAdd: |
44 case kMipsAnd: | 44 case kMipsAnd: |
45 case kMipsOr: | 45 case kMipsOr: |
46 case kMipsSub: | 46 case kMipsSub: |
47 case kMipsXor: | 47 case kMipsXor: |
48 return is_uint16(value); | 48 return is_uint16(value); |
49 case kMipsLb: | |
50 case kMipsLbu: | |
51 case kMipsSb: | |
52 case kMipsLh: | |
53 case kMipsLhu: | |
54 case kMipsSh: | |
55 case kMipsLw: | |
56 case kMipsSw: | |
57 case kMipsLwc1: | |
58 case kMipsSwc1: | |
59 case kMipsLdc1: | 49 case kMipsLdc1: |
60 case kMipsSdc1: | 50 case kMipsSdc1: |
61 case kCheckedLoadInt8: | |
62 case kCheckedLoadUint8: | |
63 case kCheckedLoadInt16: | |
64 case kCheckedLoadUint16: | |
65 case kCheckedLoadWord32: | |
66 case kCheckedStoreWord8: | |
67 case kCheckedStoreWord16: | |
68 case kCheckedStoreWord32: | |
69 case kCheckedLoadFloat32: | |
70 case kCheckedLoadFloat64: | 51 case kCheckedLoadFloat64: |
71 case kCheckedStoreFloat32: | |
72 case kCheckedStoreFloat64: | 52 case kCheckedStoreFloat64: |
73 // true even for 32b values, offsets > 16b | 53 return std::numeric_limits<int16_t>::min() <= (value + kIntSize) && |
74 // are handled in assembler-mips.cc | 54 std::numeric_limits<int16_t>::max() >= (value + kIntSize); |
75 return is_int32(value); | |
76 default: | 55 default: |
77 return is_int16(value); | 56 return is_int16(value); |
78 } | 57 } |
79 } | 58 } |
80 | 59 |
81 private: | 60 private: |
82 bool ImmediateFitsAddrMode1Instruction(int32_t imm) const { | 61 bool ImmediateFitsAddrMode1Instruction(int32_t imm) const { |
83 TRACE_UNIMPL(); | 62 TRACE_UNIMPL(); |
84 return false; | 63 return false; |
85 } | 64 } |
(...skipping 1693 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1779 case MachineRepresentation::kWord16: | 1758 case MachineRepresentation::kWord16: |
1780 opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16; | 1759 opcode = load_rep.IsSigned() ? kAtomicLoadInt16 : kAtomicLoadUint16; |
1781 break; | 1760 break; |
1782 case MachineRepresentation::kWord32: | 1761 case MachineRepresentation::kWord32: |
1783 opcode = kAtomicLoadWord32; | 1762 opcode = kAtomicLoadWord32; |
1784 break; | 1763 break; |
1785 default: | 1764 default: |
1786 UNREACHABLE(); | 1765 UNREACHABLE(); |
1787 return; | 1766 return; |
1788 } | 1767 } |
1789 | |
1790 if (g.CanBeImmediate(index, opcode)) { | 1768 if (g.CanBeImmediate(index, opcode)) { |
1791 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1769 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
1792 g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 1770 g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); |
1793 } else { | 1771 } else { |
1794 InstructionOperand addr_reg = g.TempRegister(); | 1772 InstructionOperand addr_reg = g.TempRegister(); |
1795 Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg, | 1773 Emit(kMipsAdd | AddressingModeField::encode(kMode_None), addr_reg, |
1796 g.UseRegister(index), g.UseRegister(base)); | 1774 g.UseRegister(index), g.UseRegister(base)); |
1797 // Emit desired load opcode, using temp addr_reg. | 1775 // Emit desired load opcode, using temp addr_reg. |
1798 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1776 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
1799 g.DefineAsRegister(node), addr_reg, g.TempImmediate(0)); | 1777 g.DefineAsRegister(node), addr_reg, g.TempImmediate(0)); |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1870 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 1848 DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || |
1871 IsMipsArchVariant(kMips32r2)); | 1849 IsMipsArchVariant(kMips32r2)); |
1872 return MachineOperatorBuilder::AlignmentRequirements:: | 1850 return MachineOperatorBuilder::AlignmentRequirements:: |
1873 NoUnalignedAccessSupport(); | 1851 NoUnalignedAccessSupport(); |
1874 } | 1852 } |
1875 } | 1853 } |
1876 | 1854 |
1877 } // namespace compiler | 1855 } // namespace compiler |
1878 } // namespace internal | 1856 } // namespace internal |
1879 } // namespace v8 | 1857 } // namespace v8 |
OLD | NEW |