xref: /freebsd/contrib/llvm-project/llvm/lib/Target/ARM/ARMInstrNEON.td (revision 81ad626541db97eb356e2c1d4a20eb2a26a766ab)
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), [{
4420b57cec5SDimitry Andric  return cast<LoadSDNode>(N)->getAlignment() >= 8;
4430b57cec5SDimitry Andric}]>;
4440b57cec5SDimitry Andricdef dword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4450b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
4460b57cec5SDimitry Andric  return cast<StoreSDNode>(N)->getAlignment() >= 8;
4470b57cec5SDimitry Andric}]>;
4480b57cec5SDimitry Andricdef word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
4490b57cec5SDimitry Andric  return cast<LoadSDNode>(N)->getAlignment() == 4;
4500b57cec5SDimitry Andric}]>;
4510b57cec5SDimitry Andricdef word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4520b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
4530b57cec5SDimitry Andric  return cast<StoreSDNode>(N)->getAlignment() == 4;
4540b57cec5SDimitry Andric}]>;
4550b57cec5SDimitry Andricdef hword_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
4560b57cec5SDimitry Andric  return cast<LoadSDNode>(N)->getAlignment() == 2;
4570b57cec5SDimitry Andric}]>;
4580b57cec5SDimitry Andricdef hword_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4590b57cec5SDimitry Andric                                 (store node:$val, node:$ptr), [{
4600b57cec5SDimitry Andric  return cast<StoreSDNode>(N)->getAlignment() == 2;
4610b57cec5SDimitry Andric}]>;
4620b57cec5SDimitry Andricdef byte_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
4630b57cec5SDimitry Andric  return cast<LoadSDNode>(N)->getAlignment() == 1;
4640b57cec5SDimitry Andric}]>;
4650b57cec5SDimitry Andricdef byte_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4660b57cec5SDimitry Andric                             (store node:$val, node:$ptr), [{
4670b57cec5SDimitry Andric  return cast<StoreSDNode>(N)->getAlignment() == 1;
4680b57cec5SDimitry Andric}]>;
4690b57cec5SDimitry Andricdef non_word_alignedload : PatFrag<(ops node:$ptr), (load node:$ptr), [{
4700b57cec5SDimitry Andric  return cast<LoadSDNode>(N)->getAlignment() < 4;
4710b57cec5SDimitry Andric}]>;
4720b57cec5SDimitry Andricdef non_word_alignedstore : PatFrag<(ops node:$val, node:$ptr),
4730b57cec5SDimitry Andric                                    (store node:$val, node:$ptr), [{
4740b57cec5SDimitry Andric  return cast<StoreSDNode>(N)->getAlignment() < 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
14940b57cec5SDimitry Andricdef VLD2DUPq8EvenPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14950b57cec5SDimitry Andricdef VLD2DUPq8OddPseudo   : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14960b57cec5SDimitry Andricdef VLD2DUPq16EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14970b57cec5SDimitry Andricdef VLD2DUPq16OddPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14980b57cec5SDimitry Andricdef VLD2DUPq32EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14990b57cec5SDimitry Andricdef VLD2DUPq32OddPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
15000b57cec5SDimitry Andric
15010b57cec5SDimitry Andric// ...with address register writeback:
15020b57cec5SDimitry Andricmulticlass VLD2DUPWB<bits<4> op7_4, string Dt, RegisterOperand VdTy,
15030b57cec5SDimitry Andric                     Operand AddrMode> {
15040b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1101, op7_4,
15050b57cec5SDimitry Andric                     (outs VdTy:$Vd, GPR:$wb),
15060b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD2dupu,
15070b57cec5SDimitry Andric                     "vld2", Dt, "$Vd, $Rn!",
15080b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15090b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
15100b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15110b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15120b57cec5SDimitry Andric  }
15130b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1101, op7_4,
15140b57cec5SDimitry Andric                        (outs VdTy:$Vd, GPR:$wb),
15150b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD2dupu,
15160b57cec5SDimitry Andric                        "vld2", Dt, "$Vd, $Rn, $Rm",
15170b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15180b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15190b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15200b57cec5SDimitry Andric  }
15210b57cec5SDimitry Andric}
15220b57cec5SDimitry Andric
15230b57cec5SDimitry Andricdefm VLD2DUPd8wb    : VLD2DUPWB<{0,0,0,0}, "8",  VecListDPairAllLanes,
15240b57cec5SDimitry Andric                                addrmode6dupalign16>;
15250b57cec5SDimitry Andricdefm VLD2DUPd16wb   : VLD2DUPWB<{0,1,0,?}, "16", VecListDPairAllLanes,
15260b57cec5SDimitry Andric                                addrmode6dupalign32>;
15270b57cec5SDimitry Andricdefm VLD2DUPd32wb   : VLD2DUPWB<{1,0,0,?}, "32", VecListDPairAllLanes,
15280b57cec5SDimitry Andric                                addrmode6dupalign64>;
15290b57cec5SDimitry Andric
15300b57cec5SDimitry Andricdefm VLD2DUPd8x2wb  : VLD2DUPWB<{0,0,1,0}, "8",  VecListDPairSpacedAllLanes,
15310b57cec5SDimitry Andric                                addrmode6dupalign16>;
15320b57cec5SDimitry Andricdefm VLD2DUPd16x2wb : VLD2DUPWB<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
15330b57cec5SDimitry Andric                                addrmode6dupalign32>;
15340b57cec5SDimitry Andricdefm VLD2DUPd32x2wb : VLD2DUPWB<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
15350b57cec5SDimitry Andric                                addrmode6dupalign64>;
15360b57cec5SDimitry Andric
1537fe6060f1SDimitry Andricdef VLD2DUPq8OddPseudoWB_fixed     : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1538fe6060f1SDimitry Andricdef VLD2DUPq16OddPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1539fe6060f1SDimitry Andricdef VLD2DUPq32OddPseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1540fe6060f1SDimitry Andricdef VLD2DUPq8OddPseudoWB_register  : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1541fe6060f1SDimitry Andricdef VLD2DUPq16OddPseudoWB_register : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1542fe6060f1SDimitry Andricdef VLD2DUPq32OddPseudoWB_register : VLDQQWBPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
1543fe6060f1SDimitry Andric
15440b57cec5SDimitry Andric//   VLD3DUP  : Vector Load (single 3-element structure to all lanes)
15450b57cec5SDimitry Andricclass VLD3DUP<bits<4> op7_4, string Dt>
15460b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
15470b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD3dup,
15480b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []>,
15490b57cec5SDimitry Andric    Sched<[WriteVLD2]> {
15500b57cec5SDimitry Andric  let Rm = 0b1111;
15510b57cec5SDimitry Andric  let Inst{4} = 0;
15520b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15530b57cec5SDimitry Andric}
15540b57cec5SDimitry Andric
15550b57cec5SDimitry Andricdef VLD3DUPd8  : VLD3DUP<{0,0,0,?}, "8">;
15560b57cec5SDimitry Andricdef VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
15570b57cec5SDimitry Andricdef VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
15580b57cec5SDimitry Andric
15590b57cec5SDimitry Andricdef VLD3DUPd8Pseudo  : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15600b57cec5SDimitry Andricdef VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15610b57cec5SDimitry Andricdef VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15620b57cec5SDimitry Andric
15630b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
15640b57cec5SDimitry Andricdef VLD3DUPq8  : VLD3DUP<{0,0,1,?}, "8">;
15650b57cec5SDimitry Andricdef VLD3DUPq16 : VLD3DUP<{0,1,1,?}, "16">;
15660b57cec5SDimitry Andricdef VLD3DUPq32 : VLD3DUP<{1,0,1,?}, "32">;
15670b57cec5SDimitry Andric
15680b57cec5SDimitry Andricdef VLD3DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15690b57cec5SDimitry Andricdef VLD3DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15700b57cec5SDimitry Andricdef VLD3DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15710b57cec5SDimitry Andricdef VLD3DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15720b57cec5SDimitry Andricdef VLD3DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15730b57cec5SDimitry Andricdef VLD3DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15740b57cec5SDimitry Andric
15750b57cec5SDimitry Andric// ...with address register writeback:
15760b57cec5SDimitry Andricclass VLD3DUPWB<bits<4> op7_4, string Dt, Operand AddrMode>
15770b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
15780b57cec5SDimitry Andric          (ins AddrMode:$Rn, am6offset:$Rm), IIC_VLD3dupu,
15790b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
15800b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
15810b57cec5SDimitry Andric  let Inst{4} = 0;
15820b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15830b57cec5SDimitry Andric}
15840b57cec5SDimitry Andric
15850b57cec5SDimitry Andricdef VLD3DUPd8_UPD  : VLD3DUPWB<{0,0,0,0}, "8",  addrmode6dupalign64>;
15860b57cec5SDimitry Andricdef VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16", addrmode6dupalign64>;
15870b57cec5SDimitry Andricdef VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32", addrmode6dupalign64>;
15880b57cec5SDimitry Andric
15890b57cec5SDimitry Andricdef VLD3DUPq8_UPD  : VLD3DUPWB<{0,0,1,0}, "8",  addrmode6dupalign64>;
15900b57cec5SDimitry Andricdef VLD3DUPq16_UPD : VLD3DUPWB<{0,1,1,?}, "16", addrmode6dupalign64>;
15910b57cec5SDimitry Andricdef VLD3DUPq32_UPD : VLD3DUPWB<{1,0,1,?}, "32", addrmode6dupalign64>;
15920b57cec5SDimitry Andric
15930b57cec5SDimitry Andricdef VLD3DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15940b57cec5SDimitry Andricdef VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15950b57cec5SDimitry Andricdef VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15960b57cec5SDimitry Andric
1597fe6060f1SDimitry Andricdef VLD3DUPq8OddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1598fe6060f1SDimitry Andricdef VLD3DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1599fe6060f1SDimitry Andricdef VLD3DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
1600fe6060f1SDimitry Andric
16010b57cec5SDimitry Andric//   VLD4DUP  : Vector Load (single 4-element structure to all lanes)
16020b57cec5SDimitry Andricclass VLD4DUP<bits<4> op7_4, string Dt>
16030b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
16040b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
16050b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD4dup,
16060b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
16070b57cec5SDimitry Andric  let Rm = 0b1111;
16080b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16090b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
16100b57cec5SDimitry Andric}
16110b57cec5SDimitry Andric
16120b57cec5SDimitry Andricdef VLD4DUPd8  : VLD4DUP<{0,0,0,?}, "8">;
16130b57cec5SDimitry Andricdef VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
16140b57cec5SDimitry Andricdef VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
16150b57cec5SDimitry Andric
16160b57cec5SDimitry Andricdef VLD4DUPd8Pseudo  : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16170b57cec5SDimitry Andricdef VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16180b57cec5SDimitry Andricdef VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16190b57cec5SDimitry Andric
16200b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
16210b57cec5SDimitry Andricdef VLD4DUPq8  : VLD4DUP<{0,0,1,?}, "8">;
16220b57cec5SDimitry Andricdef VLD4DUPq16 : VLD4DUP<{0,1,1,?}, "16">;
16230b57cec5SDimitry Andricdef VLD4DUPq32 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16240b57cec5SDimitry Andric
16250b57cec5SDimitry Andricdef VLD4DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16260b57cec5SDimitry Andricdef VLD4DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16270b57cec5SDimitry Andricdef VLD4DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16280b57cec5SDimitry Andricdef VLD4DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16290b57cec5SDimitry Andricdef VLD4DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16300b57cec5SDimitry Andricdef VLD4DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16310b57cec5SDimitry Andric
16320b57cec5SDimitry Andric// ...with address register writeback:
16330b57cec5SDimitry Andricclass VLD4DUPWB<bits<4> op7_4, string Dt>
16340b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
16350b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
16360b57cec5SDimitry Andric          (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
16370b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
16380b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
16390b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16400b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
16410b57cec5SDimitry Andric}
16420b57cec5SDimitry Andric
16430b57cec5SDimitry Andricdef VLD4DUPd8_UPD  : VLD4DUPWB<{0,0,0,0}, "8">;
16440b57cec5SDimitry Andricdef VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
16450b57cec5SDimitry Andricdef VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
16460b57cec5SDimitry Andric
16470b57cec5SDimitry Andricdef VLD4DUPq8_UPD  : VLD4DUPWB<{0,0,1,0}, "8">;
16480b57cec5SDimitry Andricdef VLD4DUPq16_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
16490b57cec5SDimitry Andricdef VLD4DUPq32_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16500b57cec5SDimitry Andric
16510b57cec5SDimitry Andricdef VLD4DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16520b57cec5SDimitry Andricdef VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16530b57cec5SDimitry Andricdef VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16540b57cec5SDimitry Andric
1655fe6060f1SDimitry Andricdef VLD4DUPq8OddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1656fe6060f1SDimitry Andricdef VLD4DUPq16OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1657fe6060f1SDimitry Andricdef VLD4DUPq32OddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
1658fe6060f1SDimitry Andric
16590b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
16600b57cec5SDimitry Andric
16610b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
16620b57cec5SDimitry Andric
16630b57cec5SDimitry Andric// Classes for VST* pseudo-instructions with multi-register operands.
16640b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
16650b57cec5SDimitry Andricclass VSTQPseudo<InstrItinClass itin>
16660b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
16670b57cec5SDimitry Andricclass VSTQWBPseudo<InstrItinClass itin>
16680b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16690b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
16700b57cec5SDimitry Andric                "$addr.addr = $wb">;
16710b57cec5SDimitry Andricclass VSTQWBfixedPseudo<InstrItinClass itin>
16720b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16730b57cec5SDimitry Andric                (ins addrmode6:$addr, QPR:$src), itin,
16740b57cec5SDimitry Andric                "$addr.addr = $wb">;
16750b57cec5SDimitry Andricclass VSTQWBregisterPseudo<InstrItinClass itin>
16760b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16770b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QPR:$src), itin,
16780b57cec5SDimitry Andric                "$addr.addr = $wb">;
16790b57cec5SDimitry Andricclass VSTQQPseudo<InstrItinClass itin>
16800b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
16810b57cec5SDimitry Andricclass VSTQQWBPseudo<InstrItinClass itin>
16820b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16830b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
16840b57cec5SDimitry Andric                "$addr.addr = $wb">;
16850b57cec5SDimitry Andricclass VSTQQWBfixedPseudo<InstrItinClass itin>
16860b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16870b57cec5SDimitry Andric                (ins addrmode6:$addr, QQPR:$src), itin,
16880b57cec5SDimitry Andric                "$addr.addr = $wb">;
16890b57cec5SDimitry Andricclass VSTQQWBregisterPseudo<InstrItinClass itin>
16900b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16910b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QQPR:$src), itin,
16920b57cec5SDimitry Andric                "$addr.addr = $wb">;
16930b57cec5SDimitry Andric
16940b57cec5SDimitry Andricclass VSTQQQQPseudo<InstrItinClass itin>
16950b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
16960b57cec5SDimitry Andricclass VSTQQQQWBPseudo<InstrItinClass itin>
16970b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16980b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
16990b57cec5SDimitry Andric                "$addr.addr = $wb">;
17000b57cec5SDimitry Andric
17010b57cec5SDimitry Andric//   VST1     : Vector Store (multiple single elements)
17020b57cec5SDimitry Andricclass VST1D<bits<4> op7_4, string Dt, Operand AddrMode>
17030b57cec5SDimitry Andric  : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins AddrMode:$Rn, VecListOneD:$Vd),
17040b57cec5SDimitry Andric          IIC_VST1, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST1]> {
17050b57cec5SDimitry Andric  let Rm = 0b1111;
17060b57cec5SDimitry Andric  let Inst{4} = Rn{4};
17070b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17080b57cec5SDimitry Andric}
17090b57cec5SDimitry Andricclass VST1Q<bits<4> op7_4, string Dt, Operand AddrMode>
17100b57cec5SDimitry Andric  : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins AddrMode:$Rn, VecListDPair:$Vd),
17110b57cec5SDimitry Andric          IIC_VST1x2, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST2]> {
17120b57cec5SDimitry Andric  let Rm = 0b1111;
17130b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
17140b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17150b57cec5SDimitry Andric}
17160b57cec5SDimitry Andric
17170b57cec5SDimitry Andricdef  VST1d8   : VST1D<{0,0,0,?}, "8",  addrmode6align64>;
17180b57cec5SDimitry Andricdef  VST1d16  : VST1D<{0,1,0,?}, "16", addrmode6align64>;
17190b57cec5SDimitry Andricdef  VST1d32  : VST1D<{1,0,0,?}, "32", addrmode6align64>;
17200b57cec5SDimitry Andricdef  VST1d64  : VST1D<{1,1,0,?}, "64", addrmode6align64>;
17210b57cec5SDimitry Andric
17220b57cec5SDimitry Andricdef  VST1q8   : VST1Q<{0,0,?,?}, "8",  addrmode6align64or128>;
17230b57cec5SDimitry Andricdef  VST1q16  : VST1Q<{0,1,?,?}, "16", addrmode6align64or128>;
17240b57cec5SDimitry Andricdef  VST1q32  : VST1Q<{1,0,?,?}, "32", addrmode6align64or128>;
17250b57cec5SDimitry Andricdef  VST1q64  : VST1Q<{1,1,?,?}, "64", addrmode6align64or128>;
17260b57cec5SDimitry Andric
17270b57cec5SDimitry Andric// ...with address register writeback:
17280b57cec5SDimitry Andricmulticlass VST1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17290b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00, 0b0111,op7_4, (outs GPR:$wb),
17300b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListOneD:$Vd), IIC_VLD1u,
17310b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17320b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17330b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17340b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17350b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17360b57cec5SDimitry Andric  }
17370b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0111,op7_4, (outs GPR:$wb),
17380b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListOneD:$Vd),
17390b57cec5SDimitry Andric                        IIC_VLD1u,
17400b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17410b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17420b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17430b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17440b57cec5SDimitry Andric  }
17450b57cec5SDimitry Andric}
17460b57cec5SDimitry Andricmulticlass VST1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17470b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17480b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListDPair:$Vd), IIC_VLD1x2u,
17490b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17500b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17510b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17520b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17530b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17540b57cec5SDimitry Andric  }
17550b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17560b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListDPair:$Vd),
17570b57cec5SDimitry Andric                        IIC_VLD1x2u,
17580b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17590b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17600b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17610b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17620b57cec5SDimitry Andric  }
17630b57cec5SDimitry Andric}
17640b57cec5SDimitry Andric
17650b57cec5SDimitry Andricdefm VST1d8wb  : VST1DWB<{0,0,0,?}, "8",  addrmode6align64>;
17660b57cec5SDimitry Andricdefm VST1d16wb : VST1DWB<{0,1,0,?}, "16", addrmode6align64>;
17670b57cec5SDimitry Andricdefm VST1d32wb : VST1DWB<{1,0,0,?}, "32", addrmode6align64>;
17680b57cec5SDimitry Andricdefm VST1d64wb : VST1DWB<{1,1,0,?}, "64", addrmode6align64>;
17690b57cec5SDimitry Andric
17700b57cec5SDimitry Andricdefm VST1q8wb  : VST1QWB<{0,0,?,?}, "8",  addrmode6align64or128>;
17710b57cec5SDimitry Andricdefm VST1q16wb : VST1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
17720b57cec5SDimitry Andricdefm VST1q32wb : VST1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
17730b57cec5SDimitry Andricdefm VST1q64wb : VST1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
17740b57cec5SDimitry Andric
17750b57cec5SDimitry Andric// ...with 3 registers
17760b57cec5SDimitry Andricclass VST1D3<bits<4> op7_4, string Dt, Operand AddrMode>
17770b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
17780b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListThreeD:$Vd),
17790b57cec5SDimitry Andric          IIC_VST1x3, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST3]> {
17800b57cec5SDimitry Andric  let Rm = 0b1111;
17810b57cec5SDimitry Andric  let Inst{4} = Rn{4};
17820b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17830b57cec5SDimitry Andric}
17840b57cec5SDimitry Andricmulticlass VST1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
17850b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
17860b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListThreeD:$Vd), IIC_VLD1x3u,
17870b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17880b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
17890b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17900b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17910b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17920b57cec5SDimitry Andric  }
17930b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
17940b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListThreeD:$Vd),
17950b57cec5SDimitry Andric                        IIC_VLD1x3u,
17960b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17970b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
17980b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17990b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18000b57cec5SDimitry Andric  }
18010b57cec5SDimitry Andric}
18020b57cec5SDimitry Andric
18030b57cec5SDimitry Andricdef VST1d8T     : VST1D3<{0,0,0,?}, "8",  addrmode6align64>;
18040b57cec5SDimitry Andricdef VST1d16T    : VST1D3<{0,1,0,?}, "16", addrmode6align64>;
18050b57cec5SDimitry Andricdef VST1d32T    : VST1D3<{1,0,0,?}, "32", addrmode6align64>;
18060b57cec5SDimitry Andricdef VST1d64T    : VST1D3<{1,1,0,?}, "64", addrmode6align64>;
18070b57cec5SDimitry Andric
18080b57cec5SDimitry Andricdefm VST1d8Twb  : VST1D3WB<{0,0,0,?}, "8",  addrmode6align64>;
18090b57cec5SDimitry Andricdefm VST1d16Twb : VST1D3WB<{0,1,0,?}, "16", addrmode6align64>;
18100b57cec5SDimitry Andricdefm VST1d32Twb : VST1D3WB<{1,0,0,?}, "32", addrmode6align64>;
18110b57cec5SDimitry Andricdefm VST1d64Twb : VST1D3WB<{1,1,0,?}, "64", addrmode6align64>;
18120b57cec5SDimitry Andric
18130b57cec5SDimitry Andricdef VST1d8TPseudo             : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1814fe6060f1SDimitry Andricdef VST1d8TPseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1815fe6060f1SDimitry Andricdef VST1d8TPseudoWB_register  : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18160b57cec5SDimitry Andricdef VST1d16TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1817fe6060f1SDimitry Andricdef VST1d16TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1818fe6060f1SDimitry Andricdef VST1d16TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18190b57cec5SDimitry Andricdef VST1d32TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1820fe6060f1SDimitry Andricdef VST1d32TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
1821fe6060f1SDimitry Andricdef VST1d32TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18220b57cec5SDimitry Andricdef VST1d64TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18230b57cec5SDimitry Andricdef VST1d64TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18240b57cec5SDimitry Andricdef VST1d64TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
18250b57cec5SDimitry Andric
18260b57cec5SDimitry Andricdef VST1q8HighTPseudo     : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18270b57cec5SDimitry Andricdef VST1q16HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18280b57cec5SDimitry Andricdef VST1q32HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18290b57cec5SDimitry Andricdef VST1q64HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1830fe6060f1SDimitry Andric
1831fe6060f1SDimitry Andricdef VST1q8HighTPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1832fe6060f1SDimitry Andricdef VST1q16HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1833fe6060f1SDimitry Andricdef VST1q32HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1834fe6060f1SDimitry Andricdef VST1q64HighTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1835fe6060f1SDimitry Andric
1836fe6060f1SDimitry Andricdef VST1q8LowTPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1837fe6060f1SDimitry Andricdef VST1q16LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
1838fe6060f1SDimitry Andricdef VST1q32LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18390b57cec5SDimitry Andricdef VST1q64LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18400b57cec5SDimitry Andric
18410b57cec5SDimitry Andric// ...with 4 registers
18420b57cec5SDimitry Andricclass VST1D4<bits<4> op7_4, string Dt, Operand AddrMode>
18430b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
18440b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListFourD:$Vd),
18450b57cec5SDimitry Andric          IIC_VST1x4, "vst1", Dt, "$Vd, $Rn", "",
18460b57cec5SDimitry Andric          []>, Sched<[WriteVST4]> {
18470b57cec5SDimitry Andric  let Rm = 0b1111;
18480b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
18490b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
18500b57cec5SDimitry Andric}
18510b57cec5SDimitry Andricmulticlass VST1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
18520b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18530b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1x4u,
18540b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
18550b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18560b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
18570b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18580b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18590b57cec5SDimitry Andric  }
18600b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18610b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
18620b57cec5SDimitry Andric                        IIC_VLD1x4u,
18630b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
18640b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18650b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18660b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18670b57cec5SDimitry Andric  }
18680b57cec5SDimitry Andric}
18690b57cec5SDimitry Andric
18700b57cec5SDimitry Andricdef VST1d8Q     : VST1D4<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18710b57cec5SDimitry Andricdef VST1d16Q    : VST1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
18720b57cec5SDimitry Andricdef VST1d32Q    : VST1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
18730b57cec5SDimitry Andricdef VST1d64Q    : VST1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
18740b57cec5SDimitry Andric
18750b57cec5SDimitry Andricdefm VST1d8Qwb  : VST1D4WB<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18760b57cec5SDimitry Andricdefm VST1d16Qwb : VST1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
18770b57cec5SDimitry Andricdefm VST1d32Qwb : VST1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
18780b57cec5SDimitry Andricdefm VST1d64Qwb : VST1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
18790b57cec5SDimitry Andric
18800b57cec5SDimitry Andricdef VST1d8QPseudo             : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1881fe6060f1SDimitry Andricdef VST1d8QPseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1882fe6060f1SDimitry Andricdef VST1d8QPseudoWB_register  : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18830b57cec5SDimitry Andricdef VST1d16QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1884fe6060f1SDimitry Andricdef VST1d16QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1885fe6060f1SDimitry Andricdef VST1d16QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18860b57cec5SDimitry Andricdef VST1d32QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1887fe6060f1SDimitry Andricdef VST1d32QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
1888fe6060f1SDimitry Andricdef VST1d32QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18890b57cec5SDimitry Andricdef VST1d64QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18900b57cec5SDimitry Andricdef VST1d64QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18910b57cec5SDimitry Andricdef VST1d64QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18920b57cec5SDimitry Andric
18930b57cec5SDimitry Andricdef VST1q8HighQPseudo     : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18940b57cec5SDimitry Andricdef VST1q16HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18950b57cec5SDimitry Andricdef VST1q32HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18960b57cec5SDimitry Andricdef VST1q64HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1897fe6060f1SDimitry Andric
1898fe6060f1SDimitry Andricdef VST1q8HighQPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1899fe6060f1SDimitry Andricdef VST1q16HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1900fe6060f1SDimitry Andricdef VST1q32HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1901fe6060f1SDimitry Andricdef VST1q64HighQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1902fe6060f1SDimitry Andric
1903fe6060f1SDimitry Andricdef VST1q8LowQPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1904fe6060f1SDimitry Andricdef VST1q16LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
1905fe6060f1SDimitry Andricdef VST1q32LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19060b57cec5SDimitry Andricdef VST1q64LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
19070b57cec5SDimitry Andric
19080b57cec5SDimitry Andric//   VST2     : Vector Store (multiple 2-element structures)
19090b57cec5SDimitry Andricclass VST2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
19100b57cec5SDimitry Andric            InstrItinClass itin, Operand AddrMode>
19110b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs), (ins AddrMode:$Rn, VdTy:$Vd),
19120b57cec5SDimitry Andric          itin, "vst2", Dt, "$Vd, $Rn", "", []> {
19130b57cec5SDimitry Andric  let Rm = 0b1111;
19140b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
19150b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST2Instruction";
19160b57cec5SDimitry Andric}
19170b57cec5SDimitry Andric
19180b57cec5SDimitry Andricdef  VST2d8   : VST2<0b1000, {0,0,?,?}, "8",  VecListDPair, IIC_VST2,
19190b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19200b57cec5SDimitry Andricdef  VST2d16  : VST2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VST2,
19210b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19220b57cec5SDimitry Andricdef  VST2d32  : VST2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VST2,
19230b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
19240b57cec5SDimitry Andric
19250b57cec5SDimitry Andricdef  VST2q8   : VST2<0b0011, {0,0,?,?}, "8",  VecListFourD, IIC_VST2x2,
19260b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19270b57cec5SDimitry Andricdef  VST2q16  : VST2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VST2x2,
19280b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19290b57cec5SDimitry Andricdef  VST2q32  : VST2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VST2x2,
19300b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
19310b57cec5SDimitry Andric
19320b57cec5SDimitry Andricdef  VST2q8Pseudo  : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19330b57cec5SDimitry Andricdef  VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19340b57cec5SDimitry Andricdef  VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
19350b57cec5SDimitry Andric
19360b57cec5SDimitry Andric// ...with address register writeback:
19370b57cec5SDimitry Andricmulticlass VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt,
19380b57cec5SDimitry Andric                   RegisterOperand VdTy, Operand AddrMode> {
19390b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19400b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VdTy:$Vd), IIC_VLD1u,
19410b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
19420b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
19430b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
19440b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19450b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19460b57cec5SDimitry Andric  }
19470b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19480b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VdTy:$Vd), IIC_VLD1u,
19490b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19500b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
19510b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19520b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19530b57cec5SDimitry Andric  }
19540b57cec5SDimitry Andric}
19550b57cec5SDimitry Andricmulticlass VST2QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
19560b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19570b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1u,
19580b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
19590b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19600b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
19610b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19620b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19630b57cec5SDimitry Andric  }
19640b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19650b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
19660b57cec5SDimitry Andric                        IIC_VLD1u,
19670b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19680b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19690b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19700b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19710b57cec5SDimitry Andric  }
19720b57cec5SDimitry Andric}
19730b57cec5SDimitry Andric
19740b57cec5SDimitry Andricdefm VST2d8wb    : VST2DWB<0b1000, {0,0,?,?}, "8",  VecListDPair,
19750b57cec5SDimitry Andric                           addrmode6align64or128>;
19760b57cec5SDimitry Andricdefm VST2d16wb   : VST2DWB<0b1000, {0,1,?,?}, "16", VecListDPair,
19770b57cec5SDimitry Andric                           addrmode6align64or128>;
19780b57cec5SDimitry Andricdefm VST2d32wb   : VST2DWB<0b1000, {1,0,?,?}, "32", VecListDPair,
19790b57cec5SDimitry Andric                           addrmode6align64or128>;
19800b57cec5SDimitry Andric
19810b57cec5SDimitry Andricdefm VST2q8wb    : VST2QWB<{0,0,?,?}, "8", addrmode6align64or128or256>;
19820b57cec5SDimitry Andricdefm VST2q16wb   : VST2QWB<{0,1,?,?}, "16", addrmode6align64or128or256>;
19830b57cec5SDimitry Andricdefm VST2q32wb   : VST2QWB<{1,0,?,?}, "32", addrmode6align64or128or256>;
19840b57cec5SDimitry Andric
19850b57cec5SDimitry Andricdef VST2q8PseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19860b57cec5SDimitry Andricdef VST2q16PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19870b57cec5SDimitry Andricdef VST2q32PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19880b57cec5SDimitry Andricdef VST2q8PseudoWB_register  : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19890b57cec5SDimitry Andricdef VST2q16PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19900b57cec5SDimitry Andricdef VST2q32PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19910b57cec5SDimitry Andric
19920b57cec5SDimitry Andric// ...with double-spaced registers
19930b57cec5SDimitry Andricdef VST2b8      : VST2<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced, IIC_VST2,
19940b57cec5SDimitry Andric                      addrmode6align64or128>;
19950b57cec5SDimitry Andricdef VST2b16     : VST2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VST2,
19960b57cec5SDimitry Andric                      addrmode6align64or128>;
19970b57cec5SDimitry Andricdef VST2b32     : VST2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VST2,
19980b57cec5SDimitry Andric                      addrmode6align64or128>;
19990b57cec5SDimitry Andricdefm VST2b8wb   : VST2DWB<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced,
20000b57cec5SDimitry Andric                          addrmode6align64or128>;
20010b57cec5SDimitry Andricdefm VST2b16wb  : VST2DWB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced,
20020b57cec5SDimitry Andric                          addrmode6align64or128>;
20030b57cec5SDimitry Andricdefm VST2b32wb  : VST2DWB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced,
20040b57cec5SDimitry Andric                          addrmode6align64or128>;
20050b57cec5SDimitry Andric
20060b57cec5SDimitry Andric//   VST3     : Vector Store (multiple 3-element structures)
20070b57cec5SDimitry Andricclass VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
20080b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
20090b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
20100b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []>, Sched<[WriteVST3]> {
20110b57cec5SDimitry Andric  let Rm = 0b1111;
20120b57cec5SDimitry Andric  let Inst{4} = Rn{4};
20130b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
20140b57cec5SDimitry Andric}
20150b57cec5SDimitry Andric
20160b57cec5SDimitry Andricdef  VST3d8   : VST3D<0b0100, {0,0,0,?}, "8">;
20170b57cec5SDimitry Andricdef  VST3d16  : VST3D<0b0100, {0,1,0,?}, "16">;
20180b57cec5SDimitry Andricdef  VST3d32  : VST3D<0b0100, {1,0,0,?}, "32">;
20190b57cec5SDimitry Andric
20200b57cec5SDimitry Andricdef  VST3d8Pseudo  : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20210b57cec5SDimitry Andricdef  VST3d16Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20220b57cec5SDimitry Andricdef  VST3d32Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20230b57cec5SDimitry Andric
20240b57cec5SDimitry Andric// ...with address register writeback:
20250b57cec5SDimitry Andricclass VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
20260b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
20270b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
20280b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
20290b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
20300b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
20310b57cec5SDimitry Andric  let Inst{4} = Rn{4};
20320b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
20330b57cec5SDimitry Andric}
20340b57cec5SDimitry Andric
20350b57cec5SDimitry Andricdef VST3d8_UPD  : VST3DWB<0b0100, {0,0,0,?}, "8">;
20360b57cec5SDimitry Andricdef VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
20370b57cec5SDimitry Andricdef VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
20380b57cec5SDimitry Andric
20390b57cec5SDimitry Andricdef VST3d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20400b57cec5SDimitry Andricdef VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20410b57cec5SDimitry Andricdef VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20420b57cec5SDimitry Andric
20430b57cec5SDimitry Andric// ...with double-spaced registers:
20440b57cec5SDimitry Andricdef VST3q8      : VST3D<0b0101, {0,0,0,?}, "8">;
20450b57cec5SDimitry Andricdef VST3q16     : VST3D<0b0101, {0,1,0,?}, "16">;
20460b57cec5SDimitry Andricdef VST3q32     : VST3D<0b0101, {1,0,0,?}, "32">;
20470b57cec5SDimitry Andricdef VST3q8_UPD  : VST3DWB<0b0101, {0,0,0,?}, "8">;
20480b57cec5SDimitry Andricdef VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
20490b57cec5SDimitry Andricdef VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
20500b57cec5SDimitry Andric
20510b57cec5SDimitry Andricdef VST3q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20520b57cec5SDimitry Andricdef VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20530b57cec5SDimitry Andricdef VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20540b57cec5SDimitry Andric
20550b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
20560b57cec5SDimitry Andricdef VST3q8oddPseudo   : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20570b57cec5SDimitry Andricdef VST3q16oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20580b57cec5SDimitry Andricdef VST3q32oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20590b57cec5SDimitry Andric
20600b57cec5SDimitry Andricdef VST3q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20610b57cec5SDimitry Andricdef VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20620b57cec5SDimitry Andricdef VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20630b57cec5SDimitry Andric
20640b57cec5SDimitry Andric//   VST4     : Vector Store (multiple 4-element structures)
20650b57cec5SDimitry Andricclass VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
20660b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
20670b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
20680b57cec5SDimitry Andric          IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
20690b57cec5SDimitry Andric          "", []>, Sched<[WriteVST4]> {
20700b57cec5SDimitry Andric  let Rm = 0b1111;
20710b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
20720b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
20730b57cec5SDimitry Andric}
20740b57cec5SDimitry Andric
20750b57cec5SDimitry Andricdef  VST4d8   : VST4D<0b0000, {0,0,?,?}, "8">;
20760b57cec5SDimitry Andricdef  VST4d16  : VST4D<0b0000, {0,1,?,?}, "16">;
20770b57cec5SDimitry Andricdef  VST4d32  : VST4D<0b0000, {1,0,?,?}, "32">;
20780b57cec5SDimitry Andric
20790b57cec5SDimitry Andricdef  VST4d8Pseudo  : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20800b57cec5SDimitry Andricdef  VST4d16Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20810b57cec5SDimitry Andricdef  VST4d32Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20820b57cec5SDimitry Andric
20830b57cec5SDimitry Andric// ...with address register writeback:
20840b57cec5SDimitry Andricclass VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
20850b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
20860b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
20870b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
20880b57cec5SDimitry Andric           "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
20890b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
20900b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
20910b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
20920b57cec5SDimitry Andric}
20930b57cec5SDimitry Andric
20940b57cec5SDimitry Andricdef VST4d8_UPD  : VST4DWB<0b0000, {0,0,?,?}, "8">;
20950b57cec5SDimitry Andricdef VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
20960b57cec5SDimitry Andricdef VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
20970b57cec5SDimitry Andric
20980b57cec5SDimitry Andricdef VST4d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20990b57cec5SDimitry Andricdef VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21000b57cec5SDimitry Andricdef VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21010b57cec5SDimitry Andric
21020b57cec5SDimitry Andric// ...with double-spaced registers:
21030b57cec5SDimitry Andricdef VST4q8      : VST4D<0b0001, {0,0,?,?}, "8">;
21040b57cec5SDimitry Andricdef VST4q16     : VST4D<0b0001, {0,1,?,?}, "16">;
21050b57cec5SDimitry Andricdef VST4q32     : VST4D<0b0001, {1,0,?,?}, "32">;
21060b57cec5SDimitry Andricdef VST4q8_UPD  : VST4DWB<0b0001, {0,0,?,?}, "8">;
21070b57cec5SDimitry Andricdef VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
21080b57cec5SDimitry Andricdef VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
21090b57cec5SDimitry Andric
21100b57cec5SDimitry Andricdef VST4q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21110b57cec5SDimitry Andricdef VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21120b57cec5SDimitry Andricdef VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21130b57cec5SDimitry Andric
21140b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
21150b57cec5SDimitry Andricdef VST4q8oddPseudo   : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21160b57cec5SDimitry Andricdef VST4q16oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21170b57cec5SDimitry Andricdef VST4q32oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
21180b57cec5SDimitry Andric
21190b57cec5SDimitry Andricdef VST4q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21200b57cec5SDimitry Andricdef VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21210b57cec5SDimitry Andricdef VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
21220b57cec5SDimitry Andric
21230b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
21240b57cec5SDimitry Andric
21250b57cec5SDimitry Andric// Classes for VST*LN pseudo-instructions with multi-register operands.
21260b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
21270b57cec5SDimitry Andricclass VSTQLNPseudo<InstrItinClass itin>
21280b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
21290b57cec5SDimitry Andric                itin, "">;
21300b57cec5SDimitry Andricclass VSTQLNWBPseudo<InstrItinClass itin>
21310b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21320b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
21330b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21340b57cec5SDimitry Andricclass VSTQQLNPseudo<InstrItinClass itin>
21350b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
21360b57cec5SDimitry Andric                itin, "">;
21370b57cec5SDimitry Andricclass VSTQQLNWBPseudo<InstrItinClass itin>
21380b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21390b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
21400b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21410b57cec5SDimitry Andricclass VSTQQQQLNPseudo<InstrItinClass itin>
21420b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
21430b57cec5SDimitry Andric                itin, "">;
21440b57cec5SDimitry Andricclass VSTQQQQLNWBPseudo<InstrItinClass itin>
21450b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21460b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
21470b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21480b57cec5SDimitry Andric
21490b57cec5SDimitry Andric//   VST1LN   : Vector Store (single element from one lane)
21500b57cec5SDimitry Andricclass VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
21510b57cec5SDimitry Andric             PatFrag StoreOp, SDNode ExtractOp, Operand AddrMode>
21520b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
21530b57cec5SDimitry Andric          (ins AddrMode:$Rn, DPR:$Vd, nohash_imm:$lane),
21540b57cec5SDimitry Andric          IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
21550b57cec5SDimitry Andric          [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), AddrMode:$Rn)]>,
21560b57cec5SDimitry Andric     Sched<[WriteVST1]> {
21570b57cec5SDimitry Andric  let Rm = 0b1111;
21580b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
21590b57cec5SDimitry Andric}
21600b57cec5SDimitry Andricclass VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
21610b57cec5SDimitry Andric  : VSTQLNPseudo<IIC_VST1ln>, Sched<[WriteVST1]> {
21620b57cec5SDimitry Andric  let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
21630b57cec5SDimitry Andric                          addrmode6:$addr)];
21640b57cec5SDimitry Andric}
21650b57cec5SDimitry Andric
21660b57cec5SDimitry Andricdef VST1LNd8  : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
21670b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21680b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
21690b57cec5SDimitry Andric}
21700b57cec5SDimitry Andricdef VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
21710b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21720b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
21730b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
21740b57cec5SDimitry Andric}
21750b57cec5SDimitry Andric
21760b57cec5SDimitry Andricdef VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt,
21770b57cec5SDimitry Andric                       addrmode6oneL32> {
21780b57cec5SDimitry Andric  let Inst{7}   = lane{0};
21790b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
21800b57cec5SDimitry Andric}
21810b57cec5SDimitry Andric
21820b57cec5SDimitry Andricdef VST1LNq8Pseudo  : VST1QLNPseudo<v16i8, truncstorei8, ARMvgetlaneu>;
21830b57cec5SDimitry Andricdef VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, ARMvgetlaneu>;
21840b57cec5SDimitry Andricdef VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
21850b57cec5SDimitry Andric
21860b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
21870b57cec5SDimitry Andricdef : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
21880b57cec5SDimitry Andric          (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
21890b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
21900b57cec5SDimitry Andric          (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
21910b57cec5SDimitry Andric
21920b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f16 DPR:$src), imm:$lane), addrmode6:$addr),
21930b57cec5SDimitry Andric          (VST1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
21940b57cec5SDimitry Andricdef : Pat<(store (extractelt (v8f16 QPR:$src), imm:$lane), addrmode6:$addr),
21950b57cec5SDimitry Andric          (VST1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
21960b57cec5SDimitry Andric}
21970b57cec5SDimitry Andric
21980b57cec5SDimitry Andric// ...with address register writeback:
21990b57cec5SDimitry Andricclass VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
22000b57cec5SDimitry Andric               PatFrag StoreOp, SDNode ExtractOp, Operand AdrMode>
22010b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
22020b57cec5SDimitry Andric          (ins AdrMode:$Rn, am6offset:$Rm,
22030b57cec5SDimitry Andric           DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
22040b57cec5SDimitry Andric          "\\{$Vd[$lane]\\}, $Rn$Rm",
22050b57cec5SDimitry Andric          "$Rn.addr = $wb",
22060b57cec5SDimitry Andric          [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
22070b57cec5SDimitry Andric                                  AdrMode:$Rn, am6offset:$Rm))]>,
22080b57cec5SDimitry Andric    Sched<[WriteVST1]> {
22090b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
22100b57cec5SDimitry Andric}
22110b57cec5SDimitry Andricclass VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
22120b57cec5SDimitry Andric  : VSTQLNWBPseudo<IIC_VST1lnu>, Sched<[WriteVST1]> {
22130b57cec5SDimitry Andric  let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
22140b57cec5SDimitry Andric                                        addrmode6:$addr, am6offset:$offset))];
22150b57cec5SDimitry Andric}
22160b57cec5SDimitry Andric
22170b57cec5SDimitry Andricdef VST1LNd8_UPD  : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
22180b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
22190b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22200b57cec5SDimitry Andric}
22210b57cec5SDimitry Andricdef VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
22220b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
22230b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22240b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22250b57cec5SDimitry Andric}
22260b57cec5SDimitry Andricdef VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
22270b57cec5SDimitry Andric                             extractelt, addrmode6oneL32> {
22280b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22290b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
22300b57cec5SDimitry Andric}
22310b57cec5SDimitry Andric
22320b57cec5SDimitry Andricdef VST1LNq8Pseudo_UPD  : VST1QLNWBPseudo<v16i8, post_truncsti8, ARMvgetlaneu>;
22330b57cec5SDimitry Andricdef VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,ARMvgetlaneu>;
22340b57cec5SDimitry Andricdef VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
22350b57cec5SDimitry Andric
22360b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
22370b57cec5SDimitry Andric
22380b57cec5SDimitry Andric//   VST2LN   : Vector Store (single 2-element structure from one lane)
22390b57cec5SDimitry Andricclass VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
22400b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
22410b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
22420b57cec5SDimitry Andric          IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
22430b57cec5SDimitry Andric          "", []>, Sched<[WriteVST1]> {
22440b57cec5SDimitry Andric  let Rm = 0b1111;
22450b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22460b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22470b57cec5SDimitry Andric}
22480b57cec5SDimitry Andric
22490b57cec5SDimitry Andricdef VST2LNd8  : VST2LN<0b0001, {?,?,?,?}, "8"> {
22500b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22510b57cec5SDimitry Andric}
22520b57cec5SDimitry Andricdef VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
22530b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22540b57cec5SDimitry Andric}
22550b57cec5SDimitry Andricdef VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
22560b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22570b57cec5SDimitry Andric}
22580b57cec5SDimitry Andric
22590b57cec5SDimitry Andricdef VST2LNd8Pseudo  : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22600b57cec5SDimitry Andricdef VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22610b57cec5SDimitry Andricdef VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22620b57cec5SDimitry Andric
22630b57cec5SDimitry Andric// ...with double-spaced registers:
22640b57cec5SDimitry Andricdef VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
22650b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22660b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22670b57cec5SDimitry Andric}
22680b57cec5SDimitry Andricdef VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
22690b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22700b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22710b57cec5SDimitry Andric}
22720b57cec5SDimitry Andric
22730b57cec5SDimitry Andricdef VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22740b57cec5SDimitry Andricdef VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22750b57cec5SDimitry Andric
22760b57cec5SDimitry Andric// ...with address register writeback:
22770b57cec5SDimitry Andricclass VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
22780b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
22790b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
22800b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
22810b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane]\\}, $Rn$Rm",
22820b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
22830b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22840b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22850b57cec5SDimitry Andric}
22860b57cec5SDimitry Andric
22870b57cec5SDimitry Andricdef VST2LNd8_UPD  : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
22880b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22890b57cec5SDimitry Andric}
22900b57cec5SDimitry Andricdef VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
22910b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22920b57cec5SDimitry Andric}
22930b57cec5SDimitry Andricdef VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
22940b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22950b57cec5SDimitry Andric}
22960b57cec5SDimitry Andric
22970b57cec5SDimitry Andricdef VST2LNd8Pseudo_UPD  : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22980b57cec5SDimitry Andricdef VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22990b57cec5SDimitry Andricdef VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23000b57cec5SDimitry Andric
23010b57cec5SDimitry Andricdef VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
23020b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23030b57cec5SDimitry Andric}
23040b57cec5SDimitry Andricdef VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
23050b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23060b57cec5SDimitry Andric}
23070b57cec5SDimitry Andric
23080b57cec5SDimitry Andricdef VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23090b57cec5SDimitry Andricdef VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
23100b57cec5SDimitry Andric
23110b57cec5SDimitry Andric//   VST3LN   : Vector Store (single 3-element structure from one lane)
23120b57cec5SDimitry Andricclass VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
23130b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
23140b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
23150b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
23160b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []>,
23170b57cec5SDimitry Andric    Sched<[WriteVST2]> {
23180b57cec5SDimitry Andric  let Rm = 0b1111;
23190b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
23200b57cec5SDimitry Andric}
23210b57cec5SDimitry Andric
23220b57cec5SDimitry Andricdef VST3LNd8  : VST3LN<0b0010, {?,?,?,0}, "8"> {
23230b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23240b57cec5SDimitry Andric}
23250b57cec5SDimitry Andricdef VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
23260b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23270b57cec5SDimitry Andric}
23280b57cec5SDimitry Andricdef VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
23290b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23300b57cec5SDimitry Andric}
23310b57cec5SDimitry Andric
23320b57cec5SDimitry Andricdef VST3LNd8Pseudo  : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23330b57cec5SDimitry Andricdef VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23340b57cec5SDimitry Andricdef VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
23350b57cec5SDimitry Andric
23360b57cec5SDimitry Andric// ...with double-spaced registers:
23370b57cec5SDimitry Andricdef VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
23380b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23390b57cec5SDimitry Andric}
23400b57cec5SDimitry Andricdef VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
23410b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23420b57cec5SDimitry Andric}
23430b57cec5SDimitry Andric
23440b57cec5SDimitry Andricdef VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23450b57cec5SDimitry Andricdef VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23460b57cec5SDimitry Andric
23470b57cec5SDimitry Andric// ...with address register writeback:
23480b57cec5SDimitry Andricclass VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
23490b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
23500b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
23510b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
23520b57cec5SDimitry Andric          IIC_VST3lnu, "vst3", Dt,
23530b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
23540b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
23550b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
23560b57cec5SDimitry Andric}
23570b57cec5SDimitry Andric
23580b57cec5SDimitry Andricdef VST3LNd8_UPD  : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
23590b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23600b57cec5SDimitry Andric}
23610b57cec5SDimitry Andricdef VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
23620b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23630b57cec5SDimitry Andric}
23640b57cec5SDimitry Andricdef VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
23650b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23660b57cec5SDimitry Andric}
23670b57cec5SDimitry Andric
23680b57cec5SDimitry Andricdef VST3LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23690b57cec5SDimitry Andricdef VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23700b57cec5SDimitry Andricdef VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23710b57cec5SDimitry Andric
23720b57cec5SDimitry Andricdef VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
23730b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23740b57cec5SDimitry Andric}
23750b57cec5SDimitry Andricdef VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
23760b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23770b57cec5SDimitry Andric}
23780b57cec5SDimitry Andric
23790b57cec5SDimitry Andricdef VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23800b57cec5SDimitry Andricdef VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23810b57cec5SDimitry Andric
23820b57cec5SDimitry Andric//   VST4LN   : Vector Store (single 4-element structure from one lane)
23830b57cec5SDimitry Andricclass VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
23840b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
23850b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
23860b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
23870b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
23880b57cec5SDimitry Andric          "", []>, Sched<[WriteVST2]> {
23890b57cec5SDimitry Andric  let Rm = 0b1111;
23900b57cec5SDimitry Andric  let Inst{4} = Rn{4};
23910b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
23920b57cec5SDimitry Andric}
23930b57cec5SDimitry Andric
23940b57cec5SDimitry Andricdef VST4LNd8  : VST4LN<0b0011, {?,?,?,?}, "8"> {
23950b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23960b57cec5SDimitry Andric}
23970b57cec5SDimitry Andricdef VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
23980b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23990b57cec5SDimitry Andric}
24000b57cec5SDimitry Andricdef VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
24010b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24020b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24030b57cec5SDimitry Andric}
24040b57cec5SDimitry Andric
24050b57cec5SDimitry Andricdef VST4LNd8Pseudo  : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24060b57cec5SDimitry Andricdef VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24070b57cec5SDimitry Andricdef VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24080b57cec5SDimitry Andric
24090b57cec5SDimitry Andric// ...with double-spaced registers:
24100b57cec5SDimitry Andricdef VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
24110b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24120b57cec5SDimitry Andric}
24130b57cec5SDimitry Andricdef VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
24140b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24150b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24160b57cec5SDimitry Andric}
24170b57cec5SDimitry Andric
24180b57cec5SDimitry Andricdef VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24190b57cec5SDimitry Andricdef VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
24200b57cec5SDimitry Andric
24210b57cec5SDimitry Andric// ...with address register writeback:
24220b57cec5SDimitry Andricclass VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
24230b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
24240b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
24250b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
24260b57cec5SDimitry Andric          IIC_VST4lnu, "vst4", Dt,
24270b57cec5SDimitry Andric  "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
24280b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
24290b57cec5SDimitry Andric  let Inst{4} = Rn{4};
24300b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
24310b57cec5SDimitry Andric}
24320b57cec5SDimitry Andric
24330b57cec5SDimitry Andricdef VST4LNd8_UPD  : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
24340b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
24350b57cec5SDimitry Andric}
24360b57cec5SDimitry Andricdef VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
24370b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24380b57cec5SDimitry Andric}
24390b57cec5SDimitry Andricdef VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
24400b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24410b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24420b57cec5SDimitry Andric}
24430b57cec5SDimitry Andric
24440b57cec5SDimitry Andricdef VST4LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24450b57cec5SDimitry Andricdef VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24460b57cec5SDimitry Andricdef VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24470b57cec5SDimitry Andric
24480b57cec5SDimitry Andricdef VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
24490b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24500b57cec5SDimitry Andric}
24510b57cec5SDimitry Andricdef VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
24520b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24530b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24540b57cec5SDimitry Andric}
24550b57cec5SDimitry Andric
24560b57cec5SDimitry Andricdef VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24570b57cec5SDimitry Andricdef VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24580b57cec5SDimitry Andric
24590b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
24600b57cec5SDimitry Andric
24610b57cec5SDimitry Andric// Use vld1/vst1 for unaligned f64 load / store
24620b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
24630b57cec5SDimitry Andricdef : Pat<(f64 (hword_alignedload addrmode6:$addr)),
24640b57cec5SDimitry Andric          (VLD1d16 addrmode6:$addr)>;
24650b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (f64 DPR:$value), addrmode6:$addr),
24660b57cec5SDimitry Andric          (VST1d16 addrmode6:$addr, DPR:$value)>;
24670b57cec5SDimitry Andricdef : Pat<(f64 (byte_alignedload addrmode6:$addr)),
24680b57cec5SDimitry Andric          (VLD1d8 addrmode6:$addr)>;
24690b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (f64 DPR:$value), addrmode6:$addr),
24700b57cec5SDimitry Andric          (VST1d8 addrmode6:$addr, DPR:$value)>;
24710b57cec5SDimitry Andric}
24720b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
24730b57cec5SDimitry Andricdef : Pat<(f64 (non_word_alignedload addrmode6:$addr)),
24740b57cec5SDimitry Andric          (VLD1d64 addrmode6:$addr)>;
24750b57cec5SDimitry Andricdef : Pat<(non_word_alignedstore (f64 DPR:$value), addrmode6:$addr),
24760b57cec5SDimitry Andric          (VST1d64 addrmode6:$addr, DPR:$value)>;
24770b57cec5SDimitry Andric}
24780b57cec5SDimitry Andric
24790b57cec5SDimitry Andric// Use vld1/vst1 for Q and QQ. Also use them for unaligned v2f64
24800b57cec5SDimitry Andric// load / store if it's legal.
24810b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
24820b57cec5SDimitry Andricdef : Pat<(v2f64 (dword_alignedload addrmode6:$addr)),
24830b57cec5SDimitry Andric          (VLD1q64 addrmode6:$addr)>;
24840b57cec5SDimitry Andricdef : Pat<(dword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24850b57cec5SDimitry Andric          (VST1q64 addrmode6:$addr, QPR:$value)>;
24860b57cec5SDimitry Andric}
24870b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
24880b57cec5SDimitry Andricdef : Pat<(v2f64 (word_alignedload addrmode6:$addr)),
24890b57cec5SDimitry Andric          (VLD1q32 addrmode6:$addr)>;
24900b57cec5SDimitry Andricdef : Pat<(word_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24910b57cec5SDimitry Andric          (VST1q32 addrmode6:$addr, QPR:$value)>;
24920b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
24930b57cec5SDimitry Andric          (VLD1q16 addrmode6:$addr)>;
24940b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24950b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, QPR:$value)>;
24960b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
24970b57cec5SDimitry Andric          (VLD1q8 addrmode6:$addr)>;
24980b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24990b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, QPR:$value)>;
25000b57cec5SDimitry Andric}
25010b57cec5SDimitry Andric
25020b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
25030b57cec5SDimitry Andric// Instruction Classes
25040b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
25050b57cec5SDimitry Andric
25060b57cec5SDimitry Andric// Basic 2-register operations: double- and quad-register.
25070b57cec5SDimitry Andricclass N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25080b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
25090b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
25100b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
25110b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
25120b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
25130b57cec5SDimitry Andricclass N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25140b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
25150b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
25160b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
25170b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
25180b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
25190b57cec5SDimitry Andric
25200b57cec5SDimitry Andric// Basic 2-register intrinsics, both double- and quad-register.
25210b57cec5SDimitry Andricclass N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25220b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
25230b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25240b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25250b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
25260b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25270b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
25280b57cec5SDimitry Andricclass N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25290b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
25300b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25310b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25320b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
25330b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25340b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25350b57cec5SDimitry Andric
25360b57cec5SDimitry Andric// Same as above, but not predicated.
25370b57cec5SDimitry Andricclass N2VDIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
25380b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25390b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25400b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 0,  (outs DPR:$Vd), (ins DPR:$Vm),
25410b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25420b57cec5SDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
25430b57cec5SDimitry Andric
25440b57cec5SDimitry Andricclass N2VQIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
25450b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25460b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25470b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 1,  (outs QPR:$Vd), (ins QPR:$Vm),
25480b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25490b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25500b57cec5SDimitry Andric
25510b57cec5SDimitry Andric// Similar to NV2VQIntnp with some more encoding bits exposed (crypto).
25520b57cec5SDimitry Andricclass N2VQIntXnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25530b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25540b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25550b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,  (outs QPR:$Vd), (ins QPR:$Vm),
25560b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25570b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25580b57cec5SDimitry Andric
25590b57cec5SDimitry Andric// Same as N2VQIntXnp but with Vd as a src register.
25600b57cec5SDimitry Andricclass N2VQIntX2np<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25610b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25620b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25630b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,
25640b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vm),
25650b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25660b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vm))))]> {
25670b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
25680b57cec5SDimitry Andric}
25690b57cec5SDimitry Andric
25700b57cec5SDimitry Andric// Narrow 2-register operations.
25710b57cec5SDimitry Andricclass N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25720b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25730b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25740b57cec5SDimitry Andric           ValueType TyD, ValueType TyQ, SDNode OpNode>
25750b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25760b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25770b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
25780b57cec5SDimitry Andric
25790b57cec5SDimitry Andric// Narrow 2-register intrinsics.
25800b57cec5SDimitry Andricclass N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25810b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25820b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25830b57cec5SDimitry Andric              ValueType TyD, ValueType TyQ, SDPatternOperator IntOp>
25840b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25850b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25860b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
25870b57cec5SDimitry Andric
25880b57cec5SDimitry Andric// Long 2-register operations (currently only used for VMOVL).
25890b57cec5SDimitry Andricclass N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25900b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25910b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25920b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode>
25930b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
25940b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25950b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
25960b57cec5SDimitry Andric
25970b57cec5SDimitry Andric// Long 2-register intrinsics.
25980b57cec5SDimitry Andricclass N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25990b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
26000b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
26010b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
26020b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
26030b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
26040b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
26050b57cec5SDimitry Andric
26060b57cec5SDimitry Andric// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
26070b57cec5SDimitry Andricclass N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
26080b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
26090b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
26100b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm",
26110b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
26120b57cec5SDimitry Andricclass N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
26130b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt>
26140b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
26150b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
26160b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
26170b57cec5SDimitry Andric
26180b57cec5SDimitry Andric// Basic 3-register operations: double- and quad-register.
26190b57cec5SDimitry Andricclass N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26200b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26210b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26220b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
26230b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
26240b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26250b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
26260b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26270b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26280b57cec5SDimitry Andric  let isCommutable = Commutable;
26290b57cec5SDimitry Andric}
26300b57cec5SDimitry Andric// Same as N3VD but no data type.
26310b57cec5SDimitry Andricclass N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26320b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
26330b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy,
26340b57cec5SDimitry Andric           SDNode OpNode, bit Commutable>
26350b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 0, op4,
26360b57cec5SDimitry Andric         (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
26370b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
26380b57cec5SDimitry Andric         [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
26390b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26400b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26410b57cec5SDimitry Andric  let isCommutable = Commutable;
26420b57cec5SDimitry Andric}
26430b57cec5SDimitry Andric
26440b57cec5SDimitry Andricclass N3VDSL<bits<2> op21_20, bits<4> op11_8,
26450b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
26460b57cec5SDimitry Andric             ValueType Ty, SDNode ShOp>
26470b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
26480b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
26490b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
26500b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26510b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26520b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
26530b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26540b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26550b57cec5SDimitry Andric  let isCommutable = 0;
26560b57cec5SDimitry Andric}
26570b57cec5SDimitry Andricclass N3VDSL16<bits<2> op21_20, bits<4> op11_8,
26580b57cec5SDimitry Andric               string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
26590b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
26600b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
26610b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane","",
26620b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26630b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26640b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
26650b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26660b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26670b57cec5SDimitry Andric  let isCommutable = 0;
26680b57cec5SDimitry Andric}
26690b57cec5SDimitry Andric
26700b57cec5SDimitry Andricclass N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26710b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26720b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26730b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
26740b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
26750b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26760b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
26770b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26780b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26790b57cec5SDimitry Andric  let isCommutable = Commutable;
26800b57cec5SDimitry Andric}
26810b57cec5SDimitry Andricclass N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26820b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
26830b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26840b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 1, op4,
26850b57cec5SDimitry Andric         (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
26860b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
26870b57cec5SDimitry Andric         [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
26880b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26890b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26900b57cec5SDimitry Andric  let isCommutable = Commutable;
26910b57cec5SDimitry Andric}
26920b57cec5SDimitry Andricclass N3VQSL<bits<2> op21_20, bits<4> op11_8,
26930b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
26940b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, SDNode ShOp>
26950b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
26960b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
26970b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
26980b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
26990b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
27000b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
27010b57cec5SDimitry Andric                                                imm:$lane)))))]> {
27020b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27030b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27040b57cec5SDimitry Andric  let isCommutable = 0;
27050b57cec5SDimitry Andric}
27060b57cec5SDimitry Andricclass N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
27070b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDNode ShOp>
27080b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
27090b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27100b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane", "",
27110b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
27120b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
27130b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
27140b57cec5SDimitry Andric                                                imm:$lane)))))]> {
27150b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27160b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27170b57cec5SDimitry Andric  let isCommutable = 0;
27180b57cec5SDimitry Andric}
27190b57cec5SDimitry Andric
27200b57cec5SDimitry Andric// Basic 3-register intrinsics, both double- and quad-register.
27210b57cec5SDimitry Andricclass N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27220b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27230b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
27240b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
27250b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
27260b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
27270b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
27280b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27290b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27300b57cec5SDimitry Andric  let isCommutable = Commutable;
27310b57cec5SDimitry Andric}
27320b57cec5SDimitry Andric
27330b57cec5SDimitry Andricclass N3VDIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
27340b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
27350b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
27360b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
27370b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
2738349cc55cSDimitry Andric          (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin, OpcodeStr, Dt,
2739349cc55cSDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
2740349cc55cSDimitry Andric  let isCommutable = Commutable;
2741349cc55cSDimitry Andric}
2742349cc55cSDimitry Andric
27430b57cec5SDimitry Andric
27440b57cec5SDimitry Andricclass N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27450b57cec5SDimitry Andric                string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
27460b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
27470b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
27480b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27490b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27500b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27510b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
27520b57cec5SDimitry Andric                                           imm:$lane)))))]> {
27530b57cec5SDimitry Andric  let isCommutable = 0;
27540b57cec5SDimitry Andric}
27550b57cec5SDimitry Andric
27560b57cec5SDimitry Andricclass N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27570b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
27580b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
27590b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27600b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27610b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27620b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27630b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
27640b57cec5SDimitry Andric  let isCommutable = 0;
27650b57cec5SDimitry Andric}
27660b57cec5SDimitry Andricclass N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27670b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27680b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27690b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
27700b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
27710b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
27720b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
27730b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
27740b57cec5SDimitry Andric  let isCommutable = 0;
27750b57cec5SDimitry Andric}
27760b57cec5SDimitry Andric
27770b57cec5SDimitry Andricclass N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27780b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27790b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
27800b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
27810b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
27820b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
27830b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
27840b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27850b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27860b57cec5SDimitry Andric  let isCommutable = Commutable;
27870b57cec5SDimitry Andric}
27880b57cec5SDimitry Andric
27890b57cec5SDimitry Andricclass N3VQIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
27900b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
27910b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
27920b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
27930b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
27940b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin, OpcodeStr, Dt,
2795349cc55cSDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
2796349cc55cSDimitry Andric  let isCommutable = Commutable;
2797349cc55cSDimitry Andric}
27980b57cec5SDimitry Andric
27990b57cec5SDimitry Andric// Same as N3VQIntnp but with Vd as a src register.
28000b57cec5SDimitry Andricclass N3VQInt3np<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
28010b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
28020b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
2803349cc55cSDimitry Andric                SDPatternOperator IntOp>
28040b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
28050b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vn, QPR:$Vm),
28060b57cec5SDimitry Andric          f, itin, OpcodeStr, Dt,
28070b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vn),
28080b57cec5SDimitry Andric                                       (OpTy QPR:$Vm))))]> {
28090b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
2810349cc55cSDimitry Andric  let isCommutable = 0;
28110b57cec5SDimitry Andric}
28120b57cec5SDimitry Andric
28130b57cec5SDimitry Andricclass N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28140b57cec5SDimitry Andric                string OpcodeStr, string Dt,
28150b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28160b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
28170b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28180b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
28190b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28200b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
28210b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
28220b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
28230b57cec5SDimitry Andric  let isCommutable = 0;
28240b57cec5SDimitry Andric}
28250b57cec5SDimitry Andricclass N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28260b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
28270b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28280b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
28290b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28300b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
28310b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28320b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
28330b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
28340b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
28350b57cec5SDimitry Andric  let isCommutable = 0;
28360b57cec5SDimitry Andric}
28370b57cec5SDimitry Andricclass N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28380b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
28390b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28400b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
28410b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
28420b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
28430b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
28440b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
28450b57cec5SDimitry Andric  let isCommutable = 0;
28460b57cec5SDimitry Andric}
28470b57cec5SDimitry Andric
28480b57cec5SDimitry Andric// Multiply-Add/Sub operations: double- and quad-register.
28490b57cec5SDimitry Andricclass N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28500b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
28510b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
28520b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
28530b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
28540b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28550b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
28560b57cec5SDimitry Andric                             (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
28570b57cec5SDimitry Andric
28580b57cec5SDimitry Andricclass N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28590b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
28600b57cec5SDimitry Andric                  ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28610b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
28620b57cec5SDimitry Andric        (outs DPR:$Vd),
28630b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28640b57cec5SDimitry Andric        NVMulSLFrm, itin,
28650b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28660b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28670b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28680b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28690b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
28700b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28710b57cec5SDimitry Andricclass N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28720b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
28730b57cec5SDimitry Andric                    ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28740b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
28750b57cec5SDimitry Andric        (outs DPR:$Vd),
28760b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28770b57cec5SDimitry Andric        NVMulSLFrm, itin,
28780b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28790b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28800b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28810b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28820b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_8:$Vm),
28830b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28840b57cec5SDimitry Andric
28850b57cec5SDimitry Andricclass N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28860b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
28870b57cec5SDimitry Andric                SDPatternOperator MulOp, SDPatternOperator OpNode>
28880b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
28890b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
28900b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28910b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
28920b57cec5SDimitry Andric                             (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
28930b57cec5SDimitry Andricclass N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28940b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
28950b57cec5SDimitry Andric                  SDPatternOperator MulOp, SDPatternOperator ShOp>
28960b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
28970b57cec5SDimitry Andric        (outs QPR:$Vd),
28980b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28990b57cec5SDimitry Andric        NVMulSLFrm, itin,
29000b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29010b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
29020b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$src1),
29030b57cec5SDimitry Andric                           (ResTy (MulOp QPR:$Vn,
29040b57cec5SDimitry Andric                                   (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
29050b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
29060b57cec5SDimitry Andricclass N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
29070b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
29080b57cec5SDimitry Andric                    ValueType ResTy, ValueType OpTy,
29090b57cec5SDimitry Andric                    SDPatternOperator MulOp, SDPatternOperator ShOp>
29100b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
29110b57cec5SDimitry Andric        (outs QPR:$Vd),
29120b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$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_8:$Vm),
29190b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
29200b57cec5SDimitry Andric
29210b57cec5SDimitry Andric// Neon Intrinsic-Op instructions (VABA): double- and quad-register.
29220b57cec5SDimitry Andricclass N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29230b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29240b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
29250b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29260b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29270b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29280b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
29290b57cec5SDimitry Andric                             (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
29300b57cec5SDimitry Andricclass N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29310b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29320b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
29330b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29340b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29350b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29360b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
29370b57cec5SDimitry Andric                             (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
29380b57cec5SDimitry Andric
29390b57cec5SDimitry Andric// Neon 3-argument intrinsics, both double- and quad-register.
29400b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
29410b57cec5SDimitry Andricclass N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29420b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29430b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29440b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29450b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29460b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29470b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
29480b57cec5SDimitry Andric                                      (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
29490b57cec5SDimitry Andricclass N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29500b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29510b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29520b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29530b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29540b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29550b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
29560b57cec5SDimitry Andric                                      (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
29570b57cec5SDimitry Andric
29580b57cec5SDimitry Andric// Long Multiply-Add/Sub operations.
29590b57cec5SDimitry Andricclass N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29600b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29610b57cec5SDimitry Andric                ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29620b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29630b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29640b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29650b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
29660b57cec5SDimitry Andric                                (TyQ (MulOp (TyD DPR:$Vn),
29670b57cec5SDimitry Andric                                            (TyD DPR:$Vm)))))]>;
29680b57cec5SDimitry Andricclass N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
29690b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
29700b57cec5SDimitry Andric                  ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29710b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29720b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
29730b57cec5SDimitry Andric        NVMulSLFrm, itin,
29740b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29750b57cec5SDimitry Andric        [(set QPR:$Vd,
29760b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
29770b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
29780b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),
29790b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
29800b57cec5SDimitry Andricclass N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
29810b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
29820b57cec5SDimitry Andric                    ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29830b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29840b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
29850b57cec5SDimitry Andric        NVMulSLFrm, itin,
29860b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29870b57cec5SDimitry Andric        [(set QPR:$Vd,
29880b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
29890b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
29900b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_8:$Vm),
29910b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
29920b57cec5SDimitry Andric
29930b57cec5SDimitry Andric// Long Intrinsic-Op vector operations with explicit extend (VABAL).
29940b57cec5SDimitry Andricclass N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29950b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
29960b57cec5SDimitry Andric                   ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
29970b57cec5SDimitry Andric                   SDNode OpNode>
29980b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29990b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30000b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
30010b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
30020b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
30030b57cec5SDimitry Andric                                                        (TyD DPR:$Vm)))))))]>;
30040b57cec5SDimitry Andric
30050b57cec5SDimitry Andric// Neon Long 3-argument intrinsic.  The destination register is
30060b57cec5SDimitry Andric// a quad-register and is also used as the first source operand register.
30070b57cec5SDimitry Andricclass N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30080b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
30090b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
30100b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30110b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30120b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
30130b57cec5SDimitry Andric        [(set QPR:$Vd,
30140b57cec5SDimitry Andric          (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
30150b57cec5SDimitry Andricclass N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
30160b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
30170b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30180b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30190b57cec5SDimitry Andric        (outs QPR:$Vd),
30200b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30210b57cec5SDimitry Andric        NVMulSLFrm, itin,
30220b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
30230b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30240b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
30250b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
30260b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
30270b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30280b57cec5SDimitry Andricclass N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30290b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
30300b57cec5SDimitry Andric                   ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30310b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30320b57cec5SDimitry Andric        (outs QPR:$Vd),
30330b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30340b57cec5SDimitry Andric        NVMulSLFrm, itin,
30350b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
30360b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30370b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
30380b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
30390b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
30400b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30410b57cec5SDimitry Andric
30420b57cec5SDimitry Andric// Narrowing 3-register intrinsics.
30430b57cec5SDimitry Andricclass N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30440b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
30450b57cec5SDimitry Andric              SDPatternOperator IntOp, bit Commutable>
30460b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30470b57cec5SDimitry Andric        (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
30480b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30490b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
30500b57cec5SDimitry Andric  let isCommutable = Commutable;
30510b57cec5SDimitry Andric}
30520b57cec5SDimitry Andric
30530b57cec5SDimitry Andric// Long 3-register operations.
30540b57cec5SDimitry Andricclass N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30550b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
30560b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
30570b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30580b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30590b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30600b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
30610b57cec5SDimitry Andric  let isCommutable = Commutable;
30620b57cec5SDimitry Andric}
30630b57cec5SDimitry Andric
30640b57cec5SDimitry Andricclass N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
30650b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
30660b57cec5SDimitry Andric             ValueType TyQ, ValueType TyD, SDNode OpNode>
30670b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30680b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30690b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30700b57cec5SDimitry Andric        [(set QPR:$Vd,
30710b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30720b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
30730b57cec5SDimitry Andricclass N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30740b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
30750b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDNode OpNode>
30760b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30770b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30780b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30790b57cec5SDimitry Andric        [(set QPR:$Vd,
30800b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30810b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
30820b57cec5SDimitry Andric
30830b57cec5SDimitry Andric// Long 3-register operations with explicitly extended operands.
30840b57cec5SDimitry Andricclass N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30850b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
3086fe6060f1SDimitry Andric              ValueType TyQ, ValueType TyD, SDNode OpNode, SDPatternOperator ExtOp,
30870b57cec5SDimitry Andric              bit Commutable>
30880b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30890b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30900b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30910b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
30920b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
30930b57cec5SDimitry Andric  let isCommutable = Commutable;
30940b57cec5SDimitry Andric}
30950b57cec5SDimitry Andric
30960b57cec5SDimitry Andric// Long 3-register intrinsics with explicit extend (VABDL).
30970b57cec5SDimitry Andricclass N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30980b57cec5SDimitry Andric                 InstrItinClass itin, string OpcodeStr, string Dt,
30990b57cec5SDimitry Andric                 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
31000b57cec5SDimitry Andric                 bit Commutable>
31010b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31020b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
31030b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31040b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
31050b57cec5SDimitry Andric                                                (TyD DPR:$Vm))))))]> {
31060b57cec5SDimitry Andric  let isCommutable = Commutable;
31070b57cec5SDimitry Andric}
31080b57cec5SDimitry Andric
31090b57cec5SDimitry Andric// Long 3-register intrinsics.
31100b57cec5SDimitry Andricclass N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31110b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
31120b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, bit Commutable>
31130b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31140b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
31150b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31160b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
31170b57cec5SDimitry Andric  let isCommutable = Commutable;
31180b57cec5SDimitry Andric}
31190b57cec5SDimitry Andric
31200b57cec5SDimitry Andric// Same as above, but not predicated.
31210b57cec5SDimitry Andricclass N3VLIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
31220b57cec5SDimitry Andric                bit op4, InstrItinClass itin, string OpcodeStr,
31230b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
31240b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
31250b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
31260b57cec5SDimitry Andric          (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
3127349cc55cSDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
3128349cc55cSDimitry Andric  let isCommutable = Commutable;
3129349cc55cSDimitry Andric}
3130349cc55cSDimitry Andric
31310b57cec5SDimitry Andric
31320b57cec5SDimitry Andricclass N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
31330b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31340b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31350b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
31360b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
31370b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
31380b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
31390b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
31400b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
31410b57cec5SDimitry Andric                                                imm:$lane)))))]>;
31420b57cec5SDimitry Andricclass N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
31430b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
31440b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31450b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
31460b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
31470b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
31480b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
31490b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
31500b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
31510b57cec5SDimitry Andric                                                imm:$lane)))))]>;
31520b57cec5SDimitry Andric
31530b57cec5SDimitry Andric// Wide 3-register operations.
31540b57cec5SDimitry Andricclass N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31550b57cec5SDimitry Andric           string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
3156fe6060f1SDimitry Andric           SDNode OpNode, SDPatternOperator ExtOp, bit Commutable>
31570b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31580b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
31590b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31600b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
31610b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
31620b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
31630b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
31640b57cec5SDimitry Andric  let isCommutable = Commutable;
31650b57cec5SDimitry Andric}
31660b57cec5SDimitry Andric
31670b57cec5SDimitry Andric// Pairwise long 2-register intrinsics, both double- and quad-register.
31680b57cec5SDimitry Andricclass N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31690b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31700b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31710b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31720b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
31730b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31740b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
31750b57cec5SDimitry Andricclass N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31760b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31770b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31780b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31790b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
31800b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31810b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
31820b57cec5SDimitry Andric
31830b57cec5SDimitry Andric// Pairwise long 2-register accumulate intrinsics,
31840b57cec5SDimitry Andric// both double- and quad-register.
31850b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
31860b57cec5SDimitry Andricclass N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31870b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
31880b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
31890b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31900b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
31910b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
31920b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
31930b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
31940b57cec5SDimitry Andricclass N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31950b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
31960b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
31970b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31980b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
31990b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
32000b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
32010b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
32020b57cec5SDimitry Andric
32030b57cec5SDimitry Andric// Shift by immediate,
32040b57cec5SDimitry Andric// both double- and quad-register.
32050b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32060b57cec5SDimitry Andricclass N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32070b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
32080b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
32090b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
32100b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
32110b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32120b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
32130b57cec5SDimitry Andricclass N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32140b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
32150b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
32160b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
32170b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
32180b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32190b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
32200b57cec5SDimitry Andric}
32210b57cec5SDimitry Andric
32220b57cec5SDimitry Andric// Long shift by immediate.
32230b57cec5SDimitry Andricclass N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
32240b57cec5SDimitry Andric             string OpcodeStr, string Dt,
32250b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
32260b57cec5SDimitry Andric             SDPatternOperator OpNode>
32270b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
32280b57cec5SDimitry Andric           (outs QPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), N2RegVShLFrm,
32290b57cec5SDimitry Andric           IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32300b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm), ImmTy:$SIMM)))]>;
32310b57cec5SDimitry Andric
32320b57cec5SDimitry Andric// Narrow shift by immediate.
32330b57cec5SDimitry Andricclass N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
32340b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
32350b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
32360b57cec5SDimitry Andric             SDPatternOperator OpNode>
32370b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
32380b57cec5SDimitry Andric           (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
32390b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32400b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
32410b57cec5SDimitry Andric                                          (i32 ImmTy:$SIMM))))]>;
32420b57cec5SDimitry Andric
32430b57cec5SDimitry Andric// Shift right by immediate and accumulate,
32440b57cec5SDimitry Andric// both double- and quad-register.
32450b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32460b57cec5SDimitry Andricclass N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32470b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
32480b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
32490b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
32500b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
32510b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32520b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (add DPR:$src1,
32530b57cec5SDimitry Andric                                (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
32540b57cec5SDimitry Andricclass N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32550b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
32560b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
32570b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32580b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
32590b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32600b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (add QPR:$src1,
32610b57cec5SDimitry Andric                                (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
32620b57cec5SDimitry Andric}
32630b57cec5SDimitry Andric
32640b57cec5SDimitry Andric// Shift by immediate and insert,
32650b57cec5SDimitry Andric// both double- and quad-register.
32660b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32670b57cec5SDimitry Andricclass N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32680b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32690b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32700b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
32710b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
32720b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32730b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
32740b57cec5SDimitry Andricclass N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32750b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32760b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32770b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32780b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
32790b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32800b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
32810b57cec5SDimitry Andric}
32820b57cec5SDimitry Andric
32830b57cec5SDimitry Andric// Convert, with fractional bits immediate,
32840b57cec5SDimitry Andric// both double- and quad-register.
32850b57cec5SDimitry Andricclass N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32860b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
32870b57cec5SDimitry Andric              SDPatternOperator IntOp>
32880b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
32890b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
32900b57cec5SDimitry Andric           IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32910b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
32920b57cec5SDimitry Andricclass N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32930b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
32940b57cec5SDimitry Andric              SDPatternOperator IntOp>
32950b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
32960b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
32970b57cec5SDimitry Andric           IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32980b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
32990b57cec5SDimitry Andric
33000b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
33010b57cec5SDimitry Andric// Multiclasses
33020b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
33030b57cec5SDimitry Andric
33040b57cec5SDimitry Andric// Abbreviations used in multiclass suffixes:
33050b57cec5SDimitry Andric//   Q = quarter int (8 bit) elements
33060b57cec5SDimitry Andric//   H = half int (16 bit) elements
33070b57cec5SDimitry Andric//   S = single int (32 bit) elements
33080b57cec5SDimitry Andric//   D = double int (64 bit) elements
33090b57cec5SDimitry Andric
33100b57cec5SDimitry Andric// Neon 2-register vector operations and intrinsics.
33110b57cec5SDimitry Andric
33120b57cec5SDimitry Andric// Neon 2-register comparisons.
33130b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
33140b57cec5SDimitry Andricmulticlass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
33150b57cec5SDimitry Andric                       bits<5> op11_7, bit op4, string opc, string Dt,
3316480093f4SDimitry Andric                       string asm, PatFrag fc> {
33170b57cec5SDimitry Andric  // 64-bit vector types.
33180b57cec5SDimitry Andric  def v8i8  : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
33190b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33200b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3321480093f4SDimitry Andric                  [(set DPR:$Vd, (v8i8 (ARMvcmpz (v8i8 DPR:$Vm), fc)))]>;
33220b57cec5SDimitry Andric  def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
33230b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33240b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3325480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4i16 DPR:$Vm), fc)))]>;
33260b57cec5SDimitry Andric  def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
33270b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33280b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3329480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2i32 DPR:$Vm), fc)))]>;
33300b57cec5SDimitry Andric  def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
33310b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33320b57cec5SDimitry Andric                  opc, "f32", asm, "",
3333480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2f32 DPR:$Vm), fc)))]> {
33340b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33350b57cec5SDimitry Andric  }
33360b57cec5SDimitry Andric  def v4f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
33370b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
33380b57cec5SDimitry Andric                  opc, "f16", asm, "",
3339480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4f16 DPR:$Vm), fc)))]>,
33400b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
33410b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33420b57cec5SDimitry Andric  }
33430b57cec5SDimitry Andric
33440b57cec5SDimitry Andric  // 128-bit vector types.
33450b57cec5SDimitry Andric  def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
33460b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33470b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3348480093f4SDimitry Andric                  [(set QPR:$Vd, (v16i8 (ARMvcmpz (v16i8 QPR:$Vm), fc)))]>;
33490b57cec5SDimitry Andric  def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
33500b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33510b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3352480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8i16 QPR:$Vm), fc)))]>;
33530b57cec5SDimitry Andric  def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33540b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33550b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3356480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4i32 QPR:$Vm), fc)))]>;
33570b57cec5SDimitry Andric  def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33580b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33590b57cec5SDimitry Andric                  opc, "f32", asm, "",
3360480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4f32 QPR:$Vm), fc)))]> {
33610b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33620b57cec5SDimitry Andric  }
33630b57cec5SDimitry Andric  def v8f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
33640b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33650b57cec5SDimitry Andric                  opc, "f16", asm, "",
3366480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8f16 QPR:$Vm), fc)))]>,
33670b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
33680b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33690b57cec5SDimitry Andric  }
33700b57cec5SDimitry Andric}
33710b57cec5SDimitry Andric
33728bcb0991SDimitry Andric// Neon 3-register comparisons.
33738bcb0991SDimitry Andricclass N3VQ_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
33748bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3375480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
33768bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
33778bcb0991SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
33788bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3379480093f4SDimitry Andric        [(set QPR:$Vd, (ResTy (ARMvcmp (OpTy QPR:$Vn), (OpTy QPR:$Vm), fc)))]> {
33808bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
33818bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
33828bcb0991SDimitry Andric  let isCommutable = Commutable;
33838bcb0991SDimitry Andric}
33848bcb0991SDimitry Andric
33858bcb0991SDimitry Andricclass N3VD_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
33868bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3387480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
33888bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
33898bcb0991SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
33908bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3391480093f4SDimitry Andric        [(set DPR:$Vd, (ResTy (ARMvcmp (OpTy DPR:$Vn), (OpTy DPR:$Vm), fc)))]> {
33928bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
33938bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
33948bcb0991SDimitry Andric  let isCommutable = Commutable;
33958bcb0991SDimitry Andric}
33968bcb0991SDimitry Andric
33978bcb0991SDimitry Andricmulticlass N3V_QHS_cmp<bit op24, bit op23, bits<4> op11_8, bit op4,
33988bcb0991SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
33998bcb0991SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
34008bcb0991SDimitry Andric                       string OpcodeStr, string Dt,
3401480093f4SDimitry Andric                       PatFrag fc, bit Commutable = 0> {
34028bcb0991SDimitry Andric  // 64-bit vector types.
34038bcb0991SDimitry Andric  def v8i8  : N3VD_cmp<op24, op23, 0b00, op11_8, op4, itinD16,
34048bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
34058bcb0991SDimitry Andric                       v8i8, v8i8, fc, Commutable>;
34068bcb0991SDimitry Andric  def v4i16 : N3VD_cmp<op24, op23, 0b01, op11_8, op4, itinD16,
34078bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
34088bcb0991SDimitry Andric                       v4i16, v4i16, fc, Commutable>;
34098bcb0991SDimitry Andric  def v2i32 : N3VD_cmp<op24, op23, 0b10, op11_8, op4, itinD32,
34108bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
34118bcb0991SDimitry Andric                       v2i32, v2i32, fc, Commutable>;
34128bcb0991SDimitry Andric
34138bcb0991SDimitry Andric  // 128-bit vector types.
34148bcb0991SDimitry Andric  def v16i8 : N3VQ_cmp<op24, op23, 0b00, op11_8, op4, itinQ16,
34158bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
34168bcb0991SDimitry Andric                       v16i8, v16i8, fc, Commutable>;
34178bcb0991SDimitry Andric  def v8i16 : N3VQ_cmp<op24, op23, 0b01, op11_8, op4, itinQ16,
34188bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
34198bcb0991SDimitry Andric                       v8i16, v8i16, fc, Commutable>;
34208bcb0991SDimitry Andric  def v4i32 : N3VQ_cmp<op24, op23, 0b10, op11_8, op4, itinQ32,
34218bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
34228bcb0991SDimitry Andric                       v4i32, v4i32, fc, Commutable>;
34238bcb0991SDimitry Andric}
34248bcb0991SDimitry Andric
34250b57cec5SDimitry Andric
34260b57cec5SDimitry Andric// Neon 2-register vector intrinsics,
34270b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
34280b57cec5SDimitry Andricmulticlass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34290b57cec5SDimitry Andric                      bits<5> op11_7, bit op4,
34300b57cec5SDimitry Andric                      InstrItinClass itinD, InstrItinClass itinQ,
34310b57cec5SDimitry Andric                      string OpcodeStr, string Dt, SDPatternOperator IntOp> {
34320b57cec5SDimitry Andric  // 64-bit vector types.
34330b57cec5SDimitry Andric  def v8i8  : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
34340b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
34350b57cec5SDimitry Andric  def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
34360b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
34370b57cec5SDimitry Andric  def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
34380b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
34390b57cec5SDimitry Andric
34400b57cec5SDimitry Andric  // 128-bit vector types.
34410b57cec5SDimitry Andric  def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
34420b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
34430b57cec5SDimitry Andric  def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
34440b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
34450b57cec5SDimitry Andric  def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
34460b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
34470b57cec5SDimitry Andric}
34480b57cec5SDimitry Andric
34490b57cec5SDimitry Andric
34500b57cec5SDimitry Andric// Neon Narrowing 2-register vector operations,
34510b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34520b57cec5SDimitry Andricmulticlass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34530b57cec5SDimitry Andric                    bits<5> op11_7, bit op6, bit op4,
34540b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
34550b57cec5SDimitry Andric                    SDNode OpNode> {
34560b57cec5SDimitry Andric  def v8i8  : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34570b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "16"),
34580b57cec5SDimitry Andric                   v8i8, v8i16, OpNode>;
34590b57cec5SDimitry Andric  def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34600b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "32"),
34610b57cec5SDimitry Andric                   v4i16, v4i32, OpNode>;
34620b57cec5SDimitry Andric  def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34630b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "64"),
34640b57cec5SDimitry Andric                   v2i32, v2i64, OpNode>;
34650b57cec5SDimitry Andric}
34660b57cec5SDimitry Andric
34670b57cec5SDimitry Andric// Neon Narrowing 2-register vector intrinsics,
34680b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34690b57cec5SDimitry Andricmulticlass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34700b57cec5SDimitry Andric                       bits<5> op11_7, bit op6, bit op4,
34710b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
34720b57cec5SDimitry Andric                       SDPatternOperator IntOp> {
34730b57cec5SDimitry Andric  def v8i8  : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34740b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "16"),
34750b57cec5SDimitry Andric                      v8i8, v8i16, IntOp>;
34760b57cec5SDimitry Andric  def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34770b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "32"),
34780b57cec5SDimitry Andric                      v4i16, v4i32, IntOp>;
34790b57cec5SDimitry Andric  def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34800b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "64"),
34810b57cec5SDimitry Andric                      v2i32, v2i64, IntOp>;
34820b57cec5SDimitry Andric}
34830b57cec5SDimitry Andric
34840b57cec5SDimitry Andric
34850b57cec5SDimitry Andric// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
34860b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34870b57cec5SDimitry Andricmulticlass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
34880b57cec5SDimitry Andric                    string OpcodeStr, string Dt, SDNode OpNode> {
34890b57cec5SDimitry Andric  def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34900b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
34910b57cec5SDimitry Andric  def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34920b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
34930b57cec5SDimitry Andric  def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34940b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
34950b57cec5SDimitry Andric}
34960b57cec5SDimitry Andric
34970b57cec5SDimitry Andric
34980b57cec5SDimitry Andric// Neon 3-register vector operations.
34990b57cec5SDimitry Andric
35000b57cec5SDimitry Andric// First with only element sizes of 8, 16 and 32 bits:
35010b57cec5SDimitry Andricmulticlass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
35020b57cec5SDimitry Andric                   InstrItinClass itinD16, InstrItinClass itinD32,
35030b57cec5SDimitry Andric                   InstrItinClass itinQ16, InstrItinClass itinQ32,
35040b57cec5SDimitry Andric                   string OpcodeStr, string Dt,
35050b57cec5SDimitry Andric                   SDNode OpNode, bit Commutable = 0> {
35060b57cec5SDimitry Andric  // 64-bit vector types.
35070b57cec5SDimitry Andric  def v8i8  : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
35080b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
35090b57cec5SDimitry Andric                   v8i8, v8i8, OpNode, Commutable>;
35100b57cec5SDimitry Andric  def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
35110b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
35120b57cec5SDimitry Andric                   v4i16, v4i16, OpNode, Commutable>;
35130b57cec5SDimitry Andric  def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
35140b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
35150b57cec5SDimitry Andric                   v2i32, v2i32, OpNode, Commutable>;
35160b57cec5SDimitry Andric
35170b57cec5SDimitry Andric  // 128-bit vector types.
35180b57cec5SDimitry Andric  def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
35190b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
35200b57cec5SDimitry Andric                   v16i8, v16i8, OpNode, Commutable>;
35210b57cec5SDimitry Andric  def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
35220b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
35230b57cec5SDimitry Andric                   v8i16, v8i16, OpNode, Commutable>;
35240b57cec5SDimitry Andric  def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
35250b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
35260b57cec5SDimitry Andric                   v4i32, v4i32, OpNode, Commutable>;
35270b57cec5SDimitry Andric}
35280b57cec5SDimitry Andric
35290b57cec5SDimitry Andricmulticlass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
35300b57cec5SDimitry Andric  def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, "i16", v4i16, ShOp>;
35310b57cec5SDimitry Andric  def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, "i32", v2i32, ShOp>;
35320b57cec5SDimitry Andric  def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, "i16", v8i16, v4i16, ShOp>;
35330b57cec5SDimitry Andric  def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, "i32",
35340b57cec5SDimitry Andric                     v4i32, v2i32, ShOp>;
35350b57cec5SDimitry Andric}
35360b57cec5SDimitry Andric
35370b57cec5SDimitry Andric// ....then also with element size 64 bits:
35380b57cec5SDimitry Andricmulticlass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
35390b57cec5SDimitry Andric                    InstrItinClass itinD, InstrItinClass itinQ,
35400b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
35410b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0>
35420b57cec5SDimitry Andric  : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
35430b57cec5SDimitry Andric            OpcodeStr, Dt, OpNode, Commutable> {
35440b57cec5SDimitry Andric  def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
35450b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
35460b57cec5SDimitry Andric                   v1i64, v1i64, OpNode, Commutable>;
35470b57cec5SDimitry Andric  def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
35480b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
35490b57cec5SDimitry Andric                   v2i64, v2i64, OpNode, Commutable>;
35500b57cec5SDimitry Andric}
35510b57cec5SDimitry Andric
35520b57cec5SDimitry Andric
35530b57cec5SDimitry Andric// Neon 3-register vector intrinsics.
35540b57cec5SDimitry Andric
35550b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
35560b57cec5SDimitry Andricmulticlass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35570b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35580b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35590b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35600b57cec5SDimitry Andric                     SDPatternOperator IntOp, bit Commutable = 0> {
35610b57cec5SDimitry Andric  // 64-bit vector types.
35620b57cec5SDimitry Andric  def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
35630b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35640b57cec5SDimitry Andric                      v4i16, v4i16, IntOp, Commutable>;
35650b57cec5SDimitry Andric  def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
35660b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35670b57cec5SDimitry Andric                      v2i32, v2i32, IntOp, Commutable>;
35680b57cec5SDimitry Andric
35690b57cec5SDimitry Andric  // 128-bit vector types.
35700b57cec5SDimitry Andric  def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
35710b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35720b57cec5SDimitry Andric                      v8i16, v8i16, IntOp, Commutable>;
35730b57cec5SDimitry Andric  def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
35740b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35750b57cec5SDimitry Andric                      v4i32, v4i32, IntOp, Commutable>;
35760b57cec5SDimitry Andric}
35770b57cec5SDimitry Andricmulticlass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35780b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35790b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35800b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35810b57cec5SDimitry Andric                     SDPatternOperator IntOp> {
35820b57cec5SDimitry Andric  // 64-bit vector types.
35830b57cec5SDimitry Andric  def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
35840b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35850b57cec5SDimitry Andric                      v4i16, v4i16, IntOp>;
35860b57cec5SDimitry Andric  def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
35870b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35880b57cec5SDimitry Andric                      v2i32, v2i32, IntOp>;
35890b57cec5SDimitry Andric
35900b57cec5SDimitry Andric  // 128-bit vector types.
35910b57cec5SDimitry Andric  def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
35920b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35930b57cec5SDimitry Andric                      v8i16, v8i16, IntOp>;
35940b57cec5SDimitry Andric  def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
35950b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35960b57cec5SDimitry Andric                      v4i32, v4i32, IntOp>;
35970b57cec5SDimitry Andric}
35980b57cec5SDimitry Andric
35990b57cec5SDimitry Andricmulticlass N3VIntSL_HS<bits<4> op11_8,
36000b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36010b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36020b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
36030b57cec5SDimitry Andric  def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
36040b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
36050b57cec5SDimitry Andric  def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
36060b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
36070b57cec5SDimitry Andric  def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
36080b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
36090b57cec5SDimitry Andric  def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
36100b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
36110b57cec5SDimitry Andric}
36120b57cec5SDimitry Andric
36130b57cec5SDimitry Andric// ....then also with element size of 8 bits:
36140b57cec5SDimitry Andricmulticlass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36150b57cec5SDimitry Andric                      InstrItinClass itinD16, InstrItinClass itinD32,
36160b57cec5SDimitry Andric                      InstrItinClass itinQ16, InstrItinClass itinQ32,
36170b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
36180b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0>
36190b57cec5SDimitry Andric  : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36200b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp, Commutable> {
36210b57cec5SDimitry Andric  def v8i8  : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
36220b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36230b57cec5SDimitry Andric                      v8i8, v8i8, IntOp, Commutable>;
36240b57cec5SDimitry Andric  def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
36250b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36260b57cec5SDimitry Andric                      v16i8, v16i8, IntOp, Commutable>;
36270b57cec5SDimitry Andric}
36280b57cec5SDimitry Andricmulticlass N3VInt_QHSSh<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>
36330b57cec5SDimitry Andric  : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36340b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp> {
36350b57cec5SDimitry Andric  def v8i8  : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
36360b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36370b57cec5SDimitry Andric                      v8i8, v8i8, IntOp>;
36380b57cec5SDimitry Andric  def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
36390b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36400b57cec5SDimitry Andric                      v16i8, v16i8, IntOp>;
36410b57cec5SDimitry Andric}
36420b57cec5SDimitry Andric
36430b57cec5SDimitry Andric
36440b57cec5SDimitry Andric// ....then also with element size of 64 bits:
36450b57cec5SDimitry Andricmulticlass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36460b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36470b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36480b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36490b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
36500b57cec5SDimitry Andric  : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36510b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp, Commutable> {
36520b57cec5SDimitry Andric  def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
36530b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36540b57cec5SDimitry Andric                      v1i64, v1i64, IntOp, Commutable>;
36550b57cec5SDimitry Andric  def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36560b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36570b57cec5SDimitry Andric                      v2i64, v2i64, IntOp, Commutable>;
36580b57cec5SDimitry Andric}
36590b57cec5SDimitry Andricmulticlass N3VInt_QHSDSh<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>
36640b57cec5SDimitry Andric  : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36650b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp> {
36660b57cec5SDimitry Andric  def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
36670b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36680b57cec5SDimitry Andric                      v1i64, v1i64, IntOp>;
36690b57cec5SDimitry Andric  def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36700b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36710b57cec5SDimitry Andric                      v2i64, v2i64, IntOp>;
36720b57cec5SDimitry Andric}
36730b57cec5SDimitry Andric
36740b57cec5SDimitry Andric// Neon Narrowing 3-register vector intrinsics,
36750b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
36760b57cec5SDimitry Andricmulticlass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
36770b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36780b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0> {
36790b57cec5SDimitry Andric  def v8i8  : N3VNInt<op24, op23, 0b00, op11_8, op4,
36800b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36810b57cec5SDimitry Andric                      v8i8, v8i16, IntOp, Commutable>;
36820b57cec5SDimitry Andric  def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
36830b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36840b57cec5SDimitry Andric                      v4i16, v4i32, IntOp, Commutable>;
36850b57cec5SDimitry Andric  def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
36860b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36870b57cec5SDimitry Andric                      v2i32, v2i64, IntOp, Commutable>;
36880b57cec5SDimitry Andric}
36890b57cec5SDimitry Andric
36900b57cec5SDimitry Andric
36910b57cec5SDimitry Andric// Neon Long 3-register vector operations.
36920b57cec5SDimitry Andric
36930b57cec5SDimitry Andricmulticlass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
36940b57cec5SDimitry Andric                    InstrItinClass itin16, InstrItinClass itin32,
36950b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
36960b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0> {
36970b57cec5SDimitry Andric  def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
36980b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
36990b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, Commutable>;
37000b57cec5SDimitry Andric  def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
37010b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
37020b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, Commutable>;
37030b57cec5SDimitry Andric  def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
37040b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
37050b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, Commutable>;
37060b57cec5SDimitry Andric}
37070b57cec5SDimitry Andric
37080b57cec5SDimitry Andricmulticlass N3VLSL_HS<bit op24, bits<4> op11_8,
37090b57cec5SDimitry Andric                     InstrItinClass itin, string OpcodeStr, string Dt,
37100b57cec5SDimitry Andric                     SDNode OpNode> {
37110b57cec5SDimitry Andric  def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
37120b57cec5SDimitry Andric                       !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
37130b57cec5SDimitry Andric  def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
37140b57cec5SDimitry Andric                     !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
37150b57cec5SDimitry Andric}
37160b57cec5SDimitry Andric
37170b57cec5SDimitry Andricmulticlass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37180b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
37190b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
3720fe6060f1SDimitry Andric                       SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
37210b57cec5SDimitry Andric  def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
37220b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
37230b57cec5SDimitry Andric                      v8i16, v8i8, OpNode, ExtOp, Commutable>;
37240b57cec5SDimitry Andric  def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
37250b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
37260b57cec5SDimitry Andric                      v4i32, v4i16, OpNode, ExtOp, Commutable>;
37270b57cec5SDimitry Andric  def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
37280b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
37290b57cec5SDimitry Andric                      v2i64, v2i32, OpNode, ExtOp, Commutable>;
37300b57cec5SDimitry Andric}
37310b57cec5SDimitry Andric
37320b57cec5SDimitry Andric// Neon Long 3-register vector intrinsics.
37330b57cec5SDimitry Andric
37340b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
37350b57cec5SDimitry Andricmulticlass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
37360b57cec5SDimitry Andric                      InstrItinClass itin16, InstrItinClass itin32,
37370b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
37380b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0> {
37390b57cec5SDimitry Andric  def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
37400b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
37410b57cec5SDimitry Andric                      v4i32, v4i16, IntOp, Commutable>;
37420b57cec5SDimitry Andric  def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
37430b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
37440b57cec5SDimitry Andric                      v2i64, v2i32, IntOp, Commutable>;
37450b57cec5SDimitry Andric}
37460b57cec5SDimitry Andric
37470b57cec5SDimitry Andricmulticlass N3VLIntSL_HS<bit op24, bits<4> op11_8,
37480b57cec5SDimitry Andric                        InstrItinClass itin, string OpcodeStr, string Dt,
37490b57cec5SDimitry Andric                        SDPatternOperator IntOp> {
37500b57cec5SDimitry Andric  def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
37510b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
37520b57cec5SDimitry Andric  def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
37530b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
37540b57cec5SDimitry Andric}
37550b57cec5SDimitry Andric
37560b57cec5SDimitry Andric// ....then also with element size of 8 bits:
37570b57cec5SDimitry Andricmulticlass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37580b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
37590b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
37600b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
37610b57cec5SDimitry Andric  : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
37620b57cec5SDimitry Andric               IntOp, Commutable> {
37630b57cec5SDimitry Andric  def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
37640b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
37650b57cec5SDimitry Andric                      v8i16, v8i8, IntOp, Commutable>;
37660b57cec5SDimitry Andric}
37670b57cec5SDimitry Andric
37680b57cec5SDimitry Andric// ....with explicit extend (VABDL).
37690b57cec5SDimitry Andricmulticlass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37700b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
37710b57cec5SDimitry Andric                       SDPatternOperator IntOp, SDNode ExtOp, bit Commutable = 0> {
37720b57cec5SDimitry Andric  def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
37730b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"),
37740b57cec5SDimitry Andric                         v8i16, v8i8, IntOp, ExtOp, Commutable>;
37750b57cec5SDimitry Andric  def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
37760b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"),
37770b57cec5SDimitry Andric                         v4i32, v4i16, IntOp, ExtOp, Commutable>;
37780b57cec5SDimitry Andric  def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
37790b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"),
37800b57cec5SDimitry Andric                         v2i64, v2i32, IntOp, ExtOp, Commutable>;
37810b57cec5SDimitry Andric}
37820b57cec5SDimitry Andric
37830b57cec5SDimitry Andric
37840b57cec5SDimitry Andric// Neon Wide 3-register vector intrinsics,
37850b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
37860b57cec5SDimitry Andricmulticlass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37870b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
3788fe6060f1SDimitry Andric                    SDNode OpNode, SDPatternOperator ExtOp, bit Commutable = 0> {
37890b57cec5SDimitry Andric  def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
37900b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
37910b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, ExtOp, Commutable>;
37920b57cec5SDimitry Andric  def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
37930b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
37940b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, ExtOp, Commutable>;
37950b57cec5SDimitry Andric  def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
37960b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
37970b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, ExtOp, Commutable>;
37980b57cec5SDimitry Andric}
37990b57cec5SDimitry Andric
38000b57cec5SDimitry Andric
38010b57cec5SDimitry Andric// Neon Multiply-Op vector operations,
38020b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38030b57cec5SDimitry Andricmulticlass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38040b57cec5SDimitry Andric                        InstrItinClass itinD16, InstrItinClass itinD32,
38050b57cec5SDimitry Andric                        InstrItinClass itinQ16, InstrItinClass itinQ32,
38060b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDNode OpNode> {
38070b57cec5SDimitry Andric  // 64-bit vector types.
38080b57cec5SDimitry Andric  def v8i8  : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
38090b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
38100b57cec5SDimitry Andric  def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
38110b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
38120b57cec5SDimitry Andric  def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
38130b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
38140b57cec5SDimitry Andric
38150b57cec5SDimitry Andric  // 128-bit vector types.
38160b57cec5SDimitry Andric  def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
38170b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
38180b57cec5SDimitry Andric  def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
38190b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
38200b57cec5SDimitry Andric  def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
38210b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
38220b57cec5SDimitry Andric}
38230b57cec5SDimitry Andric
38240b57cec5SDimitry Andricmulticlass N3VMulOpSL_HS<bits<4> op11_8,
38250b57cec5SDimitry Andric                         InstrItinClass itinD16, InstrItinClass itinD32,
38260b57cec5SDimitry Andric                         InstrItinClass itinQ16, InstrItinClass itinQ32,
38270b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator ShOp> {
38280b57cec5SDimitry Andric  def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
38290b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
38300b57cec5SDimitry Andric  def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
38310b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
38320b57cec5SDimitry Andric  def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
38330b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
38340b57cec5SDimitry Andric                            mul, ShOp>;
38350b57cec5SDimitry Andric  def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
38360b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
38370b57cec5SDimitry Andric                          mul, ShOp>;
38380b57cec5SDimitry Andric}
38390b57cec5SDimitry Andric
38400b57cec5SDimitry Andric// Neon Intrinsic-Op vector operations,
38410b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38420b57cec5SDimitry Andricmulticlass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38430b57cec5SDimitry Andric                        InstrItinClass itinD, InstrItinClass itinQ,
38440b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp,
38450b57cec5SDimitry Andric                        SDNode OpNode> {
38460b57cec5SDimitry Andric  // 64-bit vector types.
38470b57cec5SDimitry Andric  def v8i8  : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
38480b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
38490b57cec5SDimitry Andric  def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
38500b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
38510b57cec5SDimitry Andric  def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
38520b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
38530b57cec5SDimitry Andric
38540b57cec5SDimitry Andric  // 128-bit vector types.
38550b57cec5SDimitry Andric  def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
38560b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
38570b57cec5SDimitry Andric  def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
38580b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
38590b57cec5SDimitry Andric  def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
38600b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
38610b57cec5SDimitry Andric}
38620b57cec5SDimitry Andric
38630b57cec5SDimitry Andric// Neon 3-argument intrinsics,
38640b57cec5SDimitry Andric//   element sizes of 16 and 32 bits:
38650b57cec5SDimitry Andricmulticlass N3VInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
38660b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38670b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
38680b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
38690b57cec5SDimitry Andric  // 64-bit vector types.
38700b57cec5SDimitry Andric  def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD16,
38710b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
38720b57cec5SDimitry Andric  def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD32,
38730b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
38740b57cec5SDimitry Andric
38750b57cec5SDimitry Andric  // 128-bit vector types.
38760b57cec5SDimitry Andric  def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ16,
38770b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
38780b57cec5SDimitry Andric  def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ32,
38790b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
38800b57cec5SDimitry Andric}
38810b57cec5SDimitry Andric
38820b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38830b57cec5SDimitry Andricmulticlass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38840b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38850b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
38860b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp>
38870b57cec5SDimitry Andric           :N3VInt3_HS <op24, op23, op11_8, op4, itinD16, itinD32,
38880b57cec5SDimitry Andric                        itinQ16, itinQ32, OpcodeStr, Dt, IntOp>{
38890b57cec5SDimitry Andric  // 64-bit vector types.
38900b57cec5SDimitry Andric  def v8i8  : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD16,
38910b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
38920b57cec5SDimitry Andric  // 128-bit vector types.
38930b57cec5SDimitry Andric  def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ16,
38940b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
38950b57cec5SDimitry Andric}
38960b57cec5SDimitry Andric
38970b57cec5SDimitry Andric// Neon Long Multiply-Op vector operations,
38980b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38990b57cec5SDimitry Andricmulticlass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39000b57cec5SDimitry Andric                         InstrItinClass itin16, InstrItinClass itin32,
39010b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode MulOp,
39020b57cec5SDimitry Andric                         SDNode OpNode> {
39030b57cec5SDimitry Andric  def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
39040b57cec5SDimitry Andric                        !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
39050b57cec5SDimitry Andric  def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
39060b57cec5SDimitry Andric                        !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
39070b57cec5SDimitry Andric  def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
39080b57cec5SDimitry Andric                        !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
39090b57cec5SDimitry Andric}
39100b57cec5SDimitry Andric
39110b57cec5SDimitry Andricmulticlass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
39120b57cec5SDimitry Andric                          string Dt, SDNode MulOp, SDNode OpNode> {
39130b57cec5SDimitry Andric  def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
39140b57cec5SDimitry Andric                            !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
39150b57cec5SDimitry Andric  def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
39160b57cec5SDimitry Andric                          !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
39170b57cec5SDimitry Andric}
39180b57cec5SDimitry Andric
39190b57cec5SDimitry Andric
39200b57cec5SDimitry Andric// Neon Long 3-argument intrinsics.
39210b57cec5SDimitry Andric
39220b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
39230b57cec5SDimitry Andricmulticlass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
39240b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
39250b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39260b57cec5SDimitry Andric  def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
39270b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
39280b57cec5SDimitry Andric  def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
39290b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
39300b57cec5SDimitry Andric}
39310b57cec5SDimitry Andric
39320b57cec5SDimitry Andricmulticlass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
39330b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39340b57cec5SDimitry Andric  def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
39350b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
39360b57cec5SDimitry Andric  def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
39370b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
39380b57cec5SDimitry Andric}
39390b57cec5SDimitry Andric
39400b57cec5SDimitry Andric// ....then also with element size of 8 bits:
39410b57cec5SDimitry Andricmulticlass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39420b57cec5SDimitry Andric                        InstrItinClass itin16, InstrItinClass itin32,
39430b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp>
39440b57cec5SDimitry Andric  : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
39450b57cec5SDimitry Andric  def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
39460b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
39470b57cec5SDimitry Andric}
39480b57cec5SDimitry Andric
39490b57cec5SDimitry Andric// ....with explicit extend (VABAL).
39500b57cec5SDimitry Andricmulticlass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
39510b57cec5SDimitry Andric                            InstrItinClass itin, string OpcodeStr, string Dt,
39520b57cec5SDimitry Andric                            SDPatternOperator IntOp, SDNode ExtOp, SDNode OpNode> {
39530b57cec5SDimitry Andric  def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
39540b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
39550b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39560b57cec5SDimitry Andric  def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
39570b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
39580b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39590b57cec5SDimitry Andric  def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
39600b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
39610b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39620b57cec5SDimitry Andric}
39630b57cec5SDimitry Andric
39640b57cec5SDimitry Andric
39650b57cec5SDimitry Andric// Neon Pairwise long 2-register intrinsics,
39660b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39670b57cec5SDimitry Andricmulticlass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
39680b57cec5SDimitry Andric                        bits<5> op11_7, bit op4,
39690b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39700b57cec5SDimitry Andric  // 64-bit vector types.
39710b57cec5SDimitry Andric  def v8i8  : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39720b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
39730b57cec5SDimitry Andric  def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39740b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
39750b57cec5SDimitry Andric  def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39760b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
39770b57cec5SDimitry Andric
39780b57cec5SDimitry Andric  // 128-bit vector types.
39790b57cec5SDimitry Andric  def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39800b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
39810b57cec5SDimitry Andric  def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39820b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
39830b57cec5SDimitry Andric  def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39840b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
39850b57cec5SDimitry Andric}
39860b57cec5SDimitry Andric
39870b57cec5SDimitry Andric
39880b57cec5SDimitry Andric// Neon Pairwise long 2-register accumulate intrinsics,
39890b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39900b57cec5SDimitry Andricmulticlass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
39910b57cec5SDimitry Andric                         bits<5> op11_7, bit op4,
39920b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39930b57cec5SDimitry Andric  // 64-bit vector types.
39940b57cec5SDimitry Andric  def v8i8  : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39950b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
39960b57cec5SDimitry Andric  def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39970b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
39980b57cec5SDimitry Andric  def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39990b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
40000b57cec5SDimitry Andric
40010b57cec5SDimitry Andric  // 128-bit vector types.
40020b57cec5SDimitry Andric  def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
40030b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
40040b57cec5SDimitry Andric  def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
40050b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
40060b57cec5SDimitry Andric  def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
40070b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
40080b57cec5SDimitry Andric}
40090b57cec5SDimitry Andric
40100b57cec5SDimitry Andric
40110b57cec5SDimitry Andric// Neon 2-register vector shift by immediate,
40120b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
40130b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
40140b57cec5SDimitry Andricmulticlass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40150b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
40160b57cec5SDimitry Andric                       SDNode OpNode> {
40170b57cec5SDimitry Andric  // 64-bit vector types.
40180b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40190b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
40200b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40210b57cec5SDimitry Andric  }
40220b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40230b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
40240b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40250b57cec5SDimitry Andric  }
40260b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40270b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
40280b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40290b57cec5SDimitry Andric  }
40300b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
40310b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
40320b57cec5SDimitry Andric                             // imm6 = xxxxxx
40330b57cec5SDimitry Andric
40340b57cec5SDimitry Andric  // 128-bit vector types.
40350b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40360b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
40370b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40380b57cec5SDimitry Andric  }
40390b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40400b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
40410b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40420b57cec5SDimitry Andric  }
40430b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
40440b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
40450b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40460b57cec5SDimitry Andric  }
40470b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
40480b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
40490b57cec5SDimitry Andric                             // imm6 = xxxxxx
40500b57cec5SDimitry Andric}
40510b57cec5SDimitry Andricmulticlass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40520b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
4053349cc55cSDimitry Andric                       SDNode OpNode> {
40540b57cec5SDimitry Andric  // 64-bit vector types.
40550b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40560b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
40570b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40580b57cec5SDimitry Andric  }
40590b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40600b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
40610b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40620b57cec5SDimitry Andric  }
40630b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40640b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
40650b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40660b57cec5SDimitry Andric  }
40670b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40680b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
40690b57cec5SDimitry Andric                             // imm6 = xxxxxx
40700b57cec5SDimitry Andric
40710b57cec5SDimitry Andric  // 128-bit vector types.
40720b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40730b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
40740b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40750b57cec5SDimitry Andric  }
40760b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40770b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
40780b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40790b57cec5SDimitry Andric  }
40800b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40810b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
40820b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40830b57cec5SDimitry Andric  }
40840b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40850b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
40860b57cec5SDimitry Andric                             // imm6 = xxxxxx
40870b57cec5SDimitry Andric}
40880b57cec5SDimitry Andric
40890b57cec5SDimitry Andric// Neon Shift-Accumulate vector operations,
40900b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
40910b57cec5SDimitry Andricmulticlass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40920b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode ShOp> {
40930b57cec5SDimitry Andric  // 64-bit vector types.
40940b57cec5SDimitry Andric  def v8i8  : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
40950b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
40960b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40970b57cec5SDimitry Andric  }
40980b57cec5SDimitry Andric  def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
40990b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
41000b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41010b57cec5SDimitry Andric  }
41020b57cec5SDimitry Andric  def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
41030b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
41040b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41050b57cec5SDimitry Andric  }
41060b57cec5SDimitry Andric  def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
41070b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
41080b57cec5SDimitry Andric                             // imm6 = xxxxxx
41090b57cec5SDimitry Andric
41100b57cec5SDimitry Andric  // 128-bit vector types.
41110b57cec5SDimitry Andric  def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
41120b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
41130b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41140b57cec5SDimitry Andric  }
41150b57cec5SDimitry Andric  def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
41160b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
41170b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41180b57cec5SDimitry Andric  }
41190b57cec5SDimitry Andric  def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
41200b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
41210b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41220b57cec5SDimitry Andric  }
41230b57cec5SDimitry Andric  def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
41240b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
41250b57cec5SDimitry Andric                             // imm6 = xxxxxx
41260b57cec5SDimitry Andric}
41270b57cec5SDimitry Andric
41280b57cec5SDimitry Andric// Neon Shift-Insert vector operations,
41290b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
41300b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
41310b57cec5SDimitry Andricmulticlass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41320b57cec5SDimitry Andric                          string OpcodeStr> {
41330b57cec5SDimitry Andric  // 64-bit vector types.
41340b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41350b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsliImm> {
41360b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41370b57cec5SDimitry Andric  }
41380b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41390b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsliImm> {
41400b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41410b57cec5SDimitry Andric  }
41420b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
41430b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsliImm> {
41440b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41450b57cec5SDimitry Andric  }
41460b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
41470b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsliImm>;
41480b57cec5SDimitry Andric                             // imm6 = xxxxxx
41490b57cec5SDimitry Andric
41500b57cec5SDimitry Andric  // 128-bit vector types.
41510b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41520b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsliImm> {
41530b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41540b57cec5SDimitry Andric  }
41550b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41560b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsliImm> {
41570b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41580b57cec5SDimitry Andric  }
41590b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41600b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsliImm> {
41610b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41620b57cec5SDimitry Andric  }
41630b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
41640b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsliImm>;
41650b57cec5SDimitry Andric                             // imm6 = xxxxxx
41660b57cec5SDimitry Andric}
41670b57cec5SDimitry Andricmulticlass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41680b57cec5SDimitry Andric                          string OpcodeStr> {
41690b57cec5SDimitry Andric  // 64-bit vector types.
41700b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
41710b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsriImm> {
41720b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41730b57cec5SDimitry Andric  }
41740b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
41750b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsriImm> {
41760b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41770b57cec5SDimitry Andric  }
41780b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
41790b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsriImm> {
41800b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41810b57cec5SDimitry Andric  }
41820b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
41830b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsriImm>;
41840b57cec5SDimitry Andric                             // imm6 = xxxxxx
41850b57cec5SDimitry Andric
41860b57cec5SDimitry Andric  // 128-bit vector types.
41870b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
41880b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsriImm> {
41890b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41900b57cec5SDimitry Andric  }
41910b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
41920b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsriImm> {
41930b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41940b57cec5SDimitry Andric  }
41950b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
41960b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsriImm> {
41970b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41980b57cec5SDimitry Andric  }
41990b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
42000b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsriImm>;
42010b57cec5SDimitry Andric                             // imm6 = xxxxxx
42020b57cec5SDimitry Andric}
42030b57cec5SDimitry Andric
42040b57cec5SDimitry Andric// Neon Shift Long operations,
42050b57cec5SDimitry Andric//   element sizes of 8, 16, 32 bits:
42060b57cec5SDimitry Andricmulticlass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
42070b57cec5SDimitry Andric                      bit op4, string OpcodeStr, string Dt,
42080b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
42090b57cec5SDimitry Andric  def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42100b57cec5SDimitry Andric              OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, imm1_7, OpNode> {
42110b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
42120b57cec5SDimitry Andric  }
42130b57cec5SDimitry Andric  def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42140b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, imm1_15, OpNode> {
42150b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
42160b57cec5SDimitry Andric  }
42170b57cec5SDimitry Andric  def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
42180b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, imm1_31, OpNode> {
42190b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
42200b57cec5SDimitry Andric  }
42210b57cec5SDimitry Andric}
42220b57cec5SDimitry Andric
42230b57cec5SDimitry Andric// Neon Shift Narrow operations,
42240b57cec5SDimitry Andric//   element sizes of 16, 32, 64 bits:
42250b57cec5SDimitry Andricmulticlass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
42260b57cec5SDimitry Andric                      bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
42270b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
42280b57cec5SDimitry Andric  def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42290b57cec5SDimitry Andric                    OpcodeStr, !strconcat(Dt, "16"),
42300b57cec5SDimitry Andric                    v8i8, v8i16, shr_imm8, OpNode> {
42310b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
42320b57cec5SDimitry Andric  }
42330b57cec5SDimitry Andric  def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42340b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"),
42350b57cec5SDimitry Andric                     v4i16, v4i32, shr_imm16, OpNode> {
42360b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
42370b57cec5SDimitry Andric  }
42380b57cec5SDimitry Andric  def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
42390b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"),
42400b57cec5SDimitry Andric                     v2i32, v2i64, shr_imm32, OpNode> {
42410b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
42420b57cec5SDimitry Andric  }
42430b57cec5SDimitry Andric}
42440b57cec5SDimitry Andric
42450b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
42460b57cec5SDimitry Andric// Instruction Definitions.
42470b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
42480b57cec5SDimitry Andric
42490b57cec5SDimitry Andric// Vector Add Operations.
42500b57cec5SDimitry Andric
42510b57cec5SDimitry Andric//   VADD     : Vector Add (integer and floating-point)
42520b57cec5SDimitry Andricdefm VADD     : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
42530b57cec5SDimitry Andric                         add, 1>;
42540b57cec5SDimitry Andricdef  VADDfd   : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
42550b57cec5SDimitry Andric                     v2f32, v2f32, fadd, 1>;
42560b57cec5SDimitry Andricdef  VADDfq   : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
42570b57cec5SDimitry Andric                     v4f32, v4f32, fadd, 1>;
42580b57cec5SDimitry Andricdef  VADDhd   : N3VD<0, 0, 0b01, 0b1101, 0, IIC_VBIND, "vadd", "f16",
42590b57cec5SDimitry Andric                     v4f16, v4f16, fadd, 1>,
42600b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42610b57cec5SDimitry Andricdef  VADDhq   : N3VQ<0, 0, 0b01, 0b1101, 0, IIC_VBINQ, "vadd", "f16",
42620b57cec5SDimitry Andric                     v8f16, v8f16, fadd, 1>,
42630b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42640b57cec5SDimitry Andric//   VADDL    : Vector Add Long (Q = D + D)
42650b57cec5SDimitry Andricdefm VADDLs   : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
42660b57cec5SDimitry Andric                            "vaddl", "s", add, sext, 1>;
42670b57cec5SDimitry Andricdefm VADDLu   : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
4268e8d8bef9SDimitry Andric                            "vaddl", "u", add, zanyext, 1>;
42690b57cec5SDimitry Andric//   VADDW    : Vector Add Wide (Q = Q + D)
42700b57cec5SDimitry Andricdefm VADDWs   : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
4271e8d8bef9SDimitry Andricdefm VADDWu   : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zanyext, 0>;
42720b57cec5SDimitry Andric//   VHADD    : Vector Halving Add
42730b57cec5SDimitry Andricdefm VHADDs   : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
42740b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42750b57cec5SDimitry Andric                           "vhadd", "s", int_arm_neon_vhadds, 1>;
42760b57cec5SDimitry Andricdefm VHADDu   : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
42770b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42780b57cec5SDimitry Andric                           "vhadd", "u", int_arm_neon_vhaddu, 1>;
42790b57cec5SDimitry Andric//   VRHADD   : Vector Rounding Halving Add
42800b57cec5SDimitry Andricdefm VRHADDs  : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
42810b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42820b57cec5SDimitry Andric                           "vrhadd", "s", int_arm_neon_vrhadds, 1>;
42830b57cec5SDimitry Andricdefm VRHADDu  : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
42840b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42850b57cec5SDimitry Andric                           "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
42860b57cec5SDimitry Andric//   VQADD    : Vector Saturating Add
42870b57cec5SDimitry Andricdefm VQADDs   : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
42880b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4289480093f4SDimitry Andric                            "vqadd", "s", saddsat, 1>;
42900b57cec5SDimitry Andricdefm VQADDu   : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
42910b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4292480093f4SDimitry Andric                            "vqadd", "u", uaddsat, 1>;
42930b57cec5SDimitry Andric//   VADDHN   : Vector Add and Narrow Returning High Half (D = Q + Q)
42940b57cec5SDimitry Andricdefm VADDHN   : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i", null_frag, 1>;
42950b57cec5SDimitry Andric//   VRADDHN  : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
42960b57cec5SDimitry Andricdefm VRADDHN  : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
42970b57cec5SDimitry Andric                            int_arm_neon_vraddhn, 1>;
42980b57cec5SDimitry Andric
42990b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43000b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (add (v8i16 QPR:$Vn), QPR:$Vm), 8))),
43010b57cec5SDimitry Andric          (VADDHNv8i8 QPR:$Vn, QPR:$Vm)>;
43020b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (add (v4i32 QPR:$Vn), QPR:$Vm), 16))),
43030b57cec5SDimitry Andric          (VADDHNv4i16 QPR:$Vn, QPR:$Vm)>;
43040b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (add (v2i64 QPR:$Vn), QPR:$Vm), 32))),
43050b57cec5SDimitry Andric          (VADDHNv2i32 QPR:$Vn, QPR:$Vm)>;
43060b57cec5SDimitry Andric}
43070b57cec5SDimitry Andric
43080b57cec5SDimitry Andric// Vector Multiply Operations.
43090b57cec5SDimitry Andric
43100b57cec5SDimitry Andric//   VMUL     : Vector Multiply (integer, polynomial and floating-point)
43110b57cec5SDimitry Andricdefm VMUL     : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
43120b57cec5SDimitry Andric                        IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
43130b57cec5SDimitry Andricdef  VMULpd   : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
43140b57cec5SDimitry Andric                        "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
43150b57cec5SDimitry Andricdef  VMULpq   : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
43160b57cec5SDimitry Andric                        "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
43170b57cec5SDimitry Andricdef  VMULfd   : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
43180b57cec5SDimitry Andric                     v2f32, v2f32, fmul, 1>;
43190b57cec5SDimitry Andricdef  VMULfq   : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
43200b57cec5SDimitry Andric                     v4f32, v4f32, fmul, 1>;
43210b57cec5SDimitry Andricdef  VMULhd   : N3VD<1, 0, 0b01, 0b1101, 1, IIC_VFMULD, "vmul", "f16",
43220b57cec5SDimitry Andric                     v4f16, v4f16, fmul, 1>,
43230b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43240b57cec5SDimitry Andricdef  VMULhq   : N3VQ<1, 0, 0b01, 0b1101, 1, IIC_VFMULQ, "vmul", "f16",
43250b57cec5SDimitry Andric                     v8f16, v8f16, fmul, 1>,
43260b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43270b57cec5SDimitry Andricdefm VMULsl   : N3VSL_HS<0b1000, "vmul", mul>;
43280b57cec5SDimitry Andricdef  VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
43290b57cec5SDimitry Andricdef  VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
43300b57cec5SDimitry Andric                       v2f32, fmul>;
43310b57cec5SDimitry Andricdef  VMULslhd : N3VDSL16<0b01, 0b1001, "vmul", "f16", v4f16, fmul>,
43320b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43330b57cec5SDimitry Andricdef  VMULslhq : N3VQSL16<0b01, 0b1001, "vmul", "f16", v8f16,
43340b57cec5SDimitry Andric                       v4f16, fmul>,
43350b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
43360b57cec5SDimitry Andric
43370b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43380b57cec5SDimitry Andricdef : Pat<(v8i16 (mul (v8i16 QPR:$src1),
43390b57cec5SDimitry Andric                      (v8i16 (ARMvduplane (v8i16 QPR:$src2), imm:$lane)))),
43400b57cec5SDimitry Andric          (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
43410b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src2,
43420b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
43430b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
43440b57cec5SDimitry Andricdef : Pat<(v4i32 (mul (v4i32 QPR:$src1),
43450b57cec5SDimitry Andric                      (v4i32 (ARMvduplane (v4i32 QPR:$src2), imm:$lane)))),
43460b57cec5SDimitry Andric          (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
43470b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src2,
43480b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
43490b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
43500b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
43510b57cec5SDimitry Andric                       (v4f32 (ARMvduplane (v4f32 QPR:$src2), imm:$lane)))),
43520b57cec5SDimitry Andric          (v4f32 (VMULslfq (v4f32 QPR:$src1),
43530b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src2,
43540b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
43550b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
43560b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul (v8f16 QPR:$src1),
43570b57cec5SDimitry Andric                       (v8f16 (ARMvduplane (v8f16 QPR:$src2), imm:$lane)))),
43580b57cec5SDimitry Andric          (v8f16 (VMULslhq(v8f16 QPR:$src1),
43590b57cec5SDimitry Andric                           (v4f16 (EXTRACT_SUBREG QPR:$src2,
43600b57cec5SDimitry Andric                                   (DSubReg_i16_reg imm:$lane))),
43610b57cec5SDimitry Andric                           (SubReg_i16_lane imm:$lane)))>;
43620b57cec5SDimitry Andric
43630b57cec5SDimitry Andricdef : Pat<(v2f32 (fmul DPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43640b57cec5SDimitry Andric          (VMULslfd DPR:$Rn,
43650b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43660b57cec5SDimitry Andric            (i32 0))>;
43670b57cec5SDimitry Andricdef : Pat<(v4f16 (fmul DPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43680b57cec5SDimitry Andric          (VMULslhd DPR:$Rn,
43695ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43700b57cec5SDimitry Andric            (i32 0))>;
43710b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul QPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43720b57cec5SDimitry Andric          (VMULslfq QPR:$Rn,
43730b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43740b57cec5SDimitry Andric            (i32 0))>;
43750b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul QPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43760b57cec5SDimitry Andric          (VMULslhq QPR:$Rn,
43775ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43780b57cec5SDimitry Andric            (i32 0))>;
43790b57cec5SDimitry Andric}
43800b57cec5SDimitry Andric
43810b57cec5SDimitry Andric//   VQDMULH  : Vector Saturating Doubling Multiply Returning High Half
43820b57cec5SDimitry Andricdefm VQDMULH  : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
43830b57cec5SDimitry Andric                          IIC_VMULi16Q, IIC_VMULi32Q,
43840b57cec5SDimitry Andric                          "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
43850b57cec5SDimitry Andricdefm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
43860b57cec5SDimitry Andric                            IIC_VMULi16Q, IIC_VMULi32Q,
43870b57cec5SDimitry Andric                            "vqdmulh", "s",  int_arm_neon_vqdmulh>;
43880b57cec5SDimitry Andric
43890b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43900b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
43910b57cec5SDimitry Andric                                       (v8i16 (ARMvduplane (v8i16 QPR:$src2),
43920b57cec5SDimitry Andric                                                            imm:$lane)))),
43930b57cec5SDimitry Andric          (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
43940b57cec5SDimitry Andric                                 (v4i16 (EXTRACT_SUBREG QPR:$src2,
43950b57cec5SDimitry Andric                                         (DSubReg_i16_reg imm:$lane))),
43960b57cec5SDimitry Andric                                 (SubReg_i16_lane imm:$lane)))>;
43970b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
43980b57cec5SDimitry Andric                                       (v4i32 (ARMvduplane (v4i32 QPR:$src2),
43990b57cec5SDimitry Andric                                                            imm:$lane)))),
44000b57cec5SDimitry Andric          (v4i32 (VQDMULHslv4i32 (v4i32 QPR:$src1),
44010b57cec5SDimitry Andric                                 (v2i32 (EXTRACT_SUBREG QPR:$src2,
44020b57cec5SDimitry Andric                                         (DSubReg_i32_reg imm:$lane))),
44030b57cec5SDimitry Andric                                 (SubReg_i32_lane imm:$lane)))>;
44040b57cec5SDimitry Andric}
44050b57cec5SDimitry Andric
44060b57cec5SDimitry Andric//   VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
44070b57cec5SDimitry Andricdefm VQRDMULH   : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
44080b57cec5SDimitry Andric                            IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
44090b57cec5SDimitry Andric                            "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
44100b57cec5SDimitry Andricdefm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
44110b57cec5SDimitry Andric                              IIC_VMULi16Q, IIC_VMULi32Q,
44120b57cec5SDimitry Andric                              "vqrdmulh", "s",  int_arm_neon_vqrdmulh>;
44130b57cec5SDimitry Andric
44140b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
44150b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
44160b57cec5SDimitry Andric                                        (v8i16 (ARMvduplane (v8i16 QPR:$src2),
44170b57cec5SDimitry Andric                                                             imm:$lane)))),
44180b57cec5SDimitry Andric          (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
44190b57cec5SDimitry Andric                                  (v4i16 (EXTRACT_SUBREG QPR:$src2,
44200b57cec5SDimitry Andric                                          (DSubReg_i16_reg imm:$lane))),
44210b57cec5SDimitry Andric                                  (SubReg_i16_lane imm:$lane)))>;
44220b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
44230b57cec5SDimitry Andric                                        (v4i32 (ARMvduplane (v4i32 QPR:$src2),
44240b57cec5SDimitry Andric                                                             imm:$lane)))),
44250b57cec5SDimitry Andric          (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
44260b57cec5SDimitry Andric                                  (v2i32 (EXTRACT_SUBREG QPR:$src2,
44270b57cec5SDimitry Andric                                          (DSubReg_i32_reg imm:$lane))),
44280b57cec5SDimitry Andric                                  (SubReg_i32_lane imm:$lane)))>;
44290b57cec5SDimitry Andric}
44300b57cec5SDimitry Andric
44310b57cec5SDimitry Andric//   VMULL    : Vector Multiply Long (integer and polynomial) (Q = D * D)
44320b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
44330b57cec5SDimitry Andric    DecoderNamespace = "NEONData" in {
44340b57cec5SDimitry Andric  defm VMULLs   : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
44355ffd83dbSDimitry Andric                           "vmull", "s", ARMvmulls, 1>;
44360b57cec5SDimitry Andric  defm VMULLu   : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
44375ffd83dbSDimitry Andric                           "vmull", "u", ARMvmullu, 1>;
44380b57cec5SDimitry Andric  def  VMULLp8   :  N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
44390b57cec5SDimitry Andric                            v8i16, v8i8, int_arm_neon_vmullp, 1>;
44400b57cec5SDimitry Andric  def  VMULLp64  : N3VLIntnp<0b00101, 0b10, 0b1110, 0, 0, NoItinerary,
44410b57cec5SDimitry Andric                          "vmull", "p64", v2i64, v1i64, int_arm_neon_vmullp, 1>,
4442fe6060f1SDimitry Andric                    Requires<[HasV8, HasAES]>;
44430b57cec5SDimitry Andric}
44445ffd83dbSDimitry Andricdefm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", ARMvmulls>;
44455ffd83dbSDimitry Andricdefm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", ARMvmullu>;
44460b57cec5SDimitry Andric
44470b57cec5SDimitry Andric//   VQDMULL  : Vector Saturating Doubling Multiply Long (Q = D * D)
44480b57cec5SDimitry Andricdefm VQDMULL  : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
44490b57cec5SDimitry Andric                           "vqdmull", "s", int_arm_neon_vqdmull, 1>;
44500b57cec5SDimitry Andricdefm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
44510b57cec5SDimitry Andric                             "vqdmull", "s", int_arm_neon_vqdmull>;
44520b57cec5SDimitry Andric
44530b57cec5SDimitry Andric// Vector Multiply-Accumulate and Multiply-Subtract Operations.
44540b57cec5SDimitry Andric
44550b57cec5SDimitry Andric//   VMLA     : Vector Multiply Accumulate (integer and floating-point)
44560b57cec5SDimitry Andricdefm VMLA     : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
44570b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44580b57cec5SDimitry Andricdef  VMLAfd   : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
44590b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
44600b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44610b57cec5SDimitry Andricdef  VMLAfq   : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
44620b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
44630b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44640b57cec5SDimitry Andricdef  VMLAhd   : N3VDMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACD, "vmla", "f16",
44650b57cec5SDimitry Andric                          v4f16, fmul_su, fadd_mlx>,
44660b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44670b57cec5SDimitry Andricdef  VMLAhq   : N3VQMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACQ, "vmla", "f16",
44680b57cec5SDimitry Andric                          v8f16, fmul_su, fadd_mlx>,
44690b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44700b57cec5SDimitry Andricdefm VMLAsl   : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
44710b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44720b57cec5SDimitry Andricdef  VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
44730b57cec5SDimitry Andric                            v2f32, fmul_su, fadd_mlx>,
44740b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44750b57cec5SDimitry Andricdef  VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
44760b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fadd_mlx>,
44770b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44780b57cec5SDimitry Andricdef  VMLAslhd : N3VDMulOpSL16<0b01, 0b0001, IIC_VMACD, "vmla", "f16",
44790b57cec5SDimitry Andric                            v4f16, fmul, fadd>,
44800b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44810b57cec5SDimitry Andricdef  VMLAslhq : N3VQMulOpSL16<0b01, 0b0001, IIC_VMACQ, "vmla", "f16",
44820b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fadd>,
44830b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44840b57cec5SDimitry Andric
44850b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
44860b57cec5SDimitry Andricdef : Pat<(v8i16 (add (v8i16 QPR:$src1),
44870b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
44880b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
44890b57cec5SDimitry Andric          (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
44900b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
44910b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
44920b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
44930b57cec5SDimitry Andric
44940b57cec5SDimitry Andricdef : Pat<(v4i32 (add (v4i32 QPR:$src1),
44950b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
44960b57cec5SDimitry Andric                       (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
44970b57cec5SDimitry Andric          (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
44980b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
44990b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
45000b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
45010b57cec5SDimitry Andric}
45020b57cec5SDimitry Andric
45030b57cec5SDimitry Andricdef : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
45040b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
45050b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
45060b57cec5SDimitry Andric          (v4f32 (VMLAslfq (v4f32 QPR:$src1),
45070b57cec5SDimitry Andric                           (v4f32 QPR:$src2),
45080b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
45090b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
45100b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
45110b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
45120b57cec5SDimitry Andric
45130b57cec5SDimitry Andric//   VMLAL    : Vector Multiply Accumulate Long (Q += D * D)
45140b57cec5SDimitry Andricdefm VMLALs   : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
45155ffd83dbSDimitry Andric                              "vmlal", "s", ARMvmulls, add>;
45160b57cec5SDimitry Andricdefm VMLALu   : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
45175ffd83dbSDimitry Andric                              "vmlal", "u", ARMvmullu, add>;
45180b57cec5SDimitry Andric
45195ffd83dbSDimitry Andricdefm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", ARMvmulls, add>;
45205ffd83dbSDimitry Andricdefm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", ARMvmullu, add>;
45210b57cec5SDimitry Andric
45220b57cec5SDimitry Andriclet Predicates = [HasNEON, HasV8_1a] in {
45230b57cec5SDimitry Andric  // v8.1a Neon Rounding Double Multiply-Op vector operations,
45240b57cec5SDimitry Andric  // VQRDMLAH : Vector Saturating Rounding Doubling Multiply Accumulate Long
45250b57cec5SDimitry Andric  //            (Q += D * D)
45260b57cec5SDimitry Andric  defm VQRDMLAH : N3VInt3_HS<1, 0, 0b1011, 1, IIC_VMACi16D, IIC_VMACi32D,
45270b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
45280b57cec5SDimitry Andric                             null_frag>;
452904eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
453004eeddc0SDimitry Andric                                                   (v4i16 DPR:$Vm))),
45310b57cec5SDimitry Andric            (v4i16 (VQRDMLAHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
453204eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
453304eeddc0SDimitry Andric                                                   (v2i32 DPR:$Vm))),
45340b57cec5SDimitry Andric            (v2i32 (VQRDMLAHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
453504eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
453604eeddc0SDimitry Andric                                                   (v8i16 QPR:$Vm))),
45370b57cec5SDimitry Andric            (v8i16 (VQRDMLAHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
453804eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
453904eeddc0SDimitry Andric                                                   (v4i32 QPR:$Vm))),
45400b57cec5SDimitry Andric            (v4i32 (VQRDMLAHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
45410b57cec5SDimitry Andric
45420b57cec5SDimitry Andric  defm VQRDMLAHsl : N3VMulOpSL_HS<0b1110, IIC_VMACi16D, IIC_VMACi32D,
45430b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
45440b57cec5SDimitry Andric                                  null_frag>;
454504eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlah (v4i16 DPR:$src1),
45460b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
45470b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
454804eeddc0SDimitry Andric                                                   imm:$lane)))),
45490b57cec5SDimitry Andric            (v4i16 (VQRDMLAHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm,
45500b57cec5SDimitry Andric                                    imm:$lane))>;
455104eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlah (v2i32 DPR:$src1),
45520b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
45530b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
455404eeddc0SDimitry Andric                                                   imm:$lane)))),
45550b57cec5SDimitry Andric            (v2i32 (VQRDMLAHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
45560b57cec5SDimitry Andric                                    imm:$lane))>;
455704eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlah (v8i16 QPR:$src1),
45580b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
45590b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
456004eeddc0SDimitry Andric                                                   imm:$lane)))),
45610b57cec5SDimitry Andric            (v8i16 (VQRDMLAHslv8i16 (v8i16 QPR:$src1),
45620b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
45630b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
45640b57cec5SDimitry Andric                                             QPR:$src3,
45650b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
45660b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
456704eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlah (v4i32 QPR:$src1),
45680b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
45690b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
457004eeddc0SDimitry Andric                                                   imm:$lane)))),
45710b57cec5SDimitry Andric            (v4i32 (VQRDMLAHslv4i32 (v4i32 QPR:$src1),
45720b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
45730b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
45740b57cec5SDimitry Andric                                             QPR:$src3,
45750b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
45760b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
45770b57cec5SDimitry Andric
45780b57cec5SDimitry Andric  //   VQRDMLSH : Vector Saturating Rounding Doubling Multiply Subtract Long
45790b57cec5SDimitry Andric  //              (Q -= D * D)
45800b57cec5SDimitry Andric  defm VQRDMLSH : N3VInt3_HS<1, 0, 0b1100, 1, IIC_VMACi16D, IIC_VMACi32D,
45810b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
45820b57cec5SDimitry Andric                             null_frag>;
458304eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1), (v4i16 DPR:$Vn),
458404eeddc0SDimitry Andric                                                   (v4i16 DPR:$Vm))),
45850b57cec5SDimitry Andric            (v4i16 (VQRDMLSHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
458604eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1), (v2i32 DPR:$Vn),
458704eeddc0SDimitry Andric                                                   (v2i32 DPR:$Vm))),
45880b57cec5SDimitry Andric            (v2i32 (VQRDMLSHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
458904eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1), (v8i16 QPR:$Vn),
459004eeddc0SDimitry Andric                                                   (v8i16 QPR:$Vm))),
45910b57cec5SDimitry Andric            (v8i16 (VQRDMLSHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
459204eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1), (v4i32 QPR:$Vn),
459304eeddc0SDimitry Andric                                                   (v4i32 QPR:$Vm))),
45940b57cec5SDimitry Andric            (v4i32 (VQRDMLSHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
45950b57cec5SDimitry Andric
45960b57cec5SDimitry Andric  defm VQRDMLSHsl : N3VMulOpSL_HS<0b1111, IIC_VMACi16D, IIC_VMACi32D,
45970b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
45980b57cec5SDimitry Andric                                  null_frag>;
459904eeddc0SDimitry Andric  def : Pat<(v4i16 (int_arm_neon_vqrdmlsh (v4i16 DPR:$src1),
46000b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
46010b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
460204eeddc0SDimitry Andric                                                   imm:$lane)))),
46030b57cec5SDimitry Andric            (v4i16 (VQRDMLSHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane))>;
460404eeddc0SDimitry Andric  def : Pat<(v2i32 (int_arm_neon_vqrdmlsh (v2i32 DPR:$src1),
46050b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
46060b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
460704eeddc0SDimitry Andric                                                   imm:$lane)))),
46080b57cec5SDimitry Andric            (v2i32 (VQRDMLSHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
46090b57cec5SDimitry Andric                                    imm:$lane))>;
461004eeddc0SDimitry Andric  def : Pat<(v8i16 (int_arm_neon_vqrdmlsh (v8i16 QPR:$src1),
46110b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
46120b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
461304eeddc0SDimitry Andric                                                   imm:$lane)))),
46140b57cec5SDimitry Andric            (v8i16 (VQRDMLSHslv8i16 (v8i16 QPR:$src1),
46150b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
46160b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
46170b57cec5SDimitry Andric                                             QPR:$src3,
46180b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
46190b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
462004eeddc0SDimitry Andric  def : Pat<(v4i32 (int_arm_neon_vqrdmlsh (v4i32 QPR:$src1),
46210b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
46220b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
462304eeddc0SDimitry Andric                                                    imm:$lane)))),
46240b57cec5SDimitry Andric            (v4i32 (VQRDMLSHslv4i32 (v4i32 QPR:$src1),
46250b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
46260b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
46270b57cec5SDimitry Andric                                             QPR:$src3,
46280b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
46290b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
46300b57cec5SDimitry Andric}
46310b57cec5SDimitry Andric//   VQDMLAL  : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
46320b57cec5SDimitry Andricdefm VQDMLAL  : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46330b57cec5SDimitry Andric                            "vqdmlal", "s", null_frag>;
46340b57cec5SDimitry Andricdefm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", null_frag>;
46350b57cec5SDimitry Andric
46360b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4637480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46380b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46390b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
46400b57cec5SDimitry Andric          (VQDMLALv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4641480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46420b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46430b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
46440b57cec5SDimitry Andric          (VQDMLALv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4645480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46460b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46470b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
46480b57cec5SDimitry Andric                                                     imm:$lane)))))),
46490b57cec5SDimitry Andric          (VQDMLALslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4650480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46510b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46520b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
46530b57cec5SDimitry Andric                                                     imm:$lane)))))),
46540b57cec5SDimitry Andric          (VQDMLALslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
46550b57cec5SDimitry Andric}
46560b57cec5SDimitry Andric
46570b57cec5SDimitry Andric//   VMLS     : Vector Multiply Subtract (integer and floating-point)
46580b57cec5SDimitry Andricdefm VMLS     : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46590b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46600b57cec5SDimitry Andricdef  VMLSfd   : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
46610b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
46620b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46630b57cec5SDimitry Andricdef  VMLSfq   : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
46640b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
46650b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46660b57cec5SDimitry Andricdef  VMLShd   : N3VDMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACD, "vmls", "f16",
46670b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
46680b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46690b57cec5SDimitry Andricdef  VMLShq   : N3VQMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACQ, "vmls", "f16",
46700b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
46710b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46720b57cec5SDimitry Andricdefm VMLSsl   : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
46730b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46740b57cec5SDimitry Andricdef  VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
46750b57cec5SDimitry Andric                            v2f32, fmul_su, fsub_mlx>,
46760b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46770b57cec5SDimitry Andricdef  VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
46780b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fsub_mlx>,
46790b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46800b57cec5SDimitry Andricdef  VMLSslhd : N3VDMulOpSL16<0b01, 0b0101, IIC_VMACD, "vmls", "f16",
46810b57cec5SDimitry Andric                            v4f16, fmul, fsub>,
46820b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46830b57cec5SDimitry Andricdef  VMLSslhq : N3VQMulOpSL16<0b01, 0b0101, IIC_VMACQ, "vmls", "f16",
46840b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fsub>,
46850b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46860b57cec5SDimitry Andric
46870b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
46880b57cec5SDimitry Andricdef : Pat<(v8i16 (sub (v8i16 QPR:$src1),
46890b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
46900b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
46910b57cec5SDimitry Andric          (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
46920b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
46930b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
46940b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
46950b57cec5SDimitry Andric
46960b57cec5SDimitry Andricdef : Pat<(v4i32 (sub (v4i32 QPR:$src1),
46970b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
46980b57cec5SDimitry Andric                     (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
46990b57cec5SDimitry Andric          (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
47000b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
47010b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
47020b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
47030b57cec5SDimitry Andric}
47040b57cec5SDimitry Andric
47050b57cec5SDimitry Andricdef : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
47060b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
47070b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
47080b57cec5SDimitry Andric          (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
47090b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
47100b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
47110b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
47120b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
47130b57cec5SDimitry Andric
47140b57cec5SDimitry Andric//   VMLSL    : Vector Multiply Subtract Long (Q -= D * D)
47150b57cec5SDimitry Andricdefm VMLSLs   : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
47165ffd83dbSDimitry Andric                              "vmlsl", "s", ARMvmulls, sub>;
47170b57cec5SDimitry Andricdefm VMLSLu   : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
47185ffd83dbSDimitry Andric                              "vmlsl", "u", ARMvmullu, sub>;
47190b57cec5SDimitry Andric
47205ffd83dbSDimitry Andricdefm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", ARMvmulls, sub>;
47215ffd83dbSDimitry Andricdefm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", ARMvmullu, sub>;
47220b57cec5SDimitry Andric
47230b57cec5SDimitry Andric//   VQDMLSL  : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
47240b57cec5SDimitry Andricdefm VQDMLSL  : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
47250b57cec5SDimitry Andric                            "vqdmlsl", "s", null_frag>;
47260b57cec5SDimitry Andricdefm VQDMLSLsl: N3VLInt3SL_HS<0, 0b0111, "vqdmlsl", "s", null_frag>;
47270b57cec5SDimitry Andric
47280b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4729480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47300b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47310b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
47320b57cec5SDimitry Andric          (VQDMLSLv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4733480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47340b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47350b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
47360b57cec5SDimitry Andric          (VQDMLSLv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4737480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47380b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47390b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
47400b57cec5SDimitry Andric                                                     imm:$lane)))))),
47410b57cec5SDimitry Andric          (VQDMLSLslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4742480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47430b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47440b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
47450b57cec5SDimitry Andric                                                     imm:$lane)))))),
47460b57cec5SDimitry Andric          (VQDMLSLslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
47470b57cec5SDimitry Andric}
47480b57cec5SDimitry Andric
47490b57cec5SDimitry Andric// Fused Vector Multiply-Accumulate and Fused Multiply-Subtract Operations.
47500b57cec5SDimitry Andricdef  VFMAfd   : N3VDMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACD, "vfma", "f32",
47510b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
47520b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47530b57cec5SDimitry Andric
47540b57cec5SDimitry Andricdef  VFMAfq   : N3VQMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACQ, "vfma", "f32",
47550b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
47560b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47570b57cec5SDimitry Andricdef  VFMAhd   : N3VDMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACD, "vfma", "f16",
47580b57cec5SDimitry Andric                          v4f16, fmul, fadd>,
47590b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47600b57cec5SDimitry Andric
47610b57cec5SDimitry Andricdef  VFMAhq   : N3VQMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACQ, "vfma", "f16",
47620b57cec5SDimitry Andric                          v8f16, fmul, fadd>,
47630b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47640b57cec5SDimitry Andric
47650b57cec5SDimitry Andric//   Fused Vector Multiply Subtract (floating-point)
47660b57cec5SDimitry Andricdef  VFMSfd   : N3VDMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACD, "vfms", "f32",
47670b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
47680b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47690b57cec5SDimitry Andricdef  VFMSfq   : N3VQMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACQ, "vfms", "f32",
47700b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
47710b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47720b57cec5SDimitry Andricdef  VFMShd   : N3VDMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACD, "vfms", "f16",
47730b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
47740b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47750b57cec5SDimitry Andricdef  VFMShq   : N3VQMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACQ, "vfms", "f16",
47760b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
47770b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47780b57cec5SDimitry Andric
47790b57cec5SDimitry Andric// Match @llvm.fma.* intrinsics
47800b57cec5SDimitry Andricdef : Pat<(v4f16 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
47810b57cec5SDimitry Andric          (VFMAhd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47820b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
47830b57cec5SDimitry Andricdef : Pat<(v8f16 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
47840b57cec5SDimitry Andric          (VFMAhq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47850b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
47860b57cec5SDimitry Andricdef : Pat<(v2f32 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
47870b57cec5SDimitry Andric          (VFMAfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47880b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
47890b57cec5SDimitry Andricdef : Pat<(v4f32 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
47900b57cec5SDimitry Andric          (VFMAfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47910b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
47920b57cec5SDimitry Andricdef : Pat<(v2f32 (fma (fneg DPR:$Vn), DPR:$Vm, DPR:$src1)),
47930b57cec5SDimitry Andric          (VFMSfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47940b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
47950b57cec5SDimitry Andricdef : Pat<(v4f32 (fma (fneg QPR:$Vn), QPR:$Vm, QPR:$src1)),
47960b57cec5SDimitry Andric          (VFMSfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47970b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
47980b57cec5SDimitry Andric
47990b57cec5SDimitry Andric// ARMv8.2a dot product instructions.
48000b57cec5SDimitry Andric// We put them in the VFPV8 decoder namespace because the ARM and Thumb
48010b57cec5SDimitry Andric// encodings are the same and thus no further bit twiddling is necessary
48020b57cec5SDimitry Andric// in the disassembler.
48035ffd83dbSDimitry Andricclass VDOT<bit op6, bit op4, bit op23, RegisterClass RegTy, string Asm,
48045ffd83dbSDimitry Andric           string AsmTy, ValueType AccumTy, ValueType InputTy,
48050b57cec5SDimitry Andric           SDPatternOperator OpNode> :
48065ffd83dbSDimitry Andric      N3Vnp<{0b1100, op23}, 0b10, 0b1101, op6, op4, (outs RegTy:$dst),
48070b57cec5SDimitry Andric            (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm), N3RegFrm, IIC_VDOTPROD,
48080b57cec5SDimitry Andric            Asm, AsmTy,
48090b57cec5SDimitry Andric            [(set (AccumTy RegTy:$dst),
48100b57cec5SDimitry Andric                  (OpNode (AccumTy RegTy:$Vd),
48110b57cec5SDimitry Andric                          (InputTy RegTy:$Vn),
48120b57cec5SDimitry Andric                          (InputTy RegTy:$Vm)))]> {
48130b57cec5SDimitry Andric  let Predicates = [HasDotProd];
48140b57cec5SDimitry Andric  let DecoderNamespace = "VFPV8";
48150b57cec5SDimitry Andric  let Constraints = "$dst = $Vd";
48160b57cec5SDimitry Andric}
48170b57cec5SDimitry Andric
48185ffd83dbSDimitry Andricdef VUDOTD : VDOT<0, 1, 0, DPR, "vudot", "u8", v2i32, v8i8,  int_arm_neon_udot>;
48195ffd83dbSDimitry Andricdef VSDOTD : VDOT<0, 0, 0, DPR, "vsdot", "s8", v2i32, v8i8,  int_arm_neon_sdot>;
48205ffd83dbSDimitry Andricdef VUDOTQ : VDOT<1, 1, 0, QPR, "vudot", "u8", v4i32, v16i8, int_arm_neon_udot>;
48215ffd83dbSDimitry Andricdef VSDOTQ : VDOT<1, 0, 0, QPR, "vsdot", "s8", v4i32, v16i8, int_arm_neon_sdot>;
48220b57cec5SDimitry Andric
48230b57cec5SDimitry Andric// Indexed dot product instructions:
48240b57cec5SDimitry Andricmulticlass DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty,
48250b57cec5SDimitry Andric           ValueType AccumType, ValueType InputType, SDPatternOperator OpNode,
48260b57cec5SDimitry Andric           dag RHS> {
48270b57cec5SDimitry Andric  def "" : N3Vnp<0b11100, 0b10, 0b1101, Q, U, (outs Ty:$dst),
48280b57cec5SDimitry Andric                 (ins Ty:$Vd, Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
48290b57cec5SDimitry Andric                 N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
48300b57cec5SDimitry Andric    bit lane;
48310b57cec5SDimitry Andric    let Inst{5} = lane;
48320b57cec5SDimitry Andric    let AsmString = !strconcat(opc, ".", dt, "\t$Vd, $Vn, $Vm$lane");
48330b57cec5SDimitry Andric    let Constraints = "$dst = $Vd";
48340b57cec5SDimitry Andric    let Predicates = [HasDotProd];
48350b57cec5SDimitry Andric    let DecoderNamespace = "VFPV8";
48360b57cec5SDimitry Andric  }
48370b57cec5SDimitry Andric
48380b57cec5SDimitry Andric  def : Pat<
48390b57cec5SDimitry Andric    (AccumType (OpNode (AccumType Ty:$Vd),
48400b57cec5SDimitry Andric                       (InputType Ty:$Vn),
48410b57cec5SDimitry Andric                       (InputType (bitconvert (AccumType
48420b57cec5SDimitry Andric                                  (ARMvduplane (AccumType Ty:$Vm),
48430b57cec5SDimitry Andric                                                 VectorIndex32:$lane)))))),
48440b57cec5SDimitry Andric    (!cast<Instruction>(NAME) Ty:$Vd, Ty:$Vn, RHS, VectorIndex32:$lane)>;
48450b57cec5SDimitry Andric}
48460b57cec5SDimitry Andric
48470b57cec5SDimitry Andricdefm VUDOTDI : DOTI<"vudot", "u8", 0b0, 0b1, DPR, v2i32, v8i8,
48480b57cec5SDimitry Andric                    int_arm_neon_udot, (v2i32 DPR_VFP2:$Vm)>;
48490b57cec5SDimitry Andricdefm VSDOTDI : DOTI<"vsdot", "s8", 0b0, 0b0, DPR, v2i32, v8i8,
48500b57cec5SDimitry Andric                    int_arm_neon_sdot, (v2i32 DPR_VFP2:$Vm)>;
48510b57cec5SDimitry Andricdefm VUDOTQI : DOTI<"vudot", "u8", 0b1, 0b1, QPR, v4i32, v16i8,
48520b57cec5SDimitry Andric                    int_arm_neon_udot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48530b57cec5SDimitry Andricdefm VSDOTQI : DOTI<"vsdot", "s8", 0b1, 0b0, QPR, v4i32, v16i8,
48540b57cec5SDimitry Andric                    int_arm_neon_sdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48550b57cec5SDimitry Andric
48565ffd83dbSDimitry Andric// v8.6A matrix multiplication extension
48575ffd83dbSDimitry Andriclet Predicates = [HasMatMulInt8] in {
48585ffd83dbSDimitry Andric  class N3VMatMul<bit B, bit U, string Asm, string AsmTy,
48595ffd83dbSDimitry Andric                  SDPatternOperator OpNode>
48605ffd83dbSDimitry Andric        : N3Vnp<{0b1100, B}, 0b10, 0b1100, 1, U, (outs QPR:$dst),
48615ffd83dbSDimitry Andric                (ins QPR:$Vd, QPR:$Vn, QPR:$Vm), N3RegFrm, NoItinerary,
48625ffd83dbSDimitry Andric                Asm, AsmTy,
48635ffd83dbSDimitry Andric                [(set (v4i32 QPR:$dst), (OpNode (v4i32 QPR:$Vd),
48645ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vn),
48655ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vm)))]> {
48665ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
48675ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
48685ffd83dbSDimitry Andric  }
48695ffd83dbSDimitry Andric
48705ffd83dbSDimitry Andric  multiclass N3VMixedDotLane<bit Q, bit U, string Asm, string AsmTy, RegisterClass RegTy,
48715ffd83dbSDimitry Andric                        ValueType AccumTy, ValueType InputTy, SDPatternOperator OpNode,
48725ffd83dbSDimitry Andric                        dag RHS> {
48735ffd83dbSDimitry Andric
48745ffd83dbSDimitry Andric    def "" : N3Vnp<0b11101, 0b00, 0b1101, Q, U, (outs RegTy:$dst),
48755ffd83dbSDimitry Andric                (ins RegTy:$Vd, RegTy:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane), N3RegFrm,
48765ffd83dbSDimitry Andric                 NoItinerary, Asm, AsmTy, []> {
48775ffd83dbSDimitry Andric      bit lane;
48785ffd83dbSDimitry Andric      let Inst{5} = lane;
48795ffd83dbSDimitry Andric      let AsmString = !strconcat(Asm, ".", AsmTy, "\t$Vd, $Vn, $Vm$lane");
48805ffd83dbSDimitry Andric      let DecoderNamespace = "VFPV8";
48815ffd83dbSDimitry Andric      let Constraints = "$dst = $Vd";
48825ffd83dbSDimitry Andric    }
48835ffd83dbSDimitry Andric
48845ffd83dbSDimitry Andric    def : Pat<
48855ffd83dbSDimitry Andric      (AccumTy (OpNode (AccumTy RegTy:$Vd),
48865ffd83dbSDimitry Andric                       (InputTy RegTy:$Vn),
48875ffd83dbSDimitry Andric                       (InputTy (bitconvert (AccumTy
48885ffd83dbSDimitry Andric                                (ARMvduplane (AccumTy RegTy:$Vm),
48895ffd83dbSDimitry Andric                                              VectorIndex32:$lane)))))),
48905ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
48915ffd83dbSDimitry Andric
48925ffd83dbSDimitry Andric  }
48935ffd83dbSDimitry Andric
48945ffd83dbSDimitry Andric  multiclass SUDOTLane<bit Q, RegisterClass RegTy, ValueType AccumTy, ValueType InputTy, dag RHS>
48955ffd83dbSDimitry Andric        : N3VMixedDotLane<Q, 1, "vsudot", "u8", RegTy, AccumTy, InputTy, null_frag, null_frag> {
48965ffd83dbSDimitry Andric    def : Pat<
48975ffd83dbSDimitry Andric      (AccumTy (int_arm_neon_usdot (AccumTy RegTy:$Vd),
48985ffd83dbSDimitry Andric                                   (InputTy (bitconvert (AccumTy
48995ffd83dbSDimitry Andric                                            (ARMvduplane (AccumTy RegTy:$Vm),
49005ffd83dbSDimitry Andric                                                          VectorIndex32:$lane)))),
49015ffd83dbSDimitry Andric                                   (InputTy RegTy:$Vn))),
49025ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
49035ffd83dbSDimitry Andric  }
49045ffd83dbSDimitry Andric
49055ffd83dbSDimitry Andric  def VSMMLA  : N3VMatMul<0, 0, "vsmmla",  "s8", int_arm_neon_smmla>;
49065ffd83dbSDimitry Andric  def VUMMLA  : N3VMatMul<0, 1, "vummla",  "u8", int_arm_neon_ummla>;
49075ffd83dbSDimitry Andric  def VUSMMLA : N3VMatMul<1, 0, "vusmmla", "s8", int_arm_neon_usmmla>;
49085ffd83dbSDimitry Andric  def VUSDOTD : VDOT<0, 0, 1, DPR, "vusdot", "s8", v2i32, v8i8,  int_arm_neon_usdot>;
49095ffd83dbSDimitry Andric  def VUSDOTQ : VDOT<1, 0, 1, QPR, "vusdot", "s8", v4i32, v16i8, int_arm_neon_usdot>;
49105ffd83dbSDimitry Andric
49115ffd83dbSDimitry Andric  defm VUSDOTDI : N3VMixedDotLane<0, 0, "vusdot", "s8", DPR, v2i32, v8i8,
49125ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (v2i32 DPR_VFP2:$Vm)>;
49135ffd83dbSDimitry Andric  defm VUSDOTQI : N3VMixedDotLane<1, 0, "vusdot", "s8", QPR, v4i32, v16i8,
49145ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
49155ffd83dbSDimitry Andric  defm VSUDOTDI : SUDOTLane<0, DPR, v2i32, v8i8, (v2i32 DPR_VFP2:$Vm)>;
49165ffd83dbSDimitry Andric  defm VSUDOTQI : SUDOTLane<1, QPR, v4i32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
49175ffd83dbSDimitry Andric}
49180b57cec5SDimitry Andric
49190b57cec5SDimitry Andric// ARMv8.3 complex operations
49200b57cec5SDimitry Andricclass BaseN3VCP8ComplexTied<bit op21, bit op4, bit s, bit q,
49210b57cec5SDimitry Andric                            InstrItinClass itin, dag oops, dag iops,
49220b57cec5SDimitry Andric                            string opc, string dt, list<dag> pattern>
49230b57cec5SDimitry Andric  : N3VCP8<{?,?}, {op21,s}, q, op4, oops,
49240b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "$src1 = $Vd", pattern>{
49250b57cec5SDimitry Andric  bits<2> rot;
49260b57cec5SDimitry Andric  let Inst{24-23} = rot;
49270b57cec5SDimitry Andric}
49280b57cec5SDimitry Andric
49290b57cec5SDimitry Andricclass BaseN3VCP8ComplexOdd<bit op23, bit op21, bit op4, bit s, bit q,
49300b57cec5SDimitry Andric                           InstrItinClass itin, dag oops, dag iops, string opc,
49310b57cec5SDimitry Andric                            string dt, list<dag> pattern>
49320b57cec5SDimitry Andric  : N3VCP8<{?,op23}, {op21,s}, q, op4, oops,
49330b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "", pattern> {
49340b57cec5SDimitry Andric  bits<1> rot;
49350b57cec5SDimitry Andric  let Inst{24} = rot;
49360b57cec5SDimitry Andric}
49370b57cec5SDimitry Andric
49380b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane32<bit op4, bit s, bit q, InstrItinClass itin,
49390b57cec5SDimitry Andric                                  dag oops, dag iops, string opc, string dt,
49400b57cec5SDimitry Andric                                  list<dag> pattern>
49410b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49420b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49430b57cec5SDimitry Andric  bits<2> rot;
49440b57cec5SDimitry Andric  bit lane;
49450b57cec5SDimitry Andric
49460b57cec5SDimitry Andric  let Inst{21-20} = rot;
49470b57cec5SDimitry Andric  let Inst{5} = lane;
49480b57cec5SDimitry Andric}
49490b57cec5SDimitry Andric
49500b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane64<bit op4, bit s, bit q, InstrItinClass itin,
49510b57cec5SDimitry Andric                            dag oops, dag iops, string opc, string dt,
49520b57cec5SDimitry Andric                            list<dag> pattern>
49530b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49540b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49550b57cec5SDimitry Andric  bits<2> rot;
49560b57cec5SDimitry Andric  bit lane;
49570b57cec5SDimitry Andric
49580b57cec5SDimitry Andric  let Inst{21-20} = rot;
49590b57cec5SDimitry Andric  let Inst{5} = Vm{4};
49600b57cec5SDimitry Andric  // This is needed because the lane operand does not have any bits in the
49610b57cec5SDimitry Andric  // encoding (it only has one possible value), so we need to manually set it
49620b57cec5SDimitry Andric  // to it's default value.
49630b57cec5SDimitry Andric  let DecoderMethod = "DecodeNEONComplexLane64Instruction";
49640b57cec5SDimitry Andric}
49650b57cec5SDimitry Andric
49660b57cec5SDimitry Andricmulticlass N3VCP8ComplexTied<bit op21, bit op4,
4967349cc55cSDimitry Andric                       string OpcodeStr> {
49680b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49690b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 0, IIC_VMACD, (outs DPR:$Vd),
49700b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49710b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49720b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 1, IIC_VMACQ, (outs QPR:$Vd),
49730b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49740b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49750b57cec5SDimitry Andric  }
49760b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
49770b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 0, IIC_VMACD, (outs DPR:$Vd),
49780b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49790b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49800b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 1, IIC_VMACQ, (outs QPR:$Vd),
49810b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49820b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49830b57cec5SDimitry Andric  }
49840b57cec5SDimitry Andric}
49850b57cec5SDimitry Andric
49860b57cec5SDimitry Andricmulticlass N3VCP8ComplexOdd<bit op23, bit op21, bit op4,
4987349cc55cSDimitry Andric                       string OpcodeStr> {
49880b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49890b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 0, IIC_VMACD,
49900b57cec5SDimitry Andric              (outs DPR:$Vd),
49910b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
49920b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49930b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 1, IIC_VMACQ,
49940b57cec5SDimitry Andric              (outs QPR:$Vd),
49950b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
49960b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49970b57cec5SDimitry Andric  }
49980b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
49990b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 0, IIC_VMACD,
50000b57cec5SDimitry Andric              (outs DPR:$Vd),
50010b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
50020b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
50030b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 1, IIC_VMACQ,
50040b57cec5SDimitry Andric              (outs QPR:$Vd),
50050b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
50060b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
50070b57cec5SDimitry Andric  }
50080b57cec5SDimitry Andric}
50090b57cec5SDimitry Andric
50100b57cec5SDimitry Andric// These instructions index by pairs of lanes, so the VectorIndexes are twice
50110b57cec5SDimitry Andric// as wide as the data types.
5012349cc55cSDimitry Andricmulticlass N3VCP8ComplexTiedLane<bit op4, string OpcodeStr> {
50130b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
50140b57cec5SDimitry Andric  def v4f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 0, IIC_VMACD,
50150b57cec5SDimitry Andric                      (outs DPR:$Vd),
50160b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
50170b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
50180b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
50190b57cec5SDimitry Andric  def v8f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 1, IIC_VMACQ,
50200b57cec5SDimitry Andric                      (outs QPR:$Vd),
50210b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm,
50220b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
50230b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
50240b57cec5SDimitry Andric  }
50250b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
50260b57cec5SDimitry Andric  def v2f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 0, IIC_VMACD,
50270b57cec5SDimitry Andric                      (outs DPR:$Vd),
50280b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50290b57cec5SDimitry Andric                      complexrotateop:$rot),
50300b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50310b57cec5SDimitry Andric  def v4f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 1, IIC_VMACQ,
50320b57cec5SDimitry Andric                      (outs QPR:$Vd),
50330b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50340b57cec5SDimitry Andric                      complexrotateop:$rot),
50350b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50360b57cec5SDimitry Andric  }
50370b57cec5SDimitry Andric}
50380b57cec5SDimitry Andric
5039349cc55cSDimitry Andricdefm VCMLA : N3VCP8ComplexTied<1, 0, "vcmla">;
5040349cc55cSDimitry Andricdefm VCADD : N3VCP8ComplexOdd<1, 0, 0, "vcadd">;
5041349cc55cSDimitry Andricdefm VCMLA : N3VCP8ComplexTiedLane<0, "vcmla">;
50420b57cec5SDimitry Andric
5043480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5044480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot90 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5045480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 0))>;
5046480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot270 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5047480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 1))>;
5048480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot90 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5049480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 0))>;
5050480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot270 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5051480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 1))>;
5052480093f4SDimitry Andric}
5053480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a] in {
5054480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot90 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5055480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 0))>;
5056480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot270 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5057480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 1))>;
5058480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot90 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5059480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 0))>;
5060480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot270 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5061480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 1))>;
5062480093f4SDimitry Andric}
5063480093f4SDimitry Andric
50640b57cec5SDimitry Andric// Vector Subtract Operations.
50650b57cec5SDimitry Andric
50660b57cec5SDimitry Andric//   VSUB     : Vector Subtract (integer and floating-point)
50670b57cec5SDimitry Andricdefm VSUB     : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
50680b57cec5SDimitry Andric                         "vsub", "i", sub, 0>;
50690b57cec5SDimitry Andricdef  VSUBfd   : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
50700b57cec5SDimitry Andric                     v2f32, v2f32, fsub, 0>;
50710b57cec5SDimitry Andricdef  VSUBfq   : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
50720b57cec5SDimitry Andric                     v4f32, v4f32, fsub, 0>;
50730b57cec5SDimitry Andricdef  VSUBhd   : N3VD<0, 0, 0b11, 0b1101, 0, IIC_VBIND, "vsub", "f16",
50740b57cec5SDimitry Andric                     v4f16, v4f16, fsub, 0>,
50750b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50760b57cec5SDimitry Andricdef  VSUBhq   : N3VQ<0, 0, 0b11, 0b1101, 0, IIC_VBINQ, "vsub", "f16",
50770b57cec5SDimitry Andric                     v8f16, v8f16, fsub, 0>,
50780b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50790b57cec5SDimitry Andric//   VSUBL    : Vector Subtract Long (Q = D - D)
50800b57cec5SDimitry Andricdefm VSUBLs   : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
50810b57cec5SDimitry Andric                            "vsubl", "s", sub, sext, 0>;
50820b57cec5SDimitry Andricdefm VSUBLu   : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
5083e8d8bef9SDimitry Andric                            "vsubl", "u", sub, zanyext, 0>;
50840b57cec5SDimitry Andric//   VSUBW    : Vector Subtract Wide (Q = Q - D)
50850b57cec5SDimitry Andricdefm VSUBWs   : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
5086e8d8bef9SDimitry Andricdefm VSUBWu   : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zanyext, 0>;
50870b57cec5SDimitry Andric//   VHSUB    : Vector Halving Subtract
50880b57cec5SDimitry Andricdefm VHSUBs   : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
50890b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
50900b57cec5SDimitry Andric                           "vhsub", "s", int_arm_neon_vhsubs, 0>;
50910b57cec5SDimitry Andricdefm VHSUBu   : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
50920b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
50930b57cec5SDimitry Andric                           "vhsub", "u", int_arm_neon_vhsubu, 0>;
50940b57cec5SDimitry Andric//   VQSUB    : Vector Saturing Subtract
50950b57cec5SDimitry Andricdefm VQSUBs   : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
50960b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5097480093f4SDimitry Andric                            "vqsub", "s", ssubsat, 0>;
50980b57cec5SDimitry Andricdefm VQSUBu   : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
50990b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5100480093f4SDimitry Andric                            "vqsub", "u", usubsat, 0>;
51010b57cec5SDimitry Andric//   VSUBHN   : Vector Subtract and Narrow Returning High Half (D = Q - Q)
51020b57cec5SDimitry Andricdefm VSUBHN   : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i", null_frag, 0>;
51030b57cec5SDimitry Andric//   VRSUBHN  : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
51040b57cec5SDimitry Andricdefm VRSUBHN  : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
51050b57cec5SDimitry Andric                            int_arm_neon_vrsubhn, 0>;
51060b57cec5SDimitry Andric
51070b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
51080b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (sub (v8i16 QPR:$Vn), QPR:$Vm), 8))),
51090b57cec5SDimitry Andric          (VSUBHNv8i8 QPR:$Vn, QPR:$Vm)>;
51100b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (sub (v4i32 QPR:$Vn), QPR:$Vm), 16))),
51110b57cec5SDimitry Andric          (VSUBHNv4i16 QPR:$Vn, QPR:$Vm)>;
51120b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (sub (v2i64 QPR:$Vn), QPR:$Vm), 32))),
51130b57cec5SDimitry Andric          (VSUBHNv2i32 QPR:$Vn, QPR:$Vm)>;
51140b57cec5SDimitry Andric}
51150b57cec5SDimitry Andric
51160b57cec5SDimitry Andric// Vector Comparisons.
51170b57cec5SDimitry Andric
51180b57cec5SDimitry Andric//   VCEQ     : Vector Compare Equal
51198bcb0991SDimitry Andricdefm VCEQ     : N3V_QHS_cmp<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5120480093f4SDimitry Andric                            IIC_VSUBi4Q, "vceq", "i", ARMCCeq, 1>;
51218bcb0991SDimitry Andricdef  VCEQfd   : N3VD_cmp<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
5122480093f4SDimitry Andric                         ARMCCeq, 1>;
51238bcb0991SDimitry Andricdef  VCEQfq   : N3VQ_cmp<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
5124480093f4SDimitry Andric                         ARMCCeq, 1>;
51258bcb0991SDimitry Andricdef  VCEQhd   : N3VD_cmp<0,0,0b01,0b1110,0, IIC_VBIND, "vceq", "f16", v4i16, v4f16,
5126480093f4SDimitry Andric                         ARMCCeq, 1>,
51270b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51288bcb0991SDimitry Andricdef  VCEQhq   : N3VQ_cmp<0,0,0b01,0b1110,0, IIC_VBINQ, "vceq", "f16", v8i16, v8f16,
5129480093f4SDimitry Andric                         ARMCCeq, 1>,
51300b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51310b57cec5SDimitry Andric
51320b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in
51330b57cec5SDimitry Andricdefm VCEQz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
5134480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCeq>;
51350b57cec5SDimitry Andric
51360b57cec5SDimitry Andric//   VCGE     : Vector Compare Greater Than or Equal
51378bcb0991SDimitry Andricdefm VCGEs    : N3V_QHS_cmp<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5138480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "s", ARMCCge, 0>;
51398bcb0991SDimitry Andricdefm VCGEu    : N3V_QHS_cmp<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5140480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "u", ARMCChs, 0>;
51418bcb0991SDimitry Andricdef  VCGEfd   : N3VD_cmp<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
5142480093f4SDimitry Andric                         ARMCCge, 0>;
51438bcb0991SDimitry Andricdef  VCGEfq   : N3VQ_cmp<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
5144480093f4SDimitry Andric                         ARMCCge, 0>;
51458bcb0991SDimitry Andricdef  VCGEhd   : N3VD_cmp<1,0,0b01,0b1110,0, IIC_VBIND, "vcge", "f16", v4i16, v4f16,
5146480093f4SDimitry Andric                         ARMCCge, 0>,
51470b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51488bcb0991SDimitry Andricdef  VCGEhq   : N3VQ_cmp<1,0,0b01,0b1110,0, IIC_VBINQ, "vcge", "f16", v8i16, v8f16,
5149480093f4SDimitry Andric                         ARMCCge, 0>,
51500b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51510b57cec5SDimitry Andric
51520b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51530b57cec5SDimitry Andricdefm VCGEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
5154480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCge>;
51550b57cec5SDimitry Andricdefm VCLEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
5156480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCle>;
51570b57cec5SDimitry Andric}
51580b57cec5SDimitry Andric
51590b57cec5SDimitry Andric//   VCGT     : Vector Compare Greater Than
51608bcb0991SDimitry Andricdefm VCGTs    : N3V_QHS_cmp<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5161480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "s", ARMCCgt, 0>;
51628bcb0991SDimitry Andricdefm VCGTu    : N3V_QHS_cmp<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5163480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "u", ARMCChi, 0>;
51648bcb0991SDimitry Andricdef  VCGTfd   : N3VD_cmp<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
5165480093f4SDimitry Andric                         ARMCCgt, 0>;
51668bcb0991SDimitry Andricdef  VCGTfq   : N3VQ_cmp<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
5167480093f4SDimitry Andric                         ARMCCgt, 0>;
51688bcb0991SDimitry Andricdef  VCGThd   : N3VD_cmp<1,0,0b11,0b1110,0, IIC_VBIND, "vcgt", "f16", v4i16, v4f16,
5169480093f4SDimitry Andric                         ARMCCgt, 0>,
51700b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51718bcb0991SDimitry Andricdef  VCGThq   : N3VQ_cmp<1,0,0b11,0b1110,0, IIC_VBINQ, "vcgt", "f16", v8i16, v8f16,
5172480093f4SDimitry Andric                         ARMCCgt, 0>,
51730b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51740b57cec5SDimitry Andric
51750b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51760b57cec5SDimitry Andricdefm VCGTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
5177480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCgt>;
51780b57cec5SDimitry Andricdefm VCLTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
5179480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCClt>;
51800b57cec5SDimitry Andric}
51810b57cec5SDimitry Andric
51820b57cec5SDimitry Andric//   VACGE    : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
51830b57cec5SDimitry Andricdef  VACGEfd   : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
51840b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacge, 0>;
51850b57cec5SDimitry Andricdef  VACGEfq   : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
51860b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacge, 0>;
51870b57cec5SDimitry Andricdef  VACGEhd   : N3VDInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
51880b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacge, 0>,
51890b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51900b57cec5SDimitry Andricdef  VACGEhq   : N3VQInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
51910b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacge, 0>,
51920b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51930b57cec5SDimitry Andric//   VACGT    : Vector Absolute Compare Greater Than (aka VCAGT)
51940b57cec5SDimitry Andricdef  VACGTfd   : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
51950b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacgt, 0>;
51960b57cec5SDimitry Andricdef  VACGTfq   : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
51970b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacgt, 0>;
51980b57cec5SDimitry Andricdef  VACGThd   : N3VDInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
51990b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacgt, 0>,
52000b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52010b57cec5SDimitry Andricdef  VACGThq   : N3VQInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
52020b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacgt, 0>,
52030b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
52040b57cec5SDimitry Andric//   VTST     : Vector Test Bits
52050b57cec5SDimitry Andricdefm VTST     : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
52060b57cec5SDimitry Andric                        IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
52070b57cec5SDimitry Andric
52080b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
52090b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52100b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
52110b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52120b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
52130b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52140b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
52150b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52160b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
52170b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
52180b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52190b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
52200b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52210b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52220b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52230b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52240b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52250b57cec5SDimitry Andric}
52260b57cec5SDimitry Andric
52270b57cec5SDimitry Andric// +fp16fml Floating Point Multiplication Variants
52280b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFP16FML], DecoderNamespace= "VFPV8" in {
52290b57cec5SDimitry Andric
52300b57cec5SDimitry Andricclass N3VCP8F16Q1<string asm, RegisterClass Td, RegisterClass Tn,
52310b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52320b57cec5SDimitry Andric  : N3VCP8<op1, op2, 1, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52330b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52340b57cec5SDimitry Andric
52350b57cec5SDimitry Andricclass N3VCP8F16Q0<string asm, RegisterClass Td, RegisterClass Tn,
52360b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52370b57cec5SDimitry Andric  : N3VCP8Q0<op1, op2, 0, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52380b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52390b57cec5SDimitry Andric
52400b57cec5SDimitry Andric// Vd, Vs, Vs[0-15], Idx[0-1]
52410b57cec5SDimitry Andricclass VFMD<string opc, string type, bits<2> S>
52420b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 0, 1, (outs DPR:$Vd),
52430b57cec5SDimitry Andric               (ins SPR:$Vn, SPR_8:$Vm, VectorIndex32:$idx),
52440b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52450b57cec5SDimitry Andric  bit idx;
52460b57cec5SDimitry Andric  let Inst{3} = idx;
52470b57cec5SDimitry Andric  let Inst{19-16} = Vn{4-1};
52480b57cec5SDimitry Andric  let Inst{7}     = Vn{0};
52490b57cec5SDimitry Andric  let Inst{5}     = Vm{0};
52500b57cec5SDimitry Andric  let Inst{2-0}   = Vm{3-1};
52510b57cec5SDimitry Andric}
52520b57cec5SDimitry Andric
52530b57cec5SDimitry Andric// Vq, Vd, Vd[0-7], Idx[0-3]
52540b57cec5SDimitry Andricclass VFMQ<string opc, string type, bits<2> S>
52550b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 1, 1, (outs QPR:$Vd),
52560b57cec5SDimitry Andric               (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
52570b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52580b57cec5SDimitry Andric  bits<2> idx;
52590b57cec5SDimitry Andric  let Inst{5} = idx{1};
52600b57cec5SDimitry Andric  let Inst{3} = idx{0};
52610b57cec5SDimitry Andric}
52620b57cec5SDimitry Andric
52630b57cec5SDimitry Andric//                                                op1   op2   op3
52640b57cec5SDimitry Andricdef VFMALD  : N3VCP8F16Q0<"vfmal", DPR, SPR, SPR, 0b00, 0b10, 1>;
52650b57cec5SDimitry Andricdef VFMSLD  : N3VCP8F16Q0<"vfmsl", DPR, SPR, SPR, 0b01, 0b10, 1>;
52660b57cec5SDimitry Andricdef VFMALQ  : N3VCP8F16Q1<"vfmal", QPR, DPR, DPR, 0b00, 0b10, 1>;
52670b57cec5SDimitry Andricdef VFMSLQ  : N3VCP8F16Q1<"vfmsl", QPR, DPR, DPR, 0b01, 0b10, 1>;
52680b57cec5SDimitry Andricdef VFMALDI : VFMD<"vfmal", "f16", 0b00>;
52690b57cec5SDimitry Andricdef VFMSLDI : VFMD<"vfmsl", "f16", 0b01>;
52700b57cec5SDimitry Andricdef VFMALQI : VFMQ<"vfmal", "f16", 0b00>;
52710b57cec5SDimitry Andricdef VFMSLQI : VFMQ<"vfmsl", "f16", 0b01>;
52720b57cec5SDimitry Andric} // HasNEON, HasFP16FML
52730b57cec5SDimitry Andric
52740b57cec5SDimitry Andric
52750b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52760b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52770b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52780b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52790b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52800b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52810b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52820b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52830b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
52840b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
52850b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52860b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
52870b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52880b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
52890b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52900b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
52910b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52920b57cec5SDimitry Andric}
52930b57cec5SDimitry Andric
52940b57cec5SDimitry Andric// Vector Bitwise Operations.
52950b57cec5SDimitry Andric
52960b57cec5SDimitry Andricdef vnotd : PatFrag<(ops node:$in),
5297e8d8bef9SDimitry Andric                    (xor node:$in, ARMimmAllOnesD)>;
52980b57cec5SDimitry Andricdef vnotq : PatFrag<(ops node:$in),
5299e8d8bef9SDimitry Andric                    (xor node:$in, ARMimmAllOnesV)>;
53000b57cec5SDimitry Andric
53010b57cec5SDimitry Andric
53020b57cec5SDimitry Andric//   VAND     : Vector Bitwise AND
53030b57cec5SDimitry Andricdef  VANDd    : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
53040b57cec5SDimitry Andric                      v2i32, v2i32, and, 1>;
53050b57cec5SDimitry Andricdef  VANDq    : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
53060b57cec5SDimitry Andric                      v4i32, v4i32, and, 1>;
53070b57cec5SDimitry Andric
53080b57cec5SDimitry Andric//   VEOR     : Vector Bitwise Exclusive OR
53090b57cec5SDimitry Andricdef  VEORd    : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
53100b57cec5SDimitry Andric                      v2i32, v2i32, xor, 1>;
53110b57cec5SDimitry Andricdef  VEORq    : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
53120b57cec5SDimitry Andric                      v4i32, v4i32, xor, 1>;
53130b57cec5SDimitry Andric
53140b57cec5SDimitry Andric//   VORR     : Vector Bitwise OR
53150b57cec5SDimitry Andricdef  VORRd    : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
53160b57cec5SDimitry Andric                      v2i32, v2i32, or, 1>;
53170b57cec5SDimitry Andricdef  VORRq    : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
53180b57cec5SDimitry Andric                      v4i32, v4i32, or, 1>;
53190b57cec5SDimitry Andric
5320fe6060f1SDimitry Andricmulticlass BitwisePatterns<string Name, SDPatternOperator OpNodeD,
5321fe6060f1SDimitry Andric                           SDPatternOperator OpNodeQ> {
5322fe6060f1SDimitry Andric  def : Pat<(v8i8 (OpNodeD DPR:$LHS, DPR:$RHS)),
5323fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5324fe6060f1SDimitry Andric  def : Pat<(v4i16 (OpNodeD DPR:$LHS, DPR:$RHS)),
5325fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5326fe6060f1SDimitry Andric  def : Pat<(v1i64 (OpNodeD DPR:$LHS, DPR:$RHS)),
5327fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"d") DPR:$LHS, DPR:$RHS)>;
5328fe6060f1SDimitry Andric
5329fe6060f1SDimitry Andric  def : Pat<(v16i8 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5330fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5331fe6060f1SDimitry Andric  def : Pat<(v8i16 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5332fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5333fe6060f1SDimitry Andric  def : Pat<(v2i64 (OpNodeQ QPR:$LHS, QPR:$RHS)),
5334fe6060f1SDimitry Andric            (!cast<Instruction>(Name#"q") QPR:$LHS, QPR:$RHS)>;
5335fe6060f1SDimitry Andric}
5336fe6060f1SDimitry Andric
5337fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5338fe6060f1SDimitry Andric  defm : BitwisePatterns<"VAND", and, and>;
5339fe6060f1SDimitry Andric  defm : BitwisePatterns<"VORR", or, or>;
5340fe6060f1SDimitry Andric  defm : BitwisePatterns<"VEOR", xor, xor>;
5341fe6060f1SDimitry Andric}
5342fe6060f1SDimitry Andric
53430b57cec5SDimitry Andricdef VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
53440b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
53450b57cec5SDimitry Andric                          IIC_VMOVImm,
53460b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53470b57cec5SDimitry Andric                          [(set DPR:$Vd,
53485ffd83dbSDimitry Andric                            (v4i16 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53490b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53500b57cec5SDimitry Andric}
53510b57cec5SDimitry Andric
53520b57cec5SDimitry Andricdef VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
53530b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
53540b57cec5SDimitry Andric                          IIC_VMOVImm,
53550b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53560b57cec5SDimitry Andric                          [(set DPR:$Vd,
53575ffd83dbSDimitry Andric                            (v2i32 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53580b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53590b57cec5SDimitry Andric}
53600b57cec5SDimitry Andric
53610b57cec5SDimitry Andricdef VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
53620b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
53630b57cec5SDimitry Andric                          IIC_VMOVImm,
53640b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53650b57cec5SDimitry Andric                          [(set QPR:$Vd,
53665ffd83dbSDimitry Andric                            (v8i16 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53670b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53680b57cec5SDimitry Andric}
53690b57cec5SDimitry Andric
53700b57cec5SDimitry Andricdef VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
53710b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
53720b57cec5SDimitry Andric                          IIC_VMOVImm,
53730b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53740b57cec5SDimitry Andric                          [(set QPR:$Vd,
53755ffd83dbSDimitry Andric                            (v4i32 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53760b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53770b57cec5SDimitry Andric}
53780b57cec5SDimitry Andric
53790b57cec5SDimitry Andric
53800b57cec5SDimitry Andric//   VBIC     : Vector Bitwise Bit Clear (AND NOT)
53810b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
53820b57cec5SDimitry Andricdef  VBICd    : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
53830b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
53840b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
53850b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
53860b57cec5SDimitry Andric                                                 (vnotd DPR:$Vm))))]>;
53870b57cec5SDimitry Andricdef  VBICq    : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
53880b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
53890b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
53900b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
53910b57cec5SDimitry Andric                                                 (vnotq QPR:$Vm))))]>;
53920b57cec5SDimitry Andric}
53930b57cec5SDimitry Andric
5394fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5395fe6060f1SDimitry Andric  defm : BitwisePatterns<"VBIC", BinOpFrag<(and node:$LHS, (vnotd node:$RHS))>,
5396fe6060f1SDimitry Andric                                 BinOpFrag<(and node:$LHS, (vnotq node:$RHS))>>;
5397fe6060f1SDimitry Andric}
5398fe6060f1SDimitry Andric
53990b57cec5SDimitry Andricdef VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
54000b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
54010b57cec5SDimitry Andric                          IIC_VMOVImm,
54020b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
54030b57cec5SDimitry Andric                          [(set DPR:$Vd,
54045ffd83dbSDimitry Andric                            (v4i16 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
54050b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54060b57cec5SDimitry Andric}
54070b57cec5SDimitry Andric
54080b57cec5SDimitry Andricdef VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
54090b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
54100b57cec5SDimitry Andric                          IIC_VMOVImm,
54110b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
54120b57cec5SDimitry Andric                          [(set DPR:$Vd,
54135ffd83dbSDimitry Andric                            (v2i32 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
54140b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
54150b57cec5SDimitry Andric}
54160b57cec5SDimitry Andric
54170b57cec5SDimitry Andricdef VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
54180b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
54190b57cec5SDimitry Andric                          IIC_VMOVImm,
54200b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
54210b57cec5SDimitry Andric                          [(set QPR:$Vd,
54225ffd83dbSDimitry Andric                            (v8i16 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
54230b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54240b57cec5SDimitry Andric}
54250b57cec5SDimitry Andric
54260b57cec5SDimitry Andricdef VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
54270b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
54280b57cec5SDimitry Andric                          IIC_VMOVImm,
54290b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
54300b57cec5SDimitry Andric                          [(set QPR:$Vd,
54315ffd83dbSDimitry Andric                            (v4i32 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
54320b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
54330b57cec5SDimitry Andric}
54340b57cec5SDimitry Andric
54350b57cec5SDimitry Andric//   VORN     : Vector Bitwise OR NOT
54360b57cec5SDimitry Andricdef  VORNd    : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
54370b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
54380b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
54390b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
54400b57cec5SDimitry Andric                                                (vnotd DPR:$Vm))))]>;
54410b57cec5SDimitry Andricdef  VORNq    : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
54420b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
54430b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
54440b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
54450b57cec5SDimitry Andric                                                (vnotq QPR:$Vm))))]>;
54460b57cec5SDimitry Andric
5447fe6060f1SDimitry Andriclet Predicates = [HasNEON] in {
5448fe6060f1SDimitry Andric  defm : BitwisePatterns<"VORN", BinOpFrag<(or node:$LHS, (vnotd node:$RHS))>,
5449fe6060f1SDimitry Andric                                 BinOpFrag<(or node:$LHS, (vnotq node:$RHS))>>;
5450fe6060f1SDimitry Andric}
5451fe6060f1SDimitry Andric
54520b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT (Immediate)
54530b57cec5SDimitry Andric
54540b57cec5SDimitry Andriclet isReMaterializable = 1 in {
54550b57cec5SDimitry Andric
54560b57cec5SDimitry Andricdef VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
54570b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54580b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54590b57cec5SDimitry Andric                         [(set DPR:$Vd, (v4i16 (ARMvmvnImm timm:$SIMM)))]> {
54600b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54610b57cec5SDimitry Andric}
54620b57cec5SDimitry Andric
54630b57cec5SDimitry Andricdef VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
54640b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54650b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54660b57cec5SDimitry Andric                         [(set QPR:$Vd, (v8i16 (ARMvmvnImm timm:$SIMM)))]> {
54670b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54680b57cec5SDimitry Andric}
54690b57cec5SDimitry Andric
54700b57cec5SDimitry Andricdef VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
54710b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54720b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54730b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2i32 (ARMvmvnImm timm:$SIMM)))]> {
54740b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54750b57cec5SDimitry Andric}
54760b57cec5SDimitry Andric
54770b57cec5SDimitry Andricdef VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
54780b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54790b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54800b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4i32 (ARMvmvnImm timm:$SIMM)))]> {
54810b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54820b57cec5SDimitry Andric}
54830b57cec5SDimitry Andric}
54840b57cec5SDimitry Andric
54850b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT
54860b57cec5SDimitry Andricdef  VMVNd    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
54870b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
54880b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
54890b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
54900b57cec5SDimitry Andricdef  VMVNq    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
54910b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
54920b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
54930b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
54940b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
5495fe6060f1SDimitry Andricdef : Pat<(v1i64 (vnotd DPR:$src)),
5496fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5497fe6060f1SDimitry Andricdef : Pat<(v4i16 (vnotd DPR:$src)),
5498fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5499fe6060f1SDimitry Andricdef : Pat<(v8i8 (vnotd DPR:$src)),
5500fe6060f1SDimitry Andric          (VMVNd DPR:$src)>;
5501fe6060f1SDimitry Andricdef : Pat<(v2i64 (vnotq QPR:$src)),
5502fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
5503fe6060f1SDimitry Andricdef : Pat<(v8i16 (vnotq QPR:$src)),
5504fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
5505fe6060f1SDimitry Andricdef : Pat<(v16i8 (vnotq QPR:$src)),
5506fe6060f1SDimitry Andric          (VMVNq QPR:$src)>;
55070b57cec5SDimitry Andric}
55080b57cec5SDimitry Andric
5509e8d8bef9SDimitry Andric// The TwoAddress pass will not go looking for equivalent operations
5510e8d8bef9SDimitry Andric// with different register constraints; it just inserts copies.
5511e8d8bef9SDimitry Andric// That is why pseudo VBSP implemented. Is is expanded later into
5512e8d8bef9SDimitry Andric// VBIT/VBIF/VBSL taking into account register constraints to avoid copies.
5513e8d8bef9SDimitry Andricdef  VBSPd
5514e8d8bef9SDimitry Andric  : PseudoNeonI<(outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5515e8d8bef9SDimitry Andric                IIC_VBINiD, "",
55160b57cec5SDimitry Andric                [(set DPR:$Vd,
5517e8d8bef9SDimitry Andric                      (v2i32 (NEONvbsp DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
55180b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55190b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vbsl (v8i8 DPR:$src1),
55200b57cec5SDimitry Andric                                   (v8i8 DPR:$Vn), (v8i8 DPR:$Vm))),
5521e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55220b57cec5SDimitry Andricdef : Pat<(v4i16 (int_arm_neon_vbsl (v4i16 DPR:$src1),
55230b57cec5SDimitry Andric                                    (v4i16 DPR:$Vn), (v4i16 DPR:$Vm))),
5524e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55250b57cec5SDimitry Andricdef : Pat<(v2i32 (int_arm_neon_vbsl (v2i32 DPR:$src1),
55260b57cec5SDimitry Andric                                    (v2i32 DPR:$Vn), (v2i32 DPR:$Vm))),
5527e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55280b57cec5SDimitry Andricdef : Pat<(v2f32 (int_arm_neon_vbsl (v2f32 DPR:$src1),
55290b57cec5SDimitry Andric                                    (v2f32 DPR:$Vn), (v2f32 DPR:$Vm))),
5530e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55310b57cec5SDimitry Andricdef : Pat<(v1i64 (int_arm_neon_vbsl (v1i64 DPR:$src1),
55320b57cec5SDimitry Andric                                    (v1i64 DPR:$Vn), (v1i64 DPR:$Vm))),
5533e8d8bef9SDimitry Andric          (VBSPd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
55340b57cec5SDimitry Andric
5535fe6060f1SDimitry Andricdef : Pat<(v8i8 (or (and DPR:$Vn, DPR:$Vd),
5536fe6060f1SDimitry Andric                    (and DPR:$Vm, (vnotd DPR:$Vd)))),
5537fe6060f1SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
5538fe6060f1SDimitry Andricdef : Pat<(v4i16 (or (and DPR:$Vn, DPR:$Vd),
5539fe6060f1SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5540fe6060f1SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55410b57cec5SDimitry Andricdef : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
55420b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5543e8d8bef9SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55440b57cec5SDimitry Andricdef : Pat<(v1i64 (or (and DPR:$Vn, DPR:$Vd),
55450b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
5546e8d8bef9SDimitry Andric          (VBSPd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
55470b57cec5SDimitry Andric}
55480b57cec5SDimitry Andric
5549e8d8bef9SDimitry Andricdef  VBSPq
5550e8d8bef9SDimitry Andric  : PseudoNeonI<(outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5551e8d8bef9SDimitry Andric                IIC_VBINiQ, "",
55520b57cec5SDimitry Andric                [(set QPR:$Vd,
5553e8d8bef9SDimitry Andric                      (v4i32 (NEONvbsp QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
55540b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55550b57cec5SDimitry Andricdef : Pat<(v16i8 (int_arm_neon_vbsl (v16i8 QPR:$src1),
55560b57cec5SDimitry Andric                                   (v16i8 QPR:$Vn), (v16i8 QPR:$Vm))),
5557e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55580b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vbsl (v8i16 QPR:$src1),
55590b57cec5SDimitry Andric                                    (v8i16 QPR:$Vn), (v8i16 QPR:$Vm))),
5560e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55610b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vbsl (v4i32 QPR:$src1),
55620b57cec5SDimitry Andric                                    (v4i32 QPR:$Vn), (v4i32 QPR:$Vm))),
5563e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55640b57cec5SDimitry Andricdef : Pat<(v4f32 (int_arm_neon_vbsl (v4f32 QPR:$src1),
55650b57cec5SDimitry Andric                                    (v4f32 QPR:$Vn), (v4f32 QPR:$Vm))),
5566e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55670b57cec5SDimitry Andricdef : Pat<(v2i64 (int_arm_neon_vbsl (v2i64 QPR:$src1),
55680b57cec5SDimitry Andric                                    (v2i64 QPR:$Vn), (v2i64 QPR:$Vm))),
5569e8d8bef9SDimitry Andric          (VBSPq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55700b57cec5SDimitry Andric
5571fe6060f1SDimitry Andricdef : Pat<(v16i8 (or (and QPR:$Vn, QPR:$Vd),
5572fe6060f1SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5573fe6060f1SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
5574fe6060f1SDimitry Andricdef : Pat<(v8i16 (or (and QPR:$Vn, QPR:$Vd),
5575fe6060f1SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5576fe6060f1SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55770b57cec5SDimitry Andricdef : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
55780b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5579e8d8bef9SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55800b57cec5SDimitry Andricdef : Pat<(v2i64 (or (and QPR:$Vn, QPR:$Vd),
55810b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
5582e8d8bef9SDimitry Andric          (VBSPq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55830b57cec5SDimitry Andric}
55840b57cec5SDimitry Andric
5585e8d8bef9SDimitry Andric//   VBSL     : Vector Bitwise Select
5586e8d8bef9SDimitry Andricdef  VBSLd    : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
5587e8d8bef9SDimitry Andric                     (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
5588e8d8bef9SDimitry Andric                     N3RegFrm, IIC_VBINiD,
5589e8d8bef9SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5590e8d8bef9SDimitry Andric                     []>;
5591e8d8bef9SDimitry Andric
5592e8d8bef9SDimitry Andricdef  VBSLq    : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
5593e8d8bef9SDimitry Andric                     (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
5594e8d8bef9SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
5595e8d8bef9SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
5596e8d8bef9SDimitry Andric                     []>;
5597e8d8bef9SDimitry Andric
55980b57cec5SDimitry Andric//   VBIF     : Vector Bitwise Insert if False
55990b57cec5SDimitry Andric//              like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
56000b57cec5SDimitry Andricdef  VBIFd    : N3VX<1, 0, 0b11, 0b0001, 0, 1,
56010b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
56020b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
56030b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56040b57cec5SDimitry Andric                     []>;
56050b57cec5SDimitry Andricdef  VBIFq    : N3VX<1, 0, 0b11, 0b0001, 1, 1,
56060b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
56070b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
56080b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56090b57cec5SDimitry Andric                     []>;
56100b57cec5SDimitry Andric
56110b57cec5SDimitry Andric//   VBIT     : Vector Bitwise Insert if True
56120b57cec5SDimitry Andric//              like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
56130b57cec5SDimitry Andricdef  VBITd    : N3VX<1, 0, 0b10, 0b0001, 0, 1,
56140b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
56150b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
56160b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56170b57cec5SDimitry Andric                     []>;
56180b57cec5SDimitry Andricdef  VBITq    : N3VX<1, 0, 0b10, 0b0001, 1, 1,
56190b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
56200b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
56210b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
56220b57cec5SDimitry Andric                     []>;
56230b57cec5SDimitry Andric
56240b57cec5SDimitry Andric// Vector Absolute Differences.
56250b57cec5SDimitry Andric
56260b57cec5SDimitry Andric//   VABD     : Vector Absolute Difference
56270b57cec5SDimitry Andricdefm VABDs    : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
56280b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56290b57cec5SDimitry Andric                           "vabd", "s", int_arm_neon_vabds, 1>;
56300b57cec5SDimitry Andricdefm VABDu    : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
56310b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56320b57cec5SDimitry Andric                           "vabd", "u", int_arm_neon_vabdu, 1>;
56330b57cec5SDimitry Andricdef  VABDfd   : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
56340b57cec5SDimitry Andric                        "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
56350b57cec5SDimitry Andricdef  VABDfq   : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
56360b57cec5SDimitry Andric                        "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
56370b57cec5SDimitry Andricdef  VABDhd   : N3VDInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBIND,
56380b57cec5SDimitry Andric                        "vabd", "f16", v4f16, v4f16, int_arm_neon_vabds, 1>,
56390b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56400b57cec5SDimitry Andricdef  VABDhq   : N3VQInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBINQ,
56410b57cec5SDimitry Andric                        "vabd", "f16", v8f16, v8f16, int_arm_neon_vabds, 1>,
56420b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56430b57cec5SDimitry Andric
56440b57cec5SDimitry Andric//   VABDL    : Vector Absolute Difference Long (Q = | D - D |)
56450b57cec5SDimitry Andricdefm VABDLs   : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
56460b57cec5SDimitry Andric                               "vabdl", "s", int_arm_neon_vabds, zext, 1>;
56470b57cec5SDimitry Andricdefm VABDLu   : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
56480b57cec5SDimitry Andric                               "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
56490b57cec5SDimitry Andric
56500b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
56510b57cec5SDimitry Andricdef : Pat<(v8i16 (abs (sub (zext (v8i8 DPR:$opA)), (zext (v8i8 DPR:$opB))))),
56520b57cec5SDimitry Andric          (VABDLuv8i16 DPR:$opA, DPR:$opB)>;
56530b57cec5SDimitry Andricdef : Pat<(v4i32 (abs (sub (zext (v4i16 DPR:$opA)), (zext (v4i16 DPR:$opB))))),
56540b57cec5SDimitry Andric          (VABDLuv4i32 DPR:$opA, DPR:$opB)>;
56550b57cec5SDimitry Andric}
56560b57cec5SDimitry Andric
56570b57cec5SDimitry Andric// ISD::ABS is not legal for v2i64, so VABDL needs to be matched from the
56580b57cec5SDimitry Andric// shift/xor pattern for ABS.
56590b57cec5SDimitry Andric
56600b57cec5SDimitry Andricdef abd_shr :
56610b57cec5SDimitry Andric    PatFrag<(ops node:$in1, node:$in2, node:$shift),
56620b57cec5SDimitry Andric            (ARMvshrsImm (sub (zext node:$in1),
56630b57cec5SDimitry Andric                            (zext node:$in2)), (i32 $shift))>;
56640b57cec5SDimitry Andric
56650b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
5666fe6060f1SDimitry Andricdef : Pat<(xor (v2i64 (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)),
5667fe6060f1SDimitry Andric               (v2i64 (add (sub (zext (v2i32 DPR:$opA)),
56680b57cec5SDimitry Andric                                (zext (v2i32 DPR:$opB))),
5669fe6060f1SDimitry Andric                           (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)))),
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,
56750b57cec5SDimitry Andric                             "vaba", "s", int_arm_neon_vabds, add>;
56760b57cec5SDimitry Andricdefm VABAu    : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
56770b57cec5SDimitry Andric                             "vaba", "u", int_arm_neon_vabdu, 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,
56810b57cec5SDimitry Andric                                 "vabal", "s", int_arm_neon_vabds, zext, add>;
56820b57cec5SDimitry Andricdefm VABALu   : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
56830b57cec5SDimitry Andric                                 "vabal", "u", int_arm_neon_vabdu, 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>,
57140b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
57150b57cec5SDimitry Andric  def NEON_VMAXNMNQf  : N3VQIntnp<0b00110, 0b00, 0b1111, 1, 1,
57160b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f32",
57170b57cec5SDimitry Andric                                  v4f32, v4f32, fmaxnum, 1>,
57180b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
57190b57cec5SDimitry Andric  def NEON_VMAXNMNDh  : N3VDIntnp<0b00110, 0b01, 0b1111, 0, 1,
57200b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f16",
57210b57cec5SDimitry Andric                                  v4f16, v4f16, fmaxnum, 1>,
57220b57cec5SDimitry Andric                                  Requires<[HasV8, 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>,
57260b57cec5SDimitry Andric                                  Requires<[HasV8, 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>,
57560b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
57570b57cec5SDimitry Andric  def NEON_VMINNMNQf  : N3VQIntnp<0b00110, 0b10, 0b1111, 1, 1,
57580b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f32",
57590b57cec5SDimitry Andric                                  v4f32, v4f32, fminnum, 1>,
57600b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
57610b57cec5SDimitry Andric  def NEON_VMINNMNDh  : N3VDIntnp<0b00110, 0b11, 0b1111, 0, 1,
57620b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f16",
57630b57cec5SDimitry Andric                                  v4f16, v4f16, fminnum, 1>,
57640b57cec5SDimitry Andric                                  Requires<[HasV8, 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>,
57680b57cec5SDimitry Andric                                  Requires<[HasV8, 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}
63990b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
64000b57cec5SDimitry Andric// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
64010b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v16i8 QPR:$src), imm:$lane),
64020b57cec5SDimitry Andric          (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
64030b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
64040b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
64050b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v8i16 QPR:$src), imm:$lane),
64060b57cec5SDimitry Andric          (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
64070b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
64080b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
64090b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v16i8 QPR:$src), imm:$lane),
64100b57cec5SDimitry Andric          (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
64110b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
64120b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
64130b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v8i16 QPR:$src), imm:$lane),
64140b57cec5SDimitry Andric          (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
64150b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
64160b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6417349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v8f16 QPR:$src), imm:$lane),
6418349cc55cSDimitry Andric          (VGETLNu16 (v4f16 (EXTRACT_SUBREG QPR:$src,
6419349cc55cSDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
6420349cc55cSDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6421349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v4f16 DPR:$src), imm:$lane),
6422349cc55cSDimitry Andric          (VGETLNu16 (v4f16 DPR:$src), imm:$lane)>;
6423349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v8bf16 QPR:$src), imm:$lane),
6424349cc55cSDimitry Andric          (VGETLNu16 (v4bf16 (EXTRACT_SUBREG QPR:$src,
6425349cc55cSDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
6426349cc55cSDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
6427349cc55cSDimitry Andricdef : Pat<(ARMvgetlaneu (v4bf16 DPR:$src), imm:$lane),
6428349cc55cSDimitry Andric          (VGETLNu16 (v4bf16 DPR:$src), imm:$lane)>;
64290b57cec5SDimitry Andric}
64300b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
64310b57cec5SDimitry Andric          (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
64320b57cec5SDimitry Andric                             (DSubReg_i32_reg imm:$lane))),
64330b57cec5SDimitry Andric                     (SubReg_i32_lane imm:$lane))>,
64340b57cec5SDimitry Andric      Requires<[HasNEON, HasFastVGETLNi32]>;
64350b57cec5SDimitry Andricdef : Pat<(extractelt (v2i32 DPR:$src), imm:$lane),
64360b57cec5SDimitry Andric          (COPY_TO_REGCLASS
64370b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
64380b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
64390b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
64400b57cec5SDimitry Andric          (COPY_TO_REGCLASS
64410b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
64420b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
64430b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
64440b57cec5SDimitry Andricdef : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
64450b57cec5SDimitry Andric          (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
64460b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
64470b57cec5SDimitry Andricdef : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
64480b57cec5SDimitry Andric          (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
64490b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
64500b57cec5SDimitry Andric//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
64510b57cec5SDimitry Andric//          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
64520b57cec5SDimitry Andricdef : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
64530b57cec5SDimitry Andric          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
64540b57cec5SDimitry Andric}
64550b57cec5SDimitry Andric
64565ffd83dbSDimitry Andricmulticlass ExtractEltEvenF16<ValueType VT4, ValueType VT8> {
64575ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_even:$lane),
64580b57cec5SDimitry Andric              (EXTRACT_SUBREG
64595ffd83dbSDimitry Andric                  (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
64600b57cec5SDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
64615ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_even:$lane),
64625ffd83dbSDimitry Andric              (EXTRACT_SUBREG
64635ffd83dbSDimitry Andric                  (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
64645ffd83dbSDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
64655ffd83dbSDimitry Andric}
64660b57cec5SDimitry Andric
64675ffd83dbSDimitry Andricmulticlass ExtractEltOddF16VMOVH<ValueType VT4, ValueType VT8> {
64685ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_odd:$lane),
64690b57cec5SDimitry Andric            (COPY_TO_REGCLASS
64700b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
64715ffd83dbSDimitry Andric                        (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
64720b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
64730b57cec5SDimitry Andric              HPR)>;
64745ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_odd:$lane),
64750b57cec5SDimitry Andric            (COPY_TO_REGCLASS
64760b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
64775ffd83dbSDimitry Andric                        (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
64780b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
64790b57cec5SDimitry Andric              HPR)>;
64800b57cec5SDimitry Andric}
64810b57cec5SDimitry Andric
64825ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
64835ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4f16, v8f16>;
64845ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4f16, v8f16>;
64855ffd83dbSDimitry Andric}
64865ffd83dbSDimitry Andric
64875ffd83dbSDimitry Andriclet AddedComplexity = 1, Predicates = [HasNEON, HasBF16, HasFullFP16] in {
64885ffd83dbSDimitry Andric  // If VMOVH (vmovx.f16) is available use it to extract BF16 from the odd lanes
64895ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4bf16, v8bf16>;
64905ffd83dbSDimitry Andric}
64915ffd83dbSDimitry Andric
64925ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
64935ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4bf16, v8bf16>;
64945ffd83dbSDimitry Andric
64955ffd83dbSDimitry Andric  // Otherwise, if VMOVH is not available resort to extracting the odd lane
64965ffd83dbSDimitry Andric  // into a GPR and then moving to HPR
64975ffd83dbSDimitry Andric  def : Pat<(extractelt (v4bf16 DPR:$src), imm_odd:$lane),
64985ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
64995ffd83dbSDimitry Andric              (VGETLNu16 (v4bf16 DPR:$src), imm:$lane),
65005ffd83dbSDimitry Andric              HPR)>;
65015ffd83dbSDimitry Andric
65025ffd83dbSDimitry Andric  def : Pat<(extractelt (v8bf16 QPR:$src), imm_odd:$lane),
65035ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
65045ffd83dbSDimitry Andric              (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
65055ffd83dbSDimitry Andric                                                (DSubReg_i16_reg imm:$lane))),
65065ffd83dbSDimitry Andric                         (SubReg_i16_lane imm:$lane)),
65075ffd83dbSDimitry Andric              HPR)>;
65085ffd83dbSDimitry Andric}
65095ffd83dbSDimitry Andric
65100b57cec5SDimitry Andric//   VMOV     : Vector Set Lane (move ARM core register to scalar)
65110b57cec5SDimitry Andric
65120b57cec5SDimitry Andriclet Constraints = "$src1 = $V" in {
65130b57cec5SDimitry Andricdef VSETLNi8  : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
65140b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex8:$lane),
65150b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "8", "$V$lane, $R",
65160b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
65170b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
65180b57cec5SDimitry Andric  let Inst{21}  = lane{2};
65190b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
65200b57cec5SDimitry Andric}
65210b57cec5SDimitry Andricdef VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
65220b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex16:$lane),
65230b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "16", "$V$lane, $R",
65240b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
65250b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
65260b57cec5SDimitry Andric  let Inst{21} = lane{1};
65270b57cec5SDimitry Andric  let Inst{6}  = lane{0};
65280b57cec5SDimitry Andric}
65290b57cec5SDimitry Andricdef VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
65300b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex32:$lane),
65310b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "32", "$V$lane, $R",
65320b57cec5SDimitry Andric                          [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
65330b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]>,
65340b57cec5SDimitry Andric                Requires<[HasVFP2]> {
65350b57cec5SDimitry Andric  let Inst{21} = lane{0};
65360b57cec5SDimitry Andric  // This instruction is equivalent as
65370b57cec5SDimitry Andric  // $V = INSERT_SUBREG $src1, $R, translateImmToSubIdx($imm)
65380b57cec5SDimitry Andric  let isInsertSubreg = 1;
65390b57cec5SDimitry Andric}
65400b57cec5SDimitry Andric}
65410b57cec5SDimitry Andric
65425ffd83dbSDimitry Andric// TODO: for odd lanes we could optimize this a bit by using the VINS
65435ffd83dbSDimitry Andric// FullFP16 instruction when it is available
65445ffd83dbSDimitry Andricmulticlass InsertEltF16<ValueType VTScalar, ValueType VT4, ValueType VT8> {
65455ffd83dbSDimitry Andric  def : Pat<(insertelt (VT4 DPR:$src1), (VTScalar HPR:$src2), imm:$lane),
65465ffd83dbSDimitry Andric            (VT4 (VSETLNi16 DPR:$src1,
65475ffd83dbSDimitry Andric                 (COPY_TO_REGCLASS HPR:$src2, GPR), imm:$lane))>;
65485ffd83dbSDimitry Andric  def : Pat<(insertelt (VT8 QPR:$src1), (VTScalar HPR:$src2), imm:$lane),
65495ffd83dbSDimitry Andric            (VT8 (INSERT_SUBREG QPR:$src1,
65505ffd83dbSDimitry Andric                    (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
65515ffd83dbSDimitry Andric                                        (DSubReg_i16_reg imm:$lane))),
65525ffd83dbSDimitry Andric                              (COPY_TO_REGCLASS HPR:$src2, GPR),
65535ffd83dbSDimitry Andric                              (SubReg_i16_lane imm:$lane))),
65545ffd83dbSDimitry Andric                    (DSubReg_i16_reg imm:$lane)))>;
65555ffd83dbSDimitry Andric}
65565ffd83dbSDimitry Andric
65570b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
65580b57cec5SDimitry Andricdef : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
65590b57cec5SDimitry Andric          (v16i8 (INSERT_SUBREG QPR:$src1,
65600b57cec5SDimitry Andric                  (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
65610b57cec5SDimitry Andric                                   (DSubReg_i8_reg imm:$lane))),
65620b57cec5SDimitry Andric                            GPR:$src2, (SubReg_i8_lane imm:$lane))),
65630b57cec5SDimitry Andric                  (DSubReg_i8_reg imm:$lane)))>;
65640b57cec5SDimitry Andricdef : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
65650b57cec5SDimitry Andric          (v8i16 (INSERT_SUBREG QPR:$src1,
65660b57cec5SDimitry Andric                  (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
65670b57cec5SDimitry Andric                                     (DSubReg_i16_reg imm:$lane))),
65680b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i16_lane imm:$lane))),
65690b57cec5SDimitry Andric                  (DSubReg_i16_reg imm:$lane)))>;
65700b57cec5SDimitry Andricdef : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
65710b57cec5SDimitry Andric          (v4i32 (INSERT_SUBREG QPR:$src1,
65720b57cec5SDimitry Andric                  (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
65730b57cec5SDimitry Andric                                     (DSubReg_i32_reg imm:$lane))),
65740b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i32_lane imm:$lane))),
65750b57cec5SDimitry Andric                  (DSubReg_i32_reg imm:$lane)))>;
65760b57cec5SDimitry Andric
65770b57cec5SDimitry Andricdef : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
65780b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
65790b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
65800b57cec5SDimitry Andricdef : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
65810b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
65820b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
65830b57cec5SDimitry Andric
65845ffd83dbSDimitry Andricdefm : InsertEltF16<f16, v4f16, v8f16>;
65850b57cec5SDimitry Andric
65860b57cec5SDimitry Andricdef : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
65870b57cec5SDimitry Andric          (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
65880b57cec5SDimitry Andric
65890b57cec5SDimitry Andricdef : Pat<(v2f32 (scalar_to_vector SPR:$src)),
65900b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
65910b57cec5SDimitry Andricdef : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
65920b57cec5SDimitry Andric          (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
65930b57cec5SDimitry Andricdef : Pat<(v4f32 (scalar_to_vector SPR:$src)),
65940b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
65950b57cec5SDimitry Andric
6596fe6060f1SDimitry Andricdef : Pat<(v4f16 (scalar_to_vector (f16 HPR:$src))),
6597fe6060f1SDimitry Andric          (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6598fe6060f1SDimitry Andricdef : Pat<(v8f16 (scalar_to_vector (f16 HPR:$src))),
6599fe6060f1SDimitry Andric          (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), HPR:$src, ssub_0)>;
6600fe6060f1SDimitry Andric
66010b57cec5SDimitry Andricdef : Pat<(v8i8 (scalar_to_vector GPR:$src)),
66020b57cec5SDimitry Andric          (VSETLNi8  (v8i8  (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66030b57cec5SDimitry Andricdef : Pat<(v4i16 (scalar_to_vector GPR:$src)),
66040b57cec5SDimitry Andric          (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66050b57cec5SDimitry Andricdef : Pat<(v2i32 (scalar_to_vector GPR:$src)),
66060b57cec5SDimitry Andric          (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
66070b57cec5SDimitry Andric
66080b57cec5SDimitry Andricdef : Pat<(v16i8 (scalar_to_vector GPR:$src)),
66090b57cec5SDimitry Andric          (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
66100b57cec5SDimitry Andric                         (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66110b57cec5SDimitry Andric                         dsub_0)>;
66120b57cec5SDimitry Andricdef : Pat<(v8i16 (scalar_to_vector GPR:$src)),
66130b57cec5SDimitry Andric          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
66140b57cec5SDimitry Andric                         (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66150b57cec5SDimitry Andric                         dsub_0)>;
66160b57cec5SDimitry Andricdef : Pat<(v4i32 (scalar_to_vector GPR:$src)),
66170b57cec5SDimitry Andric          (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
66180b57cec5SDimitry Andric                         (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
66190b57cec5SDimitry Andric                         dsub_0)>;
66200b57cec5SDimitry Andric}
66210b57cec5SDimitry Andric
66225ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in
66235ffd83dbSDimitry Andricdefm : InsertEltF16<bf16, v4bf16, v8bf16>;
66245ffd83dbSDimitry Andric
66250b57cec5SDimitry Andric//   VDUP     : Vector Duplicate (from ARM core register to all elements)
66260b57cec5SDimitry Andric
66270b57cec5SDimitry Andricclass VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
66280b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
66290b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
66300b57cec5SDimitry Andric          [(set DPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
66310b57cec5SDimitry Andricclass VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
66320b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
66330b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
66340b57cec5SDimitry Andric          [(set QPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
66350b57cec5SDimitry Andric
66360b57cec5SDimitry Andricdef  VDUP8d   : VDUPD<0b11101100, 0b00, "8", v8i8>;
66370b57cec5SDimitry Andricdef  VDUP16d  : VDUPD<0b11101000, 0b01, "16", v4i16>;
66380b57cec5SDimitry Andricdef  VDUP32d  : VDUPD<0b11101000, 0b00, "32", v2i32>,
66390b57cec5SDimitry Andric                Requires<[HasNEON, HasFastVDUP32]>;
66400b57cec5SDimitry Andricdef  VDUP8q   : VDUPQ<0b11101110, 0b00, "8", v16i8>;
66410b57cec5SDimitry Andricdef  VDUP16q  : VDUPQ<0b11101010, 0b01, "16", v8i16>;
66420b57cec5SDimitry Andricdef  VDUP32q  : VDUPQ<0b11101010, 0b00, "32", v4i32>;
66430b57cec5SDimitry Andric
66440b57cec5SDimitry Andric// ARMvdup patterns for uarchs with fast VDUP.32.
66450b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>,
66460b57cec5SDimitry Andric      Requires<[HasNEON,HasFastVDUP32]>;
66470b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>,
66480b57cec5SDimitry Andric      Requires<[HasNEON]>;
66490b57cec5SDimitry Andric
66500b57cec5SDimitry Andric// ARMvdup patterns for uarchs with slow VDUP.32 - use VMOVDRR instead.
66510b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvdup (i32 GPR:$R))), (VMOVDRR GPR:$R, GPR:$R)>,
66520b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
66530b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VMOVDRR GPR:$R, GPR:$R)>,
66540b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
66550b57cec5SDimitry Andric
66560b57cec5SDimitry Andric//   VDUP     : Vector Duplicate Lane (from scalar to all elements)
66570b57cec5SDimitry Andric
66580b57cec5SDimitry Andricclass VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
66590b57cec5SDimitry Andric              ValueType Ty, Operand IdxTy>
66600b57cec5SDimitry Andric  : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
66610b57cec5SDimitry Andric              IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm$lane",
66620b57cec5SDimitry Andric              [(set DPR:$Vd, (Ty (ARMvduplane (Ty DPR:$Vm), imm:$lane)))]>;
66630b57cec5SDimitry Andric
66640b57cec5SDimitry Andricclass VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
66650b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, Operand IdxTy>
66660b57cec5SDimitry Andric  : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
66670b57cec5SDimitry Andric              IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm$lane",
66680b57cec5SDimitry Andric              [(set QPR:$Vd, (ResTy (ARMvduplane (OpTy DPR:$Vm),
66690b57cec5SDimitry Andric                                      VectorIndex32:$lane)))]>;
66700b57cec5SDimitry Andric
66710b57cec5SDimitry Andric// Inst{19-16} is partially specified depending on the element size.
66720b57cec5SDimitry Andric
66730b57cec5SDimitry Andricdef VDUPLN8d  : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8, VectorIndex8> {
66740b57cec5SDimitry Andric  bits<3> lane;
66750b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
66760b57cec5SDimitry Andric}
66770b57cec5SDimitry Andricdef VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16, VectorIndex16> {
66780b57cec5SDimitry Andric  bits<2> lane;
66790b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
66800b57cec5SDimitry Andric}
66810b57cec5SDimitry Andricdef VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32, VectorIndex32> {
66820b57cec5SDimitry Andric  bits<1> lane;
66830b57cec5SDimitry Andric  let Inst{19} = lane{0};
66840b57cec5SDimitry Andric}
66850b57cec5SDimitry Andricdef VDUPLN8q  : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8, VectorIndex8> {
66860b57cec5SDimitry Andric  bits<3> lane;
66870b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
66880b57cec5SDimitry Andric}
66890b57cec5SDimitry Andricdef VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16, VectorIndex16> {
66900b57cec5SDimitry Andric  bits<2> lane;
66910b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
66920b57cec5SDimitry Andric}
66930b57cec5SDimitry Andricdef VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32, VectorIndex32> {
66940b57cec5SDimitry Andric  bits<1> lane;
66950b57cec5SDimitry Andric  let Inst{19} = lane{0};
66960b57cec5SDimitry Andric}
66970b57cec5SDimitry Andric
66980b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
66990b57cec5SDimitry Andricdef : Pat<(v4f16 (ARMvduplane (v4f16 DPR:$Vm), imm:$lane)),
67000b57cec5SDimitry Andric          (VDUPLN32d DPR:$Vm, imm:$lane)>;
67010b57cec5SDimitry Andric
67020b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
67030b57cec5SDimitry Andric          (VDUPLN32d DPR:$Vm, imm:$lane)>;
67040b57cec5SDimitry Andric
67050b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
67060b57cec5SDimitry Andric          (VDUPLN32q DPR:$Vm, imm:$lane)>;
67070b57cec5SDimitry Andric
67080b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvduplane (v16i8 QPR:$src), imm:$lane)),
67090b57cec5SDimitry Andric          (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
67100b57cec5SDimitry Andric                                  (DSubReg_i8_reg imm:$lane))),
67110b57cec5SDimitry Andric                           (SubReg_i8_lane imm:$lane)))>;
67120b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvduplane (v8i16 QPR:$src), imm:$lane)),
67130b57cec5SDimitry Andric          (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
67140b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67150b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67160b57cec5SDimitry Andricdef : Pat<(v8f16 (ARMvduplane (v8f16 QPR:$src), imm:$lane)),
67170b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (v4f16 (EXTRACT_SUBREG QPR:$src,
67180b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67190b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67200b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvduplane (v4i32 QPR:$src), imm:$lane)),
67210b57cec5SDimitry Andric          (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
67220b57cec5SDimitry Andric                                    (DSubReg_i32_reg imm:$lane))),
67230b57cec5SDimitry Andric                            (SubReg_i32_lane imm:$lane)))>;
67240b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v4f32 QPR:$src), imm:$lane)),
67250b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
67260b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
67270b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
67280b57cec5SDimitry Andric
67295ffd83dbSDimitry Andricdef : Pat<(v4f16 (ARMvdup (f16 HPR:$src))),
67300b57cec5SDimitry Andric          (v4f16 (VDUPLN16d (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
67315ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
67320b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 SPR:$src))),
67330b57cec5SDimitry Andric          (v2f32 (VDUPLN32d (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
67340b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
67350b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 SPR:$src))),
67360b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
67370b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
67385ffd83dbSDimitry Andricdef : Pat<(v8f16 (ARMvdup (f16 HPR:$src))),
67390b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
67405ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
67415ffd83dbSDimitry Andric}
67425ffd83dbSDimitry Andric
67435ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in {
67445ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvduplane (v4bf16 DPR:$Vm), imm:$lane)),
67455ffd83dbSDimitry Andric          (VDUPLN16d DPR:$Vm, imm:$lane)>;
67465ffd83dbSDimitry Andric
67475ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvduplane (v8bf16 QPR:$src), imm:$lane)),
67485ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (v4bf16 (EXTRACT_SUBREG QPR:$src,
67495ffd83dbSDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
67505ffd83dbSDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
67515ffd83dbSDimitry Andric
67525ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvdup (bf16 HPR:$src))),
67535ffd83dbSDimitry Andric          (v4bf16 (VDUPLN16d (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
67545ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
67555ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvdup (bf16 HPR:$src))),
67565ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
67575ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
67580b57cec5SDimitry Andric}
67590b57cec5SDimitry Andric
67600b57cec5SDimitry Andric//   VMOVN    : Vector Narrowing Move
67610b57cec5SDimitry Andricdefm VMOVN    : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
67620b57cec5SDimitry Andric                         "vmovn", "i", trunc>;
67630b57cec5SDimitry Andric//   VQMOVN   : Vector Saturating Narrowing Move
67640b57cec5SDimitry Andricdefm VQMOVNs  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
67650b57cec5SDimitry Andric                            "vqmovn", "s", int_arm_neon_vqmovns>;
67660b57cec5SDimitry Andricdefm VQMOVNu  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
67670b57cec5SDimitry Andric                            "vqmovn", "u", int_arm_neon_vqmovnu>;
67680b57cec5SDimitry Andricdefm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
67690b57cec5SDimitry Andric                            "vqmovun", "s", int_arm_neon_vqmovnsu>;
67700b57cec5SDimitry Andric//   VMOVL    : Vector Lengthening Move
67710b57cec5SDimitry Andricdefm VMOVLs   : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
67720b57cec5SDimitry Andricdefm VMOVLu   : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
67730b57cec5SDimitry Andric
67740b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
67750b57cec5SDimitry Andricdef : Pat<(v8i16 (anyext (v8i8 DPR:$Vm))), (VMOVLuv8i16 DPR:$Vm)>;
67760b57cec5SDimitry Andricdef : Pat<(v4i32 (anyext (v4i16 DPR:$Vm))), (VMOVLuv4i32 DPR:$Vm)>;
67770b57cec5SDimitry Andricdef : Pat<(v2i64 (anyext (v2i32 DPR:$Vm))), (VMOVLuv2i64 DPR:$Vm)>;
67780b57cec5SDimitry Andric}
67790b57cec5SDimitry Andric
67800b57cec5SDimitry Andric// Vector Conversions.
67810b57cec5SDimitry Andric
67820b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Integers
67830b57cec5SDimitry Andricdef  VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
67840b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_sint>;
67850b57cec5SDimitry Andricdef  VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
67860b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_uint>;
67870b57cec5SDimitry Andricdef  VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
67880b57cec5SDimitry Andric                     v2f32, v2i32, sint_to_fp>;
67890b57cec5SDimitry Andricdef  VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
67900b57cec5SDimitry Andric                     v2f32, v2i32, uint_to_fp>;
67910b57cec5SDimitry Andric
67920b57cec5SDimitry Andricdef  VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
67930b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_sint>;
67940b57cec5SDimitry Andricdef  VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
67950b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_uint>;
67960b57cec5SDimitry Andricdef  VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
67970b57cec5SDimitry Andric                     v4f32, v4i32, sint_to_fp>;
67980b57cec5SDimitry Andricdef  VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
67990b57cec5SDimitry Andric                     v4f32, v4i32, uint_to_fp>;
68000b57cec5SDimitry Andric
68010b57cec5SDimitry Andricdef  VCVTh2sd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
68020b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_sint>,
68030b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68040b57cec5SDimitry Andricdef  VCVTh2ud : N2VD<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
68050b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_uint>,
68060b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68070b57cec5SDimitry Andricdef  VCVTs2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
68080b57cec5SDimitry Andric                     v4f16, v4i16, sint_to_fp>,
68090b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68100b57cec5SDimitry Andricdef  VCVTu2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
68110b57cec5SDimitry Andric                     v4f16, v4i16, uint_to_fp>,
68120b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68130b57cec5SDimitry Andric
68140b57cec5SDimitry Andricdef  VCVTh2sq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
68150b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_sint>,
68160b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68170b57cec5SDimitry Andricdef  VCVTh2uq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
68180b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_uint>,
68190b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68200b57cec5SDimitry Andricdef  VCVTs2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
68210b57cec5SDimitry Andric                     v8f16, v8i16, sint_to_fp>,
68220b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68230b57cec5SDimitry Andricdef  VCVTu2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
68240b57cec5SDimitry Andric                     v8f16, v8i16, uint_to_fp>,
68250b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
68260b57cec5SDimitry Andric
68270b57cec5SDimitry Andric// VCVT{A, N, P, M}
68280b57cec5SDimitry Andricmulticlass VCVT_FPI<string op, bits<3> op10_8, SDPatternOperator IntS,
68290b57cec5SDimitry Andric                    SDPatternOperator IntU> {
68300b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
68310b57cec5SDimitry Andric    def SDf : N2VDIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68320b57cec5SDimitry Andric                       "s32.f32", v2i32, v2f32, IntS>, Requires<[HasV8, HasNEON]>;
68330b57cec5SDimitry Andric    def SQf : N2VQIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68340b57cec5SDimitry Andric                       "s32.f32", v4i32, v4f32, IntS>, Requires<[HasV8, HasNEON]>;
68350b57cec5SDimitry Andric    def UDf : N2VDIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68360b57cec5SDimitry Andric                       "u32.f32", v2i32, v2f32, IntU>, Requires<[HasV8, HasNEON]>;
68370b57cec5SDimitry Andric    def UQf : N2VQIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68380b57cec5SDimitry Andric                       "u32.f32", v4i32, v4f32, IntU>, Requires<[HasV8, HasNEON]>;
68390b57cec5SDimitry Andric    def SDh : N2VDIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68400b57cec5SDimitry Andric                       "s16.f16", v4i16, v4f16, IntS>,
68410b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68420b57cec5SDimitry Andric    def SQh : N2VQIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
68430b57cec5SDimitry Andric                       "s16.f16", v8i16, v8f16, IntS>,
68440b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68450b57cec5SDimitry Andric    def UDh : N2VDIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68460b57cec5SDimitry Andric                       "u16.f16", v4i16, v4f16, IntU>,
68470b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68480b57cec5SDimitry Andric    def UQh : N2VQIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
68490b57cec5SDimitry Andric                       "u16.f16", v8i16, v8f16, IntU>,
68500b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
68510b57cec5SDimitry Andric  }
68520b57cec5SDimitry Andric}
68530b57cec5SDimitry Andric
68540b57cec5SDimitry Andricdefm VCVTAN : VCVT_FPI<"a", 0b000, int_arm_neon_vcvtas, int_arm_neon_vcvtau>;
68550b57cec5SDimitry Andricdefm VCVTNN : VCVT_FPI<"n", 0b001, int_arm_neon_vcvtns, int_arm_neon_vcvtnu>;
68560b57cec5SDimitry Andricdefm VCVTPN : VCVT_FPI<"p", 0b010, int_arm_neon_vcvtps, int_arm_neon_vcvtpu>;
68570b57cec5SDimitry Andricdefm VCVTMN : VCVT_FPI<"m", 0b011, int_arm_neon_vcvtms, int_arm_neon_vcvtmu>;
68580b57cec5SDimitry Andric
68590b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Fixed-Point.
68600b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTD" in {
68610b57cec5SDimitry Andricdef VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
68620b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
68630b57cec5SDimitry Andricdef VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
68640b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
68650b57cec5SDimitry Andricdef VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
68660b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
68670b57cec5SDimitry Andricdef VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
68680b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
68690b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
68700b57cec5SDimitry Andricdef VCVTh2xsd : N2VCvtD<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
68710b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxs>;
68720b57cec5SDimitry Andricdef VCVTh2xud : N2VCvtD<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
68730b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxu>;
68740b57cec5SDimitry Andricdef VCVTxs2hd : N2VCvtD<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
68750b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxs2fp>;
68760b57cec5SDimitry Andricdef VCVTxu2hd : N2VCvtD<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
68770b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxu2fp>;
68780b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
68790b57cec5SDimitry Andric}
68800b57cec5SDimitry Andric
68810b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTQ" in {
68820b57cec5SDimitry Andricdef VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
68830b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
68840b57cec5SDimitry Andricdef VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
68850b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
68860b57cec5SDimitry Andricdef VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
68870b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
68880b57cec5SDimitry Andricdef VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
68890b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
68900b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
68910b57cec5SDimitry Andricdef VCVTh2xsq : N2VCvtQ<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
68920b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxs>;
68930b57cec5SDimitry Andricdef VCVTh2xuq : N2VCvtQ<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
68940b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxu>;
68950b57cec5SDimitry Andricdef VCVTxs2hq : N2VCvtQ<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
68960b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxs2fp>;
68970b57cec5SDimitry Andricdef VCVTxu2hq : N2VCvtQ<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
68980b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxu2fp>;
68990b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
69000b57cec5SDimitry Andric}
69010b57cec5SDimitry Andric
69020b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Dd, $Dm, #0",
69030b57cec5SDimitry Andric                    (VCVTf2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
69040b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Dd, $Dm, #0",
69050b57cec5SDimitry Andric                    (VCVTf2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
69060b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Dd, $Dm, #0",
69070b57cec5SDimitry Andric                    (VCVTs2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
69080b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Dd, $Dm, #0",
69090b57cec5SDimitry Andric                    (VCVTu2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
69100b57cec5SDimitry Andric
69110b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Qd, $Qm, #0",
69120b57cec5SDimitry Andric                    (VCVTf2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
69130b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Qd, $Qm, #0",
69140b57cec5SDimitry Andric                    (VCVTf2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
69150b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Qd, $Qm, #0",
69160b57cec5SDimitry Andric                    (VCVTs2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
69170b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Qd, $Qm, #0",
69180b57cec5SDimitry Andric                    (VCVTu2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
69190b57cec5SDimitry Andric
69200b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Dd, $Dm, #0",
69210b57cec5SDimitry Andric                    (VCVTh2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
69220b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Dd, $Dm, #0",
69230b57cec5SDimitry Andric                    (VCVTh2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
69240b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Dd, $Dm, #0",
69250b57cec5SDimitry Andric                    (VCVTs2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
69260b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Dd, $Dm, #0",
69270b57cec5SDimitry Andric                    (VCVTu2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
69280b57cec5SDimitry Andric
69290b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Qd, $Qm, #0",
69300b57cec5SDimitry Andric                    (VCVTh2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
69310b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Qd, $Qm, #0",
69320b57cec5SDimitry Andric                    (VCVTh2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
69330b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Qd, $Qm, #0",
69340b57cec5SDimitry Andric                    (VCVTs2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
69350b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Qd, $Qm, #0",
69360b57cec5SDimitry Andric                    (VCVTu2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
69370b57cec5SDimitry Andric
69380b57cec5SDimitry Andric
69390b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Half-Precision and Single-Precision.
69400b57cec5SDimitry Andricdef  VCVTf2h  : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
69410b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f16.f32",
69420b57cec5SDimitry Andric                        v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
69430b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
69440b57cec5SDimitry Andricdef  VCVTh2f  : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
69450b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f32.f16",
69460b57cec5SDimitry Andric                        v4f32, v4i16, int_arm_neon_vcvthf2fp>,
69470b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
69480b57cec5SDimitry Andric
6949*81ad6265SDimitry Andricdef : Pat<(v4f16 (fpround (v4f32 QPR:$src))), (VCVTf2h QPR:$src)>;
6950*81ad6265SDimitry Andricdef : Pat<(v4f32 (fpextend (v4f16 DPR:$src))), (VCVTh2f DPR:$src)>;
6951*81ad6265SDimitry Andric
69520b57cec5SDimitry Andric// Vector Reverse.
69530b57cec5SDimitry Andric
69540b57cec5SDimitry Andric//   VREV64   : Vector Reverse elements within 64-bit doublewords
69550b57cec5SDimitry Andric
69560b57cec5SDimitry Andricclass VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69570b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
69580b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
69590b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69600b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev64 (Ty DPR:$Vm))))]>;
69610b57cec5SDimitry Andricclass VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69620b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
69630b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
69640b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69650b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev64 (Ty QPR:$Vm))))]>;
69660b57cec5SDimitry Andric
69670b57cec5SDimitry Andricdef VREV64d8  : VREV64D<0b00, "vrev64", "8", v8i8>;
69680b57cec5SDimitry Andricdef VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
69690b57cec5SDimitry Andricdef VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
69700b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
69710b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
69720b57cec5SDimitry Andric}
69730b57cec5SDimitry Andric
69740b57cec5SDimitry Andricdef VREV64q8  : VREV64Q<0b00, "vrev64", "8", v16i8>;
69750b57cec5SDimitry Andricdef VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
69760b57cec5SDimitry Andricdef VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
69770b57cec5SDimitry Andric
69780b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
6979480093f4SDimitry Andric  def : Pat<(v4f32 (ARMvrev64 (v4f32 QPR:$Vm))),
6980480093f4SDimitry Andric            (VREV64q32 QPR:$Vm)>;
6981480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev64 (v8f16 QPR:$Vm))),
6982480093f4SDimitry Andric            (VREV64q16 QPR:$Vm)>;
6983480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev64 (v4f16 DPR:$Vm))),
6984480093f4SDimitry Andric            (VREV64d16 DPR:$Vm)>;
69850b57cec5SDimitry Andric}
69860b57cec5SDimitry Andric
69870b57cec5SDimitry Andric//   VREV32   : Vector Reverse elements within 32-bit words
69880b57cec5SDimitry Andric
69890b57cec5SDimitry Andricclass VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69900b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
69910b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
69920b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69930b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev32 (Ty DPR:$Vm))))]>;
69940b57cec5SDimitry Andricclass VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69950b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
69960b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
69970b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69980b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev32 (Ty QPR:$Vm))))]>;
69990b57cec5SDimitry Andric
70000b57cec5SDimitry Andricdef VREV32d8  : VREV32D<0b00, "vrev32", "8", v8i8>;
70010b57cec5SDimitry Andricdef VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
70020b57cec5SDimitry Andric
70030b57cec5SDimitry Andricdef VREV32q8  : VREV32Q<0b00, "vrev32", "8", v16i8>;
70040b57cec5SDimitry Andricdef VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
70050b57cec5SDimitry Andric
7006480093f4SDimitry Andriclet Predicates = [HasNEON] in {
7007480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev32 (v8f16 QPR:$Vm))),
7008480093f4SDimitry Andric            (VREV32q16 QPR:$Vm)>;
7009480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev32 (v4f16 DPR:$Vm))),
7010480093f4SDimitry Andric            (VREV32d16 DPR:$Vm)>;
7011480093f4SDimitry Andric}
7012480093f4SDimitry Andric
70130b57cec5SDimitry Andric//   VREV16   : Vector Reverse elements within 16-bit halfwords
70140b57cec5SDimitry Andric
70150b57cec5SDimitry Andricclass VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70160b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
70170b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
70180b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70190b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev16 (Ty DPR:$Vm))))]>;
70200b57cec5SDimitry Andricclass VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
70210b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
70220b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
70230b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
70240b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev16 (Ty QPR:$Vm))))]>;
70250b57cec5SDimitry Andric
70260b57cec5SDimitry Andricdef VREV16d8  : VREV16D<0b00, "vrev16", "8", v8i8>;
70270b57cec5SDimitry Andricdef VREV16q8  : VREV16Q<0b00, "vrev16", "8", v16i8>;
70280b57cec5SDimitry Andric
70290b57cec5SDimitry Andric// Other Vector Shuffles.
70300b57cec5SDimitry Andric
70310b57cec5SDimitry Andric//  Aligned extractions: really just dropping registers
70320b57cec5SDimitry Andric
70330b57cec5SDimitry Andricclass AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
70340b57cec5SDimitry Andric      : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
70350b57cec5SDimitry Andric             (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>,
70360b57cec5SDimitry Andric        Requires<[HasNEON]>;
70370b57cec5SDimitry Andric
70380b57cec5SDimitry Andricdef : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
70390b57cec5SDimitry Andric
70400b57cec5SDimitry Andricdef : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
70410b57cec5SDimitry Andric
70420b57cec5SDimitry Andricdef : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
70430b57cec5SDimitry Andric
70440b57cec5SDimitry Andricdef : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
70450b57cec5SDimitry Andric
70460b57cec5SDimitry Andricdef : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
70470b57cec5SDimitry Andric
70480b57cec5SDimitry Andricdef : AlignedVEXTq<v4f16, v8f16, DSubReg_i16_reg>; // v8f16 -> v4f16
70490b57cec5SDimitry Andric
70500b57cec5SDimitry Andric//   VEXT     : Vector Extract
70510b57cec5SDimitry Andric
70520b57cec5SDimitry Andric
70530b57cec5SDimitry Andric// All of these have a two-operand InstAlias.
70540b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
70550b57cec5SDimitry Andricclass VEXTd<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
70560b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
70570b57cec5SDimitry Andric        (ins DPR:$Vn, DPR:$Vm, immTy:$index), NVExtFrm,
70580b57cec5SDimitry Andric        IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
70590b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
70600b57cec5SDimitry Andric                                     (Ty DPR:$Vm), imm:$index)))]> {
70610b57cec5SDimitry Andric  bits<3> index;
70620b57cec5SDimitry Andric  let Inst{11} = 0b0;
70630b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
70640b57cec5SDimitry Andric}
70650b57cec5SDimitry Andric
70660b57cec5SDimitry Andricclass VEXTq<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
70670b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
7068349cc55cSDimitry Andric        (ins QPR:$Vn, QPR:$Vm, immTy:$index), NVExtFrm,
70690b57cec5SDimitry Andric        IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
70700b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
70710b57cec5SDimitry Andric                                     (Ty QPR:$Vm), imm:$index)))]> {
70720b57cec5SDimitry Andric  bits<4> index;
70730b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
70740b57cec5SDimitry Andric}
70750b57cec5SDimitry Andric}
70760b57cec5SDimitry Andric
70770b57cec5SDimitry Andricdef VEXTd8  : VEXTd<"vext", "8",  v8i8, imm0_7> {
70780b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
70790b57cec5SDimitry Andric}
70800b57cec5SDimitry Andricdef VEXTd16 : VEXTd<"vext", "16", v4i16, imm0_3> {
70810b57cec5SDimitry Andric  let Inst{10-9} = index{1-0};
70820b57cec5SDimitry Andric  let Inst{8}    = 0b0;
70830b57cec5SDimitry Andric}
70840b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
70850b57cec5SDimitry Andricdef : Pat<(v4f16 (NEONvext (v4f16 DPR:$Vn), (v4f16 DPR:$Vm), (i32 imm:$index))),
70860b57cec5SDimitry Andric          (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
70870b57cec5SDimitry Andric}
70880b57cec5SDimitry Andric
70890b57cec5SDimitry Andricdef VEXTd32 : VEXTd<"vext", "32", v2i32, imm0_1> {
70900b57cec5SDimitry Andric  let Inst{10}     = index{0};
70910b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
70920b57cec5SDimitry Andric}
70930b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
70940b57cec5SDimitry Andricdef : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn), (v2f32 DPR:$Vm), (i32 imm:$index))),
70950b57cec5SDimitry Andric          (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
70960b57cec5SDimitry Andric}
70970b57cec5SDimitry Andric
70980b57cec5SDimitry Andricdef VEXTq8  : VEXTq<"vext", "8",  v16i8, imm0_15> {
70990b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
71000b57cec5SDimitry Andric}
71010b57cec5SDimitry Andricdef VEXTq16 : VEXTq<"vext", "16", v8i16, imm0_7> {
71020b57cec5SDimitry Andric  let Inst{11-9} = index{2-0};
71030b57cec5SDimitry Andric  let Inst{8}    = 0b0;
71040b57cec5SDimitry Andric}
71050b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71060b57cec5SDimitry Andricdef : Pat<(v8f16 (NEONvext (v8f16 QPR:$Vn), (v8f16 QPR:$Vm), (i32 imm:$index))),
71070b57cec5SDimitry Andric          (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
71080b57cec5SDimitry Andric}
71090b57cec5SDimitry Andric
71100b57cec5SDimitry Andricdef VEXTq32 : VEXTq<"vext", "32", v4i32, imm0_3> {
71110b57cec5SDimitry Andric  let Inst{11-10} = index{1-0};
71120b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
71130b57cec5SDimitry Andric}
71140b57cec5SDimitry Andricdef VEXTq64 : VEXTq<"vext", "64", v2i64, imm0_1> {
71150b57cec5SDimitry Andric  let Inst{11} = index{0};
71160b57cec5SDimitry Andric  let Inst{10-8}    = 0b000;
71170b57cec5SDimitry Andric}
71180b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71190b57cec5SDimitry Andricdef : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn), (v4f32 QPR:$Vm), (i32 imm:$index))),
71200b57cec5SDimitry Andric          (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
71210b57cec5SDimitry Andric}
71220b57cec5SDimitry Andric
71230b57cec5SDimitry Andric//   VTRN     : Vector Transpose
71240b57cec5SDimitry Andric
71250b57cec5SDimitry Andricdef  VTRNd8   : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
71260b57cec5SDimitry Andricdef  VTRNd16  : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
71270b57cec5SDimitry Andricdef  VTRNd32  : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
71280b57cec5SDimitry Andric
71290b57cec5SDimitry Andricdef  VTRNq8   : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
71300b57cec5SDimitry Andricdef  VTRNq16  : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
71310b57cec5SDimitry Andricdef  VTRNq32  : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
71320b57cec5SDimitry Andric
71330b57cec5SDimitry Andric//   VUZP     : Vector Unzip (Deinterleave)
71340b57cec5SDimitry Andric
71350b57cec5SDimitry Andricdef  VUZPd8   : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
71360b57cec5SDimitry Andricdef  VUZPd16  : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
71370b57cec5SDimitry Andric// vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
71380b57cec5SDimitry Andricdef : NEONInstAlias<"vuzp${p}.32 $Dd, $Dm",
71390b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
71400b57cec5SDimitry Andric
71410b57cec5SDimitry Andricdef  VUZPq8   : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
71420b57cec5SDimitry Andricdef  VUZPq16  : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
71430b57cec5SDimitry Andricdef  VUZPq32  : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
71440b57cec5SDimitry Andric
71450b57cec5SDimitry Andric//   VZIP     : Vector Zip (Interleave)
71460b57cec5SDimitry Andric
71470b57cec5SDimitry Andricdef  VZIPd8   : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
71480b57cec5SDimitry Andricdef  VZIPd16  : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
71490b57cec5SDimitry Andric// vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
71500b57cec5SDimitry Andricdef : NEONInstAlias<"vzip${p}.32 $Dd, $Dm",
71510b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
71520b57cec5SDimitry Andric
71530b57cec5SDimitry Andricdef  VZIPq8   : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
71540b57cec5SDimitry Andricdef  VZIPq16  : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
71550b57cec5SDimitry Andricdef  VZIPq32  : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
71560b57cec5SDimitry Andric
71570b57cec5SDimitry Andric// Vector Table Lookup and Table Extension.
71580b57cec5SDimitry Andric
71590b57cec5SDimitry Andric//   VTBL     : Vector Table Lookup
71600b57cec5SDimitry Andriclet DecoderMethod = "DecodeTBLInstruction" in {
71610b57cec5SDimitry Andricdef  VTBL1
71620b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
71630b57cec5SDimitry Andric        (ins VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
71640b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "",
71650b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (NEONvtbl1 VecListOneD:$Vn, DPR:$Vm)))]>;
71660b57cec5SDimitry Andric
71670b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
71680b57cec5SDimitry Andricdef  VTBL2
71690b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
71700b57cec5SDimitry Andric        (ins VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB2,
71710b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71720b57cec5SDimitry Andricdef  VTBL3
71730b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
71740b57cec5SDimitry Andric        (ins VecListThreeD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB3,
71750b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71760b57cec5SDimitry Andricdef  VTBL4
71770b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
71780b57cec5SDimitry Andric        (ins VecListFourD:$Vn, DPR:$Vm),
71790b57cec5SDimitry Andric        NVTBLFrm, IIC_VTB4,
71800b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
71810b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
71820b57cec5SDimitry Andric
71830b57cec5SDimitry Andricdef  VTBL3Pseudo
71840b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
71850b57cec5SDimitry Andricdef  VTBL4Pseudo
71860b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
71870b57cec5SDimitry Andric
71880b57cec5SDimitry Andric//   VTBX     : Vector Table Extension
71890b57cec5SDimitry Andricdef  VTBX1
71900b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
71910b57cec5SDimitry Andric        (ins DPR:$orig, VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
71920b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd",
71930b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
71940b57cec5SDimitry Andric                               DPR:$orig, VecListOneD:$Vn, DPR:$Vm)))]>;
71950b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
71960b57cec5SDimitry Andricdef  VTBX2
71970b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
71980b57cec5SDimitry Andric        (ins DPR:$orig, VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
71990b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd", []>;
72000b57cec5SDimitry Andricdef  VTBX3
72010b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
72020b57cec5SDimitry Andric        (ins DPR:$orig, VecListThreeD:$Vn, DPR:$Vm),
72030b57cec5SDimitry Andric        NVTBLFrm, IIC_VTBX3,
72040b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
72050b57cec5SDimitry Andric        "$orig = $Vd", []>;
72060b57cec5SDimitry Andricdef  VTBX4
72070b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd),
72080b57cec5SDimitry Andric        (ins DPR:$orig, VecListFourD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
72090b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
72100b57cec5SDimitry Andric        "$orig = $Vd", []>;
72110b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
72120b57cec5SDimitry Andric
72130b57cec5SDimitry Andricdef  VTBX3Pseudo
72140b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
72150b57cec5SDimitry Andric                IIC_VTBX3, "$orig = $dst", []>;
72160b57cec5SDimitry Andricdef  VTBX4Pseudo
72170b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
72180b57cec5SDimitry Andric                IIC_VTBX4, "$orig = $dst", []>;
72190b57cec5SDimitry Andric} // DecoderMethod = "DecodeTBLInstruction"
72200b57cec5SDimitry Andric
72210b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
72220b57cec5SDimitry Andricdef : Pat<(v8i8 (NEONvtbl2 v8i8:$Vn0, v8i8:$Vn1, v8i8:$Vm)),
72230b57cec5SDimitry Andric          (v8i8 (VTBL2 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
72240b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
72250b57cec5SDimitry Andric                       v8i8:$Vm))>;
72260b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx2 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72270b57cec5SDimitry Andric                                    v8i8:$Vm)),
72280b57cec5SDimitry Andric          (v8i8 (VTBX2 v8i8:$orig,
72290b57cec5SDimitry Andric                       (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
72300b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
72310b57cec5SDimitry Andric                       v8i8:$Vm))>;
72320b57cec5SDimitry Andric
72330b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl3 v8i8:$Vn0, v8i8:$Vn1,
72340b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
72350b57cec5SDimitry Andric          (v8i8 (VTBL3Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72360b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72370b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72380b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
72390b57cec5SDimitry Andric                             v8i8:$Vm))>;
72400b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx3 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72410b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
72420b57cec5SDimitry Andric          (v8i8 (VTBX3Pseudo v8i8:$orig,
72430b57cec5SDimitry Andric                             (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72440b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72450b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72460b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
72470b57cec5SDimitry Andric                             v8i8:$Vm))>;
72480b57cec5SDimitry Andric
72490b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl4 v8i8:$Vn0, v8i8:$Vn1,
72500b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
72510b57cec5SDimitry Andric          (v8i8 (VTBL4Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
72520b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
72530b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
72540b57cec5SDimitry Andric                                                 v8i8:$Vn3, dsub_3),
72550b57cec5SDimitry Andric                             v8i8:$Vm))>;
72560b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx4 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
72570b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
72580b57cec5SDimitry Andric          (v8i8 (VTBX4Pseudo 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:$Vn3, dsub_3),
72630b57cec5SDimitry Andric                             v8i8:$Vm))>;
72640b57cec5SDimitry Andric}
72650b57cec5SDimitry Andric
72660b57cec5SDimitry Andric// VRINT      : Vector Rounding
72670b57cec5SDimitry Andricmulticlass VRINT_FPI<string op, bits<3> op9_7, SDPatternOperator Int> {
72680b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
72690b57cec5SDimitry Andric    def Df : N2VDIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
72700b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
72710b57cec5SDimitry Andric                      v2f32, v2f32, Int>, Requires<[HasV8, HasNEON]> {
72720b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72730b57cec5SDimitry Andric    }
72740b57cec5SDimitry Andric    def Qf : N2VQIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
72750b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
72760b57cec5SDimitry Andric                      v4f32, v4f32, Int>, Requires<[HasV8, HasNEON]> {
72770b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72780b57cec5SDimitry Andric    }
72790b57cec5SDimitry Andric    def Dh : N2VDIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
72800b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
72810b57cec5SDimitry Andric                      v4f16, v4f16, Int>,
72820b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
72830b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72840b57cec5SDimitry Andric    }
72850b57cec5SDimitry Andric    def Qh : N2VQIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
72860b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
72870b57cec5SDimitry Andric                      v8f16, v8f16, Int>,
72880b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
72890b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
72900b57cec5SDimitry Andric    }
72910b57cec5SDimitry Andric  }
72920b57cec5SDimitry Andric
72930b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Dd, $Dm"),
72940b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Df") DPR:$Dd, DPR:$Dm)>;
72950b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Qd, $Qm"),
72960b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qf") QPR:$Qd, QPR:$Qm)>;
72970b57cec5SDimitry Andric  let Predicates = [HasNEON, HasFullFP16] in {
72980b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Dd, $Dm"),
72990b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Dh") DPR:$Dd, DPR:$Dm)>;
73000b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Qd, $Qm"),
73010b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qh") QPR:$Qd, QPR:$Qm)>;
73020b57cec5SDimitry Andric  }
73030b57cec5SDimitry Andric}
73040b57cec5SDimitry Andric
73050b57cec5SDimitry Andricdefm VRINTNN : VRINT_FPI<"n", 0b000, int_arm_neon_vrintn>;
73060b57cec5SDimitry Andricdefm VRINTXN : VRINT_FPI<"x", 0b001, int_arm_neon_vrintx>;
73070b57cec5SDimitry Andricdefm VRINTAN : VRINT_FPI<"a", 0b010, int_arm_neon_vrinta>;
73080b57cec5SDimitry Andricdefm VRINTZN : VRINT_FPI<"z", 0b011, int_arm_neon_vrintz>;
73090b57cec5SDimitry Andricdefm VRINTMN : VRINT_FPI<"m", 0b101, int_arm_neon_vrintm>;
73100b57cec5SDimitry Andricdefm VRINTPN : VRINT_FPI<"p", 0b111, int_arm_neon_vrintp>;
73110b57cec5SDimitry Andric
73120b57cec5SDimitry Andric// Cryptography instructions
73130b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
73140b57cec5SDimitry Andric    DecoderNamespace = "v8Crypto", hasSideEffects = 0 in {
73150b57cec5SDimitry Andric  class AES<string op, bit op7, bit op6, SDPatternOperator Int>
73160b57cec5SDimitry Andric    : N2VQIntXnp<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7317fe6060f1SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
73180b57cec5SDimitry Andric  class AES2Op<string op, bit op7, bit op6, SDPatternOperator Int>
73190b57cec5SDimitry Andric    : N2VQIntX2np<0b00, 0b00, 0b011, op6, op7, NoItinerary,
7320fe6060f1SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>;
73210b57cec5SDimitry Andric  class N2SHA<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
73220b57cec5SDimitry Andric              SDPatternOperator Int>
73230b57cec5SDimitry Andric    : N2VQIntXnp<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7324fe6060f1SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73250b57cec5SDimitry Andric  class N2SHA2Op<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
73260b57cec5SDimitry Andric              SDPatternOperator Int>
73270b57cec5SDimitry Andric    : N2VQIntX2np<0b10, op17_16, op10_8, op6, op7, NoItinerary,
7328fe6060f1SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73290b57cec5SDimitry Andric  class N3SHA3Op<string op, bits<5> op27_23, bits<2> op21_20, SDPatternOperator Int>
73300b57cec5SDimitry Andric    : N3VQInt3np<op27_23, op21_20, 0b1100, 1, 0, N3RegFrm, NoItinerary,
7331349cc55cSDimitry Andric                !strconcat("sha", op), "32", v4i32, v4i32, Int>;
73320b57cec5SDimitry Andric}
73330b57cec5SDimitry Andric
7334fe6060f1SDimitry Andriclet Predicates = [HasV8, HasAES] in {
73350b57cec5SDimitry Andricdef AESD : AES2Op<"d", 0, 1, int_arm_neon_aesd>;
73360b57cec5SDimitry Andricdef AESE : AES2Op<"e", 0, 0, int_arm_neon_aese>;
73370b57cec5SDimitry Andricdef AESIMC : AES<"imc", 1, 1, int_arm_neon_aesimc>;
73380b57cec5SDimitry Andricdef AESMC : AES<"mc", 1, 0, int_arm_neon_aesmc>;
7339fe6060f1SDimitry Andric}
73400b57cec5SDimitry Andric
7341fe6060f1SDimitry Andriclet Predicates = [HasV8, HasSHA2] in {
73420b57cec5SDimitry Andricdef SHA1H : N2SHA<"1h", 0b01, 0b010, 1, 1, null_frag>;
73430b57cec5SDimitry Andricdef SHA1SU1 : N2SHA2Op<"1su1", 0b10, 0b011, 1, 0, int_arm_neon_sha1su1>;
73440b57cec5SDimitry Andricdef SHA256SU0 : N2SHA2Op<"256su0", 0b10, 0b011, 1, 1, int_arm_neon_sha256su0>;
73450b57cec5SDimitry Andricdef SHA1C : N3SHA3Op<"1c", 0b00100, 0b00, null_frag>;
73460b57cec5SDimitry Andricdef SHA1M : N3SHA3Op<"1m", 0b00100, 0b10, null_frag>;
73470b57cec5SDimitry Andricdef SHA1P : N3SHA3Op<"1p", 0b00100, 0b01, null_frag>;
73480b57cec5SDimitry Andricdef SHA1SU0 : N3SHA3Op<"1su0", 0b00100, 0b11, int_arm_neon_sha1su0>;
73490b57cec5SDimitry Andricdef SHA256H : N3SHA3Op<"256h", 0b00110, 0b00, int_arm_neon_sha256h>;
73500b57cec5SDimitry Andricdef SHA256H2 : N3SHA3Op<"256h2", 0b00110, 0b01, int_arm_neon_sha256h2>;
73510b57cec5SDimitry Andricdef SHA256SU1 : N3SHA3Op<"256su1", 0b00110, 0b10, int_arm_neon_sha256su1>;
7352fe6060f1SDimitry Andric}
73530b57cec5SDimitry Andric
73540b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
73550b57cec5SDimitry Andricdef : Pat<(i32 (int_arm_neon_sha1h i32:$Rn)),
73560b57cec5SDimitry Andric          (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG
73570b57cec5SDimitry Andric              (SHA1H (SUBREG_TO_REG (i64 0),
73580b57cec5SDimitry Andric                                    (f32 (COPY_TO_REGCLASS i32:$Rn, SPR)),
73590b57cec5SDimitry Andric                                    ssub_0)),
73600b57cec5SDimitry Andric              ssub_0)), GPR)>;
73610b57cec5SDimitry Andric
73620b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1c v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73630b57cec5SDimitry Andric          (SHA1C v4i32:$hash_abcd,
73640b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73650b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73660b57cec5SDimitry Andric                                ssub_0),
73670b57cec5SDimitry Andric                 v4i32:$wk)>;
73680b57cec5SDimitry Andric
73690b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1m v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73700b57cec5SDimitry Andric          (SHA1M v4i32:$hash_abcd,
73710b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73720b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73730b57cec5SDimitry Andric                                ssub_0),
73740b57cec5SDimitry Andric                 v4i32:$wk)>;
73750b57cec5SDimitry Andric
73760b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1p v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
73770b57cec5SDimitry Andric          (SHA1P v4i32:$hash_abcd,
73780b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
73790b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
73800b57cec5SDimitry Andric                                ssub_0),
73810b57cec5SDimitry Andric                 v4i32:$wk)>;
73820b57cec5SDimitry Andric}
73830b57cec5SDimitry Andric
73840b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
73850b57cec5SDimitry Andric// NEON instructions for single-precision FP math
73860b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
73870b57cec5SDimitry Andric
73880b57cec5SDimitry Andricclass N2VSPat<SDNode OpNode, NeonI Inst>
73890b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a)),
73900b57cec5SDimitry Andric              (EXTRACT_SUBREG
73910b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
73920b57cec5SDimitry Andric                (INSERT_SUBREG
73930b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73940b57cec5SDimitry Andric                 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
73950b57cec5SDimitry Andric
73960b57cec5SDimitry Andricclass N3VSPat<SDNode OpNode, NeonI Inst>
73970b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
73980b57cec5SDimitry Andric              (EXTRACT_SUBREG
73990b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
74000b57cec5SDimitry Andric                (INSERT_SUBREG
74010b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74020b57cec5SDimitry Andric                 SPR:$a, ssub_0),
74030b57cec5SDimitry Andric                (INSERT_SUBREG
74040b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74050b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74060b57cec5SDimitry Andric
74070b57cec5SDimitry Andricclass N3VSPatFP16<SDNode OpNode, NeonI Inst>
74080b57cec5SDimitry Andric  : NEONFPPat<(f16 (OpNode HPR:$a, HPR:$b)),
74090b57cec5SDimitry Andric              (EXTRACT_SUBREG
74100b57cec5SDimitry Andric               (v4f16 (COPY_TO_REGCLASS (Inst
74110b57cec5SDimitry Andric                (INSERT_SUBREG
74120b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
74130b57cec5SDimitry Andric                 HPR:$a, ssub_0),
74140b57cec5SDimitry Andric                (INSERT_SUBREG
74150b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
74160b57cec5SDimitry Andric                 HPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74170b57cec5SDimitry Andric
74180b57cec5SDimitry Andricclass N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
74190b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
74200b57cec5SDimitry Andric              (EXTRACT_SUBREG
74210b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
74220b57cec5SDimitry Andric                (INSERT_SUBREG
74230b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74240b57cec5SDimitry Andric                 SPR:$acc, ssub_0),
74250b57cec5SDimitry Andric                (INSERT_SUBREG
74260b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74270b57cec5SDimitry Andric                 SPR:$a, ssub_0),
74280b57cec5SDimitry Andric                (INSERT_SUBREG
74290b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
74300b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
74310b57cec5SDimitry Andric
74320b57cec5SDimitry Andricclass NVCVTIFPat<SDNode OpNode, NeonI Inst>
74330b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode GPR:$a)),
74340b57cec5SDimitry Andric              (f32 (EXTRACT_SUBREG
74350b57cec5SDimitry Andric                     (v2f32 (Inst
74360b57cec5SDimitry Andric                       (INSERT_SUBREG
74370b57cec5SDimitry Andric                         (v2f32 (IMPLICIT_DEF)),
74380b57cec5SDimitry Andric                         (i32 (COPY_TO_REGCLASS GPR:$a, SPR)), ssub_0))),
74390b57cec5SDimitry Andric                     ssub_0))>;
74400b57cec5SDimitry Andricclass NVCVTFIPat<SDNode OpNode, NeonI Inst>
74410b57cec5SDimitry Andric  : NEONFPPat<(i32 (OpNode SPR:$a)),
74420b57cec5SDimitry Andric              (i32 (EXTRACT_SUBREG
74430b57cec5SDimitry Andric                     (v2f32 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
74440b57cec5SDimitry Andric                                                 SPR:$a, ssub_0))),
74450b57cec5SDimitry Andric                     ssub_0))>;
74460b57cec5SDimitry Andric
74470b57cec5SDimitry Andricdef : N3VSPat<fadd, VADDfd>;
74480b57cec5SDimitry Andricdef : N3VSPat<fsub, VSUBfd>;
74490b57cec5SDimitry Andricdef : N3VSPat<fmul, VMULfd>;
74500b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VMLAfd>,
74510b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
74520b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VMLSfd>,
74530b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
74540b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VFMAfd>,
74550b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
74560b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VFMSfd>,
74570b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
74580b57cec5SDimitry Andricdef : N2VSPat<fabs, VABSfd>;
74590b57cec5SDimitry Andricdef : N2VSPat<fneg, VNEGfd>;
74600b57cec5SDimitry Andricdef : N3VSPatFP16<fmaximum, VMAXhd>, Requires<[HasFullFP16]>;
74610b57cec5SDimitry Andricdef : N3VSPatFP16<fminimum, VMINhd>, Requires<[HasFullFP16]>;
74620b57cec5SDimitry Andricdef : N3VSPat<fmaximum, VMAXfd>, Requires<[HasNEON]>;
74630b57cec5SDimitry Andricdef : N3VSPat<fminimum, VMINfd>, Requires<[HasNEON]>;
74640b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_sint, VCVTf2sd>;
74650b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_uint, VCVTf2ud>;
74660b57cec5SDimitry Andricdef : NVCVTIFPat<sint_to_fp, VCVTs2fd>;
74670b57cec5SDimitry Andricdef : NVCVTIFPat<uint_to_fp, VCVTu2fd>;
74680b57cec5SDimitry Andric
74690b57cec5SDimitry Andric// NEON doesn't have any f64 conversions, so provide patterns to make
74700b57cec5SDimitry Andric// sure the VFP conversions match when extracting from a vector.
74710b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
74720b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74730b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
74740b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74750b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
74760b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74770b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
74780b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
74790b57cec5SDimitry Andric
74800b57cec5SDimitry Andric
74810b57cec5SDimitry Andric// Prefer VMOVDRR for i32 -> f32 bitcasts, it can write all DPR registers.
74820b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert GPR:$a)),
74830b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
74840b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
74850b57cec5SDimitry Andricdef : Pat<(arm_vmovsr GPR:$a),
74860b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
74870b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
74880b57cec5SDimitry Andric
74890b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
74905ffd83dbSDimitry Andric// Non-Instruction Patterns or Endianess - Revert Patterns
74910b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
74920b57cec5SDimitry Andric
74930b57cec5SDimitry Andric// bit_convert
74940b57cec5SDimitry Andric// 64 bit conversions
74950b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
74960b57cec5SDimitry Andricdef : Pat<(f64   (bitconvert (v1i64 DPR:$src))), (f64   DPR:$src)>;
74970b57cec5SDimitry Andricdef : Pat<(v1i64 (bitconvert (f64   DPR:$src))), (v1i64 DPR:$src)>;
74980b57cec5SDimitry Andric
74990b57cec5SDimitry Andricdef : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
75000b57cec5SDimitry Andricdef : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
75010b57cec5SDimitry Andric
75020b57cec5SDimitry Andricdef : Pat<(v4i16 (bitconvert (v4f16 DPR:$src))), (v4i16  DPR:$src)>;
75030b57cec5SDimitry Andricdef : Pat<(v4f16 (bitconvert (v4i16 DPR:$src))), (v4f16  DPR:$src)>;
75040b57cec5SDimitry Andric
75055ffd83dbSDimitry Andricdef : Pat<(v4i16 (bitconvert (v4bf16 DPR:$src))), (v4i16  DPR:$src)>;
75065ffd83dbSDimitry Andricdef : Pat<(v4bf16 (bitconvert (v4i16 DPR:$src))), (v4bf16  DPR:$src)>;
75075ffd83dbSDimitry Andric
75080b57cec5SDimitry Andric// 128 bit conversions
75090b57cec5SDimitry Andricdef : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
75100b57cec5SDimitry Andricdef : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
75110b57cec5SDimitry Andric
75120b57cec5SDimitry Andricdef : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
75130b57cec5SDimitry Andricdef : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
75140b57cec5SDimitry Andric
75150b57cec5SDimitry Andricdef : Pat<(v8i16 (bitconvert (v8f16 QPR:$src))), (v8i16  QPR:$src)>;
75160b57cec5SDimitry Andricdef : Pat<(v8f16 (bitconvert (v8i16 QPR:$src))), (v8f16  QPR:$src)>;
75175ffd83dbSDimitry Andric
75185ffd83dbSDimitry Andricdef : Pat<(v8i16 (bitconvert (v8bf16 QPR:$src))), (v8i16  QPR:$src)>;
75195ffd83dbSDimitry Andricdef : Pat<(v8bf16 (bitconvert (v8i16 QPR:$src))), (v8bf16  QPR:$src)>;
75200b57cec5SDimitry Andric}
75210b57cec5SDimitry Andric
75220b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
75230b57cec5SDimitry Andric  // 64 bit conversions
75240b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (f64   DPR:$src)>;
75250b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (f64   DPR:$src)>;
75260b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (f64   DPR:$src)>;
75275ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (f64   DPR:$src)>;
75280b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (f64   DPR:$src)>;
75290b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (f64   DPR:$src)>;
75300b57cec5SDimitry Andric
75310b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
75320b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
75330b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (v1i64 DPR:$src)>;
75345ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (v1i64 DPR:$src)>;
75350b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
75360b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (v1i64 DPR:$src)>;
75370b57cec5SDimitry Andric
75380b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (v2f32 DPR:$src)>;
75390b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
75400b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (v2f32 DPR:$src)>;
75415ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (v2f32 DPR:$src)>;
75420b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
75430b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (v2f32 DPR:$src)>;
75440b57cec5SDimitry Andric
75450b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (v2i32 DPR:$src)>;
75460b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
75470b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (v2i32 DPR:$src)>;
75485ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (v2i32 DPR:$src)>;
75490b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
75500b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (v2i32 DPR:$src)>;
75510b57cec5SDimitry Andric
75520b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (v4f16 DPR:$src)>;
75530b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (v4f16 DPR:$src)>;
75540b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (v4f16 DPR:$src)>;
75550b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (v4f16 DPR:$src)>;
75560b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (v4f16 DPR:$src)>;
75570b57cec5SDimitry Andric
75585ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (v4bf16 DPR:$src)>;
75595ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (v4bf16 DPR:$src)>;
75605ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (v4bf16 DPR:$src)>;
75615ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (v4bf16 DPR:$src)>;
75625ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (v4bf16 DPR:$src)>;
75635ffd83dbSDimitry Andric
75640b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (v4i16 DPR:$src)>;
75650b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
75660b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
75670b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
75680b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (v4i16 DPR:$src)>;
75690b57cec5SDimitry Andric
75700b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (v8i8  DPR:$src)>;
75710b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (v8i8  DPR:$src)>;
75720b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (v8i8  DPR:$src)>;
75730b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (v8i8  DPR:$src)>;
75740b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (v8i8  DPR:$src)>;
75755ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (v8i8  DPR:$src)>;
75760b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (v8i8  DPR:$src)>;
75770b57cec5SDimitry Andric
75780b57cec5SDimitry Andric  // 128 bit conversions
75790b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;
75800b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
75810b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (v2f64 QPR:$src)>;
75825ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (v2f64 QPR:$src)>;
75830b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
75840b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
75850b57cec5SDimitry Andric
75860b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
75870b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
75880b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (v2i64 QPR:$src)>;
75895ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (v2i64 QPR:$src)>;
75900b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
75910b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
75920b57cec5SDimitry Andric
75930b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
75940b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
75950b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (v4f32 QPR:$src)>;
75965ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (v4f32 QPR:$src)>;
75970b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
75980b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
75990b57cec5SDimitry Andric
76000b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
76010b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
76020b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (v4i32 QPR:$src)>;
76035ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (v4i32 QPR:$src)>;
76040b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
76050b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
76060b57cec5SDimitry Andric
76070b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (v8f16 QPR:$src)>;
76080b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (v8f16 QPR:$src)>;
76090b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (v8f16 QPR:$src)>;
76100b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (v8f16 QPR:$src)>;
76110b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (v8f16 QPR:$src)>;
76120b57cec5SDimitry Andric
76135ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (v8bf16 QPR:$src)>;
76145ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (v8bf16 QPR:$src)>;
76155ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (v8bf16 QPR:$src)>;
76165ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (v8bf16 QPR:$src)>;
76175ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (v8bf16 QPR:$src)>;
76185ffd83dbSDimitry Andric
76190b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
76200b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
76210b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
76220b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
76230b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
76240b57cec5SDimitry Andric
76250b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
76260b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
76270b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
76280b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
76290b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (v16i8 QPR:$src)>;
76305ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (v16i8 QPR:$src)>;
76310b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
76320b57cec5SDimitry Andric}
76330b57cec5SDimitry Andric
76340b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
76350b57cec5SDimitry Andric  // 64 bit conversions
76360b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
76370b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
76380b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
76395ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
76400b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
76410b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
76420b57cec5SDimitry Andric
76430b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
76440b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
76450b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
76465ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
76470b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
76480b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
76490b57cec5SDimitry Andric
76500b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
76510b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
76520b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
76535ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
76540b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
76550b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
76560b57cec5SDimitry Andric
76570b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
76580b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
76590b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
76605ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
76610b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
76620b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
76630b57cec5SDimitry Andric
76640b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76650b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76660b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76670b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76680b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76690b57cec5SDimitry Andric
76705ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76715ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76725ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76735ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76745ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76755ffd83dbSDimitry Andric
76760b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
76770b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
76780b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
76790b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
76800b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
76810b57cec5SDimitry Andric
76820b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (VREV64d8  DPR:$src)>;
76830b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (VREV64d8  DPR:$src)>;
76840b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (VREV32d8  DPR:$src)>;
76850b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (VREV32d8  DPR:$src)>;
76860b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (VREV16d8  DPR:$src)>;
76875ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (VREV16d8  DPR:$src)>;
76880b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (VREV16d8  DPR:$src)>;
76890b57cec5SDimitry Andric
76900b57cec5SDimitry Andric  // 128 bit conversions
76910b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
76920b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
76930b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
76945ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
76950b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
76960b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
76970b57cec5SDimitry Andric
76980b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
76990b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
77000b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
77015ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
77020b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
77030b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
77040b57cec5SDimitry Andric
77050b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
77060b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
77070b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
77085ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
77090b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
77100b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
77110b57cec5SDimitry Andric
77120b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
77130b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
77140b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
77155ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
77160b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
77170b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
77180b57cec5SDimitry Andric
77190b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77200b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77210b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77220b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77230b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77240b57cec5SDimitry Andric
77255ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77265ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77275ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77285ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77295ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77305ffd83dbSDimitry Andric
77310b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
77320b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
77330b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
77340b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
77350b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
77360b57cec5SDimitry Andric
77370b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (VREV64q8  QPR:$src)>;
77380b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (VREV64q8  QPR:$src)>;
77390b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (VREV32q8  QPR:$src)>;
77400b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (VREV32q8  QPR:$src)>;
77410b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (VREV16q8  QPR:$src)>;
77425ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (VREV16q8  QPR:$src)>;
77430b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (VREV16q8  QPR:$src)>;
77440b57cec5SDimitry Andric}
77450b57cec5SDimitry Andric
77465ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
77475ffd83dbSDimitry Andric  // Here we match the specific SDNode type 'ARMVectorRegCastImpl'
77485ffd83dbSDimitry Andric  // rather than the more general 'ARMVectorRegCast' which would also
77495ffd83dbSDimitry Andric  // match some bitconverts. If we use the latter in cases where the
77505ffd83dbSDimitry Andric  // input and output types are the same, the bitconvert gets elided
77515ffd83dbSDimitry Andric  // and we end up generating a nonsense match of nothing.
77525ffd83dbSDimitry Andric
77535ffd83dbSDimitry Andric  foreach VT = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
77545ffd83dbSDimitry Andric    foreach VT2 = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
77555ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 QPR:$src))), (VT QPR:$src)>;
77565ffd83dbSDimitry Andric
77575ffd83dbSDimitry Andric  foreach VT = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
77585ffd83dbSDimitry Andric    foreach VT2 = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
77595ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 DPR:$src))), (VT DPR:$src)>;
77605ffd83dbSDimitry Andric}
77615ffd83dbSDimitry Andric
77620b57cec5SDimitry Andric// Use VLD1/VST1 + VREV for non-word-aligned v2f64 load/store on Big Endian
77630b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
77640b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
77650b57cec5SDimitry Andric          (VREV64q8 (VLD1q8 addrmode6:$addr))>;
77660b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
77670b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, (VREV64q8 QPR:$value))>;
77680b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
77690b57cec5SDimitry Andric          (VREV64q16 (VLD1q16 addrmode6:$addr))>;
77700b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
77710b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, (VREV64q16 QPR:$value))>;
77720b57cec5SDimitry Andric}
77730b57cec5SDimitry Andric
77740b57cec5SDimitry Andric// Fold extracting an element out of a v2i32 into a vfp register.
77750b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
77760b57cec5SDimitry Andric          (f32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>,
77770b57cec5SDimitry Andric      Requires<[HasNEON]>;
77780b57cec5SDimitry Andric
77790b57cec5SDimitry Andric// Vector lengthening move with load, matching extending loads.
77800b57cec5SDimitry Andric
77810b57cec5SDimitry Andric// extload, zextload and sextload for a standard lengthening load. Example:
77820b57cec5SDimitry Andric// Lengthen_Single<"8", "i16", "8"> =
77830b57cec5SDimitry Andric//     Pat<(v8i16 (extloadvi8 addrmode6:$addr))
77840b57cec5SDimitry Andric//         (VMOVLuv8i16 (VLD1d8 addrmode6:$addr,
77850b57cec5SDimitry Andric//                              (f64 (IMPLICIT_DEF)), (i32 0)))>;
77860b57cec5SDimitry Andricmulticlass Lengthen_Single<string DestLanes, string DestTy, string SrcTy> {
77870b57cec5SDimitry Andric  let AddedComplexity = 10 in {
77880b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77890b57cec5SDimitry Andric                    (!cast<PatFrag>("extloadvi" # SrcTy) addrmode6:$addr)),
77900b57cec5SDimitry Andric                  (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
77910b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
77920b57cec5SDimitry Andric             Requires<[HasNEON]>;
77930b57cec5SDimitry Andric
77940b57cec5SDimitry Andric  def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77950b57cec5SDimitry Andric                  (!cast<PatFrag>("zextloadvi" # SrcTy) addrmode6:$addr)),
77960b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
77970b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
77980b57cec5SDimitry Andric           Requires<[HasNEON]>;
77990b57cec5SDimitry Andric
78000b57cec5SDimitry Andric  def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78010b57cec5SDimitry Andric                  (!cast<PatFrag>("sextloadvi" # SrcTy) addrmode6:$addr)),
78020b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLsv" # DestLanes # DestTy)
78030b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
78040b57cec5SDimitry Andric           Requires<[HasNEON]>;
78050b57cec5SDimitry Andric  }
78060b57cec5SDimitry Andric}
78070b57cec5SDimitry Andric
78080b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load which only uses
78090b57cec5SDimitry Andric// half the lanes available. Example:
78100b57cec5SDimitry Andric// Lengthen_HalfSingle<"4", "i16", "8", "i16", "i8"> =
78110b57cec5SDimitry Andric//     Pat<(v4i16 (extloadvi8 addrmode6oneL32:$addr)),
78120b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
78130b57cec5SDimitry Andric//                                      (f64 (IMPLICIT_DEF)), (i32 0))),
78140b57cec5SDimitry Andric//                         dsub_0)>;
78150b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle<string DestLanes, string DestTy, string SrcTy,
78160b57cec5SDimitry Andric                               string InsnLanes, string InsnTy> {
78170b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78180b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78190b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78200b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78210b57cec5SDimitry Andric         dsub_0)>,
78220b57cec5SDimitry Andric             Requires<[HasNEON]>;
78230b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78240b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78250b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78260b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78270b57cec5SDimitry Andric         dsub_0)>,
78280b57cec5SDimitry Andric             Requires<[HasNEON]>;
78290b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78300b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78310b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
78320b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78330b57cec5SDimitry Andric         dsub_0)>,
78340b57cec5SDimitry Andric             Requires<[HasNEON]>;
78350b57cec5SDimitry Andric}
78360b57cec5SDimitry Andric
78370b57cec5SDimitry Andric// The following class definition is basically a copy of the
78380b57cec5SDimitry Andric// Lengthen_HalfSingle definition above, however with an additional parameter
78390b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
78400b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
78410b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle_Big_Endian<string DestLanes, string DestTy, string SrcTy,
78420b57cec5SDimitry Andric                               string InsnLanes, string InsnTy, string RevLanes> {
78430b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78440b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78450b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78460b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78470b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78480b57cec5SDimitry Andric         dsub_0)>,
78490b57cec5SDimitry Andric             Requires<[HasNEON]>;
78500b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78510b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78520b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
78530b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78540b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78550b57cec5SDimitry Andric         dsub_0)>,
78560b57cec5SDimitry Andric             Requires<[HasNEON]>;
78570b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78580b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78590b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
78600b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
78610b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78620b57cec5SDimitry Andric         dsub_0)>,
78630b57cec5SDimitry Andric             Requires<[HasNEON]>;
78640b57cec5SDimitry Andric}
78650b57cec5SDimitry Andric
78660b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
78670b57cec5SDimitry Andric// lengthening load, to quadruple the initial length.
78680b57cec5SDimitry Andric//
78690b57cec5SDimitry Andric// Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> =
78700b57cec5SDimitry Andric//     Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr))
78710b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv4i32
78720b57cec5SDimitry Andric//           (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
78730b57cec5SDimitry Andric//                                                   (f64 (IMPLICIT_DEF)),
78740b57cec5SDimitry Andric//                                                   (i32 0))),
78750b57cec5SDimitry Andric//                           dsub_0)),
78760b57cec5SDimitry Andric//           dsub_0)>;
78770b57cec5SDimitry Andricmulticlass Lengthen_Double<string DestLanes, string DestTy, string SrcTy,
78780b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
78790b57cec5SDimitry Andric                           string Insn2Ty> {
78800b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78810b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78820b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78830b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78840b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78850b57cec5SDimitry Andric             dsub_0))>,
78860b57cec5SDimitry Andric             Requires<[HasNEON]>;
78870b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78880b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78890b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78900b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78910b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78920b57cec5SDimitry Andric             dsub_0))>,
78930b57cec5SDimitry Andric             Requires<[HasNEON]>;
78940b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78950b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78960b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
78970b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
78980b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78990b57cec5SDimitry Andric             dsub_0))>,
79000b57cec5SDimitry Andric             Requires<[HasNEON]>;
79010b57cec5SDimitry Andric}
79020b57cec5SDimitry Andric
79030b57cec5SDimitry Andric// The following class definition is basically a copy of the
79040b57cec5SDimitry Andric// Lengthen_Double definition above, however with an additional parameter
79050b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
79060b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
79070b57cec5SDimitry Andricmulticlass Lengthen_Double_Big_Endian<string DestLanes, string DestTy, string SrcTy,
79080b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
79090b57cec5SDimitry Andric                           string Insn2Ty, string RevLanes> {
79100b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79110b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
79120b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79130b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79140b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79150b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79160b57cec5SDimitry Andric             dsub_0))>,
79170b57cec5SDimitry Andric             Requires<[HasNEON]>;
79180b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79190b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
79200b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79210b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79220b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79230b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79240b57cec5SDimitry Andric             dsub_0))>,
79250b57cec5SDimitry Andric             Requires<[HasNEON]>;
79260b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79270b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
79280b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79290b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79300b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
79310b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79320b57cec5SDimitry Andric             dsub_0))>,
79330b57cec5SDimitry Andric             Requires<[HasNEON]>;
79340b57cec5SDimitry Andric}
79350b57cec5SDimitry Andric
79360b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
79370b57cec5SDimitry Andric// lengthening load, to quadruple the initial length, but which ends up only
79380b57cec5SDimitry Andric// requiring half the available lanes (a 64-bit outcome instead of a 128-bit).
79390b57cec5SDimitry Andric//
79400b57cec5SDimitry Andric// Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> =
79410b57cec5SDimitry Andric// Pat<(v2i32 (extloadvi8 addrmode6:$addr))
79420b57cec5SDimitry Andric//     (EXTRACT_SUBREG (VMOVLuv4i32
79430b57cec5SDimitry Andric//       (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr,
79440b57cec5SDimitry Andric//                                               (f64 (IMPLICIT_DEF)), (i32 0))),
79450b57cec5SDimitry Andric//                       dsub_0)),
79460b57cec5SDimitry Andric//       dsub_0)>;
79470b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble<string DestLanes, string DestTy, string SrcTy,
79480b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
79490b57cec5SDimitry Andric                           string Insn2Ty> {
79500b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79510b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
79520b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79530b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79540b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79550b57cec5SDimitry Andric             dsub_0)),
79560b57cec5SDimitry Andric          dsub_0)>,
79570b57cec5SDimitry Andric             Requires<[HasNEON]>;
79580b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79590b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
79600b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79610b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79620b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79630b57cec5SDimitry Andric             dsub_0)),
79640b57cec5SDimitry Andric          dsub_0)>,
79650b57cec5SDimitry Andric              Requires<[HasNEON]>;
79660b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79670b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
79680b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79690b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79700b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
79710b57cec5SDimitry Andric             dsub_0)),
79720b57cec5SDimitry Andric          dsub_0)>,
79730b57cec5SDimitry Andric             Requires<[HasNEON]>;
79740b57cec5SDimitry Andric}
79750b57cec5SDimitry Andric
79760b57cec5SDimitry Andric// The following class definition is basically a copy of the
79770b57cec5SDimitry Andric// Lengthen_HalfDouble definition above, however with an additional VREV16d8
79780b57cec5SDimitry Andric// instruction to convert data loaded by VLD1LN into proper vector format
79790b57cec5SDimitry Andric// in big endian mode.
79800b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble_Big_Endian<string DestLanes, string DestTy, string SrcTy,
79810b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
79820b57cec5SDimitry Andric                           string Insn2Ty> {
79830b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79840b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
79850b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79860b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79870b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
79880b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79890b57cec5SDimitry Andric             dsub_0)),
79900b57cec5SDimitry Andric          dsub_0)>,
79910b57cec5SDimitry Andric             Requires<[HasNEON]>;
79920b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79930b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
79940b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
79950b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
79960b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
79970b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79980b57cec5SDimitry Andric             dsub_0)),
79990b57cec5SDimitry Andric          dsub_0)>,
80000b57cec5SDimitry Andric             Requires<[HasNEON]>;
80010b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
80020b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
80030b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
80040b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
80050b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
80060b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
80070b57cec5SDimitry Andric             dsub_0)),
80080b57cec5SDimitry Andric          dsub_0)>,
80090b57cec5SDimitry Andric             Requires<[HasNEON]>;
80100b57cec5SDimitry Andric}
80110b57cec5SDimitry Andric
80120b57cec5SDimitry Andricdefm : Lengthen_Single<"8", "i16", "8">; // v8i8 -> v8i16
80130b57cec5SDimitry Andricdefm : Lengthen_Single<"4", "i32", "16">; // v4i16 -> v4i32
80140b57cec5SDimitry Andricdefm : Lengthen_Single<"2", "i64", "32">; // v2i32 -> v2i64
80150b57cec5SDimitry Andric
80160b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
80170b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"4", "i16", "i8", "8", "i16">; // v4i8 -> v4i16
80180b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"2", "i32", "i16", "4", "i32">; // v2i16 -> v2i32
80190b57cec5SDimitry Andric
80200b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
80210b57cec5SDimitry Andric  defm : Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32">;
80220b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
80230b57cec5SDimitry Andric  defm : Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32">;
80240b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
80250b57cec5SDimitry Andric  defm : Lengthen_Double<"2", "i64", "i16", "4", "i32", "2", "i64">;
80260b57cec5SDimitry Andric}
80270b57cec5SDimitry Andric
80280b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
80290b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"4", "i16", "i8", "8", "i16", "8">; // v4i8 -> v4i16
80300b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"2", "i32", "i16", "4", "i32", "16">; // v2i16 -> v2i32
80310b57cec5SDimitry Andric
80320b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
80330b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"4", "i32", "i8", "8", "i16", "4", "i32", "8">;
80340b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
80350b57cec5SDimitry Andric  defm : Lengthen_HalfDouble_Big_Endian<"2", "i32", "i8", "8", "i16", "4", "i32">;
80360b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
80370b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"2", "i64", "i16", "4", "i32", "2", "i64", "16">;
80380b57cec5SDimitry Andric}
80390b57cec5SDimitry Andric
80400b57cec5SDimitry Andric// Triple lengthening - v2i8 -> v2i16 -> v2i32 -> v2i64
80410b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
80420b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
80430b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80440b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80450b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80460b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
80470b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80480b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80490b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80500b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
80510b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
80520b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
80530b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
80540b57cec5SDimitry Andric}
80550b57cec5SDimitry Andric// The following patterns are basically a copy of the patterns above,
80560b57cec5SDimitry Andric// however with an additional VREV16d instruction to convert data
80570b57cec5SDimitry Andric// loaded by VLD1LN into proper vector format in big endian mode.
80580b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
80590b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
80600b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80610b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
80620b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80630b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80640b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
80650b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
80660b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
80670b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80680b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80690b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
80700b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
80710b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
80720b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
80730b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
80740b57cec5SDimitry Andric}
80750b57cec5SDimitry Andric
80760b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
80770b57cec5SDimitry Andricdef : Pat<(v2i64 (concat_vectors DPR:$Dn, DPR:$Dm)),
80780b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80790b57cec5SDimitry Andricdef : Pat<(v4i32 (concat_vectors DPR:$Dn, DPR:$Dm)),
80800b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80810b57cec5SDimitry Andricdef : Pat<(v8i16 (concat_vectors DPR:$Dn, DPR:$Dm)),
80820b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80830b57cec5SDimitry Andricdef : Pat<(v16i8 (concat_vectors DPR:$Dn, DPR:$Dm)),
80840b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80850b57cec5SDimitry Andricdef : Pat<(v4f32 (concat_vectors DPR:$Dn, DPR:$Dm)),
80860b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80870b57cec5SDimitry Andricdef : Pat<(v8f16 (concat_vectors DPR:$Dn, DPR:$Dm)),
80880b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80895ffd83dbSDimitry Andricdef : Pat<(v8bf16 (concat_vectors DPR:$Dn, DPR:$Dm)),
80905ffd83dbSDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
80910b57cec5SDimitry Andric}
80920b57cec5SDimitry Andric
80930b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
80940b57cec5SDimitry Andric// Assembler aliases
80950b57cec5SDimitry Andric//
80960b57cec5SDimitry Andric
80970b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdhr${p} $Dd, $Rn",
80980b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 1, pred:$p)>;
80990b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdlr${p} $Dd, $Rn",
81000b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 0, pred:$p)>;
81010b57cec5SDimitry Andric
81020b57cec5SDimitry Andric// VAND/VBIC/VEOR/VORR accept but do not require a type suffix.
81030b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
81040b57cec5SDimitry Andric                         (VANDd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81050b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
81060b57cec5SDimitry Andric                         (VANDq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81070b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
81080b57cec5SDimitry Andric                         (VBICd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81090b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
81100b57cec5SDimitry Andric                         (VBICq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81110b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
81120b57cec5SDimitry Andric                         (VEORd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81130b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
81140b57cec5SDimitry Andric                         (VEORq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81150b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
81160b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
81170b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
81180b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
81190b57cec5SDimitry Andric// ... two-operand aliases
81200b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
81210b57cec5SDimitry Andric                         (VANDd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81220b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
81230b57cec5SDimitry Andric                         (VANDq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81240b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
81250b57cec5SDimitry Andric                         (VEORd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81260b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
81270b57cec5SDimitry Andric                         (VEORq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81280b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
81290b57cec5SDimitry Andric                         (VORRd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
81300b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
81310b57cec5SDimitry Andric                         (VORRq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
81320b57cec5SDimitry Andric// ... immediates
81330b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
81340b57cec5SDimitry Andric                    (VBICiv4i16 DPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
81350b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
81360b57cec5SDimitry Andric                    (VBICiv2i32 DPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
81370b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
81380b57cec5SDimitry Andric                    (VBICiv8i16 QPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
81390b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
81400b57cec5SDimitry Andric                    (VBICiv4i32 QPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
81410b57cec5SDimitry Andric
81420b57cec5SDimitry Andric
81430b57cec5SDimitry Andric// VLD1 single-lane pseudo-instructions. These need special handling for
81440b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81450b57cec5SDimitry Andricdef VLD1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr",
81460b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81470b57cec5SDimitry Andric                      pred:$p)>;
81480b57cec5SDimitry Andricdef VLD1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr",
81490b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81500b57cec5SDimitry Andric                      pred:$p)>;
81510b57cec5SDimitry Andricdef VLD1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr",
81520b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81530b57cec5SDimitry Andric                      pred:$p)>;
81540b57cec5SDimitry Andric
81550b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_8 :
81560b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr!",
81570b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81580b57cec5SDimitry Andric                      pred:$p)>;
81590b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_16 :
81600b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr!",
81610b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81620b57cec5SDimitry Andric                      pred:$p)>;
81630b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_32 :
81640b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr!",
81650b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81660b57cec5SDimitry Andric                      pred:$p)>;
81670b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_8 :
81680b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr, $Rm",
81690b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81700b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81710b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_16 :
81720b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr, $Rm",
81730b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81740b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81750b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_32 :
81760b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr, $Rm",
81770b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81780b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81790b57cec5SDimitry Andric
81800b57cec5SDimitry Andric
81810b57cec5SDimitry Andric// VST1 single-lane pseudo-instructions. These need special handling for
81820b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81830b57cec5SDimitry Andricdef VST1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr",
81840b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81850b57cec5SDimitry Andric                      pred:$p)>;
81860b57cec5SDimitry Andricdef VST1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr",
81870b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81880b57cec5SDimitry Andric                      pred:$p)>;
81890b57cec5SDimitry Andricdef VST1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr",
81900b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81910b57cec5SDimitry Andric                      pred:$p)>;
81920b57cec5SDimitry Andric
81930b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_8 :
81940b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr!",
81950b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81960b57cec5SDimitry Andric                      pred:$p)>;
81970b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_16 :
81980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr!",
81990b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
82000b57cec5SDimitry Andric                      pred:$p)>;
82010b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_32 :
82020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr!",
82030b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
82040b57cec5SDimitry Andric                      pred:$p)>;
82050b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_8 :
82060b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr, $Rm",
82070b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
82080b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82090b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_16 :
82100b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr, $Rm",
82110b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
82120b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82130b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_32 :
82140b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr, $Rm",
82150b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
82160b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82170b57cec5SDimitry Andric
82180b57cec5SDimitry Andric// VLD2 single-lane pseudo-instructions. These need special handling for
82190b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
82200b57cec5SDimitry Andricdef VLD2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr",
82210b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82220b57cec5SDimitry Andric                  pred:$p)>;
82230b57cec5SDimitry Andricdef VLD2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
82240b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82250b57cec5SDimitry Andric                      pred:$p)>;
82260b57cec5SDimitry Andricdef VLD2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
82270b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr, pred:$p)>;
82280b57cec5SDimitry Andricdef VLD2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
82290b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82300b57cec5SDimitry Andric                      pred:$p)>;
82310b57cec5SDimitry Andricdef VLD2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
82320b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82330b57cec5SDimitry Andric                      pred:$p)>;
82340b57cec5SDimitry Andric
82350b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_8 :
82360b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr!",
82370b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82380b57cec5SDimitry Andric                      pred:$p)>;
82390b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_16 :
82400b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
82410b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82420b57cec5SDimitry Andric                      pred:$p)>;
82430b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_32 :
82440b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
82450b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82460b57cec5SDimitry Andric                      pred:$p)>;
82470b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_16 :
82480b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
82490b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82500b57cec5SDimitry Andric                      pred:$p)>;
82510b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_32 :
82520b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
82530b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82540b57cec5SDimitry Andric                      pred:$p)>;
82550b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_8 :
82560b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr, $Rm",
82570b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82580b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82590b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_16 :
82600b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
82610b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82620b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82630b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_32 :
82640b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
82650b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82660b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82670b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_16 :
82680b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
82690b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82700b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82710b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_32 :
82720b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
82730b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82740b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82750b57cec5SDimitry Andric
82760b57cec5SDimitry Andric
82770b57cec5SDimitry Andric// VST2 single-lane pseudo-instructions. These need special handling for
82780b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
82790b57cec5SDimitry Andricdef VST2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr",
82800b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82810b57cec5SDimitry Andric                      pred:$p)>;
82820b57cec5SDimitry Andricdef VST2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
82830b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82840b57cec5SDimitry Andric                      pred:$p)>;
82850b57cec5SDimitry Andricdef VST2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
82860b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82870b57cec5SDimitry Andric                      pred:$p)>;
82880b57cec5SDimitry Andricdef VST2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
82890b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82900b57cec5SDimitry Andric                      pred:$p)>;
82910b57cec5SDimitry Andricdef VST2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
82920b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82930b57cec5SDimitry Andric                      pred:$p)>;
82940b57cec5SDimitry Andric
82950b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_8 :
82960b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr!",
82970b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82980b57cec5SDimitry Andric                      pred:$p)>;
82990b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_16 :
83000b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
83010b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
83020b57cec5SDimitry Andric                      pred:$p)>;
83030b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_32 :
83040b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
83050b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
83060b57cec5SDimitry Andric                      pred:$p)>;
83070b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_16 :
83080b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
83090b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
83100b57cec5SDimitry Andric                      pred:$p)>;
83110b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_32 :
83120b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
83130b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
83140b57cec5SDimitry Andric                      pred:$p)>;
83150b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_8 :
83160b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr, $Rm",
83170b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
83180b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83190b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_16 :
83200b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
83210b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
83220b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83230b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_32 :
83240b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
83250b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
83260b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83270b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_16 :
83280b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
83290b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
83300b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83310b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_32 :
83320b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
83330b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
83340b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83350b57cec5SDimitry Andric
83360b57cec5SDimitry Andric// VLD3 all-lanes pseudo-instructions. These need special handling for
83370b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
83380b57cec5SDimitry Andricdef VLD3DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83390b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83400b57cec5SDimitry Andric                    pred:$p)>;
83410b57cec5SDimitry Andricdef VLD3DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83420b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83430b57cec5SDimitry Andric                    pred:$p)>;
83440b57cec5SDimitry Andricdef VLD3DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83450b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83460b57cec5SDimitry Andric                    pred:$p)>;
83470b57cec5SDimitry Andricdef VLD3DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83480b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83490b57cec5SDimitry Andric                    pred:$p)>;
83500b57cec5SDimitry Andricdef VLD3DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83510b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83520b57cec5SDimitry Andric                    pred:$p)>;
83530b57cec5SDimitry Andricdef VLD3DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83540b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83550b57cec5SDimitry Andric                    pred:$p)>;
83560b57cec5SDimitry Andric
83570b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_8 :
83580b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83590b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83600b57cec5SDimitry Andric                    pred:$p)>;
83610b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_16 :
83620b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83630b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83640b57cec5SDimitry Andric                    pred:$p)>;
83650b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_32 :
83660b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83670b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83680b57cec5SDimitry Andric                    pred:$p)>;
83690b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_8 :
83700b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83710b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83720b57cec5SDimitry Andric                    pred:$p)>;
83730b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_16 :
83740b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83750b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83760b57cec5SDimitry Andric                    pred:$p)>;
83770b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_32 :
83780b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83790b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83800b57cec5SDimitry Andric                    pred:$p)>;
83810b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_8 :
83820b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
83830b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83840b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83850b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_16 :
83860b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
83870b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83880b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83890b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_32 :
83900b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
83910b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
83920b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83930b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_8 :
83940b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
83950b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83960b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83970b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_16 :
83980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
83990b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
84000b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84010b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_32 :
84020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84030b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
84040b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84050b57cec5SDimitry Andric
84060b57cec5SDimitry Andric
84070b57cec5SDimitry Andric// VLD3 single-lane pseudo-instructions. These need special handling for
84080b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
84090b57cec5SDimitry Andricdef VLD3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84100b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84110b57cec5SDimitry Andric                    pred:$p)>;
84120b57cec5SDimitry Andricdef VLD3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84130b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84140b57cec5SDimitry Andric                    pred:$p)>;
84150b57cec5SDimitry Andricdef VLD3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84160b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84170b57cec5SDimitry Andric                    pred:$p)>;
84180b57cec5SDimitry Andricdef VLD3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84190b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84200b57cec5SDimitry Andric                    pred:$p)>;
84210b57cec5SDimitry Andricdef VLD3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84220b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84230b57cec5SDimitry Andric                    pred:$p)>;
84240b57cec5SDimitry Andric
84250b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_8 :
84260b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
84270b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84280b57cec5SDimitry Andric                    pred:$p)>;
84290b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_16 :
84300b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84310b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84320b57cec5SDimitry Andric                    pred:$p)>;
84330b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_32 :
84340b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84350b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84360b57cec5SDimitry Andric                    pred:$p)>;
84370b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_16 :
84380b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84390b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84400b57cec5SDimitry Andric                    pred:$p)>;
84410b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_32 :
84420b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84430b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84440b57cec5SDimitry Andric                    pred:$p)>;
84450b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_8 :
84460b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
84470b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84480b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84490b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_16 :
84500b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84510b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
84520b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84530b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_32 :
84540b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84550b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84560b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84570b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_16 :
84580b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84590b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
84600b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84610b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_32 :
84620b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84630b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84640b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84650b57cec5SDimitry Andric
84660b57cec5SDimitry Andric// VLD3 multiple structure pseudo-instructions. These need special handling for
84670b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
84680b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
84690b57cec5SDimitry Andricdef VLD3dAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84700b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84710b57cec5SDimitry Andricdef VLD3dAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84720b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84730b57cec5SDimitry Andricdef VLD3dAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84740b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84750b57cec5SDimitry Andricdef VLD3qAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
84760b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84770b57cec5SDimitry Andricdef VLD3qAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
84780b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84790b57cec5SDimitry Andricdef VLD3qAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
84800b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84810b57cec5SDimitry Andric
84820b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_8 :
84830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
84840b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84850b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_16 :
84860b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84870b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84880b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_32 :
84890b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84900b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84910b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_8 :
84920b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
84930b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84940b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_16 :
84950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
84960b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84970b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_32 :
84980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84990b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85000b57cec5SDimitry Andricdef VLD3dWB_register_Asm_8 :
85010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
85020b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85030b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85040b57cec5SDimitry Andricdef VLD3dWB_register_Asm_16 :
85050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
85060b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85070b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85080b57cec5SDimitry Andricdef VLD3dWB_register_Asm_32 :
85090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
85100b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85110b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85120b57cec5SDimitry Andricdef VLD3qWB_register_Asm_8 :
85130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
85140b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85150b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85160b57cec5SDimitry Andricdef VLD3qWB_register_Asm_16 :
85170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
85180b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85190b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85200b57cec5SDimitry Andricdef VLD3qWB_register_Asm_32 :
85210b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
85220b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85230b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85240b57cec5SDimitry Andric
85250b57cec5SDimitry Andric// VST3 single-lane pseudo-instructions. These need special handling for
85260b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
85270b57cec5SDimitry Andricdef VST3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
85280b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85290b57cec5SDimitry Andric                    pred:$p)>;
85300b57cec5SDimitry Andricdef VST3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85310b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
85320b57cec5SDimitry Andric                    pred:$p)>;
85330b57cec5SDimitry Andricdef VST3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85340b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85350b57cec5SDimitry Andric                    pred:$p)>;
85360b57cec5SDimitry Andricdef VST3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85370b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
85380b57cec5SDimitry Andric                    pred:$p)>;
85390b57cec5SDimitry Andricdef VST3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85400b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85410b57cec5SDimitry Andric                    pred:$p)>;
85420b57cec5SDimitry Andric
85430b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_8 :
85440b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
85450b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85460b57cec5SDimitry Andric                    pred:$p)>;
85470b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_16 :
85480b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85490b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
85500b57cec5SDimitry Andric                    pred:$p)>;
85510b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_32 :
85520b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85530b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85540b57cec5SDimitry Andric                    pred:$p)>;
85550b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_16 :
85560b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85570b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
85580b57cec5SDimitry Andric                    pred:$p)>;
85590b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_32 :
85600b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85610b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85620b57cec5SDimitry Andric                    pred:$p)>;
85630b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_8 :
85640b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
85650b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
85660b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85670b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_16 :
85680b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85690b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
85700b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
85710b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_32 :
85720b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85730b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
85740b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85750b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_16 :
85760b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85770b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
85780b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
85790b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_32 :
85800b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85810b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
85820b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85830b57cec5SDimitry Andric
85840b57cec5SDimitry Andric
85850b57cec5SDimitry Andric// VST3 multiple structure pseudo-instructions. These need special handling for
85860b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
85870b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
85880b57cec5SDimitry Andricdef VST3dAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
85890b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85900b57cec5SDimitry Andricdef VST3dAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85910b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85920b57cec5SDimitry Andricdef VST3dAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85930b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85940b57cec5SDimitry Andricdef VST3qAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
85950b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85960b57cec5SDimitry Andricdef VST3qAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
85970b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85980b57cec5SDimitry Andricdef VST3qAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85990b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86000b57cec5SDimitry Andric
86010b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_8 :
86020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
86030b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86040b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_16 :
86050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
86060b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86070b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_32 :
86080b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
86090b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
86100b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_8 :
86110b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
86120b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86130b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_16 :
86140b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
86150b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86160b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_32 :
86170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
86180b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
86190b57cec5SDimitry Andricdef VST3dWB_register_Asm_8 :
86200b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
86210b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86220b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86230b57cec5SDimitry Andricdef VST3dWB_register_Asm_16 :
86240b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
86250b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86260b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86270b57cec5SDimitry Andricdef VST3dWB_register_Asm_32 :
86280b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
86290b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
86300b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86310b57cec5SDimitry Andricdef VST3qWB_register_Asm_8 :
86320b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
86330b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86340b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86350b57cec5SDimitry Andricdef VST3qWB_register_Asm_16 :
86360b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
86370b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86380b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86390b57cec5SDimitry Andricdef VST3qWB_register_Asm_32 :
86400b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
86410b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
86420b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86430b57cec5SDimitry Andric
86440b57cec5SDimitry Andric// VLD4 all-lanes pseudo-instructions. These need special handling for
86450b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
86460b57cec5SDimitry Andricdef VLD4DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86470b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
86480b57cec5SDimitry Andric                    pred:$p)>;
86490b57cec5SDimitry Andricdef VLD4DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86500b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
86510b57cec5SDimitry Andric                    pred:$p)>;
86520b57cec5SDimitry Andricdef VLD4DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86530b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
86540b57cec5SDimitry Andric                    pred:$p)>;
86550b57cec5SDimitry Andricdef VLD4DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86560b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
86570b57cec5SDimitry Andric                    pred:$p)>;
86580b57cec5SDimitry Andricdef VLD4DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86590b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
86600b57cec5SDimitry Andric                    pred:$p)>;
86610b57cec5SDimitry Andricdef VLD4DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86620b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
86630b57cec5SDimitry Andric                    pred:$p)>;
86640b57cec5SDimitry Andric
86650b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_8 :
86660b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
86670b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
86680b57cec5SDimitry Andric                    pred:$p)>;
86690b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_16 :
86700b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86710b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
86720b57cec5SDimitry Andric                    pred:$p)>;
86730b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_32 :
86740b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
86750b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
86760b57cec5SDimitry Andric                    pred:$p)>;
86770b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_8 :
86780b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
86790b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
86800b57cec5SDimitry Andric                    pred:$p)>;
86810b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_16 :
86820b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86830b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
86840b57cec5SDimitry Andric                    pred:$p)>;
86850b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_32 :
86860b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
86870b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
86880b57cec5SDimitry Andric                    pred:$p)>;
86890b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_8 :
86900b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
86910b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
86920b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86930b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_16 :
86940b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
86950b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
86960b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86970b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_32 :
86980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
86990b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list,
87000b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
87010b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_8 :
87020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87030b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
87040b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87050b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_16 :
87060b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87070b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
87080b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87090b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_32 :
87100b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87110b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list,
87120b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
87130b57cec5SDimitry Andric
87140b57cec5SDimitry Andric
87150b57cec5SDimitry Andric// VLD4 single-lane pseudo-instructions. These need special handling for
87160b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
87170b57cec5SDimitry Andricdef VLD4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
87180b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87190b57cec5SDimitry Andric                    pred:$p)>;
87200b57cec5SDimitry Andricdef VLD4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87210b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87220b57cec5SDimitry Andric                    pred:$p)>;
87230b57cec5SDimitry Andricdef VLD4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87240b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87250b57cec5SDimitry Andric                    pred:$p)>;
87260b57cec5SDimitry Andricdef VLD4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87270b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87280b57cec5SDimitry Andric                    pred:$p)>;
87290b57cec5SDimitry Andricdef VLD4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87300b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87310b57cec5SDimitry Andric                    pred:$p)>;
87320b57cec5SDimitry Andric
87330b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_8 :
87340b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
87350b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87360b57cec5SDimitry Andric                    pred:$p)>;
87370b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_16 :
87380b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87390b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87400b57cec5SDimitry Andric                    pred:$p)>;
87410b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_32 :
87420b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87430b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87440b57cec5SDimitry Andric                    pred:$p)>;
87450b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_16 :
87460b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87470b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87480b57cec5SDimitry Andric                    pred:$p)>;
87490b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_32 :
87500b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87510b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87520b57cec5SDimitry Andric                    pred:$p)>;
87530b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_8 :
87540b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87550b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87560b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87570b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_16 :
87580b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87590b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87600b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87610b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_32 :
87620b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87630b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
87640b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
87650b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_16 :
87660b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87670b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87680b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87690b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_32 :
87700b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87710b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
87720b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
87730b57cec5SDimitry Andric
87740b57cec5SDimitry Andric
87750b57cec5SDimitry Andric
87760b57cec5SDimitry Andric// VLD4 multiple structure pseudo-instructions. These need special handling for
87770b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
87780b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
87790b57cec5SDimitry Andricdef VLD4dAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
87800b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87810b57cec5SDimitry Andric                pred:$p)>;
87820b57cec5SDimitry Andricdef VLD4dAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87830b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87840b57cec5SDimitry Andric                pred:$p)>;
87850b57cec5SDimitry Andricdef VLD4dAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87860b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87870b57cec5SDimitry Andric                pred:$p)>;
87880b57cec5SDimitry Andricdef VLD4qAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
87890b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87900b57cec5SDimitry Andric                pred:$p)>;
87910b57cec5SDimitry Andricdef VLD4qAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
87920b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87930b57cec5SDimitry Andric                pred:$p)>;
87940b57cec5SDimitry Andricdef VLD4qAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
87950b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87960b57cec5SDimitry Andric                pred:$p)>;
87970b57cec5SDimitry Andric
87980b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_8 :
87990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
88000b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88010b57cec5SDimitry Andric                pred:$p)>;
88020b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_16 :
88030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
88040b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88050b57cec5SDimitry Andric                pred:$p)>;
88060b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_32 :
88070b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
88080b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88090b57cec5SDimitry Andric                pred:$p)>;
88100b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_8 :
88110b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
88120b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88130b57cec5SDimitry Andric                pred:$p)>;
88140b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_16 :
88150b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
88160b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88170b57cec5SDimitry Andric                pred:$p)>;
88180b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_32 :
88190b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
88200b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88210b57cec5SDimitry Andric                pred:$p)>;
88220b57cec5SDimitry Andricdef VLD4dWB_register_Asm_8 :
88230b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
88240b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88250b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88260b57cec5SDimitry Andricdef VLD4dWB_register_Asm_16 :
88270b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
88280b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88290b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88300b57cec5SDimitry Andricdef VLD4dWB_register_Asm_32 :
88310b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
88320b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88330b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88340b57cec5SDimitry Andricdef VLD4qWB_register_Asm_8 :
88350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
88360b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88370b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88380b57cec5SDimitry Andricdef VLD4qWB_register_Asm_16 :
88390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
88400b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88410b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88420b57cec5SDimitry Andricdef VLD4qWB_register_Asm_32 :
88430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
88440b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88450b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88460b57cec5SDimitry Andric
88470b57cec5SDimitry Andric// VST4 single-lane pseudo-instructions. These need special handling for
88480b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
88490b57cec5SDimitry Andricdef VST4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
88500b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
88510b57cec5SDimitry Andric                    pred:$p)>;
88520b57cec5SDimitry Andricdef VST4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88530b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
88540b57cec5SDimitry Andric                    pred:$p)>;
88550b57cec5SDimitry Andricdef VST4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88560b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
88570b57cec5SDimitry Andric                    pred:$p)>;
88580b57cec5SDimitry Andricdef VST4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88590b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
88600b57cec5SDimitry Andric                    pred:$p)>;
88610b57cec5SDimitry Andricdef VST4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88620b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
88630b57cec5SDimitry Andric                    pred:$p)>;
88640b57cec5SDimitry Andric
88650b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_8 :
88660b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
88670b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
88680b57cec5SDimitry Andric                    pred:$p)>;
88690b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_16 :
88700b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88710b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
88720b57cec5SDimitry Andric                    pred:$p)>;
88730b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_32 :
88740b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88750b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
88760b57cec5SDimitry Andric                    pred:$p)>;
88770b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_16 :
88780b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88790b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
88800b57cec5SDimitry Andric                    pred:$p)>;
88810b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_32 :
88820b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88830b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
88840b57cec5SDimitry Andric                    pred:$p)>;
88850b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_8 :
88860b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
88870b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
88880b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88890b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_16 :
88900b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
88910b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
88920b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88930b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_32 :
88940b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
88950b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
88960b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
88970b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_16 :
88980b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
88990b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
89000b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89010b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_32 :
89020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89030b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
89040b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
89050b57cec5SDimitry Andric
89060b57cec5SDimitry Andric
89070b57cec5SDimitry Andric// VST4 multiple structure pseudo-instructions. These need special handling for
89080b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
89090b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
89100b57cec5SDimitry Andricdef VST4dAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
89110b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89120b57cec5SDimitry Andric                    pred:$p)>;
89130b57cec5SDimitry Andricdef VST4dAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
89140b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89150b57cec5SDimitry Andric                    pred:$p)>;
89160b57cec5SDimitry Andricdef VST4dAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
89170b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89180b57cec5SDimitry Andric                    pred:$p)>;
89190b57cec5SDimitry Andricdef VST4qAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
89200b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89210b57cec5SDimitry Andric                    pred:$p)>;
89220b57cec5SDimitry Andricdef VST4qAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
89230b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89240b57cec5SDimitry Andric                    pred:$p)>;
89250b57cec5SDimitry Andricdef VST4qAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
89260b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89270b57cec5SDimitry Andric                    pred:$p)>;
89280b57cec5SDimitry Andric
89290b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_8 :
89300b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
89310b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89320b57cec5SDimitry Andric                    pred:$p)>;
89330b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_16 :
89340b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
89350b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89360b57cec5SDimitry Andric                    pred:$p)>;
89370b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_32 :
89380b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
89390b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89400b57cec5SDimitry Andric                    pred:$p)>;
89410b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_8 :
89420b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
89430b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89440b57cec5SDimitry Andric                    pred:$p)>;
89450b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_16 :
89460b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
89470b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89480b57cec5SDimitry Andric                    pred:$p)>;
89490b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_32 :
89500b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
89510b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89520b57cec5SDimitry Andric                    pred:$p)>;
89530b57cec5SDimitry Andricdef VST4dWB_register_Asm_8 :
89540b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
89550b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89560b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89570b57cec5SDimitry Andricdef VST4dWB_register_Asm_16 :
89580b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89590b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89600b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89610b57cec5SDimitry Andricdef VST4dWB_register_Asm_32 :
89620b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89630b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
89640b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89650b57cec5SDimitry Andricdef VST4qWB_register_Asm_8 :
89660b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
89670b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89680b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89690b57cec5SDimitry Andricdef VST4qWB_register_Asm_16 :
89700b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
89710b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89720b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89730b57cec5SDimitry Andricdef VST4qWB_register_Asm_32 :
89740b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
89750b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
89760b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
89770b57cec5SDimitry Andric
89780b57cec5SDimitry Andric// VMOV/VMVN takes an optional datatype suffix
89790b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
89800b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
89810b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
89820b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
89830b57cec5SDimitry Andric
89840b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
89850b57cec5SDimitry Andric                         (VMVNd DPR:$Vd, DPR:$Vm, pred:$p)>;
89860b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
89870b57cec5SDimitry Andric                         (VMVNq QPR:$Vd, QPR:$Vm, pred:$p)>;
89880b57cec5SDimitry Andric
89890b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
89900b57cec5SDimitry Andric// D-register versions.
89910b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Dd, $Dn, $Dm",
89920b57cec5SDimitry Andric                    (VCGEsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89930b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Dd, $Dn, $Dm",
89940b57cec5SDimitry Andric                    (VCGEsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89950b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Dd, $Dn, $Dm",
89960b57cec5SDimitry Andric                    (VCGEsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89970b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Dd, $Dn, $Dm",
89980b57cec5SDimitry Andric                    (VCGEuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89990b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Dd, $Dn, $Dm",
90000b57cec5SDimitry Andric                    (VCGEuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90010b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Dd, $Dn, $Dm",
90020b57cec5SDimitry Andric                    (VCGEuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90030b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Dd, $Dn, $Dm",
90040b57cec5SDimitry Andric                    (VCGEfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90050b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90060b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Dd, $Dn, $Dm",
90070b57cec5SDimitry Andric                    (VCGEhd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90080b57cec5SDimitry Andric// Q-register versions.
90090b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Qd, $Qn, $Qm",
90100b57cec5SDimitry Andric                    (VCGEsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90110b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Qd, $Qn, $Qm",
90120b57cec5SDimitry Andric                    (VCGEsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90130b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Qd, $Qn, $Qm",
90140b57cec5SDimitry Andric                    (VCGEsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90150b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Qd, $Qn, $Qm",
90160b57cec5SDimitry Andric                    (VCGEuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90170b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Qd, $Qn, $Qm",
90180b57cec5SDimitry Andric                    (VCGEuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90190b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Qd, $Qn, $Qm",
90200b57cec5SDimitry Andric                    (VCGEuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90210b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Qd, $Qn, $Qm",
90220b57cec5SDimitry Andric                    (VCGEfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90230b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90240b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Qd, $Qn, $Qm",
90250b57cec5SDimitry Andric                    (VCGEhq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90260b57cec5SDimitry Andric
90270b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
90280b57cec5SDimitry Andric// D-register versions.
90290b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Dd, $Dn, $Dm",
90300b57cec5SDimitry Andric                    (VCGTsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90310b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Dd, $Dn, $Dm",
90320b57cec5SDimitry Andric                    (VCGTsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90330b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Dd, $Dn, $Dm",
90340b57cec5SDimitry Andric                    (VCGTsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90350b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Dd, $Dn, $Dm",
90360b57cec5SDimitry Andric                    (VCGTuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90370b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Dd, $Dn, $Dm",
90380b57cec5SDimitry Andric                    (VCGTuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90390b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Dd, $Dn, $Dm",
90400b57cec5SDimitry Andric                    (VCGTuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90410b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Dd, $Dn, $Dm",
90420b57cec5SDimitry Andric                    (VCGTfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90430b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90440b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Dd, $Dn, $Dm",
90450b57cec5SDimitry Andric                    (VCGThd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
90460b57cec5SDimitry Andric// Q-register versions.
90470b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Qd, $Qn, $Qm",
90480b57cec5SDimitry Andric                    (VCGTsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90490b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Qd, $Qn, $Qm",
90500b57cec5SDimitry Andric                    (VCGTsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90510b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Qd, $Qn, $Qm",
90520b57cec5SDimitry Andric                    (VCGTsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90530b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Qd, $Qn, $Qm",
90540b57cec5SDimitry Andric                    (VCGTuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90550b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Qd, $Qn, $Qm",
90560b57cec5SDimitry Andric                    (VCGTuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90570b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Qd, $Qn, $Qm",
90580b57cec5SDimitry Andric                    (VCGTuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90590b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Qd, $Qn, $Qm",
90600b57cec5SDimitry Andric                    (VCGTfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90610b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
90620b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Qd, $Qn, $Qm",
90630b57cec5SDimitry Andric                    (VCGThq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
90640b57cec5SDimitry Andric
90650b57cec5SDimitry Andric// VSWP allows, but does not require, a type suffix.
90660b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
90670b57cec5SDimitry Andric                         (VSWPd DPR:$Vd, DPR:$Vm, pred:$p)>;
90680b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
90690b57cec5SDimitry Andric                         (VSWPq QPR:$Vd, QPR:$Vm, pred:$p)>;
90700b57cec5SDimitry Andric
90710b57cec5SDimitry Andric// VBIF, VBIT, and VBSL allow, but do not require, a type suffix.
90720b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
90730b57cec5SDimitry Andric                         (VBIFd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90740b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
90750b57cec5SDimitry Andric                         (VBITd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90760b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
90770b57cec5SDimitry Andric                         (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
90780b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
90790b57cec5SDimitry Andric                         (VBIFq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90800b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
90810b57cec5SDimitry Andric                         (VBITq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90820b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
90830b57cec5SDimitry Andric                         (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
90840b57cec5SDimitry Andric
90850b57cec5SDimitry Andric// "vmov Rd, #-imm" can be handled via "vmvn".
90860b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
90870b57cec5SDimitry Andric                    (VMVNv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
90880b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
90890b57cec5SDimitry Andric                    (VMVNv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
90900b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
90910b57cec5SDimitry Andric                    (VMOVv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
90920b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
90930b57cec5SDimitry Andric                    (VMOVv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
90940b57cec5SDimitry Andric
90950b57cec5SDimitry Andric// 'gas' compatibility aliases for quad-word instructions. Strictly speaking,
90960b57cec5SDimitry Andric// these should restrict to just the Q register variants, but the register
90970b57cec5SDimitry Andric// classes are enough to match correctly regardless, so we keep it simple
90980b57cec5SDimitry Andric// and just use MnemonicAlias.
90990b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vbicq", "vbic">;
91000b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vandq", "vand">;
91010b57cec5SDimitry Andricdef : NEONMnemonicAlias<"veorq", "veor">;
91020b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vorrq", "vorr">;
91030b57cec5SDimitry Andric
91040b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq", "vmov">;
91050b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmvnq", "vmvn">;
91060b57cec5SDimitry Andric// Explicit versions for floating point so that the FPImm variants get
91070b57cec5SDimitry Andric// handled early. The parser gets confused otherwise.
91080b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f32", "vmov.f32">;
91090b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f64", "vmov.f64">;
91100b57cec5SDimitry Andric
91110b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vaddq", "vadd">;
91120b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vsubq", "vsub">;
91130b57cec5SDimitry Andric
91140b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vminq", "vmin">;
91150b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmaxq", "vmax">;
91160b57cec5SDimitry Andric
91170b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmulq", "vmul">;
91180b57cec5SDimitry Andric
91190b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vabsq", "vabs">;
91200b57cec5SDimitry Andric
91210b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshlq", "vshl">;
91220b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshrq", "vshr">;
91230b57cec5SDimitry Andric
91240b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcvtq", "vcvt">;
91250b57cec5SDimitry Andric
91260b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcleq", "vcle">;
91270b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vceqq", "vceq">;
91280b57cec5SDimitry Andric
91290b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vzipq", "vzip">;
91300b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vswpq", "vswp">;
91310b57cec5SDimitry Andric
91320b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.f32", "vrecpe.f32">;
91330b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.u32", "vrecpe.u32">;
91340b57cec5SDimitry Andric
91350b57cec5SDimitry Andric
91360b57cec5SDimitry Andric// Alias for loading floating point immediates that aren't representable
91370b57cec5SDimitry Andric// using the vmov.f32 encoding but the bitpattern is representable using
91380b57cec5SDimitry Andric// the .i32 encoding.
91390b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
91400b57cec5SDimitry Andric                     (VMOVv4i32 QPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
91410b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
91420b57cec5SDimitry Andric                     (VMOVv2i32 DPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
91435ffd83dbSDimitry Andric
91445ffd83dbSDimitry Andric// ARMv8.6a BFloat16 instructions.
91455ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
91465ffd83dbSDimitry Andricclass BF16VDOT<bits<5> op27_23, bits<2> op21_20, bit op6,
91475ffd83dbSDimitry Andric               dag oops, dag iops, list<dag> pattern>
91485ffd83dbSDimitry Andric   : N3Vnp<op27_23, op21_20, 0b1101, op6, 0, oops, iops,
91495ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "", pattern>
91505ffd83dbSDimitry Andric{
91515ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91525ffd83dbSDimitry Andric}
91535ffd83dbSDimitry Andric
91545ffd83dbSDimitry Andricclass BF16VDOTS<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy, ValueType InputTy>
91555ffd83dbSDimitry Andric   : BF16VDOT<0b11000, 0b00,  Q, (outs RegTy:$dst),
91565ffd83dbSDimitry Andric              (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
91575ffd83dbSDimitry Andric            [(set (AccumTy RegTy:$dst),
91585ffd83dbSDimitry Andric                  (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
91595ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vn),
91605ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vm)))]> {
91615ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
91625ffd83dbSDimitry Andric  let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
91635ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91645ffd83dbSDimitry Andric}
91655ffd83dbSDimitry Andric
91665ffd83dbSDimitry Andricmulticlass BF16VDOTI<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy,
91675ffd83dbSDimitry Andric                     ValueType InputTy, dag RHS> {
91685ffd83dbSDimitry Andric
91695ffd83dbSDimitry Andric  def "" : BF16VDOT<0b11100, 0b00, Q, (outs RegTy:$dst),
91705ffd83dbSDimitry Andric                    (ins RegTy:$Vd, RegTy:$Vn,
91715ffd83dbSDimitry Andric                    DPR_VFP2:$Vm, VectorIndex32:$lane), []> {
91725ffd83dbSDimitry Andric    bit lane;
91735ffd83dbSDimitry Andric    let Inst{5} = lane;
91745ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
91755ffd83dbSDimitry Andric    let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm$lane");
91765ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
91775ffd83dbSDimitry Andric  }
91785ffd83dbSDimitry Andric
91795ffd83dbSDimitry Andric  def : Pat<
91805ffd83dbSDimitry Andric    (AccumTy (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
91815ffd83dbSDimitry Andric                                 (InputTy RegTy:$Vn),
91825ffd83dbSDimitry Andric                                 (InputTy (bitconvert (AccumTy
91835ffd83dbSDimitry Andric                                          (ARMvduplane (AccumTy RegTy:$Vm),
91845ffd83dbSDimitry Andric                                                        VectorIndex32:$lane)))))),
91855ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
91865ffd83dbSDimitry Andric}
91875ffd83dbSDimitry Andric
9188e8d8bef9SDimitry Andricdef BF16VDOTS_VDOTD : BF16VDOTS<0, DPR, "vdot", v2f32, v4bf16>;
9189e8d8bef9SDimitry Andricdef BF16VDOTS_VDOTQ : BF16VDOTS<1, QPR, "vdot", v4f32, v8bf16>;
91905ffd83dbSDimitry Andric
9191e8d8bef9SDimitry Andricdefm BF16VDOTI_VDOTD : BF16VDOTI<0, DPR, "vdot", v2f32, v4bf16, (v2f32 DPR_VFP2:$Vm)>;
9192e8d8bef9SDimitry Andricdefm BF16VDOTI_VDOTQ : BF16VDOTI<1, QPR, "vdot", v4f32, v8bf16, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
91935ffd83dbSDimitry Andric
91945ffd83dbSDimitry Andricclass BF16MM<bit Q, RegisterClass RegTy,
91955ffd83dbSDimitry Andric             string opc>
91965ffd83dbSDimitry Andric   : N3Vnp<0b11000, 0b00, 0b1100, Q, 0,
91975ffd83dbSDimitry Andric           (outs RegTy:$dst), (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
91985ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "",
91995ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst), (int_arm_neon_bfmmla (v4f32 QPR:$Vd),
9200e8d8bef9SDimitry Andric                                                (v8bf16 QPR:$Vn),
9201e8d8bef9SDimitry Andric                                                (v8bf16 QPR:$Vm)))]> {
92025ffd83dbSDimitry Andric   let Constraints = "$dst = $Vd";
92035ffd83dbSDimitry Andric   let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
92045ffd83dbSDimitry Andric   let DecoderNamespace = "VFPV8";
92055ffd83dbSDimitry Andric}
92065ffd83dbSDimitry Andric
92075ffd83dbSDimitry Andricdef VMMLA : BF16MM<1, QPR, "vmmla">;
92085ffd83dbSDimitry Andric
92095ffd83dbSDimitry Andricclass VBF16MALQ<bit T, string suffix, SDPatternOperator OpNode>
92105ffd83dbSDimitry Andric  : N3VCP8<0b00, 0b11, T, 1,
92115ffd83dbSDimitry Andric           (outs QPR:$dst), (ins QPR:$Vd, QPR:$Vn, QPR:$Vm),
92125ffd83dbSDimitry Andric           NoItinerary, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm", "",
92135ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst),
92145ffd83dbSDimitry Andric                      (OpNode (v4f32 QPR:$Vd),
9215e8d8bef9SDimitry Andric                              (v8bf16 QPR:$Vn),
9216e8d8bef9SDimitry Andric                              (v8bf16 QPR:$Vm)))]> {
92175ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
92185ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
92195ffd83dbSDimitry Andric}
92205ffd83dbSDimitry Andric
92215ffd83dbSDimitry Andricdef VBF16MALTQ: VBF16MALQ<1, "t", int_arm_neon_bfmlalt>;
92225ffd83dbSDimitry Andricdef VBF16MALBQ: VBF16MALQ<0, "b", int_arm_neon_bfmlalb>;
92235ffd83dbSDimitry Andric
92245ffd83dbSDimitry Andricmulticlass VBF16MALQI<bit T, string suffix, SDPatternOperator OpNode> {
92255ffd83dbSDimitry Andric  def "" : N3VLaneCP8<0, 0b11, T, 1, (outs QPR:$dst),
92265ffd83dbSDimitry Andric              (ins QPR:$Vd, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
92275ffd83dbSDimitry Andric               IIC_VMACD, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm$idx", "", []> {
92285ffd83dbSDimitry Andric  bits<2> idx;
92295ffd83dbSDimitry Andric  let Inst{5} = idx{1};
92305ffd83dbSDimitry Andric  let Inst{3} = idx{0};
92315ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
92325ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
92335ffd83dbSDimitry Andric  }
92345ffd83dbSDimitry Andric
92355ffd83dbSDimitry Andric  def : Pat<
92365ffd83dbSDimitry Andric    (v4f32 (OpNode (v4f32 QPR:$Vd),
9237e8d8bef9SDimitry Andric                   (v8bf16 QPR:$Vn),
9238e8d8bef9SDimitry Andric                   (v8bf16 (ARMvduplane (v8bf16 QPR:$Vm),
9239e8d8bef9SDimitry Andric                            VectorIndex16:$lane)))),
92405ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) QPR:$Vd,
92415ffd83dbSDimitry Andric                              QPR:$Vn,
92425ffd83dbSDimitry Andric                              (EXTRACT_SUBREG QPR:$Vm,
92435ffd83dbSDimitry Andric                                (DSubReg_i16_reg VectorIndex16:$lane)),
92445ffd83dbSDimitry Andric                              (SubReg_i16_lane VectorIndex16:$lane))>;
92455ffd83dbSDimitry Andric}
92465ffd83dbSDimitry Andric
92475ffd83dbSDimitry Andricdefm VBF16MALTQI: VBF16MALQI<1, "t", int_arm_neon_bfmlalt>;
92485ffd83dbSDimitry Andricdefm VBF16MALBQI: VBF16MALQI<0, "b", int_arm_neon_bfmlalb>;
92495ffd83dbSDimitry Andric
92505ffd83dbSDimitry Andricdef BF16_VCVT :  N2V<0b11, 0b11, 0b01, 0b10, 0b01100, 1, 0,
92515ffd83dbSDimitry Andric                    (outs DPR:$Vd), (ins QPR:$Vm),
92525ffd83dbSDimitry Andric                    NoItinerary, "vcvt", "bf16.f32", "$Vd, $Vm", "", []>;
92535ffd83dbSDimitry Andric}
92545ffd83dbSDimitry Andric// End of BFloat16 instructions
9255