| 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 257       opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; | 257       opcode = load_rep.IsUnsigned() ? kMipsLhu : kMipsLh; | 
| 258       break; | 258       break; | 
| 259     case MachineRepresentation::kTaggedSigned:   // Fall through. | 259     case MachineRepresentation::kTaggedSigned:   // Fall through. | 
| 260     case MachineRepresentation::kTaggedPointer:  // Fall through. | 260     case MachineRepresentation::kTaggedPointer:  // Fall through. | 
| 261     case MachineRepresentation::kTagged:  // Fall through. | 261     case MachineRepresentation::kTagged:  // Fall through. | 
| 262     case MachineRepresentation::kWord32: | 262     case MachineRepresentation::kWord32: | 
| 263       opcode = kMipsLw; | 263       opcode = kMipsLw; | 
| 264       break; | 264       break; | 
| 265     case MachineRepresentation::kWord64:   // Fall through. | 265     case MachineRepresentation::kWord64:   // Fall through. | 
| 266     case MachineRepresentation::kSimd128:  // Fall through. | 266     case MachineRepresentation::kSimd128:  // Fall through. | 
|  | 267     case MachineRepresentation::kSimd1x4:  // Fall through. | 
|  | 268     case MachineRepresentation::kSimd1x8:  // Fall through. | 
|  | 269     case MachineRepresentation::kSimd1x16:  // Fall through. | 
| 267     case MachineRepresentation::kNone: | 270     case MachineRepresentation::kNone: | 
| 268       UNREACHABLE(); | 271       UNREACHABLE(); | 
| 269       return; | 272       return; | 
| 270   } | 273   } | 
| 271 | 274 | 
| 272   if (g.CanBeImmediate(index, opcode)) { | 275   if (g.CanBeImmediate(index, opcode)) { | 
| 273     Emit(opcode | AddressingModeField::encode(kMode_MRI), | 276     Emit(opcode | AddressingModeField::encode(kMode_MRI), | 
| 274          g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 277          g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 
| 275   } else { | 278   } else { | 
| 276     InstructionOperand addr_reg = g.TempRegister(); | 279     InstructionOperand addr_reg = g.TempRegister(); | 
| (...skipping 65 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 342         opcode = kMipsSh; | 345         opcode = kMipsSh; | 
| 343         break; | 346         break; | 
| 344       case MachineRepresentation::kTaggedSigned:   // Fall through. | 347       case MachineRepresentation::kTaggedSigned:   // Fall through. | 
| 345       case MachineRepresentation::kTaggedPointer:  // Fall through. | 348       case MachineRepresentation::kTaggedPointer:  // Fall through. | 
| 346       case MachineRepresentation::kTagged:  // Fall through. | 349       case MachineRepresentation::kTagged:  // Fall through. | 
| 347       case MachineRepresentation::kWord32: | 350       case MachineRepresentation::kWord32: | 
| 348         opcode = kMipsSw; | 351         opcode = kMipsSw; | 
| 349         break; | 352         break; | 
| 350       case MachineRepresentation::kWord64:   // Fall through. | 353       case MachineRepresentation::kWord64:   // Fall through. | 
| 351       case MachineRepresentation::kSimd128:  // Fall through. | 354       case MachineRepresentation::kSimd128:  // Fall through. | 
|  | 355       case MachineRepresentation::kSimd1x4:  // Fall through. | 
|  | 356       case MachineRepresentation::kSimd1x8:  // Fall through. | 
|  | 357       case MachineRepresentation::kSimd1x16:  // Fall through. | 
| 352       case MachineRepresentation::kNone: | 358       case MachineRepresentation::kNone: | 
| 353         UNREACHABLE(); | 359         UNREACHABLE(); | 
| 354         return; | 360         return; | 
| 355     } | 361     } | 
| 356 | 362 | 
| 357     if (g.CanBeImmediate(index, opcode)) { | 363     if (g.CanBeImmediate(index, opcode)) { | 
| 358       Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 364       Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 
| 359            g.UseRegister(base), g.UseImmediate(index), | 365            g.UseRegister(base), g.UseImmediate(index), | 
| 360            g.UseRegisterOrImmediateZero(value)); | 366            g.UseRegisterOrImmediateZero(value)); | 
| 361     } else { | 367     } else { | 
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1187       opcode = kMipsUlw; | 1193       opcode = kMipsUlw; | 
| 1188       break; | 1194       break; | 
| 1189     case MachineRepresentation::kFloat32: | 1195     case MachineRepresentation::kFloat32: | 
| 1190       opcode = kMipsUlwc1; | 1196       opcode = kMipsUlwc1; | 
| 1191       break; | 1197       break; | 
| 1192     case MachineRepresentation::kFloat64: | 1198     case MachineRepresentation::kFloat64: | 
| 1193       opcode = kMipsUldc1; | 1199       opcode = kMipsUldc1; | 
| 1194       break; | 1200       break; | 
| 1195     case MachineRepresentation::kWord64:   // Fall through. | 1201     case MachineRepresentation::kWord64:   // Fall through. | 
| 1196     case MachineRepresentation::kSimd128:  // Fall through. | 1202     case MachineRepresentation::kSimd128:  // Fall through. | 
|  | 1203     case MachineRepresentation::kSimd1x4:  // Fall through. | 
|  | 1204     case MachineRepresentation::kSimd1x8:  // Fall through. | 
|  | 1205     case MachineRepresentation::kSimd1x16:  // Fall through. | 
| 1197     case MachineRepresentation::kNone: | 1206     case MachineRepresentation::kNone: | 
| 1198       UNREACHABLE(); | 1207       UNREACHABLE(); | 
| 1199       return; | 1208       return; | 
| 1200   } | 1209   } | 
| 1201 | 1210 | 
| 1202   if (g.CanBeImmediate(index, opcode)) { | 1211   if (g.CanBeImmediate(index, opcode)) { | 
| 1203     Emit(opcode | AddressingModeField::encode(kMode_MRI), | 1212     Emit(opcode | AddressingModeField::encode(kMode_MRI), | 
| 1204          g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 1213          g.DefineAsRegister(node), g.UseRegister(base), g.UseImmediate(index)); | 
| 1205   } else { | 1214   } else { | 
| 1206     InstructionOperand addr_reg = g.TempRegister(); | 1215     InstructionOperand addr_reg = g.TempRegister(); | 
| (...skipping 30 matching lines...) Expand all  Loading... | 
| 1237       opcode = kMipsUsh; | 1246       opcode = kMipsUsh; | 
| 1238       break; | 1247       break; | 
| 1239     case MachineRepresentation::kTaggedSigned:   // Fall through. | 1248     case MachineRepresentation::kTaggedSigned:   // Fall through. | 
| 1240     case MachineRepresentation::kTaggedPointer:  // Fall through. | 1249     case MachineRepresentation::kTaggedPointer:  // Fall through. | 
| 1241     case MachineRepresentation::kTagged:  // Fall through. | 1250     case MachineRepresentation::kTagged:  // Fall through. | 
| 1242     case MachineRepresentation::kWord32: | 1251     case MachineRepresentation::kWord32: | 
| 1243       opcode = kMipsUsw; | 1252       opcode = kMipsUsw; | 
| 1244       break; | 1253       break; | 
| 1245     case MachineRepresentation::kWord64:   // Fall through. | 1254     case MachineRepresentation::kWord64:   // Fall through. | 
| 1246     case MachineRepresentation::kSimd128:  // Fall through. | 1255     case MachineRepresentation::kSimd128:  // Fall through. | 
|  | 1256     case MachineRepresentation::kSimd1x4:  // Fall through. | 
|  | 1257     case MachineRepresentation::kSimd1x8:  // Fall through. | 
|  | 1258     case MachineRepresentation::kSimd1x16:  // Fall through. | 
| 1247     case MachineRepresentation::kNone: | 1259     case MachineRepresentation::kNone: | 
| 1248       UNREACHABLE(); | 1260       UNREACHABLE(); | 
| 1249       return; | 1261       return; | 
| 1250   } | 1262   } | 
| 1251 | 1263 | 
| 1252   if (g.CanBeImmediate(index, opcode)) { | 1264   if (g.CanBeImmediate(index, opcode)) { | 
| 1253     Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 1265     Emit(opcode | AddressingModeField::encode(kMode_MRI), g.NoOutput(), | 
| 1254          g.UseRegister(base), g.UseImmediate(index), | 1266          g.UseRegister(base), g.UseImmediate(index), | 
| 1255          g.UseRegisterOrImmediateZero(value)); | 1267          g.UseRegisterOrImmediateZero(value)); | 
| 1256   } else { | 1268   } else { | 
| (...skipping 28 matching lines...) Expand all  Loading... | 
| 1285       break; | 1297       break; | 
| 1286     case MachineRepresentation::kFloat64: | 1298     case MachineRepresentation::kFloat64: | 
| 1287       opcode = kCheckedLoadFloat64; | 1299       opcode = kCheckedLoadFloat64; | 
| 1288       break; | 1300       break; | 
| 1289     case MachineRepresentation::kBit:      // Fall through. | 1301     case MachineRepresentation::kBit:      // Fall through. | 
| 1290     case MachineRepresentation::kTaggedSigned:   // Fall through. | 1302     case MachineRepresentation::kTaggedSigned:   // Fall through. | 
| 1291     case MachineRepresentation::kTaggedPointer:  // Fall through. | 1303     case MachineRepresentation::kTaggedPointer:  // Fall through. | 
| 1292     case MachineRepresentation::kTagged:   // Fall through. | 1304     case MachineRepresentation::kTagged:   // Fall through. | 
| 1293     case MachineRepresentation::kWord64:   // Fall through. | 1305     case MachineRepresentation::kWord64:   // Fall through. | 
| 1294     case MachineRepresentation::kSimd128:  // Fall through. | 1306     case MachineRepresentation::kSimd128:  // Fall through. | 
|  | 1307     case MachineRepresentation::kSimd1x4:  // Fall through. | 
|  | 1308     case MachineRepresentation::kSimd1x8:  // Fall through. | 
|  | 1309     case MachineRepresentation::kSimd1x16:  // Fall through. | 
| 1295     case MachineRepresentation::kNone: | 1310     case MachineRepresentation::kNone: | 
| 1296       UNREACHABLE(); | 1311       UNREACHABLE(); | 
| 1297       return; | 1312       return; | 
| 1298   } | 1313   } | 
| 1299   InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) | 1314   InstructionOperand offset_operand = g.CanBeImmediate(offset, opcode) | 
| 1300                                           ? g.UseImmediate(offset) | 1315                                           ? g.UseImmediate(offset) | 
| 1301                                           : g.UseRegister(offset); | 1316                                           : g.UseRegister(offset); | 
| 1302 | 1317 | 
| 1303   InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) | 1318   InstructionOperand length_operand = (!g.CanBeImmediate(offset, opcode)) | 
| 1304                                           ? g.CanBeImmediate(length, opcode) | 1319                                           ? g.CanBeImmediate(length, opcode) | 
| (...skipping 596 matching lines...) Expand 10 before | Expand all | Expand 10 after  Loading... | 
| 1901     DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 1916     DCHECK(IsMipsArchVariant(kLoongson) || IsMipsArchVariant(kMips32r1) || | 
| 1902            IsMipsArchVariant(kMips32r2)); | 1917            IsMipsArchVariant(kMips32r2)); | 
| 1903     return MachineOperatorBuilder::AlignmentRequirements:: | 1918     return MachineOperatorBuilder::AlignmentRequirements:: | 
| 1904         NoUnalignedAccessSupport(); | 1919         NoUnalignedAccessSupport(); | 
| 1905   } | 1920   } | 
| 1906 } | 1921 } | 
| 1907 | 1922 | 
| 1908 }  // namespace compiler | 1923 }  // namespace compiler | 
| 1909 }  // namespace internal | 1924 }  // namespace internal | 
| 1910 }  // namespace v8 | 1925 }  // namespace v8 | 
| OLD | NEW | 
|---|