| 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 133 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 144 case MachineRepresentation::kWord8: | 144 case MachineRepresentation::kWord8: |
| 145 opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb; | 145 opcode = load_rep.IsUnsigned() ? kMipsLbu : kMipsLb; |
| 146 break; | 146 break; |
| 147 case MachineRepresentation::kWord16: | 147 case MachineRepresentation::kWord16: |
| 148 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; | 148 opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; |
| 149 break; | 149 break; |
| 150 case MachineRepresentation::kTagged: // Fall through. | 150 case MachineRepresentation::kTagged: // Fall through. |
| 151 case MachineRepresentation::kWord32: | 151 case MachineRepresentation::kWord32: |
| 152 opcode = kMipsLw; | 152 opcode = kMipsLw; |
| 153 break; | 153 break; |
| 154 case MachineRepresentation::kWord64: // Fall through. | 154 case MachineRepresentation::kWord64: // Fall through. |
| 155 case MachineRepresentation::kSimd128: // Fall through. |
| 155 case MachineRepresentation::kNone: | 156 case MachineRepresentation::kNone: |
| 156 UNREACHABLE(); | 157 UNREACHABLE(); |
| 157 return; | 158 return; |
| 158 } | 159 } |
| 159 | 160 |
| 160 if (g.CanBeImmediate(index, opcode)) { | 161 if (g.CanBeImmediate(index, opcode)) { |
| 161 Emit(opcode | AddressingModeField::encode(kMode_MRI), | 162 Emit(opcode | AddressingModeField::encode(kMode_MRI), |
| 162 g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 163 g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); |
| 163 } else { | 164 } else { |
| 164 InstructionOperand addr_reg = g.TempRegister(); | 165 InstructionOperand addr_reg = g.TempRegister(); |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 224 case MachineRepresentation::kWord8: | 225 case MachineRepresentation::kWord8: |
| 225 opcode = kMipsSb; | 226 opcode = kMipsSb; |
| 226 break; | 227 break; |
| 227 case MachineRepresentation::kWord16: | 228 case MachineRepresentation::kWord16: |
| 228 opcode = kMipsSh; | 229 opcode = kMipsSh; |
| 229 break; | 230 break; |
| 230 case MachineRepresentation::kTagged: // Fall through. | 231 case MachineRepresentation::kTagged: // Fall through. |
| 231 case MachineRepresentation::kWord32: | 232 case MachineRepresentation::kWord32: |
| 232 opcode = kMipsSw; | 233 opcode = kMipsSw; |
| 233 break; | 234 break; |
| 234 case MachineRepresentation::kWord64: // Fall through. | 235 case MachineRepresentation::kWord64: // Fall through. |
| 236 case MachineRepresentation::kSimd128: // Fall through. |
| 235 case MachineRepresentation::kNone: | 237 case MachineRepresentation::kNone: |
| 236 UNREACHABLE(); | 238 UNREACHABLE(); |
| 237 return; | 239 return; |
| 238 } | 240 } |
| 239 | 241 |
| 240 if (g.CanBeImmediate(index, opcode)) { | 242 if (g.CanBeImmediate(index, opcode)) { |
| 241 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 243 Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), |
| 242 g.UseRegister(base), g.UseImmediate(index), g.UseRegister(value)); | 244 g.UseRegister(base), g.UseImmediate(index), g.UseRegister(value)); |
| 243 } else { | 245 } else { |
| 244 InstructionOperand addr_reg = g.TempRegister(); | 246 InstructionOperand addr_reg = g.TempRegister(); |
| (...skipping 643 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 888 break; | 890 break; |
| 889 case MachineRepresentation::kWord32: | 891 case MachineRepresentation::kWord32: |
| 890 opcode = kCheckedLoadWord32; | 892 opcode = kCheckedLoadWord32; |
| 891 break; | 893 break; |
| 892 case MachineRepresentation::kFloat32: | 894 case MachineRepresentation::kFloat32: |
| 893 opcode = kCheckedLoadFloat32; | 895 opcode = kCheckedLoadFloat32; |
| 894 break; | 896 break; |
| 895 case MachineRepresentation::kFloat64: | 897 case MachineRepresentation::kFloat64: |
| 896 opcode = kCheckedLoadFloat64; | 898 opcode = kCheckedLoadFloat64; |
| 897 break; | 899 break; |
| 898 case MachineRepresentation::kBit: // Fall through. | 900 case MachineRepresentation::kBit: // Fall through. |
| 899 case MachineRepresentation::kTagged: // Fall through. | 901 case MachineRepresentation::kTagged: // Fall through. |
| 900 case MachineRepresentation::kWord64: // Fall through. | 902 case MachineRepresentation::kWord64: // Fall through. |
| 903 case MachineRepresentation::kSimd128: // Fall through. |
| 901 case MachineRepresentation::kNone: | 904 case MachineRepresentation::kNone: |
| 902 UNREACHABLE(); | 905 UNREACHABLE(); |
| 903 return; | 906 return; |
| 904 } | 907 } |
| 905 InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) | 908 InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) |
| 906 ? g.UseImmediate(offset) | 909 ? g.UseImmediate(offset) |
| 907 : g.UseRegister(offset); | 910 : g.UseRegister(offset); |
| 908 | 911 |
| 909 InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) | 912 InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) |
| 910 ? g.CanBeImmediate(length, opcode) | 913 ? g.CanBeImmediate(length, opcode) |
| (...skipping 444 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1355 MachineOperatorBuilder::kFloat32Max | | 1358 MachineOperatorBuilder::kFloat32Max | |
| 1356 MachineOperatorBuilder::kFloat32RoundDown | | 1359 MachineOperatorBuilder::kFloat32RoundDown | |
| 1357 MachineOperatorBuilder::kFloat32RoundUp | | 1360 MachineOperatorBuilder::kFloat32RoundUp | |
| 1358 MachineOperatorBuilder::kFloat32RoundTruncate | | 1361 MachineOperatorBuilder::kFloat32RoundTruncate | |
| 1359 MachineOperatorBuilder::kFloat32RoundTiesEven; | 1362 MachineOperatorBuilder::kFloat32RoundTiesEven; |
| 1360 } | 1363 } |
| 1361 | 1364 |
| 1362 } // namespace compiler | 1365 } // namespace compiler |
| 1363 } // namespace internal | 1366 } // namespace internal |
| 1364 } // namespace v8 | 1367 } // namespace v8 |
| OLD | NEW |