xref: /freebsd/contrib/llvm-project/llvm/lib/Target/ARM/ARMInstrNEON.td (revision 0fca6ea1d4eea4c934cfff25ac9ee8ad6fe95583)
10b57cec5SDimitry Andric//===-- ARMInstrNEON.td - NEON support for ARM -------------*- tablegen -*-===//
20b57cec5SDimitry Andric//
30b57cec5SDimitry Andric// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
40b57cec5SDimitry Andric// See https://llvm.org/LICENSE.txt for license information.
50b57cec5SDimitry Andric// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
60b57cec5SDimitry Andric//
70b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80b57cec5SDimitry Andric//
90b57cec5SDimitry Andric// This file describes the ARM NEON instruction set.
100b57cec5SDimitry Andric//
110b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
120b57cec5SDimitry Andric
130b57cec5SDimitry Andric
140b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
150b57cec5SDimitry Andric// NEON-specific Operands.
160b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
170b57cec5SDimitry Andricdef nModImm : Operand<i32> {
188bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
190b57cec5SDimitry Andric}
200b57cec5SDimitry Andric
210b57cec5SDimitry Andricdef nImmSplatI8AsmOperand : AsmOperandClass { let Name = "NEONi8splat"; }
220b57cec5SDimitry Andricdef nImmSplatI8 : Operand<i32> {
238bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
240b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatI8AsmOperand;
250b57cec5SDimitry Andric}
260b57cec5SDimitry Andricdef nImmSplatI16AsmOperand : AsmOperandClass { let Name = "NEONi16splat"; }
270b57cec5SDimitry Andricdef nImmSplatI16 : Operand<i32> {
288bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
290b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatI16AsmOperand;
300b57cec5SDimitry Andric}
310b57cec5SDimitry Andricdef nImmSplatI32AsmOperand : AsmOperandClass { let Name = "NEONi32splat"; }
320b57cec5SDimitry Andricdef nImmSplatI32 : Operand<i32> {
338bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
340b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatI32AsmOperand;
350b57cec5SDimitry Andric}
360b57cec5SDimitry Andricdef nImmSplatNotI16AsmOperand : AsmOperandClass { let Name = "NEONi16splatNot"; }
370b57cec5SDimitry Andricdef nImmSplatNotI16 : Operand<i32> {
380b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatNotI16AsmOperand;
390b57cec5SDimitry Andric}
400b57cec5SDimitry Andricdef nImmSplatNotI32AsmOperand : AsmOperandClass { let Name = "NEONi32splatNot"; }
410b57cec5SDimitry Andricdef nImmSplatNotI32 : Operand<i32> {
420b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatNotI32AsmOperand;
430b57cec5SDimitry Andric}
440b57cec5SDimitry Andricdef nImmVMOVI32AsmOperand : AsmOperandClass { let Name = "NEONi32vmov"; }
450b57cec5SDimitry Andricdef nImmVMOVI32 : Operand<i32> {
468bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
470b57cec5SDimitry Andric  let ParserMatchClass = nImmVMOVI32AsmOperand;
480b57cec5SDimitry Andric}
490b57cec5SDimitry Andric
500b57cec5SDimitry Andricclass nImmVMOVIAsmOperandReplicate<ValueType From, ValueType To>
510b57cec5SDimitry Andric  : AsmOperandClass {
520b57cec5SDimitry Andric  let Name = "NEONi" # To.Size # "vmovi" # From.Size # "Replicate";
530b57cec5SDimitry Andric  let PredicateMethod = "isNEONmovReplicate<" # From.Size # ", " # To.Size # ">";
540b57cec5SDimitry Andric  let RenderMethod = "addNEONvmovi" # From.Size # "ReplicateOperands";
550b57cec5SDimitry Andric}
560b57cec5SDimitry Andric
570b57cec5SDimitry Andricclass nImmVINVIAsmOperandReplicate<ValueType From, ValueType To>
580b57cec5SDimitry Andric  : AsmOperandClass {
590b57cec5SDimitry Andric  let Name = "NEONi" # To.Size # "invi" # From.Size # "Replicate";
600b57cec5SDimitry Andric  let PredicateMethod = "isNEONinvReplicate<" # From.Size # ", " # To.Size # ">";
610b57cec5SDimitry Andric  let RenderMethod = "addNEONinvi" # From.Size # "ReplicateOperands";
620b57cec5SDimitry Andric}
630b57cec5SDimitry Andric
640b57cec5SDimitry Andricclass nImmVMOVIReplicate<ValueType From, ValueType To> : Operand<i32> {
658bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
660b57cec5SDimitry Andric  let ParserMatchClass = nImmVMOVIAsmOperandReplicate<From, To>;
670b57cec5SDimitry Andric}
680b57cec5SDimitry Andric
690b57cec5SDimitry Andricclass nImmVINVIReplicate<ValueType From, ValueType To> : Operand<i32> {
708bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
710b57cec5SDimitry Andric  let ParserMatchClass = nImmVINVIAsmOperandReplicate<From, To>;
720b57cec5SDimitry Andric}
730b57cec5SDimitry Andric
740b57cec5SDimitry Andricdef nImmVMOVI32NegAsmOperand : AsmOperandClass { let Name = "NEONi32vmovNeg"; }
750b57cec5SDimitry Andricdef nImmVMOVI32Neg : Operand<i32> {
768bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
770b57cec5SDimitry Andric  let ParserMatchClass = nImmVMOVI32NegAsmOperand;
780b57cec5SDimitry Andric}
790b57cec5SDimitry Andricdef nImmVMOVF32 : Operand<i32> {
800b57cec5SDimitry Andric  let PrintMethod = "printFPImmOperand";
810b57cec5SDimitry Andric  let ParserMatchClass = FPImmOperand;
820b57cec5SDimitry Andric}
830b57cec5SDimitry Andricdef nImmSplatI64AsmOperand : AsmOperandClass { let Name = "NEONi64splat"; }
840b57cec5SDimitry Andricdef nImmSplatI64 : Operand<i32> {
858bcb0991SDimitry Andric  let PrintMethod = "printVMOVModImmOperand";
860b57cec5SDimitry Andric  let ParserMatchClass = nImmSplatI64AsmOperand;
870b57cec5SDimitry Andric}
880b57cec5SDimitry Andric
890b57cec5SDimitry Andricdef VectorIndex8Operand  : AsmOperandClass { let Name = "VectorIndex8"; }
900b57cec5SDimitry Andricdef VectorIndex16Operand : AsmOperandClass { let Name = "VectorIndex16"; }
910b57cec5SDimitry Andricdef VectorIndex32Operand : AsmOperandClass { let Name = "VectorIndex32"; }
920b57cec5SDimitry Andricdef VectorIndex64Operand : AsmOperandClass { let Name = "VectorIndex64"; }
930b57cec5SDimitry Andricdef VectorIndex8 : Operand<i32>, ImmLeaf<i32, [{
940b57cec5SDimitry Andric  return ((uint64_t)Imm) < 8;
950b57cec5SDimitry Andric}]> {
960b57cec5SDimitry Andric  let ParserMatchClass = VectorIndex8Operand;
970b57cec5SDimitry Andric  let PrintMethod = "printVectorIndex";
980b57cec5SDimitry Andric  let MIOperandInfo = (ops i32imm);
990b57cec5SDimitry Andric}
1000b57cec5SDimitry Andricdef VectorIndex16 : Operand<i32>, ImmLeaf<i32, [{
1010b57cec5SDimitry Andric  return ((uint64_t)Imm) < 4;
1020b57cec5SDimitry Andric}]> {
1030b57cec5SDimitry Andric  let ParserMatchClass = VectorIndex16Operand;
1040b57cec5SDimitry Andric  let PrintMethod = "printVectorIndex";
1050b57cec5SDimitry Andric  let MIOperandInfo = (ops i32imm);
1060b57cec5SDimitry Andric}
1070b57cec5SDimitry Andricdef VectorIndex32 : Operand<i32>, ImmLeaf<i32, [{
1080b57cec5SDimitry Andric  return ((uint64_t)Imm) < 2;
1090b57cec5SDimitry Andric}]> {
1100b57cec5SDimitry Andric  let ParserMatchClass = VectorIndex32Operand;
1110b57cec5SDimitry Andric  let PrintMethod = "printVectorIndex";
1120b57cec5SDimitry Andric  let MIOperandInfo = (ops i32imm);
1130b57cec5SDimitry Andric}
1140b57cec5SDimitry Andricdef VectorIndex64 : Operand<i32>, ImmLeaf<i32, [{
1150b57cec5SDimitry Andric  return ((uint64_t)Imm) < 1;
1160b57cec5SDimitry Andric}]> {
1170b57cec5SDimitry Andric  let ParserMatchClass = VectorIndex64Operand;
1180b57cec5SDimitry Andric  let PrintMethod = "printVectorIndex";
1190b57cec5SDimitry Andric  let MIOperandInfo = (ops i32imm);
1200b57cec5SDimitry Andric}
1210b57cec5SDimitry Andric
1220b57cec5SDimitry Andric// Register list of one D register.
1230b57cec5SDimitry Andricdef VecListOneDAsmOperand : AsmOperandClass {
1240b57cec5SDimitry Andric  let Name = "VecListOneD";
1250b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1260b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1270b57cec5SDimitry Andric}
1280b57cec5SDimitry Andricdef VecListOneD : RegisterOperand<DPR, "printVectorListOne"> {
1290b57cec5SDimitry Andric  let ParserMatchClass = VecListOneDAsmOperand;
1300b57cec5SDimitry Andric}
1310b57cec5SDimitry Andric// Register list of two sequential D registers.
1320b57cec5SDimitry Andricdef VecListDPairAsmOperand : AsmOperandClass {
1330b57cec5SDimitry Andric  let Name = "VecListDPair";
1340b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1350b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1360b57cec5SDimitry Andric}
1370b57cec5SDimitry Andricdef VecListDPair : RegisterOperand<DPair, "printVectorListTwo"> {
1380b57cec5SDimitry Andric  let ParserMatchClass = VecListDPairAsmOperand;
1390b57cec5SDimitry Andric}
1400b57cec5SDimitry Andric// Register list of three sequential D registers.
1410b57cec5SDimitry Andricdef VecListThreeDAsmOperand : AsmOperandClass {
1420b57cec5SDimitry Andric  let Name = "VecListThreeD";
1430b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1440b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1450b57cec5SDimitry Andric}
1460b57cec5SDimitry Andricdef VecListThreeD : RegisterOperand<DPR, "printVectorListThree"> {
1470b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeDAsmOperand;
1480b57cec5SDimitry Andric}
1490b57cec5SDimitry Andric// Register list of four sequential D registers.
1500b57cec5SDimitry Andricdef VecListFourDAsmOperand : AsmOperandClass {
1510b57cec5SDimitry Andric  let Name = "VecListFourD";
1520b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1530b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1540b57cec5SDimitry Andric}
1550b57cec5SDimitry Andricdef VecListFourD : RegisterOperand<DPR, "printVectorListFour"> {
1560b57cec5SDimitry Andric  let ParserMatchClass = VecListFourDAsmOperand;
1570b57cec5SDimitry Andric}
1580b57cec5SDimitry Andric// Register list of two D registers spaced by 2 (two sequential Q registers).
1590b57cec5SDimitry Andricdef VecListDPairSpacedAsmOperand : AsmOperandClass {
1600b57cec5SDimitry Andric  let Name = "VecListDPairSpaced";
1610b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1620b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1630b57cec5SDimitry Andric}
1640b57cec5SDimitry Andricdef VecListDPairSpaced : RegisterOperand<DPair, "printVectorListTwoSpaced"> {
1650b57cec5SDimitry Andric  let ParserMatchClass = VecListDPairSpacedAsmOperand;
1660b57cec5SDimitry Andric}
1670b57cec5SDimitry Andric// Register list of three D registers spaced by 2 (three Q registers).
1680b57cec5SDimitry Andricdef VecListThreeQAsmOperand : AsmOperandClass {
1690b57cec5SDimitry Andric  let Name = "VecListThreeQ";
1700b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1710b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1720b57cec5SDimitry Andric}
1730b57cec5SDimitry Andricdef VecListThreeQ : RegisterOperand<DPR, "printVectorListThreeSpaced"> {
1740b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeQAsmOperand;
1750b57cec5SDimitry Andric}
1760b57cec5SDimitry Andric// Register list of three D registers spaced by 2 (three Q registers).
1770b57cec5SDimitry Andricdef VecListFourQAsmOperand : AsmOperandClass {
1780b57cec5SDimitry Andric  let Name = "VecListFourQ";
1790b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1800b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1810b57cec5SDimitry Andric}
1820b57cec5SDimitry Andricdef VecListFourQ : RegisterOperand<DPR, "printVectorListFourSpaced"> {
1830b57cec5SDimitry Andric  let ParserMatchClass = VecListFourQAsmOperand;
1840b57cec5SDimitry Andric}
1850b57cec5SDimitry Andric
1860b57cec5SDimitry Andric// Register list of one D register, with "all lanes" subscripting.
1870b57cec5SDimitry Andricdef VecListOneDAllLanesAsmOperand : AsmOperandClass {
1880b57cec5SDimitry Andric  let Name = "VecListOneDAllLanes";
1890b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1900b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
1910b57cec5SDimitry Andric}
1920b57cec5SDimitry Andricdef VecListOneDAllLanes : RegisterOperand<DPR, "printVectorListOneAllLanes"> {
1930b57cec5SDimitry Andric  let ParserMatchClass = VecListOneDAllLanesAsmOperand;
1940b57cec5SDimitry Andric}
1950b57cec5SDimitry Andric// Register list of two D registers, with "all lanes" subscripting.
1960b57cec5SDimitry Andricdef VecListDPairAllLanesAsmOperand : AsmOperandClass {
1970b57cec5SDimitry Andric  let Name = "VecListDPairAllLanes";
1980b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
1990b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2000b57cec5SDimitry Andric}
2010b57cec5SDimitry Andricdef VecListDPairAllLanes : RegisterOperand<DPair,
2020b57cec5SDimitry Andric                                           "printVectorListTwoAllLanes"> {
2030b57cec5SDimitry Andric  let ParserMatchClass = VecListDPairAllLanesAsmOperand;
2040b57cec5SDimitry Andric}
2050b57cec5SDimitry Andric// Register list of two D registers spaced by 2 (two sequential Q registers).
2060b57cec5SDimitry Andricdef VecListDPairSpacedAllLanesAsmOperand : AsmOperandClass {
2070b57cec5SDimitry Andric  let Name = "VecListDPairSpacedAllLanes";
2080b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2090b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2100b57cec5SDimitry Andric}
2110b57cec5SDimitry Andricdef VecListDPairSpacedAllLanes : RegisterOperand<DPairSpc,
2120b57cec5SDimitry Andric                                         "printVectorListTwoSpacedAllLanes"> {
2130b57cec5SDimitry Andric  let ParserMatchClass = VecListDPairSpacedAllLanesAsmOperand;
2140b57cec5SDimitry Andric}
2150b57cec5SDimitry Andric// Register list of three D registers, with "all lanes" subscripting.
2160b57cec5SDimitry Andricdef VecListThreeDAllLanesAsmOperand : AsmOperandClass {
2170b57cec5SDimitry Andric  let Name = "VecListThreeDAllLanes";
2180b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2190b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2200b57cec5SDimitry Andric}
2210b57cec5SDimitry Andricdef VecListThreeDAllLanes : RegisterOperand<DPR,
2220b57cec5SDimitry Andric                                            "printVectorListThreeAllLanes"> {
2230b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeDAllLanesAsmOperand;
2240b57cec5SDimitry Andric}
2250b57cec5SDimitry Andric// Register list of three D registers spaced by 2 (three sequential Q regs).
2260b57cec5SDimitry Andricdef VecListThreeQAllLanesAsmOperand : AsmOperandClass {
2270b57cec5SDimitry Andric  let Name = "VecListThreeQAllLanes";
2280b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2290b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2300b57cec5SDimitry Andric}
2310b57cec5SDimitry Andricdef VecListThreeQAllLanes : RegisterOperand<DPR,
2320b57cec5SDimitry Andric                                         "printVectorListThreeSpacedAllLanes"> {
2330b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeQAllLanesAsmOperand;
2340b57cec5SDimitry Andric}
2350b57cec5SDimitry Andric// Register list of four D registers, with "all lanes" subscripting.
2360b57cec5SDimitry Andricdef VecListFourDAllLanesAsmOperand : AsmOperandClass {
2370b57cec5SDimitry Andric  let Name = "VecListFourDAllLanes";
2380b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2390b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2400b57cec5SDimitry Andric}
2410b57cec5SDimitry Andricdef VecListFourDAllLanes : RegisterOperand<DPR, "printVectorListFourAllLanes"> {
2420b57cec5SDimitry Andric  let ParserMatchClass = VecListFourDAllLanesAsmOperand;
2430b57cec5SDimitry Andric}
2440b57cec5SDimitry Andric// Register list of four D registers spaced by 2 (four sequential Q regs).
2450b57cec5SDimitry Andricdef VecListFourQAllLanesAsmOperand : AsmOperandClass {
2460b57cec5SDimitry Andric  let Name = "VecListFourQAllLanes";
2470b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2480b57cec5SDimitry Andric  let RenderMethod = "addVecListOperands";
2490b57cec5SDimitry Andric}
2500b57cec5SDimitry Andricdef VecListFourQAllLanes : RegisterOperand<DPR,
2510b57cec5SDimitry Andric                                         "printVectorListFourSpacedAllLanes"> {
2520b57cec5SDimitry Andric  let ParserMatchClass = VecListFourQAllLanesAsmOperand;
2530b57cec5SDimitry Andric}
2540b57cec5SDimitry Andric
2550b57cec5SDimitry Andric
2560b57cec5SDimitry Andric// Register list of one D register, with byte lane subscripting.
2570b57cec5SDimitry Andricdef VecListOneDByteIndexAsmOperand : AsmOperandClass {
2580b57cec5SDimitry Andric  let Name = "VecListOneDByteIndexed";
2590b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2600b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
2610b57cec5SDimitry Andric}
2620b57cec5SDimitry Andricdef VecListOneDByteIndexed : Operand<i32> {
2630b57cec5SDimitry Andric  let ParserMatchClass = VecListOneDByteIndexAsmOperand;
2640b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
2650b57cec5SDimitry Andric}
2660b57cec5SDimitry Andric// ...with half-word lane subscripting.
2670b57cec5SDimitry Andricdef VecListOneDHWordIndexAsmOperand : AsmOperandClass {
2680b57cec5SDimitry Andric  let Name = "VecListOneDHWordIndexed";
2690b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2700b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
2710b57cec5SDimitry Andric}
2720b57cec5SDimitry Andricdef VecListOneDHWordIndexed : Operand<i32> {
2730b57cec5SDimitry Andric  let ParserMatchClass = VecListOneDHWordIndexAsmOperand;
2740b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
2750b57cec5SDimitry Andric}
2760b57cec5SDimitry Andric// ...with word lane subscripting.
2770b57cec5SDimitry Andricdef VecListOneDWordIndexAsmOperand : AsmOperandClass {
2780b57cec5SDimitry Andric  let Name = "VecListOneDWordIndexed";
2790b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2800b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
2810b57cec5SDimitry Andric}
2820b57cec5SDimitry Andricdef VecListOneDWordIndexed : Operand<i32> {
2830b57cec5SDimitry Andric  let ParserMatchClass = VecListOneDWordIndexAsmOperand;
2840b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
2850b57cec5SDimitry Andric}
2860b57cec5SDimitry Andric
2870b57cec5SDimitry Andric// Register list of two D registers with byte lane subscripting.
2880b57cec5SDimitry Andricdef VecListTwoDByteIndexAsmOperand : AsmOperandClass {
2890b57cec5SDimitry Andric  let Name = "VecListTwoDByteIndexed";
2900b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
2910b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
2920b57cec5SDimitry Andric}
2930b57cec5SDimitry Andricdef VecListTwoDByteIndexed : Operand<i32> {
2940b57cec5SDimitry Andric  let ParserMatchClass = VecListTwoDByteIndexAsmOperand;
2950b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
2960b57cec5SDimitry Andric}
2970b57cec5SDimitry Andric// ...with half-word lane subscripting.
2980b57cec5SDimitry Andricdef VecListTwoDHWordIndexAsmOperand : AsmOperandClass {
2990b57cec5SDimitry Andric  let Name = "VecListTwoDHWordIndexed";
3000b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3010b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3020b57cec5SDimitry Andric}
3030b57cec5SDimitry Andricdef VecListTwoDHWordIndexed : Operand<i32> {
3040b57cec5SDimitry Andric  let ParserMatchClass = VecListTwoDHWordIndexAsmOperand;
3050b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3060b57cec5SDimitry Andric}
3070b57cec5SDimitry Andric// ...with word lane subscripting.
3080b57cec5SDimitry Andricdef VecListTwoDWordIndexAsmOperand : AsmOperandClass {
3090b57cec5SDimitry Andric  let Name = "VecListTwoDWordIndexed";
3100b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3110b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3120b57cec5SDimitry Andric}
3130b57cec5SDimitry Andricdef VecListTwoDWordIndexed : Operand<i32> {
3140b57cec5SDimitry Andric  let ParserMatchClass = VecListTwoDWordIndexAsmOperand;
3150b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3160b57cec5SDimitry Andric}
3170b57cec5SDimitry Andric// Register list of two Q registers with half-word lane subscripting.
3180b57cec5SDimitry Andricdef VecListTwoQHWordIndexAsmOperand : AsmOperandClass {
3190b57cec5SDimitry Andric  let Name = "VecListTwoQHWordIndexed";
3200b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3210b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3220b57cec5SDimitry Andric}
3230b57cec5SDimitry Andricdef VecListTwoQHWordIndexed : Operand<i32> {
3240b57cec5SDimitry Andric  let ParserMatchClass = VecListTwoQHWordIndexAsmOperand;
3250b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3260b57cec5SDimitry Andric}
3270b57cec5SDimitry Andric// ...with word lane subscripting.
3280b57cec5SDimitry Andricdef VecListTwoQWordIndexAsmOperand : AsmOperandClass {
3290b57cec5SDimitry Andric  let Name = "VecListTwoQWordIndexed";
3300b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3310b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3320b57cec5SDimitry Andric}
3330b57cec5SDimitry Andricdef VecListTwoQWordIndexed : Operand<i32> {
3340b57cec5SDimitry Andric  let ParserMatchClass = VecListTwoQWordIndexAsmOperand;
3350b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3360b57cec5SDimitry Andric}
3370b57cec5SDimitry Andric
3380b57cec5SDimitry Andric
3390b57cec5SDimitry Andric// Register list of three D registers with byte lane subscripting.
3400b57cec5SDimitry Andricdef VecListThreeDByteIndexAsmOperand : AsmOperandClass {
3410b57cec5SDimitry Andric  let Name = "VecListThreeDByteIndexed";
3420b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3430b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3440b57cec5SDimitry Andric}
3450b57cec5SDimitry Andricdef VecListThreeDByteIndexed : Operand<i32> {
3460b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeDByteIndexAsmOperand;
3470b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3480b57cec5SDimitry Andric}
3490b57cec5SDimitry Andric// ...with half-word lane subscripting.
3500b57cec5SDimitry Andricdef VecListThreeDHWordIndexAsmOperand : AsmOperandClass {
3510b57cec5SDimitry Andric  let Name = "VecListThreeDHWordIndexed";
3520b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3530b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3540b57cec5SDimitry Andric}
3550b57cec5SDimitry Andricdef VecListThreeDHWordIndexed : Operand<i32> {
3560b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeDHWordIndexAsmOperand;
3570b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3580b57cec5SDimitry Andric}
3590b57cec5SDimitry Andric// ...with word lane subscripting.
3600b57cec5SDimitry Andricdef VecListThreeDWordIndexAsmOperand : AsmOperandClass {
3610b57cec5SDimitry Andric  let Name = "VecListThreeDWordIndexed";
3620b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3630b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3640b57cec5SDimitry Andric}
3650b57cec5SDimitry Andricdef VecListThreeDWordIndexed : Operand<i32> {
3660b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeDWordIndexAsmOperand;
3670b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3680b57cec5SDimitry Andric}
3690b57cec5SDimitry Andric// Register list of three Q registers with half-word lane subscripting.
3700b57cec5SDimitry Andricdef VecListThreeQHWordIndexAsmOperand : AsmOperandClass {
3710b57cec5SDimitry Andric  let Name = "VecListThreeQHWordIndexed";
3720b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3730b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3740b57cec5SDimitry Andric}
3750b57cec5SDimitry Andricdef VecListThreeQHWordIndexed : Operand<i32> {
3760b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeQHWordIndexAsmOperand;
3770b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3780b57cec5SDimitry Andric}
3790b57cec5SDimitry Andric// ...with word lane subscripting.
3800b57cec5SDimitry Andricdef VecListThreeQWordIndexAsmOperand : AsmOperandClass {
3810b57cec5SDimitry Andric  let Name = "VecListThreeQWordIndexed";
3820b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3830b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3840b57cec5SDimitry Andric}
3850b57cec5SDimitry Andricdef VecListThreeQWordIndexed : Operand<i32> {
3860b57cec5SDimitry Andric  let ParserMatchClass = VecListThreeQWordIndexAsmOperand;
3870b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3880b57cec5SDimitry Andric}
3890b57cec5SDimitry Andric
3900b57cec5SDimitry Andric// Register list of four D registers with byte lane subscripting.
3910b57cec5SDimitry Andricdef VecListFourDByteIndexAsmOperand : AsmOperandClass {
3920b57cec5SDimitry Andric  let Name = "VecListFourDByteIndexed";
3930b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
3940b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
3950b57cec5SDimitry Andric}
3960b57cec5SDimitry Andricdef VecListFourDByteIndexed : Operand<i32> {
3970b57cec5SDimitry Andric  let ParserMatchClass = VecListFourDByteIndexAsmOperand;
3980b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
3990b57cec5SDimitry Andric}
4000b57cec5SDimitry Andric// ...with half-word lane subscripting.
4010b57cec5SDimitry Andricdef VecListFourDHWordIndexAsmOperand : AsmOperandClass {
4020b57cec5SDimitry Andric  let Name = "VecListFourDHWordIndexed";
4030b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
4040b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
4050b57cec5SDimitry Andric}
4060b57cec5SDimitry Andricdef VecListFourDHWordIndexed : Operand<i32> {
4070b57cec5SDimitry Andric  let ParserMatchClass = VecListFourDHWordIndexAsmOperand;
4080b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
4090b57cec5SDimitry Andric}
4100b57cec5SDimitry Andric// ...with word lane subscripting.
4110b57cec5SDimitry Andricdef VecListFourDWordIndexAsmOperand : AsmOperandClass {
4120b57cec5SDimitry Andric  let Name = "VecListFourDWordIndexed";
4130b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
4140b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
4150b57cec5SDimitry Andric}
4160b57cec5SDimitry Andricdef VecListFourDWordIndexed : Operand<i32> {
4170b57cec5SDimitry Andric  let ParserMatchClass = VecListFourDWordIndexAsmOperand;
4180b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
4190b57cec5SDimitry Andric}
4200b57cec5SDimitry Andric// Register list of four Q registers with half-word lane subscripting.
4210b57cec5SDimitry Andricdef VecListFourQHWordIndexAsmOperand : AsmOperandClass {
4220b57cec5SDimitry Andric  let Name = "VecListFourQHWordIndexed";
4230b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
4240b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
4250b57cec5SDimitry Andric}
4260b57cec5SDimitry Andricdef VecListFourQHWordIndexed : Operand<i32> {
4270b57cec5SDimitry Andric  let ParserMatchClass = VecListFourQHWordIndexAsmOperand;
4280b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
4290b57cec5SDimitry Andric}
4300b57cec5SDimitry Andric// ...with word lane subscripting.
4310b57cec5SDimitry Andricdef VecListFourQWordIndexAsmOperand : AsmOperandClass {
4320b57cec5SDimitry Andric  let Name = "VecListFourQWordIndexed";
4330b57cec5SDimitry Andric  let ParserMethod = "parseVectorList";
4340b57cec5SDimitry Andric  let RenderMethod = "addVecListIndexedOperands";
4350b57cec5SDimitry Andric}
4360b57cec5SDimitry Andricdef VecListFourQWordIndexed : Operand<i32> {
4370b57cec5SDimitry Andric  let ParserMatchClass = VecListFourQWordIndexAsmOperand;
4380b57cec5SDimitry Andric  let MIOperandInfo = (ops DPR:$Vd, i32imm:$idx);
4390b57cec5SDimitry Andric}
4400b57cec5SDimitry Andric
4410b57cec5SDimitry Andricdef dword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
442bdd1243dSDimitry Andric  return cast<LoadSDNode>(N)->getAlign() >= 8;
4430b57cec5SDimitry Andric}]>;
4440b57cec5SDimitry Andricdef dword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4450b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
446bdd1243dSDimitry Andric  return cast<StoreSDNode>(N)->getAlign() >= 8;
4470b57cec5SDimitry Andric}]>;
4480b57cec5SDimitry Andricdef word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
449bdd1243dSDimitry Andric  return cast<LoadSDNode>(N)->getAlign() == 4;
4500b57cec5SDimitry Andric}]>;
4510b57cec5SDimitry Andricdef word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4520b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
453bdd1243dSDimitry Andric  return cast<StoreSDNode>(N)->getAlign() == 4;
4540b57cec5SDimitry Andric}]>;
4550b57cec5SDimitry Andricdef hword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
456bdd1243dSDimitry Andric  return cast<LoadSDNode>(N)->getAlign() == 2;
4570b57cec5SDimitry Andric}]>;
4580b57cec5SDimitry Andricdef hword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4590b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
460bdd1243dSDimitry Andric  return cast<StoreSDNode>(N)->getAlign() == 2;
4610b57cec5SDimitry Andric}]>;
4620b57cec5SDimitry Andricdef byte_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
463bdd1243dSDimitry Andric  return cast<LoadSDNode>(N)->getAlign() == 1;
4640b57cec5SDimitry Andric}]>;
4650b57cec5SDimitry Andricdef byte_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4660b57cec5SDimitry Andric                             (store node:$val, node:$ptr), [{
467bdd1243dSDimitry Andric  return cast<StoreSDNode>(N)->getAlign() == 1;
4680b57cec5SDimitry Andric}]>;
4690b57cec5SDimitry Andricdef non_word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
470bdd1243dSDimitry Andric  return cast<LoadSDNode>(N)->getAlign() < 4;
4710b57cec5SDimitry Andric}]>;
4720b57cec5SDimitry Andricdef non_word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4730b57cec5SDimitry Andric                                    (store node:$val, node:$ptr), [{
474bdd1243dSDimitry Andric  return cast<StoreSDNode>(N)->getAlign() < 4;
4750b57cec5SDimitry Andric}]>;
4760b57cec5SDimitry Andric
4770b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4780b57cec5SDimitry Andric// NEON-specific DAG Nodes.
4790b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
4800b57cec5SDimitry Andric
4818bcb0991SDimitry Andricdef SDTARMVTST    : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisSameAs<1, 2>]>;
4828bcb0991SDimitry Andricdef NEONvtst      : SDNode<"ARMISD::VTST", SDTARMVTST>;
4830b57cec5SDimitry Andric
4840b57cec5SDimitry Andric// Types for vector shift by immediates.  The "SHX" version is for long and
4850b57cec5SDimitry Andric// narrow operations where the source and destination vectors have different
4860b57cec5SDimitry Andric// types.  The "SHINS" version is for shift and insert operations.
4870b57cec5SDimitry Andricdef SDTARMVSHXIMM    : SDTypeProfile<1, 2, [SDTCisInt<0>, SDTCisInt<1>,
4880b57cec5SDimitry Andric                                            SDTCisVT<2, i32>]>;
4890b57cec5SDimitry Andricdef SDTARMVSHINSIMM  : SDTypeProfile<1, 3, [SDTCisInt<0>, SDTCisSameAs<0, 1>,
4900b57cec5SDimitry Andric                                            SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
4910b57cec5SDimitry Andric
4920b57cec5SDimitry Andricdef NEONvshrnImm     : SDNode<"ARMISD::VSHRNIMM", SDTARMVSHXIMM>;
4930b57cec5SDimitry Andric
4940b57cec5SDimitry Andricdef NEONvrshrsImm    : SDNode<"ARMISD::VRSHRsIMM", SDTARMVSHIMM>;
4950b57cec5SDimitry Andricdef NEONvrshruImm    : SDNode<"ARMISD::VRSHRuIMM", SDTARMVSHIMM>;
4960b57cec5SDimitry Andricdef NEONvrshrnImm    : SDNode<"ARMISD::VRSHRNIMM", SDTARMVSHXIMM>;
4970b57cec5SDimitry Andric
4980b57cec5SDimitry Andricdef NEONvqshlsImm    : SDNode<"ARMISD::VQSHLsIMM", SDTARMVSHIMM>;
4990b57cec5SDimitry Andricdef NEONvqshluImm    : SDNode<"ARMISD::VQSHLuIMM", SDTARMVSHIMM>;
5000b57cec5SDimitry Andricdef NEONvqshlsuImm   : SDNode<"ARMISD::VQSHLsuIMM", SDTARMVSHIMM>;
5010b57cec5SDimitry Andricdef NEONvqshrnsImm   : SDNode<"ARMISD::VQSHRNsIMM", SDTARMVSHXIMM>;
5020b57cec5SDimitry Andricdef NEONvqshrnuImm   : SDNode<"ARMISD::VQSHRNuIMM", SDTARMVSHXIMM>;
5030b57cec5SDimitry Andricdef NEONvqshrnsuImm  : SDNode<"ARMISD::VQSHRNsuIMM", SDTARMVSHXIMM>;
5040b57cec5SDimitry Andric
5050b57cec5SDimitry Andricdef NEONvqrshrnsImm  : SDNode<"ARMISD::VQRSHRNsIMM", SDTARMVSHXIMM>;
5060b57cec5SDimitry Andricdef NEONvqrshrnuImm  : SDNode<"ARMISD::VQRSHRNuIMM", SDTARMVSHXIMM>;
5070b57cec5SDimitry Andricdef NEONvqrshrnsuImm : SDNode<"ARMISD::VQRSHRNsuIMM", SDTARMVSHXIMM>;
5080b57cec5SDimitry Andric
5090b57cec5SDimitry Andricdef NEONvsliImm      : SDNode<"ARMISD::VSLIIMM", SDTARMVSHINSIMM>;
5100b57cec5SDimitry Andricdef NEONvsriImm      : SDNode<"ARMISD::VSRIIMM", SDTARMVSHINSIMM>;
5110b57cec5SDimitry Andric
512e8d8bef9SDimitry Andricdef NEONvbsp      : SDNode<"ARMISD::VBSP",
5130b57cec5SDimitry Andric                           SDTypeProfile<1, 3, [SDTCisVec<0>,
5140b57cec5SDimitry Andric                                                SDTCisSameAs<0, 1>,
5150b57cec5SDimitry Andric                                                SDTCisSameAs<0, 2>,
5160b57cec5SDimitry Andric                                                SDTCisSameAs<0, 3>]>>;
5170b57cec5SDimitry Andric
5180b57cec5SDimitry Andricdef SDTARMVEXT    : SDTypeProfile<1, 3, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
5190b57cec5SDimitry Andric                                         SDTCisSameAs<0, 2>, SDTCisVT<3, i32>]>;
5200b57cec5SDimitry Andricdef NEONvext      : SDNode<"ARMISD::VEXT", SDTARMVEXT>;
5210b57cec5SDimitry Andric
5220b57cec5SDimitry Andricdef SDTARMVSHUF2  : SDTypeProfile<2, 2, [SDTCisVec<0>, SDTCisSameAs<0, 1>,
5230b57cec5SDimitry Andric                                         SDTCisSameAs<0, 2>,
5240b57cec5SDimitry Andric                                         SDTCisSameAs<0, 3>]>;
5250b57cec5SDimitry Andricdef NEONzip       : SDNode<"ARMISD::VZIP", SDTARMVSHUF2>;
5260b57cec5SDimitry Andricdef NEONuzp       : SDNode<"ARMISD::VUZP", SDTARMVSHUF2>;
5270b57cec5SDimitry Andricdef NEONtrn       : SDNode<"ARMISD::VTRN", SDTARMVSHUF2>;
5280b57cec5SDimitry Andric
5290b57cec5SDimitry Andricdef SDTARMVTBL1   : SDTypeProfile<1, 2, [SDTCisVT<0, v8i8>, SDTCisVT<1, v8i8>,
5300b57cec5SDimitry Andric                                         SDTCisVT<2, v8i8>]>;
5310b57cec5SDimitry Andricdef SDTARMVTBL2   : SDTypeProfile<1, 3, [SDTCisVT<0, v8i8>, SDTCisVT<1, v8i8>,
5320b57cec5SDimitry Andric                                         SDTCisVT<2, v8i8>, SDTCisVT<3, v8i8>]>;
5330b57cec5SDimitry Andricdef NEONvtbl1     : SDNode<"ARMISD::VTBL1", SDTARMVTBL1>;
5340b57cec5SDimitry Andricdef NEONvtbl2     : SDNode<"ARMISD::VTBL2", SDTARMVTBL2>;
5350b57cec5SDimitry Andric
5360b57cec5SDimitry Andric
5370b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5380b57cec5SDimitry Andric// NEON load / store instructions
5390b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5400b57cec5SDimitry Andric
5410b57cec5SDimitry Andric// Use VLDM to load a Q register as a D register pair.
5420b57cec5SDimitry Andric// This is a pseudo instruction that is expanded to VLDMD after reg alloc.
5430b57cec5SDimitry Andricdef VLDMQIA
5440b57cec5SDimitry Andric  : PseudoVFPLdStM<(outs DPair:$dst), (ins GPR:$Rn),
5450b57cec5SDimitry Andric                    IIC_fpLoad_m, "",
5460b57cec5SDimitry Andric                   [(set DPair:$dst, (v2f64 (word_alignedload GPR:$Rn)))]>;
5470b57cec5SDimitry Andric
5480b57cec5SDimitry Andric// Use VSTM to store a Q register as a D register pair.
5490b57cec5SDimitry Andric// This is a pseudo instruction that is expanded to VSTMD after reg alloc.
5500b57cec5SDimitry Andricdef VSTMQIA
5510b57cec5SDimitry Andric  : PseudoVFPLdStM<(outs), (ins DPair:$src, GPR:$Rn),
5520b57cec5SDimitry Andric                    IIC_fpStore_m, "",
5530b57cec5SDimitry Andric                   [(word_alignedstore (v2f64 DPair:$src), GPR:$Rn)]>;
5540b57cec5SDimitry Andric
5550b57cec5SDimitry Andric// Classes for VLD* pseudo-instructions with multi-register operands.
5560b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
5570b57cec5SDimitry Andricclass VLDQPseudo<InstrItinClass itin>
5580b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
5590b57cec5SDimitry Andricclass VLDQWBPseudo<InstrItinClass itin>
5600b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5610b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset), itin,
5620b57cec5SDimitry Andric                "$addr.addr = $wb">;
5630b57cec5SDimitry Andricclass VLDQWBfixedPseudo<InstrItinClass itin>
5640b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5650b57cec5SDimitry Andric                (ins addrmode6:$addr), itin,
5660b57cec5SDimitry Andric                "$addr.addr = $wb">;
5670b57cec5SDimitry Andricclass VLDQWBregisterPseudo<InstrItinClass itin>
5680b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5690b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset), itin,
5700b57cec5SDimitry Andric                "$addr.addr = $wb">;
5710b57cec5SDimitry Andric
5720b57cec5SDimitry Andricclass VLDQQPseudo<InstrItinClass itin>
5730b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
5740b57cec5SDimitry Andricclass VLDQQWBPseudo<InstrItinClass itin>
5750b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5760b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset), itin,
5770b57cec5SDimitry Andric                "$addr.addr = $wb">;
5780b57cec5SDimitry Andricclass VLDQQWBfixedPseudo<InstrItinClass itin>
5790b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5800b57cec5SDimitry Andric                (ins addrmode6:$addr), itin,
5810b57cec5SDimitry Andric                "$addr.addr = $wb">;
5820b57cec5SDimitry Andricclass VLDQQWBregisterPseudo<InstrItinClass itin>
5830b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5840b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset), itin,
5850b57cec5SDimitry Andric                "$addr.addr = $wb">;
5860b57cec5SDimitry Andric
5870b57cec5SDimitry Andric
5880b57cec5SDimitry Andricclass VLDQQQQPseudo<InstrItinClass itin>
5890b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst), (ins addrmode6:$addr, QQQQPR:$src),itin,
5900b57cec5SDimitry Andric                "$src = $dst">;
5910b57cec5SDimitry Andricclass VLDQQQQWBPseudo<InstrItinClass itin>
5920b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
5930b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
5940b57cec5SDimitry Andric                "$addr.addr = $wb, $src = $dst">;
5950b57cec5SDimitry Andric
5960b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
5970b57cec5SDimitry Andric
5980b57cec5SDimitry Andric//   VLD1     : Vector Load (multiple single elements)
5990b57cec5SDimitry Andricclass VLD1D<bits<4> op7_4, string Dt, Operand AddrMode>
6000b57cec5SDimitry Andric  : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd),
6010b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1,
6020b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD1]> {
6030b57cec5SDimitry Andric  let Rm = 0b1111;
6040b57cec5SDimitry Andric  let Inst{4} = Rn{4};
6050b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6060b57cec5SDimitry Andric}
6070b57cec5SDimitry Andricclass VLD1Q<bits<4> op7_4, string Dt, Operand AddrMode>
6080b57cec5SDimitry Andric  : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd),
6090b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x2,
6100b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD2]> {
6110b57cec5SDimitry Andric  let Rm = 0b1111;
6120b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
6130b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6140b57cec5SDimitry Andric}
6150b57cec5SDimitry Andric
6160b57cec5SDimitry Andricdef  VLD1d8   : VLD1D<{0,0,0,?}, "8",  addrmode6align64>;
6170b57cec5SDimitry Andricdef  VLD1d16  : VLD1D<{0,1,0,?}, "16", addrmode6align64>;
6180b57cec5SDimitry Andricdef  VLD1d32  : VLD1D<{1,0,0,?}, "32", addrmode6align64>;
6190b57cec5SDimitry Andricdef  VLD1d64  : VLD1D<{1,1,0,?}, "64", addrmode6align64>;
6200b57cec5SDimitry Andric
6210b57cec5SDimitry Andricdef  VLD1q8   : VLD1Q<{0,0,?,?}, "8",  addrmode6align64or128>;
6220b57cec5SDimitry Andricdef  VLD1q16  : VLD1Q<{0,1,?,?}, "16", addrmode6align64or128>;
6230b57cec5SDimitry Andricdef  VLD1q32  : VLD1Q<{1,0,?,?}, "32", addrmode6align64or128>;
6240b57cec5SDimitry Andricdef  VLD1q64  : VLD1Q<{1,1,?,?}, "64", addrmode6align64or128>;
6250b57cec5SDimitry Andric
6260b57cec5SDimitry Andric// ...with address register writeback:
6270b57cec5SDimitry Andricmulticlass VLD1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
6280b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10, 0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
6290b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1u,
6300b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6310b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
6320b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
6330b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6340b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6350b57cec5SDimitry Andric  }
6360b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
6370b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1u,
6380b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
6390b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
6400b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6410b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6420b57cec5SDimitry Andric  }
6430b57cec5SDimitry Andric}
6440b57cec5SDimitry Andricmulticlass VLD1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
6450b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
6460b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
6470b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6480b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
6490b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
6500b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
6510b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6520b57cec5SDimitry Andric  }
6530b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
6540b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
6550b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
6560b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
6570b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
6580b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6590b57cec5SDimitry Andric  }
6600b57cec5SDimitry Andric}
6610b57cec5SDimitry Andric
6620b57cec5SDimitry Andricdefm VLD1d8wb  : VLD1DWB<{0,0,0,?}, "8",  addrmode6align64>;
6630b57cec5SDimitry Andricdefm VLD1d16wb : VLD1DWB<{0,1,0,?}, "16", addrmode6align64>;
6640b57cec5SDimitry Andricdefm VLD1d32wb : VLD1DWB<{1,0,0,?}, "32", addrmode6align64>;
6650b57cec5SDimitry Andricdefm VLD1d64wb : VLD1DWB<{1,1,0,?}, "64", addrmode6align64>;
6660b57cec5SDimitry Andricdefm VLD1q8wb  : VLD1QWB<{0,0,?,?}, "8",  addrmode6align64or128>;
6670b57cec5SDimitry Andricdefm VLD1q16wb : VLD1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
6680b57cec5SDimitry Andricdefm VLD1q32wb : VLD1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
6690b57cec5SDimitry Andricdefm VLD1q64wb : VLD1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
6700b57cec5SDimitry Andric
6710b57cec5SDimitry Andric// ...with 3 registers
6720b57cec5SDimitry Andricclass VLD1D3<bits<4> op7_4, string Dt, Operand AddrMode>
6730b57cec5SDimitry Andric  : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd),
6740b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x3, "vld1", Dt,
6750b57cec5SDimitry Andric          "$Vd, $Rn", "", []>, Sched<[WriteVLD3]> {
6760b57cec5SDimitry Andric  let Rm = 0b1111;
6770b57cec5SDimitry Andric  let Inst{4} = Rn{4};
6780b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6790b57cec5SDimitry Andric}
6800b57cec5SDimitry Andricmulticlass VLD1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
6810b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b0110, op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
6820b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
6830b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6840b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
6850b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
6860b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6870b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6880b57cec5SDimitry Andric  }
6890b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
6900b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
6910b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
6920b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
6930b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6940b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6950b57cec5SDimitry Andric  }
6960b57cec5SDimitry Andric}
6970b57cec5SDimitry Andric
6980b57cec5SDimitry Andricdef VLD1d8T      : VLD1D3<{0,0,0,?}, "8",  addrmode6align64>;
6990b57cec5SDimitry Andricdef VLD1d16T     : VLD1D3<{0,1,0,?}, "16", addrmode6align64>;
7000b57cec5SDimitry Andricdef VLD1d32T     : VLD1D3<{1,0,0,?}, "32", addrmode6align64>;
7010b57cec5SDimitry Andricdef VLD1d64T     : VLD1D3<{1,1,0,?}, "64", addrmode6align64>;
7020b57cec5SDimitry Andric
7030b57cec5SDimitry Andricdefm VLD1d8Twb  : VLD1D3WB<{0,0,0,?}, "8",  addrmode6align64>;
7040b57cec5SDimitry Andricdefm VLD1d16Twb : VLD1D3WB<{0,1,0,?}, "16", addrmode6align64>;
7050b57cec5SDimitry Andricdefm VLD1d32Twb : VLD1D3WB<{1,0,0,?}, "32", addrmode6align64>;
7060b57cec5SDimitry Andricdefm VLD1d64Twb : VLD1D3WB<{1,1,0,?}, "64", addrmode6align64>;
7070b57cec5SDimitry Andric
7080b57cec5SDimitry Andricdef VLD1d8TPseudo             : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
709fe6060f1SDimitry Andricdef VLD1d8TPseudoWB_fixed     : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
710fe6060f1SDimitry Andricdef VLD1d8TPseudoWB_register  : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7110b57cec5SDimitry Andricdef VLD1d16TPseudo            : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
712fe6060f1SDimitry Andricdef VLD1d16TPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
713fe6060f1SDimitry Andricdef VLD1d16TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7140b57cec5SDimitry Andricdef VLD1d32TPseudo            : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
715fe6060f1SDimitry Andricdef VLD1d32TPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
716fe6060f1SDimitry Andricdef VLD1d32TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7170b57cec5SDimitry Andricdef VLD1d64TPseudo            : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7180b57cec5SDimitry Andricdef VLD1d64TPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7190b57cec5SDimitry Andricdef VLD1d64TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7200b57cec5SDimitry Andric
7210b57cec5SDimitry Andricdef VLD1q8HighTPseudo      : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
722fe6060f1SDimitry Andricdef VLD1q8HighTPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7230b57cec5SDimitry Andricdef VLD1q8LowTPseudo_UPD   : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7240b57cec5SDimitry Andricdef VLD1q16HighTPseudo     : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
725fe6060f1SDimitry Andricdef VLD1q16HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7260b57cec5SDimitry Andricdef VLD1q16LowTPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7270b57cec5SDimitry Andricdef VLD1q32HighTPseudo     : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
728fe6060f1SDimitry Andricdef VLD1q32HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7290b57cec5SDimitry Andricdef VLD1q32LowTPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7300b57cec5SDimitry Andricdef VLD1q64HighTPseudo     : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
731fe6060f1SDimitry Andricdef VLD1q64HighTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7320b57cec5SDimitry Andricdef VLD1q64LowTPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7330b57cec5SDimitry Andric
7340b57cec5SDimitry Andric// ...with 4 registers
7350b57cec5SDimitry Andricclass VLD1D4<bits<4> op7_4, string Dt, Operand AddrMode>
7360b57cec5SDimitry Andric  : NLdSt<0, 0b10, 0b0010, op7_4, (outs VecListFourD:$Vd),
7370b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x4, "vld1", Dt,
7380b57cec5SDimitry Andric          "$Vd, $Rn", "", []>, Sched<[WriteVLD4]> {
7390b57cec5SDimitry Andric  let Rm = 0b1111;
7400b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
7410b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
7420b57cec5SDimitry Andric}
7430b57cec5SDimitry Andricmulticlass VLD1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
7440b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b0010, op7_4, (outs VecListFourD:$Vd, GPR:$wb),
7450b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
7460b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
7470b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
7480b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
7490b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
7500b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7510b57cec5SDimitry Andric  }
7520b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0010,op7_4, (outs VecListFourD:$Vd, GPR:$wb),
7530b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
7540b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
7550b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
7560b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
7570b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7580b57cec5SDimitry Andric  }
7590b57cec5SDimitry Andric}
7600b57cec5SDimitry Andric
7610b57cec5SDimitry Andricdef VLD1d8Q      : VLD1D4<{0,0,?,?}, "8",  addrmode6align64or128or256>;
7620b57cec5SDimitry Andricdef VLD1d16Q     : VLD1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
7630b57cec5SDimitry Andricdef VLD1d32Q     : VLD1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
7640b57cec5SDimitry Andricdef VLD1d64Q     : VLD1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
7650b57cec5SDimitry Andric
7660b57cec5SDimitry Andricdefm VLD1d8Qwb   : VLD1D4WB<{0,0,?,?}, "8",  addrmode6align64or128or256>;
7670b57cec5SDimitry Andricdefm VLD1d16Qwb  : VLD1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
7680b57cec5SDimitry Andricdefm VLD1d32Qwb  : VLD1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
7690b57cec5SDimitry Andricdefm VLD1d64Qwb  : VLD1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
7700b57cec5SDimitry Andric
7710b57cec5SDimitry Andricdef VLD1d8QPseudo             : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
772fe6060f1SDimitry Andricdef VLD1d8QPseudoWB_fixed     : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
773fe6060f1SDimitry Andricdef VLD1d8QPseudoWB_register  : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7740b57cec5SDimitry Andricdef VLD1d16QPseudo            : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
775fe6060f1SDimitry Andricdef VLD1d16QPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
776fe6060f1SDimitry Andricdef VLD1d16QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7770b57cec5SDimitry Andricdef VLD1d32QPseudo            : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
778fe6060f1SDimitry Andricdef VLD1d32QPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
779fe6060f1SDimitry Andricdef VLD1d32QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7800b57cec5SDimitry Andricdef VLD1d64QPseudo            : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7810b57cec5SDimitry Andricdef VLD1d64QPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7820b57cec5SDimitry Andricdef VLD1d64QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7830b57cec5SDimitry Andric
7840b57cec5SDimitry Andricdef VLD1q8LowQPseudo_UPD   : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7850b57cec5SDimitry Andricdef VLD1q8HighQPseudo      : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
786fe6060f1SDimitry Andricdef VLD1q8HighQPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7870b57cec5SDimitry Andricdef VLD1q16LowQPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7880b57cec5SDimitry Andricdef VLD1q16HighQPseudo     : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
789fe6060f1SDimitry Andricdef VLD1q16HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7900b57cec5SDimitry Andricdef VLD1q32LowQPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7910b57cec5SDimitry Andricdef VLD1q32HighQPseudo     : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
792fe6060f1SDimitry Andricdef VLD1q32HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7930b57cec5SDimitry Andricdef VLD1q64LowQPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7940b57cec5SDimitry Andricdef VLD1q64HighQPseudo     : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
795fe6060f1SDimitry Andricdef VLD1q64HighQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7960b57cec5SDimitry Andric
7970b57cec5SDimitry Andric//   VLD2     : Vector Load (multiple 2-element structures)
7980b57cec5SDimitry Andricclass VLD2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
7990b57cec5SDimitry Andric           InstrItinClass itin, Operand AddrMode>
8000b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd),
8010b57cec5SDimitry Andric          (ins AddrMode:$Rn), itin,
8020b57cec5SDimitry Andric          "vld2", Dt, "$Vd, $Rn", "", []> {
8030b57cec5SDimitry Andric  let Rm = 0b1111;
8040b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
8050b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST2Instruction";
8060b57cec5SDimitry Andric}
8070b57cec5SDimitry Andric
8080b57cec5SDimitry Andricdef  VLD2d8   : VLD2<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2,
8090b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8100b57cec5SDimitry Andricdef  VLD2d16  : VLD2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2,
8110b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8120b57cec5SDimitry Andricdef  VLD2d32  : VLD2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2,
8130b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8140b57cec5SDimitry Andric
8150b57cec5SDimitry Andricdef  VLD2q8   : VLD2<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2,
8160b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8170b57cec5SDimitry Andricdef  VLD2q16  : VLD2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2,
8180b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8190b57cec5SDimitry Andricdef  VLD2q32  : VLD2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2,
8200b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8210b57cec5SDimitry Andric
8220b57cec5SDimitry Andricdef  VLD2q8Pseudo  : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8230b57cec5SDimitry Andricdef  VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8240b57cec5SDimitry Andricdef  VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8250b57cec5SDimitry Andric
8260b57cec5SDimitry Andric// ...with address register writeback:
8270b57cec5SDimitry Andricmulticlass VLD2WB<bits<4> op11_8, bits<4> op7_4, string Dt,
8280b57cec5SDimitry Andric                  RegisterOperand VdTy, InstrItinClass itin, Operand AddrMode> {
8290b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
8300b57cec5SDimitry Andric                     (ins AddrMode:$Rn), itin,
8310b57cec5SDimitry Andric                     "vld2", Dt, "$Vd, $Rn!",
8320b57cec5SDimitry Andric                     "$Rn.addr = $wb", []> {
8330b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
8340b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
8350b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
8360b57cec5SDimitry Andric  }
8370b57cec5SDimitry Andric  def _register : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
8380b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), itin,
8390b57cec5SDimitry Andric                        "vld2", Dt, "$Vd, $Rn, $Rm",
8400b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
8410b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
8420b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
8430b57cec5SDimitry Andric  }
8440b57cec5SDimitry Andric}
8450b57cec5SDimitry Andric
8460b57cec5SDimitry Andricdefm VLD2d8wb  : VLD2WB<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2u,
8470b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8480b57cec5SDimitry Andricdefm VLD2d16wb : VLD2WB<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2u,
8490b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8500b57cec5SDimitry Andricdefm VLD2d32wb : VLD2WB<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2u,
8510b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8520b57cec5SDimitry Andric
8530b57cec5SDimitry Andricdefm VLD2q8wb  : VLD2WB<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2u,
8540b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8550b57cec5SDimitry Andricdefm VLD2q16wb : VLD2WB<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2u,
8560b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8570b57cec5SDimitry Andricdefm VLD2q32wb : VLD2WB<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2u,
8580b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8590b57cec5SDimitry Andric
8600b57cec5SDimitry Andricdef VLD2q8PseudoWB_fixed     : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8610b57cec5SDimitry Andricdef VLD2q16PseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8620b57cec5SDimitry Andricdef VLD2q32PseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8630b57cec5SDimitry Andricdef VLD2q8PseudoWB_register  : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8640b57cec5SDimitry Andricdef VLD2q16PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8650b57cec5SDimitry Andricdef VLD2q32PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8660b57cec5SDimitry Andric
8670b57cec5SDimitry Andric// ...with double-spaced registers
8680b57cec5SDimitry Andricdef  VLD2b8    : VLD2<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2,
8690b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8700b57cec5SDimitry Andricdef  VLD2b16   : VLD2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2,
8710b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8720b57cec5SDimitry Andricdef  VLD2b32   : VLD2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2,
8730b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8740b57cec5SDimitry Andricdefm VLD2b8wb  : VLD2WB<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2u,
8750b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8760b57cec5SDimitry Andricdefm VLD2b16wb : VLD2WB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2u,
8770b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8780b57cec5SDimitry Andricdefm VLD2b32wb : VLD2WB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2u,
8790b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8800b57cec5SDimitry Andric
8810b57cec5SDimitry Andric//   VLD3     : Vector Load (multiple 3-element structures)
8820b57cec5SDimitry Andricclass VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
8830b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
8840b57cec5SDimitry Andric          (ins addrmode6:$Rn), IIC_VLD3,
8850b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []>, Sched<[WriteVLD3]> {
8860b57cec5SDimitry Andric  let Rm = 0b1111;
8870b57cec5SDimitry Andric  let Inst{4} = Rn{4};
8880b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
8890b57cec5SDimitry Andric}
8900b57cec5SDimitry Andric
8910b57cec5SDimitry Andricdef  VLD3d8   : VLD3D<0b0100, {0,0,0,?}, "8">;
8920b57cec5SDimitry Andricdef  VLD3d16  : VLD3D<0b0100, {0,1,0,?}, "16">;
8930b57cec5SDimitry Andricdef  VLD3d32  : VLD3D<0b0100, {1,0,0,?}, "32">;
8940b57cec5SDimitry Andric
8950b57cec5SDimitry Andricdef  VLD3d8Pseudo  : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8960b57cec5SDimitry Andricdef  VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8970b57cec5SDimitry Andricdef  VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8980b57cec5SDimitry Andric
8990b57cec5SDimitry Andric// ...with address register writeback:
9000b57cec5SDimitry Andricclass VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
9010b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
9020b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
9030b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
9040b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
9050b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
9060b57cec5SDimitry Andric  let Inst{4} = Rn{4};
9070b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
9080b57cec5SDimitry Andric}
9090b57cec5SDimitry Andric
9100b57cec5SDimitry Andricdef VLD3d8_UPD  : VLD3DWB<0b0100, {0,0,0,?}, "8">;
9110b57cec5SDimitry Andricdef VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
9120b57cec5SDimitry Andricdef VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
9130b57cec5SDimitry Andric
9140b57cec5SDimitry Andricdef VLD3d8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9150b57cec5SDimitry Andricdef VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9160b57cec5SDimitry Andricdef VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9170b57cec5SDimitry Andric
9180b57cec5SDimitry Andric// ...with double-spaced registers:
9190b57cec5SDimitry Andricdef VLD3q8      : VLD3D<0b0101, {0,0,0,?}, "8">;
9200b57cec5SDimitry Andricdef VLD3q16     : VLD3D<0b0101, {0,1,0,?}, "16">;
9210b57cec5SDimitry Andricdef VLD3q32     : VLD3D<0b0101, {1,0,0,?}, "32">;
9220b57cec5SDimitry Andricdef VLD3q8_UPD  : VLD3DWB<0b0101, {0,0,0,?}, "8">;
9230b57cec5SDimitry Andricdef VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
9240b57cec5SDimitry Andricdef VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
9250b57cec5SDimitry Andric
9260b57cec5SDimitry Andricdef VLD3q8Pseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9270b57cec5SDimitry Andricdef VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9280b57cec5SDimitry Andricdef VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9290b57cec5SDimitry Andric
9300b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
9310b57cec5SDimitry Andricdef VLD3q8oddPseudo   : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9320b57cec5SDimitry Andricdef VLD3q16oddPseudo  : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9330b57cec5SDimitry Andricdef VLD3q32oddPseudo  : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9340b57cec5SDimitry Andric
9350b57cec5SDimitry Andricdef VLD3q8oddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9360b57cec5SDimitry Andricdef VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9370b57cec5SDimitry Andricdef VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9380b57cec5SDimitry Andric
9390b57cec5SDimitry Andric//   VLD4     : Vector Load (multiple 4-element structures)
9400b57cec5SDimitry Andricclass VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
9410b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
9420b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
9430b57cec5SDimitry Andric          (ins addrmode6:$Rn), IIC_VLD4,
9440b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []>,
9450b57cec5SDimitry Andric    Sched<[WriteVLD4]> {
9460b57cec5SDimitry Andric  let Rm = 0b1111;
9470b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
9480b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
9490b57cec5SDimitry Andric}
9500b57cec5SDimitry Andric
9510b57cec5SDimitry Andricdef  VLD4d8   : VLD4D<0b0000, {0,0,?,?}, "8">;
9520b57cec5SDimitry Andricdef  VLD4d16  : VLD4D<0b0000, {0,1,?,?}, "16">;
9530b57cec5SDimitry Andricdef  VLD4d32  : VLD4D<0b0000, {1,0,?,?}, "32">;
9540b57cec5SDimitry Andric
9550b57cec5SDimitry Andricdef  VLD4d8Pseudo  : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9560b57cec5SDimitry Andricdef  VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9570b57cec5SDimitry Andricdef  VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9580b57cec5SDimitry Andric
9590b57cec5SDimitry Andric// ...with address register writeback:
9600b57cec5SDimitry Andricclass VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
9610b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
9620b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
9630b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4u,
9640b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
9650b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
9660b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
9670b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
9680b57cec5SDimitry Andric}
9690b57cec5SDimitry Andric
9700b57cec5SDimitry Andricdef VLD4d8_UPD  : VLD4DWB<0b0000, {0,0,?,?}, "8">;
9710b57cec5SDimitry Andricdef VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
9720b57cec5SDimitry Andricdef VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
9730b57cec5SDimitry Andric
9740b57cec5SDimitry Andricdef VLD4d8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9750b57cec5SDimitry Andricdef VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9760b57cec5SDimitry Andricdef VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9770b57cec5SDimitry Andric
9780b57cec5SDimitry Andric// ...with double-spaced registers:
9790b57cec5SDimitry Andricdef VLD4q8      : VLD4D<0b0001, {0,0,?,?}, "8">;
9800b57cec5SDimitry Andricdef VLD4q16     : VLD4D<0b0001, {0,1,?,?}, "16">;
9810b57cec5SDimitry Andricdef VLD4q32     : VLD4D<0b0001, {1,0,?,?}, "32">;
9820b57cec5SDimitry Andricdef VLD4q8_UPD  : VLD4DWB<0b0001, {0,0,?,?}, "8">;
9830b57cec5SDimitry Andricdef VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
9840b57cec5SDimitry Andricdef VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
9850b57cec5SDimitry Andric
9860b57cec5SDimitry Andricdef VLD4q8Pseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9870b57cec5SDimitry Andricdef VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9880b57cec5SDimitry Andricdef VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9890b57cec5SDimitry Andric
9900b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
9910b57cec5SDimitry Andricdef VLD4q8oddPseudo   : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9920b57cec5SDimitry Andricdef VLD4q16oddPseudo  : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9930b57cec5SDimitry Andricdef VLD4q32oddPseudo  : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9940b57cec5SDimitry Andric
9950b57cec5SDimitry Andricdef VLD4q8oddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9960b57cec5SDimitry Andricdef VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9970b57cec5SDimitry Andricdef VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9980b57cec5SDimitry Andric
9990b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
10000b57cec5SDimitry Andric
10010b57cec5SDimitry Andric// Classes for VLD*LN pseudo-instructions with multi-register operands.
10020b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
10030b57cec5SDimitry Andricclass VLDQLNPseudo<InstrItinClass itin>
10040b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst),
10050b57cec5SDimitry Andric                (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
10060b57cec5SDimitry Andric                itin, "$src = $dst">;
10070b57cec5SDimitry Andricclass VLDQLNWBPseudo<InstrItinClass itin>
10080b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
10090b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
10100b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10110b57cec5SDimitry Andricclass VLDQQLNPseudo<InstrItinClass itin>
10120b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst),
10130b57cec5SDimitry Andric                (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
10140b57cec5SDimitry Andric                itin, "$src = $dst">;
10150b57cec5SDimitry Andricclass VLDQQLNWBPseudo<InstrItinClass itin>
10160b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
10170b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
10180b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10190b57cec5SDimitry Andricclass VLDQQQQLNPseudo<InstrItinClass itin>
10200b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst),
10210b57cec5SDimitry Andric                (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
10220b57cec5SDimitry Andric                itin, "$src = $dst">;
10230b57cec5SDimitry Andricclass VLDQQQQLNWBPseudo<InstrItinClass itin>
10240b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
10250b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
10260b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10270b57cec5SDimitry Andric
10280b57cec5SDimitry Andric//   VLD1LN   : Vector Load (single element to one lane)
10290b57cec5SDimitry Andricclass VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
10300b57cec5SDimitry Andric             PatFrag LoadOp>
10310b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
10320b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
10330b57cec5SDimitry Andric          IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
10340b57cec5SDimitry Andric          "$src = $Vd",
10350b57cec5SDimitry Andric          [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
10360b57cec5SDimitry Andric                                         (i32 (LoadOp addrmode6:$Rn)),
10370b57cec5SDimitry Andric                                         imm:$lane))]> {
10380b57cec5SDimitry Andric  let Rm = 0b1111;
10390b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
10400b57cec5SDimitry Andric}
10410b57cec5SDimitry Andricclass VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
10420b57cec5SDimitry Andric             PatFrag LoadOp>
10430b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
10440b57cec5SDimitry Andric          (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
10450b57cec5SDimitry Andric          IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
10460b57cec5SDimitry Andric          "$src = $Vd",
10470b57cec5SDimitry Andric          [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
10480b57cec5SDimitry Andric                                         (i32 (LoadOp addrmode6oneL32:$Rn)),
10490b57cec5SDimitry Andric                                         imm:$lane))]>, Sched<[WriteVLD1]> {
10500b57cec5SDimitry Andric  let Rm = 0b1111;
10510b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
10520b57cec5SDimitry Andric}
10530b57cec5SDimitry Andricclass VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln>,
10540b57cec5SDimitry Andric                                                    Sched<[WriteVLD1]> {
10550b57cec5SDimitry Andric  let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
10560b57cec5SDimitry Andric                                               (i32 (LoadOp addrmode6:$addr)),
10570b57cec5SDimitry Andric                                               imm:$lane))];
10580b57cec5SDimitry Andric}
10590b57cec5SDimitry Andric
10600b57cec5SDimitry Andricdef VLD1LNd8  : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
10610b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
10620b57cec5SDimitry Andric}
10630b57cec5SDimitry Andricdef VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
10640b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
10650b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
10660b57cec5SDimitry Andric}
10670b57cec5SDimitry Andricdef VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
10680b57cec5SDimitry Andric  let Inst{7} = lane{0};
10690b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
10700b57cec5SDimitry Andric}
10710b57cec5SDimitry Andric
10720b57cec5SDimitry Andricdef VLD1LNq8Pseudo  : VLD1QLNPseudo<v16i8, extloadi8>;
10730b57cec5SDimitry Andricdef VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
10740b57cec5SDimitry Andricdef VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
10750b57cec5SDimitry Andric
10760b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
10770b57cec5SDimitry Andricdef : Pat<(vector_insert (v4f16 DPR:$src),
10780b57cec5SDimitry Andric                         (f16 (load addrmode6:$addr)), imm:$lane),
10790b57cec5SDimitry Andric          (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
10800b57cec5SDimitry Andricdef : Pat<(vector_insert (v8f16 QPR:$src),
10810b57cec5SDimitry Andric                         (f16 (load addrmode6:$addr)), imm:$lane),
10820b57cec5SDimitry Andric          (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
10835ffd83dbSDimitry Andricdef : Pat<(vector_insert (v4bf16 DPR:$src),
10845ffd83dbSDimitry Andric                         (bf16 (load addrmode6:$addr)), imm:$lane),
10855ffd83dbSDimitry Andric          (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
10865ffd83dbSDimitry Andricdef : Pat<(vector_insert (v8bf16 QPR:$src),
10875ffd83dbSDimitry Andric                         (bf16 (load addrmode6:$addr)), imm:$lane),
10885ffd83dbSDimitry Andric          (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
10890b57cec5SDimitry Andricdef : Pat<(vector_insert (v2f32 DPR:$src),
10900b57cec5SDimitry Andric                         (f32 (load addrmode6:$addr)), imm:$lane),
10910b57cec5SDimitry Andric          (VLD1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
10920b57cec5SDimitry Andricdef : Pat<(vector_insert (v4f32 QPR:$src),
10930b57cec5SDimitry Andric                         (f32 (load addrmode6:$addr)), imm:$lane),
10940b57cec5SDimitry Andric          (VLD1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
10950b57cec5SDimitry Andric
10960b57cec5SDimitry Andric// A 64-bit subvector insert to the first 128-bit vector position
10970b57cec5SDimitry Andric// is a subregister copy that needs no instruction.
10980b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v1i64 DPR:$src), (i32 0)),
10990b57cec5SDimitry Andric          (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11000b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v2i32 DPR:$src), (i32 0)),
11010b57cec5SDimitry Andric          (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11020b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v2f32 DPR:$src), (i32 0)),
11030b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11040b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v4i16 DPR:$src), (i32 0)),
11050b57cec5SDimitry Andric          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11060b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v4f16 DPR:$src), (i32 0)),
11070b57cec5SDimitry Andric          (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11080b57cec5SDimitry Andricdef : Pat<(insert_subvector (v16i8 undef), (v8i8 DPR:$src), (i32 0)),
11090b57cec5SDimitry Andric          (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11100b57cec5SDimitry Andric}
11110b57cec5SDimitry Andric
11120b57cec5SDimitry Andric
11130b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
11140b57cec5SDimitry Andric
11150b57cec5SDimitry Andric// ...with address register writeback:
11160b57cec5SDimitry Andricclass VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
11170b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
11180b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
11190b57cec5SDimitry Andric           DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
11200b57cec5SDimitry Andric          "\\{$Vd[$lane]\\}, $Rn$Rm",
11210b57cec5SDimitry Andric          "$src = $Vd, $Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
11220b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
11230b57cec5SDimitry Andric}
11240b57cec5SDimitry Andric
11250b57cec5SDimitry Andricdef VLD1LNd8_UPD  : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
11260b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11270b57cec5SDimitry Andric}
11280b57cec5SDimitry Andricdef VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
11290b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11300b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11310b57cec5SDimitry Andric}
11320b57cec5SDimitry Andricdef VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
11330b57cec5SDimitry Andric  let Inst{7} = lane{0};
11340b57cec5SDimitry Andric  let Inst{5} = Rn{4};
11350b57cec5SDimitry Andric  let Inst{4} = Rn{4};
11360b57cec5SDimitry Andric}
11370b57cec5SDimitry Andric
11380b57cec5SDimitry Andricdef VLD1LNq8Pseudo_UPD  : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11390b57cec5SDimitry Andricdef VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11400b57cec5SDimitry Andricdef VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11410b57cec5SDimitry Andric
11420b57cec5SDimitry Andric//   VLD2LN   : Vector Load (single 2-element structure to one lane)
11430b57cec5SDimitry Andricclass VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
11440b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
11450b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
11460b57cec5SDimitry Andric          IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
11470b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2", []>, Sched<[WriteVLD1]> {
11480b57cec5SDimitry Andric  let Rm = 0b1111;
11490b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11500b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2LN";
11510b57cec5SDimitry Andric}
11520b57cec5SDimitry Andric
11530b57cec5SDimitry Andricdef VLD2LNd8  : VLD2LN<0b0001, {?,?,?,?}, "8"> {
11540b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11550b57cec5SDimitry Andric}
11560b57cec5SDimitry Andricdef VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
11570b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11580b57cec5SDimitry Andric}
11590b57cec5SDimitry Andricdef VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
11600b57cec5SDimitry Andric  let Inst{7} = lane{0};
11610b57cec5SDimitry Andric}
11620b57cec5SDimitry Andric
11630b57cec5SDimitry Andricdef VLD2LNd8Pseudo  : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11640b57cec5SDimitry Andricdef VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11650b57cec5SDimitry Andricdef VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11660b57cec5SDimitry Andric
11670b57cec5SDimitry Andric// ...with double-spaced registers:
11680b57cec5SDimitry Andricdef VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
11690b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11700b57cec5SDimitry Andric}
11710b57cec5SDimitry Andricdef VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
11720b57cec5SDimitry Andric  let Inst{7} = lane{0};
11730b57cec5SDimitry Andric}
11740b57cec5SDimitry Andric
11750b57cec5SDimitry Andricdef VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11760b57cec5SDimitry Andricdef VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11770b57cec5SDimitry Andric
11780b57cec5SDimitry Andric// ...with address register writeback:
11790b57cec5SDimitry Andricclass VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
11800b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
11810b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
11820b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
11830b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
11840b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
11850b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11860b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2LN";
11870b57cec5SDimitry Andric}
11880b57cec5SDimitry Andric
11890b57cec5SDimitry Andricdef VLD2LNd8_UPD  : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
11900b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11910b57cec5SDimitry Andric}
11920b57cec5SDimitry Andricdef VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
11930b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11940b57cec5SDimitry Andric}
11950b57cec5SDimitry Andricdef VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
11960b57cec5SDimitry Andric  let Inst{7} = lane{0};
11970b57cec5SDimitry Andric}
11980b57cec5SDimitry Andric
11990b57cec5SDimitry Andricdef VLD2LNd8Pseudo_UPD  : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12000b57cec5SDimitry Andricdef VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12010b57cec5SDimitry Andricdef VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12020b57cec5SDimitry Andric
12030b57cec5SDimitry Andricdef VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
12040b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12050b57cec5SDimitry Andric}
12060b57cec5SDimitry Andricdef VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
12070b57cec5SDimitry Andric  let Inst{7} = lane{0};
12080b57cec5SDimitry Andric}
12090b57cec5SDimitry Andric
12100b57cec5SDimitry Andricdef VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12110b57cec5SDimitry Andricdef VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12120b57cec5SDimitry Andric
12130b57cec5SDimitry Andric//   VLD3LN   : Vector Load (single 3-element structure to one lane)
12140b57cec5SDimitry Andricclass VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
12150b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
12160b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
12170b57cec5SDimitry Andric          nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
12180b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
12190b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []>, Sched<[WriteVLD2]> {
12200b57cec5SDimitry Andric  let Rm = 0b1111;
12210b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3LN";
12220b57cec5SDimitry Andric}
12230b57cec5SDimitry Andric
12240b57cec5SDimitry Andricdef VLD3LNd8  : VLD3LN<0b0010, {?,?,?,0}, "8"> {
12250b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
12260b57cec5SDimitry Andric}
12270b57cec5SDimitry Andricdef VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
12280b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12290b57cec5SDimitry Andric}
12300b57cec5SDimitry Andricdef VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
12310b57cec5SDimitry Andric  let Inst{7}   = lane{0};
12320b57cec5SDimitry Andric}
12330b57cec5SDimitry Andric
12340b57cec5SDimitry Andricdef VLD3LNd8Pseudo  : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12350b57cec5SDimitry Andricdef VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12360b57cec5SDimitry Andricdef VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12370b57cec5SDimitry Andric
12380b57cec5SDimitry Andric// ...with double-spaced registers:
12390b57cec5SDimitry Andricdef VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
12400b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12410b57cec5SDimitry Andric}
12420b57cec5SDimitry Andricdef VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
12430b57cec5SDimitry Andric  let Inst{7}   = lane{0};
12440b57cec5SDimitry Andric}
12450b57cec5SDimitry Andric
12460b57cec5SDimitry Andricdef VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12470b57cec5SDimitry Andricdef VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12480b57cec5SDimitry Andric
12490b57cec5SDimitry Andric// ...with address register writeback:
12500b57cec5SDimitry Andricclass VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
12510b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
12520b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
12530b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
12540b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
12550b57cec5SDimitry Andric          IIC_VLD3lnu, "vld3", Dt,
12560b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
12570b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
12580b57cec5SDimitry Andric          []>, Sched<[WriteVLD2]> {
12590b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3LN";
12600b57cec5SDimitry Andric}
12610b57cec5SDimitry Andric
12620b57cec5SDimitry Andricdef VLD3LNd8_UPD  : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
12630b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
12640b57cec5SDimitry Andric}
12650b57cec5SDimitry Andricdef VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
12660b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12670b57cec5SDimitry Andric}
12680b57cec5SDimitry Andricdef VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
12690b57cec5SDimitry Andric  let Inst{7} = lane{0};
12700b57cec5SDimitry Andric}
12710b57cec5SDimitry Andric
12720b57cec5SDimitry Andricdef VLD3LNd8Pseudo_UPD  : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12730b57cec5SDimitry Andricdef VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12740b57cec5SDimitry Andricdef VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12750b57cec5SDimitry Andric
12760b57cec5SDimitry Andricdef VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
12770b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12780b57cec5SDimitry Andric}
12790b57cec5SDimitry Andricdef VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
12800b57cec5SDimitry Andric  let Inst{7} = lane{0};
12810b57cec5SDimitry Andric}
12820b57cec5SDimitry Andric
12830b57cec5SDimitry Andricdef VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12840b57cec5SDimitry Andricdef VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12850b57cec5SDimitry Andric
12860b57cec5SDimitry Andric//   VLD4LN   : Vector Load (single 4-element structure to one lane)
12870b57cec5SDimitry Andricclass VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
12880b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
12890b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
12900b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
12910b57cec5SDimitry Andric          nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
12920b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
12930b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>,
12940b57cec5SDimitry Andric    Sched<[WriteVLD2]> {
12950b57cec5SDimitry Andric  let Rm = 0b1111;
12960b57cec5SDimitry Andric  let Inst{4} = Rn{4};
12970b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4LN";
12980b57cec5SDimitry Andric}
12990b57cec5SDimitry Andric
13000b57cec5SDimitry Andricdef VLD4LNd8  : VLD4LN<0b0011, {?,?,?,?}, "8"> {
13010b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
13020b57cec5SDimitry Andric}
13030b57cec5SDimitry Andricdef VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
13040b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13050b57cec5SDimitry Andric}
13060b57cec5SDimitry Andricdef VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
13070b57cec5SDimitry Andric  let Inst{7} = lane{0};
13080b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13090b57cec5SDimitry Andric}
13100b57cec5SDimitry Andric
13110b57cec5SDimitry Andricdef VLD4LNd8Pseudo  : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13120b57cec5SDimitry Andricdef VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13130b57cec5SDimitry Andricdef VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13140b57cec5SDimitry Andric
13150b57cec5SDimitry Andric// ...with double-spaced registers:
13160b57cec5SDimitry Andricdef VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
13170b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13180b57cec5SDimitry Andric}
13190b57cec5SDimitry Andricdef VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
13200b57cec5SDimitry Andric  let Inst{7} = lane{0};
13210b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13220b57cec5SDimitry Andric}
13230b57cec5SDimitry Andric
13240b57cec5SDimitry Andricdef VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13250b57cec5SDimitry Andricdef VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13260b57cec5SDimitry Andric
13270b57cec5SDimitry Andric// ...with address register writeback:
13280b57cec5SDimitry Andricclass VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
13290b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
13300b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
13310b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
13320b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
13330b57cec5SDimitry Andric          IIC_VLD4lnu, "vld4", Dt,
13340b57cec5SDimitry Andric"\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
13350b57cec5SDimitry Andric"$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
13360b57cec5SDimitry Andric          []> {
13370b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
13380b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4LN"  ;
13390b57cec5SDimitry Andric}
13400b57cec5SDimitry Andric
13410b57cec5SDimitry Andricdef VLD4LNd8_UPD  : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
13420b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
13430b57cec5SDimitry Andric}
13440b57cec5SDimitry Andricdef VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
13450b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13460b57cec5SDimitry Andric}
13470b57cec5SDimitry Andricdef VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
13480b57cec5SDimitry Andric  let Inst{7} = lane{0};
13490b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13500b57cec5SDimitry Andric}
13510b57cec5SDimitry Andric
13520b57cec5SDimitry Andricdef VLD4LNd8Pseudo_UPD  : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13530b57cec5SDimitry Andricdef VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13540b57cec5SDimitry Andricdef VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13550b57cec5SDimitry Andric
13560b57cec5SDimitry Andricdef VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
13570b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13580b57cec5SDimitry Andric}
13590b57cec5SDimitry Andricdef VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
13600b57cec5SDimitry Andric  let Inst{7} = lane{0};
13610b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13620b57cec5SDimitry Andric}
13630b57cec5SDimitry Andric
13640b57cec5SDimitry Andricdef VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13650b57cec5SDimitry Andricdef VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13660b57cec5SDimitry Andric
13670b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
13680b57cec5SDimitry Andric
13690b57cec5SDimitry Andric//   VLD1DUP  : Vector Load (single element to all lanes)
13700b57cec5SDimitry Andricclass VLD1DUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
13710b57cec5SDimitry Andric              Operand AddrMode>
13720b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListOneDAllLanes:$Vd),
13730b57cec5SDimitry Andric          (ins AddrMode:$Rn),
13740b57cec5SDimitry Andric          IIC_VLD1dup, "vld1", Dt, "$Vd, $Rn", "",
13750b57cec5SDimitry Andric          [(set VecListOneDAllLanes:$Vd,
13760b57cec5SDimitry Andric                (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]>,
13770b57cec5SDimitry Andric   Sched<[WriteVLD2]> {
13780b57cec5SDimitry Andric  let Rm = 0b1111;
13790b57cec5SDimitry Andric  let Inst{4} = Rn{4};
13800b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1DupInstruction";
13810b57cec5SDimitry Andric}
13820b57cec5SDimitry Andricdef VLD1DUPd8  : VLD1DUP<{0,0,0,?}, "8", v8i8, extloadi8,
13830b57cec5SDimitry Andric                         addrmode6dupalignNone>;
13840b57cec5SDimitry Andricdef VLD1DUPd16 : VLD1DUP<{0,1,0,?}, "16", v4i16, extloadi16,
13850b57cec5SDimitry Andric                         addrmode6dupalign16>;
13860b57cec5SDimitry Andricdef VLD1DUPd32 : VLD1DUP<{1,0,0,?}, "32", v2i32, load,
13870b57cec5SDimitry Andric                         addrmode6dupalign32>;
13880b57cec5SDimitry Andric
13890b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
13900b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
13910b57cec5SDimitry Andric          (VLD1DUPd32 addrmode6:$addr)>;
13920b57cec5SDimitry Andric}
13930b57cec5SDimitry Andric
13940b57cec5SDimitry Andricclass VLD1QDUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
13950b57cec5SDimitry Andric               Operand AddrMode>
13960b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListDPairAllLanes:$Vd),
13970b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1dup,
13980b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "",
13990b57cec5SDimitry Andric          [(set VecListDPairAllLanes:$Vd,
14000b57cec5SDimitry Andric                (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]> {
14010b57cec5SDimitry Andric  let Rm = 0b1111;
14020b57cec5SDimitry Andric  let Inst{4} = Rn{4};
14030b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1DupInstruction";
14040b57cec5SDimitry Andric}
14050b57cec5SDimitry Andric
14060b57cec5SDimitry Andricdef VLD1DUPq8  : VLD1QDUP<{0,0,1,0}, "8", v16i8, extloadi8,
14070b57cec5SDimitry Andric                          addrmode6dupalignNone>;
14080b57cec5SDimitry Andricdef VLD1DUPq16 : VLD1QDUP<{0,1,1,?}, "16", v8i16, extloadi16,
14090b57cec5SDimitry Andric                          addrmode6dupalign16>;
14100b57cec5SDimitry Andricdef VLD1DUPq32 : VLD1QDUP<{1,0,1,?}, "32", v4i32, load,
14110b57cec5SDimitry Andric                          addrmode6dupalign32>;
14120b57cec5SDimitry Andric
14130b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
14140b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
14150b57cec5SDimitry Andric          (VLD1DUPq32 addrmode6:$addr)>;
14160b57cec5SDimitry Andric}
14170b57cec5SDimitry Andric
14180b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
14190b57cec5SDimitry Andric// ...with address register writeback:
14200b57cec5SDimitry Andricmulticlass VLD1DUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
14210b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
14220b57cec5SDimitry Andric                     (outs VecListOneDAllLanes:$Vd, GPR:$wb),
14230b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1dupu,
14240b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
14250b57cec5SDimitry Andric                     "$Rn.addr = $wb", []> {
14260b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
14270b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14280b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14290b57cec5SDimitry Andric  }
14300b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1100, op7_4,
14310b57cec5SDimitry Andric                        (outs VecListOneDAllLanes:$Vd, GPR:$wb),
14320b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
14330b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
14340b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
14350b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14360b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14370b57cec5SDimitry Andric  }
14380b57cec5SDimitry Andric}
14390b57cec5SDimitry Andricmulticlass VLD1QDUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
14400b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
14410b57cec5SDimitry Andric                     (outs VecListDPairAllLanes:$Vd, GPR:$wb),
14420b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1dupu,
14430b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
14440b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
14450b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
14460b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14470b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14480b57cec5SDimitry Andric  }
14490b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1100, op7_4,
14500b57cec5SDimitry Andric                        (outs VecListDPairAllLanes:$Vd, GPR:$wb),
14510b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
14520b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
14530b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
14540b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14550b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14560b57cec5SDimitry Andric  }
14570b57cec5SDimitry Andric}
14580b57cec5SDimitry Andric
14590b57cec5SDimitry Andricdefm VLD1DUPd8wb  : VLD1DUPWB<{0,0,0,0}, "8", addrmode6dupalignNone>;
14600b57cec5SDimitry Andricdefm VLD1DUPd16wb : VLD1DUPWB<{0,1,0,?}, "16", addrmode6dupalign16>;
14610b57cec5SDimitry Andricdefm VLD1DUPd32wb : VLD1DUPWB<{1,0,0,?}, "32", addrmode6dupalign32>;
14620b57cec5SDimitry Andric
14630b57cec5SDimitry Andricdefm VLD1DUPq8wb  : VLD1QDUPWB<{0,0,1,0}, "8", addrmode6dupalignNone>;
14640b57cec5SDimitry Andricdefm VLD1DUPq16wb : VLD1QDUPWB<{0,1,1,?}, "16", addrmode6dupalign16>;
14650b57cec5SDimitry Andricdefm VLD1DUPq32wb : VLD1QDUPWB<{1,0,1,?}, "32", addrmode6dupalign32>;
14660b57cec5SDimitry Andric
14670b57cec5SDimitry Andric//   VLD2DUP  : Vector Load (single 2-element structure to all lanes)
14680b57cec5SDimitry Andricclass VLD2DUP<bits<4> op7_4, string Dt, RegisterOperand VdTy, Operand AddrMode>
14690b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1101, op7_4, (outs VdTy:$Vd),
14700b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD2dup,
14710b57cec5SDimitry Andric          "vld2", Dt, "$Vd, $Rn", "", []> {
14720b57cec5SDimitry Andric  let Rm = 0b1111;
14730b57cec5SDimitry Andric  let Inst{4} = Rn{4};
14740b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2DupInstruction";
14750b57cec5SDimitry Andric}
14760b57cec5SDimitry Andric
14770b57cec5SDimitry Andricdef VLD2DUPd8  : VLD2DUP<{0,0,0,?}, "8",  VecListDPairAllLanes,
14780b57cec5SDimitry Andric                         addrmode6dupalign16>;
14790b57cec5SDimitry Andricdef VLD2DUPd16 : VLD2DUP<{0,1,0,?}, "16", VecListDPairAllLanes,
14800b57cec5SDimitry Andric                         addrmode6dupalign32>;
14810b57cec5SDimitry Andricdef VLD2DUPd32 : VLD2DUP<{1,0,0,?}, "32", VecListDPairAllLanes,
14820b57cec5SDimitry Andric                         addrmode6dupalign64>;
14830b57cec5SDimitry Andric
14840b57cec5SDimitry Andric// HACK this one, VLD2DUPd8x2 must be changed at the same time with VLD2b8 or
14850b57cec5SDimitry Andric// "vld2.8 {d0[], d2[]}, [r4:32]" will become "vld2.8 {d0, d2}, [r4:32]".
14860b57cec5SDimitry Andric// ...with double-spaced registers
14870b57cec5SDimitry Andricdef VLD2DUPd8x2  : VLD2DUP<{0,0,1,?}, "8",  VecListDPairSpacedAllLanes,
14880b57cec5SDimitry Andric                           addrmode6dupalign16>;
14890b57cec5SDimitry Andricdef VLD2DUPd16x2 : VLD2DUP<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
14900b57cec5SDimitry Andric                           addrmode6dupalign32>;
14910b57cec5SDimitry Andricdef VLD2DUPd32x2 : VLD2DUP<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
14920b57cec5SDimitry Andric                           addrmode6dupalign64>;
14930b57cec5SDimitry Andric
1494*0fca6ea1SDimitry Andric// Duplicate of VLDQQPseudo but with a constraint variable
1495*0fca6ea1SDimitry Andric// to ensure the odd and even lanes use the same register range
1496*0fca6ea1SDimitry Andricclass VLDQQPseudoInputDST<InstrItinClass itin>
1497*0fca6ea1SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr, QQPR: $src), itin,
1498*0fca6ea1SDimitry Andric                "$src = $dst">;
1499*0fca6ea1SDimitry Andricclass VLDQQWBPseudoInputDST<InstrItinClass itin>
1500*0fca6ea1SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
1501*0fca6ea1SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR: $src), itin,
1502*0fca6ea1SDimitry Andric                "$addr.addr = $wb, $src = $dst">;
1503*0fca6ea1SDimitry Andricclass VLDQQWBfixedPseudoInputDST<InstrItinClass itin>
1504*0fca6ea1SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
1505*0fca6ea1SDimitry Andric                (ins addrmode6:$addr, QQPR: $src), itin,
1506*0fca6ea1SDimitry Andric                "$addr.addr = $wb, $src = $dst">;
1507*0fca6ea1SDimitry Andric
1508*0fca6ea1SDimitry Andricdef VLD2DUPq8EvenPseudo  : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1509*0fca6ea1SDimitry Andricdef VLD2DUPq8OddPseudo   : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1510*0fca6ea1SDimitry Andricdef VLD2DUPq16EvenPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1511*0fca6ea1SDimitry Andricdef VLD2DUPq16OddPseudo  : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1512*0fca6ea1SDimitry Andricdef VLD2DUPq32EvenPseudo : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1513*0fca6ea1SDimitry Andricdef VLD2DUPq32OddPseudo  : VLDQQPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
15140b57cec5SDimitry Andric
15150b57cec5SDimitry Andric// ...with address register writeback:
15160b57cec5SDimitry Andricmulticlass VLD2DUPWB<bits<4> op7_4, string Dt, RegisterOperand VdTy,
15170b57cec5SDimitry Andric                     Operand AddrMode> {
15180b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1101, op7_4,
15190b57cec5SDimitry Andric                     (outs VdTy:$Vd, GPR:$wb),
15200b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD2dupu,
15210b57cec5SDimitry Andric                     "vld2", Dt, "$Vd, $Rn!",
15220b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15230b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
15240b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15250b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15260b57cec5SDimitry Andric  }
15270b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1101, op7_4,
15280b57cec5SDimitry Andric                        (outs VdTy:$Vd, GPR:$wb),
15290b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD2dupu,
15300b57cec5SDimitry Andric                        "vld2", Dt, "$Vd, $Rn, $Rm",
15310b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15320b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15330b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15340b57cec5SDimitry Andric  }
15350b57cec5SDimitry Andric}
15360b57cec5SDimitry Andric
15370b57cec5SDimitry Andricdefm VLD2DUPd8wb    : VLD2DUPWB<{0,0,0,0}, "8",  VecListDPairAllLanes,
15380b57cec5SDimitry Andric                                addrmode6dupalign16>;
15390b57cec5SDimitry Andricdefm VLD2DUPd16wb   : VLD2DUPWB<{0,1,0,?}, "16", VecListDPairAllLanes,
15400b57cec5SDimitry Andric                                addrmode6dupalign32>;
15410b57cec5SDimitry Andricdefm VLD2DUPd32wb   : VLD2DUPWB<{1,0,0,?}, "32", VecListDPairAllLanes,
15420b57cec5SDimitry Andric                                addrmode6dupalign64>;
15430b57cec5SDimitry Andric
15440b57cec5SDimitry Andricdefm VLD2DUPd8x2wb  : VLD2DUPWB<{0,0,1,0}, "8",  VecListDPairSpacedAllLanes,
15450b57cec5SDimitry Andric                                addrmode6dupalign16>;
15460b57cec5SDimitry Andricdefm VLD2DUPd16x2wb : VLD2DUPWB<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
15470b57cec5SDimitry Andric                                addrmode6dupalign32>;
15480b57cec5SDimitry Andricdefm VLD2DUPd32x2wb : VLD2DUPWB<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
15490b57cec5SDimitry Andric                                addrmode6dupalign64>;
15500b57cec5SDimitry Andric
1551*0fca6ea1SDimitry Andricdef VLD2DUPq8OddPseudoWB_fixed     : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1552*0fca6ea1SDimitry Andricdef VLD2DUPq16OddPseudoWB_fixed    : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1553*0fca6ea1SDimitry Andricdef VLD2DUPq32OddPseudoWB_fixed    : VLDQQWBfixedPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1554*0fca6ea1SDimitry Andricdef VLD2DUPq8OddPseudoWB_register  : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1555*0fca6ea1SDimitry Andricdef VLD2DUPq16OddPseudoWB_register : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1556*0fca6ea1SDimitry Andricdef VLD2DUPq32OddPseudoWB_register : VLDQQWBPseudoInputDST<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1557fe6060f1SDimitry Andric
15580b57cec5SDimitry Andric//   VLD3DUP  : Vector Load (single 3-element structure to all lanes)
15590b57cec5SDimitry Andricclass VLD3DUP<bits<4> op7_4, string Dt>
15600b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
15610b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD3dup,
15620b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []>,
15630b57cec5SDimitry Andric    Sched<[WriteVLD2]> {
15640b57cec5SDimitry Andric  let Rm = 0b1111;
15650b57cec5SDimitry Andric  let Inst{4} = 0;
15660b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15670b57cec5SDimitry Andric}
15680b57cec5SDimitry Andric
15690b57cec5SDimitry Andricdef VLD3DUPd8  : VLD3DUP<{0,0,0,?}, "8">;
15700b57cec5SDimitry Andricdef VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
15710b57cec5SDimitry Andricdef VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
15720b57cec5SDimitry Andric
15730b57cec5SDimitry Andricdef VLD3DUPd8Pseudo  : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15740b57cec5SDimitry Andricdef VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15750b57cec5SDimitry Andricdef VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15760b57cec5SDimitry Andric
15770b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
15780b57cec5SDimitry Andricdef VLD3DUPq8  : VLD3DUP<{0,0,1,?}, "8">;
15790b57cec5SDimitry Andricdef VLD3DUPq16 : VLD3DUP<{0,1,1,?}, "16">;
15800b57cec5SDimitry Andricdef VLD3DUPq32 : VLD3DUP<{1,0,1,?}, "32">;
15810b57cec5SDimitry Andric
15820b57cec5SDimitry Andricdef VLD3DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15830b57cec5SDimitry Andricdef VLD3DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15840b57cec5SDimitry Andricdef VLD3DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15850b57cec5SDimitry Andricdef VLD3DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15860b57cec5SDimitry Andricdef VLD3DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15870b57cec5SDimitry Andricdef VLD3DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15880b57cec5SDimitry Andric
15890b57cec5SDimitry Andric// ...with address register writeback:
15900b57cec5SDimitry Andricclass VLD3DUPWB<bits<4> op7_4, string Dt, Operand AddrMode>
15910b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
15920b57cec5SDimitry Andric          (ins AddrMode:$Rn, am6offset:$Rm), IIC_VLD3dupu,
15930b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
15940b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
15950b57cec5SDimitry Andric  let Inst{4} = 0;
15960b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15970b57cec5SDimitry Andric}
15980b57cec5SDimitry Andric
15990b57cec5SDimitry Andricdef VLD3DUPd8_UPD  : VLD3DUPWB<{0,0,0,0}, "8",  addrmode6dupalign64>;
16000b57cec5SDimitry Andricdef VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16", addrmode6dupalign64>;
16010b57cec5SDimitry Andricdef VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32", addrmode6dupalign64>;
16020b57cec5SDimitry Andric
16030b57cec5SDimitry Andricdef VLD3DUPq8_UPD  : VLD3DUPWB<{0,0,1,0}, "8",  addrmode6dupalign64>;
16040b57cec5SDimitry Andricdef VLD3DUPq16_UPD : VLD3DUPWB<{0,1,1,?}, "16", addrmode6dupalign64>;
16050b57cec5SDimitry Andricdef VLD3DUPq32_UPD : VLD3DUPWB<{1,0,1,?}, "32", addrmode6dupalign64>;
16060b57cec5SDimitry Andric
16070b57cec5SDimitry Andricdef VLD3DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
16080b57cec5SDimitry Andricdef VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
16090b57cec5SDimitry Andricdef VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
16100b57cec5SDimitry Andric
1611fe6060f1SDimitry Andricdef VLD3DUPq8OddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1612fe6060f1SDimitry Andricdef VLD3DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1613fe6060f1SDimitry Andricdef VLD3DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1614fe6060f1SDimitry Andric
16150b57cec5SDimitry Andric//   VLD4DUP  : Vector Load (single 4-element structure to all lanes)
16160b57cec5SDimitry Andricclass VLD4DUP<bits<4> op7_4, string Dt>
16170b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
16180b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
16190b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD4dup,
16200b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
16210b57cec5SDimitry Andric  let Rm = 0b1111;
16220b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16230b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
16240b57cec5SDimitry Andric}
16250b57cec5SDimitry Andric
16260b57cec5SDimitry Andricdef VLD4DUPd8  : VLD4DUP<{0,0,0,?}, "8">;
16270b57cec5SDimitry Andricdef VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
16280b57cec5SDimitry Andricdef VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
16290b57cec5SDimitry Andric
16300b57cec5SDimitry Andricdef VLD4DUPd8Pseudo  : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16310b57cec5SDimitry Andricdef VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16320b57cec5SDimitry Andricdef VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16330b57cec5SDimitry Andric
16340b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
16350b57cec5SDimitry Andricdef VLD4DUPq8  : VLD4DUP<{0,0,1,?}, "8">;
16360b57cec5SDimitry Andricdef VLD4DUPq16 : VLD4DUP<{0,1,1,?}, "16">;
16370b57cec5SDimitry Andricdef VLD4DUPq32 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16380b57cec5SDimitry Andric
16390b57cec5SDimitry Andricdef VLD4DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16400b57cec5SDimitry Andricdef VLD4DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16410b57cec5SDimitry Andricdef VLD4DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16420b57cec5SDimitry Andricdef VLD4DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16430b57cec5SDimitry Andricdef VLD4DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16440b57cec5SDimitry Andricdef VLD4DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16450b57cec5SDimitry Andric
16460b57cec5SDimitry Andric// ...with address register writeback:
16470b57cec5SDimitry Andricclass VLD4DUPWB<bits<4> op7_4, string Dt>
16480b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
16490b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
16500b57cec5SDimitry Andric          (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
16510b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
16520b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
16530b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16540b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
16550b57cec5SDimitry Andric}
16560b57cec5SDimitry Andric
16570b57cec5SDimitry Andricdef VLD4DUPd8_UPD  : VLD4DUPWB<{0,0,0,0}, "8">;
16580b57cec5SDimitry Andricdef VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
16590b57cec5SDimitry Andricdef VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
16600b57cec5SDimitry Andric
16610b57cec5SDimitry Andricdef VLD4DUPq8_UPD  : VLD4DUPWB<{0,0,1,0}, "8">;
16620b57cec5SDimitry Andricdef VLD4DUPq16_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
16630b57cec5SDimitry Andricdef VLD4DUPq32_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16640b57cec5SDimitry Andric
16650b57cec5SDimitry Andricdef VLD4DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16660b57cec5SDimitry Andricdef VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16670b57cec5SDimitry Andricdef VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16680b57cec5SDimitry Andric
1669fe6060f1SDimitry Andricdef VLD4DUPq8OddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1670fe6060f1SDimitry Andricdef VLD4DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1671fe6060f1SDimitry Andricdef VLD4DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1672fe6060f1SDimitry Andric
16730b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
16740b57cec5SDimitry Andric
16750b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
16760b57cec5SDimitry Andric
16770b57cec5SDimitry Andric// Classes for VST* pseudo-instructions with multi-register operands.
16780b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
16790b57cec5SDimitry Andricclass VSTQPseudo<InstrItinClass itin>
16800b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
16810b57cec5SDimitry Andricclass VSTQWBPseudo<InstrItinClass itin>
16820b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16830b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
16840b57cec5SDimitry Andric                "$addr.addr = $wb">;
16850b57cec5SDimitry Andricclass VSTQWBfixedPseudo<InstrItinClass itin>
16860b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16870b57cec5SDimitry Andric                (ins addrmode6:$addr, QPR:$src), itin,
16880b57cec5SDimitry Andric                "$addr.addr = $wb">;
16890b57cec5SDimitry Andricclass VSTQWBregisterPseudo<InstrItinClass itin>
16900b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16910b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QPR:$src), itin,
16920b57cec5SDimitry Andric                "$addr.addr = $wb">;
16930b57cec5SDimitry Andricclass VSTQQPseudo<InstrItinClass itin>
16940b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
16950b57cec5SDimitry Andricclass VSTQQWBPseudo<InstrItinClass itin>
16960b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16970b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
16980b57cec5SDimitry Andric                "$addr.addr = $wb">;
16990b57cec5SDimitry Andricclass VSTQQWBfixedPseudo<InstrItinClass itin>
17000b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
17010b57cec5SDimitry Andric                (ins addrmode6:$addr, QQPR:$src), itin,
17020b57cec5SDimitry Andric                "$addr.addr = $wb">;
17030b57cec5SDimitry Andricclass VSTQQWBregisterPseudo<InstrItinClass itin>
17040b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
17050b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QQPR:$src), itin,
17060b57cec5SDimitry Andric                "$addr.addr = $wb">;
17070b57cec5SDimitry Andric
17080b57cec5SDimitry Andricclass VSTQQQQPseudo<InstrItinClass itin>
17090b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
17100b57cec5SDimitry Andricclass VSTQQQQWBPseudo<InstrItinClass itin>
17110b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
17120b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
17130b57cec5SDimitry Andric                "$addr.addr = $wb">;
17140b57cec5SDimitry Andric
17150b57cec5SDimitry Andric//   VST1     : Vector Store (multiple single elements)
17160b57cec5SDimitry Andricclass VST1D<bits<4> op7_4, string Dt, Operand AddrMode>
17170b57cec5SDimitry Andric  : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins AddrMode:$Rn, VecListOneD:$Vd),
17180b57cec5SDimitry Andric          IIC_VST1, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST1]> {
17190b57cec5SDimitry Andric  let Rm = 0b1111;
17200b57cec5SDimitry Andric  let Inst{4} = Rn{4};
17210b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17220b57cec5SDimitry Andric}
17230b57cec5SDimitry Andricclass VST1Q<bits<4> op7_4, string Dt, Operand AddrMode>
17240b57cec5SDimitry Andric  : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins AddrMode:$Rn, VecListDPair:$Vd),
17250b57cec5SDimitry Andric          IIC_VST1x2, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST2]> {
17260b57cec5SDimitry Andric  let Rm = 0b1111;
17270b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
17280b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17290b57cec5SDimitry Andric}
17300b57cec5SDimitry Andric
17310b57cec5SDimitry Andricdef  VST1d8   : VST1D<{0,0,0,?}, "8",  addrmode6align64>;
17320b57cec5SDimitry Andricdef  VST1d16  : VST1D<{0,1,0,?}, "16", addrmode6align64>;
17330b57cec5SDimitry Andricdef  VST1d32  : VST1D<{1,0,0,?}, "32", addrmode6align64>;
17340b57cec5SDimitry Andricdef  VST1d64  : VST1D<{1,1,0,?}, "64", addrmode6align64>;
17350b57cec5SDimitry Andric
17360b57cec5SDimitry Andricdef  VST1q8   : VST1Q<{0,0,?,?}, "8",  addrmode6align64or128>;
17370b57cec5SDimitry Andricdef  VST1q16  : VST1Q<{0,1,?,?}, "16", addrmode6align64or128>;
17380b57cec5SDimitry Andricdef  VST1q32  : VST1Q<{1,0,?,?}, "32", addrmode6align64or128>;
17390b57cec5SDimitry Andricdef  VST1q64  : VST1Q<{1,1,?,?}, "64", addrmode6align64or128>;
17400b57cec5SDimitry Andric
17410b57cec5SDimitry Andric// ...with address register writeback:
17420b57cec5SDimitry Andricmulticlass VST1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17430b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00, 0b0111,op7_4, (outs GPR:$wb),
17440b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListOneD:$Vd), IIC_VLD1u,
17450b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17460b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17470b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17480b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17490b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17500b57cec5SDimitry Andric  }
17510b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0111,op7_4, (outs GPR:$wb),
17520b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListOneD:$Vd),
17530b57cec5SDimitry Andric                        IIC_VLD1u,
17540b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17550b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17560b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17570b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17580b57cec5SDimitry Andric  }
17590b57cec5SDimitry Andric}
17600b57cec5SDimitry Andricmulticlass VST1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17610b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17620b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListDPair:$Vd), IIC_VLD1x2u,
17630b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17640b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17650b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17660b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17670b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17680b57cec5SDimitry Andric  }
17690b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17700b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListDPair:$Vd),
17710b57cec5SDimitry Andric                        IIC_VLD1x2u,
17720b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17730b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17740b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17750b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17760b57cec5SDimitry Andric  }
17770b57cec5SDimitry Andric}
17780b57cec5SDimitry Andric
17790b57cec5SDimitry Andricdefm VST1d8wb  : VST1DWB<{0,0,0,?}, "8",  addrmode6align64>;
17800b57cec5SDimitry Andricdefm VST1d16wb : VST1DWB<{0,1,0,?}, "16", addrmode6align64>;
17810b57cec5SDimitry Andricdefm VST1d32wb : VST1DWB<{1,0,0,?}, "32", addrmode6align64>;
17820b57cec5SDimitry Andricdefm VST1d64wb : VST1DWB<{1,1,0,?}, "64", addrmode6align64>;
17830b57cec5SDimitry Andric
17840b57cec5SDimitry Andricdefm VST1q8wb  : VST1QWB<{0,0,?,?}, "8",  addrmode6align64or128>;
17850b57cec5SDimitry Andricdefm VST1q16wb : VST1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
17860b57cec5SDimitry Andricdefm VST1q32wb : VST1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
17870b57cec5SDimitry Andricdefm VST1q64wb : VST1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
17880b57cec5SDimitry Andric
17890b57cec5SDimitry Andric// ...with 3 registers
17900b57cec5SDimitry Andricclass VST1D3<bits<4> op7_4, string Dt, Operand AddrMode>
17910b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
17920b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListThreeD:$Vd),
17930b57cec5SDimitry Andric          IIC_VST1x3, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST3]> {
17940b57cec5SDimitry Andric  let Rm = 0b1111;
17950b57cec5SDimitry Andric  let Inst{4} = Rn{4};
17960b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17970b57cec5SDimitry Andric}
17980b57cec5SDimitry Andricmulticlass VST1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
17990b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
18000b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListThreeD:$Vd), IIC_VLD1x3u,
18010b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
18020b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
18030b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
18040b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18050b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18060b57cec5SDimitry Andric  }
18070b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
18080b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListThreeD:$Vd),
18090b57cec5SDimitry Andric                        IIC_VLD1x3u,
18100b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
18110b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
18120b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18130b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18140b57cec5SDimitry Andric  }
18150b57cec5SDimitry Andric}
18160b57cec5SDimitry Andric
18170b57cec5SDimitry Andricdef VST1d8T     : VST1D3<{0,0,0,?}, "8",  addrmode6align64>;
18180b57cec5SDimitry Andricdef VST1d16T    : VST1D3<{0,1,0,?}, "16", addrmode6align64>;
18190b57cec5SDimitry Andricdef VST1d32T    : VST1D3<{1,0,0,?}, "32", addrmode6align64>;
18200b57cec5SDimitry Andricdef VST1d64T    : VST1D3<{1,1,0,?}, "64", addrmode6align64>;
18210b57cec5SDimitry Andric
18220b57cec5SDimitry Andricdefm VST1d8Twb  : VST1D3WB<{0,0,0,?}, "8",  addrmode6align64>;
18230b57cec5SDimitry Andricdefm VST1d16Twb : VST1D3WB<{0,1,0,?}, "16", addrmode6align64>;
18240b57cec5SDimitry Andricdefm VST1d32Twb : VST1D3WB<{1,0,0,?}, "32", addrmode6align64>;
18250b57cec5SDimitry Andricdefm VST1d64Twb : VST1D3WB<{1,1,0,?}, "64", addrmode6align64>;
18260b57cec5SDimitry Andric
18270b57cec5SDimitry Andricdef VST1d8TPseudo             : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1828fe6060f1SDimitry Andricdef VST1d8TPseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1829fe6060f1SDimitry Andricdef VST1d8TPseudoWB_register  : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18300b57cec5SDimitry Andricdef VST1d16TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1831fe6060f1SDimitry Andricdef VST1d16TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1832fe6060f1SDimitry Andricdef VST1d16TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18330b57cec5SDimitry Andricdef VST1d32TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1834fe6060f1SDimitry Andricdef VST1d32TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1835fe6060f1SDimitry Andricdef VST1d32TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18360b57cec5SDimitry Andricdef VST1d64TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18370b57cec5SDimitry Andricdef VST1d64TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18380b57cec5SDimitry Andricdef VST1d64TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18390b57cec5SDimitry Andric
18400b57cec5SDimitry Andricdef VST1q8HighTPseudo     : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18410b57cec5SDimitry Andricdef VST1q16HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18420b57cec5SDimitry Andricdef VST1q32HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18430b57cec5SDimitry Andricdef VST1q64HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1844fe6060f1SDimitry Andric
1845fe6060f1SDimitry Andricdef VST1q8HighTPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1846fe6060f1SDimitry Andricdef VST1q16HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1847fe6060f1SDimitry Andricdef VST1q32HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1848fe6060f1SDimitry Andricdef VST1q64HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1849fe6060f1SDimitry Andric
1850fe6060f1SDimitry Andricdef VST1q8LowTPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1851fe6060f1SDimitry Andricdef VST1q16LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1852fe6060f1SDimitry Andricdef VST1q32LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18530b57cec5SDimitry Andricdef VST1q64LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18540b57cec5SDimitry Andric
18550b57cec5SDimitry Andric// ...with 4 registers
18560b57cec5SDimitry Andricclass VST1D4<bits<4> op7_4, string Dt, Operand AddrMode>
18570b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
18580b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListFourD:$Vd),
18590b57cec5SDimitry Andric          IIC_VST1x4, "vst1", Dt, "$Vd, $Rn", "",
18600b57cec5SDimitry Andric          []>, Sched<[WriteVST4]> {
18610b57cec5SDimitry Andric  let Rm = 0b1111;
18620b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
18630b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
18640b57cec5SDimitry Andric}
18650b57cec5SDimitry Andricmulticlass VST1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
18660b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18670b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1x4u,
18680b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
18690b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18700b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
18710b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18720b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18730b57cec5SDimitry Andric  }
18740b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18750b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
18760b57cec5SDimitry Andric                        IIC_VLD1x4u,
18770b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
18780b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18790b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18800b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18810b57cec5SDimitry Andric  }
18820b57cec5SDimitry Andric}
18830b57cec5SDimitry Andric
18840b57cec5SDimitry Andricdef VST1d8Q     : VST1D4<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18850b57cec5SDimitry Andricdef VST1d16Q    : VST1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
18860b57cec5SDimitry Andricdef VST1d32Q    : VST1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
18870b57cec5SDimitry Andricdef VST1d64Q    : VST1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
18880b57cec5SDimitry Andric
18890b57cec5SDimitry Andricdefm VST1d8Qwb  : VST1D4WB<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18900b57cec5SDimitry Andricdefm VST1d16Qwb : VST1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
18910b57cec5SDimitry Andricdefm VST1d32Qwb : VST1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
18920b57cec5SDimitry Andricdefm VST1d64Qwb : VST1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
18930b57cec5SDimitry Andric
18940b57cec5SDimitry Andricdef VST1d8QPseudo             : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1895fe6060f1SDimitry Andricdef VST1d8QPseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1896fe6060f1SDimitry Andricdef VST1d8QPseudoWB_register  : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18970b57cec5SDimitry Andricdef VST1d16QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1898fe6060f1SDimitry Andricdef VST1d16QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1899fe6060f1SDimitry Andricdef VST1d16QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
19000b57cec5SDimitry Andricdef VST1d32QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1901fe6060f1SDimitry Andricdef VST1d32QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1902fe6060f1SDimitry Andricdef VST1d32QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
19030b57cec5SDimitry Andricdef VST1d64QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19040b57cec5SDimitry Andricdef VST1d64QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
19050b57cec5SDimitry Andricdef VST1d64QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
19060b57cec5SDimitry Andric
19070b57cec5SDimitry Andricdef VST1q8HighQPseudo     : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19080b57cec5SDimitry Andricdef VST1q16HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19090b57cec5SDimitry Andricdef VST1q32HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19100b57cec5SDimitry Andricdef VST1q64HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1911fe6060f1SDimitry Andric
1912fe6060f1SDimitry Andricdef VST1q8HighQPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1913fe6060f1SDimitry Andricdef VST1q16HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1914fe6060f1SDimitry Andricdef VST1q32HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1915fe6060f1SDimitry Andricdef VST1q64HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1916fe6060f1SDimitry Andric
1917fe6060f1SDimitry Andricdef VST1q8LowQPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1918fe6060f1SDimitry Andricdef VST1q16LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1919fe6060f1SDimitry Andricdef VST1q32LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19200b57cec5SDimitry Andricdef VST1q64LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19210b57cec5SDimitry Andric
19220b57cec5SDimitry Andric//   VST2     : Vector Store (multiple 2-element structures)
19230b57cec5SDimitry Andricclass VST2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
19240b57cec5SDimitry Andric            InstrItinClass itin, Operand AddrMode>
19250b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs), (ins AddrMode:$Rn, VdTy:$Vd),
19260b57cec5SDimitry Andric          itin, "vst2", Dt, "$Vd, $Rn", "", []> {
19270b57cec5SDimitry Andric  let Rm = 0b1111;
19280b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
19290b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST2Instruction";
19300b57cec5SDimitry Andric}
19310b57cec5SDimitry Andric
19320b57cec5SDimitry Andricdef  VST2d8   : VST2<0b1000, {0,0,?,?}, "8",  VecListDPair, IIC_VST2,
19330b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19340b57cec5SDimitry Andricdef  VST2d16  : VST2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VST2,
19350b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19360b57cec5SDimitry Andricdef  VST2d32  : VST2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VST2,
19370b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19380b57cec5SDimitry Andric
19390b57cec5SDimitry Andricdef  VST2q8   : VST2<0b0011, {0,0,?,?}, "8",  VecListFourD, IIC_VST2x2,
19400b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19410b57cec5SDimitry Andricdef  VST2q16  : VST2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VST2x2,
19420b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19430b57cec5SDimitry Andricdef  VST2q32  : VST2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VST2x2,
19440b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19450b57cec5SDimitry Andric
19460b57cec5SDimitry Andricdef  VST2q8Pseudo  : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19470b57cec5SDimitry Andricdef  VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19480b57cec5SDimitry Andricdef  VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19490b57cec5SDimitry Andric
19500b57cec5SDimitry Andric// ...with address register writeback:
19510b57cec5SDimitry Andricmulticlass VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt,
19520b57cec5SDimitry Andric                   RegisterOperand VdTy, Operand AddrMode> {
19530b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19540b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VdTy:$Vd), IIC_VLD1u,
19550b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
19560b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
19570b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
19580b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19590b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19600b57cec5SDimitry Andric  }
19610b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19620b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VdTy:$Vd), IIC_VLD1u,
19630b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19640b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
19650b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19660b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19670b57cec5SDimitry Andric  }
19680b57cec5SDimitry Andric}
19690b57cec5SDimitry Andricmulticlass VST2QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
19700b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19710b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1u,
19720b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
19730b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19740b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
19750b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19760b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19770b57cec5SDimitry Andric  }
19780b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19790b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
19800b57cec5SDimitry Andric                        IIC_VLD1u,
19810b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19820b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19830b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19840b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19850b57cec5SDimitry Andric  }
19860b57cec5SDimitry Andric}
19870b57cec5SDimitry Andric
19880b57cec5SDimitry Andricdefm VST2d8wb    : VST2DWB<0b1000, {0,0,?,?}, "8",  VecListDPair,
19890b57cec5SDimitry Andric                           addrmode6align64or128>;
19900b57cec5SDimitry Andricdefm VST2d16wb   : VST2DWB<0b1000, {0,1,?,?}, "16", VecListDPair,
19910b57cec5SDimitry Andric                           addrmode6align64or128>;
19920b57cec5SDimitry Andricdefm VST2d32wb   : VST2DWB<0b1000, {1,0,?,?}, "32", VecListDPair,
19930b57cec5SDimitry Andric                           addrmode6align64or128>;
19940b57cec5SDimitry Andric
19950b57cec5SDimitry Andricdefm VST2q8wb    : VST2QWB<{0,0,?,?}, "8", addrmode6align64or128or256>;
19960b57cec5SDimitry Andricdefm VST2q16wb   : VST2QWB<{0,1,?,?}, "16", addrmode6align64or128or256>;
19970b57cec5SDimitry Andricdefm VST2q32wb   : VST2QWB<{1,0,?,?}, "32", addrmode6align64or128or256>;
19980b57cec5SDimitry Andric
19990b57cec5SDimitry Andricdef VST2q8PseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20000b57cec5SDimitry Andricdef VST2q16PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20010b57cec5SDimitry Andricdef VST2q32PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20020b57cec5SDimitry Andricdef VST2q8PseudoWB_register  : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20030b57cec5SDimitry Andricdef VST2q16PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20040b57cec5SDimitry Andricdef VST2q32PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
20050b57cec5SDimitry Andric
20060b57cec5SDimitry Andric// ...with double-spaced registers
20070b57cec5SDimitry Andricdef VST2b8      : VST2<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced, IIC_VST2,
20080b57cec5SDimitry Andric                      addrmode6align64or128>;
20090b57cec5SDimitry Andricdef VST2b16     : VST2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VST2,
20100b57cec5SDimitry Andric                      addrmode6align64or128>;
20110b57cec5SDimitry Andricdef VST2b32     : VST2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VST2,
20120b57cec5SDimitry Andric                      addrmode6align64or128>;
20130b57cec5SDimitry Andricdefm VST2b8wb   : VST2DWB<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced,
20140b57cec5SDimitry Andric                          addrmode6align64or128>;
20150b57cec5SDimitry Andricdefm VST2b16wb  : VST2DWB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced,
20160b57cec5SDimitry Andric                          addrmode6align64or128>;
20170b57cec5SDimitry Andricdefm VST2b32wb  : VST2DWB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced,
20180b57cec5SDimitry Andric                          addrmode6align64or128>;
20190b57cec5SDimitry Andric
20200b57cec5SDimitry Andric//   VST3     : Vector Store (multiple 3-element structures)
20210b57cec5SDimitry Andricclass VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
20220b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
20230b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
20240b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []>, Sched<[WriteVST3]> {
20250b57cec5SDimitry Andric  let Rm = 0b1111;
20260b57cec5SDimitry Andric  let Inst{4} = Rn{4};
20270b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
20280b57cec5SDimitry Andric}
20290b57cec5SDimitry Andric
20300b57cec5SDimitry Andricdef  VST3d8   : VST3D<0b0100, {0,0,0,?}, "8">;
20310b57cec5SDimitry Andricdef  VST3d16  : VST3D<0b0100, {0,1,0,?}, "16">;
20320b57cec5SDimitry Andricdef  VST3d32  : VST3D<0b0100, {1,0,0,?}, "32">;
20330b57cec5SDimitry Andric
20340b57cec5SDimitry Andricdef  VST3d8Pseudo  : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20350b57cec5SDimitry Andricdef  VST3d16Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20360b57cec5SDimitry Andricdef  VST3d32Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20370b57cec5SDimitry Andric
20380b57cec5SDimitry Andric// ...with address register writeback:
20390b57cec5SDimitry Andricclass VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
20400b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
20410b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
20420b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
20430b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
20440b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
20450b57cec5SDimitry Andric  let Inst{4} = Rn{4};
20460b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
20470b57cec5SDimitry Andric}
20480b57cec5SDimitry Andric
20490b57cec5SDimitry Andricdef VST3d8_UPD  : VST3DWB<0b0100, {0,0,0,?}, "8">;
20500b57cec5SDimitry Andricdef VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
20510b57cec5SDimitry Andricdef VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
20520b57cec5SDimitry Andric
20530b57cec5SDimitry Andricdef VST3d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20540b57cec5SDimitry Andricdef VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20550b57cec5SDimitry Andricdef VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20560b57cec5SDimitry Andric
20570b57cec5SDimitry Andric// ...with double-spaced registers:
20580b57cec5SDimitry Andricdef VST3q8      : VST3D<0b0101, {0,0,0,?}, "8">;
20590b57cec5SDimitry Andricdef VST3q16     : VST3D<0b0101, {0,1,0,?}, "16">;
20600b57cec5SDimitry Andricdef VST3q32     : VST3D<0b0101, {1,0,0,?}, "32">;
20610b57cec5SDimitry Andricdef VST3q8_UPD  : VST3DWB<0b0101, {0,0,0,?}, "8">;
20620b57cec5SDimitry Andricdef VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
20630b57cec5SDimitry Andricdef VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
20640b57cec5SDimitry Andric
20650b57cec5SDimitry Andricdef VST3q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20660b57cec5SDimitry Andricdef VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20670b57cec5SDimitry Andricdef VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20680b57cec5SDimitry Andric
20690b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
20700b57cec5SDimitry Andricdef VST3q8oddPseudo   : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20710b57cec5SDimitry Andricdef VST3q16oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20720b57cec5SDimitry Andricdef VST3q32oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20730b57cec5SDimitry Andric
20740b57cec5SDimitry Andricdef VST3q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20750b57cec5SDimitry Andricdef VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20760b57cec5SDimitry Andricdef VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20770b57cec5SDimitry Andric
20780b57cec5SDimitry Andric//   VST4     : Vector Store (multiple 4-element structures)
20790b57cec5SDimitry Andricclass VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
20800b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
20810b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
20820b57cec5SDimitry Andric          IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
20830b57cec5SDimitry Andric          "", []>, Sched<[WriteVST4]> {
20840b57cec5SDimitry Andric  let Rm = 0b1111;
20850b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
20860b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
20870b57cec5SDimitry Andric}
20880b57cec5SDimitry Andric
20890b57cec5SDimitry Andricdef  VST4d8   : VST4D<0b0000, {0,0,?,?}, "8">;
20900b57cec5SDimitry Andricdef  VST4d16  : VST4D<0b0000, {0,1,?,?}, "16">;
20910b57cec5SDimitry Andricdef  VST4d32  : VST4D<0b0000, {1,0,?,?}, "32">;
20920b57cec5SDimitry Andric
20930b57cec5SDimitry Andricdef  VST4d8Pseudo  : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20940b57cec5SDimitry Andricdef  VST4d16Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20950b57cec5SDimitry Andricdef  VST4d32Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20960b57cec5SDimitry Andric
20970b57cec5SDimitry Andric// ...with address register writeback:
20980b57cec5SDimitry Andricclass VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
20990b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
21000b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
21010b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
21020b57cec5SDimitry Andric           "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
21030b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
21040b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
21050b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
21060b57cec5SDimitry Andric}
21070b57cec5SDimitry Andric
21080b57cec5SDimitry Andricdef VST4d8_UPD  : VST4DWB<0b0000, {0,0,?,?}, "8">;
21090b57cec5SDimitry Andricdef VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
21100b57cec5SDimitry Andricdef VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
21110b57cec5SDimitry Andric
21120b57cec5SDimitry Andricdef VST4d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21130b57cec5SDimitry Andricdef VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21140b57cec5SDimitry Andricdef VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21150b57cec5SDimitry Andric
21160b57cec5SDimitry Andric// ...with double-spaced registers:
21170b57cec5SDimitry Andricdef VST4q8      : VST4D<0b0001, {0,0,?,?}, "8">;
21180b57cec5SDimitry Andricdef VST4q16     : VST4D<0b0001, {0,1,?,?}, "16">;
21190b57cec5SDimitry Andricdef VST4q32     : VST4D<0b0001, {1,0,?,?}, "32">;
21200b57cec5SDimitry Andricdef VST4q8_UPD  : VST4DWB<0b0001, {0,0,?,?}, "8">;
21210b57cec5SDimitry Andricdef VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
21220b57cec5SDimitry Andricdef VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
21230b57cec5SDimitry Andric
21240b57cec5SDimitry Andricdef VST4q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21250b57cec5SDimitry Andricdef VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21260b57cec5SDimitry Andricdef VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21270b57cec5SDimitry Andric
21280b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
21290b57cec5SDimitry Andricdef VST4q8oddPseudo   : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21300b57cec5SDimitry Andricdef VST4q16oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21310b57cec5SDimitry Andricdef VST4q32oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21320b57cec5SDimitry Andric
21330b57cec5SDimitry Andricdef VST4q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21340b57cec5SDimitry Andricdef VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21350b57cec5SDimitry Andricdef VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21360b57cec5SDimitry Andric
21370b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
21380b57cec5SDimitry Andric
21390b57cec5SDimitry Andric// Classes for VST*LN pseudo-instructions with multi-register operands.
21400b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
21410b57cec5SDimitry Andricclass VSTQLNPseudo<InstrItinClass itin>
21420b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
21430b57cec5SDimitry Andric                itin, "">;
21440b57cec5SDimitry Andricclass VSTQLNWBPseudo<InstrItinClass itin>
21450b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21460b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
21470b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21480b57cec5SDimitry Andricclass VSTQQLNPseudo<InstrItinClass itin>
21490b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
21500b57cec5SDimitry Andric                itin, "">;
21510b57cec5SDimitry Andricclass VSTQQLNWBPseudo<InstrItinClass itin>
21520b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21530b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
21540b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21550b57cec5SDimitry Andricclass VSTQQQQLNPseudo<InstrItinClass itin>
21560b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
21570b57cec5SDimitry Andric                itin, "">;
21580b57cec5SDimitry Andricclass VSTQQQQLNWBPseudo<InstrItinClass itin>
21590b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21600b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
21610b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21620b57cec5SDimitry Andric
21630b57cec5SDimitry Andric//   VST1LN   : Vector Store (single element from one lane)
21640b57cec5SDimitry Andricclass VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
21650b57cec5SDimitry Andric             PatFrag StoreOp, SDNode ExtractOp, Operand AddrMode>
21660b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
21670b57cec5SDimitry Andric          (ins AddrMode:$Rn, DPR:$Vd, nohash_imm:$lane),
21680b57cec5SDimitry Andric          IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
21690b57cec5SDimitry Andric          [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), AddrMode:$Rn)]>,
21700b57cec5SDimitry Andric     Sched<[WriteVST1]> {
21710b57cec5SDimitry Andric  let Rm = 0b1111;
21720b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
21730b57cec5SDimitry Andric}
21740b57cec5SDimitry Andricclass VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
21750b57cec5SDimitry Andric  : VSTQLNPseudo<IIC_VST1ln>, Sched<[WriteVST1]> {
21760b57cec5SDimitry Andric  let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
21770b57cec5SDimitry Andric                          addrmode6:$addr)];
21780b57cec5SDimitry Andric}
21790b57cec5SDimitry Andric
21800b57cec5SDimitry Andricdef VST1LNd8  : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
21810b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21820b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
21830b57cec5SDimitry Andric}
21840b57cec5SDimitry Andricdef VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
21850b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21860b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
21870b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
21880b57cec5SDimitry Andric}
21890b57cec5SDimitry Andric
21900b57cec5SDimitry Andricdef VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt,
21910b57cec5SDimitry Andric                       addrmode6oneL32> {
21920b57cec5SDimitry Andric  let Inst{7}   = lane{0};
21930b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
21940b57cec5SDimitry Andric}
21950b57cec5SDimitry Andric
21960b57cec5SDimitry Andricdef VST1LNq8Pseudo  : VST1QLNPseudo<v16i8, truncstorei8, ARMvgetlaneu>;
21970b57cec5SDimitry Andricdef VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, ARMvgetlaneu>;
21980b57cec5SDimitry Andricdef VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
21990b57cec5SDimitry Andric
22000b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
22010b57cec5SDimitry Andricdef : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
22020b57cec5SDimitry Andric          (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
22030b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
22040b57cec5SDimitry Andric          (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
22050b57cec5SDimitry Andric
22060b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f16 DPR:$src), imm:$lane), addrmode6:$addr),
22070b57cec5SDimitry Andric          (VST1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
22080b57cec5SDimitry Andricdef : Pat<(store (extractelt (v8f16 QPR:$src), imm:$lane), addrmode6:$addr),
22090b57cec5SDimitry Andric          (VST1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
22100b57cec5SDimitry Andric}
22110b57cec5SDimitry Andric
22120b57cec5SDimitry Andric// ...with address register writeback:
22130b57cec5SDimitry Andricclass VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
22140b57cec5SDimitry Andric               PatFrag StoreOp, SDNode ExtractOp, Operand AdrMode>
22150b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
22160b57cec5SDimitry Andric          (ins AdrMode:$Rn, am6offset:$Rm,
22170b57cec5SDimitry Andric           DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
22180b57cec5SDimitry Andric          "\\{$Vd[$lane]\\}, $Rn$Rm",
22190b57cec5SDimitry Andric          "$Rn.addr = $wb",
22200b57cec5SDimitry Andric          [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
22210b57cec5SDimitry Andric                                  AdrMode:$Rn, am6offset:$Rm))]>,
22220b57cec5SDimitry Andric    Sched<[WriteVST1]> {
22230b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
22240b57cec5SDimitry Andric}
22250b57cec5SDimitry Andricclass VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
22260b57cec5SDimitry Andric  : VSTQLNWBPseudo<IIC_VST1lnu>, Sched<[WriteVST1]> {
22270b57cec5SDimitry Andric  let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
22280b57cec5SDimitry Andric                                        addrmode6:$addr, am6offset:$offset))];
22290b57cec5SDimitry Andric}
22300b57cec5SDimitry Andric
22310b57cec5SDimitry Andricdef VST1LNd8_UPD  : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
22320b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
22330b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22340b57cec5SDimitry Andric}
22350b57cec5SDimitry Andricdef VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
22360b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
22370b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22380b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22390b57cec5SDimitry Andric}
22400b57cec5SDimitry Andricdef VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
22410b57cec5SDimitry Andric                             extractelt, addrmode6oneL32> {
22420b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22430b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
22440b57cec5SDimitry Andric}
22450b57cec5SDimitry Andric
22460b57cec5SDimitry Andricdef VST1LNq8Pseudo_UPD  : VST1QLNWBPseudo<v16i8, post_truncsti8, ARMvgetlaneu>;
22470b57cec5SDimitry Andricdef VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,ARMvgetlaneu>;
22480b57cec5SDimitry Andricdef VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
22490b57cec5SDimitry Andric
22500b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
22510b57cec5SDimitry Andric
22520b57cec5SDimitry Andric//   VST2LN   : Vector Store (single 2-element structure from one lane)
22530b57cec5SDimitry Andricclass VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
22540b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
22550b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
22560b57cec5SDimitry Andric          IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
22570b57cec5SDimitry Andric          "", []>, Sched<[WriteVST1]> {
22580b57cec5SDimitry Andric  let Rm = 0b1111;
22590b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22600b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22610b57cec5SDimitry Andric}
22620b57cec5SDimitry Andric
22630b57cec5SDimitry Andricdef VST2LNd8  : VST2LN<0b0001, {?,?,?,?}, "8"> {
22640b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22650b57cec5SDimitry Andric}
22660b57cec5SDimitry Andricdef VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
22670b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22680b57cec5SDimitry Andric}
22690b57cec5SDimitry Andricdef VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
22700b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22710b57cec5SDimitry Andric}
22720b57cec5SDimitry Andric
22730b57cec5SDimitry Andricdef VST2LNd8Pseudo  : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22740b57cec5SDimitry Andricdef VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22750b57cec5SDimitry Andricdef VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22760b57cec5SDimitry Andric
22770b57cec5SDimitry Andric// ...with double-spaced registers:
22780b57cec5SDimitry Andricdef VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
22790b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22800b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22810b57cec5SDimitry Andric}
22820b57cec5SDimitry Andricdef VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
22830b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22840b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22850b57cec5SDimitry Andric}
22860b57cec5SDimitry Andric
22870b57cec5SDimitry Andricdef VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22880b57cec5SDimitry Andricdef VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22890b57cec5SDimitry Andric
22900b57cec5SDimitry Andric// ...with address register writeback:
22910b57cec5SDimitry Andricclass VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
22920b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
22930b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
22940b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
22950b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane]\\}, $Rn$Rm",
22960b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
22970b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22980b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22990b57cec5SDimitry Andric}
23000b57cec5SDimitry Andric
23010b57cec5SDimitry Andricdef VST2LNd8_UPD  : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
23020b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23030b57cec5SDimitry Andric}
23040b57cec5SDimitry Andricdef VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
23050b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23060b57cec5SDimitry Andric}
23070b57cec5SDimitry Andricdef VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
23080b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23090b57cec5SDimitry Andric}
23100b57cec5SDimitry Andric
23110b57cec5SDimitry Andricdef VST2LNd8Pseudo_UPD  : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23120b57cec5SDimitry Andricdef VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23130b57cec5SDimitry Andricdef VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23140b57cec5SDimitry Andric
23150b57cec5SDimitry Andricdef VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
23160b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23170b57cec5SDimitry Andric}
23180b57cec5SDimitry Andricdef VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
23190b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23200b57cec5SDimitry Andric}
23210b57cec5SDimitry Andric
23220b57cec5SDimitry Andricdef VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23230b57cec5SDimitry Andricdef VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23240b57cec5SDimitry Andric
23250b57cec5SDimitry Andric//   VST3LN   : Vector Store (single 3-element structure from one lane)
23260b57cec5SDimitry Andricclass VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
23270b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
23280b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
23290b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
23300b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []>,
23310b57cec5SDimitry Andric    Sched<[WriteVST2]> {
23320b57cec5SDimitry Andric  let Rm = 0b1111;
23330b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
23340b57cec5SDimitry Andric}
23350b57cec5SDimitry Andric
23360b57cec5SDimitry Andricdef VST3LNd8  : VST3LN<0b0010, {?,?,?,0}, "8"> {
23370b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23380b57cec5SDimitry Andric}
23390b57cec5SDimitry Andricdef VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
23400b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23410b57cec5SDimitry Andric}
23420b57cec5SDimitry Andricdef VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
23430b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23440b57cec5SDimitry Andric}
23450b57cec5SDimitry Andric
23460b57cec5SDimitry Andricdef VST3LNd8Pseudo  : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23470b57cec5SDimitry Andricdef VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23480b57cec5SDimitry Andricdef VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23490b57cec5SDimitry Andric
23500b57cec5SDimitry Andric// ...with double-spaced registers:
23510b57cec5SDimitry Andricdef VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
23520b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23530b57cec5SDimitry Andric}
23540b57cec5SDimitry Andricdef VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
23550b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23560b57cec5SDimitry Andric}
23570b57cec5SDimitry Andric
23580b57cec5SDimitry Andricdef VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23590b57cec5SDimitry Andricdef VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23600b57cec5SDimitry Andric
23610b57cec5SDimitry Andric// ...with address register writeback:
23620b57cec5SDimitry Andricclass VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
23630b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
23640b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
23650b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
23660b57cec5SDimitry Andric          IIC_VST3lnu, "vst3", Dt,
23670b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
23680b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
23690b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
23700b57cec5SDimitry Andric}
23710b57cec5SDimitry Andric
23720b57cec5SDimitry Andricdef VST3LNd8_UPD  : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
23730b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23740b57cec5SDimitry Andric}
23750b57cec5SDimitry Andricdef VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
23760b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23770b57cec5SDimitry Andric}
23780b57cec5SDimitry Andricdef VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
23790b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23800b57cec5SDimitry Andric}
23810b57cec5SDimitry Andric
23820b57cec5SDimitry Andricdef VST3LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23830b57cec5SDimitry Andricdef VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23840b57cec5SDimitry Andricdef VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23850b57cec5SDimitry Andric
23860b57cec5SDimitry Andricdef VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
23870b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23880b57cec5SDimitry Andric}
23890b57cec5SDimitry Andricdef VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
23900b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23910b57cec5SDimitry Andric}
23920b57cec5SDimitry Andric
23930b57cec5SDimitry Andricdef VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23940b57cec5SDimitry Andricdef VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23950b57cec5SDimitry Andric
23960b57cec5SDimitry Andric//   VST4LN   : Vector Store (single 4-element structure from one lane)
23970b57cec5SDimitry Andricclass VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
23980b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
23990b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
24000b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
24010b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
24020b57cec5SDimitry Andric          "", []>, Sched<[WriteVST2]> {
24030b57cec5SDimitry Andric  let Rm = 0b1111;
24040b57cec5SDimitry Andric  let Inst{4} = Rn{4};
24050b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
24060b57cec5SDimitry Andric}
24070b57cec5SDimitry Andric
24080b57cec5SDimitry Andricdef VST4LNd8  : VST4LN<0b0011, {?,?,?,?}, "8"> {
24090b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
24100b57cec5SDimitry Andric}
24110b57cec5SDimitry Andricdef VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
24120b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24130b57cec5SDimitry Andric}
24140b57cec5SDimitry Andricdef VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
24150b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24160b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24170b57cec5SDimitry Andric}
24180b57cec5SDimitry Andric
24190b57cec5SDimitry Andricdef VST4LNd8Pseudo  : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24200b57cec5SDimitry Andricdef VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24210b57cec5SDimitry Andricdef VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24220b57cec5SDimitry Andric
24230b57cec5SDimitry Andric// ...with double-spaced registers:
24240b57cec5SDimitry Andricdef VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
24250b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24260b57cec5SDimitry Andric}
24270b57cec5SDimitry Andricdef VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
24280b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24290b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24300b57cec5SDimitry Andric}
24310b57cec5SDimitry Andric
24320b57cec5SDimitry Andricdef VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24330b57cec5SDimitry Andricdef VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24340b57cec5SDimitry Andric
24350b57cec5SDimitry Andric// ...with address register writeback:
24360b57cec5SDimitry Andricclass VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
24370b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
24380b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
24390b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
24400b57cec5SDimitry Andric          IIC_VST4lnu, "vst4", Dt,
24410b57cec5SDimitry Andric  "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
24420b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
24430b57cec5SDimitry Andric  let Inst{4} = Rn{4};
24440b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
24450b57cec5SDimitry Andric}
24460b57cec5SDimitry Andric
24470b57cec5SDimitry Andricdef VST4LNd8_UPD  : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
24480b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
24490b57cec5SDimitry Andric}
24500b57cec5SDimitry Andricdef VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
24510b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24520b57cec5SDimitry Andric}
24530b57cec5SDimitry Andricdef VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
24540b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24550b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24560b57cec5SDimitry Andric}
24570b57cec5SDimitry Andric
24580b57cec5SDimitry Andricdef VST4LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24590b57cec5SDimitry Andricdef VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24600b57cec5SDimitry Andricdef VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24610b57cec5SDimitry Andric
24620b57cec5SDimitry Andricdef VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
24630b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24640b57cec5SDimitry Andric}
24650b57cec5SDimitry Andricdef VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
24660b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24670b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24680b57cec5SDimitry Andric}
24690b57cec5SDimitry Andric
24700b57cec5SDimitry Andricdef VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24710b57cec5SDimitry Andricdef VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24720b57cec5SDimitry Andric
24730b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
24740b57cec5SDimitry Andric
24750b57cec5SDimitry Andric// Use vld1/vst1 for unaligned f64 load / store
24760b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
24770b57cec5SDimitry Andricdef : Pat<(f64 (hword_alignedload addrmode6:$addr)),
24780b57cec5SDimitry Andric          (VLD1d16 addrmode6:$addr)>;
24790b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (f64 DPR:$value), addrmode6:$addr),
24800b57cec5SDimitry Andric          (VST1d16 addrmode6:$addr, DPR:$value)>;
24810b57cec5SDimitry Andricdef : Pat<(f64 (byte_alignedload addrmode6:$addr)),
24820b57cec5SDimitry Andric          (VLD1d8 addrmode6:$addr)>;
24830b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (f64 DPR:$value), addrmode6:$addr),
24840b57cec5SDimitry Andric          (VST1d8 addrmode6:$addr, DPR:$value)>;
24850b57cec5SDimitry Andric}
24860b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
24870b57cec5SDimitry Andricdef : Pat<(f64 (non_word_alignedload addrmode6:$addr)),
24880b57cec5SDimitry Andric          (VLD1d64 addrmode6:$addr)>;
24890b57cec5SDimitry Andricdef : Pat<(non_word_alignedstore (f64 DPR:$value), addrmode6:$addr),
24900b57cec5SDimitry Andric          (VST1d64 addrmode6:$addr, DPR:$value)>;
24910b57cec5SDimitry Andric}
24920b57cec5SDimitry Andric
24930b57cec5SDimitry Andric// Use vld1/vst1 for Q and QQ. Also use them for unaligned v2f64
24940b57cec5SDimitry Andric// load / store if it's legal.
24950b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
24960b57cec5SDimitry Andricdef : Pat<(v2f64 (dword_alignedload addrmode6:$addr)),
24970b57cec5SDimitry Andric          (VLD1q64 addrmode6:$addr)>;
24980b57cec5SDimitry Andricdef : Pat<(dword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24990b57cec5SDimitry Andric          (VST1q64 addrmode6:$addr, QPR:$value)>;
25000b57cec5SDimitry Andric}
25010b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
25020b57cec5SDimitry Andricdef : Pat<(v2f64 (word_alignedload addrmode6:$addr)),
25030b57cec5SDimitry Andric          (VLD1q32 addrmode6:$addr)>;
25040b57cec5SDimitry Andricdef : Pat<(word_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
25050b57cec5SDimitry Andric          (VST1q32 addrmode6:$addr, QPR:$value)>;
25060b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
25070b57cec5SDimitry Andric          (VLD1q16 addrmode6:$addr)>;
25080b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
25090b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, QPR:$value)>;
25100b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
25110b57cec5SDimitry Andric          (VLD1q8 addrmode6:$addr)>;
25120b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
25130b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, QPR:$value)>;
25140b57cec5SDimitry Andric}
25150b57cec5SDimitry Andric
25160b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
25170b57cec5SDimitry Andric// Instruction Classes
25180b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
25190b57cec5SDimitry Andric
25200b57cec5SDimitry Andric// Basic 2-register operations: double- and quad-register.
25210b57cec5SDimitry Andricclass N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25220b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
25230b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
25240b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
25250b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
25260b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
25270b57cec5SDimitry Andricclass N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25280b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
25290b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
25300b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
25310b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
25320b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
25330b57cec5SDimitry Andric
25340b57cec5SDimitry Andric// Basic 2-register intrinsics, both double- and quad-register.
25350b57cec5SDimitry Andricclass N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25360b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
25370b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25380b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25390b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
25400b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25410b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
25420b57cec5SDimitry Andricclass N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25430b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
25440b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25450b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25460b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
25470b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25480b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25490b57cec5SDimitry Andric
25500b57cec5SDimitry Andric// Same as above, but not predicated.
25510b57cec5SDimitry Andricclass N2VDIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
25520b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25530b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25540b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 0,  (outs DPR:$Vd), (ins DPR:$Vm),
25550b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25560b57cec5SDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
25570b57cec5SDimitry Andric
25580b57cec5SDimitry Andricclass N2VQIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
25590b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25600b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25610b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 1,  (outs QPR:$Vd), (ins QPR:$Vm),
25620b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25630b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25640b57cec5SDimitry Andric
25650b57cec5SDimitry Andric// Similar to NV2VQIntnp with some more encoding bits exposed (crypto).
25660b57cec5SDimitry Andricclass N2VQIntXnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25670b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25680b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25690b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,  (outs QPR:$Vd), (ins QPR:$Vm),
25700b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25710b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25720b57cec5SDimitry Andric
25730b57cec5SDimitry Andric// Same as N2VQIntXnp but with Vd as a src register.
25740b57cec5SDimitry Andricclass N2VQIntX2np<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25750b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25760b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25770b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,
25780b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vm),
25790b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25800b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vm))))]> {
25810b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
25820b57cec5SDimitry Andric}
25830b57cec5SDimitry Andric
25840b57cec5SDimitry Andric// Narrow 2-register operations.
25850b57cec5SDimitry Andricclass N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25860b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25870b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25880b57cec5SDimitry Andric           ValueType TyD, ValueType TyQ, SDNode OpNode>
25890b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25900b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25910b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
25920b57cec5SDimitry Andric
25930b57cec5SDimitry Andric// Narrow 2-register intrinsics.
25940b57cec5SDimitry Andricclass N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25950b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25960b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25970b57cec5SDimitry Andric              ValueType TyD, ValueType TyQ, SDPatternOperator IntOp>
25980b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25990b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
26000b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
26010b57cec5SDimitry Andric
26020b57cec5SDimitry Andric// Long 2-register operations (currently only used for VMOVL).
26030b57cec5SDimitry Andricclass N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
26040b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
26050b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26060b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode>
26070b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
26080b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
26090b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
26100b57cec5SDimitry Andric
26110b57cec5SDimitry Andric// Long 2-register intrinsics.
26120b57cec5SDimitry Andricclass N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
26130b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
26140b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
26150b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
26160b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
26170b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
26180b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
26190b57cec5SDimitry Andric
26200b57cec5SDimitry Andric// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
26210b57cec5SDimitry Andricclass N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
26220b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
26230b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
26240b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm",
26250b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
26260b57cec5SDimitry Andricclass N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
26270b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt>
26280b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
26290b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
26300b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
26310b57cec5SDimitry Andric
26320b57cec5SDimitry Andric// Basic 3-register operations: double- and quad-register.
26330b57cec5SDimitry Andricclass N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26340b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26350b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26360b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
26370b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
26380b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26390b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
26400b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26410b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26420b57cec5SDimitry Andric  let isCommutable = Commutable;
26430b57cec5SDimitry Andric}
26440b57cec5SDimitry Andric// Same as N3VD but no data type.
26450b57cec5SDimitry Andricclass N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26460b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
26470b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy,
26480b57cec5SDimitry Andric           SDNode OpNode, bit Commutable>
26490b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 0, op4,
26500b57cec5SDimitry Andric         (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
26510b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
26520b57cec5SDimitry Andric         [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
26530b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26540b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26550b57cec5SDimitry Andric  let isCommutable = Commutable;
26560b57cec5SDimitry Andric}
26570b57cec5SDimitry Andric
26580b57cec5SDimitry Andricclass N3VDSL<bits<2> op21_20, bits<4> op11_8,
26590b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
26600b57cec5SDimitry Andric             ValueType Ty, SDNode ShOp>
26610b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
26620b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
26630b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
26640b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26650b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26660b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
26670b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26680b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26690b57cec5SDimitry Andric  let isCommutable = 0;
26700b57cec5SDimitry Andric}
26710b57cec5SDimitry Andricclass N3VDSL16<bits<2> op21_20, bits<4> op11_8,
26720b57cec5SDimitry Andric               string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
26730b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
26740b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
26750b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane","",
26760b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26770b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26780b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
26790b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26800b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26810b57cec5SDimitry Andric  let isCommutable = 0;
26820b57cec5SDimitry Andric}
26830b57cec5SDimitry Andric
26840b57cec5SDimitry Andricclass N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26850b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26860b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26870b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
26880b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
26890b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26900b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
26910b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26920b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26930b57cec5SDimitry Andric  let isCommutable = Commutable;
26940b57cec5SDimitry Andric}
26950b57cec5SDimitry Andricclass N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26960b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
26970b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26980b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 1, op4,
26990b57cec5SDimitry Andric         (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
27000b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
27010b57cec5SDimitry Andric         [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
27020b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27030b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27040b57cec5SDimitry Andric  let isCommutable = Commutable;
27050b57cec5SDimitry Andric}
27060b57cec5SDimitry Andricclass N3VQSL<bits<2> op21_20, bits<4> op11_8,
27070b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
27080b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, SDNode ShOp>
27090b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
27100b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
27110b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27120b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
27130b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
27140b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
27150b57cec5SDimitry Andric                                                imm:$lane)))))]> {
27160b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27170b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27180b57cec5SDimitry Andric  let isCommutable = 0;
27190b57cec5SDimitry Andric}
27200b57cec5SDimitry Andricclass N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
27210b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDNode ShOp>
27220b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
27230b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27240b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane", "",
27250b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
27260b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
27270b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
27280b57cec5SDimitry Andric                                                imm:$lane)))))]> {
27290b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27300b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27310b57cec5SDimitry Andric  let isCommutable = 0;
27320b57cec5SDimitry Andric}
27330b57cec5SDimitry Andric
27340b57cec5SDimitry Andric// Basic 3-register intrinsics, both double- and quad-register.
27350b57cec5SDimitry Andricclass N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27360b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27370b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
27380b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
27390b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
27400b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
27410b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
27420b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27430b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27440b57cec5SDimitry Andric  let isCommutable = Commutable;
27450b57cec5SDimitry Andric}
27460b57cec5SDimitry Andric
27470b57cec5SDimitry Andricclass N3VDIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
27480b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
27490b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
27500b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
27510b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2752349cc55cSDimitry Andric          (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin, OpcodeStr, Dt,
2753349cc55cSDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2754349cc55cSDimitry Andric  let isCommutable = Commutable;
2755349cc55cSDimitry Andric}
2756349cc55cSDimitry Andric
27570b57cec5SDimitry Andric
27580b57cec5SDimitry Andricclass N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27590b57cec5SDimitry Andric                string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
27600b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
27610b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
27620b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27630b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27640b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27650b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
27660b57cec5SDimitry Andric                                           imm:$lane)))))]> {
27670b57cec5SDimitry Andric  let isCommutable = 0;
27680b57cec5SDimitry Andric}
27690b57cec5SDimitry Andric
27700b57cec5SDimitry Andricclass N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27710b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
27720b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
27730b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27740b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27750b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27760b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27770b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
27780b57cec5SDimitry Andric  let isCommutable = 0;
27790b57cec5SDimitry Andric}
27800b57cec5SDimitry Andricclass N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27810b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27820b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27830b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
27840b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
27850b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
27860b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
27870b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
27880b57cec5SDimitry Andric  let isCommutable = 0;
27890b57cec5SDimitry Andric}
27900b57cec5SDimitry Andric
27910b57cec5SDimitry Andricclass N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27920b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27930b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
27940b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
27950b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
27960b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
27970b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
27980b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27990b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
28000b57cec5SDimitry Andric  let isCommutable = Commutable;
28010b57cec5SDimitry Andric}
28020b57cec5SDimitry Andric
28030b57cec5SDimitry Andricclass N3VQIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
28040b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
28050b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
28060b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
28070b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
28080b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin, OpcodeStr, Dt,
2809349cc55cSDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2810349cc55cSDimitry Andric  let isCommutable = Commutable;
2811349cc55cSDimitry Andric}
28120b57cec5SDimitry Andric
28130b57cec5SDimitry Andric// Same as N3VQIntnp but with Vd as a src register.
28140b57cec5SDimitry Andricclass N3VQInt3np<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
28150b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
28160b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
2817349cc55cSDimitry Andric                SDPatternOperator IntOp>
28180b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
28190b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vn, QPR:$Vm),
28200b57cec5SDimitry Andric          f, itin, OpcodeStr, Dt,
28210b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vn),
28220b57cec5SDimitry Andric                                       (OpTy QPR:$Vm))))]> {
28230b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
2824349cc55cSDimitry Andric  let isCommutable = 0;
28250b57cec5SDimitry Andric}
28260b57cec5SDimitry Andric
28270b57cec5SDimitry Andricclass N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28280b57cec5SDimitry Andric                string OpcodeStr, string Dt,
28290b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28300b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
28310b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28320b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
28330b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28340b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
28350b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
28360b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
28370b57cec5SDimitry Andric  let isCommutable = 0;
28380b57cec5SDimitry Andric}
28390b57cec5SDimitry Andricclass N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28400b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
28410b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28420b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
28430b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28440b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
28450b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28460b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
28470b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
28480b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
28490b57cec5SDimitry Andric  let isCommutable = 0;
28500b57cec5SDimitry Andric}
28510b57cec5SDimitry Andricclass N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28520b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
28530b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28540b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
28550b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
28560b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
28570b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
28580b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
28590b57cec5SDimitry Andric  let isCommutable = 0;
28600b57cec5SDimitry Andric}
28610b57cec5SDimitry Andric
28620b57cec5SDimitry Andric// Multiply-Add/Sub operations: double- and quad-register.
28630b57cec5SDimitry Andricclass N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28640b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
28650b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
28660b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
28670b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
28680b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28690b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
28700b57cec5SDimitry Andric                             (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
28710b57cec5SDimitry Andric
28720b57cec5SDimitry Andricclass N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28730b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
28740b57cec5SDimitry Andric                  ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28750b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
28760b57cec5SDimitry Andric        (outs DPR:$Vd),
28770b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28780b57cec5SDimitry Andric        NVMulSLFrm, itin,
28790b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28800b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28810b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28820b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28830b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
28840b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28850b57cec5SDimitry Andricclass N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28860b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
28870b57cec5SDimitry Andric                    ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28880b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
28890b57cec5SDimitry Andric        (outs DPR:$Vd),
28900b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28910b57cec5SDimitry Andric        NVMulSLFrm, itin,
28920b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28930b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28940b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28950b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28960b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_8:$Vm),
28970b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28980b57cec5SDimitry Andric
28990b57cec5SDimitry Andricclass N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29000b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
29010b57cec5SDimitry Andric                SDPatternOperator MulOp, SDPatternOperator OpNode>
29020b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29030b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29040b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29050b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
29060b57cec5SDimitry Andric                             (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
29070b57cec5SDimitry Andricclass N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
29080b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
29090b57cec5SDimitry Andric                  SDPatternOperator MulOp, SDPatternOperator ShOp>
29100b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
29110b57cec5SDimitry Andric        (outs QPR:$Vd),
29120b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
29130b57cec5SDimitry Andric        NVMulSLFrm, itin,
29140b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29150b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
29160b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$src1),
29170b57cec5SDimitry Andric                           (ResTy (MulOp QPR:$Vn,
29180b57cec5SDimitry Andric                                   (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
29190b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
29200b57cec5SDimitry Andricclass N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
29210b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
29220b57cec5SDimitry Andric                    ValueType ResTy, ValueType OpTy,
29230b57cec5SDimitry Andric                    SDPatternOperator MulOp, SDPatternOperator ShOp>
29240b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
29250b57cec5SDimitry Andric        (outs QPR:$Vd),
29260b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
29270b57cec5SDimitry Andric        NVMulSLFrm, itin,
29280b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29290b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
29300b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$src1),
29310b57cec5SDimitry Andric                           (ResTy (MulOp QPR:$Vn,
29320b57cec5SDimitry Andric                                   (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
29330b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
29340b57cec5SDimitry Andric
29350b57cec5SDimitry Andric// Neon Intrinsic-Op instructions (VABA): double- and quad-register.
29360b57cec5SDimitry Andricclass N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29370b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29380b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
29390b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29400b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29410b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29420b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
29430b57cec5SDimitry Andric                             (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
29440b57cec5SDimitry Andricclass N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29450b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29460b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
29470b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29480b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29490b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29500b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
29510b57cec5SDimitry Andric                             (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
29520b57cec5SDimitry Andric
29530b57cec5SDimitry Andric// Neon 3-argument intrinsics, both double- and quad-register.
29540b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
29550b57cec5SDimitry Andricclass N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29560b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29570b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29580b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29590b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29600b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29610b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
29620b57cec5SDimitry Andric                                      (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
29630b57cec5SDimitry Andricclass N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29640b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29650b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29660b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29670b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29680b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29690b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
29700b57cec5SDimitry Andric                                      (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
29710b57cec5SDimitry Andric
29720b57cec5SDimitry Andric// Long Multiply-Add/Sub operations.
29730b57cec5SDimitry Andricclass N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29740b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29750b57cec5SDimitry Andric                ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29760b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29770b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29780b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29790b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
29800b57cec5SDimitry Andric                                (TyQ (MulOp (TyD DPR:$Vn),
29810b57cec5SDimitry Andric                                            (TyD DPR:$Vm)))))]>;
29820b57cec5SDimitry Andricclass N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
29830b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
29840b57cec5SDimitry Andric                  ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29850b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29860b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
29870b57cec5SDimitry Andric        NVMulSLFrm, itin,
29880b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29890b57cec5SDimitry Andric        [(set QPR:$Vd,
29900b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
29910b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
29920b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),
29930b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
29940b57cec5SDimitry Andricclass N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
29950b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
29960b57cec5SDimitry Andric                    ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29970b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29980b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
29990b57cec5SDimitry Andric        NVMulSLFrm, itin,
30000b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
30010b57cec5SDimitry Andric        [(set QPR:$Vd,
30020b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
30030b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
30040b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_8:$Vm),
30050b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
30060b57cec5SDimitry Andric
30070b57cec5SDimitry Andric// Long Intrinsic-Op vector operations with explicit extend (VABAL).
30080b57cec5SDimitry Andricclass N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30090b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
30100b57cec5SDimitry Andric                   ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
30110b57cec5SDimitry Andric                   SDNode OpNode>
30120b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30130b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30140b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
30150b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
30160b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
30170b57cec5SDimitry Andric                                                        (TyD DPR:$Vm)))))))]>;
30180b57cec5SDimitry Andric
30190b57cec5SDimitry Andric// Neon Long 3-argument intrinsic.  The destination register is
30200b57cec5SDimitry Andric// a quad-register and is also used as the first source operand register.
30210b57cec5SDimitry Andricclass N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30220b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
30230b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
30240b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30250b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30260b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
30270b57cec5SDimitry Andric        [(set QPR:$Vd,
30280b57cec5SDimitry Andric          (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
30290b57cec5SDimitry Andricclass N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
30300b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
30310b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30320b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30330b57cec5SDimitry Andric        (outs QPR:$Vd),
30340b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30350b57cec5SDimitry Andric        NVMulSLFrm, itin,
30360b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
30370b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30380b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
30390b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
30400b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
30410b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30420b57cec5SDimitry Andricclass N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30430b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
30440b57cec5SDimitry Andric                   ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30450b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30460b57cec5SDimitry Andric        (outs QPR:$Vd),
30470b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30480b57cec5SDimitry Andric        NVMulSLFrm, itin,
30490b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
30500b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30510b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
30520b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
30530b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
30540b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30550b57cec5SDimitry Andric
30560b57cec5SDimitry Andric// Narrowing 3-register intrinsics.
30570b57cec5SDimitry Andricclass N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30580b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
30590b57cec5SDimitry Andric              SDPatternOperator IntOp, bit Commutable>
30600b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30610b57cec5SDimitry Andric        (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
30620b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30630b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
30640b57cec5SDimitry Andric  let isCommutable = Commutable;
30650b57cec5SDimitry Andric}
30660b57cec5SDimitry Andric
30670b57cec5SDimitry Andric// Long 3-register operations.
30680b57cec5SDimitry Andricclass N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30690b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
30700b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
30710b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30720b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30730b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30740b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
30750b57cec5SDimitry Andric  let isCommutable = Commutable;
30760b57cec5SDimitry Andric}
30770b57cec5SDimitry Andric
30780b57cec5SDimitry Andricclass N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
30790b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
30800b57cec5SDimitry Andric             ValueType TyQ, ValueType TyD, SDNode OpNode>
30810b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30820b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30830b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30840b57cec5SDimitry Andric        [(set QPR:$Vd,
30850b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30860b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
30870b57cec5SDimitry Andricclass N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30880b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
30890b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDNode OpNode>
30900b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30910b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30920b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30930b57cec5SDimitry Andric        [(set QPR:$Vd,
30940b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30950b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
30960b57cec5SDimitry Andric
30970b57cec5SDimitry Andric// Long 3-register operations with explicitly extended operands.
30980b57cec5SDimitry Andricclass N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30990b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
3100fe6060f1SDimitry Andric              ValueType TyQ, ValueType TyD, SDNode OpNode, SDPatternOperator ExtOp,
31010b57cec5SDimitry Andric              bit Commutable>
31020b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31030b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
31040b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31050b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
31060b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
31070b57cec5SDimitry Andric  let isCommutable = Commutable;
31080b57cec5SDimitry Andric}
31090b57cec5SDimitry Andric
31100b57cec5SDimitry Andric// Long 3-register intrinsics with explicit extend (VABDL).
31110b57cec5SDimitry Andricclass N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31120b57cec5SDimitry Andric                 InstrItinClass itin, string OpcodeStr, string Dt,
31130b57cec5SDimitry Andric                 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
31140b57cec5SDimitry Andric                 bit Commutable>
31150b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31160b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
31170b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31180b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
31190b57cec5SDimitry Andric                                                (TyD DPR:$Vm))))))]> {
31200b57cec5SDimitry Andric  let isCommutable = Commutable;
31210b57cec5SDimitry Andric}
31220b57cec5SDimitry Andric
31230b57cec5SDimitry Andric// Long 3-register intrinsics.
31240b57cec5SDimitry Andricclass N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31250b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
31260b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, bit Commutable>
31270b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31280b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
31290b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31300b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
31310b57cec5SDimitry Andric  let isCommutable = Commutable;
31320b57cec5SDimitry Andric}
31330b57cec5SDimitry Andric
31340b57cec5SDimitry Andric// Same as above, but not predicated.
31350b57cec5SDimitry Andricclass N3VLIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
31360b57cec5SDimitry Andric                bit op4, InstrItinClass itin, string OpcodeStr,
31370b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
31380b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
31390b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
31400b57cec5SDimitry Andric          (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
3141349cc55cSDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
3142349cc55cSDimitry Andric  let isCommutable = Commutable;
3143349cc55cSDimitry Andric}
3144349cc55cSDimitry Andric
31450b57cec5SDimitry Andric
31460b57cec5SDimitry Andricclass N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
31470b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31480b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31490b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
31500b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
31510b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
31520b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
31530b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
31540b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
31550b57cec5SDimitry Andric                                                imm:$lane)))))]>;
31560b57cec5SDimitry Andricclass N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
31570b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
31580b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31590b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
31600b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
31610b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
31620b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
31630b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
31640b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
31650b57cec5SDimitry Andric                                                imm:$lane)))))]>;
31660b57cec5SDimitry Andric
31670b57cec5SDimitry Andric// Wide 3-register operations.
31680b57cec5SDimitry Andricclass N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31690b57cec5SDimitry Andric           string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
3170fe6060f1SDimitry Andric           SDNode OpNode, SDPatternOperator ExtOp, bit Commutable>
31710b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31720b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
31730b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31740b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
31750b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
31760b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
31770b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
31780b57cec5SDimitry Andric  let isCommutable = Commutable;
31790b57cec5SDimitry Andric}
31800b57cec5SDimitry Andric
31810b57cec5SDimitry Andric// Pairwise long 2-register intrinsics, both double- and quad-register.
31820b57cec5SDimitry Andricclass N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31830b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31840b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31850b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31860b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
31870b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31880b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
31890b57cec5SDimitry Andricclass N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31900b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31910b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31920b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31930b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
31940b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31950b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
31960b57cec5SDimitry Andric
31970b57cec5SDimitry Andric// Pairwise long 2-register accumulate intrinsics,
31980b57cec5SDimitry Andric// both double- and quad-register.
31990b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
32000b57cec5SDimitry Andricclass N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
32010b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
32020b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
32030b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
32040b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
32050b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
32060b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
32070b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
32080b57cec5SDimitry Andricclass N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
32090b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
32100b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
32110b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
32120b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
32130b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
32140b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
32150b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
32160b57cec5SDimitry Andric
32170b57cec5SDimitry Andric// Shift by immediate,
32180b57cec5SDimitry Andric// both double- and quad-register.
32190b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32200b57cec5SDimitry Andricclass N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32210b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
32220b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
32230b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
32240b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
32250b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32260b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
32270b57cec5SDimitry Andricclass N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32280b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
32290b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
32300b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
32310b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
32320b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32330b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
32340b57cec5SDimitry Andric}
32350b57cec5SDimitry Andric
32360b57cec5SDimitry Andric// Long shift by immediate.
32370b57cec5SDimitry Andricclass N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
32380b57cec5SDimitry Andric             string OpcodeStr, string Dt,
32390b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
32400b57cec5SDimitry Andric             SDPatternOperator OpNode>
32410b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
32420b57cec5SDimitry Andric           (outs QPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), N2RegVShLFrm,
32430b57cec5SDimitry Andric           IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32440b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm), ImmTy:$SIMM)))]>;
32450b57cec5SDimitry Andric
32460b57cec5SDimitry Andric// Narrow shift by immediate.
32470b57cec5SDimitry Andricclass N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
32480b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
32490b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
32500b57cec5SDimitry Andric             SDPatternOperator OpNode>
32510b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
32520b57cec5SDimitry Andric           (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
32530b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32540b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
32550b57cec5SDimitry Andric                                          (i32 ImmTy:$SIMM))))]>;
32560b57cec5SDimitry Andric
32570b57cec5SDimitry Andric// Shift right by immediate and accumulate,
32580b57cec5SDimitry Andric// both double- and quad-register.
32590b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32600b57cec5SDimitry Andricclass N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32610b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
32620b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
32630b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
32640b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
32650b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32660b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (add DPR:$src1,
32670b57cec5SDimitry Andric                                (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
32680b57cec5SDimitry Andricclass N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32690b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
32700b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
32710b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32720b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
32730b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32740b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (add QPR:$src1,
32750b57cec5SDimitry Andric                                (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
32760b57cec5SDimitry Andric}
32770b57cec5SDimitry Andric
32780b57cec5SDimitry Andric// Shift by immediate and insert,
32790b57cec5SDimitry Andric// both double- and quad-register.
32800b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32810b57cec5SDimitry Andricclass N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32820b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32830b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32840b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
32850b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
32860b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32870b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
32880b57cec5SDimitry Andricclass N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32890b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32900b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32910b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32920b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
32930b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32940b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
32950b57cec5SDimitry Andric}
32960b57cec5SDimitry Andric
32970b57cec5SDimitry Andric// Convert, with fractional bits immediate,
32980b57cec5SDimitry Andric// both double- and quad-register.
32990b57cec5SDimitry Andricclass N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
33000b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
33010b57cec5SDimitry Andric              SDPatternOperator IntOp>
33020b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
33030b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
33040b57cec5SDimitry Andric           IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
33050b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
33060b57cec5SDimitry Andricclass N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
33070b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
33080b57cec5SDimitry Andric              SDPatternOperator IntOp>
33090b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
33100b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
33110b57cec5SDimitry Andric           IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
33120b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
33130b57cec5SDimitry Andric
33140b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
33150b57cec5SDimitry Andric// Multiclasses
33160b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
33170b57cec5SDimitry Andric
33180b57cec5SDimitry Andric// Abbreviations used in multiclass suffixes:
33190b57cec5SDimitry Andric//   Q = quarter int (8 bit) elements
33200b57cec5SDimitry Andric//   H = half int (16 bit) elements
33210b57cec5SDimitry Andric//   S = single int (32 bit) elements
33220b57cec5SDimitry Andric//   D = double int (64 bit) elements
33230b57cec5SDimitry Andric
33240b57cec5SDimitry Andric// Neon 2-register vector operations and intrinsics.
33250b57cec5SDimitry Andric
33260b57cec5SDimitry Andric// Neon 2-register comparisons.
33270b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
33280b57cec5SDimitry Andricmulticlass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
33290b57cec5SDimitry Andric                       bits<5> op11_7, bit op4, string opc, string Dt,
3330480093f4SDimitry Andric                       string asm, PatFrag fc> {
33310b57cec5SDimitry Andric  // 64-bit vector types.
33320b57cec5SDimitry Andric  def v8i8  : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
33330b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33340b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3335480093f4SDimitry Andric                  [(set DPR:$Vd, (v8i8 (ARMvcmpz (v8i8 DPR:$Vm), fc)))]>;
33360b57cec5SDimitry Andric  def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
33370b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33380b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3339480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4i16 DPR:$Vm), fc)))]>;
33400b57cec5SDimitry Andric  def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
33410b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33420b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3343480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2i32 DPR:$Vm), fc)))]>;
33440b57cec5SDimitry Andric  def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
33450b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33460b57cec5SDimitry Andric                  opc, "f32", asm, "",
3347480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2f32 DPR:$Vm), fc)))]> {
33480b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33490b57cec5SDimitry Andric  }
33500b57cec5SDimitry Andric  def v4f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
33510b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33520b57cec5SDimitry Andric                  opc, "f16", asm, "",
3353480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4f16 DPR:$Vm), fc)))]>,
33540b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
33550b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33560b57cec5SDimitry Andric  }
33570b57cec5SDimitry Andric
33580b57cec5SDimitry Andric  // 128-bit vector types.
33590b57cec5SDimitry Andric  def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
33600b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33610b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3362480093f4SDimitry Andric                  [(set QPR:$Vd, (v16i8 (ARMvcmpz (v16i8 QPR:$Vm), fc)))]>;
33630b57cec5SDimitry Andric  def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
33640b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33650b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3366480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8i16 QPR:$Vm), fc)))]>;
33670b57cec5SDimitry Andric  def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33680b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33690b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3370480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4i32 QPR:$Vm), fc)))]>;
33710b57cec5SDimitry Andric  def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33720b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33730b57cec5SDimitry Andric                  opc, "f32", asm, "",
3374480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4f32 QPR:$Vm), fc)))]> {
33750b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33760b57cec5SDimitry Andric  }
33770b57cec5SDimitry Andric  def v8f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
33780b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33790b57cec5SDimitry Andric                  opc, "f16", asm, "",
3380480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8f16 QPR:$Vm), fc)))]>,
33810b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
33820b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33830b57cec5SDimitry Andric  }
33840b57cec5SDimitry Andric}
33850b57cec5SDimitry Andric
33868bcb0991SDimitry Andric// Neon 3-register comparisons.
33878bcb0991SDimitry Andricclass N3VQ_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
33888bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3389480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
33908bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
33918bcb0991SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
33928bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3393480093f4SDimitry Andric        [(set QPR:$Vd, (ResTy (ARMvcmp (OpTy QPR:$Vn), (OpTy QPR:$Vm), fc)))]> {
33948bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
33958bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
33968bcb0991SDimitry Andric  let isCommutable = Commutable;
33978bcb0991SDimitry Andric}
33988bcb0991SDimitry Andric
33998bcb0991SDimitry Andricclass N3VD_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
34008bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3401480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
34028bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
34038bcb0991SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
34048bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3405480093f4SDimitry Andric        [(set DPR:$Vd, (ResTy (ARMvcmp (OpTy DPR:$Vn), (OpTy DPR:$Vm), fc)))]> {
34068bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
34078bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
34088bcb0991SDimitry Andric  let isCommutable = Commutable;
34098bcb0991SDimitry Andric}
34108bcb0991SDimitry Andric
34118bcb0991SDimitry Andricmulticlass N3V_QHS_cmp<bit op24, bit op23, bits<4> op11_8, bit op4,
34128bcb0991SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
34138bcb0991SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
34148bcb0991SDimitry Andric                       string OpcodeStr, string Dt,
3415480093f4SDimitry Andric                       PatFrag fc, bit Commutable = 0> {
34168bcb0991SDimitry Andric  // 64-bit vector types.
34178bcb0991SDimitry Andric  def v8i8  : N3VD_cmp<op24, op23, 0b00, op11_8, op4, itinD16,
34188bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
34198bcb0991SDimitry Andric                       v8i8, v8i8, fc, Commutable>;
34208bcb0991SDimitry Andric  def v4i16 : N3VD_cmp<op24, op23, 0b01, op11_8, op4, itinD16,
34218bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
34228bcb0991SDimitry Andric                       v4i16, v4i16, fc, Commutable>;
34238bcb0991SDimitry Andric  def v2i32 : N3VD_cmp<op24, op23, 0b10, op11_8, op4, itinD32,
34248bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
34258bcb0991SDimitry Andric                       v2i32, v2i32, fc, Commutable>;
34268bcb0991SDimitry Andric
34278bcb0991SDimitry Andric  // 128-bit vector types.
34288bcb0991SDimitry Andric  def v16i8 : N3VQ_cmp<op24, op23, 0b00, op11_8, op4, itinQ16,
34298bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
34308bcb0991SDimitry Andric                       v16i8, v16i8, fc, Commutable>;
34318bcb0991SDimitry Andric  def v8i16 : N3VQ_cmp<op24, op23, 0b01, op11_8, op4, itinQ16,
34328bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
34338bcb0991SDimitry Andric                       v8i16, v8i16, fc, Commutable>;
34348bcb0991SDimitry Andric  def v4i32 : N3VQ_cmp<op24, op23, 0b10, op11_8, op4, itinQ32,
34358bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
34368bcb0991SDimitry Andric                       v4i32, v4i32, fc, Commutable>;
34378bcb0991SDimitry Andric}
34388bcb0991SDimitry Andric
34390b57cec5SDimitry Andric
34400b57cec5SDimitry Andric// Neon 2-register vector intrinsics,
34410b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
34420b57cec5SDimitry Andricmulticlass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34430b57cec5SDimitry Andric                      bits<5> op11_7, bit op4,
34440b57cec5SDimitry Andric                      InstrItinClass itinD, InstrItinClass itinQ,
34450b57cec5SDimitry Andric                      string OpcodeStr, string Dt, SDPatternOperator IntOp> {
34460b57cec5SDimitry Andric  // 64-bit vector types.
34470b57cec5SDimitry Andric  def v8i8  : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
34480b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
34490b57cec5SDimitry Andric  def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
34500b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
34510b57cec5SDimitry Andric  def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
34520b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
34530b57cec5SDimitry Andric
34540b57cec5SDimitry Andric  // 128-bit vector types.
34550b57cec5SDimitry Andric  def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
34560b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
34570b57cec5SDimitry Andric  def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
34580b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
34590b57cec5SDimitry Andric  def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
34600b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
34610b57cec5SDimitry Andric}
34620b57cec5SDimitry Andric
34630b57cec5SDimitry Andric
34640b57cec5SDimitry Andric// Neon Narrowing 2-register vector operations,
34650b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34660b57cec5SDimitry Andricmulticlass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34670b57cec5SDimitry Andric                    bits<5> op11_7, bit op6, bit op4,
34680b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
34690b57cec5SDimitry Andric                    SDNode OpNode> {
34700b57cec5SDimitry Andric  def v8i8  : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34710b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "16"),
34720b57cec5SDimitry Andric                   v8i8, v8i16, OpNode>;
34730b57cec5SDimitry Andric  def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34740b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "32"),
34750b57cec5SDimitry Andric                   v4i16, v4i32, OpNode>;
34760b57cec5SDimitry Andric  def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34770b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "64"),
34780b57cec5SDimitry Andric                   v2i32, v2i64, OpNode>;
34790b57cec5SDimitry Andric}
34800b57cec5SDimitry Andric
34810b57cec5SDimitry Andric// Neon Narrowing 2-register vector intrinsics,
34820b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34830b57cec5SDimitry Andricmulticlass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34840b57cec5SDimitry Andric                       bits<5> op11_7, bit op6, bit op4,
34850b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
34860b57cec5SDimitry Andric                       SDPatternOperator IntOp> {
34870b57cec5SDimitry Andric  def v8i8  : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34880b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "16"),
34890b57cec5SDimitry Andric                      v8i8, v8i16, IntOp>;
34900b57cec5SDimitry Andric  def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34910b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "32"),
34920b57cec5SDimitry Andric                      v4i16, v4i32, IntOp>;
34930b57cec5SDimitry Andric  def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34940b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "64"),
34950b57cec5SDimitry Andric                      v2i32, v2i64, IntOp>;
34960b57cec5SDimitry Andric}
34970b57cec5SDimitry Andric
34980b57cec5SDimitry Andric
34990b57cec5SDimitry Andric// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
35000b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
35010b57cec5SDimitry Andricmulticlass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
35020b57cec5SDimitry Andric                    string OpcodeStr, string Dt, SDNode OpNode> {
35030b57cec5SDimitry Andric  def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
35040b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
35050b57cec5SDimitry Andric  def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
35060b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
35070b57cec5SDimitry Andric  def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
35080b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
35090b57cec5SDimitry Andric}
35100b57cec5SDimitry Andric
35110b57cec5SDimitry Andric
35120b57cec5SDimitry Andric// Neon 3-register vector operations.
35130b57cec5SDimitry Andric
35140b57cec5SDimitry Andric// First with only element sizes of 8, 16 and 32 bits:
35150b57cec5SDimitry Andricmulticlass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
35160b57cec5SDimitry Andric                   InstrItinClass itinD16, InstrItinClass itinD32,
35170b57cec5SDimitry Andric                   InstrItinClass itinQ16, InstrItinClass itinQ32,
35180b57cec5SDimitry Andric                   string OpcodeStr, string Dt,
35190b57cec5SDimitry Andric                   SDNode OpNode, bit Commutable = 0> {
35200b57cec5SDimitry Andric  // 64-bit vector types.
35210b57cec5SDimitry Andric  def v8i8  : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
35220b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
35230b57cec5SDimitry Andric                   v8i8, v8i8, OpNode, Commutable>;
35240b57cec5SDimitry Andric  def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
35250b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
35260b57cec5SDimitry Andric                   v4i16, v4i16, OpNode, Commutable>;
35270b57cec5SDimitry Andric  def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
35280b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
35290b57cec5SDimitry Andric                   v2i32, v2i32, OpNode, Commutable>;
35300b57cec5SDimitry Andric
35310b57cec5SDimitry Andric  // 128-bit vector types.
35320b57cec5SDimitry Andric  def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
35330b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
35340b57cec5SDimitry Andric                   v16i8, v16i8, OpNode, Commutable>;
35350b57cec5SDimitry Andric  def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
35360b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
35370b57cec5SDimitry Andric                   v8i16, v8i16, OpNode, Commutable>;
35380b57cec5SDimitry Andric  def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
35390b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
35400b57cec5SDimitry Andric                   v4i32, v4i32, OpNode, Commutable>;
35410b57cec5SDimitry Andric}
35420b57cec5SDimitry Andric
35430b57cec5SDimitry Andricmulticlass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
35440b57cec5SDimitry Andric  def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, "i16", v4i16, ShOp>;
35450b57cec5SDimitry Andric  def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, "i32", v2i32, ShOp>;
35460b57cec5SDimitry Andric  def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, "i16", v8i16, v4i16, ShOp>;
35470b57cec5SDimitry Andric  def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, "i32",
35480b57cec5SDimitry Andric                     v4i32, v2i32, ShOp>;
35490b57cec5SDimitry Andric}
35500b57cec5SDimitry Andric
35510b57cec5SDimitry Andric// ....then also with element size 64 bits:
35520b57cec5SDimitry Andricmulticlass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
35530b57cec5SDimitry Andric                    InstrItinClass itinD, InstrItinClass itinQ,
35540b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
35550b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0>
35560b57cec5SDimitry Andric  : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
35570b57cec5SDimitry Andric            OpcodeStr, Dt, OpNode, Commutable> {
35580b57cec5SDimitry Andric  def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
35590b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
35600b57cec5SDimitry Andric                   v1i64, v1i64, OpNode, Commutable>;
35610b57cec5SDimitry Andric  def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
35620b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
35630b57cec5SDimitry Andric                   v2i64, v2i64, OpNode, Commutable>;
35640b57cec5SDimitry Andric}
35650b57cec5SDimitry Andric
35660b57cec5SDimitry Andric
35670b57cec5SDimitry Andric// Neon 3-register vector intrinsics.
35680b57cec5SDimitry Andric
35690b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
35700b57cec5SDimitry Andricmulticlass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35710b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35720b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35730b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35740b57cec5SDimitry Andric                     SDPatternOperator IntOp, bit Commutable = 0> {
35750b57cec5SDimitry Andric  // 64-bit vector types.
35760b57cec5SDimitry Andric  def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
35770b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35780b57cec5SDimitry Andric                      v4i16, v4i16, IntOp, Commutable>;
35790b57cec5SDimitry Andric  def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
35800b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35810b57cec5SDimitry Andric                      v2i32, v2i32, IntOp, Commutable>;
35820b57cec5SDimitry Andric
35830b57cec5SDimitry Andric  // 128-bit vector types.
35840b57cec5SDimitry Andric  def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
35850b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35860b57cec5SDimitry Andric                      v8i16, v8i16, IntOp, Commutable>;
35870b57cec5SDimitry Andric  def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
35880b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35890b57cec5SDimitry Andric                      v4i32, v4i32, IntOp, Commutable>;
35900b57cec5SDimitry Andric}
35910b57cec5SDimitry Andricmulticlass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35920b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35930b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35940b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35950b57cec5SDimitry Andric                     SDPatternOperator IntOp> {
35960b57cec5SDimitry Andric  // 64-bit vector types.
35970b57cec5SDimitry Andric  def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
35980b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35990b57cec5SDimitry Andric                      v4i16, v4i16, IntOp>;
36000b57cec5SDimitry Andric  def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
36010b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36020b57cec5SDimitry Andric                      v2i32, v2i32, IntOp>;
36030b57cec5SDimitry Andric
36040b57cec5SDimitry Andric  // 128-bit vector types.
36050b57cec5SDimitry Andric  def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
36060b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36070b57cec5SDimitry Andric                      v8i16, v8i16, IntOp>;
36080b57cec5SDimitry Andric  def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
36090b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36100b57cec5SDimitry Andric                      v4i32, v4i32, IntOp>;
36110b57cec5SDimitry Andric}
36120b57cec5SDimitry Andric
36130b57cec5SDimitry Andricmulticlass N3VIntSL_HS<bits<4> op11_8,
36140b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36150b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36160b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
36170b57cec5SDimitry Andric  def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
36180b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
36190b57cec5SDimitry Andric  def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
36200b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
36210b57cec5SDimitry Andric  def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
36220b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
36230b57cec5SDimitry Andric  def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
36240b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
36250b57cec5SDimitry Andric}
36260b57cec5SDimitry Andric
36270b57cec5SDimitry Andric// ....then also with element size of 8 bits:
36280b57cec5SDimitry Andricmulticlass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36290b57cec5SDimitry Andric                      InstrItinClass itinD16, InstrItinClass itinD32,
36300b57cec5SDimitry Andric                      InstrItinClass itinQ16, InstrItinClass itinQ32,
36310b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
36320b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0>
36330b57cec5SDimitry Andric  : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36340b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp, Commutable> {
36350b57cec5SDimitry Andric  def v8i8  : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
36360b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36370b57cec5SDimitry Andric                      v8i8, v8i8, IntOp, Commutable>;
36380b57cec5SDimitry Andric  def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
36390b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36400b57cec5SDimitry Andric                      v16i8, v16i8, IntOp, Commutable>;
36410b57cec5SDimitry Andric}
36420b57cec5SDimitry Andricmulticlass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36430b57cec5SDimitry Andric                      InstrItinClass itinD16, InstrItinClass itinD32,
36440b57cec5SDimitry Andric                      InstrItinClass itinQ16, InstrItinClass itinQ32,
36450b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
36460b57cec5SDimitry Andric                      SDPatternOperator IntOp>
36470b57cec5SDimitry Andric  : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36480b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp> {
36490b57cec5SDimitry Andric  def v8i8  : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
36500b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36510b57cec5SDimitry Andric                      v8i8, v8i8, IntOp>;
36520b57cec5SDimitry Andric  def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
36530b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36540b57cec5SDimitry Andric                      v16i8, v16i8, IntOp>;
36550b57cec5SDimitry Andric}
36560b57cec5SDimitry Andric
36570b57cec5SDimitry Andric
36580b57cec5SDimitry Andric// ....then also with element size of 64 bits:
36590b57cec5SDimitry Andricmulticlass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36600b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36610b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36620b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36630b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
36640b57cec5SDimitry Andric  : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36650b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp, Commutable> {
36660b57cec5SDimitry Andric  def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
36670b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36680b57cec5SDimitry Andric                      v1i64, v1i64, IntOp, Commutable>;
36690b57cec5SDimitry Andric  def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36700b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36710b57cec5SDimitry Andric                      v2i64, v2i64, IntOp, Commutable>;
36720b57cec5SDimitry Andric}
36730b57cec5SDimitry Andricmulticlass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36740b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36750b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36760b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36770b57cec5SDimitry Andric                       SDPatternOperator IntOp>
36780b57cec5SDimitry Andric  : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36790b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp> {
36800b57cec5SDimitry Andric  def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
36810b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36820b57cec5SDimitry Andric                      v1i64, v1i64, IntOp>;
36830b57cec5SDimitry Andric  def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36840b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36850b57cec5SDimitry Andric                      v2i64, v2i64, IntOp>;
36860b57cec5SDimitry Andric}
36870b57cec5SDimitry Andric
36880b57cec5SDimitry Andric// Neon Narrowing 3-register vector intrinsics,
36890b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
36900b57cec5SDimitry Andricmulticlass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
36910b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36920b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0> {
36930b57cec5SDimitry Andric  def v8i8  : N3VNInt<op24, op23, 0b00, op11_8, op4,
36940b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36950b57cec5SDimitry Andric                      v8i8, v8i16, IntOp, Commutable>;
36960b57cec5SDimitry Andric  def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
36970b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36980b57cec5SDimitry Andric                      v4i16, v4i32, IntOp, Commutable>;
36990b57cec5SDimitry Andric  def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
37000b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
37010b57cec5SDimitry Andric                      v2i32, v2i64, IntOp, Commutable>;
37020b57cec5SDimitry Andric}
37030b57cec5SDimitry Andric
37040b57cec5SDimitry Andric
37050b57cec5SDimitry Andric// Neon Long 3-register vector operations.
37060b57cec5SDimitry Andric
37070b57cec5SDimitry Andricmulticlass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37080b57cec5SDimitry Andric                    InstrItinClass itin16, InstrItinClass itin32,
37090b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
37100b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0> {
37110b57cec5SDimitry Andric  def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
37120b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
37130b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, Commutable>;
37140b57cec5SDimitry Andric  def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
37150b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
37160b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, Commutable>;
37170b57cec5SDimitry Andric  def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
37180b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
37190b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, Commutable>;
37200b57cec5SDimitry Andric}
37210b57cec5SDimitry Andric
37220b57cec5SDimitry Andricmulticlass N3VLSL_HS<bit op24, bits<4> op11_8,
37230b57cec5SDimitry Andric                     InstrItinClass itin, string OpcodeStr, string Dt,
37240b57cec5SDimitry Andric                     SDNode OpNode> {
37250b57cec5SDimitry Andric  def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
37260b57cec5SDimitry Andric                       !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
37270b57cec5SDimitry Andric  def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
37280b57cec5SDimitry Andric                     !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
37290b57cec5SDimitry Andric}
37300b57cec5SDimitry Andric
37310b57cec5SDimitry Andricmulticlass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37320b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
37330b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
3734fe6060f1SDimitry Andric                       SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
37350b57cec5SDimitry Andric  def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
37360b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
37370b57cec5SDimitry Andric                      v8i16, v8i8, OpNode, ExtOp, Commutable>;
37380b57cec5SDimitry Andric  def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
37390b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
37400b57cec5SDimitry Andric                      v4i32, v4i16, OpNode, ExtOp, Commutable>;
37410b57cec5SDimitry Andric  def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
37420b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
37430b57cec5SDimitry Andric                      v2i64, v2i32, OpNode, ExtOp, Commutable>;
37440b57cec5SDimitry Andric}
37450b57cec5SDimitry Andric
37460b57cec5SDimitry Andric// Neon Long 3-register vector intrinsics.
37470b57cec5SDimitry Andric
37480b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
37490b57cec5SDimitry Andricmulticlass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
37500b57cec5SDimitry Andric                      InstrItinClass itin16, InstrItinClass itin32,
37510b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
37520b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0> {
37530b57cec5SDimitry Andric  def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
37540b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
37550b57cec5SDimitry Andric                      v4i32, v4i16, IntOp, Commutable>;
37560b57cec5SDimitry Andric  def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
37570b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
37580b57cec5SDimitry Andric                      v2i64, v2i32, IntOp, Commutable>;
37590b57cec5SDimitry Andric}
37600b57cec5SDimitry Andric
37610b57cec5SDimitry Andricmulticlass N3VLIntSL_HS<bit op24, bits<4> op11_8,
37620b57cec5SDimitry Andric                        InstrItinClass itin, string OpcodeStr, string Dt,
37630b57cec5SDimitry Andric                        SDPatternOperator IntOp> {
37640b57cec5SDimitry Andric  def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
37650b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
37660b57cec5SDimitry Andric  def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
37670b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
37680b57cec5SDimitry Andric}
37690b57cec5SDimitry Andric
37700b57cec5SDimitry Andric// ....then also with element size of 8 bits:
37710b57cec5SDimitry Andricmulticlass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37720b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
37730b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
37740b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
37750b57cec5SDimitry Andric  : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
37760b57cec5SDimitry Andric               IntOp, Commutable> {
37770b57cec5SDimitry Andric  def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
37780b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
37790b57cec5SDimitry Andric                      v8i16, v8i8, IntOp, Commutable>;
37800b57cec5SDimitry Andric}
37810b57cec5SDimitry Andric
37820b57cec5SDimitry Andric// ....with explicit extend (VABDL).
37830b57cec5SDimitry Andricmulticlass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37840b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
37850b57cec5SDimitry Andric                       SDPatternOperator IntOp, SDNode ExtOp, bit Commutable = 0> {
37860b57cec5SDimitry Andric  def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
37870b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"),
37880b57cec5SDimitry Andric                         v8i16, v8i8, IntOp, ExtOp, Commutable>;
37890b57cec5SDimitry Andric  def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
37900b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"),
37910b57cec5SDimitry Andric                         v4i32, v4i16, IntOp, ExtOp, Commutable>;
37920b57cec5SDimitry Andric  def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
37930b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"),
37940b57cec5SDimitry Andric                         v2i64, v2i32, IntOp, ExtOp, Commutable>;
37950b57cec5SDimitry Andric}
37960b57cec5SDimitry Andric
37970b57cec5SDimitry Andric
37980b57cec5SDimitry Andric// Neon Wide 3-register vector intrinsics,
37990b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
38000b57cec5SDimitry Andricmulticlass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38010b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
3802fe6060f1SDimitry Andric                    SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
38030b57cec5SDimitry Andric  def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
38040b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
38050b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, ExtOp, Commutable>;
38060b57cec5SDimitry Andric  def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
38070b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
38080b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, ExtOp, Commutable>;
38090b57cec5SDimitry Andric  def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
38100b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
38110b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, ExtOp, Commutable>;
38120b57cec5SDimitry Andric}
38130b57cec5SDimitry Andric
38140b57cec5SDimitry Andric
38150b57cec5SDimitry Andric// Neon Multiply-Op vector operations,
38160b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38170b57cec5SDimitry Andricmulticlass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38180b57cec5SDimitry Andric                        InstrItinClass itinD16, InstrItinClass itinD32,
38190b57cec5SDimitry Andric                        InstrItinClass itinQ16, InstrItinClass itinQ32,
38200b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDNode OpNode> {
38210b57cec5SDimitry Andric  // 64-bit vector types.
38220b57cec5SDimitry Andric  def v8i8  : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
38230b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
38240b57cec5SDimitry Andric  def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
38250b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
38260b57cec5SDimitry Andric  def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
38270b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
38280b57cec5SDimitry Andric
38290b57cec5SDimitry Andric  // 128-bit vector types.
38300b57cec5SDimitry Andric  def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
38310b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
38320b57cec5SDimitry Andric  def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
38330b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
38340b57cec5SDimitry Andric  def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
38350b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
38360b57cec5SDimitry Andric}
38370b57cec5SDimitry Andric
38380b57cec5SDimitry Andricmulticlass N3VMulOpSL_HS<bits<4> op11_8,
38390b57cec5SDimitry Andric                         InstrItinClass itinD16, InstrItinClass itinD32,
38400b57cec5SDimitry Andric                         InstrItinClass itinQ16, InstrItinClass itinQ32,
38410b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator ShOp> {
38420b57cec5SDimitry Andric  def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
38430b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
38440b57cec5SDimitry Andric  def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
38450b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
38460b57cec5SDimitry Andric  def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
38470b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
38480b57cec5SDimitry Andric                            mul, ShOp>;
38490b57cec5SDimitry Andric  def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
38500b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
38510b57cec5SDimitry Andric                          mul, ShOp>;
38520b57cec5SDimitry Andric}
38530b57cec5SDimitry Andric
38540b57cec5SDimitry Andric// Neon Intrinsic-Op vector operations,
38550b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38560b57cec5SDimitry Andricmulticlass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38570b57cec5SDimitry Andric                        InstrItinClass itinD, InstrItinClass itinQ,
38580b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp,
38590b57cec5SDimitry Andric                        SDNode OpNode> {
38600b57cec5SDimitry Andric  // 64-bit vector types.
38610b57cec5SDimitry Andric  def v8i8  : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
38620b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
38630b57cec5SDimitry Andric  def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
38640b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
38650b57cec5SDimitry Andric  def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
38660b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
38670b57cec5SDimitry Andric
38680b57cec5SDimitry Andric  // 128-bit vector types.
38690b57cec5SDimitry Andric  def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
38700b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
38710b57cec5SDimitry Andric  def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
38720b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
38730b57cec5SDimitry Andric  def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
38740b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
38750b57cec5SDimitry Andric}
38760b57cec5SDimitry Andric
38770b57cec5SDimitry Andric// Neon 3-argument intrinsics,
38780b57cec5SDimitry Andric//   element sizes of 16 and 32 bits:
38790b57cec5SDimitry Andricmulticlass N3VInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
38800b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38810b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
38820b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
38830b57cec5SDimitry Andric  // 64-bit vector types.
38840b57cec5SDimitry Andric  def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD16,
38850b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
38860b57cec5SDimitry Andric  def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD32,
38870b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
38880b57cec5SDimitry Andric
38890b57cec5SDimitry Andric  // 128-bit vector types.
38900b57cec5SDimitry Andric  def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ16,
38910b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
38920b57cec5SDimitry Andric  def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ32,
38930b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
38940b57cec5SDimitry Andric}
38950b57cec5SDimitry Andric
38960b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38970b57cec5SDimitry Andricmulticlass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38980b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38990b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
39000b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp>
39010b57cec5SDimitry Andric           :N3VInt3_HS <op24, op23, op11_8, op4, itinD16, itinD32,
39020b57cec5SDimitry Andric                        itinQ16, itinQ32, OpcodeStr, Dt, IntOp>{
39030b57cec5SDimitry Andric  // 64-bit vector types.
39040b57cec5SDimitry Andric  def v8i8  : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD16,
39050b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
39060b57cec5SDimitry Andric  // 128-bit vector types.
39070b57cec5SDimitry Andric  def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ16,
39080b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
39090b57cec5SDimitry Andric}
39100b57cec5SDimitry Andric
39110b57cec5SDimitry Andric// Neon Long Multiply-Op vector operations,
39120b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39130b57cec5SDimitry Andricmulticlass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39140b57cec5SDimitry Andric                         InstrItinClass itin16, InstrItinClass itin32,
39150b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode MulOp,
39160b57cec5SDimitry Andric                         SDNode OpNode> {
39170b57cec5SDimitry Andric  def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
39180b57cec5SDimitry Andric                        !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
39190b57cec5SDimitry Andric  def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
39200b57cec5SDimitry Andric                        !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
39210b57cec5SDimitry Andric  def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
39220b57cec5SDimitry Andric                        !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
39230b57cec5SDimitry Andric}
39240b57cec5SDimitry Andric
39250b57cec5SDimitry Andricmulticlass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
39260b57cec5SDimitry Andric                          string Dt, SDNode MulOp, SDNode OpNode> {
39270b57cec5SDimitry Andric  def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
39280b57cec5SDimitry Andric                            !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
39290b57cec5SDimitry Andric  def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
39300b57cec5SDimitry Andric                          !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
39310b57cec5SDimitry Andric}
39320b57cec5SDimitry Andric
39330b57cec5SDimitry Andric
39340b57cec5SDimitry Andric// Neon Long 3-argument intrinsics.
39350b57cec5SDimitry Andric
39360b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
39370b57cec5SDimitry Andricmulticlass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
39380b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
39390b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39400b57cec5SDimitry Andric  def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
39410b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
39420b57cec5SDimitry Andric  def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
39430b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
39440b57cec5SDimitry Andric}
39450b57cec5SDimitry Andric
39460b57cec5SDimitry Andricmulticlass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
39470b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39480b57cec5SDimitry Andric  def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
39490b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
39500b57cec5SDimitry Andric  def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
39510b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
39520b57cec5SDimitry Andric}
39530b57cec5SDimitry Andric
39540b57cec5SDimitry Andric// ....then also with element size of 8 bits:
39550b57cec5SDimitry Andricmulticlass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39560b57cec5SDimitry Andric                        InstrItinClass itin16, InstrItinClass itin32,
39570b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp>
39580b57cec5SDimitry Andric  : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
39590b57cec5SDimitry Andric  def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
39600b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
39610b57cec5SDimitry Andric}
39620b57cec5SDimitry Andric
39630b57cec5SDimitry Andric// ....with explicit extend (VABAL).
39640b57cec5SDimitry Andricmulticlass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39650b57cec5SDimitry Andric                            InstrItinClass itin, string OpcodeStr, string Dt,
39660b57cec5SDimitry Andric                            SDPatternOperator IntOp, SDNode ExtOp, SDNode OpNode> {
39670b57cec5SDimitry Andric  def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
39680b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
39690b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39700b57cec5SDimitry Andric  def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
39710b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
39720b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39730b57cec5SDimitry Andric  def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
39740b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
39750b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39760b57cec5SDimitry Andric}
39770b57cec5SDimitry Andric
39780b57cec5SDimitry Andric
39790b57cec5SDimitry Andric// Neon Pairwise long 2-register intrinsics,
39800b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39810b57cec5SDimitry Andricmulticlass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
39820b57cec5SDimitry Andric                        bits<5> op11_7, bit op4,
39830b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39840b57cec5SDimitry Andric  // 64-bit vector types.
39850b57cec5SDimitry Andric  def v8i8  : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39860b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
39870b57cec5SDimitry Andric  def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39880b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
39890b57cec5SDimitry Andric  def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39900b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
39910b57cec5SDimitry Andric
39920b57cec5SDimitry Andric  // 128-bit vector types.
39930b57cec5SDimitry Andric  def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39940b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
39950b57cec5SDimitry Andric  def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39960b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
39970b57cec5SDimitry Andric  def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39980b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
39990b57cec5SDimitry Andric}
40000b57cec5SDimitry Andric
40010b57cec5SDimitry Andric
40020b57cec5SDimitry Andric// Neon Pairwise long 2-register accumulate intrinsics,
40030b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
40040b57cec5SDimitry Andricmulticlass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
40050b57cec5SDimitry Andric                         bits<5> op11_7, bit op4,
40060b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
40070b57cec5SDimitry Andric  // 64-bit vector types.
40080b57cec5SDimitry Andric  def v8i8  : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
40090b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
40100b57cec5SDimitry Andric  def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
40110b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
40120b57cec5SDimitry Andric  def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
40130b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
40140b57cec5SDimitry Andric
40150b57cec5SDimitry Andric  // 128-bit vector types.
40160b57cec5SDimitry Andric  def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
40170b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
40180b57cec5SDimitry Andric  def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
40190b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
40200b57cec5SDimitry Andric  def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
40210b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
40220b57cec5SDimitry Andric}
40230b57cec5SDimitry Andric
40240b57cec5SDimitry Andric
40250b57cec5SDimitry Andric// Neon 2-register vector shift by immediate,
40260b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
40270b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
40280b57cec5SDimitry Andricmulticlass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40290b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
40300b57cec5SDimitry Andric                       SDNode OpNode> {
40310b57cec5SDimitry Andric  // 64-bit vector types.
40320b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40330b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
40340b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40350b57cec5SDimitry Andric  }
40360b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40370b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
40380b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40390b57cec5SDimitry Andric  }
40400b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40410b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
40420b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40430b57cec5SDimitry Andric  }
40440b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
40450b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
40460b57cec5SDimitry Andric                             // imm6 = xxxxxx
40470b57cec5SDimitry Andric
40480b57cec5SDimitry Andric  // 128-bit vector types.
40490b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40500b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
40510b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40520b57cec5SDimitry Andric  }
40530b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40540b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
40550b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40560b57cec5SDimitry Andric  }
40570b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40580b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
40590b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40600b57cec5SDimitry Andric  }
40610b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
40620b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
40630b57cec5SDimitry Andric                             // imm6 = xxxxxx
40640b57cec5SDimitry Andric}
40650b57cec5SDimitry Andricmulticlass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40660b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
4067349cc55cSDimitry Andric                       SDNode OpNode> {
40680b57cec5SDimitry Andric  // 64-bit vector types.
40690b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40700b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
40710b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40720b57cec5SDimitry Andric  }
40730b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40740b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
40750b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40760b57cec5SDimitry Andric  }
40770b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40780b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
40790b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40800b57cec5SDimitry Andric  }
40810b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40820b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
40830b57cec5SDimitry Andric                             // imm6 = xxxxxx
40840b57cec5SDimitry Andric
40850b57cec5SDimitry Andric  // 128-bit vector types.
40860b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40870b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
40880b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40890b57cec5SDimitry Andric  }
40900b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40910b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
40920b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40930b57cec5SDimitry Andric  }
40940b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40950b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
40960b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40970b57cec5SDimitry Andric  }
40980b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40990b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
41000b57cec5SDimitry Andric                             // imm6 = xxxxxx
41010b57cec5SDimitry Andric}
41020b57cec5SDimitry Andric
41030b57cec5SDimitry Andric// Neon Shift-Accumulate vector operations,
41040b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
41050b57cec5SDimitry Andricmulticlass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41060b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode ShOp> {
41070b57cec5SDimitry Andric  // 64-bit vector types.
41080b57cec5SDimitry Andric  def v8i8  : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
41090b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
41100b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41110b57cec5SDimitry Andric  }
41120b57cec5SDimitry Andric  def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
41130b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
41140b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41150b57cec5SDimitry Andric  }
41160b57cec5SDimitry Andric  def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
41170b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
41180b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41190b57cec5SDimitry Andric  }
41200b57cec5SDimitry Andric  def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
41210b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
41220b57cec5SDimitry Andric                             // imm6 = xxxxxx
41230b57cec5SDimitry Andric
41240b57cec5SDimitry Andric  // 128-bit vector types.
41250b57cec5SDimitry Andric  def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
41260b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
41270b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41280b57cec5SDimitry Andric  }
41290b57cec5SDimitry Andric  def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
41300b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
41310b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41320b57cec5SDimitry Andric  }
41330b57cec5SDimitry Andric  def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
41340b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
41350b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41360b57cec5SDimitry Andric  }
41370b57cec5SDimitry Andric  def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
41380b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
41390b57cec5SDimitry Andric                             // imm6 = xxxxxx
41400b57cec5SDimitry Andric}
41410b57cec5SDimitry Andric
41420b57cec5SDimitry Andric// Neon Shift-Insert vector operations,
41430b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
41440b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
41450b57cec5SDimitry Andricmulticlass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41460b57cec5SDimitry Andric                          string OpcodeStr> {
41470b57cec5SDimitry Andric  // 64-bit vector types.
41480b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41490b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsliImm> {
41500b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41510b57cec5SDimitry Andric  }
41520b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41530b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsliImm> {
41540b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41550b57cec5SDimitry Andric  }
41560b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41570b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsliImm> {
41580b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41590b57cec5SDimitry Andric  }
41600b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
41610b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsliImm>;
41620b57cec5SDimitry Andric                             // imm6 = xxxxxx
41630b57cec5SDimitry Andric
41640b57cec5SDimitry Andric  // 128-bit vector types.
41650b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41660b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsliImm> {
41670b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41680b57cec5SDimitry Andric  }
41690b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41700b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsliImm> {
41710b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41720b57cec5SDimitry Andric  }
41730b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41740b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsliImm> {
41750b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41760b57cec5SDimitry Andric  }
41770b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
41780b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsliImm>;
41790b57cec5SDimitry Andric                             // imm6 = xxxxxx
41800b57cec5SDimitry Andric}
41810b57cec5SDimitry Andricmulticlass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41820b57cec5SDimitry Andric                          string OpcodeStr> {
41830b57cec5SDimitry Andric  // 64-bit vector types.
41840b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
41850b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsriImm> {
41860b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41870b57cec5SDimitry Andric  }
41880b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
41890b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsriImm> {
41900b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41910b57cec5SDimitry Andric  }
41920b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
41930b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsriImm> {
41940b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41950b57cec5SDimitry Andric  }
41960b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
41970b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsriImm>;
41980b57cec5SDimitry Andric                             // imm6 = xxxxxx
41990b57cec5SDimitry Andric
42000b57cec5SDimitry Andric  // 128-bit vector types.
42010b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
42020b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsriImm> {
42030b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
42040b57cec5SDimitry Andric  }
42050b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
42060b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsriImm> {
42070b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
42080b57cec5SDimitry Andric  }
42090b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
42100b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsriImm> {
42110b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
42120b57cec5SDimitry Andric  }
42130b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
42140b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsriImm>;
42150b57cec5SDimitry Andric                             // imm6 = xxxxxx
42160b57cec5SDimitry Andric}
42170b57cec5SDimitry Andric
42180b57cec5SDimitry Andric// Neon Shift Long operations,
42190b57cec5SDimitry Andric//   element sizes of 8, 16, 32 bits:
42200b57cec5SDimitry Andricmulticlass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
42210b57cec5SDimitry Andric                      bit op4, string OpcodeStr, string Dt,
42220b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
42230b57cec5SDimitry Andric  def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42240b57cec5SDimitry Andric              OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, imm1_7, OpNode> {
42250b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
42260b57cec5SDimitry Andric  }
42270b57cec5SDimitry Andric  def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42280b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, imm1_15, OpNode> {
42290b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
42300b57cec5SDimitry Andric  }
42310b57cec5SDimitry Andric  def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42320b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, imm1_31, OpNode> {
42330b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
42340b57cec5SDimitry Andric  }
42350b57cec5SDimitry Andric}
42360b57cec5SDimitry Andric
42370b57cec5SDimitry Andric// Neon Shift Narrow operations,
42380b57cec5SDimitry Andric//   element sizes of 16, 32, 64 bits:
42390b57cec5SDimitry Andricmulticlass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
42400b57cec5SDimitry Andric                      bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
42410b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
42420b57cec5SDimitry Andric  def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42430b57cec5SDimitry Andric                    OpcodeStr, !strconcat(Dt, "16"),
42440b57cec5SDimitry Andric                    v8i8, v8i16, shr_imm8, OpNode> {
42450b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
42460b57cec5SDimitry Andric  }
42470b57cec5SDimitry Andric  def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42480b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"),
42490b57cec5SDimitry Andric                     v4i16, v4i32, shr_imm16, OpNode> {
42500b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
42510b57cec5SDimitry Andric  }
42520b57cec5SDimitry Andric  def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42530b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"),
42540b57cec5SDimitry Andric                     v2i32, v2i64, shr_imm32, OpNode> {
42550b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
42560b57cec5SDimitry Andric  }
42570b57cec5SDimitry Andric}
42580b57cec5SDimitry Andric
42590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
42600b57cec5SDimitry Andric// Instruction Definitions.
42610b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
42620b57cec5SDimitry Andric
42630b57cec5SDimitry Andric// Vector Add Operations.
42640b57cec5SDimitry Andric
42650b57cec5SDimitry Andric//   VADD     : Vector Add (integer and floating-point)
42660b57cec5SDimitry Andricdefm VADD     : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
42670b57cec5SDimitry Andric                         add, 1>;
42680b57cec5SDimitry Andricdef  VADDfd   : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
42690b57cec5SDimitry Andric                     v2f32, v2f32, fadd, 1>;
42700b57cec5SDimitry Andricdef  VADDfq   : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
42710b57cec5SDimitry Andric                     v4f32, v4f32, fadd, 1>;
42720b57cec5SDimitry Andricdef  VADDhd   : N3VD<0, 0, 0b01, 0b1101, 0, IIC_VBIND, "vadd", "f16",
42730b57cec5SDimitry Andric                     v4f16, v4f16, fadd, 1>,
42740b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42750b57cec5SDimitry Andricdef  VADDhq   : N3VQ<0, 0, 0b01, 0b1101, 0, IIC_VBINQ, "vadd", "f16",
42760b57cec5SDimitry Andric                     v8f16, v8f16, fadd, 1>,
42770b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42780b57cec5SDimitry Andric//   VADDL    : Vector Add Long (Q = D + D)
42790b57cec5SDimitry Andricdefm VADDLs   : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
42800b57cec5SDimitry Andric                            "vaddl", "s", add, sext, 1>;
42810b57cec5SDimitry Andricdefm VADDLu   : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4282e8d8bef9SDimitry Andric                            "vaddl", "u", add, zanyext, 1>;
42830b57cec5SDimitry Andric//   VADDW    : Vector Add Wide (Q = Q + D)
42840b57cec5SDimitry Andricdefm VADDWs   : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
4285e8d8bef9SDimitry Andricdefm VADDWu   : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zanyext, 0>;
42860b57cec5SDimitry Andric//   VHADD    : Vector Halving Add
42870b57cec5SDimitry Andricdefm VHADDs   : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
42880b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42890b57cec5SDimitry Andric                           "vhadd", "s", int_arm_neon_vhadds, 1>;
42900b57cec5SDimitry Andricdefm VHADDu   : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
42910b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42920b57cec5SDimitry Andric                           "vhadd", "u", int_arm_neon_vhaddu, 1>;
42930b57cec5SDimitry Andric//   VRHADD   : Vector Rounding Halving Add
42940b57cec5SDimitry Andricdefm VRHADDs  : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
42950b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42960b57cec5SDimitry Andric                           "vrhadd", "s", int_arm_neon_vrhadds, 1>;
42970b57cec5SDimitry Andricdefm VRHADDu  : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
42980b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42990b57cec5SDimitry Andric                           "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
43000b57cec5SDimitry Andric//   VQADD    : Vector Saturating Add
43010b57cec5SDimitry Andricdefm VQADDs   : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
43020b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4303480093f4SDimitry Andric                            "vqadd", "s", saddsat, 1>;
43040b57cec5SDimitry Andricdefm VQADDu   : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
43050b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4306480093f4SDimitry Andric                            "vqadd", "u", uaddsat, 1>;
43070b57cec5SDimitry Andric//   VADDHN   : Vector Add and Narrow Returning High Half (D = Q + Q)
43080b57cec5SDimitry Andricdefm VADDHN   : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i", null_frag, 1>;
43090b57cec5SDimitry Andric//   VRADDHN  : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
43100b57cec5SDimitry Andricdefm VRADDHN  : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
43110b57cec5SDimitry Andric                            int_arm_neon_vraddhn, 1>;
43120b57cec5SDimitry Andric
43130b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43140b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (add (v8i16 QPR:$Vn), QPR:$Vm), 8))),
43150b57cec5SDimitry Andric          (VADDHNv8i8 QPR:$Vn, QPR:$Vm)>;
43160b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (add (v4i32 QPR:$Vn), QPR:$Vm), 16))),
43170b57cec5SDimitry Andric          (VADDHNv4i16 QPR:$Vn, QPR:$Vm)>;
43180b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (add (v2i64 QPR:$Vn), QPR:$Vm), 32))),
43190b57cec5SDimitry Andric          (VADDHNv2i32 QPR:$Vn, QPR:$Vm)>;
43200b57cec5SDimitry Andric}
43210b57cec5SDimitry Andric
43220b57cec5SDimitry Andric// Vector Multiply Operations.
43230b57cec5SDimitry Andric
43240b57cec5SDimitry Andric//   VMUL     : Vector Multiply (integer, polynomial and floating-point)
43250b57cec5SDimitry Andricdefm VMUL     : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
43260b57cec5SDimitry Andric                        IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
43270b57cec5SDimitry Andricdef  VMULpd   : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
43280b57cec5SDimitry Andric                        "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
43290b57cec5SDimitry Andricdef  VMULpq   : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
43300b57cec5SDimitry Andric                        "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
43310b57cec5SDimitry Andricdef  VMULfd   : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
43320b57cec5SDimitry Andric                     v2f32, v2f32, fmul, 1>;
43330b57cec5SDimitry Andricdef  VMULfq   : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
43340b57cec5SDimitry Andric                     v4f32, v4f32, fmul, 1>;
43350b57cec5SDimitry Andricdef  VMULhd   : N3VD<1, 0, 0b01, 0b1101, 1, IIC_VFMULD, "vmul", "f16",
43360b57cec5SDimitry Andric                     v4f16, v4f16, fmul, 1>,
43370b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43380b57cec5SDimitry Andricdef  VMULhq   : N3VQ<1, 0, 0b01, 0b1101, 1, IIC_VFMULQ, "vmul", "f16",
43390b57cec5SDimitry Andric                     v8f16, v8f16, fmul, 1>,
43400b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43410b57cec5SDimitry Andricdefm VMULsl   : N3VSL_HS<0b1000, "vmul", mul>;
43420b57cec5SDimitry Andricdef  VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
43430b57cec5SDimitry Andricdef  VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
43440b57cec5SDimitry Andric                       v2f32, fmul>;
43450b57cec5SDimitry Andricdef  VMULslhd : N3VDSL16<0b01, 0b1001, "vmul", "f16", v4f16, fmul>,
43460b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43470b57cec5SDimitry Andricdef  VMULslhq : N3VQSL16<0b01, 0b1001, "vmul", "f16", v8f16,
43480b57cec5SDimitry Andric                       v4f16, fmul>,
43490b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43500b57cec5SDimitry Andric
43510b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43520b57cec5SDimitry Andricdef : Pat<(v8i16 (mul (v8i16 QPR:$src1),
43530b57cec5SDimitry Andric                      (v8i16 (ARMvduplane (v8i16 QPR:$src2), imm:$lane)))),
43540b57cec5SDimitry Andric          (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
43550b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src2,
43560b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
43570b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
43580b57cec5SDimitry Andricdef : Pat<(v4i32 (mul (v4i32 QPR:$src1),
43590b57cec5SDimitry Andric                      (v4i32 (ARMvduplane (v4i32 QPR:$src2), imm:$lane)))),
43600b57cec5SDimitry Andric          (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
43610b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src2,
43620b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
43630b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
43640b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
43650b57cec5SDimitry Andric                       (v4f32 (ARMvduplane (v4f32 QPR:$src2), imm:$lane)))),
43660b57cec5SDimitry Andric          (v4f32 (VMULslfq (v4f32 QPR:$src1),
43670b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src2,
43680b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
43690b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
43700b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul (v8f16 QPR:$src1),
43710b57cec5SDimitry Andric                       (v8f16 (ARMvduplane (v8f16 QPR:$src2), imm:$lane)))),
43720b57cec5SDimitry Andric          (v8f16 (VMULslhq(v8f16 QPR:$src1),
43730b57cec5SDimitry Andric                           (v4f16 (EXTRACT_SUBREG QPR:$src2,
43740b57cec5SDimitry Andric                                   (DSubReg_i16_reg imm:$lane))),
43750b57cec5SDimitry Andric                           (SubReg_i16_lane imm:$lane)))>;
43760b57cec5SDimitry Andric
43770b57cec5SDimitry Andricdef : Pat<(v2f32 (fmul DPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43780b57cec5SDimitry Andric          (VMULslfd DPR:$Rn,
43790b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43800b57cec5SDimitry Andric            (i32 0))>;
43810b57cec5SDimitry Andricdef : Pat<(v4f16 (fmul DPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43820b57cec5SDimitry Andric          (VMULslhd DPR:$Rn,
43835ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43840b57cec5SDimitry Andric            (i32 0))>;
43850b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul QPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43860b57cec5SDimitry Andric          (VMULslfq QPR:$Rn,
43870b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43880b57cec5SDimitry Andric            (i32 0))>;
43890b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul QPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43900b57cec5SDimitry Andric          (VMULslhq QPR:$Rn,
43915ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43920b57cec5SDimitry Andric            (i32 0))>;
43930b57cec5SDimitry Andric}
43940b57cec5SDimitry Andric
43950b57cec5SDimitry Andric//   VQDMULH  : Vector Saturating Doubling Multiply Returning High Half
43960b57cec5SDimitry Andricdefm VQDMULH  : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
43970b57cec5SDimitry Andric                          IIC_VMULi16Q, IIC_VMULi32Q,
43980b57cec5SDimitry Andric                          "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
43990b57cec5SDimitry Andricdefm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
44000b57cec5SDimitry Andric                            IIC_VMULi16Q, IIC_VMULi32Q,
44010b57cec5SDimitry Andric                            "vqdmulh", "s",  int_arm_neon_vqdmulh>;
44020b57cec5SDimitry Andric
44030b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
44040b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
44050b57cec5SDimitry Andric                                       (v8i16 (ARMvduplane (v8i16 QPR:$src2),
44060b57cec5SDimitry Andric                                                            imm:$lane)))),
44070b57cec5SDimitry Andric          (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
44080b57cec5SDimitry Andric                                 (v4i16 (EXTRACT_SUBREG QPR:$src2,
44090b57cec5SDimitry Andric                                         (DSubReg_i16_reg imm:$lane))),
44100b57cec5SDimitry Andric                                 (SubReg_i16_lane imm:$lane)))>;
44110b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
44120b57cec5SDimitry Andric                                       (v4i32 (ARMvduplane (v4i32 QPR:$src2),
44130b57cec5SDimitry Andric                                                            imm:$lane)))),
44140b57cec5SDimitry Andric          (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
44150b57cec5SDimitry Andric                                 (v2i32 (EXTRACT_SUBREG QPR:$src2,
44160b57cec5SDimitry Andric                                         (DSubReg_i32_reg imm:$lane))),
44170b57cec5SDimitry Andric                                 (SubReg_i32_lane imm:$lane)))>;
44180b57cec5SDimitry Andric}
44190b57cec5SDimitry Andric
44200b57cec5SDimitry Andric//   VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
44210b57cec5SDimitry Andricdefm VQRDMULH   : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
44220b57cec5SDimitry Andric                            IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
44230b57cec5SDimitry Andric                            "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
44240b57cec5SDimitry Andricdefm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
44250b57cec5SDimitry Andric                              IIC_VMULi16Q, IIC_VMULi32Q,
44260b57cec5SDimitry Andric                              "vqrdmulh", "s",  int_arm_neon_vqrdmulh>;
44270b57cec5SDimitry Andric
44280b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
44290b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
44300b57cec5SDimitry Andric                                        (v8i16 (ARMvduplane (v8i16 QPR:$src2),
44310b57cec5SDimitry Andric                                                             imm:$lane)))),
44320b57cec5SDimitry Andric          (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
44330b57cec5SDimitry Andric                                  (v4i16 (EXTRACT_SUBREG QPR:$src2,
44340b57cec5SDimitry Andric                                          (DSubReg_i16_reg imm:$lane))),
44350b57cec5SDimitry Andric                                  (SubReg_i16_lane imm:$lane)))>;
44360b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
44370b57cec5SDimitry Andric                                        (v4i32 (ARMvduplane (v4i32 QPR:$src2),
44380b57cec5SDimitry Andric                                                             imm:$lane)))),
44390b57cec5SDimitry Andric          (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
44400b57cec5SDimitry Andric                                  (v2i32 (EXTRACT_SUBREG QPR:$src2,
44410b57cec5SDimitry Andric                                          (DSubReg_i32_reg imm:$lane))),
44420b57cec5SDimitry Andric                                  (SubReg_i32_lane imm:$lane)))>;
44430b57cec5SDimitry Andric}
44440b57cec5SDimitry Andric
44450b57cec5SDimitry Andric//   VMULL    : Vector Multiply Long (integer and polynomial) (Q = D * D)
44460b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
44470b57cec5SDimitry Andric    DecoderNamespace = "NEONData" in {
44480b57cec5SDimitry Andric  defm VMULLs   : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
44495ffd83dbSDimitry Andric                           "vmull", "s", ARMvmulls, 1>;
44500b57cec5SDimitry Andric  defm VMULLu   : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
44515ffd83dbSDimitry Andric                           "vmull", "u", ARMvmullu, 1>;
44520b57cec5SDimitry Andric  def  VMULLp8   :  N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
44530b57cec5SDimitry Andric                            v8i16, v8i8, int_arm_neon_vmullp, 1>;
44540b57cec5SDimitry Andric  def  VMULLp64  : N3VLIntnp<0b00101, 0b10, 0b1110, 0, 0, NoItinerary,
44550b57cec5SDimitry Andric                          "vmull", "p64", v2i64, v1i64, int_arm_neon_vmullp, 1>,
4456fe6060f1SDimitry Andric                    Requires<[HasV8, HasAES]>;
44570b57cec5SDimitry Andric}
44585ffd83dbSDimitry Andricdefm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", ARMvmulls>;
44595ffd83dbSDimitry Andricdefm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", ARMvmullu>;
44600b57cec5SDimitry Andric
44610b57cec5SDimitry Andric//   VQDMULL  : Vector Saturating Doubling Multiply Long (Q = D * D)
44620b57cec5SDimitry Andricdefm VQDMULL  : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
44630b57cec5SDimitry Andric                           "vqdmull", "s", int_arm_neon_vqdmull, 1>;
44640b57cec5SDimitry Andricdefm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
44650b57cec5SDimitry Andric                             "vqdmull", "s", int_arm_neon_vqdmull>;
44660b57cec5SDimitry Andric
44670b57cec5SDimitry Andric// Vector Multiply-Accumulate and Multiply-Subtract Operations.
44680b57cec5SDimitry Andric
44690b57cec5SDimitry Andric//   VMLA     : Vector Multiply Accumulate (integer and floating-point)
44700b57cec5SDimitry Andricdefm VMLA     : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
44710b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44720b57cec5SDimitry Andricdef  VMLAfd   : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
44730b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
44740b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44750b57cec5SDimitry Andricdef  VMLAfq   : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
44760b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
44770b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44780b57cec5SDimitry Andricdef  VMLAhd   : N3VDMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACD, "vmla", "f16",
44790b57cec5SDimitry Andric                          v4f16, fmul_su, fadd_mlx>,
44800b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44810b57cec5SDimitry Andricdef  VMLAhq   : N3VQMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACQ, "vmla", "f16",
44820b57cec5SDimitry Andric                          v8f16, fmul_su, fadd_mlx>,
44830b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44840b57cec5SDimitry Andricdefm VMLAsl   : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
44850b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44860b57cec5SDimitry Andricdef  VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
44870b57cec5SDimitry Andric                            v2f32, fmul_su, fadd_mlx>,
44880b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44890b57cec5SDimitry Andricdef  VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
44900b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fadd_mlx>,
44910b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44920b57cec5SDimitry Andricdef  VMLAslhd : N3VDMulOpSL16<0b01, 0b0001, IIC_VMACD, "vmla", "f16",
44930b57cec5SDimitry Andric                            v4f16, fmul, fadd>,
44940b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44950b57cec5SDimitry Andricdef  VMLAslhq : N3VQMulOpSL16<0b01, 0b0001, IIC_VMACQ, "vmla", "f16",
44960b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fadd>,
44970b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44980b57cec5SDimitry Andric
44990b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
45000b57cec5SDimitry Andricdef : Pat<(v8i16 (add (v8i16 QPR:$src1),
45010b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
45020b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
45030b57cec5SDimitry Andric          (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
45040b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
45050b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
45060b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
45070b57cec5SDimitry Andric
45080b57cec5SDimitry Andricdef : Pat<(v4i32 (add (v4i32 QPR:$src1),
45090b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
45100b57cec5SDimitry Andric                       (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
45110b57cec5SDimitry Andric          (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
45120b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
45130b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
45140b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
45150b57cec5SDimitry Andric}
45160b57cec5SDimitry Andric
45170b57cec5SDimitry Andricdef : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
45180b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
45190b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
45200b57cec5SDimitry Andric          (v4f32 (VMLAslfq (v4f32 QPR:$src1),
45210b57cec5SDimitry Andric                           (v4f32 QPR:$src2),
45220b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
45230b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
45240b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
45250b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
45260b57cec5SDimitry Andric
45270b57cec5SDimitry Andric//   VMLAL    : Vector Multiply Accumulate Long (Q += D * D)
45280b57cec5SDimitry Andricdefm VMLALs   : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
45295ffd83dbSDimitry Andric                              "vmlal", "s", ARMvmulls, add>;
45300b57cec5SDimitry Andricdefm VMLALu   : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
45315ffd83dbSDimitry Andric                              "vmlal", "u", ARMvmullu, add>;
45320b57cec5SDimitry Andric
45335ffd83dbSDimitry Andricdefm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", ARMvmulls, add>;
45345ffd83dbSDimitry Andricdefm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", ARMvmullu, add>;
45350b57cec5SDimitry Andric
45360b57cec5SDimitry Andriclet Predicates = [HasNEON, HasV8_1a] in {
45370b57cec5SDimitry Andric  // v8.1a Neon Rounding Double Multiply-Op vector operations,
45380b57cec5SDimitry Andric  // VQRDMLAH : Vector Saturating Rounding Doubling Multiply Accumulate Long
45390b57cec5SDimitry Andric  //            (Q += D * D)
45400b57cec5SDimitry Andric  defm VQRDMLAH : N3VInt3_HS<1, 0, 0b1011, 1, IIC_VMACi16D, IIC_VMACi32D,
45410b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
45420b57cec5SDimitry Andric                             null_frag>;
454304eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
454404eeddc0SDimitry Andric                                                   (v4i16 DPR:$Vm))),
45450b57cec5SDimitry Andric            (v4i16 (VQRDMLAHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
454604eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
454704eeddc0SDimitry Andric                                                   (v2i32 DPR:$Vm))),
45480b57cec5SDimitry Andric            (v2i32 (VQRDMLAHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
454904eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
455004eeddc0SDimitry Andric                                                   (v8i16 QPR:$Vm))),
45510b57cec5SDimitry Andric            (v8i16 (VQRDMLAHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
455204eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
455304eeddc0SDimitry Andric                                                   (v4i32 QPR:$Vm))),
45540b57cec5SDimitry Andric            (v4i32 (VQRDMLAHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
45550b57cec5SDimitry Andric
45560b57cec5SDimitry Andric  defm VQRDMLAHsl : N3VMulOpSL_HS<0b1110, IIC_VMACi16D, IIC_VMACi32D,
45570b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
45580b57cec5SDimitry Andric                                  null_frag>;
455904eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1),
45600b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
45610b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
456204eeddc0SDimitry Andric                                                   imm:$lane)))),
45630b57cec5SDimitry Andric            (v4i16 (VQRDMLAHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm,
45640b57cec5SDimitry Andric                                    imm:$lane))>;
456504eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1),
45660b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
45670b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
456804eeddc0SDimitry Andric                                                   imm:$lane)))),
45690b57cec5SDimitry Andric            (v2i32 (VQRDMLAHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
45700b57cec5SDimitry Andric                                    imm:$lane))>;
457104eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1),
45720b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
45730b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
457404eeddc0SDimitry Andric                                                   imm:$lane)))),
45750b57cec5SDimitry Andric            (v8i16 (VQRDMLAHslv8i16 (v8i16 QPR:$src1),
45760b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
45770b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
45780b57cec5SDimitry Andric                                             QPR:$src3,
45790b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
45800b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
458104eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1),
45820b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
45830b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
458404eeddc0SDimitry Andric                                                   imm:$lane)))),
45850b57cec5SDimitry Andric            (v4i32 (VQRDMLAHslv4i32 (v4i32 QPR:$src1),
45860b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
45870b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
45880b57cec5SDimitry Andric                                             QPR:$src3,
45890b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
45900b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
45910b57cec5SDimitry Andric
45920b57cec5SDimitry Andric  //   VQRDMLSH : Vector Saturating Rounding Doubling Multiply Subtract Long
45930b57cec5SDimitry Andric  //              (Q -= D * D)
45940b57cec5SDimitry Andric  defm VQRDMLSH : N3VInt3_HS<1, 0, 0b1100, 1, IIC_VMACi16D, IIC_VMACi32D,
45950b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
45960b57cec5SDimitry Andric                             null_frag>;
459704eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
459804eeddc0SDimitry Andric                                                   (v4i16 DPR:$Vm))),
45990b57cec5SDimitry Andric            (v4i16 (VQRDMLSHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
460004eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
460104eeddc0SDimitry Andric                                                   (v2i32 DPR:$Vm))),
46020b57cec5SDimitry Andric            (v2i32 (VQRDMLSHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
460304eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
460404eeddc0SDimitry Andric                                                   (v8i16 QPR:$Vm))),
46050b57cec5SDimitry Andric            (v8i16 (VQRDMLSHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
460604eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
460704eeddc0SDimitry Andric                                                   (v4i32 QPR:$Vm))),
46080b57cec5SDimitry Andric            (v4i32 (VQRDMLSHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
46090b57cec5SDimitry Andric
46100b57cec5SDimitry Andric  defm VQRDMLSHsl : N3VMulOpSL_HS<0b1111, IIC_VMACi16D, IIC_VMACi32D,
46110b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
46120b57cec5SDimitry Andric                                  null_frag>;
461304eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1),
46140b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
46150b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
461604eeddc0SDimitry Andric                                                   imm:$lane)))),
46170b57cec5SDimitry Andric            (v4i16 (VQRDMLSHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane))>;
461804eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1),
46190b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
46200b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
462104eeddc0SDimitry Andric                                                   imm:$lane)))),
46220b57cec5SDimitry Andric            (v2i32 (VQRDMLSHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
46230b57cec5SDimitry Andric                                    imm:$lane))>;
462404eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1),
46250b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
46260b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
462704eeddc0SDimitry Andric                                                   imm:$lane)))),
46280b57cec5SDimitry Andric            (v8i16 (VQRDMLSHslv8i16 (v8i16 QPR:$src1),
46290b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
46300b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
46310b57cec5SDimitry Andric                                             QPR:$src3,
46320b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
46330b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
463404eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1),
46350b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
46360b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
463704eeddc0SDimitry Andric                                                    imm:$lane)))),
46380b57cec5SDimitry Andric            (v4i32 (VQRDMLSHslv4i32 (v4i32 QPR:$src1),
46390b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
46400b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
46410b57cec5SDimitry Andric                                             QPR:$src3,
46420b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
46430b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
46440b57cec5SDimitry Andric}
46450b57cec5SDimitry Andric//   VQDMLAL  : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
46460b57cec5SDimitry Andricdefm VQDMLAL  : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46470b57cec5SDimitry Andric                            "vqdmlal", "s", null_frag>;
46480b57cec5SDimitry Andricdefm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", null_frag>;
46490b57cec5SDimitry Andric
46500b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4651480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46520b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46530b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
46540b57cec5SDimitry Andric          (VQDMLALv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4655480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46560b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46570b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
46580b57cec5SDimitry Andric          (VQDMLALv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4659480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46600b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46610b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
46620b57cec5SDimitry Andric                                                     imm:$lane)))))),
46630b57cec5SDimitry Andric          (VQDMLALslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4664480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46650b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46660b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
46670b57cec5SDimitry Andric                                                     imm:$lane)))))),
46680b57cec5SDimitry Andric          (VQDMLALslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
46690b57cec5SDimitry Andric}
46700b57cec5SDimitry Andric
46710b57cec5SDimitry Andric//   VMLS     : Vector Multiply Subtract (integer and floating-point)
46720b57cec5SDimitry Andricdefm VMLS     : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46730b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46740b57cec5SDimitry Andricdef  VMLSfd   : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
46750b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
46760b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46770b57cec5SDimitry Andricdef  VMLSfq   : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
46780b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
46790b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46800b57cec5SDimitry Andricdef  VMLShd   : N3VDMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACD, "vmls", "f16",
46810b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
46820b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46830b57cec5SDimitry Andricdef  VMLShq   : N3VQMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACQ, "vmls", "f16",
46840b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
46850b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46860b57cec5SDimitry Andricdefm VMLSsl   : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
46870b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46880b57cec5SDimitry Andricdef  VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
46890b57cec5SDimitry Andric                            v2f32, fmul_su, fsub_mlx>,
46900b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46910b57cec5SDimitry Andricdef  VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
46920b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fsub_mlx>,
46930b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46940b57cec5SDimitry Andricdef  VMLSslhd : N3VDMulOpSL16<0b01, 0b0101, IIC_VMACD, "vmls", "f16",
46950b57cec5SDimitry Andric                            v4f16, fmul, fsub>,
46960b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46970b57cec5SDimitry Andricdef  VMLSslhq : N3VQMulOpSL16<0b01, 0b0101, IIC_VMACQ, "vmls", "f16",
46980b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fsub>,
46990b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
47000b57cec5SDimitry Andric
47010b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
47020b57cec5SDimitry Andricdef : Pat<(v8i16 (sub (v8i16 QPR:$src1),
47030b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
47040b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
47050b57cec5SDimitry Andric          (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
47060b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
47070b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
47080b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
47090b57cec5SDimitry Andric
47100b57cec5SDimitry Andricdef : Pat<(v4i32 (sub (v4i32 QPR:$src1),
47110b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
47120b57cec5SDimitry Andric                     (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
47130b57cec5SDimitry Andric          (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
47140b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
47150b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
47160b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
47170b57cec5SDimitry Andric}
47180b57cec5SDimitry Andric
47190b57cec5SDimitry Andricdef : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
47200b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
47210b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
47220b57cec5SDimitry Andric          (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
47230b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
47240b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
47250b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
47260b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
47270b57cec5SDimitry Andric
47280b57cec5SDimitry Andric//   VMLSL    : Vector Multiply Subtract Long (Q -= D * D)
47290b57cec5SDimitry Andricdefm VMLSLs   : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
47305ffd83dbSDimitry Andric                              "vmlsl", "s", ARMvmulls, sub>;
47310b57cec5SDimitry Andricdefm VMLSLu   : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
47325ffd83dbSDimitry Andric                              "vmlsl", "u", ARMvmullu, sub>;
47330b57cec5SDimitry Andric
47345ffd83dbSDimitry Andricdefm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", ARMvmulls, sub>;
47355ffd83dbSDimitry Andricdefm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", ARMvmullu, sub>;
47360b57cec5SDimitry Andric
47370b57cec5SDimitry Andric//   VQDMLSL  : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
47380b57cec5SDimitry Andricdefm VQDMLSL  : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
47390b57cec5SDimitry Andric                            "vqdmlsl", "s", null_frag>;
47400b57cec5SDimitry Andricdefm VQDMLSLsl: N3VLInt3SL_HS<0, 0b0111, "vqdmlsl", "s", null_frag>;
47410b57cec5SDimitry Andric
47420b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4743480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47440b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47450b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
47460b57cec5SDimitry Andric          (VQDMLSLv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4747480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47480b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47490b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
47500b57cec5SDimitry Andric          (VQDMLSLv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4751480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47520b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47530b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
47540b57cec5SDimitry Andric                                                     imm:$lane)))))),
47550b57cec5SDimitry Andric          (VQDMLSLslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4756480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47570b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47580b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
47590b57cec5SDimitry Andric                                                     imm:$lane)))))),
47600b57cec5SDimitry Andric          (VQDMLSLslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
47610b57cec5SDimitry Andric}
47620b57cec5SDimitry Andric
47630b57cec5SDimitry Andric// Fused Vector Multiply-Accumulate and Fused Multiply-Subtract Operations.
47640b57cec5SDimitry Andricdef  VFMAfd   : N3VDMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACD, "vfma", "f32",
47650b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
47660b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47670b57cec5SDimitry Andric
47680b57cec5SDimitry Andricdef  VFMAfq   : N3VQMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACQ, "vfma", "f32",
47690b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
47700b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47710b57cec5SDimitry Andricdef  VFMAhd   : N3VDMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACD, "vfma", "f16",
47720b57cec5SDimitry Andric                          v4f16, fmul, fadd>,
47730b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47740b57cec5SDimitry Andric
47750b57cec5SDimitry Andricdef  VFMAhq   : N3VQMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACQ, "vfma", "f16",
47760b57cec5SDimitry Andric                          v8f16, fmul, fadd>,
47770b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47780b57cec5SDimitry Andric
47790b57cec5SDimitry Andric//   Fused Vector Multiply Subtract (floating-point)
47800b57cec5SDimitry Andricdef  VFMSfd   : N3VDMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACD, "vfms", "f32",
47810b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
47820b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47830b57cec5SDimitry Andricdef  VFMSfq   : N3VQMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACQ, "vfms", "f32",
47840b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
47850b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47860b57cec5SDimitry Andricdef  VFMShd   : N3VDMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACD, "vfms", "f16",
47870b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
47880b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47890b57cec5SDimitry Andricdef  VFMShq   : N3VQMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACQ, "vfms", "f16",
47900b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
47910b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47920b57cec5SDimitry Andric
47930b57cec5SDimitry Andric// Match @llvm.fma.* intrinsics
47940b57cec5SDimitry Andricdef : Pat<(v4f16 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
47950b57cec5SDimitry Andric          (VFMAhd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47960b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
47970b57cec5SDimitry Andricdef : Pat<(v8f16 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
47980b57cec5SDimitry Andric          (VFMAhq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47990b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
48000b57cec5SDimitry Andricdef : Pat<(v2f32 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
48010b57cec5SDimitry Andric          (VFMAfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
48020b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
48030b57cec5SDimitry Andricdef : Pat<(v4f32 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
48040b57cec5SDimitry Andric          (VFMAfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
48050b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
48060b57cec5SDimitry Andricdef : Pat<(v2f32 (fma (fneg DPR:$Vn), DPR:$Vm, DPR:$src1)),
48070b57cec5SDimitry Andric          (VFMSfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
48080b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
48090b57cec5SDimitry Andricdef : Pat<(v4f32 (fma (fneg QPR:$Vn), QPR:$Vm, QPR:$src1)),
48100b57cec5SDimitry Andric          (VFMSfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
48110b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
48120b57cec5SDimitry Andric
48130b57cec5SDimitry Andric// ARMv8.2a dot product instructions.
48140b57cec5SDimitry Andric// We put them in the VFPV8 decoder namespace because the ARM and Thumb
48150b57cec5SDimitry Andric// encodings are the same and thus no further bit twiddling is necessary
48160b57cec5SDimitry Andric// in the disassembler.
48175ffd83dbSDimitry Andricclass VDOT<bit op6, bit op4, bit op23, RegisterClass RegTy, string Asm,
48185ffd83dbSDimitry Andric           string AsmTy, ValueType AccumTy, ValueType InputTy,
48190b57cec5SDimitry Andric           SDPatternOperator OpNode> :
48205ffd83dbSDimitry Andric      N3Vnp<{0b1100, op23}, 0b10, 0b1101, op6, op4, (outs RegTy:$dst),
48210b57cec5SDimitry Andric            (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm), N3RegFrm, IIC_VDOTPROD,
48220b57cec5SDimitry Andric            Asm, AsmTy,
48230b57cec5SDimitry Andric            [(set (AccumTy RegTy:$dst),
48240b57cec5SDimitry Andric                  (OpNode (AccumTy RegTy:$Vd),
48250b57cec5SDimitry Andric                          (InputTy RegTy:$Vn),
48260b57cec5SDimitry Andric                          (InputTy RegTy:$Vm)))]> {
48270b57cec5SDimitry Andric  let Predicates = [HasDotProd];
48280b57cec5SDimitry Andric  let DecoderNamespace = "VFPV8";
48290b57cec5SDimitry Andric  let Constraints = "$dst = $Vd";
48300b57cec5SDimitry Andric}
48310b57cec5SDimitry Andric
48325ffd83dbSDimitry Andricdef VUDOTD : VDOT<0, 1, 0, DPR, "vudot", "u8", v2i32, v8i8,  int_arm_neon_udot>;
48335ffd83dbSDimitry Andricdef VSDOTD : VDOT<0, 0, 0, DPR, "vsdot", "s8", v2i32, v8i8,  int_arm_neon_sdot>;
48345ffd83dbSDimitry Andricdef VUDOTQ : VDOT<1, 1, 0, QPR, "vudot", "u8", v4i32, v16i8, int_arm_neon_udot>;
48355ffd83dbSDimitry Andricdef VSDOTQ : VDOT<1, 0, 0, QPR, "vsdot", "s8", v4i32, v16i8, int_arm_neon_sdot>;
48360b57cec5SDimitry Andric
48370b57cec5SDimitry Andric// Indexed dot product instructions:
48380b57cec5SDimitry Andricmulticlass DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty,
48390b57cec5SDimitry Andric           ValueType AccumType, ValueType InputType, SDPatternOperator OpNode,
48400b57cec5SDimitry Andric           dag RHS> {
48410b57cec5SDimitry Andric  def "" : N3Vnp<0b11100, 0b10, 0b1101, Q, U, (outs Ty:$dst),
48420b57cec5SDimitry Andric                 (ins Ty:$Vd, Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
48430b57cec5SDimitry Andric                 N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
48440b57cec5SDimitry Andric    bit lane;
48450b57cec5SDimitry Andric    let Inst{5} = lane;
48460b57cec5SDimitry Andric    let AsmString = !strconcat(opc, ".", dt, "\t$Vd, $Vn, $Vm$lane");
48470b57cec5SDimitry Andric    let Constraints = "$dst = $Vd";
48480b57cec5SDimitry Andric    let Predicates = [HasDotProd];
48490b57cec5SDimitry Andric    let DecoderNamespace = "VFPV8";
48500b57cec5SDimitry Andric  }
48510b57cec5SDimitry Andric
48520b57cec5SDimitry Andric  def : Pat<
48530b57cec5SDimitry Andric    (AccumType (OpNode (AccumType Ty:$Vd),
48540b57cec5SDimitry Andric                       (InputType Ty:$Vn),
48550b57cec5SDimitry Andric                       (InputType (bitconvert (AccumType
48560b57cec5SDimitry Andric                                  (ARMvduplane (AccumType Ty:$Vm),
48570b57cec5SDimitry Andric                                                 VectorIndex32:$lane)))))),
48580b57cec5SDimitry Andric    (!cast<Instruction>(NAME) Ty:$Vd, Ty:$Vn, RHS, VectorIndex32:$lane)>;
48590b57cec5SDimitry Andric}
48600b57cec5SDimitry Andric
48610b57cec5SDimitry Andricdefm VUDOTDI : DOTI<"vudot", "u8", 0b0, 0b1, DPR, v2i32, v8i8,
48620b57cec5SDimitry Andric                    int_arm_neon_udot, (v2i32 DPR_VFP2:$Vm)>;
48630b57cec5SDimitry Andricdefm VSDOTDI : DOTI<"vsdot", "s8", 0b0, 0b0, DPR, v2i32, v8i8,
48640b57cec5SDimitry Andric                    int_arm_neon_sdot, (v2i32 DPR_VFP2:$Vm)>;
48650b57cec5SDimitry Andricdefm VUDOTQI : DOTI<"vudot", "u8", 0b1, 0b1, QPR, v4i32, v16i8,
48660b57cec5SDimitry Andric                    int_arm_neon_udot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48670b57cec5SDimitry Andricdefm VSDOTQI : DOTI<"vsdot", "s8", 0b1, 0b0, QPR, v4i32, v16i8,
48680b57cec5SDimitry Andric                    int_arm_neon_sdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48690b57cec5SDimitry Andric
48705ffd83dbSDimitry Andric// v8.6A matrix multiplication extension
48715ffd83dbSDimitry Andriclet Predicates = [HasMatMulInt8] in {
48725ffd83dbSDimitry Andric  class N3VMatMul<bit B, bit U, string Asm, string AsmTy,
48735ffd83dbSDimitry Andric                  SDPatternOperator OpNode>
48745ffd83dbSDimitry Andric        : N3Vnp<{0b1100, B}, 0b10, 0b1100, 1, U, (outs QPR:$dst),
48755ffd83dbSDimitry Andric                (ins QPR:$Vd, QPR:$Vn, QPR:$Vm), N3RegFrm, NoItinerary,
48765ffd83dbSDimitry Andric                Asm, AsmTy,
48775ffd83dbSDimitry Andric                [(set (v4i32 QPR:$dst), (OpNode (v4i32 QPR:$Vd),
48785ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vn),
48795ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vm)))]> {
48805ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
48815ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
48825ffd83dbSDimitry Andric  }
48835ffd83dbSDimitry Andric
48845ffd83dbSDimitry Andric  multiclass N3VMixedDotLane<bit Q, bit U, string Asm, string AsmTy, RegisterClass RegTy,
48855ffd83dbSDimitry Andric                        ValueType AccumTy, ValueType InputTy, SDPatternOperator OpNode,
48865ffd83dbSDimitry Andric                        dag RHS> {
48875ffd83dbSDimitry Andric
48885ffd83dbSDimitry Andric    def "" : N3Vnp<0b11101, 0b00, 0b1101, Q, U, (outs RegTy:$dst),
48895ffd83dbSDimitry Andric                (ins RegTy:$Vd, RegTy:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane), N3RegFrm,
48905ffd83dbSDimitry Andric                 NoItinerary, Asm, AsmTy, []> {
48915ffd83dbSDimitry Andric      bit lane;
48925ffd83dbSDimitry Andric      let Inst{5} = lane;
48935ffd83dbSDimitry Andric      let AsmString = !strconcat(Asm, ".", AsmTy, "\t$Vd, $Vn, $Vm$lane");
48945ffd83dbSDimitry Andric      let DecoderNamespace = "VFPV8";
48955ffd83dbSDimitry Andric      let Constraints = "$dst = $Vd";
48965ffd83dbSDimitry Andric    }
48975ffd83dbSDimitry Andric
48985ffd83dbSDimitry Andric    def : Pat<
48995ffd83dbSDimitry Andric      (AccumTy (OpNode (AccumTy RegTy:$Vd),
49005ffd83dbSDimitry Andric                       (InputTy RegTy:$Vn),
49015ffd83dbSDimitry Andric                       (InputTy (bitconvert (AccumTy
49025ffd83dbSDimitry Andric                                (ARMvduplane (AccumTy RegTy:$Vm),
49035ffd83dbSDimitry Andric                                              VectorIndex32:$lane)))))),
49045ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
49055ffd83dbSDimitry Andric
49065ffd83dbSDimitry Andric  }
49075ffd83dbSDimitry Andric
49085ffd83dbSDimitry Andric  multiclass SUDOTLane<bit Q, RegisterClass RegTy, ValueType AccumTy, ValueType InputTy, dag RHS>
49095ffd83dbSDimitry Andric        : N3VMixedDotLane<Q, 1, "vsudot", "u8", RegTy, AccumTy, InputTy, null_frag, null_frag> {
49105ffd83dbSDimitry Andric    def : Pat<
49115ffd83dbSDimitry Andric      (AccumTy (int_arm_neon_usdot (AccumTy RegTy:$Vd),
49125ffd83dbSDimitry Andric                                   (InputTy (bitconvert (AccumTy
49135ffd83dbSDimitry Andric                                            (ARMvduplane (AccumTy RegTy:$Vm),
49145ffd83dbSDimitry Andric                                                          VectorIndex32:$lane)))),
49155ffd83dbSDimitry Andric                                   (InputTy RegTy:$Vn))),
49165ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
49175ffd83dbSDimitry Andric  }
49185ffd83dbSDimitry Andric
49195ffd83dbSDimitry Andric  def VSMMLA  : N3VMatMul<0, 0, "vsmmla",  "s8", int_arm_neon_smmla>;
49205ffd83dbSDimitry Andric  def VUMMLA  : N3VMatMul<0, 1, "vummla",  "u8", int_arm_neon_ummla>;
49215ffd83dbSDimitry Andric  def VUSMMLA : N3VMatMul<1, 0, "vusmmla", "s8", int_arm_neon_usmmla>;
49225ffd83dbSDimitry Andric  def VUSDOTD : VDOT<0, 0, 1, DPR, "vusdot", "s8", v2i32, v8i8,  int_arm_neon_usdot>;
49235ffd83dbSDimitry Andric  def VUSDOTQ : VDOT<1, 0, 1, QPR, "vusdot", "s8", v4i32, v16i8, int_arm_neon_usdot>;
49245ffd83dbSDimitry Andric
49255ffd83dbSDimitry Andric  defm VUSDOTDI : N3VMixedDotLane<0, 0, "vusdot", "s8", DPR, v2i32, v8i8,
49265ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (v2i32 DPR_VFP2:$Vm)>;
49275ffd83dbSDimitry Andric  defm VUSDOTQI : N3VMixedDotLane<1, 0, "vusdot", "s8", QPR, v4i32, v16i8,
49285ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
49295ffd83dbSDimitry Andric  defm VSUDOTDI : SUDOTLane<0, DPR, v2i32, v8i8, (v2i32 DPR_VFP2:$Vm)>;
49305ffd83dbSDimitry Andric  defm VSUDOTQI : SUDOTLane<1, QPR, v4i32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
49315ffd83dbSDimitry Andric}
49320b57cec5SDimitry Andric
49330b57cec5SDimitry Andric// ARMv8.3 complex operations
49340b57cec5SDimitry Andricclass BaseN3VCP8ComplexTied<bit op21, bit op4, bit s, bit q,
49350b57cec5SDimitry Andric                            InstrItinClass itin, dag oops, dag iops,
49360b57cec5SDimitry Andric                            string opc, string dt, list<dag> pattern>
49370b57cec5SDimitry Andric  : N3VCP8<{?,?}, {op21,s}, q, op4, oops,
49380b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "$src1 = $Vd", pattern>{
49390b57cec5SDimitry Andric  bits<2> rot;
49400b57cec5SDimitry Andric  let Inst{24-23} = rot;
49410b57cec5SDimitry Andric}
49420b57cec5SDimitry Andric
49430b57cec5SDimitry Andricclass BaseN3VCP8ComplexOdd<bit op23, bit op21, bit op4, bit s, bit q,
49440b57cec5SDimitry Andric                           InstrItinClass itin, dag oops, dag iops, string opc,
49450b57cec5SDimitry Andric                            string dt, list<dag> pattern>
49460b57cec5SDimitry Andric  : N3VCP8<{?,op23}, {op21,s}, q, op4, oops,
49470b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "", pattern> {
49480b57cec5SDimitry Andric  bits<1> rot;
49490b57cec5SDimitry Andric  let Inst{24} = rot;
49500b57cec5SDimitry Andric}
49510b57cec5SDimitry Andric
49520b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane32<bit op4, bit s, bit q, InstrItinClass itin,
49530b57cec5SDimitry Andric                                  dag oops, dag iops, string opc, string dt,
49540b57cec5SDimitry Andric                                  list<dag> pattern>
49550b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49560b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49570b57cec5SDimitry Andric  bits<2> rot;
49580b57cec5SDimitry Andric  bit lane;
49590b57cec5SDimitry Andric
49600b57cec5SDimitry Andric  let Inst{21-20} = rot;
49610b57cec5SDimitry Andric  let Inst{5} = lane;
49620b57cec5SDimitry Andric}
49630b57cec5SDimitry Andric
49640b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane64<bit op4, bit s, bit q, InstrItinClass itin,
49650b57cec5SDimitry Andric                            dag oops, dag iops, string opc, string dt,
49660b57cec5SDimitry Andric                            list<dag> pattern>
49670b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49680b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49690b57cec5SDimitry Andric  bits<2> rot;
49700b57cec5SDimitry Andric  bit lane;
49710b57cec5SDimitry Andric
49720b57cec5SDimitry Andric  let Inst{21-20} = rot;
49730b57cec5SDimitry Andric  let Inst{5} = Vm{4};
49740b57cec5SDimitry Andric  // This is needed because the lane operand does not have any bits in the
49750b57cec5SDimitry Andric  // encoding (it only has one possible value), so we need to manually set it
49760b57cec5SDimitry Andric  // to it's default value.
49770b57cec5SDimitry Andric  let DecoderMethod = "DecodeNEONComplexLane64Instruction";
49780b57cec5SDimitry Andric}
49790b57cec5SDimitry Andric
49800b57cec5SDimitry Andricmulticlass N3VCP8ComplexTied<bit op21, bit op4,
4981349cc55cSDimitry Andric                       string OpcodeStr> {
49820b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49830b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 0, IIC_VMACD, (outs DPR:$Vd),
49840b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49850b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49860b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 1, IIC_VMACQ, (outs QPR:$Vd),
49870b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49880b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49890b57cec5SDimitry Andric  }
49900b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
49910b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 0, IIC_VMACD, (outs DPR:$Vd),
49920b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49930b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49940b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 1, IIC_VMACQ, (outs QPR:$Vd),
49950b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49960b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49970b57cec5SDimitry Andric  }
49980b57cec5SDimitry Andric}
49990b57cec5SDimitry Andric
50000b57cec5SDimitry Andricmulticlass N3VCP8ComplexOdd<bit op23, bit op21, bit op4,
5001349cc55cSDimitry Andric                       string OpcodeStr> {
50020b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
50030b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 0, IIC_VMACD,
50040b57cec5SDimitry Andric              (outs DPR:$Vd),
50050b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
50060b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
50070b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 1, IIC_VMACQ,
50080b57cec5SDimitry Andric              (outs QPR:$Vd),
50090b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
50100b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
50110b57cec5SDimitry Andric  }
50120b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
50130b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 0, IIC_VMACD,
50140b57cec5SDimitry Andric              (outs DPR:$Vd),
50150b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
50160b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
50170b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 1, IIC_VMACQ,
50180b57cec5SDimitry Andric              (outs QPR:$Vd),
50190b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
50200b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
50210b57cec5SDimitry Andric  }
50220b57cec5SDimitry Andric}
50230b57cec5SDimitry Andric
50240b57cec5SDimitry Andric// These instructions index by pairs of lanes, so the VectorIndexes are twice
50250b57cec5SDimitry Andric// as wide as the data types.
5026349cc55cSDimitry Andricmulticlass N3VCP8ComplexTiedLane<bit op4, string OpcodeStr> {
50270b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
50280b57cec5SDimitry Andric  def v4f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 0, IIC_VMACD,
50290b57cec5SDimitry Andric                      (outs DPR:$Vd),
50300b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
50310b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
50320b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
50330b57cec5SDimitry Andric  def v8f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 1, IIC_VMACQ,
50340b57cec5SDimitry Andric                      (outs QPR:$Vd),
50350b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm,
50360b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
50370b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
50380b57cec5SDimitry Andric  }
50390b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
50400b57cec5SDimitry Andric  def v2f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 0, IIC_VMACD,
50410b57cec5SDimitry Andric                      (outs DPR:$Vd),
50420b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50430b57cec5SDimitry Andric                      complexrotateop:$rot),
50440b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50450b57cec5SDimitry Andric  def v4f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 1, IIC_VMACQ,
50460b57cec5SDimitry Andric                      (outs QPR:$Vd),
50470b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50480b57cec5SDimitry Andric                      complexrotateop:$rot),
50490b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50500b57cec5SDimitry Andric  }
50510b57cec5SDimitry Andric}
50520b57cec5SDimitry Andric
5053349cc55cSDimitry Andricdefm VCMLA : N3VCP8ComplexTied<1, 0, "vcmla">;
5054349cc55cSDimitry Andricdefm VCADD : N3VCP8ComplexOdd<1, 0, 0, "vcadd">;
5055349cc55cSDimitry Andricdefm VCMLA : N3VCP8ComplexTiedLane<0, "vcmla">;
50560b57cec5SDimitry Andric
5057480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5058480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot90 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5059480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 0))>;
5060480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot270 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5061480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 1))>;
5062480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot90 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5063480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 0))>;
5064480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot270 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5065480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 1))>;
5066480093f4SDimitry Andric}
5067480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a] in {
5068480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot90 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5069480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 0))>;
5070480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot270 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5071480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 1))>;
5072480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot90 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5073480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 0))>;
5074480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot270 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5075480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 1))>;
5076480093f4SDimitry Andric}
5077480093f4SDimitry Andric
50780b57cec5SDimitry Andric// Vector Subtract Operations.
50790b57cec5SDimitry Andric
50800b57cec5SDimitry Andric//   VSUB     : Vector Subtract (integer and floating-point)
50810b57cec5SDimitry Andricdefm VSUB     : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
50820b57cec5SDimitry Andric                         "vsub", "i", sub, 0>;
50830b57cec5SDimitry Andricdef  VSUBfd   : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
50840b57cec5SDimitry Andric                     v2f32, v2f32, fsub, 0>;
50850b57cec5SDimitry Andricdef  VSUBfq   : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
50860b57cec5SDimitry Andric                     v4f32, v4f32, fsub, 0>;
50870b57cec5SDimitry Andricdef  VSUBhd   : N3VD<0, 0, 0b11, 0b1101, 0, IIC_VBIND, "vsub", "f16",
50880b57cec5SDimitry Andric                     v4f16, v4f16, fsub, 0>,
50890b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50900b57cec5SDimitry Andricdef  VSUBhq   : N3VQ<0, 0, 0b11, 0b1101, 0, IIC_VBINQ, "vsub", "f16",
50910b57cec5SDimitry Andric                     v8f16, v8f16, fsub, 0>,
50920b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50930b57cec5SDimitry Andric//   VSUBL    : Vector Subtract Long (Q = D - D)
50940b57cec5SDimitry Andricdefm VSUBLs   : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
50950b57cec5SDimitry Andric                            "vsubl", "s", sub, sext, 0>;
50960b57cec5SDimitry Andricdefm VSUBLu   : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5097e8d8bef9SDimitry Andric                            "vsubl", "u", sub, zanyext, 0>;
50980b57cec5SDimitry Andric//   VSUBW    : Vector Subtract Wide (Q = Q - D)
50990b57cec5SDimitry Andricdefm VSUBWs   : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
5100e8d8bef9SDimitry Andricdefm VSUBWu   : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zanyext, 0>;
51010b57cec5SDimitry Andric//   VHSUB    : Vector Halving Subtract
51020b57cec5SDimitry Andricdefm VHSUBs   : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
51030b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
51040b57cec5SDimitry Andric                           "vhsub", "s", int_arm_neon_vhsubs, 0>;
51050b57cec5SDimitry Andricdefm VHSUBu   : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
51060b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
51070b57cec5SDimitry Andric                           "vhsub", "u", int_arm_neon_vhsubu, 0>;
51080b57cec5SDimitry Andric//   VQSUB    : Vector Saturing Subtract
51090b57cec5SDimitry Andricdefm VQSUBs   : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
51100b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5111480093f4SDimitry Andric                            "vqsub", "s", ssubsat, 0>;
51120b57cec5SDimitry Andricdefm VQSUBu   : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
51130b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5114480093f4SDimitry Andric                            "vqsub", "u", usubsat, 0>;
51150b57cec5SDimitry Andric//   VSUBHN   : Vector Subtract and Narrow Returning High Half (D = Q - Q)
51160b57cec5SDimitry Andricdefm VSUBHN   : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i", null_frag, 0>;
51170b57cec5SDimitry Andric//   VRSUBHN  : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
51180b57cec5SDimitry Andricdefm VRSUBHN  : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
51190b57cec5SDimitry Andric                            int_arm_neon_vrsubhn, 0>;
51200b57cec5SDimitry Andric
51210b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
51220b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (sub (v8i16 QPR:$Vn), QPR:$Vm), 8))),
51230b57cec5SDimitry Andric          (VSUBHNv8i8 QPR:$Vn, QPR:$Vm)>;
51240b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (sub (v4i32 QPR:$Vn), QPR:$Vm), 16))),
51250b57cec5SDimitry Andric          (VSUBHNv4i16 QPR:$Vn, QPR:$Vm)>;
51260b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (sub (v2i64 QPR:$Vn), QPR:$Vm), 32))),
51270b57cec5SDimitry Andric          (VSUBHNv2i32 QPR:$Vn, QPR:$Vm)>;
51280b57cec5SDimitry Andric}
51290b57cec5SDimitry Andric
51300b57cec5SDimitry Andric// Vector Comparisons.
51310b57cec5SDimitry Andric
51320b57cec5SDimitry Andric//   VCEQ     : Vector Compare Equal
51338bcb0991SDimitry Andricdefm VCEQ     : N3V_QHS_cmp<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5134480093f4SDimitry Andric                            IIC_VSUBi4Q, "vceq", "i", ARMCCeq, 1>;
51358bcb0991SDimitry Andricdef  VCEQfd   : N3VD_cmp<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
5136480093f4SDimitry Andric                         ARMCCeq, 1>;
51378bcb0991SDimitry Andricdef  VCEQfq   : N3VQ_cmp<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
5138480093f4SDimitry Andric                         ARMCCeq, 1>;
51398bcb0991SDimitry Andricdef  VCEQhd   : N3VD_cmp<0,0,0b01,0b1110,0, IIC_VBIND, "vceq", "f16", v4i16, v4f16,
5140480093f4SDimitry Andric                         ARMCCeq, 1>,
51410b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51428bcb0991SDimitry Andricdef  VCEQhq   : N3VQ_cmp<0,0,0b01,0b1110,0, IIC_VBINQ, "vceq", "f16", v8i16, v8f16,
5143480093f4SDimitry Andric                         ARMCCeq, 1>,
51440b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51450b57cec5SDimitry Andric
51460b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in
51470b57cec5SDimitry Andricdefm VCEQz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
5148480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCeq>;
51490b57cec5SDimitry Andric
51500b57cec5SDimitry Andric//   VCGE     : Vector Compare Greater Than or Equal
51518bcb0991SDimitry Andricdefm VCGEs    : N3V_QHS_cmp<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5152480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "s", ARMCCge, 0>;
51538bcb0991SDimitry Andricdefm VCGEu    : N3V_QHS_cmp<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5154480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "u", ARMCChs, 0>;
51558bcb0991SDimitry Andricdef  VCGEfd   : N3VD_cmp<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
5156480093f4SDimitry Andric                         ARMCCge, 0>;
51578bcb0991SDimitry Andricdef  VCGEfq   : N3VQ_cmp<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
5158480093f4SDimitry Andric                         ARMCCge, 0>;
51598bcb0991SDimitry Andricdef  VCGEhd   : N3VD_cmp<1,0,0b01,0b1110,0, IIC_VBIND, "vcge", "f16", v4i16, v4f16,
5160480093f4SDimitry Andric                         ARMCCge, 0>,
51610b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51628bcb0991SDimitry Andricdef  VCGEhq   : N3VQ_cmp<1,0,0b01,0b1110,0, IIC_VBINQ, "vcge", "f16", v8i16, v8f16,
5163480093f4SDimitry Andric                         ARMCCge, 0>,
51640b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51650b57cec5SDimitry Andric
51660b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51670b57cec5SDimitry Andricdefm VCGEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
5168480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCge>;
51690b57cec5SDimitry Andricdefm VCLEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
5170480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCle>;
51710b57cec5SDimitry Andric}
51720b57cec5SDimitry Andric
51730b57cec5SDimitry Andric//   VCGT     : Vector Compare Greater Than
51748bcb0991SDimitry Andricdefm VCGTs    : N3V_QHS_cmp<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5175480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "s", ARMCCgt, 0>;
51768bcb0991SDimitry Andricdefm VCGTu    : N3V_QHS_cmp<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5177480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "u", ARMCChi, 0>;
51788bcb0991SDimitry Andricdef  VCGTfd   : N3VD_cmp<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
5179480093f4SDimitry Andric                         ARMCCgt, 0>;
51808bcb0991SDimitry Andricdef  VCGTfq   : N3VQ_cmp<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
5181480093f4SDimitry Andric                         ARMCCgt, 0>;
51828bcb0991SDimitry Andricdef  VCGThd   : N3VD_cmp<1,0,0b11,0b1110,0, IIC_VBIND, "vcgt", "f16", v4i16, v4f16,
5183480093f4SDimitry Andric                         ARMCCgt, 0>,
51840b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51858bcb0991SDimitry Andricdef  VCGThq   : N3VQ_cmp<1,0,0b11,0b1110,0, IIC_VBINQ, "vcgt", "f16", v8i16, v8f16,
5186480093f4SDimitry Andric                         ARMCCgt, 0>,
51870b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51880b57cec5SDimitry Andric
51890b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51900b57cec5SDimitry Andricdefm VCGTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
5191480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCgt>;
51920b57cec5SDimitry Andricdefm VCLTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
5193480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCClt>;
51940b57cec5SDimitry Andric}
51950b57cec5SDimitry Andric
51960b57cec5SDimitry Andric//   VACGE    : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
51970b57cec5SDimitry Andricdef  VACGEfd   : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
51980b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacge, 0>;
51990b57cec5SDimitry Andricdef  VACGEfq   : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
52000b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacge, 0>;
52010b57cec5SDimitry Andricdef  VACGEhd   : N3VDInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
52020b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacge, 0>,
52030b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52040b57cec5SDimitry Andricdef  VACGEhq   : N3VQInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
52050b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacge, 0>,
52060b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52070b57cec5SDimitry Andric//   VACGT    : Vector Absolute Compare Greater Than (aka VCAGT)
52080b57cec5SDimitry Andricdef  VACGTfd   : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
52090b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacgt, 0>;
52100b57cec5SDimitry Andricdef  VACGTfq   : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
52110b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacgt, 0>;
52120b57cec5SDimitry Andricdef  VACGThd   : N3VDInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
52130b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacgt, 0>,
52140b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52150b57cec5SDimitry Andricdef  VACGThq   : N3VQInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
52160b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacgt, 0>,
52170b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52180b57cec5SDimitry Andric//   VTST     : Vector Test Bits
52190b57cec5SDimitry Andricdefm VTST     : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
52200b57cec5SDimitry Andric                        IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
52210b57cec5SDimitry Andric
52220b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
52230b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52240b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
52250b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52260b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
52270b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52280b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
52290b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52300b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
52310b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
52320b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52330b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
52340b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52350b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52360b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52370b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52380b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52390b57cec5SDimitry Andric}
52400b57cec5SDimitry Andric
52410b57cec5SDimitry Andric// +fp16fml Floating Point Multiplication Variants
52420b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFP16FML], DecoderNamespace= "VFPV8" in {
52430b57cec5SDimitry Andric
52440b57cec5SDimitry Andricclass N3VCP8F16Q1<string asm, RegisterClass Td, RegisterClass Tn,
52450b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52460b57cec5SDimitry Andric  : N3VCP8<op1, op2, 1, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52470b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52480b57cec5SDimitry Andric
52490b57cec5SDimitry Andricclass N3VCP8F16Q0<string asm, RegisterClass Td, RegisterClass Tn,
52500b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52510b57cec5SDimitry Andric  : N3VCP8Q0<op1, op2, 0, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52520b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52530b57cec5SDimitry Andric
52540b57cec5SDimitry Andric// Vd, Vs, Vs[0-15], Idx[0-1]
52550b57cec5SDimitry Andricclass VFMD<string opc, string type, bits<2> S>
52560b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 0, 1, (outs DPR:$Vd),
52570b57cec5SDimitry Andric               (ins SPR:$Vn, SPR_8:$Vm, VectorIndex32:$idx),
52580b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52590b57cec5SDimitry Andric  bit idx;
52600b57cec5SDimitry Andric  let Inst{3} = idx;
52610b57cec5SDimitry Andric  let Inst{19-16} = Vn{4-1};
52620b57cec5SDimitry Andric  let Inst{7}     = Vn{0};
52630b57cec5SDimitry Andric  let Inst{5}     = Vm{0};
52640b57cec5SDimitry Andric  let Inst{2-0}   = Vm{3-1};
52650b57cec5SDimitry Andric}
52660b57cec5SDimitry Andric
52670b57cec5SDimitry Andric// Vq, Vd, Vd[0-7], Idx[0-3]
52680b57cec5SDimitry Andricclass VFMQ<string opc, string type, bits<2> S>
52690b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 1, 1, (outs QPR:$Vd),
52700b57cec5SDimitry Andric               (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
52710b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52720b57cec5SDimitry Andric  bits<2> idx;
52730b57cec5SDimitry Andric  let Inst{5} = idx{1};
52740b57cec5SDimitry Andric  let Inst{3} = idx{0};
52750b57cec5SDimitry Andric}
52760b57cec5SDimitry Andric
52770b57cec5SDimitry Andric//                                                op1   op2   op3
52780b57cec5SDimitry Andricdef VFMALD  : N3VCP8F16Q0<"vfmal", DPR, SPR, SPR, 0b00, 0b10, 1>;
52790b57cec5SDimitry Andricdef VFMSLD  : N3VCP8F16Q0<"vfmsl", DPR, SPR, SPR, 0b01, 0b10, 1>;
52800b57cec5SDimitry Andricdef VFMALQ  : N3VCP8F16Q1<"vfmal", QPR, DPR, DPR, 0b00, 0b10, 1>;
52810b57cec5SDimitry Andricdef VFMSLQ  : N3VCP8F16Q1<"vfmsl", QPR, DPR, DPR, 0b01, 0b10, 1>;
52820b57cec5SDimitry Andricdef VFMALDI : VFMD<"vfmal", "f16", 0b00>;
52830b57cec5SDimitry Andricdef VFMSLDI : VFMD<"vfmsl", "f16", 0b01>;
52840b57cec5SDimitry Andricdef VFMALQI : VFMQ<"vfmal", "f16", 0b00>;
52850b57cec5SDimitry Andricdef VFMSLQI : VFMQ<"vfmsl", "f16", 0b01>;
52860b57cec5SDimitry Andric} // HasNEON, HasFP16FML
52870b57cec5SDimitry Andric
52880b57cec5SDimitry Andric
52890b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52900b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52910b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52920b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52930b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52940b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52950b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52960b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52970b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
52980b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
52990b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
53000b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
53010b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
53020b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
53030b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
53040b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
53050b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
53060b57cec5SDimitry Andric}
53070b57cec5SDimitry Andric
53080b57cec5SDimitry Andric// Vector Bitwise Operations.
53090b57cec5SDimitry Andric
53100b57cec5SDimitry Andricdef vnotd : PatFrag<(ops node:$in),
5311e8d8bef9SDimitry Andric                    (xor node:$in, ARMimmAllOnesD)>;
53120b57cec5SDimitry Andricdef vnotq : PatFrag<(ops node:$in),
5313e8d8bef9SDimitry Andric                    (xor node:$in, ARMimmAllOnesV)>;
53140b57cec5SDimitry Andric
53150b57cec5SDimitry Andric
53160b57cec5SDimitry Andric//   VAND     : Vector Bitwise AND
53170b57cec5SDimitry Andricdef  VANDd    : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
53180b57cec5SDimitry Andric                      v2i32, v2i32, and, 1>;
53190b57cec5SDimitry Andricdef  VANDq    : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
53200b57cec5SDimitry Andric                      v4i32, v4i32, and, 1>;
53210b57cec5SDimitry Andric
53220b57cec5SDimitry Andric//   VEOR     : Vector Bitwise Exclusive OR
53230b57cec5SDimitry Andricdef  VEORd    : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
53240b57cec5SDimitry Andric                      v2i32, v2i32, xor, 1>;
53250b57cec5SDimitry Andricdef  VEORq    : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
53260b57cec5SDimitry Andric                      v4i32, v4i32, xor, 1>;
53270b57cec5SDimitry Andric
53280b57cec5SDimitry Andric//   VORR     : Vector Bitwise OR
53290b57cec5SDimitry Andricdef  VORRd    : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
53300b57cec5SDimitry Andric                      v2i32, v2i32, or, 1>;
53310b57cec5SDimitry Andricdef  VORRq    : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
53320b57cec5SDimitry Andric                      v4i32, v4i32, or, 1>;
53330b57cec5SDimitry Andric
5334fe6060f1SDimitry Andricmulticlass BitwisePatterns<string Name, SDPatternOperator OpNodeD,
5335fe6060f1SDimitry Andric                           SDPatternOperator OpNodeQ> {
5336fe6060f1SDimitry Andric  def : Pat<(v8i8 (OpNodeD DPR:$LHS, DPR:$RHS)),
5337fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5338fe6060f1SDimitry Andric  def : Pat<(v4i16 (OpNodeD DPR:$LHS, DPR:$RHS)),
5339fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5340fe6060f1SDimitry Andric  def : Pat<(v1i64 (OpNodeD DPR:$LHS, DPR:$RHS)),
5341fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5342fe6060f1SDimitry Andric
5343fe6060f1SDimitry Andric  def : Pat<(v16i8 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5344fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5345fe6060f1SDimitry Andric  def : Pat<(v8i16 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5346fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5347fe6060f1SDimitry Andric  def : Pat<(v2i64 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5348fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5349fe6060f1SDimitry Andric}
5350fe6060f1SDimitry Andric
5351fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5352fe6060f1SDimitry Andric  defm : BitwisePatterns<"VAND", and, and>;
5353fe6060f1SDimitry Andric  defm : BitwisePatterns<"VORR", or, or>;
5354fe6060f1SDimitry Andric  defm : BitwisePatterns<"VEOR", xor, xor>;
5355fe6060f1SDimitry Andric}
5356fe6060f1SDimitry Andric
53570b57cec5SDimitry Andricdef VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
53580b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
53590b57cec5SDimitry Andric                          IIC_VMOVImm,
53600b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53610b57cec5SDimitry Andric                          [(set DPR:$Vd,
53625ffd83dbSDimitry Andric                            (v4i16 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53630b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53640b57cec5SDimitry Andric}
53650b57cec5SDimitry Andric
53660b57cec5SDimitry Andricdef VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
53670b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
53680b57cec5SDimitry Andric                          IIC_VMOVImm,
53690b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53700b57cec5SDimitry Andric                          [(set DPR:$Vd,
53715ffd83dbSDimitry Andric                            (v2i32 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53720b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53730b57cec5SDimitry Andric}
53740b57cec5SDimitry Andric
53750b57cec5SDimitry Andricdef VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
53760b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
53770b57cec5SDimitry Andric                          IIC_VMOVImm,
53780b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53790b57cec5SDimitry Andric                          [(set QPR:$Vd,
53805ffd83dbSDimitry Andric                            (v8i16 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53810b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53820b57cec5SDimitry Andric}
53830b57cec5SDimitry Andric
53840b57cec5SDimitry Andricdef VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
53850b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
53860b57cec5SDimitry Andric                          IIC_VMOVImm,
53870b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53880b57cec5SDimitry Andric                          [(set QPR:$Vd,
53895ffd83dbSDimitry Andric                            (v4i32 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53900b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53910b57cec5SDimitry Andric}
53920b57cec5SDimitry Andric
53930b57cec5SDimitry Andric
53940b57cec5SDimitry Andric//   VBIC     : Vector Bitwise Bit Clear (AND NOT)
53950b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
53960b57cec5SDimitry Andricdef  VBICd    : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
53970b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
53980b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
53990b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
54000b57cec5SDimitry Andric                                                 (vnotd DPR:$Vm))))]>;
54010b57cec5SDimitry Andricdef  VBICq    : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
54020b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
54030b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
54040b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
54050b57cec5SDimitry Andric                                                 (vnotq QPR:$Vm))))]>;
54060b57cec5SDimitry Andric}
54070b57cec5SDimitry Andric
5408fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5409fe6060f1SDimitry Andric  defm : BitwisePatterns<"VBIC", BinOpFrag<(and node:$LHS, (vnotd node:$RHS))>,
5410fe6060f1SDimitry Andric                                 BinOpFrag<(and node:$LHS, (vnotq node:$RHS))>>;
5411fe6060f1SDimitry Andric}
5412fe6060f1SDimitry Andric
54130b57cec5SDimitry Andricdef VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
54140b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
54150b57cec5SDimitry Andric                          IIC_VMOVImm,
54160b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
54170b57cec5SDimitry Andric                          [(set DPR:$Vd,
54185ffd83dbSDimitry Andric                            (v4i16 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
54190b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54200b57cec5SDimitry Andric}
54210b57cec5SDimitry Andric
54220b57cec5SDimitry Andricdef VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
54230b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
54240b57cec5SDimitry Andric                          IIC_VMOVImm,
54250b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
54260b57cec5SDimitry Andric                          [(set DPR:$Vd,
54275ffd83dbSDimitry Andric                            (v2i32 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
54280b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
54290b57cec5SDimitry Andric}
54300b57cec5SDimitry Andric
54310b57cec5SDimitry Andricdef VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
54320b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
54330b57cec5SDimitry Andric                          IIC_VMOVImm,
54340b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
54350b57cec5SDimitry Andric                          [(set QPR:$Vd,
54365ffd83dbSDimitry Andric                            (v8i16 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
54370b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54380b57cec5SDimitry Andric}
54390b57cec5SDimitry Andric
54400b57cec5SDimitry Andricdef VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
54410b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
54420b57cec5SDimitry Andric                          IIC_VMOVImm,
54430b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
54440b57cec5SDimitry Andric                          [(set QPR:$Vd,
54455ffd83dbSDimitry Andric                            (v4i32 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
54460b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
54470b57cec5SDimitry Andric}
54480b57cec5SDimitry Andric
54490b57cec5SDimitry Andric//   VORN     : Vector Bitwise OR NOT
54500b57cec5SDimitry Andricdef  VORNd    : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
54510b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
54520b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
54530b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
54540b57cec5SDimitry Andric                                                (vnotd DPR:$Vm))))]>;
54550b57cec5SDimitry Andricdef  VORNq    : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
54560b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
54570b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
54580b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
54590b57cec5SDimitry Andric                                                (vnotq QPR:$Vm))))]>;
54600b57cec5SDimitry Andric
5461fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5462fe6060f1SDimitry Andric  defm : BitwisePatterns<"VORN", BinOpFrag<(or node:$LHS, (vnotd node:$RHS))>,
5463fe6060f1SDimitry Andric                                 BinOpFrag<(or node:$LHS, (vnotq node:$RHS))>>;
5464fe6060f1SDimitry Andric}
5465fe6060f1SDimitry Andric
54660b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT (Immediate)
54670b57cec5SDimitry Andric
54680b57cec5SDimitry Andriclet isReMaterializable = 1 in {
54690b57cec5SDimitry Andric
54700b57cec5SDimitry Andricdef VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
54710b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54720b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54730b57cec5SDimitry Andric                         [(set DPR:$Vd, (v4i16 (ARMvmvnImm timm:$SIMM)))]> {
54740b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54750b57cec5SDimitry Andric}
54760b57cec5SDimitry Andric
54770b57cec5SDimitry Andricdef VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
54780b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54790b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54800b57cec5SDimitry Andric                         [(set QPR:$Vd, (v8i16 (ARMvmvnImm timm:$SIMM)))]> {
54810b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54820b57cec5SDimitry Andric}
54830b57cec5SDimitry Andric
54840b57cec5SDimitry Andricdef VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
54850b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54860b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54870b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2i32 (ARMvmvnImm timm:$SIMM)))]> {
54880b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54890b57cec5SDimitry Andric}
54900b57cec5SDimitry Andric
54910b57cec5SDimitry Andricdef VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
54920b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54930b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54940b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4i32 (ARMvmvnImm timm:$SIMM)))]> {
54950b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54960b57cec5SDimitry Andric}
54970b57cec5SDimitry Andric}
54980b57cec5SDimitry Andric
54990b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT
55000b57cec5SDimitry Andricdef  VMVNd    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
55010b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
55020b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
55030b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
55040b57cec5SDimitry Andricdef  VMVNq    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
55050b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
55060b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
55070b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
55080b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
5509fe6060f1SDimitry Andricdef : Pat<(v1i64 (vnotd DPR:$src)),
5510fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5511fe6060f1SDimitry Andricdef : Pat<(v4i16 (vnotd DPR:$src)),
5512fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5513fe6060f1SDimitry Andricdef : Pat<(v8i8 (vnotd DPR:$src)),
5514fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5515fe6060f1SDimitry Andricdef : Pat<(v2i64 (vnotq QPR:$src)),
5516fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
5517fe6060f1SDimitry Andricdef : Pat<(v8i16 (vnotq QPR:$src)),
5518fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
5519fe6060f1SDimitry Andricdef : Pat<(v16i8 (vnotq QPR:$src)),
5520fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
55210b57cec5SDimitry Andric}
55220b57cec5SDimitry Andric
5523e8d8bef9SDimitry Andric// The TwoAddress pass will not go looking for equivalent operations
5524e8d8bef9SDimitry Andric// with different register constraints; it just inserts copies.
5525e8d8bef9SDimitry Andric// That is why pseudo VBSP implemented. Is is expanded later into
5526e8d8bef9SDimitry Andric// VBIT/VBIF/VBSL taking into account register constraints to avoid copies.
5527e8d8bef9SDimitry Andricdef  VBSPd
5528e8d8bef9SDimitry Andric  : PseudoNeonI<(outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5529e8d8bef9SDimitry Andric                IIC_VBINiD, "",
55300b57cec5SDimitry Andric                [(set DPR:$Vd,
5531e8d8bef9SDimitry Andric                      (v2i32 (NEONvbsp DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
55320b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55330b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vbsl (v8i8 DPR:$src1),
55340b57cec5SDimitry Andric                                   (v8i8 DPR:$Vn), (v8i8 DPR:$Vm))),
5535e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55360b57cec5SDimitry Andricdef : Pat<(v4i16 (int_arm_neon_vbsl (v4i16 DPR:$src1),
55370b57cec5SDimitry Andric                                    (v4i16 DPR:$Vn), (v4i16 DPR:$Vm))),
5538e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55390b57cec5SDimitry Andricdef : Pat<(v2i32 (int_arm_neon_vbsl (v2i32 DPR:$src1),
55400b57cec5SDimitry Andric                                    (v2i32 DPR:$Vn), (v2i32 DPR:$Vm))),
5541e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55420b57cec5SDimitry Andricdef : Pat<(v2f32 (int_arm_neon_vbsl (v2f32 DPR:$src1),
55430b57cec5SDimitry Andric                                    (v2f32 DPR:$Vn), (v2f32 DPR:$Vm))),
5544e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55450b57cec5SDimitry Andricdef : Pat<(v1i64 (int_arm_neon_vbsl (v1i64 DPR:$src1),
55460b57cec5SDimitry Andric                                    (v1i64 DPR:$Vn), (v1i64 DPR:$Vm))),
5547e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55480b57cec5SDimitry Andric
5549fe6060f1SDimitry Andricdef : Pat<(v8i8 (or (and DPR:$Vn, DPR:$Vd),
5550fe6060f1SDimitry Andric                    (and DPR:$Vm, (vnotd DPR:$Vd)))),
5551fe6060f1SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5552fe6060f1SDimitry Andricdef : Pat<(v4i16 (or (and DPR:$Vn, DPR:$Vd),
5553fe6060f1SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5554fe6060f1SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55550b57cec5SDimitry Andricdef : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
55560b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5557e8d8bef9SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55580b57cec5SDimitry Andricdef : Pat<(v1i64 (or (and DPR:$Vn, DPR:$Vd),
55590b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5560e8d8bef9SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55610b57cec5SDimitry Andric}
55620b57cec5SDimitry Andric
5563e8d8bef9SDimitry Andricdef  VBSPq
5564e8d8bef9SDimitry Andric  : PseudoNeonI<(outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5565e8d8bef9SDimitry Andric                IIC_VBINiQ, "",
55660b57cec5SDimitry Andric                [(set QPR:$Vd,
5567e8d8bef9SDimitry Andric                      (v4i32 (NEONvbsp QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
55680b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55690b57cec5SDimitry Andricdef : Pat<(v16i8 (int_arm_neon_vbsl (v16i8 QPR:$src1),
55700b57cec5SDimitry Andric                                   (v16i8 QPR:$Vn), (v16i8 QPR:$Vm))),
5571e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55720b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vbsl (v8i16 QPR:$src1),
55730b57cec5SDimitry Andric                                    (v8i16 QPR:$Vn), (v8i16 QPR:$Vm))),
5574e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55750b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vbsl (v4i32 QPR:$src1),
55760b57cec5SDimitry Andric                                    (v4i32 QPR:$Vn), (v4i32 QPR:$Vm))),
5577e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55780b57cec5SDimitry Andricdef : Pat<(v4f32 (int_arm_neon_vbsl (v4f32 QPR:$src1),
55790b57cec5SDimitry Andric                                    (v4f32 QPR:$Vn), (v4f32 QPR:$Vm))),
5580e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55810b57cec5SDimitry Andricdef : Pat<(v2i64 (int_arm_neon_vbsl (v2i64 QPR:$src1),
55820b57cec5SDimitry Andric                                    (v2i64 QPR:$Vn), (v2i64 QPR:$Vm))),
5583e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55840b57cec5SDimitry Andric
5585fe6060f1SDimitry Andricdef : Pat<(v16i8 (or (and QPR:$Vn, QPR:$Vd),
5586fe6060f1SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5587fe6060f1SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5588fe6060f1SDimitry Andricdef : Pat<(v8i16 (or (and QPR:$Vn, QPR:$Vd),
5589fe6060f1SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5590fe6060f1SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55910b57cec5SDimitry Andricdef : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
55920b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5593e8d8bef9SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55940b57cec5SDimitry Andricdef : Pat<(v2i64 (or (and QPR:$Vn, QPR:$Vd),
55950b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5596e8d8bef9SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55970b57cec5SDimitry Andric}
55980b57cec5SDimitry Andric
5599e8d8bef9SDimitry Andric//   VBSL     : Vector Bitwise Select
5600e8d8bef9SDimitry Andricdef  VBSLd    : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5601e8d8bef9SDimitry Andric                     (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5602e8d8bef9SDimitry Andric                     N3RegFrm, IIC_VBINiD,
5603e8d8bef9SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5604e8d8bef9SDimitry Andric                     []>;
5605e8d8bef9SDimitry Andric
5606e8d8bef9SDimitry Andricdef  VBSLq    : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5607e8d8bef9SDimitry Andric                     (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5608e8d8bef9SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
5609e8d8bef9SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5610e8d8bef9SDimitry Andric                     []>;
5611e8d8bef9SDimitry Andric
56120b57cec5SDimitry Andric//   VBIF     : Vector Bitwise Insert if False
56130b57cec5SDimitry Andric//              like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
56140b57cec5SDimitry Andricdef  VBIFd    : N3VX<1, 0, 0b11, 0b0001, 0, 1,
56150b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
56160b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
56170b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56180b57cec5SDimitry Andric                     []>;
56190b57cec5SDimitry Andricdef  VBIFq    : N3VX<1, 0, 0b11, 0b0001, 1, 1,
56200b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
56210b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
56220b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56230b57cec5SDimitry Andric                     []>;
56240b57cec5SDimitry Andric
56250b57cec5SDimitry Andric//   VBIT     : Vector Bitwise Insert if True
56260b57cec5SDimitry Andric//              like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
56270b57cec5SDimitry Andricdef  VBITd    : N3VX<1, 0, 0b10, 0b0001, 0, 1,
56280b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
56290b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
56300b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56310b57cec5SDimitry Andric                     []>;
56320b57cec5SDimitry Andricdef  VBITq    : N3VX<1, 0, 0b10, 0b0001, 1, 1,
56330b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
56340b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
56350b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56360b57cec5SDimitry Andric                     []>;
56370b57cec5SDimitry Andric
56380b57cec5SDimitry Andric// Vector Absolute Differences.
56390b57cec5SDimitry Andric
56400b57cec5SDimitry Andric//   VABD     : Vector Absolute Difference
56410b57cec5SDimitry Andricdefm VABDs    : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
56420b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5643*0fca6ea1SDimitry Andric                           "vabd", "s", abds, 1>;
56440b57cec5SDimitry Andricdefm VABDu    : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
56450b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5646*0fca6ea1SDimitry Andric                           "vabd", "u", abdu, 1>;
56470b57cec5SDimitry Andricdef  VABDfd   : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
56480b57cec5SDimitry Andric                        "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
56490b57cec5SDimitry Andricdef  VABDfq   : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
56500b57cec5SDimitry Andric                        "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
56510b57cec5SDimitry Andricdef  VABDhd   : N3VDInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBIND,
56520b57cec5SDimitry Andric                        "vabd", "f16", v4f16, v4f16, int_arm_neon_vabds, 1>,
56530b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56540b57cec5SDimitry Andricdef  VABDhq   : N3VQInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBINQ,
56550b57cec5SDimitry Andric                        "vabd", "f16", v8f16, v8f16, int_arm_neon_vabds, 1>,
56560b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56570b57cec5SDimitry Andric
56580b57cec5SDimitry Andric//   VABDL    : Vector Absolute Difference Long (Q = | D - D |)
56590b57cec5SDimitry Andricdefm VABDLs   : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
5660*0fca6ea1SDimitry Andric                               "vabdl", "s", abds, zext, 1>;
56610b57cec5SDimitry Andricdefm VABDLu   : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
5662*0fca6ea1SDimitry Andric                               "vabdl", "u", abdu, zext, 1>;
56630b57cec5SDimitry Andric
56640b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
5665*0fca6ea1SDimitry Andricdef : Pat<(v8i16 (zext (abdu (v8i8 DPR:$opA), (v8i8 DPR:$opB)))),
56660b57cec5SDimitry Andric          (VABDLuv8i16 DPR:$opA, DPR:$opB)>;
5667*0fca6ea1SDimitry Andricdef : Pat<(v4i32 (zext (abdu (v4i16 DPR:$opA), (v4i16 DPR:$opB)))),
56680b57cec5SDimitry Andric          (VABDLuv4i32 DPR:$opA, DPR:$opB)>;
5669*0fca6ea1SDimitry Andricdef : Pat<(v2i64 (zext (abdu (v2i32 DPR:$opA), (v2i32 DPR:$opB)))),
56700b57cec5SDimitry Andric          (VABDLuv2i64 DPR:$opA, DPR:$opB)>;
56710b57cec5SDimitry Andric}
56720b57cec5SDimitry Andric
56730b57cec5SDimitry Andric//   VABA     : Vector Absolute Difference and Accumulate
56740b57cec5SDimitry Andricdefm VABAs    : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5675*0fca6ea1SDimitry Andric                             "vaba", "s", abds, add>;
56760b57cec5SDimitry Andricdefm VABAu    : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
5677*0fca6ea1SDimitry Andric                             "vaba", "u", abdu, add>;
56780b57cec5SDimitry Andric
56790b57cec5SDimitry Andric//   VABAL    : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
56800b57cec5SDimitry Andricdefm VABALs   : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
5681*0fca6ea1SDimitry Andric                                 "vabal", "s", abds, zext, add>;
56820b57cec5SDimitry Andricdefm VABALu   : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
5683*0fca6ea1SDimitry Andric                                 "vabal", "u", abdu, zext, add>;
56840b57cec5SDimitry Andric
56850b57cec5SDimitry Andric// Vector Maximum and Minimum.
56860b57cec5SDimitry Andric
56870b57cec5SDimitry Andric//   VMAX     : Vector Maximum
56880b57cec5SDimitry Andricdefm VMAXs    : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
56890b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56900b57cec5SDimitry Andric                           "vmax", "s", smax, 1>;
56910b57cec5SDimitry Andricdefm VMAXu    : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
56920b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56930b57cec5SDimitry Andric                           "vmax", "u", umax, 1>;
56940b57cec5SDimitry Andricdef  VMAXfd   : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
56950b57cec5SDimitry Andric                        "vmax", "f32",
56960b57cec5SDimitry Andric                        v2f32, v2f32, fmaximum, 1>;
56970b57cec5SDimitry Andricdef  VMAXfq   : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
56980b57cec5SDimitry Andric                        "vmax", "f32",
56990b57cec5SDimitry Andric                        v4f32, v4f32, fmaximum, 1>;
57000b57cec5SDimitry Andricdef  VMAXhd   : N3VDInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBIND,
57010b57cec5SDimitry Andric                        "vmax", "f16",
57020b57cec5SDimitry Andric                        v4f16, v4f16, fmaximum, 1>,
57030b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57040b57cec5SDimitry Andricdef  VMAXhq   : N3VQInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBINQ,
57050b57cec5SDimitry Andric                        "vmax", "f16",
57060b57cec5SDimitry Andric                        v8f16, v8f16, fmaximum, 1>,
57070b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57080b57cec5SDimitry Andric
57090b57cec5SDimitry Andric// VMAXNM
57100b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
57110b57cec5SDimitry Andric  def NEON_VMAXNMNDf  : N3VDIntnp<0b00110, 0b00, 0b1111, 0, 1,
57120b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f32",
57130b57cec5SDimitry Andric                                  v2f32, v2f32, fmaxnum, 1>,
57145f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON]>;
57150b57cec5SDimitry Andric  def NEON_VMAXNMNQf  : N3VQIntnp<0b00110, 0b00, 0b1111, 1, 1,
57160b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f32",
57170b57cec5SDimitry Andric                                  v4f32, v4f32, fmaxnum, 1>,
57185f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON]>;
57190b57cec5SDimitry Andric  def NEON_VMAXNMNDh  : N3VDIntnp<0b00110, 0b01, 0b1111, 0, 1,
57200b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f16",
57210b57cec5SDimitry Andric                                  v4f16, v4f16, fmaxnum, 1>,
57225f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
57230b57cec5SDimitry Andric  def NEON_VMAXNMNQh  : N3VQIntnp<0b00110, 0b01, 0b1111, 1, 1,
57240b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f16",
57250b57cec5SDimitry Andric                                  v8f16, v8f16, fmaxnum, 1>,
57265f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
57270b57cec5SDimitry Andric}
57280b57cec5SDimitry Andric
57290b57cec5SDimitry Andric//   VMIN     : Vector Minimum
57300b57cec5SDimitry Andricdefm VMINs    : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
57310b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
57320b57cec5SDimitry Andric                           "vmin", "s", smin, 1>;
57330b57cec5SDimitry Andricdefm VMINu    : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
57340b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
57350b57cec5SDimitry Andric                           "vmin", "u", umin, 1>;
57360b57cec5SDimitry Andricdef  VMINfd   : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
57370b57cec5SDimitry Andric                        "vmin", "f32",
57380b57cec5SDimitry Andric                        v2f32, v2f32, fminimum, 1>;
57390b57cec5SDimitry Andricdef  VMINfq   : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
57400b57cec5SDimitry Andric                        "vmin", "f32",
57410b57cec5SDimitry Andric                        v4f32, v4f32, fminimum, 1>;
57420b57cec5SDimitry Andricdef  VMINhd   : N3VDInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBIND,
57430b57cec5SDimitry Andric                        "vmin", "f16",
57440b57cec5SDimitry Andric                        v4f16, v4f16, fminimum, 1>,
57450b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57460b57cec5SDimitry Andricdef  VMINhq   : N3VQInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBINQ,
57470b57cec5SDimitry Andric                        "vmin", "f16",
57480b57cec5SDimitry Andric                        v8f16, v8f16, fminimum, 1>,
57490b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57500b57cec5SDimitry Andric
57510b57cec5SDimitry Andric// VMINNM
57520b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
57530b57cec5SDimitry Andric  def NEON_VMINNMNDf  : N3VDIntnp<0b00110, 0b10, 0b1111, 0, 1,
57540b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f32",
57550b57cec5SDimitry Andric                                  v2f32, v2f32, fminnum, 1>,
57565f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON]>;
57570b57cec5SDimitry Andric  def NEON_VMINNMNQf  : N3VQIntnp<0b00110, 0b10, 0b1111, 1, 1,
57580b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f32",
57590b57cec5SDimitry Andric                                  v4f32, v4f32, fminnum, 1>,
57605f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON]>;
57610b57cec5SDimitry Andric  def NEON_VMINNMNDh  : N3VDIntnp<0b00110, 0b11, 0b1111, 0, 1,
57620b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f16",
57630b57cec5SDimitry Andric                                  v4f16, v4f16, fminnum, 1>,
57645f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
57650b57cec5SDimitry Andric  def NEON_VMINNMNQh  : N3VQIntnp<0b00110, 0b11, 0b1111, 1, 1,
57660b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f16",
57670b57cec5SDimitry Andric                                  v8f16, v8f16, fminnum, 1>,
57685f757f3fSDimitry Andric                                  Requires<[HasFPARMv8, HasNEON, HasFullFP16]>;
57690b57cec5SDimitry Andric}
57700b57cec5SDimitry Andric
57710b57cec5SDimitry Andric// Vector Pairwise Operations.
57720b57cec5SDimitry Andric
57730b57cec5SDimitry Andric//   VPADD    : Vector Pairwise Add
57740b57cec5SDimitry Andricdef  VPADDi8  : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
57750b57cec5SDimitry Andric                        "vpadd", "i8",
57760b57cec5SDimitry Andric                        v8i8, v8i8, int_arm_neon_vpadd, 0>;
57770b57cec5SDimitry Andricdef  VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
57780b57cec5SDimitry Andric                        "vpadd", "i16",
57790b57cec5SDimitry Andric                        v4i16, v4i16, int_arm_neon_vpadd, 0>;
57800b57cec5SDimitry Andricdef  VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
57810b57cec5SDimitry Andric                        "vpadd", "i32",
57820b57cec5SDimitry Andric                        v2i32, v2i32, int_arm_neon_vpadd, 0>;
57830b57cec5SDimitry Andricdef  VPADDf   : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
57840b57cec5SDimitry Andric                        IIC_VPBIND, "vpadd", "f32",
57850b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vpadd, 0>;
57860b57cec5SDimitry Andricdef  VPADDh   : N3VDInt<1, 0, 0b01, 0b1101, 0, N3RegFrm,
57870b57cec5SDimitry Andric                        IIC_VPBIND, "vpadd", "f16",
57880b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vpadd, 0>,
57890b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57900b57cec5SDimitry Andric
57910b57cec5SDimitry Andric//   VPADDL   : Vector Pairwise Add Long
57920b57cec5SDimitry Andricdefm VPADDLs  : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
57930b57cec5SDimitry Andric                             int_arm_neon_vpaddls>;
57940b57cec5SDimitry Andricdefm VPADDLu  : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
57950b57cec5SDimitry Andric                             int_arm_neon_vpaddlu>;
57960b57cec5SDimitry Andric
57970b57cec5SDimitry Andric//   VPADAL   : Vector Pairwise Add and Accumulate Long
57980b57cec5SDimitry Andricdefm VPADALs  : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
57990b57cec5SDimitry Andric                              int_arm_neon_vpadals>;
58000b57cec5SDimitry Andricdefm VPADALu  : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
58010b57cec5SDimitry Andric                              int_arm_neon_vpadalu>;
58020b57cec5SDimitry Andric
58030b57cec5SDimitry Andric//   VPMAX    : Vector Pairwise Maximum
58040b57cec5SDimitry Andricdef  VPMAXs8  : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58050b57cec5SDimitry Andric                        "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
58060b57cec5SDimitry Andricdef  VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58070b57cec5SDimitry Andric                        "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
58080b57cec5SDimitry Andricdef  VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58090b57cec5SDimitry Andric                        "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
58100b57cec5SDimitry Andricdef  VPMAXu8  : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58110b57cec5SDimitry Andric                        "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
58120b57cec5SDimitry Andricdef  VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58130b57cec5SDimitry Andric                        "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
58140b57cec5SDimitry Andricdef  VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
58150b57cec5SDimitry Andric                        "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
58160b57cec5SDimitry Andricdef  VPMAXf   : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
58170b57cec5SDimitry Andric                        "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
58180b57cec5SDimitry Andricdef  VPMAXh   : N3VDInt<1, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
58190b57cec5SDimitry Andric                        "f16", v4f16, v4f16, int_arm_neon_vpmaxs, 0>,
58200b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58210b57cec5SDimitry Andric
58220b57cec5SDimitry Andric//   VPMIN    : Vector Pairwise Minimum
58230b57cec5SDimitry Andricdef  VPMINs8  : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58240b57cec5SDimitry Andric                        "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
58250b57cec5SDimitry Andricdef  VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58260b57cec5SDimitry Andric                        "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
58270b57cec5SDimitry Andricdef  VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58280b57cec5SDimitry Andric                        "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
58290b57cec5SDimitry Andricdef  VPMINu8  : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58300b57cec5SDimitry Andric                        "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
58310b57cec5SDimitry Andricdef  VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58320b57cec5SDimitry Andric                        "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
58330b57cec5SDimitry Andricdef  VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
58340b57cec5SDimitry Andric                        "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
58350b57cec5SDimitry Andricdef  VPMINf   : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
58360b57cec5SDimitry Andric                        "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
58370b57cec5SDimitry Andricdef  VPMINh   : N3VDInt<1, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
58380b57cec5SDimitry Andric                        "f16", v4f16, v4f16, int_arm_neon_vpmins, 0>,
58390b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58400b57cec5SDimitry Andric
58410b57cec5SDimitry Andric// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
58420b57cec5SDimitry Andric
58430b57cec5SDimitry Andric//   VRECPE   : Vector Reciprocal Estimate
58440b57cec5SDimitry Andricdef  VRECPEd  : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
58450b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "u32",
58460b57cec5SDimitry Andric                        v2i32, v2i32, int_arm_neon_vrecpe>;
58470b57cec5SDimitry Andricdef  VRECPEq  : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
58480b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "u32",
58490b57cec5SDimitry Andric                        v4i32, v4i32, int_arm_neon_vrecpe>;
58500b57cec5SDimitry Andricdef  VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
58510b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "f32",
58520b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrecpe>;
58530b57cec5SDimitry Andricdef  VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
58540b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "f32",
58550b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrecpe>;
58560b57cec5SDimitry Andricdef  VRECPEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
58570b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "f16",
58580b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrecpe>,
58590b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58600b57cec5SDimitry Andricdef  VRECPEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
58610b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "f16",
58620b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrecpe>,
58630b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58640b57cec5SDimitry Andric
58650b57cec5SDimitry Andric//   VRECPS   : Vector Reciprocal Step
58660b57cec5SDimitry Andricdef  VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
58670b57cec5SDimitry Andric                        IIC_VRECSD, "vrecps", "f32",
58680b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrecps, 1>;
58690b57cec5SDimitry Andricdef  VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
58700b57cec5SDimitry Andric                        IIC_VRECSQ, "vrecps", "f32",
58710b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrecps, 1>;
58720b57cec5SDimitry Andricdef  VRECPShd : N3VDInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
58730b57cec5SDimitry Andric                        IIC_VRECSD, "vrecps", "f16",
58740b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrecps, 1>,
58750b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58760b57cec5SDimitry Andricdef  VRECPShq : N3VQInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
58770b57cec5SDimitry Andric                        IIC_VRECSQ, "vrecps", "f16",
58780b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrecps, 1>,
58790b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58800b57cec5SDimitry Andric
58810b57cec5SDimitry Andric//   VRSQRTE  : Vector Reciprocal Square Root Estimate
58820b57cec5SDimitry Andricdef  VRSQRTEd  : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
58830b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "u32",
58840b57cec5SDimitry Andric                         v2i32, v2i32, int_arm_neon_vrsqrte>;
58850b57cec5SDimitry Andricdef  VRSQRTEq  : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
58860b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "u32",
58870b57cec5SDimitry Andric                         v4i32, v4i32, int_arm_neon_vrsqrte>;
58880b57cec5SDimitry Andricdef  VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
58890b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "f32",
58900b57cec5SDimitry Andric                         v2f32, v2f32, int_arm_neon_vrsqrte>;
58910b57cec5SDimitry Andricdef  VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
58920b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "f32",
58930b57cec5SDimitry Andric                         v4f32, v4f32, int_arm_neon_vrsqrte>;
58940b57cec5SDimitry Andricdef  VRSQRTEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
58950b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "f16",
58960b57cec5SDimitry Andric                         v4f16, v4f16, int_arm_neon_vrsqrte>,
58970b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58980b57cec5SDimitry Andricdef  VRSQRTEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
58990b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "f16",
59000b57cec5SDimitry Andric                         v8f16, v8f16, int_arm_neon_vrsqrte>,
59010b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
59020b57cec5SDimitry Andric
59030b57cec5SDimitry Andric//   VRSQRTS  : Vector Reciprocal Square Root Step
59040b57cec5SDimitry Andricdef VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
59050b57cec5SDimitry Andric                        IIC_VRECSD, "vrsqrts", "f32",
59060b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
59070b57cec5SDimitry Andricdef VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
59080b57cec5SDimitry Andric                        IIC_VRECSQ, "vrsqrts", "f32",
59090b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
59100b57cec5SDimitry Andricdef VRSQRTShd : N3VDInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
59110b57cec5SDimitry Andric                        IIC_VRECSD, "vrsqrts", "f16",
59120b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrsqrts, 1>,
59130b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
59140b57cec5SDimitry Andricdef VRSQRTShq : N3VQInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
59150b57cec5SDimitry Andric                        IIC_VRECSQ, "vrsqrts", "f16",
59160b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrsqrts, 1>,
59170b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
59180b57cec5SDimitry Andric
59190b57cec5SDimitry Andric// Vector Shifts.
59200b57cec5SDimitry Andric
59210b57cec5SDimitry Andric//   VSHL     : Vector Shift
59220b57cec5SDimitry Andricdefm VSHLs    : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
59230b57cec5SDimitry Andric                            IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
59240b57cec5SDimitry Andric                            "vshl", "s", int_arm_neon_vshifts>;
59250b57cec5SDimitry Andricdefm VSHLu    : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
59260b57cec5SDimitry Andric                            IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
59270b57cec5SDimitry Andric                            "vshl", "u", int_arm_neon_vshiftu>;
59280b57cec5SDimitry Andric
59290b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
59300b57cec5SDimitry Andricdef : Pat<(v8i8 (ARMvshls (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
59310b57cec5SDimitry Andric          (VSHLsv8i8 DPR:$Dn, DPR:$Dm)>;
59320b57cec5SDimitry Andricdef : Pat<(v4i16 (ARMvshls (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
59330b57cec5SDimitry Andric          (VSHLsv4i16 DPR:$Dn, DPR:$Dm)>;
59340b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvshls (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
59350b57cec5SDimitry Andric          (VSHLsv2i32 DPR:$Dn, DPR:$Dm)>;
59360b57cec5SDimitry Andricdef : Pat<(v1i64 (ARMvshls (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
59370b57cec5SDimitry Andric          (VSHLsv1i64 DPR:$Dn, DPR:$Dm)>;
59380b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvshls (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
59390b57cec5SDimitry Andric          (VSHLsv16i8 QPR:$Dn, QPR:$Dm)>;
59400b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshls (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
59410b57cec5SDimitry Andric          (VSHLsv8i16 QPR:$Dn, QPR:$Dm)>;
59420b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshls (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
59430b57cec5SDimitry Andric          (VSHLsv4i32 QPR:$Dn, QPR:$Dm)>;
59440b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshls (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
59450b57cec5SDimitry Andric          (VSHLsv2i64 QPR:$Dn, QPR:$Dm)>;
59460b57cec5SDimitry Andric
59470b57cec5SDimitry Andricdef : Pat<(v8i8 (ARMvshlu (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
59480b57cec5SDimitry Andric          (VSHLuv8i8 DPR:$Dn, DPR:$Dm)>;
59490b57cec5SDimitry Andricdef : Pat<(v4i16 (ARMvshlu (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
59500b57cec5SDimitry Andric          (VSHLuv4i16 DPR:$Dn, DPR:$Dm)>;
59510b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvshlu (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
59520b57cec5SDimitry Andric          (VSHLuv2i32 DPR:$Dn, DPR:$Dm)>;
59530b57cec5SDimitry Andricdef : Pat<(v1i64 (ARMvshlu (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
59540b57cec5SDimitry Andric          (VSHLuv1i64 DPR:$Dn, DPR:$Dm)>;
59550b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvshlu (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
59560b57cec5SDimitry Andric          (VSHLuv16i8 QPR:$Dn, QPR:$Dm)>;
59570b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlu (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
59580b57cec5SDimitry Andric          (VSHLuv8i16 QPR:$Dn, QPR:$Dm)>;
59590b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlu (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
59600b57cec5SDimitry Andric          (VSHLuv4i32 QPR:$Dn, QPR:$Dm)>;
59610b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlu (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
59620b57cec5SDimitry Andric          (VSHLuv2i64 QPR:$Dn, QPR:$Dm)>;
59630b57cec5SDimitry Andric
59640b57cec5SDimitry Andric}
59650b57cec5SDimitry Andric
59660b57cec5SDimitry Andric//   VSHL     : Vector Shift Left (Immediate)
59670b57cec5SDimitry Andricdefm VSHLi    : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", ARMvshlImm>;
59680b57cec5SDimitry Andric
59690b57cec5SDimitry Andric//   VSHR     : Vector Shift Right (Immediate)
5970349cc55cSDimitry Andricdefm VSHRs    : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s",
59710b57cec5SDimitry Andric                            ARMvshrsImm>;
5972349cc55cSDimitry Andricdefm VSHRu    : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u",
59730b57cec5SDimitry Andric                            ARMvshruImm>;
59740b57cec5SDimitry Andric
59750b57cec5SDimitry Andric//   VSHLL    : Vector Shift Left Long
59760b57cec5SDimitry Andricdefm VSHLLs   : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s",
59770b57cec5SDimitry Andric  PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (sext node:$LHS), node:$RHS)>>;
59780b57cec5SDimitry Andricdefm VSHLLu   : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u",
59790b57cec5SDimitry Andric  PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (zext node:$LHS), node:$RHS)>>;
59800b57cec5SDimitry Andric
59810b57cec5SDimitry Andric//   VSHLL    : Vector Shift Left Long (with maximum shift count)
59820b57cec5SDimitry Andricclass N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
59830b57cec5SDimitry Andric                bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
59840b57cec5SDimitry Andric                ValueType OpTy, Operand ImmTy>
59850b57cec5SDimitry Andric  : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
59860b57cec5SDimitry Andric           ResTy, OpTy, ImmTy, null_frag> {
59870b57cec5SDimitry Andric  let Inst{21-16} = op21_16;
59880b57cec5SDimitry Andric  let DecoderMethod = "DecodeVSHLMaxInstruction";
59890b57cec5SDimitry Andric}
59900b57cec5SDimitry Andricdef  VSHLLi8  : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
59910b57cec5SDimitry Andric                          v8i16, v8i8, imm8>;
59920b57cec5SDimitry Andricdef  VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
59930b57cec5SDimitry Andric                          v4i32, v4i16, imm16>;
59940b57cec5SDimitry Andricdef  VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
59950b57cec5SDimitry Andric                          v2i64, v2i32, imm32>;
59960b57cec5SDimitry Andric
59970b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
59980b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (zext (v8i8 DPR:$Rn)), (i32 8))),
59990b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
60000b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (zext (v4i16 DPR:$Rn)), (i32 16))),
60010b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
60020b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (zext (v2i32 DPR:$Rn)), (i32 32))),
60030b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
60040b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (sext (v8i8 DPR:$Rn)), (i32 8))),
60050b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
60060b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (sext (v4i16 DPR:$Rn)), (i32 16))),
60070b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
60080b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (sext (v2i32 DPR:$Rn)), (i32 32))),
60090b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
60100b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (anyext (v8i8 DPR:$Rn)), (i32 8))),
60110b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
60120b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (anyext (v4i16 DPR:$Rn)), (i32 16))),
60130b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
60140b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (anyext (v2i32 DPR:$Rn)), (i32 32))),
60150b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
60160b57cec5SDimitry Andric}
60170b57cec5SDimitry Andric
60180b57cec5SDimitry Andric//   VSHRN    : Vector Shift Right and Narrow
60190b57cec5SDimitry Andricdefm VSHRN    : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
60200b57cec5SDimitry Andric                           PatFrag<(ops node:$Rn, node:$amt),
60210b57cec5SDimitry Andric                                   (trunc (ARMvshrsImm node:$Rn, node:$amt))>>;
60220b57cec5SDimitry Andric
60230b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
60240b57cec5SDimitry Andricdef : Pat<(v8i8 (trunc (ARMvshruImm (v8i16 QPR:$Vn), shr_imm8:$amt))),
60250b57cec5SDimitry Andric          (VSHRNv8i8 QPR:$Vn, shr_imm8:$amt)>;
60260b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (v4i32 QPR:$Vn), shr_imm16:$amt))),
60270b57cec5SDimitry Andric          (VSHRNv4i16 QPR:$Vn, shr_imm16:$amt)>;
60280b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (v2i64 QPR:$Vn), shr_imm32:$amt))),
60290b57cec5SDimitry Andric          (VSHRNv2i32 QPR:$Vn, shr_imm32:$amt)>;
60300b57cec5SDimitry Andric}
60310b57cec5SDimitry Andric
60320b57cec5SDimitry Andric//   VRSHL    : Vector Rounding Shift
60330b57cec5SDimitry Andricdefm VRSHLs   : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
60340b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60350b57cec5SDimitry Andric                            "vrshl", "s", int_arm_neon_vrshifts>;
60360b57cec5SDimitry Andricdefm VRSHLu   : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
60370b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60380b57cec5SDimitry Andric                            "vrshl", "u", int_arm_neon_vrshiftu>;
60390b57cec5SDimitry Andric//   VRSHR    : Vector Rounding Shift Right
6040349cc55cSDimitry Andricdefm VRSHRs   : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s",
60410b57cec5SDimitry Andric                            NEONvrshrsImm>;
6042349cc55cSDimitry Andricdefm VRSHRu   : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u",
60430b57cec5SDimitry Andric                            NEONvrshruImm>;
60440b57cec5SDimitry Andric
60450b57cec5SDimitry Andric//   VRSHRN   : Vector Rounding Shift Right and Narrow
60460b57cec5SDimitry Andricdefm VRSHRN   : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
60470b57cec5SDimitry Andric                           NEONvrshrnImm>;
60480b57cec5SDimitry Andric
60490b57cec5SDimitry Andric//   VQSHL    : Vector Saturating Shift
60500b57cec5SDimitry Andricdefm VQSHLs   : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
60510b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60520b57cec5SDimitry Andric                            "vqshl", "s", int_arm_neon_vqshifts>;
60530b57cec5SDimitry Andricdefm VQSHLu   : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
60540b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60550b57cec5SDimitry Andric                            "vqshl", "u", int_arm_neon_vqshiftu>;
60560b57cec5SDimitry Andric//   VQSHL    : Vector Saturating Shift Left (Immediate)
60570b57cec5SDimitry Andricdefm VQSHLsi  : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshlsImm>;
60580b57cec5SDimitry Andricdefm VQSHLui  : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshluImm>;
60590b57cec5SDimitry Andric
60600b57cec5SDimitry Andric//   VQSHLU   : Vector Saturating Shift Left (Immediate, Unsigned)
60610b57cec5SDimitry Andricdefm VQSHLsu  : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsuImm>;
60620b57cec5SDimitry Andric
60630b57cec5SDimitry Andric//   VQSHRN   : Vector Saturating Shift Right and Narrow
60640b57cec5SDimitry Andricdefm VQSHRNs  : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
60650b57cec5SDimitry Andric                           NEONvqshrnsImm>;
60660b57cec5SDimitry Andricdefm VQSHRNu  : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
60670b57cec5SDimitry Andric                           NEONvqshrnuImm>;
60680b57cec5SDimitry Andric
60690b57cec5SDimitry Andric//   VQSHRUN  : Vector Saturating Shift Right and Narrow (Unsigned)
60700b57cec5SDimitry Andricdefm VQSHRUN  : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
60710b57cec5SDimitry Andric                           NEONvqshrnsuImm>;
60720b57cec5SDimitry Andric
60730b57cec5SDimitry Andric//   VQRSHL   : Vector Saturating Rounding Shift
60740b57cec5SDimitry Andricdefm VQRSHLs  : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
60750b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60760b57cec5SDimitry Andric                            "vqrshl", "s", int_arm_neon_vqrshifts>;
60770b57cec5SDimitry Andricdefm VQRSHLu  : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
60780b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
60790b57cec5SDimitry Andric                            "vqrshl", "u", int_arm_neon_vqrshiftu>;
60800b57cec5SDimitry Andric
60810b57cec5SDimitry Andric//   VQRSHRN  : Vector Saturating Rounding Shift Right and Narrow
60820b57cec5SDimitry Andricdefm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
60830b57cec5SDimitry Andric                           NEONvqrshrnsImm>;
60840b57cec5SDimitry Andricdefm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
60850b57cec5SDimitry Andric                           NEONvqrshrnuImm>;
60860b57cec5SDimitry Andric
60870b57cec5SDimitry Andric//   VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
60880b57cec5SDimitry Andricdefm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
60890b57cec5SDimitry Andric                           NEONvqrshrnsuImm>;
60900b57cec5SDimitry Andric
60910b57cec5SDimitry Andric//   VSRA     : Vector Shift Right and Accumulate
60920b57cec5SDimitry Andricdefm VSRAs    : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", ARMvshrsImm>;
60930b57cec5SDimitry Andricdefm VSRAu    : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", ARMvshruImm>;
60940b57cec5SDimitry Andric//   VRSRA    : Vector Rounding Shift Right and Accumulate
60950b57cec5SDimitry Andricdefm VRSRAs   : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrsImm>;
60960b57cec5SDimitry Andricdefm VRSRAu   : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshruImm>;
60970b57cec5SDimitry Andric
60980b57cec5SDimitry Andric//   VSLI     : Vector Shift Left and Insert
60990b57cec5SDimitry Andricdefm VSLI     : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
61000b57cec5SDimitry Andric
61010b57cec5SDimitry Andric//   VSRI     : Vector Shift Right and Insert
61020b57cec5SDimitry Andricdefm VSRI     : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
61030b57cec5SDimitry Andric
61040b57cec5SDimitry Andric// Vector Absolute and Saturating Absolute.
61050b57cec5SDimitry Andric
61060b57cec5SDimitry Andric//   VABS     : Vector Absolute Value
61070b57cec5SDimitry Andricdefm VABS     : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
61080b57cec5SDimitry Andric                           IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s", abs>;
61090b57cec5SDimitry Andricdef  VABSfd   : N2VD<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
61100b57cec5SDimitry Andric                     "vabs", "f32",
61110b57cec5SDimitry Andric                     v2f32, v2f32, fabs>;
61120b57cec5SDimitry Andricdef  VABSfq   : N2VQ<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
61130b57cec5SDimitry Andric                     "vabs", "f32",
61140b57cec5SDimitry Andric                      v4f32, v4f32, fabs>;
61150b57cec5SDimitry Andricdef  VABShd   : N2VD<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
61160b57cec5SDimitry Andric                     "vabs", "f16",
61170b57cec5SDimitry Andric                     v4f16, v4f16, fabs>,
61180b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
61190b57cec5SDimitry Andricdef  VABShq   : N2VQ<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
61200b57cec5SDimitry Andric                     "vabs", "f16",
61210b57cec5SDimitry Andric                      v8f16, v8f16, fabs>,
61220b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
61230b57cec5SDimitry Andric
61240b57cec5SDimitry Andric//   VQABS    : Vector Saturating Absolute Value
61250b57cec5SDimitry Andricdefm VQABS    : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
61260b57cec5SDimitry Andric                           IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
61270b57cec5SDimitry Andric                           int_arm_neon_vqabs>;
61280b57cec5SDimitry Andric
61290b57cec5SDimitry Andric// Vector Negate.
61300b57cec5SDimitry Andric
61310b57cec5SDimitry Andricdef vnegd  : PatFrag<(ops node:$in),
6132e8d8bef9SDimitry Andric                     (sub ARMimmAllZerosD, node:$in)>;
61330b57cec5SDimitry Andricdef vnegq  : PatFrag<(ops node:$in),
6134e8d8bef9SDimitry Andric                     (sub ARMimmAllZerosV, node:$in)>;
61350b57cec5SDimitry Andric
61360b57cec5SDimitry Andricclass VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
61370b57cec5SDimitry Andric  : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
61380b57cec5SDimitry Andric        IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
61390b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
61400b57cec5SDimitry Andricclass VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
61410b57cec5SDimitry Andric  : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
61420b57cec5SDimitry Andric        IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
61430b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
61440b57cec5SDimitry Andric
61450b57cec5SDimitry Andric//   VNEG     : Vector Negate (integer)
61460b57cec5SDimitry Andricdef  VNEGs8d  : VNEGD<0b00, "vneg", "s8", v8i8>;
61470b57cec5SDimitry Andricdef  VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
61480b57cec5SDimitry Andricdef  VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
61490b57cec5SDimitry Andricdef  VNEGs8q  : VNEGQ<0b00, "vneg", "s8", v16i8>;
61500b57cec5SDimitry Andricdef  VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
61510b57cec5SDimitry Andricdef  VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
61520b57cec5SDimitry Andric
61530b57cec5SDimitry Andric//   VNEG     : Vector Negate (floating-point)
61540b57cec5SDimitry Andricdef  VNEGfd   : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
61550b57cec5SDimitry Andric                    (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
61560b57cec5SDimitry Andric                    "vneg", "f32", "$Vd, $Vm", "",
61570b57cec5SDimitry Andric                    [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
61580b57cec5SDimitry Andricdef  VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
61590b57cec5SDimitry Andric                    (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
61600b57cec5SDimitry Andric                    "vneg", "f32", "$Vd, $Vm", "",
61610b57cec5SDimitry Andric                    [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
61620b57cec5SDimitry Andricdef  VNEGhd   : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 0, 0,
61630b57cec5SDimitry Andric                    (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
61640b57cec5SDimitry Andric                    "vneg", "f16", "$Vd, $Vm", "",
61650b57cec5SDimitry Andric                    [(set DPR:$Vd, (v4f16 (fneg DPR:$Vm)))]>,
61660b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
61670b57cec5SDimitry Andricdef  VNEGhq   : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 1, 0,
61680b57cec5SDimitry Andric                    (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
61690b57cec5SDimitry Andric                    "vneg", "f16", "$Vd, $Vm", "",
61700b57cec5SDimitry Andric                    [(set QPR:$Vd, (v8f16 (fneg QPR:$Vm)))]>,
61710b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
61720b57cec5SDimitry Andric
61730b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
61740b57cec5SDimitry Andricdef : Pat<(v8i8  (vnegd  DPR:$src)), (VNEGs8d DPR:$src)>;
61750b57cec5SDimitry Andricdef : Pat<(v4i16 (vnegd  DPR:$src)), (VNEGs16d DPR:$src)>;
61760b57cec5SDimitry Andricdef : Pat<(v2i32 (vnegd  DPR:$src)), (VNEGs32d DPR:$src)>;
61770b57cec5SDimitry Andricdef : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
61780b57cec5SDimitry Andricdef : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
61790b57cec5SDimitry Andricdef : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
61800b57cec5SDimitry Andric}
61810b57cec5SDimitry Andric
61820b57cec5SDimitry Andric//   VQNEG    : Vector Saturating Negate
61830b57cec5SDimitry Andricdefm VQNEG    : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
61840b57cec5SDimitry Andric                           IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
61850b57cec5SDimitry Andric                           int_arm_neon_vqneg>;
61860b57cec5SDimitry Andric
61870b57cec5SDimitry Andric// Vector Bit Counting Operations.
61880b57cec5SDimitry Andric
61890b57cec5SDimitry Andric//   VCLS     : Vector Count Leading Sign Bits
61900b57cec5SDimitry Andricdefm VCLS     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
61910b57cec5SDimitry Andric                           IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
61920b57cec5SDimitry Andric                           int_arm_neon_vcls>;
61930b57cec5SDimitry Andric//   VCLZ     : Vector Count Leading Zeros
61940b57cec5SDimitry Andricdefm VCLZ     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
61950b57cec5SDimitry Andric                           IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
61960b57cec5SDimitry Andric                           ctlz>;
61970b57cec5SDimitry Andric//   VCNT     : Vector Count One Bits
61980b57cec5SDimitry Andricdef  VCNTd    : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
61990b57cec5SDimitry Andric                        IIC_VCNTiD, "vcnt", "8",
62000b57cec5SDimitry Andric                        v8i8, v8i8, ctpop>;
62010b57cec5SDimitry Andricdef  VCNTq    : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
62020b57cec5SDimitry Andric                        IIC_VCNTiQ, "vcnt", "8",
62030b57cec5SDimitry Andric                        v16i8, v16i8, ctpop>;
62040b57cec5SDimitry Andric
62050b57cec5SDimitry Andric// Vector Swap
62060b57cec5SDimitry Andricdef  VSWPd    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
62070b57cec5SDimitry Andric                     (outs DPR:$Vd, DPR:$Vm), (ins DPR:$in1, DPR:$in2),
62080b57cec5SDimitry Andric                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
62090b57cec5SDimitry Andric                     []>;
62100b57cec5SDimitry Andricdef  VSWPq    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
62110b57cec5SDimitry Andric                     (outs QPR:$Vd, QPR:$Vm), (ins QPR:$in1, QPR:$in2),
62120b57cec5SDimitry Andric                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
62130b57cec5SDimitry Andric                     []>;
62140b57cec5SDimitry Andric
62150b57cec5SDimitry Andric// Vector Move Operations.
62160b57cec5SDimitry Andric
62170b57cec5SDimitry Andric//   VMOV     : Vector Move (Register)
62180b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p} $Vd, $Vm",
62190b57cec5SDimitry Andric                    (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
62200b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p} $Vd, $Vm",
62210b57cec5SDimitry Andric                    (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
62220b57cec5SDimitry Andric
62230b57cec5SDimitry Andric//   VMOV     : Vector Move (Immediate)
62240b57cec5SDimitry Andric
62250b57cec5SDimitry Andric// Although VMOVs are not strictly speaking cheap, they are as expensive
62260b57cec5SDimitry Andric// as their copies counterpart (VORR), so we should prefer rematerialization
62270b57cec5SDimitry Andric// over splitting when it applies.
62280b57cec5SDimitry Andriclet isReMaterializable = 1, isAsCheapAsAMove=1 in {
62290b57cec5SDimitry Andricdef VMOVv8i8  : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
62300b57cec5SDimitry Andric                         (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
62310b57cec5SDimitry Andric                         "vmov", "i8", "$Vd, $SIMM", "",
62320b57cec5SDimitry Andric                         [(set DPR:$Vd, (v8i8 (ARMvmovImm timm:$SIMM)))]>;
62330b57cec5SDimitry Andricdef VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
62340b57cec5SDimitry Andric                         (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
62350b57cec5SDimitry Andric                         "vmov", "i8", "$Vd, $SIMM", "",
62360b57cec5SDimitry Andric                         [(set QPR:$Vd, (v16i8 (ARMvmovImm timm:$SIMM)))]>;
62370b57cec5SDimitry Andric
62380b57cec5SDimitry Andricdef VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
62390b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
62400b57cec5SDimitry Andric                         "vmov", "i16", "$Vd, $SIMM", "",
62410b57cec5SDimitry Andric                         [(set DPR:$Vd, (v4i16 (ARMvmovImm timm:$SIMM)))]> {
62420b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
62430b57cec5SDimitry Andric}
62440b57cec5SDimitry Andric
62450b57cec5SDimitry Andricdef VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
62460b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
62470b57cec5SDimitry Andric                         "vmov", "i16", "$Vd, $SIMM", "",
62480b57cec5SDimitry Andric                         [(set QPR:$Vd, (v8i16 (ARMvmovImm timm:$SIMM)))]> {
62490b57cec5SDimitry Andric let Inst{9} = SIMM{9};
62500b57cec5SDimitry Andric}
62510b57cec5SDimitry Andric
62520b57cec5SDimitry Andricdef VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
62530b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
62540b57cec5SDimitry Andric                         "vmov", "i32", "$Vd, $SIMM", "",
62550b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2i32 (ARMvmovImm timm:$SIMM)))]> {
62560b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
62570b57cec5SDimitry Andric}
62580b57cec5SDimitry Andric
62590b57cec5SDimitry Andricdef VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
62600b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
62610b57cec5SDimitry Andric                         "vmov", "i32", "$Vd, $SIMM", "",
62620b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4i32 (ARMvmovImm timm:$SIMM)))]> {
62630b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
62640b57cec5SDimitry Andric}
62650b57cec5SDimitry Andric
62660b57cec5SDimitry Andricdef VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
62670b57cec5SDimitry Andric                         (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
62680b57cec5SDimitry Andric                         "vmov", "i64", "$Vd, $SIMM", "",
62690b57cec5SDimitry Andric                         [(set DPR:$Vd, (v1i64 (ARMvmovImm timm:$SIMM)))]>;
62700b57cec5SDimitry Andricdef VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
62710b57cec5SDimitry Andric                         (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
62720b57cec5SDimitry Andric                         "vmov", "i64", "$Vd, $SIMM", "",
62730b57cec5SDimitry Andric                         [(set QPR:$Vd, (v2i64 (ARMvmovImm timm:$SIMM)))]>;
62740b57cec5SDimitry Andric
62750b57cec5SDimitry Andricdef VMOVv2f32 : N1ModImm<1, 0b000, 0b1111, 0, 0, 0, 1, (outs DPR:$Vd),
62760b57cec5SDimitry Andric                         (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
62770b57cec5SDimitry Andric                         "vmov", "f32", "$Vd, $SIMM", "",
62780b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2f32 (ARMvmovFPImm timm:$SIMM)))]>;
62790b57cec5SDimitry Andricdef VMOVv4f32 : N1ModImm<1, 0b000, 0b1111, 0, 1, 0, 1, (outs QPR:$Vd),
62800b57cec5SDimitry Andric                         (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
62810b57cec5SDimitry Andric                         "vmov", "f32", "$Vd, $SIMM", "",
62820b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4f32 (ARMvmovFPImm timm:$SIMM)))]>;
62830b57cec5SDimitry Andric} // isReMaterializable, isAsCheapAsAMove
62840b57cec5SDimitry Andric
62850b57cec5SDimitry Andric// Add support for bytes replication feature, so it could be GAS compatible.
62860b57cec5SDimitry Andricmulticlass NEONImmReplicateI8InstAlias<ValueType To> {
62870b57cec5SDimitry Andric  // E.g. instructions below:
62880b57cec5SDimitry Andric  // "vmov.i32 d0, #0xffffffff"
62890b57cec5SDimitry Andric  // "vmov.i32 d0, #0xabababab"
62900b57cec5SDimitry Andric  // "vmov.i16 d0, #0xabab"
62910b57cec5SDimitry Andric  // are incorrect, but we could deal with such cases.
62920b57cec5SDimitry Andric  // For last two instructions, for example, it should emit:
62930b57cec5SDimitry Andric  // "vmov.i8 d0, #0xab"
62940b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62950b57cec5SDimitry Andric                      (VMOVv8i8 DPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
62960b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62970b57cec5SDimitry Andric                      (VMOVv16i8 QPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
62980b57cec5SDimitry Andric  // Also add same support for VMVN instructions. So instruction:
62990b57cec5SDimitry Andric  // "vmvn.i32 d0, #0xabababab"
63000b57cec5SDimitry Andric  // actually means:
63010b57cec5SDimitry Andric  // "vmov.i8 d0, #0x54"
63020b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
63030b57cec5SDimitry Andric                      (VMOVv8i8 DPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
63040b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
63050b57cec5SDimitry Andric                      (VMOVv16i8 QPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
63060b57cec5SDimitry Andric}
63070b57cec5SDimitry Andric
63080b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i16>;
63090b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i32>;
63100b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i64>;
63110b57cec5SDimitry Andric
63120b57cec5SDimitry Andric// Similar to above for types other than i8, e.g.:
63130b57cec5SDimitry Andric// "vmov.i32 d0, #0xab00ab00" -> "vmov.i16 d0, #0xab00"
63140b57cec5SDimitry Andric// "vmvn.i64 q0, #0xab000000ab000000" -> "vmvn.i32 q0, #0xab000000"
63150b57cec5SDimitry Andric// In this case we do not canonicalize VMVN to VMOV
63160b57cec5SDimitry Andricmulticlass NEONImmReplicateInstAlias<ValueType From, NeonI V8, NeonI V16,
63170b57cec5SDimitry Andric                                     NeonI NV8, NeonI NV16, ValueType To> {
63180b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
63190b57cec5SDimitry Andric                      (V8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
63200b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
63210b57cec5SDimitry Andric                      (V16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
63220b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
63230b57cec5SDimitry Andric                      (NV8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
63240b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
63250b57cec5SDimitry Andric                      (NV16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
63260b57cec5SDimitry Andric}
63270b57cec5SDimitry Andric
63280b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
63290b57cec5SDimitry Andric                                      VMVNv4i16, VMVNv8i16, i32>;
63300b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
63310b57cec5SDimitry Andric                                      VMVNv4i16, VMVNv8i16, i64>;
63320b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i32, VMOVv2i32, VMOVv4i32,
63330b57cec5SDimitry Andric                                      VMVNv2i32, VMVNv4i32, i64>;
63340b57cec5SDimitry Andric// TODO: add "VMOV <-> VMVN" conversion for cases like
63350b57cec5SDimitry Andric// "vmov.i32 d0, #0xffaaffaa" -> "vmvn.i16 d0, #0x55"
63360b57cec5SDimitry Andric// "vmvn.i32 d0, #0xaaffaaff" -> "vmov.i16 d0, #0xff00"
63370b57cec5SDimitry Andric
63380b57cec5SDimitry Andric// On some CPUs the two instructions "vmov.i32 dD, #0" and "vmov.i32 qD, #0"
63390b57cec5SDimitry Andric// require zero cycles to execute so they should be used wherever possible for
63400b57cec5SDimitry Andric// setting a register to zero.
63410b57cec5SDimitry Andric
63420b57cec5SDimitry Andric// Even without these pseudo-insts we would probably end up with the correct
63430b57cec5SDimitry Andric// instruction, but we could not mark the general ones with "isAsCheapAsAMove"
63440b57cec5SDimitry Andric// since they are sometimes rather expensive (in general).
63450b57cec5SDimitry Andric
63460b57cec5SDimitry Andriclet AddedComplexity = 50, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
63470b57cec5SDimitry Andric  def VMOVD0 : ARMPseudoExpand<(outs DPR:$Vd), (ins), 4, IIC_VMOVImm,
6348e8d8bef9SDimitry Andric                               [(set DPR:$Vd, (v2i32 ARMimmAllZerosD))],
63490b57cec5SDimitry Andric                               (VMOVv2i32 DPR:$Vd, 0, (ops 14, zero_reg))>,
63500b57cec5SDimitry Andric               Requires<[HasZCZ]>;
63510b57cec5SDimitry Andric  def VMOVQ0 : ARMPseudoExpand<(outs QPR:$Vd), (ins), 4, IIC_VMOVImm,
6352e8d8bef9SDimitry Andric                               [(set QPR:$Vd, (v4i32 ARMimmAllZerosV))],
63530b57cec5SDimitry Andric                               (VMOVv4i32 QPR:$Vd, 0, (ops 14, zero_reg))>,
63540b57cec5SDimitry Andric               Requires<[HasZCZ]>;
63550b57cec5SDimitry Andric}
63560b57cec5SDimitry Andric
63570b57cec5SDimitry Andric//   VMOV     : Vector Get Lane (move scalar to ARM core register)
63580b57cec5SDimitry Andric
63590b57cec5SDimitry Andricdef VGETLNs8  : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
63600b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
63610b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "s8", "$R, $V$lane",
63620b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlanes (v8i8 DPR:$V),
63630b57cec5SDimitry Andric                                           imm:$lane))]> {
63640b57cec5SDimitry Andric  let Inst{21}  = lane{2};
63650b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
63660b57cec5SDimitry Andric}
63670b57cec5SDimitry Andricdef VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
63680b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
63690b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "s16", "$R, $V$lane",
63700b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlanes (v4i16 DPR:$V),
63710b57cec5SDimitry Andric                                           imm:$lane))]> {
63720b57cec5SDimitry Andric  let Inst{21} = lane{1};
63730b57cec5SDimitry Andric  let Inst{6}  = lane{0};
63740b57cec5SDimitry Andric}
63750b57cec5SDimitry Andricdef VGETLNu8  : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
63760b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
63770b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "u8", "$R, $V$lane",
63780b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlaneu (v8i8 DPR:$V),
63790b57cec5SDimitry Andric                                           imm:$lane))]> {
63800b57cec5SDimitry Andric  let Inst{21}  = lane{2};
63810b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
63820b57cec5SDimitry Andric}
63830b57cec5SDimitry Andricdef VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
63840b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
63850b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "u16", "$R, $V$lane",
63860b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlaneu (v4i16 DPR:$V),
63870b57cec5SDimitry Andric                                           imm:$lane))]> {
63880b57cec5SDimitry Andric  let Inst{21} = lane{1};
63890b57cec5SDimitry Andric  let Inst{6}  = lane{0};
63900b57cec5SDimitry Andric}
63910b57cec5SDimitry Andricdef VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
63920b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex32:$lane),
63930b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "32", "$R, $V$lane",
63940b57cec5SDimitry Andric                          [(set GPR:$R, (extractelt (v2i32 DPR:$V),
63950b57cec5SDimitry Andric                                           imm:$lane))]>,
63960b57cec5SDimitry Andric                Requires<[HasFPRegs, HasFastVGETLNi32]> {
63970b57cec5SDimitry Andric  let Inst{21} = lane{0};
63980b57cec5SDimitry Andric}
63995f757f3fSDimitry Andric// VGETLNi32 is also legal as just vmov r0,d0[0] without the .32 suffix
64005f757f3fSDimitry Andricdef : InstAlias<"vmov${p} $R, $V$lane",
64015f757f3fSDimitry Andric    (VGETLNi32 GPR:$R, DPR:$V, VectorIndex32:$lane, pred:$p), 0>,
64025f757f3fSDimitry Andric    Requires<VGETLNi32.Predicates>;
64030b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
64040b57cec5SDimitry Andric// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
64050b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v16i8 QPR:$src), imm:$lane),
64060b57cec5SDimitry Andric          (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
64070b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
64080b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
64090b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v8i16 QPR:$src), imm:$lane),
64100b57cec5SDimitry Andric          (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
64110b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
64120b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
64130b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v16i8 QPR:$src), imm:$lane),
64140b57cec5SDimitry Andric          (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
64150b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
64160b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
64170b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v8i16 QPR:$src), imm:$lane),
64180b57cec5SDimitry Andric          (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
64190b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
64200b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6421349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v8f16 QPR:$src), imm:$lane),
6422349cc55cSDimitry Andric          (VGETLNu16 (v4f16 (EXTRACT_SUBREG QPR:$src,
6423349cc55cSDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
6424349cc55cSDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6425349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v4f16 DPR:$src), imm:$lane),
6426349cc55cSDimitry Andric          (VGETLNu16 (v4f16 DPR:$src), imm:$lane)>;
6427349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v8bf16 QPR:$src), imm:$lane),
6428349cc55cSDimitry Andric          (VGETLNu16 (v4bf16 (EXTRACT_SUBREG QPR:$src,
6429349cc55cSDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
6430349cc55cSDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6431349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v4bf16 DPR:$src), imm:$lane),
6432349cc55cSDimitry Andric          (VGETLNu16 (v4bf16 DPR:$src), imm:$lane)>;
64330b57cec5SDimitry Andric}
64340b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
64350b57cec5SDimitry Andric          (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
64360b57cec5SDimitry Andric                             (DSubReg_i32_reg imm:$lane))),
64370b57cec5SDimitry Andric                     (SubReg_i32_lane imm:$lane))>,
64380b57cec5SDimitry Andric      Requires<[HasNEON, HasFastVGETLNi32]>;
64390b57cec5SDimitry Andricdef : Pat<(extractelt (v2i32 DPR:$src), imm:$lane),
64400b57cec5SDimitry Andric          (COPY_TO_REGCLASS
64410b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
64420b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
64430b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
64440b57cec5SDimitry Andric          (COPY_TO_REGCLASS
64450b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
64460b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
64470b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
64480b57cec5SDimitry Andricdef : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
64490b57cec5SDimitry Andric          (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
64500b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
64510b57cec5SDimitry Andricdef : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
64520b57cec5SDimitry Andric          (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
64530b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
64540b57cec5SDimitry Andric//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
64550b57cec5SDimitry Andric//          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
64560b57cec5SDimitry Andricdef : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
64570b57cec5SDimitry Andric          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
64580b57cec5SDimitry Andric}
64590b57cec5SDimitry Andric
64605ffd83dbSDimitry Andricmulticlass ExtractEltEvenF16<ValueType VT4, ValueType VT8> {
64615ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_even:$lane),
64620b57cec5SDimitry Andric              (EXTRACT_SUBREG
64635ffd83dbSDimitry Andric                  (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
64640b57cec5SDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
64655ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_even:$lane),
64665ffd83dbSDimitry Andric              (EXTRACT_SUBREG
64675ffd83dbSDimitry Andric                  (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
64685ffd83dbSDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
64695ffd83dbSDimitry Andric}
64700b57cec5SDimitry Andric
64715ffd83dbSDimitry Andricmulticlass ExtractEltOddF16VMOVH<ValueType VT4, ValueType VT8> {
64725ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_odd:$lane),
64730b57cec5SDimitry Andric            (COPY_TO_REGCLASS
64740b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
64755ffd83dbSDimitry Andric                        (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
64760b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
64770b57cec5SDimitry Andric              HPR)>;
64785ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_odd:$lane),
64790b57cec5SDimitry Andric            (COPY_TO_REGCLASS
64800b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
64815ffd83dbSDimitry Andric                        (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
64820b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
64830b57cec5SDimitry Andric              HPR)>;
64840b57cec5SDimitry Andric}
64850b57cec5SDimitry Andric
64865ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
64875ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4f16, v8f16>;
64885ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4f16, v8f16>;
64895ffd83dbSDimitry Andric}
64905ffd83dbSDimitry Andric
64915ffd83dbSDimitry Andriclet AddedComplexity = 1, Predicates = [HasNEON, HasBF16, HasFullFP16] in {
64925ffd83dbSDimitry Andric  // If VMOVH (vmovx.f16) is available use it to extract BF16 from the odd lanes
64935ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4bf16, v8bf16>;
64945ffd83dbSDimitry Andric}
64955ffd83dbSDimitry Andric
64965ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
64975ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4bf16, v8bf16>;
64985ffd83dbSDimitry Andric
64995ffd83dbSDimitry Andric  // Otherwise, if VMOVH is not available resort to extracting the odd lane
65005ffd83dbSDimitry Andric  // into a GPR and then moving to HPR
65015ffd83dbSDimitry Andric  def : Pat<(extractelt (v4bf16 DPR:$src), imm_odd:$lane),
65025ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
65035ffd83dbSDimitry Andric              (VGETLNu16 (v4bf16 DPR:$src), imm:$lane),
65045ffd83dbSDimitry Andric              HPR)>;
65055ffd83dbSDimitry Andric
65065ffd83dbSDimitry Andric  def : Pat<(extractelt (v8bf16 QPR:$src), imm_odd:$lane),
65075ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
65085ffd83dbSDimitry Andric              (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
65095ffd83dbSDimitry Andric                                                (DSubReg_i16_reg imm:$lane))),
65105ffd83dbSDimitry Andric                         (SubReg_i16_lane imm:$lane)),
65115ffd83dbSDimitry Andric              HPR)>;
65125ffd83dbSDimitry Andric}
65135ffd83dbSDimitry Andric
65140b57cec5SDimitry Andric//   VMOV     : Vector Set Lane (move ARM core register to scalar)
65150b57cec5SDimitry Andric
65160b57cec5SDimitry Andriclet Constraints = "$src1 = $V" in {
65170b57cec5SDimitry Andricdef VSETLNi8  : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
65180b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex8:$lane),
65190b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "8", "$V$lane, $R",
65200b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
65210b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
65220b57cec5SDimitry Andric  let Inst{21}  = lane{2};
65230b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
65240b57cec5SDimitry Andric}
65250b57cec5SDimitry Andricdef VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
65260b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex16:$lane),
65270b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "16", "$V$lane, $R",
65280b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
65290b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
65300b57cec5SDimitry Andric  let Inst{21} = lane{1};
65310b57cec5SDimitry Andric  let Inst{6}  = lane{0};
65320b57cec5SDimitry Andric}
65330b57cec5SDimitry Andricdef VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
65340b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex32:$lane),
65350b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "32", "$V$lane, $R",
65360b57cec5SDimitry Andric                          [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
65370b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]>,
65380b57cec5SDimitry Andric                Requires<[HasVFP2]> {
65390b57cec5SDimitry Andric  let Inst{21} = lane{0};
65400b57cec5SDimitry Andric  // This instruction is equivalent as
65410b57cec5SDimitry Andric  // $V = INSERT_SUBREG $src1, $R, translateImmToSubIdx($imm)
65420b57cec5SDimitry Andric  let isInsertSubreg = 1;
65430b57cec5SDimitry Andric}
65440b57cec5SDimitry Andric}
65455f757f3fSDimitry Andric// VSETLNi32 is also legal as just vmov d0[0],r0 without the .32 suffix
65465f757f3fSDimitry Andricdef : InstAlias<"vmov${p} $V$lane, $R",
65475f757f3fSDimitry Andric    (VSETLNi32 DPR:$V, GPR:$R, VectorIndex32:$lane, pred:$p), 0>,
65485f757f3fSDimitry Andric    Requires<VSETLNi32.Predicates>;
65490b57cec5SDimitry Andric
65505ffd83dbSDimitry Andric// TODO: for odd lanes we could optimize this a bit by using the VINS
65515ffd83dbSDimitry Andric// FullFP16 instruction when it is available
65525ffd83dbSDimitry Andricmulticlass InsertEltF16<ValueType VTScalar, ValueType VT4, ValueType VT8> {
65535ffd83dbSDimitry Andric  def : Pat<(insertelt (VT4 DPR:$src1), (VTScalar HPR:$src2), imm:$lane),
65545ffd83dbSDimitry Andric            (VT4 (VSETLNi16 DPR:$src1,
65555ffd83dbSDimitry Andric                 (COPY_TO_REGCLASS HPR:$src2, GPR), imm:$lane))>;
65565ffd83dbSDimitry Andric  def : Pat<(insertelt (VT8 QPR:$src1), (VTScalar HPR:$src2), imm:$lane),
65575ffd83dbSDimitry Andric            (VT8 (INSERT_SUBREG QPR:$src1,
65585ffd83dbSDimitry Andric                    (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
65595ffd83dbSDimitry Andric                                        (DSubReg_i16_reg imm:$lane))),
65605ffd83dbSDimitry Andric                              (COPY_TO_REGCLASS HPR:$src2, GPR),
65615ffd83dbSDimitry Andric                              (SubReg_i16_lane imm:$lane))),
65625ffd83dbSDimitry Andric                    (DSubReg_i16_reg imm:$lane)))>;
65635ffd83dbSDimitry Andric}
65645ffd83dbSDimitry Andric
65650b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
65660b57cec5SDimitry Andricdef : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
65670b57cec5SDimitry Andric          (v16i8 (INSERT_SUBREG QPR:$src1,
65680b57cec5SDimitry Andric                  (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
65690b57cec5SDimitry Andric                                   (DSubReg_i8_reg imm:$lane))),
65700b57cec5SDimitry Andric                            GPR:$src2, (SubReg_i8_lane imm:$lane))),
65710b57cec5SDimitry Andric                  (DSubReg_i8_reg imm:$lane)))>;
65720b57cec5SDimitry Andricdef : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
65730b57cec5SDimitry Andric          (v8i16 (INSERT_SUBREG QPR:$src1,
65740b57cec5SDimitry Andric                  (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
65750b57cec5SDimitry Andric                                     (DSubReg_i16_reg imm:$lane))),
65760b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i16_lane imm:$lane))),
65770b57cec5SDimitry Andric                  (DSubReg_i16_reg imm:$lane)))>;
65780b57cec5SDimitry Andricdef : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
65790b57cec5SDimitry Andric          (v4i32 (INSERT_SUBREG QPR:$src1,
65800b57cec5SDimitry Andric                  (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
65810b57cec5SDimitry Andric                                     (DSubReg_i32_reg imm:$lane))),
65820b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i32_lane imm:$lane))),
65830b57cec5SDimitry Andric                  (DSubReg_i32_reg imm:$lane)))>;
65840b57cec5SDimitry Andric
65850b57cec5SDimitry Andricdef : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
65860b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
65870b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
65880b57cec5SDimitry Andricdef : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
65890b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
65900b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
65910b57cec5SDimitry Andric
65925ffd83dbSDimitry Andricdefm : InsertEltF16<f16, v4f16, v8f16>;
65930b57cec5SDimitry Andric
65940b57cec5SDimitry Andricdef : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
65950b57cec5SDimitry Andric          (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
65960b57cec5SDimitry Andric
65970b57cec5SDimitry Andricdef : Pat<(v2f32 (scalar_to_vector SPR:$src)),
65980b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
65990b57cec5SDimitry Andricdef : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
66000b57cec5SDimitry Andric          (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
66010b57cec5SDimitry Andricdef : Pat<(v4f32 (scalar_to_vector SPR:$src)),
66020b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
66030b57cec5SDimitry Andric
6604fe6060f1SDimitry Andricdef : Pat<(v4f16 (scalar_to_vector (f16 HPR:$src))),
6605fe6060f1SDimitry Andric          (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6606fe6060f1SDimitry Andricdef : Pat<(v8f16 (scalar_to_vector (f16 HPR:$src))),
6607fe6060f1SDimitry Andric          (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6608fe6060f1SDimitry Andric
66090b57cec5SDimitry Andricdef : Pat<(v8i8 (scalar_to_vector GPR:$src)),
66100b57cec5SDimitry Andric          (VSETLNi8  (v8i8  (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66110b57cec5SDimitry Andricdef : Pat<(v4i16 (scalar_to_vector GPR:$src)),
66120b57cec5SDimitry Andric          (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66130b57cec5SDimitry Andricdef : Pat<(v2i32 (scalar_to_vector GPR:$src)),
66140b57cec5SDimitry Andric          (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66150b57cec5SDimitry Andric
66160b57cec5SDimitry Andricdef : Pat<(v16i8 (scalar_to_vector GPR:$src)),
66170b57cec5SDimitry Andric          (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
66180b57cec5SDimitry Andric                         (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66190b57cec5SDimitry Andric                         dsub_0)>;
66200b57cec5SDimitry Andricdef : Pat<(v8i16 (scalar_to_vector GPR:$src)),
66210b57cec5SDimitry Andric          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
66220b57cec5SDimitry Andric                         (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66230b57cec5SDimitry Andric                         dsub_0)>;
66240b57cec5SDimitry Andricdef : Pat<(v4i32 (scalar_to_vector GPR:$src)),
66250b57cec5SDimitry Andric          (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
66260b57cec5SDimitry Andric                         (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66270b57cec5SDimitry Andric                         dsub_0)>;
66280b57cec5SDimitry Andric}
66290b57cec5SDimitry Andric
66305ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in
66315ffd83dbSDimitry Andricdefm : InsertEltF16<bf16, v4bf16, v8bf16>;
66325ffd83dbSDimitry Andric
66330b57cec5SDimitry Andric//   VDUP     : Vector Duplicate (from ARM core register to all elements)
66340b57cec5SDimitry Andric
66350b57cec5SDimitry Andricclass VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
66360b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
66370b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
66380b57cec5SDimitry Andric          [(set DPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
66390b57cec5SDimitry Andricclass VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
66400b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
66410b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
66420b57cec5SDimitry Andric          [(set QPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
66430b57cec5SDimitry Andric
66440b57cec5SDimitry Andricdef  VDUP8d   : VDUPD<0b11101100, 0b00, "8", v8i8>;
66450b57cec5SDimitry Andricdef  VDUP16d  : VDUPD<0b11101000, 0b01, "16", v4i16>;
66460b57cec5SDimitry Andricdef  VDUP32d  : VDUPD<0b11101000, 0b00, "32", v2i32>,
66470b57cec5SDimitry Andric                Requires<[HasNEON, HasFastVDUP32]>;
66480b57cec5SDimitry Andricdef  VDUP8q   : VDUPQ<0b11101110, 0b00, "8", v16i8>;
66490b57cec5SDimitry Andricdef  VDUP16q  : VDUPQ<0b11101010, 0b01, "16", v8i16>;
66500b57cec5SDimitry Andricdef  VDUP32q  : VDUPQ<0b11101010, 0b00, "32", v4i32>;
66510b57cec5SDimitry Andric
66520b57cec5SDimitry Andric// ARMvdup patterns for uarchs with fast VDUP.32.
66530b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>,
66540b57cec5SDimitry Andric      Requires<[HasNEON,HasFastVDUP32]>;
66550b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>,
66560b57cec5SDimitry Andric      Requires<[HasNEON]>;
66570b57cec5SDimitry Andric
66580b57cec5SDimitry Andric// ARMvdup patterns for uarchs with slow VDUP.32 - use VMOVDRR instead.
66590b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvdup (i32 GPR:$R))), (VMOVDRR GPR:$R, GPR:$R)>,
66600b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
66610b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VMOVDRR GPR:$R, GPR:$R)>,
66620b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
66630b57cec5SDimitry Andric
66640b57cec5SDimitry Andric//   VDUP     : Vector Duplicate Lane (from scalar to all elements)
66650b57cec5SDimitry Andric
66660b57cec5SDimitry Andricclass VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
66670b57cec5SDimitry Andric              ValueType Ty, Operand IdxTy>
66680b57cec5SDimitry Andric  : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
66690b57cec5SDimitry Andric              IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm$lane",
66700b57cec5SDimitry Andric              [(set DPR:$Vd, (Ty (ARMvduplane (Ty DPR:$Vm), imm:$lane)))]>;
66710b57cec5SDimitry Andric
66720b57cec5SDimitry Andricclass VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
66730b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, Operand IdxTy>
66740b57cec5SDimitry Andric  : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
66750b57cec5SDimitry Andric              IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm$lane",
66760b57cec5SDimitry Andric              [(set QPR:$Vd, (ResTy (ARMvduplane (OpTy DPR:$Vm),
66770b57cec5SDimitry Andric                                      VectorIndex32:$lane)))]>;
66780b57cec5SDimitry Andric
66790b57cec5SDimitry Andric// Inst{19-16} is partially specified depending on the element size.
66800b57cec5SDimitry Andric
66810b57cec5SDimitry Andricdef VDUPLN8d  : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8, VectorIndex8> {
66820b57cec5SDimitry Andric  bits<3> lane;
66830b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
66840b57cec5SDimitry Andric}
66850b57cec5SDimitry Andricdef VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16, VectorIndex16> {
66860b57cec5SDimitry Andric  bits<2> lane;
66870b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
66880b57cec5SDimitry Andric}
66890b57cec5SDimitry Andricdef VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32, VectorIndex32> {
66900b57cec5SDimitry Andric  bits<1> lane;
66910b57cec5SDimitry Andric  let Inst{19} = lane{0};
66920b57cec5SDimitry Andric}
66930b57cec5SDimitry Andricdef VDUPLN8q  : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8, VectorIndex8> {
66940b57cec5SDimitry Andric  bits<3> lane;
66950b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
66960b57cec5SDimitry Andric}
66970b57cec5SDimitry Andricdef VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16, VectorIndex16> {
66980b57cec5SDimitry Andric  bits<2> lane;
66990b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
67000b57cec5SDimitry Andric}
67010b57cec5SDimitry Andricdef VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32, VectorIndex32> {
67020b57cec5SDimitry Andric  bits<1> lane;
67030b57cec5SDimitry Andric  let Inst{19} = lane{0};
67040b57cec5SDimitry Andric}
67050b57cec5SDimitry Andric
67060b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
67070b57cec5SDimitry Andricdef : Pat<(v4f16 (ARMvduplane (v4f16 DPR:$Vm), imm:$lane)),
6708bdd1243dSDimitry Andric          (VDUPLN16d DPR:$Vm, imm:$lane)>;
67090b57cec5SDimitry Andric
67100b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
67110b57cec5SDimitry Andric          (VDUPLN32d DPR:$Vm, imm:$lane)>;
67120b57cec5SDimitry Andric
67130b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
67140b57cec5SDimitry Andric          (VDUPLN32q DPR:$Vm, imm:$lane)>;
67150b57cec5SDimitry Andric
67160b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvduplane (v16i8 QPR:$src), imm:$lane)),
67170b57cec5SDimitry Andric          (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
67180b57cec5SDimitry Andric                                  (DSubReg_i8_reg imm:$lane))),
67190b57cec5SDimitry Andric                           (SubReg_i8_lane imm:$lane)))>;
67200b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvduplane (v8i16 QPR:$src), imm:$lane)),
67210b57cec5SDimitry Andric          (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
67220b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67230b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67240b57cec5SDimitry Andricdef : Pat<(v8f16 (ARMvduplane (v8f16 QPR:$src), imm:$lane)),
67250b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (v4f16 (EXTRACT_SUBREG QPR:$src,
67260b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67270b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67280b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvduplane (v4i32 QPR:$src), imm:$lane)),
67290b57cec5SDimitry Andric          (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
67300b57cec5SDimitry Andric                                    (DSubReg_i32_reg imm:$lane))),
67310b57cec5SDimitry Andric                            (SubReg_i32_lane imm:$lane)))>;
67320b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v4f32 QPR:$src), imm:$lane)),
67330b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
67340b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
67350b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
67360b57cec5SDimitry Andric
67375ffd83dbSDimitry Andricdef : Pat<(v4f16 (ARMvdup (f16 HPR:$src))),
67380b57cec5SDimitry Andric          (v4f16 (VDUPLN16d (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
67395ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
67400b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 SPR:$src))),
67410b57cec5SDimitry Andric          (v2f32 (VDUPLN32d (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
67420b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
67430b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 SPR:$src))),
67440b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
67450b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
67465ffd83dbSDimitry Andricdef : Pat<(v8f16 (ARMvdup (f16 HPR:$src))),
67470b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
67485ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
67495ffd83dbSDimitry Andric}
67505ffd83dbSDimitry Andric
67515ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in {
67525ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvduplane (v4bf16 DPR:$Vm), imm:$lane)),
67535ffd83dbSDimitry Andric          (VDUPLN16d DPR:$Vm, imm:$lane)>;
67545ffd83dbSDimitry Andric
67555ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvduplane (v8bf16 QPR:$src), imm:$lane)),
67565ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (v4bf16 (EXTRACT_SUBREG QPR:$src,
67575ffd83dbSDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67585ffd83dbSDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67595ffd83dbSDimitry Andric
67605ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvdup (bf16 HPR:$src))),
67615ffd83dbSDimitry Andric          (v4bf16 (VDUPLN16d (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
67625ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
67635ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvdup (bf16 HPR:$src))),
67645ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
67655ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
67660b57cec5SDimitry Andric}
67670b57cec5SDimitry Andric
67680b57cec5SDimitry Andric//   VMOVN    : Vector Narrowing Move
67690b57cec5SDimitry Andricdefm VMOVN    : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
67700b57cec5SDimitry Andric                         "vmovn", "i", trunc>;
67710b57cec5SDimitry Andric//   VQMOVN   : Vector Saturating Narrowing Move
67720b57cec5SDimitry Andricdefm VQMOVNs  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
67730b57cec5SDimitry Andric                            "vqmovn", "s", int_arm_neon_vqmovns>;
67740b57cec5SDimitry Andricdefm VQMOVNu  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
67750b57cec5SDimitry Andric                            "vqmovn", "u", int_arm_neon_vqmovnu>;
67760b57cec5SDimitry Andricdefm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
67770b57cec5SDimitry Andric                            "vqmovun", "s", int_arm_neon_vqmovnsu>;
67780b57cec5SDimitry Andric//   VMOVL    : Vector Lengthening Move
67790b57cec5SDimitry Andricdefm VMOVLs   : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
67800b57cec5SDimitry Andricdefm VMOVLu   : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
67810b57cec5SDimitry Andric
67820b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
67830b57cec5SDimitry Andricdef : Pat<(v8i16 (anyext (v8i8 DPR:$Vm))), (VMOVLuv8i16 DPR:$Vm)>;
67840b57cec5SDimitry Andricdef : Pat<(v4i32 (anyext (v4i16 DPR:$Vm))), (VMOVLuv4i32 DPR:$Vm)>;
67850b57cec5SDimitry Andricdef : Pat<(v2i64 (anyext (v2i32 DPR:$Vm))), (VMOVLuv2i64 DPR:$Vm)>;
67860b57cec5SDimitry Andric}
67870b57cec5SDimitry Andric
67880b57cec5SDimitry Andric// Vector Conversions.
67890b57cec5SDimitry Andric
67900b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Integers
67910b57cec5SDimitry Andricdef  VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
67920b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_sint>;
67930b57cec5SDimitry Andricdef  VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
67940b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_uint>;
67950b57cec5SDimitry Andricdef  VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
67960b57cec5SDimitry Andric                     v2f32, v2i32, sint_to_fp>;
67970b57cec5SDimitry Andricdef  VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
67980b57cec5SDimitry Andric                     v2f32, v2i32, uint_to_fp>;
67990b57cec5SDimitry Andric
68000b57cec5SDimitry Andricdef  VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
68010b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_sint>;
68020b57cec5SDimitry Andricdef  VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
68030b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_uint>;
68040b57cec5SDimitry Andricdef  VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
68050b57cec5SDimitry Andric                     v4f32, v4i32, sint_to_fp>;
68060b57cec5SDimitry Andricdef  VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
68070b57cec5SDimitry Andric                     v4f32, v4i32, uint_to_fp>;
68080b57cec5SDimitry Andric
68090b57cec5SDimitry Andricdef  VCVTh2sd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
68100b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_sint>,
68110b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68120b57cec5SDimitry Andricdef  VCVTh2ud : N2VD<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
68130b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_uint>,
68140b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68150b57cec5SDimitry Andricdef  VCVTs2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
68160b57cec5SDimitry Andric                     v4f16, v4i16, sint_to_fp>,
68170b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68180b57cec5SDimitry Andricdef  VCVTu2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
68190b57cec5SDimitry Andric                     v4f16, v4i16, uint_to_fp>,
68200b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68210b57cec5SDimitry Andric
68220b57cec5SDimitry Andricdef  VCVTh2sq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
68230b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_sint>,
68240b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68250b57cec5SDimitry Andricdef  VCVTh2uq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
68260b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_uint>,
68270b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68280b57cec5SDimitry Andricdef  VCVTs2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
68290b57cec5SDimitry Andric                     v8f16, v8i16, sint_to_fp>,
68300b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68310b57cec5SDimitry Andricdef  VCVTu2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
68320b57cec5SDimitry Andric                     v8f16, v8i16, uint_to_fp>,
68330b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68340b57cec5SDimitry Andric
68350b57cec5SDimitry Andric// VCVT{A, N, P, M}
68360b57cec5SDimitry Andricmulticlass VCVT_FPI<string op, bits<3> op10_8, SDPatternOperator IntS,
68370b57cec5SDimitry Andric                    SDPatternOperator IntU> {
68380b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
68390b57cec5SDimitry Andric    def SDf : N2VDIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68400b57cec5SDimitry Andric                       "s32.f32", v2i32, v2f32, IntS>, Requires<[HasV8, HasNEON]>;
68410b57cec5SDimitry Andric    def SQf : N2VQIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68420b57cec5SDimitry Andric                       "s32.f32", v4i32, v4f32, IntS>, Requires<[HasV8, HasNEON]>;
68430b57cec5SDimitry Andric    def UDf : N2VDIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68440b57cec5SDimitry Andric                       "u32.f32", v2i32, v2f32, IntU>, Requires<[HasV8, HasNEON]>;
68450b57cec5SDimitry Andric    def UQf : N2VQIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68460b57cec5SDimitry Andric                       "u32.f32", v4i32, v4f32, IntU>, Requires<[HasV8, HasNEON]>;
68470b57cec5SDimitry Andric    def SDh : N2VDIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68480b57cec5SDimitry Andric                       "s16.f16", v4i16, v4f16, IntS>,
68490b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68500b57cec5SDimitry Andric    def SQh : N2VQIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68510b57cec5SDimitry Andric                       "s16.f16", v8i16, v8f16, IntS>,
68520b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68530b57cec5SDimitry Andric    def UDh : N2VDIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68540b57cec5SDimitry Andric                       "u16.f16", v4i16, v4f16, IntU>,
68550b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68560b57cec5SDimitry Andric    def UQh : N2VQIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68570b57cec5SDimitry Andric                       "u16.f16", v8i16, v8f16, IntU>,
68580b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68590b57cec5SDimitry Andric  }
68600b57cec5SDimitry Andric}
68610b57cec5SDimitry Andric
68620b57cec5SDimitry Andricdefm VCVTAN : VCVT_FPI<"a", 0b000, int_arm_neon_vcvtas, int_arm_neon_vcvtau>;
68630b57cec5SDimitry Andricdefm VCVTNN : VCVT_FPI<"n", 0b001, int_arm_neon_vcvtns, int_arm_neon_vcvtnu>;
68640b57cec5SDimitry Andricdefm VCVTPN : VCVT_FPI<"p", 0b010, int_arm_neon_vcvtps, int_arm_neon_vcvtpu>;
68650b57cec5SDimitry Andricdefm VCVTMN : VCVT_FPI<"m", 0b011, int_arm_neon_vcvtms, int_arm_neon_vcvtmu>;
68660b57cec5SDimitry Andric
68670b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Fixed-Point.
68680b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTD" in {
68690b57cec5SDimitry Andricdef VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
68700b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
68710b57cec5SDimitry Andricdef VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
68720b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
68730b57cec5SDimitry Andricdef VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
68740b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
68750b57cec5SDimitry Andricdef VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
68760b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
68770b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
68780b57cec5SDimitry Andricdef VCVTh2xsd : N2VCvtD<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
68790b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxs>;
68800b57cec5SDimitry Andricdef VCVTh2xud : N2VCvtD<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
68810b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxu>;
68820b57cec5SDimitry Andricdef VCVTxs2hd : N2VCvtD<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
68830b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxs2fp>;
68840b57cec5SDimitry Andricdef VCVTxu2hd : N2VCvtD<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
68850b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxu2fp>;
68860b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
68870b57cec5SDimitry Andric}
68880b57cec5SDimitry Andric
68890b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTQ" in {
68900b57cec5SDimitry Andricdef VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
68910b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
68920b57cec5SDimitry Andricdef VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
68930b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
68940b57cec5SDimitry Andricdef VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
68950b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
68960b57cec5SDimitry Andricdef VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
68970b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
68980b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
68990b57cec5SDimitry Andricdef VCVTh2xsq : N2VCvtQ<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
69000b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxs>;
69010b57cec5SDimitry Andricdef VCVTh2xuq : N2VCvtQ<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
69020b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxu>;
69030b57cec5SDimitry Andricdef VCVTxs2hq : N2VCvtQ<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
69040b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxs2fp>;
69050b57cec5SDimitry Andricdef VCVTxu2hq : N2VCvtQ<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
69060b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxu2fp>;
69070b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
69080b57cec5SDimitry Andric}
69090b57cec5SDimitry Andric
69100b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Dd, $Dm, #0",
69110b57cec5SDimitry Andric                    (VCVTf2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
69120b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Dd, $Dm, #0",
69130b57cec5SDimitry Andric                    (VCVTf2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
69140b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Dd, $Dm, #0",
69150b57cec5SDimitry Andric                    (VCVTs2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
69160b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Dd, $Dm, #0",
69170b57cec5SDimitry Andric                    (VCVTu2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
69180b57cec5SDimitry Andric
69190b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Qd, $Qm, #0",
69200b57cec5SDimitry Andric                    (VCVTf2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
69210b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Qd, $Qm, #0",
69220b57cec5SDimitry Andric                    (VCVTf2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
69230b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Qd, $Qm, #0",
69240b57cec5SDimitry Andric                    (VCVTs2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
69250b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Qd, $Qm, #0",
69260b57cec5SDimitry Andric                    (VCVTu2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
69270b57cec5SDimitry Andric
69280b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Dd, $Dm, #0",
69290b57cec5SDimitry Andric                    (VCVTh2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
69300b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Dd, $Dm, #0",
69310b57cec5SDimitry Andric                    (VCVTh2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
69320b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Dd, $Dm, #0",
69330b57cec5SDimitry Andric                    (VCVTs2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
69340b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Dd, $Dm, #0",
69350b57cec5SDimitry Andric                    (VCVTu2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
69360b57cec5SDimitry Andric
69370b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Qd, $Qm, #0",
69380b57cec5SDimitry Andric                    (VCVTh2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
69390b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Qd, $Qm, #0",
69400b57cec5SDimitry Andric                    (VCVTh2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
69410b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Qd, $Qm, #0",
69420b57cec5SDimitry Andric                    (VCVTs2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
69430b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Qd, $Qm, #0",
69440b57cec5SDimitry Andric                    (VCVTu2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
69450b57cec5SDimitry Andric
69460b57cec5SDimitry Andric
69470b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Half-Precision and Single-Precision.
69480b57cec5SDimitry Andricdef  VCVTf2h  : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
69490b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f16.f32",
69500b57cec5SDimitry Andric                        v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
69510b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
69520b57cec5SDimitry Andricdef  VCVTh2f  : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
69530b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f32.f16",
69540b57cec5SDimitry Andric                        v4f32, v4i16, int_arm_neon_vcvthf2fp>,
69550b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
69560b57cec5SDimitry Andric
695781ad6265SDimitry Andricdef : Pat<(v4f16 (fpround (v4f32 QPR:$src))), (VCVTf2h QPR:$src)>;
695881ad6265SDimitry Andricdef : Pat<(v4f32 (fpextend (v4f16 DPR:$src))), (VCVTh2f DPR:$src)>;
695981ad6265SDimitry Andric
69600b57cec5SDimitry Andric// Vector Reverse.
69610b57cec5SDimitry Andric
69620b57cec5SDimitry Andric//   VREV64   : Vector Reverse elements within 64-bit doublewords
69630b57cec5SDimitry Andric
69640b57cec5SDimitry Andricclass VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69650b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
69660b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
69670b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69680b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev64 (Ty DPR:$Vm))))]>;
69690b57cec5SDimitry Andricclass VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69700b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
69710b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
69720b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69730b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev64 (Ty QPR:$Vm))))]>;
69740b57cec5SDimitry Andric
69750b57cec5SDimitry Andricdef VREV64d8  : VREV64D<0b00, "vrev64", "8", v8i8>;
69760b57cec5SDimitry Andricdef VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
69770b57cec5SDimitry Andricdef VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
69780b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
69790b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
69800b57cec5SDimitry Andric}
69810b57cec5SDimitry Andric
69820b57cec5SDimitry Andricdef VREV64q8  : VREV64Q<0b00, "vrev64", "8", v16i8>;
69830b57cec5SDimitry Andricdef VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
69840b57cec5SDimitry Andricdef VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
69850b57cec5SDimitry Andric
69860b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
6987480093f4SDimitry Andric  def : Pat<(v4f32 (ARMvrev64 (v4f32 QPR:$Vm))),
6988480093f4SDimitry Andric            (VREV64q32 QPR:$Vm)>;
6989480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev64 (v8f16 QPR:$Vm))),
6990480093f4SDimitry Andric            (VREV64q16 QPR:$Vm)>;
6991480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev64 (v4f16 DPR:$Vm))),
6992480093f4SDimitry Andric            (VREV64d16 DPR:$Vm)>;
6993bdd1243dSDimitry Andric  def : Pat<(v8bf16 (ARMvrev64 (v8bf16 QPR:$Vm))),
6994bdd1243dSDimitry Andric            (VREV64q16 QPR:$Vm)>;
6995bdd1243dSDimitry Andric  def : Pat<(v4bf16 (ARMvrev64 (v4bf16 DPR:$Vm))),
6996bdd1243dSDimitry Andric            (VREV64d16 DPR:$Vm)>;
69970b57cec5SDimitry Andric}
69980b57cec5SDimitry Andric
69990b57cec5SDimitry Andric//   VREV32   : Vector Reverse elements within 32-bit words
70000b57cec5SDimitry Andric
70010b57cec5SDimitry Andricclass VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70020b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
70030b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
70040b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70050b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev32 (Ty DPR:$Vm))))]>;
70060b57cec5SDimitry Andricclass VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70070b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
70080b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
70090b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70100b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev32 (Ty QPR:$Vm))))]>;
70110b57cec5SDimitry Andric
70120b57cec5SDimitry Andricdef VREV32d8  : VREV32D<0b00, "vrev32", "8", v8i8>;
70130b57cec5SDimitry Andricdef VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
70140b57cec5SDimitry Andric
70150b57cec5SDimitry Andricdef VREV32q8  : VREV32Q<0b00, "vrev32", "8", v16i8>;
70160b57cec5SDimitry Andricdef VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
70170b57cec5SDimitry Andric
7018480093f4SDimitry Andriclet Predicates = [HasNEON] in {
7019480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev32 (v8f16 QPR:$Vm))),
7020480093f4SDimitry Andric            (VREV32q16 QPR:$Vm)>;
7021480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev32 (v4f16 DPR:$Vm))),
7022480093f4SDimitry Andric            (VREV32d16 DPR:$Vm)>;
7023bdd1243dSDimitry Andric  def : Pat<(v8bf16 (ARMvrev32 (v8bf16 QPR:$Vm))),
7024bdd1243dSDimitry Andric            (VREV32q16 QPR:$Vm)>;
7025bdd1243dSDimitry Andric  def : Pat<(v4bf16 (ARMvrev32 (v4bf16 DPR:$Vm))),
7026bdd1243dSDimitry Andric            (VREV32d16 DPR:$Vm)>;
7027480093f4SDimitry Andric}
7028480093f4SDimitry Andric
70290b57cec5SDimitry Andric//   VREV16   : Vector Reverse elements within 16-bit halfwords
70300b57cec5SDimitry Andric
70310b57cec5SDimitry Andricclass VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70320b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
70330b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
70340b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70350b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev16 (Ty DPR:$Vm))))]>;
70360b57cec5SDimitry Andricclass VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70370b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
70380b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
70390b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70400b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev16 (Ty QPR:$Vm))))]>;
70410b57cec5SDimitry Andric
70420b57cec5SDimitry Andricdef VREV16d8  : VREV16D<0b00, "vrev16", "8", v8i8>;
70430b57cec5SDimitry Andricdef VREV16q8  : VREV16Q<0b00, "vrev16", "8", v16i8>;
70440b57cec5SDimitry Andric
70450b57cec5SDimitry Andric// Other Vector Shuffles.
70460b57cec5SDimitry Andric
70470b57cec5SDimitry Andric//  Aligned extractions: really just dropping registers
70480b57cec5SDimitry Andric
70490b57cec5SDimitry Andricclass AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
70500b57cec5SDimitry Andric      : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
70510b57cec5SDimitry Andric             (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>,
70520b57cec5SDimitry Andric        Requires<[HasNEON]>;
70530b57cec5SDimitry Andric
70540b57cec5SDimitry Andricdef : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
70550b57cec5SDimitry Andricdef : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
70560b57cec5SDimitry Andricdef : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
70570b57cec5SDimitry Andricdef : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
70580b57cec5SDimitry Andricdef : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
7059bdd1243dSDimitry Andricdef : AlignedVEXTq<v4f16, v8f16, DSubReg_i16_reg>;
7060bdd1243dSDimitry Andricdef : AlignedVEXTq<v4bf16, v8bf16, DSubReg_i16_reg>;
70610b57cec5SDimitry Andric
70620b57cec5SDimitry Andric
70630b57cec5SDimitry Andric//   VEXT     : Vector Extract
70640b57cec5SDimitry Andric
70650b57cec5SDimitry Andric// All of these have a two-operand InstAlias.
70660b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
70670b57cec5SDimitry Andricclass VEXTd<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
70680b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
70690b57cec5SDimitry Andric        (ins DPR:$Vn, DPR:$Vm, immTy:$index), NVExtFrm,
70700b57cec5SDimitry Andric        IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
70710b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
70720b57cec5SDimitry Andric                                     (Ty DPR:$Vm), imm:$index)))]> {
70730b57cec5SDimitry Andric  bits<3> index;
70740b57cec5SDimitry Andric  let Inst{11} = 0b0;
70750b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
70760b57cec5SDimitry Andric}
70770b57cec5SDimitry Andric
70780b57cec5SDimitry Andricclass VEXTq<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
70790b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
7080349cc55cSDimitry Andric        (ins QPR:$Vn, QPR:$Vm, immTy:$index), NVExtFrm,
70810b57cec5SDimitry Andric        IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
70820b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
70830b57cec5SDimitry Andric                                     (Ty QPR:$Vm), imm:$index)))]> {
70840b57cec5SDimitry Andric  bits<4> index;
70850b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
70860b57cec5SDimitry Andric}
70870b57cec5SDimitry Andric}
70880b57cec5SDimitry Andric
70890b57cec5SDimitry Andricdef VEXTd8  : VEXTd<"vext", "8",  v8i8, imm0_7> {
70900b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
70910b57cec5SDimitry Andric}
70920b57cec5SDimitry Andricdef VEXTd16 : VEXTd<"vext", "16", v4i16, imm0_3> {
70930b57cec5SDimitry Andric  let Inst{10-9} = index{1-0};
70940b57cec5SDimitry Andric  let Inst{8}    = 0b0;
70950b57cec5SDimitry Andric}
70960b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
70970b57cec5SDimitry Andricdef : Pat<(v4f16 (NEONvext (v4f16 DPR:$Vn), (v4f16 DPR:$Vm), (i32 imm:$index))),
70980b57cec5SDimitry Andric          (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
7099bdd1243dSDimitry Andricdef : Pat<(v4bf16 (NEONvext (v4bf16 DPR:$Vn), (v4bf16 DPR:$Vm), (i32 imm:$index))),
7100bdd1243dSDimitry Andric          (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
71010b57cec5SDimitry Andric}
71020b57cec5SDimitry Andric
71030b57cec5SDimitry Andricdef VEXTd32 : VEXTd<"vext", "32", v2i32, imm0_1> {
71040b57cec5SDimitry Andric  let Inst{10}     = index{0};
71050b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
71060b57cec5SDimitry Andric}
71070b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71080b57cec5SDimitry Andricdef : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn), (v2f32 DPR:$Vm), (i32 imm:$index))),
71090b57cec5SDimitry Andric          (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
71100b57cec5SDimitry Andric}
71110b57cec5SDimitry Andric
71120b57cec5SDimitry Andricdef VEXTq8  : VEXTq<"vext", "8",  v16i8, imm0_15> {
71130b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
71140b57cec5SDimitry Andric}
71150b57cec5SDimitry Andricdef VEXTq16 : VEXTq<"vext", "16", v8i16, imm0_7> {
71160b57cec5SDimitry Andric  let Inst{11-9} = index{2-0};
71170b57cec5SDimitry Andric  let Inst{8}    = 0b0;
71180b57cec5SDimitry Andric}
71190b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71200b57cec5SDimitry Andricdef : Pat<(v8f16 (NEONvext (v8f16 QPR:$Vn), (v8f16 QPR:$Vm), (i32 imm:$index))),
71210b57cec5SDimitry Andric          (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
7122bdd1243dSDimitry Andricdef : Pat<(v8bf16 (NEONvext (v8bf16 QPR:$Vn), (v8bf16 QPR:$Vm), (i32 imm:$index))),
7123bdd1243dSDimitry Andric          (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
71240b57cec5SDimitry Andric}
71250b57cec5SDimitry Andric
71260b57cec5SDimitry Andricdef VEXTq32 : VEXTq<"vext", "32", v4i32, imm0_3> {
71270b57cec5SDimitry Andric  let Inst{11-10} = index{1-0};
71280b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
71290b57cec5SDimitry Andric}
71300b57cec5SDimitry Andricdef VEXTq64 : VEXTq<"vext", "64", v2i64, imm0_1> {
71310b57cec5SDimitry Andric  let Inst{11} = index{0};
71320b57cec5SDimitry Andric  let Inst{10-8}    = 0b000;
71330b57cec5SDimitry Andric}
71340b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71350b57cec5SDimitry Andricdef : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn), (v4f32 QPR:$Vm), (i32 imm:$index))),
71360b57cec5SDimitry Andric          (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
71370b57cec5SDimitry Andric}
71380b57cec5SDimitry Andric
71390b57cec5SDimitry Andric//   VTRN     : Vector Transpose
71400b57cec5SDimitry Andric
71410b57cec5SDimitry Andricdef  VTRNd8   : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
71420b57cec5SDimitry Andricdef  VTRNd16  : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
71430b57cec5SDimitry Andricdef  VTRNd32  : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
71440b57cec5SDimitry Andric
71450b57cec5SDimitry Andricdef  VTRNq8   : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
71460b57cec5SDimitry Andricdef  VTRNq16  : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
71470b57cec5SDimitry Andricdef  VTRNq32  : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
71480b57cec5SDimitry Andric
71490b57cec5SDimitry Andric//   VUZP     : Vector Unzip (Deinterleave)
71500b57cec5SDimitry Andric
71510b57cec5SDimitry Andricdef  VUZPd8   : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
71520b57cec5SDimitry Andricdef  VUZPd16  : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
71530b57cec5SDimitry Andric// vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
71540b57cec5SDimitry Andricdef : NEONInstAlias<"vuzp${p}.32 $Dd, $Dm",
71550b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
71560b57cec5SDimitry Andric
71570b57cec5SDimitry Andricdef  VUZPq8   : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
71580b57cec5SDimitry Andricdef  VUZPq16  : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
71590b57cec5SDimitry Andricdef  VUZPq32  : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
71600b57cec5SDimitry Andric
71610b57cec5SDimitry Andric//   VZIP     : Vector Zip (Interleave)
71620b57cec5SDimitry Andric
71630b57cec5SDimitry Andricdef  VZIPd8   : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
71640b57cec5SDimitry Andricdef  VZIPd16  : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
71650b57cec5SDimitry Andric// vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
71660b57cec5SDimitry Andricdef : NEONInstAlias<"vzip${p}.32 $Dd, $Dm",
71670b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
71680b57cec5SDimitry Andric
71690b57cec5SDimitry Andricdef  VZIPq8   : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
71700b57cec5SDimitry Andricdef  VZIPq16  : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
71710b57cec5SDimitry Andricdef  VZIPq32  : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
71720b57cec5SDimitry Andric
71730b57cec5SDimitry Andric// Vector Table Lookup and Table Extension.
71740b57cec5SDimitry Andric
71750b57cec5SDimitry Andric//   VTBL     : Vector Table Lookup
71760b57cec5SDimitry Andriclet DecoderMethod = "DecodeTBLInstruction" in {
71770b57cec5SDimitry Andricdef  VTBL1
71780b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
71790b57cec5SDimitry Andric        (ins VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
71800b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "",
71810b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (NEONvtbl1 VecListOneD:$Vn, DPR:$Vm)))]>;
71820b57cec5SDimitry Andric
71830b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
71840b57cec5SDimitry Andricdef  VTBL2
71850b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
71860b57cec5SDimitry Andric        (ins VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB2,
71870b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71880b57cec5SDimitry Andricdef  VTBL3
71890b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
71900b57cec5SDimitry Andric        (ins VecListThreeD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB3,
71910b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71920b57cec5SDimitry Andricdef  VTBL4
71930b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
71940b57cec5SDimitry Andric        (ins VecListFourD:$Vn, DPR:$Vm),
71950b57cec5SDimitry Andric        NVTBLFrm, IIC_VTB4,
71960b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71970b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
71980b57cec5SDimitry Andric
71990b57cec5SDimitry Andricdef  VTBL3Pseudo
72000b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
72010b57cec5SDimitry Andricdef  VTBL4Pseudo
72020b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
72030b57cec5SDimitry Andric
72040b57cec5SDimitry Andric//   VTBX     : Vector Table Extension
72050b57cec5SDimitry Andricdef  VTBX1
72060b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
72070b57cec5SDimitry Andric        (ins DPR:$orig, VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
72080b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd",
72090b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
72100b57cec5SDimitry Andric                               DPR:$orig, VecListOneD:$Vn, DPR:$Vm)))]>;
72110b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
72120b57cec5SDimitry Andricdef  VTBX2
72130b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
72140b57cec5SDimitry Andric        (ins DPR:$orig, VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
72150b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd", []>;
72160b57cec5SDimitry Andricdef  VTBX3
72170b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
72180b57cec5SDimitry Andric        (ins DPR:$orig, VecListThreeD:$Vn, DPR:$Vm),
72190b57cec5SDimitry Andric        NVTBLFrm, IIC_VTBX3,
72200b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
72210b57cec5SDimitry Andric        "$orig = $Vd", []>;
72220b57cec5SDimitry Andricdef  VTBX4
72230b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd),
72240b57cec5SDimitry Andric        (ins DPR:$orig, VecListFourD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
72250b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
72260b57cec5SDimitry Andric        "$orig = $Vd", []>;
72270b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
72280b57cec5SDimitry Andric
72290b57cec5SDimitry Andricdef  VTBX3Pseudo
72300b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
72310b57cec5SDimitry Andric                IIC_VTBX3, "$orig = $dst", []>;
72320b57cec5SDimitry Andricdef  VTBX4Pseudo
72330b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
72340b57cec5SDimitry Andric                IIC_VTBX4, "$orig = $dst", []>;
72350b57cec5SDimitry Andric} // DecoderMethod = "DecodeTBLInstruction"
72360b57cec5SDimitry Andric
72370b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
72380b57cec5SDimitry Andricdef : Pat<(v8i8 (NEONvtbl2 v8i8:$Vn0, v8i8:$Vn1, v8i8:$Vm)),
72390b57cec5SDimitry Andric          (v8i8 (VTBL2 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
72400b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
72410b57cec5SDimitry Andric                       v8i8:$Vm))>;
72420b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx2 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72430b57cec5SDimitry Andric                                    v8i8:$Vm)),
72440b57cec5SDimitry Andric          (v8i8 (VTBX2 v8i8:$orig,
72450b57cec5SDimitry Andric                       (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
72460b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
72470b57cec5SDimitry Andric                       v8i8:$Vm))>;
72480b57cec5SDimitry Andric
72490b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl3 v8i8:$Vn0, v8i8:$Vn1,
72500b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
72510b57cec5SDimitry Andric          (v8i8 (VTBL3Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72520b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72530b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72540b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
72550b57cec5SDimitry Andric                             v8i8:$Vm))>;
72560b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx3 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72570b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
72580b57cec5SDimitry Andric          (v8i8 (VTBX3Pseudo v8i8:$orig,
72590b57cec5SDimitry Andric                             (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72600b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72610b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72620b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
72630b57cec5SDimitry Andric                             v8i8:$Vm))>;
72640b57cec5SDimitry Andric
72650b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl4 v8i8:$Vn0, v8i8:$Vn1,
72660b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
72670b57cec5SDimitry Andric          (v8i8 (VTBL4Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72680b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72690b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72700b57cec5SDimitry Andric                                                 v8i8:$Vn3, dsub_3),
72710b57cec5SDimitry Andric                             v8i8:$Vm))>;
72720b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx4 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72730b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
72740b57cec5SDimitry Andric          (v8i8 (VTBX4Pseudo v8i8:$orig,
72750b57cec5SDimitry Andric                             (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72760b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72770b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72780b57cec5SDimitry Andric                                                 v8i8:$Vn3, dsub_3),
72790b57cec5SDimitry Andric                             v8i8:$Vm))>;
72800b57cec5SDimitry Andric}
72810b57cec5SDimitry Andric
72820b57cec5SDimitry Andric// VRINT      : Vector Rounding
72830b57cec5SDimitry Andricmulticlass VRINT_FPI<string op, bits<3> op9_7, SDPatternOperator Int> {
72840b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
72850b57cec5SDimitry Andric    def Df : N2VDIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
72860b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
72870b57cec5SDimitry Andric                      v2f32, v2f32, Int>, Requires<[HasV8, HasNEON]> {
72880b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72890b57cec5SDimitry Andric    }
72900b57cec5SDimitry Andric    def Qf : N2VQIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
72910b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
72920b57cec5SDimitry Andric                      v4f32, v4f32, Int>, Requires<[HasV8, HasNEON]> {
72930b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72940b57cec5SDimitry Andric    }
72950b57cec5SDimitry Andric    def Dh : N2VDIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
72960b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
72970b57cec5SDimitry Andric                      v4f16, v4f16, Int>,
72980b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
72990b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
73000b57cec5SDimitry Andric    }
73010b57cec5SDimitry Andric    def Qh : N2VQIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
73020b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
73030b57cec5SDimitry Andric                      v8f16, v8f16, Int>,
73040b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
73050b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
73060b57cec5SDimitry Andric    }
73070b57cec5SDimitry Andric  }
73080b57cec5SDimitry Andric
73090b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Dd, $Dm"),
73100b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Df") DPR:$Dd, DPR:$Dm)>;
73110b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Qd, $Qm"),
73120b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qf") QPR:$Qd, QPR:$Qm)>;
73130b57cec5SDimitry Andric  let Predicates = [HasNEON, HasFullFP16] in {
73140b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Dd, $Dm"),
73150b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Dh") DPR:$Dd, DPR:$Dm)>;
73160b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Qd, $Qm"),
73170b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qh") QPR:$Qd, QPR:$Qm)>;
73180b57cec5SDimitry Andric  }
73190b57cec5SDimitry Andric}
73200b57cec5SDimitry Andric
73210b57cec5SDimitry Andricdefm VRINTNN : VRINT_FPI<"n", 0b000, int_arm_neon_vrintn>;
73220b57cec5SDimitry Andricdefm VRINTXN : VRINT_FPI<"x", 0b001, int_arm_neon_vrintx>;
73230b57cec5SDimitry Andricdefm VRINTAN : VRINT_FPI<"a", 0b010, int_arm_neon_vrinta>;
73240b57cec5SDimitry Andricdefm VRINTZN : VRINT_FPI<"z", 0b011, int_arm_neon_vrintz>;
73250b57cec5SDimitry Andricdefm VRINTMN : VRINT_FPI<"m", 0b101, int_arm_neon_vrintm>;
73260b57cec5SDimitry Andricdefm VRINTPN : VRINT_FPI<"p", 0b111, int_arm_neon_vrintp>;
73270b57cec5SDimitry Andric
73280b57cec5SDimitry Andric// Cryptography instructions
73290b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
73300b57cec5SDimitry Andric    DecoderNamespace = "v8Crypto", hasSideEffects = 0 in {
73310b57cec5SDimitry Andric  class AES<string op, bit op7, bit op6, SDPatternOperator Int>
73320b57cec5SDimitry Andric    : N2VQIntXnp<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7333fe6060f1SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
73340b57cec5SDimitry Andric  class AES2Op<string op, bit op7, bit op6, SDPatternOperator Int>
73350b57cec5SDimitry Andric    : N2VQIntX2np<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7336fe6060f1SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
73370b57cec5SDimitry Andric  class N2SHA<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
73380b57cec5SDimitry Andric              SDPatternOperator Int>
73390b57cec5SDimitry Andric    : N2VQIntXnp<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7340fe6060f1SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73410b57cec5SDimitry Andric  class N2SHA2Op<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
73420b57cec5SDimitry Andric              SDPatternOperator Int>
73430b57cec5SDimitry Andric    : N2VQIntX2np<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7344fe6060f1SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73450b57cec5SDimitry Andric  class N3SHA3Op<string op, bits<5> op27_23, bits<2> op21_20, SDPatternOperator Int>
73460b57cec5SDimitry Andric    : N3VQInt3np<op27_23, op21_20, 0b1100, 1, 0, N3RegFrm, NoItinerary,
7347349cc55cSDimitry Andric                !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73480b57cec5SDimitry Andric}
73490b57cec5SDimitry Andric
7350fe6060f1SDimitry Andriclet Predicates = [HasV8, HasAES] in {
7351*0fca6ea1SDimitry Andriclet isCommutable = 1 in {
73520b57cec5SDimitry Andricdef AESD : AES2Op<"d", 0, 1, int_arm_neon_aesd>;
73530b57cec5SDimitry Andricdef AESE : AES2Op<"e", 0, 0, int_arm_neon_aese>;
7354*0fca6ea1SDimitry Andric}
73550b57cec5SDimitry Andricdef AESIMC : AES<"imc", 1, 1, int_arm_neon_aesimc>;
73560b57cec5SDimitry Andricdef AESMC : AES<"mc", 1, 0, int_arm_neon_aesmc>;
7357fe6060f1SDimitry Andric}
73580b57cec5SDimitry Andric
7359fe6060f1SDimitry Andriclet Predicates = [HasV8, HasSHA2] in {
73600b57cec5SDimitry Andricdef SHA1H : N2SHA<"1h", 0b01, 0b010, 1, 1, null_frag>;
73610b57cec5SDimitry Andricdef SHA1SU1 : N2SHA2Op<"1su1", 0b10, 0b011, 1, 0, int_arm_neon_sha1su1>;
73620b57cec5SDimitry Andricdef SHA256SU0 : N2SHA2Op<"256su0", 0b10, 0b011, 1, 1, int_arm_neon_sha256su0>;
73630b57cec5SDimitry Andricdef SHA1C : N3SHA3Op<"1c", 0b00100, 0b00, null_frag>;
73640b57cec5SDimitry Andricdef SHA1M : N3SHA3Op<"1m", 0b00100, 0b10, null_frag>;
73650b57cec5SDimitry Andricdef SHA1P : N3SHA3Op<"1p", 0b00100, 0b01, null_frag>;
73660b57cec5SDimitry Andricdef SHA1SU0 : N3SHA3Op<"1su0", 0b00100, 0b11, int_arm_neon_sha1su0>;
73670b57cec5SDimitry Andricdef SHA256H : N3SHA3Op<"256h", 0b00110, 0b00, int_arm_neon_sha256h>;
73680b57cec5SDimitry Andricdef SHA256H2 : N3SHA3Op<"256h2", 0b00110, 0b01, int_arm_neon_sha256h2>;
73690b57cec5SDimitry Andricdef SHA256SU1 : N3SHA3Op<"256su1", 0b00110, 0b10, int_arm_neon_sha256su1>;
7370fe6060f1SDimitry Andric}
73710b57cec5SDimitry Andric
73720b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
73730b57cec5SDimitry Andricdef : Pat<(i32 (int_arm_neon_sha1h i32:$Rn)),
73740b57cec5SDimitry Andric          (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG
73750b57cec5SDimitry Andric              (SHA1H (SUBREG_TO_REG (i64 0),
73760b57cec5SDimitry Andric                                    (f32 (COPY_TO_REGCLASS i32:$Rn, SPR)),
73770b57cec5SDimitry Andric                                    ssub_0)),
73780b57cec5SDimitry Andric              ssub_0)), GPR)>;
73790b57cec5SDimitry Andric
73800b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1c v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73810b57cec5SDimitry Andric          (SHA1C v4i32:$hash_abcd,
73820b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73830b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73840b57cec5SDimitry Andric                                ssub_0),
73850b57cec5SDimitry Andric                 v4i32:$wk)>;
73860b57cec5SDimitry Andric
73870b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1m v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73880b57cec5SDimitry Andric          (SHA1M v4i32:$hash_abcd,
73890b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73900b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73910b57cec5SDimitry Andric                                ssub_0),
73920b57cec5SDimitry Andric                 v4i32:$wk)>;
73930b57cec5SDimitry Andric
73940b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1p v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73950b57cec5SDimitry Andric          (SHA1P v4i32:$hash_abcd,
73960b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73970b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73980b57cec5SDimitry Andric                                ssub_0),
73990b57cec5SDimitry Andric                 v4i32:$wk)>;
74000b57cec5SDimitry Andric}
74010b57cec5SDimitry Andric
74020b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
74030b57cec5SDimitry Andric// NEON instructions for single-precision FP math
74040b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
74050b57cec5SDimitry Andric
74060b57cec5SDimitry Andricclass N2VSPat<SDNode OpNode, NeonI Inst>
74070b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a)),
74080b57cec5SDimitry Andric              (EXTRACT_SUBREG
74090b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
74100b57cec5SDimitry Andric                (INSERT_SUBREG
74110b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74120b57cec5SDimitry Andric                 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
74130b57cec5SDimitry Andric
74140b57cec5SDimitry Andricclass N3VSPat<SDNode OpNode, NeonI Inst>
74150b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
74160b57cec5SDimitry Andric              (EXTRACT_SUBREG
74170b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
74180b57cec5SDimitry Andric                (INSERT_SUBREG
74190b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74200b57cec5SDimitry Andric                 SPR:$a, ssub_0),
74210b57cec5SDimitry Andric                (INSERT_SUBREG
74220b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74230b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74240b57cec5SDimitry Andric
74250b57cec5SDimitry Andricclass N3VSPatFP16<SDNode OpNode, NeonI Inst>
74260b57cec5SDimitry Andric  : NEONFPPat<(f16 (OpNode HPR:$a, HPR:$b)),
74270b57cec5SDimitry Andric              (EXTRACT_SUBREG
74280b57cec5SDimitry Andric               (v4f16 (COPY_TO_REGCLASS (Inst
74290b57cec5SDimitry Andric                (INSERT_SUBREG
74300b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
74310b57cec5SDimitry Andric                 HPR:$a, ssub_0),
74320b57cec5SDimitry Andric                (INSERT_SUBREG
74330b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
74340b57cec5SDimitry Andric                 HPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74350b57cec5SDimitry Andric
74360b57cec5SDimitry Andricclass N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
74370b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
74380b57cec5SDimitry Andric              (EXTRACT_SUBREG
74390b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
74400b57cec5SDimitry Andric                (INSERT_SUBREG
74410b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74420b57cec5SDimitry Andric                 SPR:$acc, ssub_0),
74430b57cec5SDimitry Andric                (INSERT_SUBREG
74440b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74450b57cec5SDimitry Andric                 SPR:$a, ssub_0),
74460b57cec5SDimitry Andric                (INSERT_SUBREG
74470b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74480b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74490b57cec5SDimitry Andric
74500b57cec5SDimitry Andricclass NVCVTIFPat<SDNode OpNode, NeonI Inst>
74510b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode GPR:$a)),
74520b57cec5SDimitry Andric              (f32 (EXTRACT_SUBREG
74530b57cec5SDimitry Andric                     (v2f32 (Inst
74540b57cec5SDimitry Andric                       (INSERT_SUBREG
74550b57cec5SDimitry Andric                         (v2f32 (IMPLICIT_DEF)),
74560b57cec5SDimitry Andric                         (i32 (COPY_TO_REGCLASS GPR:$a, SPR)), ssub_0))),
74570b57cec5SDimitry Andric                     ssub_0))>;
74580b57cec5SDimitry Andricclass NVCVTFIPat<SDNode OpNode, NeonI Inst>
74590b57cec5SDimitry Andric  : NEONFPPat<(i32 (OpNode SPR:$a)),
74600b57cec5SDimitry Andric              (i32 (EXTRACT_SUBREG
74610b57cec5SDimitry Andric                     (v2f32 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
74620b57cec5SDimitry Andric                                                 SPR:$a, ssub_0))),
74630b57cec5SDimitry Andric                     ssub_0))>;
74640b57cec5SDimitry Andric
74650b57cec5SDimitry Andricdef : N3VSPat<fadd, VADDfd>;
74660b57cec5SDimitry Andricdef : N3VSPat<fsub, VSUBfd>;
74670b57cec5SDimitry Andricdef : N3VSPat<fmul, VMULfd>;
74680b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VMLAfd>,
74690b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
74700b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VMLSfd>,
74710b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
74720b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VFMAfd>,
74730b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
74740b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VFMSfd>,
74750b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
74760b57cec5SDimitry Andricdef : N2VSPat<fabs, VABSfd>;
74770b57cec5SDimitry Andricdef : N2VSPat<fneg, VNEGfd>;
74780b57cec5SDimitry Andricdef : N3VSPatFP16<fmaximum, VMAXhd>, Requires<[HasFullFP16]>;
74790b57cec5SDimitry Andricdef : N3VSPatFP16<fminimum, VMINhd>, Requires<[HasFullFP16]>;
74800b57cec5SDimitry Andricdef : N3VSPat<fmaximum, VMAXfd>, Requires<[HasNEON]>;
74810b57cec5SDimitry Andricdef : N3VSPat<fminimum, VMINfd>, Requires<[HasNEON]>;
74820b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_sint, VCVTf2sd>;
74830b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_uint, VCVTf2ud>;
74840b57cec5SDimitry Andricdef : NVCVTIFPat<sint_to_fp, VCVTs2fd>;
74850b57cec5SDimitry Andricdef : NVCVTIFPat<uint_to_fp, VCVTu2fd>;
74860b57cec5SDimitry Andric
74870b57cec5SDimitry Andric// NEON doesn't have any f64 conversions, so provide patterns to make
74880b57cec5SDimitry Andric// sure the VFP conversions match when extracting from a vector.
74890b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
74900b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74910b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
74920b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74930b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
74940b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74950b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
74960b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74970b57cec5SDimitry Andric
74980b57cec5SDimitry Andric
74990b57cec5SDimitry Andric// Prefer VMOVDRR for i32 -> f32 bitcasts, it can write all DPR registers.
75000b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert GPR:$a)),
75010b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
75020b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
75030b57cec5SDimitry Andricdef : Pat<(arm_vmovsr GPR:$a),
75040b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
75050b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
75060b57cec5SDimitry Andric
75070b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
75085ffd83dbSDimitry Andric// Non-Instruction Patterns or Endianess - Revert Patterns
75090b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
75100b57cec5SDimitry Andric
75110b57cec5SDimitry Andric// bit_convert
75120b57cec5SDimitry Andric// 64 bit conversions
75130b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
75140b57cec5SDimitry Andricdef : Pat<(f64   (bitconvert (v1i64 DPR:$src))), (f64   DPR:$src)>;
75150b57cec5SDimitry Andricdef : Pat<(v1i64 (bitconvert (f64   DPR:$src))), (v1i64 DPR:$src)>;
75160b57cec5SDimitry Andric
75170b57cec5SDimitry Andricdef : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
75180b57cec5SDimitry Andricdef : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
75190b57cec5SDimitry Andric
75200b57cec5SDimitry Andricdef : Pat<(v4i16 (bitconvert (v4f16 DPR:$src))), (v4i16  DPR:$src)>;
75210b57cec5SDimitry Andricdef : Pat<(v4f16 (bitconvert (v4i16 DPR:$src))), (v4f16  DPR:$src)>;
75220b57cec5SDimitry Andric
75235ffd83dbSDimitry Andricdef : Pat<(v4i16 (bitconvert (v4bf16 DPR:$src))), (v4i16  DPR:$src)>;
75245ffd83dbSDimitry Andricdef : Pat<(v4bf16 (bitconvert (v4i16 DPR:$src))), (v4bf16  DPR:$src)>;
75255ffd83dbSDimitry Andric
75260b57cec5SDimitry Andric// 128 bit conversions
75270b57cec5SDimitry Andricdef : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
75280b57cec5SDimitry Andricdef : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
75290b57cec5SDimitry Andric
75300b57cec5SDimitry Andricdef : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
75310b57cec5SDimitry Andricdef : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
75320b57cec5SDimitry Andric
75330b57cec5SDimitry Andricdef : Pat<(v8i16 (bitconvert (v8f16 QPR:$src))), (v8i16  QPR:$src)>;
75340b57cec5SDimitry Andricdef : Pat<(v8f16 (bitconvert (v8i16 QPR:$src))), (v8f16  QPR:$src)>;
75355ffd83dbSDimitry Andric
75365ffd83dbSDimitry Andricdef : Pat<(v8i16 (bitconvert (v8bf16 QPR:$src))), (v8i16  QPR:$src)>;
75375ffd83dbSDimitry Andricdef : Pat<(v8bf16 (bitconvert (v8i16 QPR:$src))), (v8bf16  QPR:$src)>;
75380b57cec5SDimitry Andric}
75390b57cec5SDimitry Andric
75400b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
75410b57cec5SDimitry Andric  // 64 bit conversions
75420b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (f64   DPR:$src)>;
75430b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (f64   DPR:$src)>;
75440b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (f64   DPR:$src)>;
75455ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (f64   DPR:$src)>;
75460b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (f64   DPR:$src)>;
75470b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (f64   DPR:$src)>;
75480b57cec5SDimitry Andric
75490b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
75500b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
75510b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (v1i64 DPR:$src)>;
75525ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (v1i64 DPR:$src)>;
75530b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
75540b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (v1i64 DPR:$src)>;
75550b57cec5SDimitry Andric
75560b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (v2f32 DPR:$src)>;
75570b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
75580b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (v2f32 DPR:$src)>;
75595ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (v2f32 DPR:$src)>;
75600b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
75610b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (v2f32 DPR:$src)>;
75620b57cec5SDimitry Andric
75630b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (v2i32 DPR:$src)>;
75640b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
75650b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (v2i32 DPR:$src)>;
75665ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (v2i32 DPR:$src)>;
75670b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
75680b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (v2i32 DPR:$src)>;
75690b57cec5SDimitry Andric
75700b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (v4f16 DPR:$src)>;
75710b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (v4f16 DPR:$src)>;
75720b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (v4f16 DPR:$src)>;
75730b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (v4f16 DPR:$src)>;
75740b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (v4f16 DPR:$src)>;
75750b57cec5SDimitry Andric
75765ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (v4bf16 DPR:$src)>;
75775ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (v4bf16 DPR:$src)>;
75785ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (v4bf16 DPR:$src)>;
75795ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (v4bf16 DPR:$src)>;
75805ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (v4bf16 DPR:$src)>;
75815ffd83dbSDimitry Andric
75820b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (v4i16 DPR:$src)>;
75830b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
75840b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
75850b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
75860b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (v4i16 DPR:$src)>;
75870b57cec5SDimitry Andric
75880b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (v8i8  DPR:$src)>;
75890b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (v8i8  DPR:$src)>;
75900b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (v8i8  DPR:$src)>;
75910b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (v8i8  DPR:$src)>;
75920b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (v8i8  DPR:$src)>;
75935ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (v8i8  DPR:$src)>;
75940b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (v8i8  DPR:$src)>;
75950b57cec5SDimitry Andric
75960b57cec5SDimitry Andric  // 128 bit conversions
75970b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;
75980b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
75990b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (v2f64 QPR:$src)>;
76005ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (v2f64 QPR:$src)>;
76010b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
76020b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
76030b57cec5SDimitry Andric
76040b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
76050b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
76060b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (v2i64 QPR:$src)>;
76075ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (v2i64 QPR:$src)>;
76080b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
76090b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
76100b57cec5SDimitry Andric
76110b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
76120b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
76130b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (v4f32 QPR:$src)>;
76145ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (v4f32 QPR:$src)>;
76150b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
76160b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
76170b57cec5SDimitry Andric
76180b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
76190b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
76200b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (v4i32 QPR:$src)>;
76215ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (v4i32 QPR:$src)>;
76220b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
76230b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
76240b57cec5SDimitry Andric
76250b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (v8f16 QPR:$src)>;
76260b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (v8f16 QPR:$src)>;
76270b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (v8f16 QPR:$src)>;
76280b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (v8f16 QPR:$src)>;
76290b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (v8f16 QPR:$src)>;
76300b57cec5SDimitry Andric
76315ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (v8bf16 QPR:$src)>;
76325ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (v8bf16 QPR:$src)>;
76335ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (v8bf16 QPR:$src)>;
76345ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (v8bf16 QPR:$src)>;
76355ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (v8bf16 QPR:$src)>;
76365ffd83dbSDimitry Andric
76370b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
76380b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
76390b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
76400b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
76410b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
76420b57cec5SDimitry Andric
76430b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
76440b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
76450b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
76460b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
76470b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (v16i8 QPR:$src)>;
76485ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (v16i8 QPR:$src)>;
76490b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
76500b57cec5SDimitry Andric}
76510b57cec5SDimitry Andric
76520b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
76530b57cec5SDimitry Andric  // 64 bit conversions
76540b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
76550b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
76560b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
76575ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
76580b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
76590b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
76600b57cec5SDimitry Andric
76610b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
76620b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
76630b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
76645ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
76650b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
76660b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
76670b57cec5SDimitry Andric
76680b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
76690b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
76700b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
76715ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
76720b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
76730b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
76740b57cec5SDimitry Andric
76750b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
76760b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
76770b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
76785ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
76790b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
76800b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
76810b57cec5SDimitry Andric
76820b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76830b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76840b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76850b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76860b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76870b57cec5SDimitry Andric
76885ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76895ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76905ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76915ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76925ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76935ffd83dbSDimitry Andric
76940b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76950b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76960b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76970b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76980b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76990b57cec5SDimitry Andric
77000b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (VREV64d8  DPR:$src)>;
77010b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (VREV64d8  DPR:$src)>;
77020b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (VREV32d8  DPR:$src)>;
77030b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (VREV32d8  DPR:$src)>;
77040b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (VREV16d8  DPR:$src)>;
77055ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (VREV16d8  DPR:$src)>;
77060b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (VREV16d8  DPR:$src)>;
77070b57cec5SDimitry Andric
77080b57cec5SDimitry Andric  // 128 bit conversions
77090b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
77100b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
77110b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
77125ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
77130b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
77140b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
77150b57cec5SDimitry Andric
77160b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
77170b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
77180b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
77195ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
77200b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
77210b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
77220b57cec5SDimitry Andric
77230b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
77240b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
77250b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
77265ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
77270b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
77280b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
77290b57cec5SDimitry Andric
77300b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
77310b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
77320b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
77335ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
77340b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
77350b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
77360b57cec5SDimitry Andric
77370b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77380b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77390b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77400b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77410b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77420b57cec5SDimitry Andric
77435ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77445ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77455ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77465ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77475ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77485ffd83dbSDimitry Andric
77490b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77500b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77510b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77520b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77530b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77540b57cec5SDimitry Andric
77550b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (VREV64q8  QPR:$src)>;
77560b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (VREV64q8  QPR:$src)>;
77570b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (VREV32q8  QPR:$src)>;
77580b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (VREV32q8  QPR:$src)>;
77590b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (VREV16q8  QPR:$src)>;
77605ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (VREV16q8  QPR:$src)>;
77610b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (VREV16q8  QPR:$src)>;
77620b57cec5SDimitry Andric}
77630b57cec5SDimitry Andric
77645ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
77655ffd83dbSDimitry Andric  // Here we match the specific SDNode type 'ARMVectorRegCastImpl'
77665ffd83dbSDimitry Andric  // rather than the more general 'ARMVectorRegCast' which would also
77675ffd83dbSDimitry Andric  // match some bitconverts. If we use the latter in cases where the
77685ffd83dbSDimitry Andric  // input and output types are the same, the bitconvert gets elided
77695ffd83dbSDimitry Andric  // and we end up generating a nonsense match of nothing.
77705ffd83dbSDimitry Andric
77715ffd83dbSDimitry Andric  foreach VT = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
77725ffd83dbSDimitry Andric    foreach VT2 = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
77735ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 QPR:$src))), (VT QPR:$src)>;
77745ffd83dbSDimitry Andric
77755ffd83dbSDimitry Andric  foreach VT = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
77765ffd83dbSDimitry Andric    foreach VT2 = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
77775ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 DPR:$src))), (VT DPR:$src)>;
77785ffd83dbSDimitry Andric}
77795ffd83dbSDimitry Andric
77800b57cec5SDimitry Andric// Use VLD1/VST1 + VREV for non-word-aligned v2f64 load/store on Big Endian
77810b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
77820b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
77830b57cec5SDimitry Andric          (VREV64q8 (VLD1q8 addrmode6:$addr))>;
77840b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
77850b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, (VREV64q8 QPR:$value))>;
77860b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
77870b57cec5SDimitry Andric          (VREV64q16 (VLD1q16 addrmode6:$addr))>;
77880b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
77890b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, (VREV64q16 QPR:$value))>;
77900b57cec5SDimitry Andric}
77910b57cec5SDimitry Andric
77920b57cec5SDimitry Andric// Fold extracting an element out of a v2i32 into a vfp register.
77930b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
77940b57cec5SDimitry Andric          (f32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>,
77950b57cec5SDimitry Andric      Requires<[HasNEON]>;
77960b57cec5SDimitry Andric
77970b57cec5SDimitry Andric// Vector lengthening move with load, matching extending loads.
77980b57cec5SDimitry Andric
77990b57cec5SDimitry Andric// extload, zextload and sextload for a standard lengthening load. Example:
78000b57cec5SDimitry Andric// Lengthen_Single<"8", "i16", "8"> =
78010b57cec5SDimitry Andric//     Pat<(v8i16 (extloadvi8 addrmode6:$addr))
78020b57cec5SDimitry Andric//         (VMOVLuv8i16 (VLD1d8 addrmode6:$addr,
78030b57cec5SDimitry Andric//                              (f64 (IMPLICIT_DEF)), (i32 0)))>;
78040b57cec5SDimitry Andricmulticlass Lengthen_Single<string DestLanes, string DestTy, string SrcTy> {
78050b57cec5SDimitry Andric  let AddedComplexity = 10 in {
78060b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78070b57cec5SDimitry Andric                    (!cast<PatFrag>("extloadvi" # SrcTy) addrmode6:$addr)),
78080b57cec5SDimitry Andric                  (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
78090b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
78100b57cec5SDimitry Andric             Requires<[HasNEON]>;
78110b57cec5SDimitry Andric
78120b57cec5SDimitry Andric  def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78130b57cec5SDimitry Andric                  (!cast<PatFrag>("zextloadvi" # SrcTy) addrmode6:$addr)),
78140b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
78150b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
78160b57cec5SDimitry Andric           Requires<[HasNEON]>;
78170b57cec5SDimitry Andric
78180b57cec5SDimitry Andric  def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78190b57cec5SDimitry Andric                  (!cast<PatFrag>("sextloadvi" # SrcTy) addrmode6:$addr)),
78200b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLsv" # DestLanes # DestTy)
78210b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
78220b57cec5SDimitry Andric           Requires<[HasNEON]>;
78230b57cec5SDimitry Andric  }
78240b57cec5SDimitry Andric}
78250b57cec5SDimitry Andric
78260b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load which only uses
78270b57cec5SDimitry Andric// half the lanes available. Example:
78280b57cec5SDimitry Andric// Lengthen_HalfSingle<"4", "i16", "8", "i16", "i8"> =
78290b57cec5SDimitry Andric//     Pat<(v4i16 (extloadvi8 addrmode6oneL32:$addr)),
78300b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
78310b57cec5SDimitry Andric//                                      (f64 (IMPLICIT_DEF)), (i32 0))),
78320b57cec5SDimitry Andric//                         dsub_0)>;
78330b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle<string DestLanes, string DestTy, string SrcTy,
78340b57cec5SDimitry Andric                               string InsnLanes, string InsnTy> {
78350b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78360b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78370b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78380b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78390b57cec5SDimitry Andric         dsub_0)>,
78400b57cec5SDimitry Andric             Requires<[HasNEON]>;
78410b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78420b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78430b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78440b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78450b57cec5SDimitry Andric         dsub_0)>,
78460b57cec5SDimitry Andric             Requires<[HasNEON]>;
78470b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78480b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78490b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
78500b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78510b57cec5SDimitry Andric         dsub_0)>,
78520b57cec5SDimitry Andric             Requires<[HasNEON]>;
78530b57cec5SDimitry Andric}
78540b57cec5SDimitry Andric
78550b57cec5SDimitry Andric// The following class definition is basically a copy of the
78560b57cec5SDimitry Andric// Lengthen_HalfSingle definition above, however with an additional parameter
78570b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
78580b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
78590b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle_Big_Endian<string DestLanes, string DestTy, string SrcTy,
78600b57cec5SDimitry Andric                               string InsnLanes, string InsnTy, string RevLanes> {
78610b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78620b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78630b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78640b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78650b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78660b57cec5SDimitry Andric         dsub_0)>,
78670b57cec5SDimitry Andric             Requires<[HasNEON]>;
78680b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78690b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78700b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78710b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78720b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78730b57cec5SDimitry Andric         dsub_0)>,
78740b57cec5SDimitry Andric             Requires<[HasNEON]>;
78750b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78760b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78770b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
78780b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78790b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78800b57cec5SDimitry Andric         dsub_0)>,
78810b57cec5SDimitry Andric             Requires<[HasNEON]>;
78820b57cec5SDimitry Andric}
78830b57cec5SDimitry Andric
78840b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
78850b57cec5SDimitry Andric// lengthening load, to quadruple the initial length.
78860b57cec5SDimitry Andric//
78870b57cec5SDimitry Andric// Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> =
78880b57cec5SDimitry Andric//     Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr))
78890b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv4i32
78900b57cec5SDimitry Andric//           (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
78910b57cec5SDimitry Andric//                                                   (f64 (IMPLICIT_DEF)),
78920b57cec5SDimitry Andric//                                                   (i32 0))),
78930b57cec5SDimitry Andric//                           dsub_0)),
78940b57cec5SDimitry Andric//           dsub_0)>;
78950b57cec5SDimitry Andricmulticlass Lengthen_Double<string DestLanes, string DestTy, string SrcTy,
78960b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
78970b57cec5SDimitry Andric                           string Insn2Ty> {
78980b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78990b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
79000b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79010b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79020b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79030b57cec5SDimitry Andric             dsub_0))>,
79040b57cec5SDimitry Andric             Requires<[HasNEON]>;
79050b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79060b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
79070b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79080b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79090b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79100b57cec5SDimitry Andric             dsub_0))>,
79110b57cec5SDimitry Andric             Requires<[HasNEON]>;
79120b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79130b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
79140b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79150b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79160b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79170b57cec5SDimitry Andric             dsub_0))>,
79180b57cec5SDimitry Andric             Requires<[HasNEON]>;
79190b57cec5SDimitry Andric}
79200b57cec5SDimitry Andric
79210b57cec5SDimitry Andric// The following class definition is basically a copy of the
79220b57cec5SDimitry Andric// Lengthen_Double definition above, however with an additional parameter
79230b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
79240b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
79250b57cec5SDimitry Andricmulticlass Lengthen_Double_Big_Endian<string DestLanes, string DestTy, string SrcTy,
79260b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
79270b57cec5SDimitry Andric                           string Insn2Ty, string RevLanes> {
79280b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79290b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
79300b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79310b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79320b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79330b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79340b57cec5SDimitry Andric             dsub_0))>,
79350b57cec5SDimitry Andric             Requires<[HasNEON]>;
79360b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79370b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
79380b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79390b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79400b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79410b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79420b57cec5SDimitry Andric             dsub_0))>,
79430b57cec5SDimitry Andric             Requires<[HasNEON]>;
79440b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79450b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
79460b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79470b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79480b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79490b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79500b57cec5SDimitry Andric             dsub_0))>,
79510b57cec5SDimitry Andric             Requires<[HasNEON]>;
79520b57cec5SDimitry Andric}
79530b57cec5SDimitry Andric
79540b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
79550b57cec5SDimitry Andric// lengthening load, to quadruple the initial length, but which ends up only
79560b57cec5SDimitry Andric// requiring half the available lanes (a 64-bit outcome instead of a 128-bit).
79570b57cec5SDimitry Andric//
79580b57cec5SDimitry Andric// Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> =
79590b57cec5SDimitry Andric// Pat<(v2i32 (extloadvi8 addrmode6:$addr))
79600b57cec5SDimitry Andric//     (EXTRACT_SUBREG (VMOVLuv4i32
79610b57cec5SDimitry Andric//       (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr,
79620b57cec5SDimitry Andric//                                               (f64 (IMPLICIT_DEF)), (i32 0))),
79630b57cec5SDimitry Andric//                       dsub_0)),
79640b57cec5SDimitry Andric//       dsub_0)>;
79650b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble<string DestLanes, string DestTy, string SrcTy,
79660b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
79670b57cec5SDimitry Andric                           string Insn2Ty> {
79680b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79690b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
79700b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79710b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79720b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79730b57cec5SDimitry Andric             dsub_0)),
79740b57cec5SDimitry Andric          dsub_0)>,
79750b57cec5SDimitry Andric             Requires<[HasNEON]>;
79760b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79770b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
79780b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79790b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79800b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79810b57cec5SDimitry Andric             dsub_0)),
79820b57cec5SDimitry Andric          dsub_0)>,
79830b57cec5SDimitry Andric              Requires<[HasNEON]>;
79840b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79850b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
79860b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79870b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79880b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79890b57cec5SDimitry Andric             dsub_0)),
79900b57cec5SDimitry Andric          dsub_0)>,
79910b57cec5SDimitry Andric             Requires<[HasNEON]>;
79920b57cec5SDimitry Andric}
79930b57cec5SDimitry Andric
79940b57cec5SDimitry Andric// The following class definition is basically a copy of the
79950b57cec5SDimitry Andric// Lengthen_HalfDouble definition above, however with an additional VREV16d8
79960b57cec5SDimitry Andric// instruction to convert data loaded by VLD1LN into proper vector format
79970b57cec5SDimitry Andric// in big endian mode.
79980b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble_Big_Endian<string DestLanes, string DestTy, string SrcTy,
79990b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
80000b57cec5SDimitry Andric                           string Insn2Ty> {
80010b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
80020b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
80030b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
80040b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
800506c3fb27SDimitry Andric             (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
80060b57cec5SDimitry Andric             dsub_0)),
80070b57cec5SDimitry Andric           dsub_0)>,
80080b57cec5SDimitry Andric             Requires<[HasNEON]>;
80090b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
80100b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
80110b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
80120b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
801306c3fb27SDimitry Andric             (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
80140b57cec5SDimitry Andric             dsub_0)),
80150b57cec5SDimitry Andric           dsub_0)>,
80160b57cec5SDimitry Andric             Requires<[HasNEON]>;
80170b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
80180b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
80190b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
80200b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
802106c3fb27SDimitry Andric             (VREV16d8 (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
80220b57cec5SDimitry Andric             dsub_0)),
80230b57cec5SDimitry Andric           dsub_0)>,
80240b57cec5SDimitry Andric             Requires<[HasNEON]>;
80250b57cec5SDimitry Andric}
80260b57cec5SDimitry Andric
80270b57cec5SDimitry Andricdefm : Lengthen_Single<"8", "i16", "8">; // v8i8 -> v8i16
80280b57cec5SDimitry Andricdefm : Lengthen_Single<"4", "i32", "16">; // v4i16 -> v4i32
80290b57cec5SDimitry Andricdefm : Lengthen_Single<"2", "i64", "32">; // v2i32 -> v2i64
80300b57cec5SDimitry Andric
80310b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
80320b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"4", "i16", "i8", "8", "i16">; // v4i8 -> v4i16
80330b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"2", "i32", "i16", "4", "i32">; // v2i16 -> v2i32
80340b57cec5SDimitry Andric
80350b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
80360b57cec5SDimitry Andric  defm : Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32">;
80370b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
80380b57cec5SDimitry Andric  defm : Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32">;
80390b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
80400b57cec5SDimitry Andric  defm : Lengthen_Double<"2", "i64", "i16", "4", "i32", "2", "i64">;
80410b57cec5SDimitry Andric}
80420b57cec5SDimitry Andric
80430b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
80440b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"4", "i16", "i8", "8", "i16", "8">; // v4i8 -> v4i16
80450b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"2", "i32", "i16", "4", "i32", "16">; // v2i16 -> v2i32
80460b57cec5SDimitry Andric
80470b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
80480b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"4", "i32", "i8", "8", "i16", "4", "i32", "8">;
80490b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
80500b57cec5SDimitry Andric  defm : Lengthen_HalfDouble_Big_Endian<"2", "i32", "i8", "8", "i16", "4", "i32">;
80510b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
80520b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"2", "i64", "i16", "4", "i32", "2", "i64", "16">;
80530b57cec5SDimitry Andric}
80540b57cec5SDimitry Andric
80550b57cec5SDimitry Andric// Triple lengthening - v2i8 -> v2i16 -> v2i32 -> v2i64
80560b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
80570b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
80580b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80590b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80600b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80610b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
80620b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80630b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80640b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80650b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
80660b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
80670b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80680b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80690b57cec5SDimitry Andric}
80700b57cec5SDimitry Andric// The following patterns are basically a copy of the patterns above,
80710b57cec5SDimitry Andric// however with an additional VREV16d instruction to convert data
80720b57cec5SDimitry Andric// loaded by VLD1LN into proper vector format in big endian mode.
80730b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
80740b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
80750b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
807606c3fb27SDimitry Andric           (VREV16d8
80770b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80780b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80790b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
80800b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
808106c3fb27SDimitry Andric           (VREV16d8
80820b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80830b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80840b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
80850b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
808606c3fb27SDimitry Andric           (VREV16d8
80870b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80880b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80890b57cec5SDimitry Andric}
80900b57cec5SDimitry Andric
80910b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
80920b57cec5SDimitry Andricdef : Pat<(v2i64 (concat_vectors DPR:$Dn, DPR:$Dm)),
80930b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80940b57cec5SDimitry Andricdef : Pat<(v4i32 (concat_vectors DPR:$Dn, DPR:$Dm)),
80950b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80960b57cec5SDimitry Andricdef : Pat<(v8i16 (concat_vectors DPR:$Dn, DPR:$Dm)),
80970b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80980b57cec5SDimitry Andricdef : Pat<(v16i8 (concat_vectors DPR:$Dn, DPR:$Dm)),
80990b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
81000b57cec5SDimitry Andricdef : Pat<(v4f32 (concat_vectors DPR:$Dn, DPR:$Dm)),
81010b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
81020b57cec5SDimitry Andricdef : Pat<(v8f16 (concat_vectors DPR:$Dn, DPR:$Dm)),
81030b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
81045ffd83dbSDimitry Andricdef : Pat<(v8bf16 (concat_vectors DPR:$Dn, DPR:$Dm)),
81055ffd83dbSDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
81060b57cec5SDimitry Andric}
81070b57cec5SDimitry Andric
81080b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
81090b57cec5SDimitry Andric// Assembler aliases
81100b57cec5SDimitry Andric//
81110b57cec5SDimitry Andric
81120b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdhr${p} $Dd, $Rn",
81130b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 1, pred:$p)>;
81140b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdlr${p} $Dd, $Rn",
81150b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 0, pred:$p)>;
81160b57cec5SDimitry Andric
81170b57cec5SDimitry Andric// VAND/VBIC/VEOR/VORR accept but do not require a type suffix.
81180b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
81190b57cec5SDimitry Andric                         (VANDd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81200b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
81210b57cec5SDimitry Andric                         (VANDq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81220b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
81230b57cec5SDimitry Andric                         (VBICd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81240b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
81250b57cec5SDimitry Andric                         (VBICq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81260b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
81270b57cec5SDimitry Andric                         (VEORd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81280b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
81290b57cec5SDimitry Andric                         (VEORq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81300b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
81310b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81320b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
81330b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81340b57cec5SDimitry Andric// ... two-operand aliases
81350b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
81360b57cec5SDimitry Andric                         (VANDd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81370b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
81380b57cec5SDimitry Andric                         (VANDq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81390b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
81400b57cec5SDimitry Andric                         (VEORd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81410b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
81420b57cec5SDimitry Andric                         (VEORq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81430b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
81440b57cec5SDimitry Andric                         (VORRd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81450b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
81460b57cec5SDimitry Andric                         (VORRq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81470b57cec5SDimitry Andric// ... immediates
81480b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
81490b57cec5SDimitry Andric                    (VBICiv4i16 DPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
81500b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
81510b57cec5SDimitry Andric                    (VBICiv2i32 DPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
81520b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
81530b57cec5SDimitry Andric                    (VBICiv8i16 QPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
81540b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
81550b57cec5SDimitry Andric                    (VBICiv4i32 QPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
81560b57cec5SDimitry Andric
81570b57cec5SDimitry Andric
81580b57cec5SDimitry Andric// VLD1 single-lane pseudo-instructions. These need special handling for
81590b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81600b57cec5SDimitry Andricdef VLD1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr",
81610b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81620b57cec5SDimitry Andric                      pred:$p)>;
81630b57cec5SDimitry Andricdef VLD1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr",
81640b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81650b57cec5SDimitry Andric                      pred:$p)>;
81660b57cec5SDimitry Andricdef VLD1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr",
81670b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81680b57cec5SDimitry Andric                      pred:$p)>;
81690b57cec5SDimitry Andric
81700b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_8 :
81710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr!",
81720b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81730b57cec5SDimitry Andric                      pred:$p)>;
81740b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_16 :
81750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr!",
81760b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81770b57cec5SDimitry Andric                      pred:$p)>;
81780b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_32 :
81790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr!",
81800b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81810b57cec5SDimitry Andric                      pred:$p)>;
81820b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_8 :
81830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr, $Rm",
81840b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81850b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81860b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_16 :
81870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr, $Rm",
81880b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81890b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81900b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_32 :
81910b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr, $Rm",
81920b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81930b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81940b57cec5SDimitry Andric
81950b57cec5SDimitry Andric
81960b57cec5SDimitry Andric// VST1 single-lane pseudo-instructions. These need special handling for
81970b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81980b57cec5SDimitry Andricdef VST1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr",
81990b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
82000b57cec5SDimitry Andric                      pred:$p)>;
82010b57cec5SDimitry Andricdef VST1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr",
82020b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
82030b57cec5SDimitry Andric                      pred:$p)>;
82040b57cec5SDimitry Andricdef VST1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr",
82050b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
82060b57cec5SDimitry Andric                      pred:$p)>;
82070b57cec5SDimitry Andric
82080b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_8 :
82090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr!",
82100b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
82110b57cec5SDimitry Andric                      pred:$p)>;
82120b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_16 :
82130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr!",
82140b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
82150b57cec5SDimitry Andric                      pred:$p)>;
82160b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_32 :
82170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr!",
82180b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
82190b57cec5SDimitry Andric                      pred:$p)>;
82200b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_8 :
82210b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr, $Rm",
82220b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
82230b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82240b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_16 :
82250b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr, $Rm",
82260b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
82270b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82280b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_32 :
82290b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr, $Rm",
82300b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
82310b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82320b57cec5SDimitry Andric
82330b57cec5SDimitry Andric// VLD2 single-lane pseudo-instructions. These need special handling for
82340b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
82350b57cec5SDimitry Andricdef VLD2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr",
82360b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82370b57cec5SDimitry Andric                  pred:$p)>;
82380b57cec5SDimitry Andricdef VLD2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
82390b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82400b57cec5SDimitry Andric                      pred:$p)>;
82410b57cec5SDimitry Andricdef VLD2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
82420b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr, pred:$p)>;
82430b57cec5SDimitry Andricdef VLD2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
82440b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82450b57cec5SDimitry Andric                      pred:$p)>;
82460b57cec5SDimitry Andricdef VLD2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
82470b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82480b57cec5SDimitry Andric                      pred:$p)>;
82490b57cec5SDimitry Andric
82500b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_8 :
82510b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr!",
82520b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82530b57cec5SDimitry Andric                      pred:$p)>;
82540b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_16 :
82550b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
82560b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82570b57cec5SDimitry Andric                      pred:$p)>;
82580b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_32 :
82590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
82600b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82610b57cec5SDimitry Andric                      pred:$p)>;
82620b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_16 :
82630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
82640b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82650b57cec5SDimitry Andric                      pred:$p)>;
82660b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_32 :
82670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
82680b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82690b57cec5SDimitry Andric                      pred:$p)>;
82700b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_8 :
82710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr, $Rm",
82720b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82730b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82740b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_16 :
82750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
82760b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82770b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82780b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_32 :
82790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
82800b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82810b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82820b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_16 :
82830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
82840b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82850b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82860b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_32 :
82870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
82880b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82890b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82900b57cec5SDimitry Andric
82910b57cec5SDimitry Andric
82920b57cec5SDimitry Andric// VST2 single-lane pseudo-instructions. These need special handling for
82930b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
82940b57cec5SDimitry Andricdef VST2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr",
82950b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82960b57cec5SDimitry Andric                      pred:$p)>;
82970b57cec5SDimitry Andricdef VST2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
82980b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82990b57cec5SDimitry Andric                      pred:$p)>;
83000b57cec5SDimitry Andricdef VST2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
83010b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
83020b57cec5SDimitry Andric                      pred:$p)>;
83030b57cec5SDimitry Andricdef VST2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
83040b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
83050b57cec5SDimitry Andric                      pred:$p)>;
83060b57cec5SDimitry Andricdef VST2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
83070b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
83080b57cec5SDimitry Andric                      pred:$p)>;
83090b57cec5SDimitry Andric
83100b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_8 :
83110b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr!",
83120b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
83130b57cec5SDimitry Andric                      pred:$p)>;
83140b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_16 :
83150b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
83160b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
83170b57cec5SDimitry Andric                      pred:$p)>;
83180b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_32 :
83190b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
83200b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
83210b57cec5SDimitry Andric                      pred:$p)>;
83220b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_16 :
83230b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
83240b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
83250b57cec5SDimitry Andric                      pred:$p)>;
83260b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_32 :
83270b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
83280b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
83290b57cec5SDimitry Andric                      pred:$p)>;
83300b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_8 :
83310b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr, $Rm",
83320b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
83330b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83340b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_16 :
83350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
83360b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
83370b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83380b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_32 :
83390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
83400b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
83410b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83420b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_16 :
83430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
83440b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
83450b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83460b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_32 :
83470b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
83480b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
83490b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83500b57cec5SDimitry Andric
83510b57cec5SDimitry Andric// VLD3 all-lanes pseudo-instructions. These need special handling for
83520b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
83530b57cec5SDimitry Andricdef VLD3DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83540b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83550b57cec5SDimitry Andric                    pred:$p)>;
83560b57cec5SDimitry Andricdef VLD3DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83570b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83580b57cec5SDimitry Andric                    pred:$p)>;
83590b57cec5SDimitry Andricdef VLD3DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83600b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83610b57cec5SDimitry Andric                    pred:$p)>;
83620b57cec5SDimitry Andricdef VLD3DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83630b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83640b57cec5SDimitry Andric                    pred:$p)>;
83650b57cec5SDimitry Andricdef VLD3DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83660b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83670b57cec5SDimitry Andric                    pred:$p)>;
83680b57cec5SDimitry Andricdef VLD3DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83690b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83700b57cec5SDimitry Andric                    pred:$p)>;
83710b57cec5SDimitry Andric
83720b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_8 :
83730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83740b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83750b57cec5SDimitry Andric                    pred:$p)>;
83760b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_16 :
83770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83780b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83790b57cec5SDimitry Andric                    pred:$p)>;
83800b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_32 :
83810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83820b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83830b57cec5SDimitry Andric                    pred:$p)>;
83840b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_8 :
83850b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83860b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83870b57cec5SDimitry Andric                    pred:$p)>;
83880b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_16 :
83890b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83900b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83910b57cec5SDimitry Andric                    pred:$p)>;
83920b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_32 :
83930b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83940b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83950b57cec5SDimitry Andric                    pred:$p)>;
83960b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_8 :
83970b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
83980b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83990b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84000b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_16 :
84010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84020b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
84030b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84040b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_32 :
84050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84060b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
84070b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84080b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_8 :
84090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
84100b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
84110b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84120b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_16 :
84130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84140b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
84150b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84160b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_32 :
84170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84180b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
84190b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84200b57cec5SDimitry Andric
84210b57cec5SDimitry Andric
84220b57cec5SDimitry Andric// VLD3 single-lane pseudo-instructions. These need special handling for
84230b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
84240b57cec5SDimitry Andricdef VLD3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84250b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84260b57cec5SDimitry Andric                    pred:$p)>;
84270b57cec5SDimitry Andricdef VLD3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84280b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84290b57cec5SDimitry Andric                    pred:$p)>;
84300b57cec5SDimitry Andricdef VLD3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84310b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84320b57cec5SDimitry Andric                    pred:$p)>;
84330b57cec5SDimitry Andricdef VLD3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84340b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84350b57cec5SDimitry Andric                    pred:$p)>;
84360b57cec5SDimitry Andricdef VLD3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84370b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84380b57cec5SDimitry Andric                    pred:$p)>;
84390b57cec5SDimitry Andric
84400b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_8 :
84410b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
84420b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84430b57cec5SDimitry Andric                    pred:$p)>;
84440b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_16 :
84450b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84460b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84470b57cec5SDimitry Andric                    pred:$p)>;
84480b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_32 :
84490b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84500b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84510b57cec5SDimitry Andric                    pred:$p)>;
84520b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_16 :
84530b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84540b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84550b57cec5SDimitry Andric                    pred:$p)>;
84560b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_32 :
84570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84580b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84590b57cec5SDimitry Andric                    pred:$p)>;
84600b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_8 :
84610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
84620b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84630b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84640b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_16 :
84650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84660b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
84670b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84680b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_32 :
84690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84700b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84710b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84720b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_16 :
84730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84740b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
84750b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84760b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_32 :
84770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84780b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84790b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84800b57cec5SDimitry Andric
84810b57cec5SDimitry Andric// VLD3 multiple structure pseudo-instructions. These need special handling for
84820b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
84830b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
84840b57cec5SDimitry Andricdef VLD3dAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84850b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84860b57cec5SDimitry Andricdef VLD3dAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84870b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84880b57cec5SDimitry Andricdef VLD3dAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84890b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84900b57cec5SDimitry Andricdef VLD3qAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84910b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84920b57cec5SDimitry Andricdef VLD3qAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84930b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84940b57cec5SDimitry Andricdef VLD3qAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84950b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84960b57cec5SDimitry Andric
84970b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_8 :
84980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
84990b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85000b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_16 :
85010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
85020b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85030b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_32 :
85040b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
85050b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85060b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_8 :
85070b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
85080b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85090b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_16 :
85100b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
85110b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85120b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_32 :
85130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
85140b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85150b57cec5SDimitry Andricdef VLD3dWB_register_Asm_8 :
85160b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
85170b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85180b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85190b57cec5SDimitry Andricdef VLD3dWB_register_Asm_16 :
85200b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
85210b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85220b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85230b57cec5SDimitry Andricdef VLD3dWB_register_Asm_32 :
85240b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
85250b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85260b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85270b57cec5SDimitry Andricdef VLD3qWB_register_Asm_8 :
85280b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
85290b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85300b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85310b57cec5SDimitry Andricdef VLD3qWB_register_Asm_16 :
85320b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
85330b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85340b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85350b57cec5SDimitry Andricdef VLD3qWB_register_Asm_32 :
85360b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
85370b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85380b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85390b57cec5SDimitry Andric
85400b57cec5SDimitry Andric// VST3 single-lane pseudo-instructions. These need special handling for
85410b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
85420b57cec5SDimitry Andricdef VST3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
85430b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85440b57cec5SDimitry Andric                    pred:$p)>;
85450b57cec5SDimitry Andricdef VST3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85460b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
85470b57cec5SDimitry Andric                    pred:$p)>;
85480b57cec5SDimitry Andricdef VST3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85490b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85500b57cec5SDimitry Andric                    pred:$p)>;
85510b57cec5SDimitry Andricdef VST3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85520b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
85530b57cec5SDimitry Andric                    pred:$p)>;
85540b57cec5SDimitry Andricdef VST3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85550b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85560b57cec5SDimitry Andric                    pred:$p)>;
85570b57cec5SDimitry Andric
85580b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_8 :
85590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
85600b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85610b57cec5SDimitry Andric                    pred:$p)>;
85620b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_16 :
85630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85640b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
85650b57cec5SDimitry Andric                    pred:$p)>;
85660b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_32 :
85670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85680b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85690b57cec5SDimitry Andric                    pred:$p)>;
85700b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_16 :
85710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85720b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
85730b57cec5SDimitry Andric                    pred:$p)>;
85740b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_32 :
85750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85760b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85770b57cec5SDimitry Andric                    pred:$p)>;
85780b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_8 :
85790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
85800b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85810b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85820b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_16 :
85830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85840b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
85850b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
85860b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_32 :
85870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85880b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85890b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85900b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_16 :
85910b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85920b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
85930b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
85940b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_32 :
85950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85960b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85970b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85980b57cec5SDimitry Andric
85990b57cec5SDimitry Andric
86000b57cec5SDimitry Andric// VST3 multiple structure pseudo-instructions. These need special handling for
86010b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
86020b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
86030b57cec5SDimitry Andricdef VST3dAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
86040b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86050b57cec5SDimitry Andricdef VST3dAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
86060b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86070b57cec5SDimitry Andricdef VST3dAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
86080b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86090b57cec5SDimitry Andricdef VST3qAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
86100b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86110b57cec5SDimitry Andricdef VST3qAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
86120b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86130b57cec5SDimitry Andricdef VST3qAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
86140b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86150b57cec5SDimitry Andric
86160b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_8 :
86170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
86180b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86190b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_16 :
86200b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
86210b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86220b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_32 :
86230b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
86240b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86250b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_8 :
86260b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
86270b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86280b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_16 :
86290b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
86300b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86310b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_32 :
86320b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
86330b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86340b57cec5SDimitry Andricdef VST3dWB_register_Asm_8 :
86350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
86360b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86370b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86380b57cec5SDimitry Andricdef VST3dWB_register_Asm_16 :
86390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
86400b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86410b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86420b57cec5SDimitry Andricdef VST3dWB_register_Asm_32 :
86430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
86440b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86450b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86460b57cec5SDimitry Andricdef VST3qWB_register_Asm_8 :
86470b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
86480b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86490b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86500b57cec5SDimitry Andricdef VST3qWB_register_Asm_16 :
86510b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
86520b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86530b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86540b57cec5SDimitry Andricdef VST3qWB_register_Asm_32 :
86550b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
86560b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86570b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86580b57cec5SDimitry Andric
86590b57cec5SDimitry Andric// VLD4 all-lanes pseudo-instructions. These need special handling for
86600b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
86610b57cec5SDimitry Andricdef VLD4DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86620b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
86630b57cec5SDimitry Andric                    pred:$p)>;
86640b57cec5SDimitry Andricdef VLD4DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86650b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
86660b57cec5SDimitry Andric                    pred:$p)>;
86670b57cec5SDimitry Andricdef VLD4DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86680b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
86690b57cec5SDimitry Andric                    pred:$p)>;
86700b57cec5SDimitry Andricdef VLD4DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86710b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
86720b57cec5SDimitry Andric                    pred:$p)>;
86730b57cec5SDimitry Andricdef VLD4DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86740b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
86750b57cec5SDimitry Andric                    pred:$p)>;
86760b57cec5SDimitry Andricdef VLD4DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86770b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
86780b57cec5SDimitry Andric                    pred:$p)>;
86790b57cec5SDimitry Andric
86800b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_8 :
86810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
86820b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
86830b57cec5SDimitry Andric                    pred:$p)>;
86840b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_16 :
86850b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86860b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
86870b57cec5SDimitry Andric                    pred:$p)>;
86880b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_32 :
86890b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
86900b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
86910b57cec5SDimitry Andric                    pred:$p)>;
86920b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_8 :
86930b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
86940b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
86950b57cec5SDimitry Andric                    pred:$p)>;
86960b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_16 :
86970b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86980b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
86990b57cec5SDimitry Andric                    pred:$p)>;
87000b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_32 :
87010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87020b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
87030b57cec5SDimitry Andric                    pred:$p)>;
87040b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_8 :
87050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87060b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
87070b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87080b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_16 :
87090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87100b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
87110b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87120b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_32 :
87130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87140b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list,
87150b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
87160b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_8 :
87170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87180b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
87190b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87200b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_16 :
87210b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87220b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
87230b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87240b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_32 :
87250b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87260b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list,
87270b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
87280b57cec5SDimitry Andric
87290b57cec5SDimitry Andric
87300b57cec5SDimitry Andric// VLD4 single-lane pseudo-instructions. These need special handling for
87310b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
87320b57cec5SDimitry Andricdef VLD4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
87330b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87340b57cec5SDimitry Andric                    pred:$p)>;
87350b57cec5SDimitry Andricdef VLD4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87360b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87370b57cec5SDimitry Andric                    pred:$p)>;
87380b57cec5SDimitry Andricdef VLD4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87390b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87400b57cec5SDimitry Andric                    pred:$p)>;
87410b57cec5SDimitry Andricdef VLD4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87420b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87430b57cec5SDimitry Andric                    pred:$p)>;
87440b57cec5SDimitry Andricdef VLD4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87450b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87460b57cec5SDimitry Andric                    pred:$p)>;
87470b57cec5SDimitry Andric
87480b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_8 :
87490b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
87500b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87510b57cec5SDimitry Andric                    pred:$p)>;
87520b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_16 :
87530b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87540b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87550b57cec5SDimitry Andric                    pred:$p)>;
87560b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_32 :
87570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87580b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87590b57cec5SDimitry Andric                    pred:$p)>;
87600b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_16 :
87610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87620b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87630b57cec5SDimitry Andric                    pred:$p)>;
87640b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_32 :
87650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87660b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87670b57cec5SDimitry Andric                    pred:$p)>;
87680b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_8 :
87690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87700b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87710b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87720b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_16 :
87730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87740b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87750b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87760b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_32 :
87770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87780b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
87790b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
87800b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_16 :
87810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87820b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87830b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87840b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_32 :
87850b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87860b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
87870b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
87880b57cec5SDimitry Andric
87890b57cec5SDimitry Andric
87900b57cec5SDimitry Andric
87910b57cec5SDimitry Andric// VLD4 multiple structure pseudo-instructions. These need special handling for
87920b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
87930b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
87940b57cec5SDimitry Andricdef VLD4dAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
87950b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87960b57cec5SDimitry Andric                pred:$p)>;
87970b57cec5SDimitry Andricdef VLD4dAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87980b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87990b57cec5SDimitry Andric                pred:$p)>;
88000b57cec5SDimitry Andricdef VLD4dAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
88010b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88020b57cec5SDimitry Andric                pred:$p)>;
88030b57cec5SDimitry Andricdef VLD4qAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
88040b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88050b57cec5SDimitry Andric                pred:$p)>;
88060b57cec5SDimitry Andricdef VLD4qAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
88070b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88080b57cec5SDimitry Andric                pred:$p)>;
88090b57cec5SDimitry Andricdef VLD4qAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
88100b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88110b57cec5SDimitry Andric                pred:$p)>;
88120b57cec5SDimitry Andric
88130b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_8 :
88140b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
88150b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88160b57cec5SDimitry Andric                pred:$p)>;
88170b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_16 :
88180b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
88190b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88200b57cec5SDimitry Andric                pred:$p)>;
88210b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_32 :
88220b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
88230b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88240b57cec5SDimitry Andric                pred:$p)>;
88250b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_8 :
88260b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
88270b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88280b57cec5SDimitry Andric                pred:$p)>;
88290b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_16 :
88300b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
88310b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88320b57cec5SDimitry Andric                pred:$p)>;
88330b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_32 :
88340b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
88350b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88360b57cec5SDimitry Andric                pred:$p)>;
88370b57cec5SDimitry Andricdef VLD4dWB_register_Asm_8 :
88380b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
88390b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88400b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88410b57cec5SDimitry Andricdef VLD4dWB_register_Asm_16 :
88420b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
88430b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88440b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88450b57cec5SDimitry Andricdef VLD4dWB_register_Asm_32 :
88460b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
88470b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88480b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88490b57cec5SDimitry Andricdef VLD4qWB_register_Asm_8 :
88500b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
88510b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88520b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88530b57cec5SDimitry Andricdef VLD4qWB_register_Asm_16 :
88540b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
88550b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88560b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88570b57cec5SDimitry Andricdef VLD4qWB_register_Asm_32 :
88580b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
88590b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88600b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88610b57cec5SDimitry Andric
88620b57cec5SDimitry Andric// VST4 single-lane pseudo-instructions. These need special handling for
88630b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
88640b57cec5SDimitry Andricdef VST4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
88650b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
88660b57cec5SDimitry Andric                    pred:$p)>;
88670b57cec5SDimitry Andricdef VST4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88680b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
88690b57cec5SDimitry Andric                    pred:$p)>;
88700b57cec5SDimitry Andricdef VST4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88710b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
88720b57cec5SDimitry Andric                    pred:$p)>;
88730b57cec5SDimitry Andricdef VST4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88740b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
88750b57cec5SDimitry Andric                    pred:$p)>;
88760b57cec5SDimitry Andricdef VST4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88770b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
88780b57cec5SDimitry Andric                    pred:$p)>;
88790b57cec5SDimitry Andric
88800b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_8 :
88810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
88820b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
88830b57cec5SDimitry Andric                    pred:$p)>;
88840b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_16 :
88850b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88860b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
88870b57cec5SDimitry Andric                    pred:$p)>;
88880b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_32 :
88890b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88900b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
88910b57cec5SDimitry Andric                    pred:$p)>;
88920b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_16 :
88930b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88940b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
88950b57cec5SDimitry Andric                    pred:$p)>;
88960b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_32 :
88970b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88980b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
88990b57cec5SDimitry Andric                    pred:$p)>;
89000b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_8 :
89010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
89020b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
89030b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89040b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_16 :
89050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89060b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
89070b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89080b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_32 :
89090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89100b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
89110b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
89120b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_16 :
89130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89140b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
89150b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89160b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_32 :
89170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89180b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
89190b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
89200b57cec5SDimitry Andric
89210b57cec5SDimitry Andric
89220b57cec5SDimitry Andric// VST4 multiple structure pseudo-instructions. These need special handling for
89230b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
89240b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
89250b57cec5SDimitry Andricdef VST4dAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
89260b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89270b57cec5SDimitry Andric                    pred:$p)>;
89280b57cec5SDimitry Andricdef VST4dAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
89290b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89300b57cec5SDimitry Andric                    pred:$p)>;
89310b57cec5SDimitry Andricdef VST4dAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
89320b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89330b57cec5SDimitry Andric                    pred:$p)>;
89340b57cec5SDimitry Andricdef VST4qAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
89350b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89360b57cec5SDimitry Andric                    pred:$p)>;
89370b57cec5SDimitry Andricdef VST4qAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
89380b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89390b57cec5SDimitry Andric                    pred:$p)>;
89400b57cec5SDimitry Andricdef VST4qAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
89410b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89420b57cec5SDimitry Andric                    pred:$p)>;
89430b57cec5SDimitry Andric
89440b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_8 :
89450b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
89460b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89470b57cec5SDimitry Andric                    pred:$p)>;
89480b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_16 :
89490b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
89500b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89510b57cec5SDimitry Andric                    pred:$p)>;
89520b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_32 :
89530b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
89540b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89550b57cec5SDimitry Andric                    pred:$p)>;
89560b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_8 :
89570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
89580b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89590b57cec5SDimitry Andric                    pred:$p)>;
89600b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_16 :
89610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
89620b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89630b57cec5SDimitry Andric                    pred:$p)>;
89640b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_32 :
89650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
89660b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89670b57cec5SDimitry Andric                    pred:$p)>;
89680b57cec5SDimitry Andricdef VST4dWB_register_Asm_8 :
89690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
89700b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89710b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89720b57cec5SDimitry Andricdef VST4dWB_register_Asm_16 :
89730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89740b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89750b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89760b57cec5SDimitry Andricdef VST4dWB_register_Asm_32 :
89770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89780b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89790b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89800b57cec5SDimitry Andricdef VST4qWB_register_Asm_8 :
89810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
89820b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89830b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89840b57cec5SDimitry Andricdef VST4qWB_register_Asm_16 :
89850b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89860b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89870b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89880b57cec5SDimitry Andricdef VST4qWB_register_Asm_32 :
89890b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89900b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89910b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89920b57cec5SDimitry Andric
89930b57cec5SDimitry Andric// VMOV/VMVN takes an optional datatype suffix
89940b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
89950b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
89960b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
89970b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
89980b57cec5SDimitry Andric
89990b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
90000b57cec5SDimitry Andric                         (VMVNd DPR:$Vd, DPR:$Vm, pred:$p)>;
90010b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
90020b57cec5SDimitry Andric                         (VMVNq QPR:$Vd, QPR:$Vm, pred:$p)>;
90030b57cec5SDimitry Andric
90040b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
90050b57cec5SDimitry Andric// D-register versions.
90060b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Dd, $Dn, $Dm",
90070b57cec5SDimitry Andric                    (VCGEsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90080b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Dd, $Dn, $Dm",
90090b57cec5SDimitry Andric                    (VCGEsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90100b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Dd, $Dn, $Dm",
90110b57cec5SDimitry Andric                    (VCGEsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90120b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Dd, $Dn, $Dm",
90130b57cec5SDimitry Andric                    (VCGEuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90140b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Dd, $Dn, $Dm",
90150b57cec5SDimitry Andric                    (VCGEuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90160b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Dd, $Dn, $Dm",
90170b57cec5SDimitry Andric                    (VCGEuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90180b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Dd, $Dn, $Dm",
90190b57cec5SDimitry Andric                    (VCGEfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90200b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90210b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Dd, $Dn, $Dm",
90220b57cec5SDimitry Andric                    (VCGEhd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90230b57cec5SDimitry Andric// Q-register versions.
90240b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Qd, $Qn, $Qm",
90250b57cec5SDimitry Andric                    (VCGEsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90260b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Qd, $Qn, $Qm",
90270b57cec5SDimitry Andric                    (VCGEsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90280b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Qd, $Qn, $Qm",
90290b57cec5SDimitry Andric                    (VCGEsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90300b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Qd, $Qn, $Qm",
90310b57cec5SDimitry Andric                    (VCGEuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90320b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Qd, $Qn, $Qm",
90330b57cec5SDimitry Andric                    (VCGEuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90340b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Qd, $Qn, $Qm",
90350b57cec5SDimitry Andric                    (VCGEuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90360b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Qd, $Qn, $Qm",
90370b57cec5SDimitry Andric                    (VCGEfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90380b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90390b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Qd, $Qn, $Qm",
90400b57cec5SDimitry Andric                    (VCGEhq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90410b57cec5SDimitry Andric
90420b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
90430b57cec5SDimitry Andric// D-register versions.
90440b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Dd, $Dn, $Dm",
90450b57cec5SDimitry Andric                    (VCGTsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90460b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Dd, $Dn, $Dm",
90470b57cec5SDimitry Andric                    (VCGTsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90480b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Dd, $Dn, $Dm",
90490b57cec5SDimitry Andric                    (VCGTsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90500b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Dd, $Dn, $Dm",
90510b57cec5SDimitry Andric                    (VCGTuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90520b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Dd, $Dn, $Dm",
90530b57cec5SDimitry Andric                    (VCGTuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90540b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Dd, $Dn, $Dm",
90550b57cec5SDimitry Andric                    (VCGTuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90560b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Dd, $Dn, $Dm",
90570b57cec5SDimitry Andric                    (VCGTfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90580b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90590b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Dd, $Dn, $Dm",
90600b57cec5SDimitry Andric                    (VCGThd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90610b57cec5SDimitry Andric// Q-register versions.
90620b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Qd, $Qn, $Qm",
90630b57cec5SDimitry Andric                    (VCGTsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90640b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Qd, $Qn, $Qm",
90650b57cec5SDimitry Andric                    (VCGTsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90660b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Qd, $Qn, $Qm",
90670b57cec5SDimitry Andric                    (VCGTsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90680b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Qd, $Qn, $Qm",
90690b57cec5SDimitry Andric                    (VCGTuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90700b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Qd, $Qn, $Qm",
90710b57cec5SDimitry Andric                    (VCGTuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90720b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Qd, $Qn, $Qm",
90730b57cec5SDimitry Andric                    (VCGTuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90740b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Qd, $Qn, $Qm",
90750b57cec5SDimitry Andric                    (VCGTfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90760b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90770b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Qd, $Qn, $Qm",
90780b57cec5SDimitry Andric                    (VCGThq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90790b57cec5SDimitry Andric
90800b57cec5SDimitry Andric// VSWP allows, but does not require, a type suffix.
90810b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
90820b57cec5SDimitry Andric                         (VSWPd DPR:$Vd, DPR:$Vm, pred:$p)>;
90830b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
90840b57cec5SDimitry Andric                         (VSWPq QPR:$Vd, QPR:$Vm, pred:$p)>;
90850b57cec5SDimitry Andric
90860b57cec5SDimitry Andric// VBIF, VBIT, and VBSL allow, but do not require, a type suffix.
90870b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
90880b57cec5SDimitry Andric                         (VBIFd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90890b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
90900b57cec5SDimitry Andric                         (VBITd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90910b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
90920b57cec5SDimitry Andric                         (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90930b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
90940b57cec5SDimitry Andric                         (VBIFq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90950b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
90960b57cec5SDimitry Andric                         (VBITq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90970b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
90980b57cec5SDimitry Andric                         (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90990b57cec5SDimitry Andric
91000b57cec5SDimitry Andric// "vmov Rd, #-imm" can be handled via "vmvn".
91010b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
91020b57cec5SDimitry Andric                    (VMVNv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
91030b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
91040b57cec5SDimitry Andric                    (VMVNv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
91050b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
91060b57cec5SDimitry Andric                    (VMOVv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
91070b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
91080b57cec5SDimitry Andric                    (VMOVv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
91090b57cec5SDimitry Andric
91100b57cec5SDimitry Andric// 'gas' compatibility aliases for quad-word instructions. Strictly speaking,
91110b57cec5SDimitry Andric// these should restrict to just the Q register variants, but the register
91120b57cec5SDimitry Andric// classes are enough to match correctly regardless, so we keep it simple
91130b57cec5SDimitry Andric// and just use MnemonicAlias.
91140b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vbicq", "vbic">;
91150b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vandq", "vand">;
91160b57cec5SDimitry Andricdef : NEONMnemonicAlias<"veorq", "veor">;
91170b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vorrq", "vorr">;
91180b57cec5SDimitry Andric
91190b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq", "vmov">;
91200b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmvnq", "vmvn">;
91210b57cec5SDimitry Andric// Explicit versions for floating point so that the FPImm variants get
91220b57cec5SDimitry Andric// handled early. The parser gets confused otherwise.
91230b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f32", "vmov.f32">;
91240b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f64", "vmov.f64">;
91250b57cec5SDimitry Andric
91260b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vaddq", "vadd">;
91270b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vsubq", "vsub">;
91280b57cec5SDimitry Andric
91290b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vminq", "vmin">;
91300b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmaxq", "vmax">;
91310b57cec5SDimitry Andric
91320b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmulq", "vmul">;
91330b57cec5SDimitry Andric
91340b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vabsq", "vabs">;
91350b57cec5SDimitry Andric
91360b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshlq", "vshl">;
91370b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshrq", "vshr">;
91380b57cec5SDimitry Andric
91390b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcvtq", "vcvt">;
91400b57cec5SDimitry Andric
91410b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcleq", "vcle">;
91420b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vceqq", "vceq">;
91430b57cec5SDimitry Andric
91440b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vzipq", "vzip">;
91450b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vswpq", "vswp">;
91460b57cec5SDimitry Andric
91470b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.f32", "vrecpe.f32">;
91480b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.u32", "vrecpe.u32">;
91490b57cec5SDimitry Andric
91500b57cec5SDimitry Andric
91510b57cec5SDimitry Andric// Alias for loading floating point immediates that aren't representable
91520b57cec5SDimitry Andric// using the vmov.f32 encoding but the bitpattern is representable using
91530b57cec5SDimitry Andric// the .i32 encoding.
91540b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
91550b57cec5SDimitry Andric                     (VMOVv4i32 QPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
91560b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
91570b57cec5SDimitry Andric                     (VMOVv2i32 DPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
91585ffd83dbSDimitry Andric
91595ffd83dbSDimitry Andric// ARMv8.6a BFloat16 instructions.
91605ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
91615ffd83dbSDimitry Andricclass BF16VDOT<bits<5> op27_23, bits<2> op21_20, bit op6,
91625ffd83dbSDimitry Andric               dag oops, dag iops, list<dag> pattern>
91635ffd83dbSDimitry Andric   : N3Vnp<op27_23, op21_20, 0b1101, op6, 0, oops, iops,
91645ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "", pattern>
91655ffd83dbSDimitry Andric{
91665ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91675ffd83dbSDimitry Andric}
91685ffd83dbSDimitry Andric
91695ffd83dbSDimitry Andricclass BF16VDOTS<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy, ValueType InputTy>
91705ffd83dbSDimitry Andric   : BF16VDOT<0b11000, 0b00,  Q, (outs RegTy:$dst),
91715ffd83dbSDimitry Andric              (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
91725ffd83dbSDimitry Andric            [(set (AccumTy RegTy:$dst),
91735ffd83dbSDimitry Andric                  (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
91745ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vn),
91755ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vm)))]> {
91765ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
91775ffd83dbSDimitry Andric  let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
91785ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91795ffd83dbSDimitry Andric}
91805ffd83dbSDimitry Andric
91815ffd83dbSDimitry Andricmulticlass BF16VDOTI<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy,
91825ffd83dbSDimitry Andric                     ValueType InputTy, dag RHS> {
91835ffd83dbSDimitry Andric
91845ffd83dbSDimitry Andric  def "" : BF16VDOT<0b11100, 0b00, Q, (outs RegTy:$dst),
91855ffd83dbSDimitry Andric                    (ins RegTy:$Vd, RegTy:$Vn,
91865ffd83dbSDimitry Andric                    DPR_VFP2:$Vm, VectorIndex32:$lane), []> {
91875ffd83dbSDimitry Andric    bit lane;
91885ffd83dbSDimitry Andric    let Inst{5} = lane;
91895ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
91905ffd83dbSDimitry Andric    let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm$lane");
91915ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91925ffd83dbSDimitry Andric  }
91935ffd83dbSDimitry Andric
91945ffd83dbSDimitry Andric  def : Pat<
91955ffd83dbSDimitry Andric    (AccumTy (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
91965ffd83dbSDimitry Andric                                 (InputTy RegTy:$Vn),
91975ffd83dbSDimitry Andric                                 (InputTy (bitconvert (AccumTy
91985ffd83dbSDimitry Andric                                          (ARMvduplane (AccumTy RegTy:$Vm),
91995ffd83dbSDimitry Andric                                                        VectorIndex32:$lane)))))),
92005ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
92015ffd83dbSDimitry Andric}
92025ffd83dbSDimitry Andric
9203e8d8bef9SDimitry Andricdef BF16VDOTS_VDOTD : BF16VDOTS<0, DPR, "vdot", v2f32, v4bf16>;
9204e8d8bef9SDimitry Andricdef BF16VDOTS_VDOTQ : BF16VDOTS<1, QPR, "vdot", v4f32, v8bf16>;
92055ffd83dbSDimitry Andric
9206e8d8bef9SDimitry Andricdefm BF16VDOTI_VDOTD : BF16VDOTI<0, DPR, "vdot", v2f32, v4bf16, (v2f32 DPR_VFP2:$Vm)>;
9207e8d8bef9SDimitry Andricdefm BF16VDOTI_VDOTQ : BF16VDOTI<1, QPR, "vdot", v4f32, v8bf16, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
92085ffd83dbSDimitry Andric
92095ffd83dbSDimitry Andricclass BF16MM<bit Q, RegisterClass RegTy,
92105ffd83dbSDimitry Andric             string opc>
92115ffd83dbSDimitry Andric   : N3Vnp<0b11000, 0b00, 0b1100, Q, 0,
92125ffd83dbSDimitry Andric           (outs RegTy:$dst), (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
92135ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "",
92145ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst), (int_arm_neon_bfmmla (v4f32 QPR:$Vd),
9215e8d8bef9SDimitry Andric                                                (v8bf16 QPR:$Vn),
9216e8d8bef9SDimitry Andric                                                (v8bf16 QPR:$Vm)))]> {
92175ffd83dbSDimitry Andric   let Constraints = "$dst = $Vd";
92185ffd83dbSDimitry Andric   let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
92195ffd83dbSDimitry Andric   let DecoderNamespace = "VFPV8";
92205ffd83dbSDimitry Andric}
92215ffd83dbSDimitry Andric
92225ffd83dbSDimitry Andricdef VMMLA : BF16MM<1, QPR, "vmmla">;
92235ffd83dbSDimitry Andric
92245ffd83dbSDimitry Andricclass VBF16MALQ<bit T, string suffix, SDPatternOperator OpNode>
92255ffd83dbSDimitry Andric  : N3VCP8<0b00, 0b11, T, 1,
92265ffd83dbSDimitry Andric           (outs QPR:$dst), (ins QPR:$Vd, QPR:$Vn, QPR:$Vm),
92275ffd83dbSDimitry Andric           NoItinerary, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm", "",
92285ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst),
92295ffd83dbSDimitry Andric                      (OpNode (v4f32 QPR:$Vd),
9230e8d8bef9SDimitry Andric                              (v8bf16 QPR:$Vn),
9231e8d8bef9SDimitry Andric                              (v8bf16 QPR:$Vm)))]> {
92325ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
92335ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
92345ffd83dbSDimitry Andric}
92355ffd83dbSDimitry Andric
92365ffd83dbSDimitry Andricdef VBF16MALTQ: VBF16MALQ<1, "t", int_arm_neon_bfmlalt>;
92375ffd83dbSDimitry Andricdef VBF16MALBQ: VBF16MALQ<0, "b", int_arm_neon_bfmlalb>;
92385ffd83dbSDimitry Andric
92395ffd83dbSDimitry Andricmulticlass VBF16MALQI<bit T, string suffix, SDPatternOperator OpNode> {
92405ffd83dbSDimitry Andric  def "" : N3VLaneCP8<0, 0b11, T, 1, (outs QPR:$dst),
92415ffd83dbSDimitry Andric              (ins QPR:$Vd, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
92425ffd83dbSDimitry Andric               IIC_VMACD, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm$idx", "", []> {
92435ffd83dbSDimitry Andric  bits<2> idx;
92445ffd83dbSDimitry Andric  let Inst{5} = idx{1};
92455ffd83dbSDimitry Andric  let Inst{3} = idx{0};
92465ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
92475ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
92485ffd83dbSDimitry Andric  }
92495ffd83dbSDimitry Andric
92505ffd83dbSDimitry Andric  def : Pat<
92515ffd83dbSDimitry Andric    (v4f32 (OpNode (v4f32 QPR:$Vd),
9252e8d8bef9SDimitry Andric                   (v8bf16 QPR:$Vn),
9253e8d8bef9SDimitry Andric                   (v8bf16 (ARMvduplane (v8bf16 QPR:$Vm),
9254e8d8bef9SDimitry Andric                            VectorIndex16:$lane)))),
92555ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) QPR:$Vd,
92565ffd83dbSDimitry Andric                              QPR:$Vn,
92575ffd83dbSDimitry Andric                              (EXTRACT_SUBREG QPR:$Vm,
92585ffd83dbSDimitry Andric                                (DSubReg_i16_reg VectorIndex16:$lane)),
92595ffd83dbSDimitry Andric                              (SubReg_i16_lane VectorIndex16:$lane))>;
92605ffd83dbSDimitry Andric}
92615ffd83dbSDimitry Andric
92625ffd83dbSDimitry Andricdefm VBF16MALTQI: VBF16MALQI<1, "t", int_arm_neon_bfmlalt>;
92635ffd83dbSDimitry Andricdefm VBF16MALBQI: VBF16MALQI<0, "b", int_arm_neon_bfmlalb>;
92645ffd83dbSDimitry Andric
92655ffd83dbSDimitry Andricdef BF16_VCVT :  N2V<0b11, 0b11, 0b01, 0b10, 0b01100, 1, 0,
92665ffd83dbSDimitry Andric                    (outs DPR:$Vd), (ins QPR:$Vm),
92675ffd83dbSDimitry Andric                    NoItinerary, "vcvt", "bf16.f32", "$Vd, $Vm", "", []>;
92685ffd83dbSDimitry Andric}
92695ffd83dbSDimitry Andric// End of BFloat16 instructions
9270