xref: /freebsd/contrib/llvm-project/llvm/lib/Target/ARM/ARMInstrNEON.td (revision 5ffd83dbcc34f10e07f6d3e968ae6365869615f4)
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
5120b57cec5SDimitry Andricdef NEONvbsl      : SDNode<"ARMISD::VBSL",
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 Andricdef NEONimmAllZerosV: PatLeaf<(ARMvmovImm (i32 timm)), [{
5380b57cec5SDimitry Andric  ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
5390b57cec5SDimitry Andric  unsigned EltBits = 0;
5408bcb0991SDimitry Andric  uint64_t EltVal = ARM_AM::decodeVMOVModImm(ConstVal->getZExtValue(), EltBits);
5410b57cec5SDimitry Andric  return (EltBits == 32 && EltVal == 0);
5420b57cec5SDimitry Andric}]>;
5430b57cec5SDimitry Andric
5440b57cec5SDimitry Andricdef NEONimmAllOnesV: PatLeaf<(ARMvmovImm (i32 timm)), [{
5450b57cec5SDimitry Andric  ConstantSDNode *ConstVal = cast<ConstantSDNode>(N->getOperand(0));
5460b57cec5SDimitry Andric  unsigned EltBits = 0;
5478bcb0991SDimitry Andric  uint64_t EltVal = ARM_AM::decodeVMOVModImm(ConstVal->getZExtValue(), EltBits);
5480b57cec5SDimitry Andric  return (EltBits == 8 && EltVal == 0xff);
5490b57cec5SDimitry Andric}]>;
5500b57cec5SDimitry Andric
5510b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5520b57cec5SDimitry Andric// NEON load / store instructions
5530b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
5540b57cec5SDimitry Andric
5550b57cec5SDimitry Andric// Use VLDM to load a Q register as a D register pair.
5560b57cec5SDimitry Andric// This is a pseudo instruction that is expanded to VLDMD after reg alloc.
5570b57cec5SDimitry Andricdef VLDMQIA
5580b57cec5SDimitry Andric  : PseudoVFPLdStM<(outs DPair:$dst), (ins GPR:$Rn),
5590b57cec5SDimitry Andric                    IIC_fpLoad_m, "",
5600b57cec5SDimitry Andric                   [(set DPair:$dst, (v2f64 (word_alignedload GPR:$Rn)))]>;
5610b57cec5SDimitry Andric
5620b57cec5SDimitry Andric// Use VSTM to store a Q register as a D register pair.
5630b57cec5SDimitry Andric// This is a pseudo instruction that is expanded to VSTMD after reg alloc.
5640b57cec5SDimitry Andricdef VSTMQIA
5650b57cec5SDimitry Andric  : PseudoVFPLdStM<(outs), (ins DPair:$src, GPR:$Rn),
5660b57cec5SDimitry Andric                    IIC_fpStore_m, "",
5670b57cec5SDimitry Andric                   [(word_alignedstore (v2f64 DPair:$src), GPR:$Rn)]>;
5680b57cec5SDimitry Andric
5690b57cec5SDimitry Andric// Classes for VLD* pseudo-instructions with multi-register operands.
5700b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
5710b57cec5SDimitry Andricclass VLDQPseudo<InstrItinClass itin>
5720b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst), (ins addrmode6:$addr), itin, "">;
5730b57cec5SDimitry Andricclass VLDQWBPseudo<InstrItinClass itin>
5740b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5750b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset), itin,
5760b57cec5SDimitry Andric                "$addr.addr = $wb">;
5770b57cec5SDimitry Andricclass VLDQWBfixedPseudo<InstrItinClass itin>
5780b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5790b57cec5SDimitry Andric                (ins addrmode6:$addr), itin,
5800b57cec5SDimitry Andric                "$addr.addr = $wb">;
5810b57cec5SDimitry Andricclass VLDQWBregisterPseudo<InstrItinClass itin>
5820b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
5830b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset), itin,
5840b57cec5SDimitry Andric                "$addr.addr = $wb">;
5850b57cec5SDimitry Andric
5860b57cec5SDimitry Andricclass VLDQQPseudo<InstrItinClass itin>
5870b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst), (ins addrmode6:$addr), itin, "">;
5880b57cec5SDimitry Andricclass VLDQQWBPseudo<InstrItinClass itin>
5890b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5900b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset), itin,
5910b57cec5SDimitry Andric                "$addr.addr = $wb">;
5920b57cec5SDimitry Andricclass VLDQQWBfixedPseudo<InstrItinClass itin>
5930b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5940b57cec5SDimitry Andric                (ins addrmode6:$addr), itin,
5950b57cec5SDimitry Andric                "$addr.addr = $wb">;
5960b57cec5SDimitry Andricclass VLDQQWBregisterPseudo<InstrItinClass itin>
5970b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
5980b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset), itin,
5990b57cec5SDimitry Andric                "$addr.addr = $wb">;
6000b57cec5SDimitry Andric
6010b57cec5SDimitry Andric
6020b57cec5SDimitry Andricclass VLDQQQQPseudo<InstrItinClass itin>
6030b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst), (ins addrmode6:$addr, QQQQPR:$src),itin,
6040b57cec5SDimitry Andric                "$src = $dst">;
6050b57cec5SDimitry Andricclass VLDQQQQWBPseudo<InstrItinClass itin>
6060b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
6070b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
6080b57cec5SDimitry Andric                "$addr.addr = $wb, $src = $dst">;
6090b57cec5SDimitry Andric
6100b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
6110b57cec5SDimitry Andric
6120b57cec5SDimitry Andric//   VLD1     : Vector Load (multiple single elements)
6130b57cec5SDimitry Andricclass VLD1D<bits<4> op7_4, string Dt, Operand AddrMode>
6140b57cec5SDimitry Andric  : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd),
6150b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1,
6160b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD1]> {
6170b57cec5SDimitry Andric  let Rm = 0b1111;
6180b57cec5SDimitry Andric  let Inst{4} = Rn{4};
6190b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6200b57cec5SDimitry Andric}
6210b57cec5SDimitry Andricclass VLD1Q<bits<4> op7_4, string Dt, Operand AddrMode>
6220b57cec5SDimitry Andric  : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd),
6230b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x2,
6240b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVLD2]> {
6250b57cec5SDimitry Andric  let Rm = 0b1111;
6260b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
6270b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6280b57cec5SDimitry Andric}
6290b57cec5SDimitry Andric
6300b57cec5SDimitry Andricdef  VLD1d8   : VLD1D<{0,0,0,?}, "8",  addrmode6align64>;
6310b57cec5SDimitry Andricdef  VLD1d16  : VLD1D<{0,1,0,?}, "16", addrmode6align64>;
6320b57cec5SDimitry Andricdef  VLD1d32  : VLD1D<{1,0,0,?}, "32", addrmode6align64>;
6330b57cec5SDimitry Andricdef  VLD1d64  : VLD1D<{1,1,0,?}, "64", addrmode6align64>;
6340b57cec5SDimitry Andric
6350b57cec5SDimitry Andricdef  VLD1q8   : VLD1Q<{0,0,?,?}, "8",  addrmode6align64or128>;
6360b57cec5SDimitry Andricdef  VLD1q16  : VLD1Q<{0,1,?,?}, "16", addrmode6align64or128>;
6370b57cec5SDimitry Andricdef  VLD1q32  : VLD1Q<{1,0,?,?}, "32", addrmode6align64or128>;
6380b57cec5SDimitry Andricdef  VLD1q64  : VLD1Q<{1,1,?,?}, "64", addrmode6align64or128>;
6390b57cec5SDimitry Andric
6400b57cec5SDimitry Andric// ...with address register writeback:
6410b57cec5SDimitry Andricmulticlass VLD1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
6420b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10, 0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
6430b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1u,
6440b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6450b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
6460b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
6470b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6480b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6490b57cec5SDimitry Andric  }
6500b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0111,op7_4, (outs VecListOneD:$Vd, GPR:$wb),
6510b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1u,
6520b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
6530b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
6540b57cec5SDimitry Andric    let Inst{4} = Rn{4};
6550b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6560b57cec5SDimitry Andric  }
6570b57cec5SDimitry Andric}
6580b57cec5SDimitry Andricmulticlass VLD1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
6590b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
6600b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
6610b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6620b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
6630b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
6640b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
6650b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6660b57cec5SDimitry Andric  }
6670b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b1010,op7_4, (outs VecListDPair:$Vd, GPR:$wb),
6680b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
6690b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
6700b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
6710b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
6720b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
6730b57cec5SDimitry Andric  }
6740b57cec5SDimitry Andric}
6750b57cec5SDimitry Andric
6760b57cec5SDimitry Andricdefm VLD1d8wb  : VLD1DWB<{0,0,0,?}, "8",  addrmode6align64>;
6770b57cec5SDimitry Andricdefm VLD1d16wb : VLD1DWB<{0,1,0,?}, "16", addrmode6align64>;
6780b57cec5SDimitry Andricdefm VLD1d32wb : VLD1DWB<{1,0,0,?}, "32", addrmode6align64>;
6790b57cec5SDimitry Andricdefm VLD1d64wb : VLD1DWB<{1,1,0,?}, "64", addrmode6align64>;
6800b57cec5SDimitry Andricdefm VLD1q8wb  : VLD1QWB<{0,0,?,?}, "8",  addrmode6align64or128>;
6810b57cec5SDimitry Andricdefm VLD1q16wb : VLD1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
6820b57cec5SDimitry Andricdefm VLD1q32wb : VLD1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
6830b57cec5SDimitry Andricdefm VLD1q64wb : VLD1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
6840b57cec5SDimitry Andric
6850b57cec5SDimitry Andric// ...with 3 registers
6860b57cec5SDimitry Andricclass VLD1D3<bits<4> op7_4, string Dt, Operand AddrMode>
6870b57cec5SDimitry Andric  : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd),
6880b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x3, "vld1", Dt,
6890b57cec5SDimitry Andric          "$Vd, $Rn", "", []>, Sched<[WriteVLD3]> {
6900b57cec5SDimitry Andric  let Rm = 0b1111;
6910b57cec5SDimitry Andric  let Inst{4} = Rn{4};
6920b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
6930b57cec5SDimitry Andric}
6940b57cec5SDimitry Andricmulticlass VLD1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
6950b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b0110, op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
6960b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
6970b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
6980b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
6990b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
7000b57cec5SDimitry Andric    let Inst{4} = Rn{4};
7010b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7020b57cec5SDimitry Andric  }
7030b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0110,op7_4, (outs VecListThreeD:$Vd, GPR:$wb),
7040b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
7050b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
7060b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
7070b57cec5SDimitry Andric    let Inst{4} = Rn{4};
7080b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7090b57cec5SDimitry Andric  }
7100b57cec5SDimitry Andric}
7110b57cec5SDimitry Andric
7120b57cec5SDimitry Andricdef VLD1d8T      : VLD1D3<{0,0,0,?}, "8",  addrmode6align64>;
7130b57cec5SDimitry Andricdef VLD1d16T     : VLD1D3<{0,1,0,?}, "16", addrmode6align64>;
7140b57cec5SDimitry Andricdef VLD1d32T     : VLD1D3<{1,0,0,?}, "32", addrmode6align64>;
7150b57cec5SDimitry Andricdef VLD1d64T     : VLD1D3<{1,1,0,?}, "64", addrmode6align64>;
7160b57cec5SDimitry Andric
7170b57cec5SDimitry Andricdefm VLD1d8Twb  : VLD1D3WB<{0,0,0,?}, "8",  addrmode6align64>;
7180b57cec5SDimitry Andricdefm VLD1d16Twb : VLD1D3WB<{0,1,0,?}, "16", addrmode6align64>;
7190b57cec5SDimitry Andricdefm VLD1d32Twb : VLD1D3WB<{1,0,0,?}, "32", addrmode6align64>;
7200b57cec5SDimitry Andricdefm VLD1d64Twb : VLD1D3WB<{1,1,0,?}, "64", addrmode6align64>;
7210b57cec5SDimitry Andric
7220b57cec5SDimitry Andricdef VLD1d8TPseudo  : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7230b57cec5SDimitry Andricdef VLD1d16TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7240b57cec5SDimitry Andricdef VLD1d32TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7250b57cec5SDimitry Andricdef VLD1d64TPseudo : VLDQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7260b57cec5SDimitry Andricdef VLD1d64TPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7270b57cec5SDimitry Andricdef VLD1d64TPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7280b57cec5SDimitry Andric
7290b57cec5SDimitry Andricdef VLD1q8HighTPseudo     : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7300b57cec5SDimitry Andricdef VLD1q8LowTPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7310b57cec5SDimitry Andricdef VLD1q16HighTPseudo    : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7320b57cec5SDimitry Andricdef VLD1q16LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7330b57cec5SDimitry Andricdef VLD1q32HighTPseudo    : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7340b57cec5SDimitry Andricdef VLD1q32LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7350b57cec5SDimitry Andricdef VLD1q64HighTPseudo    : VLDQQQQPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7360b57cec5SDimitry Andricdef VLD1q64LowTPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x3>, Sched<[WriteVLD3]>;
7370b57cec5SDimitry Andric
7380b57cec5SDimitry Andric// ...with 4 registers
7390b57cec5SDimitry Andricclass VLD1D4<bits<4> op7_4, string Dt, Operand AddrMode>
7400b57cec5SDimitry Andric  : NLdSt<0, 0b10, 0b0010, op7_4, (outs VecListFourD:$Vd),
7410b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1x4, "vld1", Dt,
7420b57cec5SDimitry Andric          "$Vd, $Rn", "", []>, Sched<[WriteVLD4]> {
7430b57cec5SDimitry Andric  let Rm = 0b1111;
7440b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
7450b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
7460b57cec5SDimitry Andric}
7470b57cec5SDimitry Andricmulticlass VLD1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
7480b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b10,0b0010, op7_4, (outs VecListFourD:$Vd, GPR:$wb),
7490b57cec5SDimitry Andric                    (ins AddrMode:$Rn), IIC_VLD1x2u,
7500b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
7510b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
7520b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
7530b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
7540b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7550b57cec5SDimitry Andric  }
7560b57cec5SDimitry Andric  def _register : NLdSt<0,0b10,0b0010,op7_4, (outs VecListFourD:$Vd, GPR:$wb),
7570b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1x2u,
7580b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
7590b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
7600b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
7610b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
7620b57cec5SDimitry Andric  }
7630b57cec5SDimitry Andric}
7640b57cec5SDimitry Andric
7650b57cec5SDimitry Andricdef VLD1d8Q      : VLD1D4<{0,0,?,?}, "8",  addrmode6align64or128or256>;
7660b57cec5SDimitry Andricdef VLD1d16Q     : VLD1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
7670b57cec5SDimitry Andricdef VLD1d32Q     : VLD1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
7680b57cec5SDimitry Andricdef VLD1d64Q     : VLD1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
7690b57cec5SDimitry Andric
7700b57cec5SDimitry Andricdefm VLD1d8Qwb   : VLD1D4WB<{0,0,?,?}, "8",  addrmode6align64or128or256>;
7710b57cec5SDimitry Andricdefm VLD1d16Qwb  : VLD1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
7720b57cec5SDimitry Andricdefm VLD1d32Qwb  : VLD1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
7730b57cec5SDimitry Andricdefm VLD1d64Qwb  : VLD1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
7740b57cec5SDimitry Andric
7750b57cec5SDimitry Andricdef VLD1d8QPseudo  : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7760b57cec5SDimitry Andricdef VLD1d16QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7770b57cec5SDimitry Andricdef VLD1d32QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7780b57cec5SDimitry Andricdef VLD1d64QPseudo : VLDQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7790b57cec5SDimitry Andricdef VLD1d64QPseudoWB_fixed : VLDQQWBfixedPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7800b57cec5SDimitry Andricdef VLD1d64QPseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7810b57cec5SDimitry Andric
7820b57cec5SDimitry Andricdef VLD1q8LowQPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7830b57cec5SDimitry Andricdef VLD1q8HighQPseudo     : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7840b57cec5SDimitry Andricdef VLD1q16LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7850b57cec5SDimitry Andricdef VLD1q16HighQPseudo    : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7860b57cec5SDimitry Andricdef VLD1q32LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7870b57cec5SDimitry Andricdef VLD1q32HighQPseudo    : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7880b57cec5SDimitry Andricdef VLD1q64LowQPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7890b57cec5SDimitry Andricdef VLD1q64HighQPseudo    : VLDQQQQPseudo<IIC_VLD1x4>, Sched<[WriteVLD4]>;
7900b57cec5SDimitry Andric
7910b57cec5SDimitry Andric//   VLD2     : Vector Load (multiple 2-element structures)
7920b57cec5SDimitry Andricclass VLD2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
7930b57cec5SDimitry Andric           InstrItinClass itin, Operand AddrMode>
7940b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd),
7950b57cec5SDimitry Andric          (ins AddrMode:$Rn), itin,
7960b57cec5SDimitry Andric          "vld2", Dt, "$Vd, $Rn", "", []> {
7970b57cec5SDimitry Andric  let Rm = 0b1111;
7980b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
7990b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST2Instruction";
8000b57cec5SDimitry Andric}
8010b57cec5SDimitry Andric
8020b57cec5SDimitry Andricdef  VLD2d8   : VLD2<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2,
8030b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8040b57cec5SDimitry Andricdef  VLD2d16  : VLD2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2,
8050b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8060b57cec5SDimitry Andricdef  VLD2d32  : VLD2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2,
8070b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVLD2]>;
8080b57cec5SDimitry Andric
8090b57cec5SDimitry Andricdef  VLD2q8   : VLD2<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2,
8100b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8110b57cec5SDimitry Andricdef  VLD2q16  : VLD2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2,
8120b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8130b57cec5SDimitry Andricdef  VLD2q32  : VLD2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2,
8140b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8150b57cec5SDimitry Andric
8160b57cec5SDimitry Andricdef  VLD2q8Pseudo  : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8170b57cec5SDimitry Andricdef  VLD2q16Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8180b57cec5SDimitry Andricdef  VLD2q32Pseudo : VLDQQPseudo<IIC_VLD2x2>, Sched<[WriteVLD4]>;
8190b57cec5SDimitry Andric
8200b57cec5SDimitry Andric// ...with address register writeback:
8210b57cec5SDimitry Andricmulticlass VLD2WB<bits<4> op11_8, bits<4> op7_4, string Dt,
8220b57cec5SDimitry Andric                  RegisterOperand VdTy, InstrItinClass itin, Operand AddrMode> {
8230b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
8240b57cec5SDimitry Andric                     (ins AddrMode:$Rn), itin,
8250b57cec5SDimitry Andric                     "vld2", Dt, "$Vd, $Rn!",
8260b57cec5SDimitry Andric                     "$Rn.addr = $wb", []> {
8270b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
8280b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
8290b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
8300b57cec5SDimitry Andric  }
8310b57cec5SDimitry Andric  def _register : NLdSt<0, 0b10, op11_8, op7_4, (outs VdTy:$Vd, GPR:$wb),
8320b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), itin,
8330b57cec5SDimitry Andric                        "vld2", Dt, "$Vd, $Rn, $Rm",
8340b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
8350b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
8360b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
8370b57cec5SDimitry Andric  }
8380b57cec5SDimitry Andric}
8390b57cec5SDimitry Andric
8400b57cec5SDimitry Andricdefm VLD2d8wb  : VLD2WB<0b1000, {0,0,?,?}, "8", VecListDPair, IIC_VLD2u,
8410b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8420b57cec5SDimitry Andricdefm VLD2d16wb : VLD2WB<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VLD2u,
8430b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8440b57cec5SDimitry Andricdefm VLD2d32wb : VLD2WB<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VLD2u,
8450b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8460b57cec5SDimitry Andric
8470b57cec5SDimitry Andricdefm VLD2q8wb  : VLD2WB<0b0011, {0,0,?,?}, "8", VecListFourD, IIC_VLD2x2u,
8480b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8490b57cec5SDimitry Andricdefm VLD2q16wb : VLD2WB<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VLD2x2u,
8500b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8510b57cec5SDimitry Andricdefm VLD2q32wb : VLD2WB<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VLD2x2u,
8520b57cec5SDimitry Andric                        addrmode6align64or128or256>, Sched<[WriteVLD4]>;
8530b57cec5SDimitry Andric
8540b57cec5SDimitry Andricdef VLD2q8PseudoWB_fixed     : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8550b57cec5SDimitry Andricdef VLD2q16PseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8560b57cec5SDimitry Andricdef VLD2q32PseudoWB_fixed    : VLDQQWBfixedPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8570b57cec5SDimitry Andricdef VLD2q8PseudoWB_register  : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8580b57cec5SDimitry Andricdef VLD2q16PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8590b57cec5SDimitry Andricdef VLD2q32PseudoWB_register : VLDQQWBregisterPseudo<IIC_VLD2x2u>, Sched<[WriteVLD4]>;
8600b57cec5SDimitry Andric
8610b57cec5SDimitry Andric// ...with double-spaced registers
8620b57cec5SDimitry Andricdef  VLD2b8    : VLD2<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2,
8630b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8640b57cec5SDimitry Andricdef  VLD2b16   : VLD2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2,
8650b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8660b57cec5SDimitry Andricdef  VLD2b32   : VLD2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2,
8670b57cec5SDimitry Andric                      addrmode6align64or128>, Sched<[WriteVLD2]>;
8680b57cec5SDimitry Andricdefm VLD2b8wb  : VLD2WB<0b1001, {0,0,?,?}, "8", VecListDPairSpaced, IIC_VLD2u,
8690b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8700b57cec5SDimitry Andricdefm VLD2b16wb : VLD2WB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VLD2u,
8710b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8720b57cec5SDimitry Andricdefm VLD2b32wb : VLD2WB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VLD2u,
8730b57cec5SDimitry Andric                        addrmode6align64or128>, Sched<[WriteVLD2]>;
8740b57cec5SDimitry Andric
8750b57cec5SDimitry Andric//   VLD3     : Vector Load (multiple 3-element structures)
8760b57cec5SDimitry Andricclass VLD3D<bits<4> op11_8, bits<4> op7_4, string Dt>
8770b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
8780b57cec5SDimitry Andric          (ins addrmode6:$Rn), IIC_VLD3,
8790b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn", "", []>, Sched<[WriteVLD3]> {
8800b57cec5SDimitry Andric  let Rm = 0b1111;
8810b57cec5SDimitry Andric  let Inst{4} = Rn{4};
8820b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
8830b57cec5SDimitry Andric}
8840b57cec5SDimitry Andric
8850b57cec5SDimitry Andricdef  VLD3d8   : VLD3D<0b0100, {0,0,0,?}, "8">;
8860b57cec5SDimitry Andricdef  VLD3d16  : VLD3D<0b0100, {0,1,0,?}, "16">;
8870b57cec5SDimitry Andricdef  VLD3d32  : VLD3D<0b0100, {1,0,0,?}, "32">;
8880b57cec5SDimitry Andric
8890b57cec5SDimitry Andricdef  VLD3d8Pseudo  : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8900b57cec5SDimitry Andricdef  VLD3d16Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8910b57cec5SDimitry Andricdef  VLD3d32Pseudo : VLDQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
8920b57cec5SDimitry Andric
8930b57cec5SDimitry Andric// ...with address register writeback:
8940b57cec5SDimitry Andricclass VLD3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
8950b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
8960b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
8970b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD3u,
8980b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd, $dst2, $dst3\\}, $Rn$Rm",
8990b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD3]> {
9000b57cec5SDimitry Andric  let Inst{4} = Rn{4};
9010b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
9020b57cec5SDimitry Andric}
9030b57cec5SDimitry Andric
9040b57cec5SDimitry Andricdef VLD3d8_UPD  : VLD3DWB<0b0100, {0,0,0,?}, "8">;
9050b57cec5SDimitry Andricdef VLD3d16_UPD : VLD3DWB<0b0100, {0,1,0,?}, "16">;
9060b57cec5SDimitry Andricdef VLD3d32_UPD : VLD3DWB<0b0100, {1,0,0,?}, "32">;
9070b57cec5SDimitry Andric
9080b57cec5SDimitry Andricdef VLD3d8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9090b57cec5SDimitry Andricdef VLD3d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9100b57cec5SDimitry Andricdef VLD3d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9110b57cec5SDimitry Andric
9120b57cec5SDimitry Andric// ...with double-spaced registers:
9130b57cec5SDimitry Andricdef VLD3q8      : VLD3D<0b0101, {0,0,0,?}, "8">;
9140b57cec5SDimitry Andricdef VLD3q16     : VLD3D<0b0101, {0,1,0,?}, "16">;
9150b57cec5SDimitry Andricdef VLD3q32     : VLD3D<0b0101, {1,0,0,?}, "32">;
9160b57cec5SDimitry Andricdef VLD3q8_UPD  : VLD3DWB<0b0101, {0,0,0,?}, "8">;
9170b57cec5SDimitry Andricdef VLD3q16_UPD : VLD3DWB<0b0101, {0,1,0,?}, "16">;
9180b57cec5SDimitry Andricdef VLD3q32_UPD : VLD3DWB<0b0101, {1,0,0,?}, "32">;
9190b57cec5SDimitry Andric
9200b57cec5SDimitry Andricdef VLD3q8Pseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9210b57cec5SDimitry Andricdef VLD3q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9220b57cec5SDimitry Andricdef VLD3q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9230b57cec5SDimitry Andric
9240b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
9250b57cec5SDimitry Andricdef VLD3q8oddPseudo   : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9260b57cec5SDimitry Andricdef VLD3q16oddPseudo  : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9270b57cec5SDimitry Andricdef VLD3q32oddPseudo  : VLDQQQQPseudo<IIC_VLD3>, Sched<[WriteVLD3]>;
9280b57cec5SDimitry Andric
9290b57cec5SDimitry Andricdef VLD3q8oddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9300b57cec5SDimitry Andricdef VLD3q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9310b57cec5SDimitry Andricdef VLD3q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD3u>, Sched<[WriteVLD3]>;
9320b57cec5SDimitry Andric
9330b57cec5SDimitry Andric//   VLD4     : Vector Load (multiple 4-element structures)
9340b57cec5SDimitry Andricclass VLD4D<bits<4> op11_8, bits<4> op7_4, string Dt>
9350b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
9360b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
9370b57cec5SDimitry Andric          (ins addrmode6:$Rn), IIC_VLD4,
9380b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn", "", []>,
9390b57cec5SDimitry Andric    Sched<[WriteVLD4]> {
9400b57cec5SDimitry Andric  let Rm = 0b1111;
9410b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
9420b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
9430b57cec5SDimitry Andric}
9440b57cec5SDimitry Andric
9450b57cec5SDimitry Andricdef  VLD4d8   : VLD4D<0b0000, {0,0,?,?}, "8">;
9460b57cec5SDimitry Andricdef  VLD4d16  : VLD4D<0b0000, {0,1,?,?}, "16">;
9470b57cec5SDimitry Andricdef  VLD4d32  : VLD4D<0b0000, {1,0,?,?}, "32">;
9480b57cec5SDimitry Andric
9490b57cec5SDimitry Andricdef  VLD4d8Pseudo  : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9500b57cec5SDimitry Andricdef  VLD4d16Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9510b57cec5SDimitry Andricdef  VLD4d32Pseudo : VLDQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9520b57cec5SDimitry Andric
9530b57cec5SDimitry Andric// ...with address register writeback:
9540b57cec5SDimitry Andricclass VLD4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
9550b57cec5SDimitry Andric  : NLdSt<0, 0b10, op11_8, op7_4,
9560b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
9570b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm), IIC_VLD4u,
9580b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd, $dst2, $dst3, $dst4\\}, $Rn$Rm",
9590b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD4]> {
9600b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
9610b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
9620b57cec5SDimitry Andric}
9630b57cec5SDimitry Andric
9640b57cec5SDimitry Andricdef VLD4d8_UPD  : VLD4DWB<0b0000, {0,0,?,?}, "8">;
9650b57cec5SDimitry Andricdef VLD4d16_UPD : VLD4DWB<0b0000, {0,1,?,?}, "16">;
9660b57cec5SDimitry Andricdef VLD4d32_UPD : VLD4DWB<0b0000, {1,0,?,?}, "32">;
9670b57cec5SDimitry Andric
9680b57cec5SDimitry Andricdef VLD4d8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9690b57cec5SDimitry Andricdef VLD4d16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9700b57cec5SDimitry Andricdef VLD4d32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9710b57cec5SDimitry Andric
9720b57cec5SDimitry Andric// ...with double-spaced registers:
9730b57cec5SDimitry Andricdef VLD4q8      : VLD4D<0b0001, {0,0,?,?}, "8">;
9740b57cec5SDimitry Andricdef VLD4q16     : VLD4D<0b0001, {0,1,?,?}, "16">;
9750b57cec5SDimitry Andricdef VLD4q32     : VLD4D<0b0001, {1,0,?,?}, "32">;
9760b57cec5SDimitry Andricdef VLD4q8_UPD  : VLD4DWB<0b0001, {0,0,?,?}, "8">;
9770b57cec5SDimitry Andricdef VLD4q16_UPD : VLD4DWB<0b0001, {0,1,?,?}, "16">;
9780b57cec5SDimitry Andricdef VLD4q32_UPD : VLD4DWB<0b0001, {1,0,?,?}, "32">;
9790b57cec5SDimitry Andric
9800b57cec5SDimitry Andricdef VLD4q8Pseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9810b57cec5SDimitry Andricdef VLD4q16Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9820b57cec5SDimitry Andricdef VLD4q32Pseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9830b57cec5SDimitry Andric
9840b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
9850b57cec5SDimitry Andricdef VLD4q8oddPseudo   : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9860b57cec5SDimitry Andricdef VLD4q16oddPseudo  : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9870b57cec5SDimitry Andricdef VLD4q32oddPseudo  : VLDQQQQPseudo<IIC_VLD4>, Sched<[WriteVLD4]>;
9880b57cec5SDimitry Andric
9890b57cec5SDimitry Andricdef VLD4q8oddPseudo_UPD  : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9900b57cec5SDimitry Andricdef VLD4q16oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9910b57cec5SDimitry Andricdef VLD4q32oddPseudo_UPD : VLDQQQQWBPseudo<IIC_VLD4u>, Sched<[WriteVLD4]>;
9920b57cec5SDimitry Andric
9930b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
9940b57cec5SDimitry Andric
9950b57cec5SDimitry Andric// Classes for VLD*LN pseudo-instructions with multi-register operands.
9960b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
9970b57cec5SDimitry Andricclass VLDQLNPseudo<InstrItinClass itin>
9980b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst),
9990b57cec5SDimitry Andric                (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
10000b57cec5SDimitry Andric                itin, "$src = $dst">;
10010b57cec5SDimitry Andricclass VLDQLNWBPseudo<InstrItinClass itin>
10020b57cec5SDimitry Andric  : PseudoNLdSt<(outs QPR:$dst, GPR:$wb),
10030b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
10040b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10050b57cec5SDimitry Andricclass VLDQQLNPseudo<InstrItinClass itin>
10060b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst),
10070b57cec5SDimitry Andric                (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
10080b57cec5SDimitry Andric                itin, "$src = $dst">;
10090b57cec5SDimitry Andricclass VLDQQLNWBPseudo<InstrItinClass itin>
10100b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQPR:$dst, GPR:$wb),
10110b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
10120b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10130b57cec5SDimitry Andricclass VLDQQQQLNPseudo<InstrItinClass itin>
10140b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst),
10150b57cec5SDimitry Andric                (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
10160b57cec5SDimitry Andric                itin, "$src = $dst">;
10170b57cec5SDimitry Andricclass VLDQQQQLNWBPseudo<InstrItinClass itin>
10180b57cec5SDimitry Andric  : PseudoNLdSt<(outs QQQQPR:$dst, GPR:$wb),
10190b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
10200b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb, $src = $dst">;
10210b57cec5SDimitry Andric
10220b57cec5SDimitry Andric//   VLD1LN   : Vector Load (single element to one lane)
10230b57cec5SDimitry Andricclass VLD1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
10240b57cec5SDimitry Andric             PatFrag LoadOp>
10250b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
10260b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src, nohash_imm:$lane),
10270b57cec5SDimitry Andric          IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
10280b57cec5SDimitry Andric          "$src = $Vd",
10290b57cec5SDimitry Andric          [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
10300b57cec5SDimitry Andric                                         (i32 (LoadOp addrmode6:$Rn)),
10310b57cec5SDimitry Andric                                         imm:$lane))]> {
10320b57cec5SDimitry Andric  let Rm = 0b1111;
10330b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
10340b57cec5SDimitry Andric}
10350b57cec5SDimitry Andricclass VLD1LN32<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
10360b57cec5SDimitry Andric             PatFrag LoadOp>
10370b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd),
10380b57cec5SDimitry Andric          (ins addrmode6oneL32:$Rn, DPR:$src, nohash_imm:$lane),
10390b57cec5SDimitry Andric          IIC_VLD1ln, "vld1", Dt, "\\{$Vd[$lane]\\}, $Rn",
10400b57cec5SDimitry Andric          "$src = $Vd",
10410b57cec5SDimitry Andric          [(set DPR:$Vd, (vector_insert (Ty DPR:$src),
10420b57cec5SDimitry Andric                                         (i32 (LoadOp addrmode6oneL32:$Rn)),
10430b57cec5SDimitry Andric                                         imm:$lane))]>, Sched<[WriteVLD1]> {
10440b57cec5SDimitry Andric  let Rm = 0b1111;
10450b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
10460b57cec5SDimitry Andric}
10470b57cec5SDimitry Andricclass VLD1QLNPseudo<ValueType Ty, PatFrag LoadOp> : VLDQLNPseudo<IIC_VLD1ln>,
10480b57cec5SDimitry Andric                                                    Sched<[WriteVLD1]> {
10490b57cec5SDimitry Andric  let Pattern = [(set QPR:$dst, (vector_insert (Ty QPR:$src),
10500b57cec5SDimitry Andric                                               (i32 (LoadOp addrmode6:$addr)),
10510b57cec5SDimitry Andric                                               imm:$lane))];
10520b57cec5SDimitry Andric}
10530b57cec5SDimitry Andric
10540b57cec5SDimitry Andricdef VLD1LNd8  : VLD1LN<0b0000, {?,?,?,0}, "8", v8i8, extloadi8> {
10550b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
10560b57cec5SDimitry Andric}
10570b57cec5SDimitry Andricdef VLD1LNd16 : VLD1LN<0b0100, {?,?,0,?}, "16", v4i16, extloadi16> {
10580b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
10590b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
10600b57cec5SDimitry Andric}
10610b57cec5SDimitry Andricdef VLD1LNd32 : VLD1LN32<0b1000, {?,0,?,?}, "32", v2i32, load> {
10620b57cec5SDimitry Andric  let Inst{7} = lane{0};
10630b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
10640b57cec5SDimitry Andric}
10650b57cec5SDimitry Andric
10660b57cec5SDimitry Andricdef VLD1LNq8Pseudo  : VLD1QLNPseudo<v16i8, extloadi8>;
10670b57cec5SDimitry Andricdef VLD1LNq16Pseudo : VLD1QLNPseudo<v8i16, extloadi16>;
10680b57cec5SDimitry Andricdef VLD1LNq32Pseudo : VLD1QLNPseudo<v4i32, load>;
10690b57cec5SDimitry Andric
10700b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
10710b57cec5SDimitry Andricdef : Pat<(vector_insert (v4f16 DPR:$src),
10720b57cec5SDimitry Andric                         (f16 (load addrmode6:$addr)), imm:$lane),
10730b57cec5SDimitry Andric          (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
10740b57cec5SDimitry Andricdef : Pat<(vector_insert (v8f16 QPR:$src),
10750b57cec5SDimitry Andric                         (f16 (load addrmode6:$addr)), imm:$lane),
10760b57cec5SDimitry Andric          (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
1077*5ffd83dbSDimitry Andricdef : Pat<(vector_insert (v4bf16 DPR:$src),
1078*5ffd83dbSDimitry Andric                         (bf16 (load addrmode6:$addr)), imm:$lane),
1079*5ffd83dbSDimitry Andric          (VLD1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
1080*5ffd83dbSDimitry Andricdef : Pat<(vector_insert (v8bf16 QPR:$src),
1081*5ffd83dbSDimitry Andric                         (bf16 (load addrmode6:$addr)), imm:$lane),
1082*5ffd83dbSDimitry Andric          (VLD1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
10830b57cec5SDimitry Andricdef : Pat<(vector_insert (v2f32 DPR:$src),
10840b57cec5SDimitry Andric                         (f32 (load addrmode6:$addr)), imm:$lane),
10850b57cec5SDimitry Andric          (VLD1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
10860b57cec5SDimitry Andricdef : Pat<(vector_insert (v4f32 QPR:$src),
10870b57cec5SDimitry Andric                         (f32 (load addrmode6:$addr)), imm:$lane),
10880b57cec5SDimitry Andric          (VLD1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
10890b57cec5SDimitry Andric
10900b57cec5SDimitry Andric// A 64-bit subvector insert to the first 128-bit vector position
10910b57cec5SDimitry Andric// is a subregister copy that needs no instruction.
10920b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v1i64 DPR:$src), (i32 0)),
10930b57cec5SDimitry Andric          (INSERT_SUBREG (v2i64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
10940b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v2i32 DPR:$src), (i32 0)),
10950b57cec5SDimitry Andric          (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
10960b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v2f32 DPR:$src), (i32 0)),
10970b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
10980b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v4i16 DPR:$src), (i32 0)),
10990b57cec5SDimitry Andric          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11000b57cec5SDimitry Andricdef : Pat<(insert_subvector undef, (v4f16 DPR:$src), (i32 0)),
11010b57cec5SDimitry Andric          (INSERT_SUBREG (v8f16 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11020b57cec5SDimitry Andricdef : Pat<(insert_subvector (v16i8 undef), (v8i8 DPR:$src), (i32 0)),
11030b57cec5SDimitry Andric          (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
11040b57cec5SDimitry Andric}
11050b57cec5SDimitry Andric
11060b57cec5SDimitry Andric
11070b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
11080b57cec5SDimitry Andric
11090b57cec5SDimitry Andric// ...with address register writeback:
11100b57cec5SDimitry Andricclass VLD1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
11110b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, GPR:$wb),
11120b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
11130b57cec5SDimitry Andric           DPR:$src, nohash_imm:$lane), IIC_VLD1lnu, "vld1", Dt,
11140b57cec5SDimitry Andric          "\\{$Vd[$lane]\\}, $Rn$Rm",
11150b57cec5SDimitry Andric          "$src = $Vd, $Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
11160b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1LN";
11170b57cec5SDimitry Andric}
11180b57cec5SDimitry Andric
11190b57cec5SDimitry Andricdef VLD1LNd8_UPD  : VLD1LNWB<0b0000, {?,?,?,0}, "8"> {
11200b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11210b57cec5SDimitry Andric}
11220b57cec5SDimitry Andricdef VLD1LNd16_UPD : VLD1LNWB<0b0100, {?,?,0,?}, "16"> {
11230b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11240b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11250b57cec5SDimitry Andric}
11260b57cec5SDimitry Andricdef VLD1LNd32_UPD : VLD1LNWB<0b1000, {?,0,?,?}, "32"> {
11270b57cec5SDimitry Andric  let Inst{7} = lane{0};
11280b57cec5SDimitry Andric  let Inst{5} = Rn{4};
11290b57cec5SDimitry Andric  let Inst{4} = Rn{4};
11300b57cec5SDimitry Andric}
11310b57cec5SDimitry Andric
11320b57cec5SDimitry Andricdef VLD1LNq8Pseudo_UPD  : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11330b57cec5SDimitry Andricdef VLD1LNq16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11340b57cec5SDimitry Andricdef VLD1LNq32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD1lnu>, Sched<[WriteVLD1]>;
11350b57cec5SDimitry Andric
11360b57cec5SDimitry Andric//   VLD2LN   : Vector Load (single 2-element structure to one lane)
11370b57cec5SDimitry Andricclass VLD2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
11380b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2),
11390b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, nohash_imm:$lane),
11400b57cec5SDimitry Andric          IIC_VLD2ln, "vld2", Dt, "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn",
11410b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2", []>, Sched<[WriteVLD1]> {
11420b57cec5SDimitry Andric  let Rm = 0b1111;
11430b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11440b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2LN";
11450b57cec5SDimitry Andric}
11460b57cec5SDimitry Andric
11470b57cec5SDimitry Andricdef VLD2LNd8  : VLD2LN<0b0001, {?,?,?,?}, "8"> {
11480b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11490b57cec5SDimitry Andric}
11500b57cec5SDimitry Andricdef VLD2LNd16 : VLD2LN<0b0101, {?,?,0,?}, "16"> {
11510b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11520b57cec5SDimitry Andric}
11530b57cec5SDimitry Andricdef VLD2LNd32 : VLD2LN<0b1001, {?,0,0,?}, "32"> {
11540b57cec5SDimitry Andric  let Inst{7} = lane{0};
11550b57cec5SDimitry Andric}
11560b57cec5SDimitry Andric
11570b57cec5SDimitry Andricdef VLD2LNd8Pseudo  : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11580b57cec5SDimitry Andricdef VLD2LNd16Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11590b57cec5SDimitry Andricdef VLD2LNd32Pseudo : VLDQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11600b57cec5SDimitry Andric
11610b57cec5SDimitry Andric// ...with double-spaced registers:
11620b57cec5SDimitry Andricdef VLD2LNq16 : VLD2LN<0b0101, {?,?,1,?}, "16"> {
11630b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11640b57cec5SDimitry Andric}
11650b57cec5SDimitry Andricdef VLD2LNq32 : VLD2LN<0b1001, {?,1,0,?}, "32"> {
11660b57cec5SDimitry Andric  let Inst{7} = lane{0};
11670b57cec5SDimitry Andric}
11680b57cec5SDimitry Andric
11690b57cec5SDimitry Andricdef VLD2LNq16Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11700b57cec5SDimitry Andricdef VLD2LNq32Pseudo : VLDQQLNPseudo<IIC_VLD2ln>, Sched<[WriteVLD1]>;
11710b57cec5SDimitry Andric
11720b57cec5SDimitry Andric// ...with address register writeback:
11730b57cec5SDimitry Andricclass VLD2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
11740b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, GPR:$wb),
11750b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
11760b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, nohash_imm:$lane), IIC_VLD2lnu, "vld2", Dt,
11770b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane]\\}, $Rn$Rm",
11780b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $Rn.addr = $wb", []> {
11790b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
11800b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2LN";
11810b57cec5SDimitry Andric}
11820b57cec5SDimitry Andric
11830b57cec5SDimitry Andricdef VLD2LNd8_UPD  : VLD2LNWB<0b0001, {?,?,?,?}, "8"> {
11840b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
11850b57cec5SDimitry Andric}
11860b57cec5SDimitry Andricdef VLD2LNd16_UPD : VLD2LNWB<0b0101, {?,?,0,?}, "16"> {
11870b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11880b57cec5SDimitry Andric}
11890b57cec5SDimitry Andricdef VLD2LNd32_UPD : VLD2LNWB<0b1001, {?,0,0,?}, "32"> {
11900b57cec5SDimitry Andric  let Inst{7} = lane{0};
11910b57cec5SDimitry Andric}
11920b57cec5SDimitry Andric
11930b57cec5SDimitry Andricdef VLD2LNd8Pseudo_UPD  : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
11940b57cec5SDimitry Andricdef VLD2LNd16Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
11950b57cec5SDimitry Andricdef VLD2LNd32Pseudo_UPD : VLDQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
11960b57cec5SDimitry Andric
11970b57cec5SDimitry Andricdef VLD2LNq16_UPD : VLD2LNWB<0b0101, {?,?,1,?}, "16"> {
11980b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
11990b57cec5SDimitry Andric}
12000b57cec5SDimitry Andricdef VLD2LNq32_UPD : VLD2LNWB<0b1001, {?,1,0,?}, "32"> {
12010b57cec5SDimitry Andric  let Inst{7} = lane{0};
12020b57cec5SDimitry Andric}
12030b57cec5SDimitry Andric
12040b57cec5SDimitry Andricdef VLD2LNq16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12050b57cec5SDimitry Andricdef VLD2LNq32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD2lnu>, Sched<[WriteVLD1]>;
12060b57cec5SDimitry Andric
12070b57cec5SDimitry Andric//   VLD3LN   : Vector Load (single 3-element structure to one lane)
12080b57cec5SDimitry Andricclass VLD3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
12090b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
12100b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3,
12110b57cec5SDimitry Andric          nohash_imm:$lane), IIC_VLD3ln, "vld3", Dt,
12120b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn",
12130b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3", []>, Sched<[WriteVLD2]> {
12140b57cec5SDimitry Andric  let Rm = 0b1111;
12150b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3LN";
12160b57cec5SDimitry Andric}
12170b57cec5SDimitry Andric
12180b57cec5SDimitry Andricdef VLD3LNd8  : VLD3LN<0b0010, {?,?,?,0}, "8"> {
12190b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
12200b57cec5SDimitry Andric}
12210b57cec5SDimitry Andricdef VLD3LNd16 : VLD3LN<0b0110, {?,?,0,0}, "16"> {
12220b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12230b57cec5SDimitry Andric}
12240b57cec5SDimitry Andricdef VLD3LNd32 : VLD3LN<0b1010, {?,0,0,0}, "32"> {
12250b57cec5SDimitry Andric  let Inst{7}   = lane{0};
12260b57cec5SDimitry Andric}
12270b57cec5SDimitry Andric
12280b57cec5SDimitry Andricdef VLD3LNd8Pseudo  : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12290b57cec5SDimitry Andricdef VLD3LNd16Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12300b57cec5SDimitry Andricdef VLD3LNd32Pseudo : VLDQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12310b57cec5SDimitry Andric
12320b57cec5SDimitry Andric// ...with double-spaced registers:
12330b57cec5SDimitry Andricdef VLD3LNq16 : VLD3LN<0b0110, {?,?,1,0}, "16"> {
12340b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12350b57cec5SDimitry Andric}
12360b57cec5SDimitry Andricdef VLD3LNq32 : VLD3LN<0b1010, {?,1,0,0}, "32"> {
12370b57cec5SDimitry Andric  let Inst{7}   = lane{0};
12380b57cec5SDimitry Andric}
12390b57cec5SDimitry Andric
12400b57cec5SDimitry Andricdef VLD3LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12410b57cec5SDimitry Andricdef VLD3LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD3ln>, Sched<[WriteVLD2]>;
12420b57cec5SDimitry Andric
12430b57cec5SDimitry Andric// ...with address register writeback:
12440b57cec5SDimitry Andricclass VLD3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
12450b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
12460b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
12470b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
12480b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, DPR:$src3, nohash_imm:$lane),
12490b57cec5SDimitry Andric          IIC_VLD3lnu, "vld3", Dt,
12500b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane]\\}, $Rn$Rm",
12510b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $Rn.addr = $wb",
12520b57cec5SDimitry Andric          []>, Sched<[WriteVLD2]> {
12530b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3LN";
12540b57cec5SDimitry Andric}
12550b57cec5SDimitry Andric
12560b57cec5SDimitry Andricdef VLD3LNd8_UPD  : VLD3LNWB<0b0010, {?,?,?,0}, "8"> {
12570b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
12580b57cec5SDimitry Andric}
12590b57cec5SDimitry Andricdef VLD3LNd16_UPD : VLD3LNWB<0b0110, {?,?,0,0}, "16"> {
12600b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12610b57cec5SDimitry Andric}
12620b57cec5SDimitry Andricdef VLD3LNd32_UPD : VLD3LNWB<0b1010, {?,0,0,0}, "32"> {
12630b57cec5SDimitry Andric  let Inst{7} = lane{0};
12640b57cec5SDimitry Andric}
12650b57cec5SDimitry Andric
12660b57cec5SDimitry Andricdef VLD3LNd8Pseudo_UPD  : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12670b57cec5SDimitry Andricdef VLD3LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12680b57cec5SDimitry Andricdef VLD3LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12690b57cec5SDimitry Andric
12700b57cec5SDimitry Andricdef VLD3LNq16_UPD : VLD3LNWB<0b0110, {?,?,1,0}, "16"> {
12710b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12720b57cec5SDimitry Andric}
12730b57cec5SDimitry Andricdef VLD3LNq32_UPD : VLD3LNWB<0b1010, {?,1,0,0}, "32"> {
12740b57cec5SDimitry Andric  let Inst{7} = lane{0};
12750b57cec5SDimitry Andric}
12760b57cec5SDimitry Andric
12770b57cec5SDimitry Andricdef VLD3LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12780b57cec5SDimitry Andricdef VLD3LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD3lnu>, Sched<[WriteVLD2]>;
12790b57cec5SDimitry Andric
12800b57cec5SDimitry Andric//   VLD4LN   : Vector Load (single 4-element structure to one lane)
12810b57cec5SDimitry Andricclass VLD4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
12820b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
12830b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
12840b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4,
12850b57cec5SDimitry Andric          nohash_imm:$lane), IIC_VLD4ln, "vld4", Dt,
12860b57cec5SDimitry Andric          "\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn",
12870b57cec5SDimitry Andric          "$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4", []>,
12880b57cec5SDimitry Andric    Sched<[WriteVLD2]> {
12890b57cec5SDimitry Andric  let Rm = 0b1111;
12900b57cec5SDimitry Andric  let Inst{4} = Rn{4};
12910b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4LN";
12920b57cec5SDimitry Andric}
12930b57cec5SDimitry Andric
12940b57cec5SDimitry Andricdef VLD4LNd8  : VLD4LN<0b0011, {?,?,?,?}, "8"> {
12950b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
12960b57cec5SDimitry Andric}
12970b57cec5SDimitry Andricdef VLD4LNd16 : VLD4LN<0b0111, {?,?,0,?}, "16"> {
12980b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
12990b57cec5SDimitry Andric}
13000b57cec5SDimitry Andricdef VLD4LNd32 : VLD4LN<0b1011, {?,0,?,?}, "32"> {
13010b57cec5SDimitry Andric  let Inst{7} = lane{0};
13020b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13030b57cec5SDimitry Andric}
13040b57cec5SDimitry Andric
13050b57cec5SDimitry Andricdef VLD4LNd8Pseudo  : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13060b57cec5SDimitry Andricdef VLD4LNd16Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13070b57cec5SDimitry Andricdef VLD4LNd32Pseudo : VLDQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13080b57cec5SDimitry Andric
13090b57cec5SDimitry Andric// ...with double-spaced registers:
13100b57cec5SDimitry Andricdef VLD4LNq16 : VLD4LN<0b0111, {?,?,1,?}, "16"> {
13110b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13120b57cec5SDimitry Andric}
13130b57cec5SDimitry Andricdef VLD4LNq32 : VLD4LN<0b1011, {?,1,?,?}, "32"> {
13140b57cec5SDimitry Andric  let Inst{7} = lane{0};
13150b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13160b57cec5SDimitry Andric}
13170b57cec5SDimitry Andric
13180b57cec5SDimitry Andricdef VLD4LNq16Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13190b57cec5SDimitry Andricdef VLD4LNq32Pseudo : VLDQQQQLNPseudo<IIC_VLD4ln>, Sched<[WriteVLD2]>;
13200b57cec5SDimitry Andric
13210b57cec5SDimitry Andric// ...with address register writeback:
13220b57cec5SDimitry Andricclass VLD4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
13230b57cec5SDimitry Andric  : NLdStLn<1, 0b10, op11_8, op7_4,
13240b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
13250b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
13260b57cec5SDimitry Andric           DPR:$src1, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
13270b57cec5SDimitry Andric          IIC_VLD4lnu, "vld4", Dt,
13280b57cec5SDimitry Andric"\\{$Vd[$lane], $dst2[$lane], $dst3[$lane], $dst4[$lane]\\}, $Rn$Rm",
13290b57cec5SDimitry Andric"$src1 = $Vd, $src2 = $dst2, $src3 = $dst3, $src4 = $dst4, $Rn.addr = $wb",
13300b57cec5SDimitry Andric          []> {
13310b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
13320b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4LN"  ;
13330b57cec5SDimitry Andric}
13340b57cec5SDimitry Andric
13350b57cec5SDimitry Andricdef VLD4LNd8_UPD  : VLD4LNWB<0b0011, {?,?,?,?}, "8"> {
13360b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
13370b57cec5SDimitry Andric}
13380b57cec5SDimitry Andricdef VLD4LNd16_UPD : VLD4LNWB<0b0111, {?,?,0,?}, "16"> {
13390b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13400b57cec5SDimitry Andric}
13410b57cec5SDimitry Andricdef VLD4LNd32_UPD : VLD4LNWB<0b1011, {?,0,?,?}, "32"> {
13420b57cec5SDimitry Andric  let Inst{7} = lane{0};
13430b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13440b57cec5SDimitry Andric}
13450b57cec5SDimitry Andric
13460b57cec5SDimitry Andricdef VLD4LNd8Pseudo_UPD  : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13470b57cec5SDimitry Andricdef VLD4LNd16Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13480b57cec5SDimitry Andricdef VLD4LNd32Pseudo_UPD : VLDQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13490b57cec5SDimitry Andric
13500b57cec5SDimitry Andricdef VLD4LNq16_UPD : VLD4LNWB<0b0111, {?,?,1,?}, "16"> {
13510b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
13520b57cec5SDimitry Andric}
13530b57cec5SDimitry Andricdef VLD4LNq32_UPD : VLD4LNWB<0b1011, {?,1,?,?}, "32"> {
13540b57cec5SDimitry Andric  let Inst{7} = lane{0};
13550b57cec5SDimitry Andric  let Inst{5} = Rn{5};
13560b57cec5SDimitry Andric}
13570b57cec5SDimitry Andric
13580b57cec5SDimitry Andricdef VLD4LNq16Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13590b57cec5SDimitry Andricdef VLD4LNq32Pseudo_UPD : VLDQQQQLNWBPseudo<IIC_VLD4lnu>, Sched<[WriteVLD2]>;
13600b57cec5SDimitry Andric
13610b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
13620b57cec5SDimitry Andric
13630b57cec5SDimitry Andric//   VLD1DUP  : Vector Load (single element to all lanes)
13640b57cec5SDimitry Andricclass VLD1DUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
13650b57cec5SDimitry Andric              Operand AddrMode>
13660b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListOneDAllLanes:$Vd),
13670b57cec5SDimitry Andric          (ins AddrMode:$Rn),
13680b57cec5SDimitry Andric          IIC_VLD1dup, "vld1", Dt, "$Vd, $Rn", "",
13690b57cec5SDimitry Andric          [(set VecListOneDAllLanes:$Vd,
13700b57cec5SDimitry Andric                (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]>,
13710b57cec5SDimitry Andric   Sched<[WriteVLD2]> {
13720b57cec5SDimitry Andric  let Rm = 0b1111;
13730b57cec5SDimitry Andric  let Inst{4} = Rn{4};
13740b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1DupInstruction";
13750b57cec5SDimitry Andric}
13760b57cec5SDimitry Andricdef VLD1DUPd8  : VLD1DUP<{0,0,0,?}, "8", v8i8, extloadi8,
13770b57cec5SDimitry Andric                         addrmode6dupalignNone>;
13780b57cec5SDimitry Andricdef VLD1DUPd16 : VLD1DUP<{0,1,0,?}, "16", v4i16, extloadi16,
13790b57cec5SDimitry Andric                         addrmode6dupalign16>;
13800b57cec5SDimitry Andricdef VLD1DUPd32 : VLD1DUP<{1,0,0,?}, "32", v2i32, load,
13810b57cec5SDimitry Andric                         addrmode6dupalign32>;
13820b57cec5SDimitry Andric
13830b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
13840b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
13850b57cec5SDimitry Andric          (VLD1DUPd32 addrmode6:$addr)>;
13860b57cec5SDimitry Andric}
13870b57cec5SDimitry Andric
13880b57cec5SDimitry Andricclass VLD1QDUP<bits<4> op7_4, string Dt, ValueType Ty, PatFrag LoadOp,
13890b57cec5SDimitry Andric               Operand AddrMode>
13900b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1100, op7_4, (outs VecListDPairAllLanes:$Vd),
13910b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD1dup,
13920b57cec5SDimitry Andric          "vld1", Dt, "$Vd, $Rn", "",
13930b57cec5SDimitry Andric          [(set VecListDPairAllLanes:$Vd,
13940b57cec5SDimitry Andric                (Ty (ARMvdup (i32 (LoadOp AddrMode:$Rn)))))]> {
13950b57cec5SDimitry Andric  let Rm = 0b1111;
13960b57cec5SDimitry Andric  let Inst{4} = Rn{4};
13970b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD1DupInstruction";
13980b57cec5SDimitry Andric}
13990b57cec5SDimitry Andric
14000b57cec5SDimitry Andricdef VLD1DUPq8  : VLD1QDUP<{0,0,1,0}, "8", v16i8, extloadi8,
14010b57cec5SDimitry Andric                          addrmode6dupalignNone>;
14020b57cec5SDimitry Andricdef VLD1DUPq16 : VLD1QDUP<{0,1,1,?}, "16", v8i16, extloadi16,
14030b57cec5SDimitry Andric                          addrmode6dupalign16>;
14040b57cec5SDimitry Andricdef VLD1DUPq32 : VLD1QDUP<{1,0,1,?}, "32", v4i32, load,
14050b57cec5SDimitry Andric                          addrmode6dupalign32>;
14060b57cec5SDimitry Andric
14070b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
14080b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 (load addrmode6dup:$addr)))),
14090b57cec5SDimitry Andric          (VLD1DUPq32 addrmode6:$addr)>;
14100b57cec5SDimitry Andric}
14110b57cec5SDimitry Andric
14120b57cec5SDimitry Andriclet mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1 in {
14130b57cec5SDimitry Andric// ...with address register writeback:
14140b57cec5SDimitry Andricmulticlass VLD1DUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
14150b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
14160b57cec5SDimitry Andric                     (outs VecListOneDAllLanes:$Vd, GPR:$wb),
14170b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1dupu,
14180b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
14190b57cec5SDimitry Andric                     "$Rn.addr = $wb", []> {
14200b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
14210b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14220b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14230b57cec5SDimitry Andric  }
14240b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1100, op7_4,
14250b57cec5SDimitry Andric                        (outs VecListOneDAllLanes:$Vd, GPR:$wb),
14260b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
14270b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
14280b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
14290b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14300b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14310b57cec5SDimitry Andric  }
14320b57cec5SDimitry Andric}
14330b57cec5SDimitry Andricmulticlass VLD1QDUPWB<bits<4> op7_4, string Dt, Operand AddrMode> {
14340b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1100, op7_4,
14350b57cec5SDimitry Andric                     (outs VecListDPairAllLanes:$Vd, GPR:$wb),
14360b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD1dupu,
14370b57cec5SDimitry Andric                     "vld1", Dt, "$Vd, $Rn!",
14380b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
14390b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
14400b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14410b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14420b57cec5SDimitry Andric  }
14430b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1100, op7_4,
14440b57cec5SDimitry Andric                        (outs VecListDPairAllLanes:$Vd, GPR:$wb),
14450b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD1dupu,
14460b57cec5SDimitry Andric                        "vld1", Dt, "$Vd, $Rn, $Rm",
14470b57cec5SDimitry Andric                        "$Rn.addr = $wb", []> {
14480b57cec5SDimitry Andric    let Inst{4} = Rn{4};
14490b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD1DupInstruction";
14500b57cec5SDimitry Andric  }
14510b57cec5SDimitry Andric}
14520b57cec5SDimitry Andric
14530b57cec5SDimitry Andricdefm VLD1DUPd8wb  : VLD1DUPWB<{0,0,0,0}, "8", addrmode6dupalignNone>;
14540b57cec5SDimitry Andricdefm VLD1DUPd16wb : VLD1DUPWB<{0,1,0,?}, "16", addrmode6dupalign16>;
14550b57cec5SDimitry Andricdefm VLD1DUPd32wb : VLD1DUPWB<{1,0,0,?}, "32", addrmode6dupalign32>;
14560b57cec5SDimitry Andric
14570b57cec5SDimitry Andricdefm VLD1DUPq8wb  : VLD1QDUPWB<{0,0,1,0}, "8", addrmode6dupalignNone>;
14580b57cec5SDimitry Andricdefm VLD1DUPq16wb : VLD1QDUPWB<{0,1,1,?}, "16", addrmode6dupalign16>;
14590b57cec5SDimitry Andricdefm VLD1DUPq32wb : VLD1QDUPWB<{1,0,1,?}, "32", addrmode6dupalign32>;
14600b57cec5SDimitry Andric
14610b57cec5SDimitry Andric//   VLD2DUP  : Vector Load (single 2-element structure to all lanes)
14620b57cec5SDimitry Andricclass VLD2DUP<bits<4> op7_4, string Dt, RegisterOperand VdTy, Operand AddrMode>
14630b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1101, op7_4, (outs VdTy:$Vd),
14640b57cec5SDimitry Andric          (ins AddrMode:$Rn), IIC_VLD2dup,
14650b57cec5SDimitry Andric          "vld2", Dt, "$Vd, $Rn", "", []> {
14660b57cec5SDimitry Andric  let Rm = 0b1111;
14670b57cec5SDimitry Andric  let Inst{4} = Rn{4};
14680b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD2DupInstruction";
14690b57cec5SDimitry Andric}
14700b57cec5SDimitry Andric
14710b57cec5SDimitry Andricdef VLD2DUPd8  : VLD2DUP<{0,0,0,?}, "8",  VecListDPairAllLanes,
14720b57cec5SDimitry Andric                         addrmode6dupalign16>;
14730b57cec5SDimitry Andricdef VLD2DUPd16 : VLD2DUP<{0,1,0,?}, "16", VecListDPairAllLanes,
14740b57cec5SDimitry Andric                         addrmode6dupalign32>;
14750b57cec5SDimitry Andricdef VLD2DUPd32 : VLD2DUP<{1,0,0,?}, "32", VecListDPairAllLanes,
14760b57cec5SDimitry Andric                         addrmode6dupalign64>;
14770b57cec5SDimitry Andric
14780b57cec5SDimitry Andric// HACK this one, VLD2DUPd8x2 must be changed at the same time with VLD2b8 or
14790b57cec5SDimitry Andric// "vld2.8 {d0[], d2[]}, [r4:32]" will become "vld2.8 {d0, d2}, [r4:32]".
14800b57cec5SDimitry Andric// ...with double-spaced registers
14810b57cec5SDimitry Andricdef VLD2DUPd8x2  : VLD2DUP<{0,0,1,?}, "8",  VecListDPairSpacedAllLanes,
14820b57cec5SDimitry Andric                           addrmode6dupalign16>;
14830b57cec5SDimitry Andricdef VLD2DUPd16x2 : VLD2DUP<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
14840b57cec5SDimitry Andric                           addrmode6dupalign32>;
14850b57cec5SDimitry Andricdef VLD2DUPd32x2 : VLD2DUP<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
14860b57cec5SDimitry Andric                           addrmode6dupalign64>;
14870b57cec5SDimitry Andric
14880b57cec5SDimitry Andricdef VLD2DUPq8EvenPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14890b57cec5SDimitry Andricdef VLD2DUPq8OddPseudo   : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14900b57cec5SDimitry Andricdef VLD2DUPq16EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14910b57cec5SDimitry Andricdef VLD2DUPq16OddPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14920b57cec5SDimitry Andricdef VLD2DUPq32EvenPseudo : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14930b57cec5SDimitry Andricdef VLD2DUPq32OddPseudo  : VLDQQPseudo<IIC_VLD2dup>, Sched<[WriteVLD2]>;
14940b57cec5SDimitry Andric
14950b57cec5SDimitry Andric// ...with address register writeback:
14960b57cec5SDimitry Andricmulticlass VLD2DUPWB<bits<4> op7_4, string Dt, RegisterOperand VdTy,
14970b57cec5SDimitry Andric                     Operand AddrMode> {
14980b57cec5SDimitry Andric  def _fixed : NLdSt<1, 0b10, 0b1101, op7_4,
14990b57cec5SDimitry Andric                     (outs VdTy:$Vd, GPR:$wb),
15000b57cec5SDimitry Andric                     (ins AddrMode:$Rn), IIC_VLD2dupu,
15010b57cec5SDimitry Andric                     "vld2", Dt, "$Vd, $Rn!",
15020b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15030b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
15040b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15050b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15060b57cec5SDimitry Andric  }
15070b57cec5SDimitry Andric  def _register : NLdSt<1, 0b10, 0b1101, op7_4,
15080b57cec5SDimitry Andric                        (outs VdTy:$Vd, GPR:$wb),
15090b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm), IIC_VLD2dupu,
15100b57cec5SDimitry Andric                        "vld2", Dt, "$Vd, $Rn, $Rm",
15110b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVLD1]> {
15120b57cec5SDimitry Andric    let Inst{4} = Rn{4};
15130b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLD2DupInstruction";
15140b57cec5SDimitry Andric  }
15150b57cec5SDimitry Andric}
15160b57cec5SDimitry Andric
15170b57cec5SDimitry Andricdefm VLD2DUPd8wb    : VLD2DUPWB<{0,0,0,0}, "8",  VecListDPairAllLanes,
15180b57cec5SDimitry Andric                                addrmode6dupalign16>;
15190b57cec5SDimitry Andricdefm VLD2DUPd16wb   : VLD2DUPWB<{0,1,0,?}, "16", VecListDPairAllLanes,
15200b57cec5SDimitry Andric                                addrmode6dupalign32>;
15210b57cec5SDimitry Andricdefm VLD2DUPd32wb   : VLD2DUPWB<{1,0,0,?}, "32", VecListDPairAllLanes,
15220b57cec5SDimitry Andric                                addrmode6dupalign64>;
15230b57cec5SDimitry Andric
15240b57cec5SDimitry Andricdefm VLD2DUPd8x2wb  : VLD2DUPWB<{0,0,1,0}, "8",  VecListDPairSpacedAllLanes,
15250b57cec5SDimitry Andric                                addrmode6dupalign16>;
15260b57cec5SDimitry Andricdefm VLD2DUPd16x2wb : VLD2DUPWB<{0,1,1,?}, "16", VecListDPairSpacedAllLanes,
15270b57cec5SDimitry Andric                                addrmode6dupalign32>;
15280b57cec5SDimitry Andricdefm VLD2DUPd32x2wb : VLD2DUPWB<{1,0,1,?}, "32", VecListDPairSpacedAllLanes,
15290b57cec5SDimitry Andric                                addrmode6dupalign64>;
15300b57cec5SDimitry Andric
15310b57cec5SDimitry Andric//   VLD3DUP  : Vector Load (single 3-element structure to all lanes)
15320b57cec5SDimitry Andricclass VLD3DUP<bits<4> op7_4, string Dt>
15330b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3),
15340b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD3dup,
15350b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn", "", []>,
15360b57cec5SDimitry Andric    Sched<[WriteVLD2]> {
15370b57cec5SDimitry Andric  let Rm = 0b1111;
15380b57cec5SDimitry Andric  let Inst{4} = 0;
15390b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15400b57cec5SDimitry Andric}
15410b57cec5SDimitry Andric
15420b57cec5SDimitry Andricdef VLD3DUPd8  : VLD3DUP<{0,0,0,?}, "8">;
15430b57cec5SDimitry Andricdef VLD3DUPd16 : VLD3DUP<{0,1,0,?}, "16">;
15440b57cec5SDimitry Andricdef VLD3DUPd32 : VLD3DUP<{1,0,0,?}, "32">;
15450b57cec5SDimitry Andric
15460b57cec5SDimitry Andricdef VLD3DUPd8Pseudo  : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15470b57cec5SDimitry Andricdef VLD3DUPd16Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15480b57cec5SDimitry Andricdef VLD3DUPd32Pseudo : VLDQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15490b57cec5SDimitry Andric
15500b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
15510b57cec5SDimitry Andricdef VLD3DUPq8  : VLD3DUP<{0,0,1,?}, "8">;
15520b57cec5SDimitry Andricdef VLD3DUPq16 : VLD3DUP<{0,1,1,?}, "16">;
15530b57cec5SDimitry Andricdef VLD3DUPq32 : VLD3DUP<{1,0,1,?}, "32">;
15540b57cec5SDimitry Andric
15550b57cec5SDimitry Andricdef VLD3DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15560b57cec5SDimitry Andricdef VLD3DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15570b57cec5SDimitry Andricdef VLD3DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15580b57cec5SDimitry Andricdef VLD3DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15590b57cec5SDimitry Andricdef VLD3DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15600b57cec5SDimitry Andricdef VLD3DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD3dup>, Sched<[WriteVLD2]>;
15610b57cec5SDimitry Andric
15620b57cec5SDimitry Andric// ...with address register writeback:
15630b57cec5SDimitry Andricclass VLD3DUPWB<bits<4> op7_4, string Dt, Operand AddrMode>
15640b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1110, op7_4, (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, GPR:$wb),
15650b57cec5SDimitry Andric          (ins AddrMode:$Rn, am6offset:$Rm), IIC_VLD3dupu,
15660b57cec5SDimitry Andric          "vld3", Dt, "\\{$Vd[], $dst2[], $dst3[]\\}, $Rn$Rm",
15670b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
15680b57cec5SDimitry Andric  let Inst{4} = 0;
15690b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD3DupInstruction";
15700b57cec5SDimitry Andric}
15710b57cec5SDimitry Andric
15720b57cec5SDimitry Andricdef VLD3DUPd8_UPD  : VLD3DUPWB<{0,0,0,0}, "8",  addrmode6dupalign64>;
15730b57cec5SDimitry Andricdef VLD3DUPd16_UPD : VLD3DUPWB<{0,1,0,?}, "16", addrmode6dupalign64>;
15740b57cec5SDimitry Andricdef VLD3DUPd32_UPD : VLD3DUPWB<{1,0,0,?}, "32", addrmode6dupalign64>;
15750b57cec5SDimitry Andric
15760b57cec5SDimitry Andricdef VLD3DUPq8_UPD  : VLD3DUPWB<{0,0,1,0}, "8",  addrmode6dupalign64>;
15770b57cec5SDimitry Andricdef VLD3DUPq16_UPD : VLD3DUPWB<{0,1,1,?}, "16", addrmode6dupalign64>;
15780b57cec5SDimitry Andricdef VLD3DUPq32_UPD : VLD3DUPWB<{1,0,1,?}, "32", addrmode6dupalign64>;
15790b57cec5SDimitry Andric
15800b57cec5SDimitry Andricdef VLD3DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15810b57cec5SDimitry Andricdef VLD3DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15820b57cec5SDimitry Andricdef VLD3DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD3dupu>, Sched<[WriteVLD2]>;
15830b57cec5SDimitry Andric
15840b57cec5SDimitry Andric//   VLD4DUP  : Vector Load (single 4-element structure to all lanes)
15850b57cec5SDimitry Andricclass VLD4DUP<bits<4> op7_4, string Dt>
15860b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
15870b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4),
15880b57cec5SDimitry Andric          (ins addrmode6dup:$Rn), IIC_VLD4dup,
15890b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn", "", []> {
15900b57cec5SDimitry Andric  let Rm = 0b1111;
15910b57cec5SDimitry Andric  let Inst{4} = Rn{4};
15920b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
15930b57cec5SDimitry Andric}
15940b57cec5SDimitry Andric
15950b57cec5SDimitry Andricdef VLD4DUPd8  : VLD4DUP<{0,0,0,?}, "8">;
15960b57cec5SDimitry Andricdef VLD4DUPd16 : VLD4DUP<{0,1,0,?}, "16">;
15970b57cec5SDimitry Andricdef VLD4DUPd32 : VLD4DUP<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
15980b57cec5SDimitry Andric
15990b57cec5SDimitry Andricdef VLD4DUPd8Pseudo  : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16000b57cec5SDimitry Andricdef VLD4DUPd16Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16010b57cec5SDimitry Andricdef VLD4DUPd32Pseudo : VLDQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16020b57cec5SDimitry Andric
16030b57cec5SDimitry Andric// ...with double-spaced registers (not used for codegen):
16040b57cec5SDimitry Andricdef VLD4DUPq8  : VLD4DUP<{0,0,1,?}, "8">;
16050b57cec5SDimitry Andricdef VLD4DUPq16 : VLD4DUP<{0,1,1,?}, "16">;
16060b57cec5SDimitry Andricdef VLD4DUPq32 : VLD4DUP<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16070b57cec5SDimitry Andric
16080b57cec5SDimitry Andricdef VLD4DUPq8EvenPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16090b57cec5SDimitry Andricdef VLD4DUPq8OddPseudo   : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16100b57cec5SDimitry Andricdef VLD4DUPq16EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16110b57cec5SDimitry Andricdef VLD4DUPq16OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16120b57cec5SDimitry Andricdef VLD4DUPq32EvenPseudo : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16130b57cec5SDimitry Andricdef VLD4DUPq32OddPseudo  : VLDQQQQPseudo<IIC_VLD4dup>, Sched<[WriteVLD2]>;
16140b57cec5SDimitry Andric
16150b57cec5SDimitry Andric// ...with address register writeback:
16160b57cec5SDimitry Andricclass VLD4DUPWB<bits<4> op7_4, string Dt>
16170b57cec5SDimitry Andric  : NLdSt<1, 0b10, 0b1111, op7_4,
16180b57cec5SDimitry Andric          (outs DPR:$Vd, DPR:$dst2, DPR:$dst3, DPR:$dst4, GPR:$wb),
16190b57cec5SDimitry Andric          (ins addrmode6dup:$Rn, am6offset:$Rm), IIC_VLD4dupu,
16200b57cec5SDimitry Andric          "vld4", Dt, "\\{$Vd[], $dst2[], $dst3[], $dst4[]\\}, $Rn$Rm",
16210b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVLD2]> {
16220b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16230b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLD4DupInstruction";
16240b57cec5SDimitry Andric}
16250b57cec5SDimitry Andric
16260b57cec5SDimitry Andricdef VLD4DUPd8_UPD  : VLD4DUPWB<{0,0,0,0}, "8">;
16270b57cec5SDimitry Andricdef VLD4DUPd16_UPD : VLD4DUPWB<{0,1,0,?}, "16">;
16280b57cec5SDimitry Andricdef VLD4DUPd32_UPD : VLD4DUPWB<{1,?,0,?}, "32"> { let Inst{6} = Rn{5}; }
16290b57cec5SDimitry Andric
16300b57cec5SDimitry Andricdef VLD4DUPq8_UPD  : VLD4DUPWB<{0,0,1,0}, "8">;
16310b57cec5SDimitry Andricdef VLD4DUPq16_UPD : VLD4DUPWB<{0,1,1,?}, "16">;
16320b57cec5SDimitry Andricdef VLD4DUPq32_UPD : VLD4DUPWB<{1,?,1,?}, "32"> { let Inst{6} = Rn{5}; }
16330b57cec5SDimitry Andric
16340b57cec5SDimitry Andricdef VLD4DUPd8Pseudo_UPD  : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16350b57cec5SDimitry Andricdef VLD4DUPd16Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16360b57cec5SDimitry Andricdef VLD4DUPd32Pseudo_UPD : VLDQQWBPseudo<IIC_VLD4dupu>, Sched<[WriteVLD2]>;
16370b57cec5SDimitry Andric
16380b57cec5SDimitry Andric} // mayLoad = 1, hasSideEffects = 0, hasExtraDefRegAllocReq = 1
16390b57cec5SDimitry Andric
16400b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
16410b57cec5SDimitry Andric
16420b57cec5SDimitry Andric// Classes for VST* pseudo-instructions with multi-register operands.
16430b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
16440b57cec5SDimitry Andricclass VSTQPseudo<InstrItinClass itin>
16450b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src), itin, "">;
16460b57cec5SDimitry Andricclass VSTQWBPseudo<InstrItinClass itin>
16470b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16480b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src), itin,
16490b57cec5SDimitry Andric                "$addr.addr = $wb">;
16500b57cec5SDimitry Andricclass VSTQWBfixedPseudo<InstrItinClass itin>
16510b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16520b57cec5SDimitry Andric                (ins addrmode6:$addr, QPR:$src), itin,
16530b57cec5SDimitry Andric                "$addr.addr = $wb">;
16540b57cec5SDimitry Andricclass VSTQWBregisterPseudo<InstrItinClass itin>
16550b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16560b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QPR:$src), itin,
16570b57cec5SDimitry Andric                "$addr.addr = $wb">;
16580b57cec5SDimitry Andricclass VSTQQPseudo<InstrItinClass itin>
16590b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src), itin, "">;
16600b57cec5SDimitry Andricclass VSTQQWBPseudo<InstrItinClass itin>
16610b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16620b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src), itin,
16630b57cec5SDimitry Andric                "$addr.addr = $wb">;
16640b57cec5SDimitry Andricclass VSTQQWBfixedPseudo<InstrItinClass itin>
16650b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16660b57cec5SDimitry Andric                (ins addrmode6:$addr, QQPR:$src), itin,
16670b57cec5SDimitry Andric                "$addr.addr = $wb">;
16680b57cec5SDimitry Andricclass VSTQQWBregisterPseudo<InstrItinClass itin>
16690b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16700b57cec5SDimitry Andric                (ins addrmode6:$addr, rGPR:$offset, QQPR:$src), itin,
16710b57cec5SDimitry Andric                "$addr.addr = $wb">;
16720b57cec5SDimitry Andric
16730b57cec5SDimitry Andricclass VSTQQQQPseudo<InstrItinClass itin>
16740b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src), itin, "">;
16750b57cec5SDimitry Andricclass VSTQQQQWBPseudo<InstrItinClass itin>
16760b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
16770b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src), itin,
16780b57cec5SDimitry Andric                "$addr.addr = $wb">;
16790b57cec5SDimitry Andric
16800b57cec5SDimitry Andric//   VST1     : Vector Store (multiple single elements)
16810b57cec5SDimitry Andricclass VST1D<bits<4> op7_4, string Dt, Operand AddrMode>
16820b57cec5SDimitry Andric  : NLdSt<0,0b00,0b0111,op7_4, (outs), (ins AddrMode:$Rn, VecListOneD:$Vd),
16830b57cec5SDimitry Andric          IIC_VST1, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST1]> {
16840b57cec5SDimitry Andric  let Rm = 0b1111;
16850b57cec5SDimitry Andric  let Inst{4} = Rn{4};
16860b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
16870b57cec5SDimitry Andric}
16880b57cec5SDimitry Andricclass VST1Q<bits<4> op7_4, string Dt, Operand AddrMode>
16890b57cec5SDimitry Andric  : NLdSt<0,0b00,0b1010,op7_4, (outs), (ins AddrMode:$Rn, VecListDPair:$Vd),
16900b57cec5SDimitry Andric          IIC_VST1x2, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST2]> {
16910b57cec5SDimitry Andric  let Rm = 0b1111;
16920b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
16930b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
16940b57cec5SDimitry Andric}
16950b57cec5SDimitry Andric
16960b57cec5SDimitry Andricdef  VST1d8   : VST1D<{0,0,0,?}, "8",  addrmode6align64>;
16970b57cec5SDimitry Andricdef  VST1d16  : VST1D<{0,1,0,?}, "16", addrmode6align64>;
16980b57cec5SDimitry Andricdef  VST1d32  : VST1D<{1,0,0,?}, "32", addrmode6align64>;
16990b57cec5SDimitry Andricdef  VST1d64  : VST1D<{1,1,0,?}, "64", addrmode6align64>;
17000b57cec5SDimitry Andric
17010b57cec5SDimitry Andricdef  VST1q8   : VST1Q<{0,0,?,?}, "8",  addrmode6align64or128>;
17020b57cec5SDimitry Andricdef  VST1q16  : VST1Q<{0,1,?,?}, "16", addrmode6align64or128>;
17030b57cec5SDimitry Andricdef  VST1q32  : VST1Q<{1,0,?,?}, "32", addrmode6align64or128>;
17040b57cec5SDimitry Andricdef  VST1q64  : VST1Q<{1,1,?,?}, "64", addrmode6align64or128>;
17050b57cec5SDimitry Andric
17060b57cec5SDimitry Andric// ...with address register writeback:
17070b57cec5SDimitry Andricmulticlass VST1DWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17080b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00, 0b0111,op7_4, (outs GPR:$wb),
17090b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListOneD:$Vd), IIC_VLD1u,
17100b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17110b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17120b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17130b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17140b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17150b57cec5SDimitry Andric  }
17160b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0111,op7_4, (outs GPR:$wb),
17170b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListOneD:$Vd),
17180b57cec5SDimitry Andric                        IIC_VLD1u,
17190b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17200b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST1]> {
17210b57cec5SDimitry Andric    let Inst{4} = Rn{4};
17220b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17230b57cec5SDimitry Andric  }
17240b57cec5SDimitry Andric}
17250b57cec5SDimitry Andricmulticlass VST1QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
17260b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17270b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListDPair:$Vd), IIC_VLD1x2u,
17280b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17290b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17300b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17310b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17320b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17330b57cec5SDimitry Andric  }
17340b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b1010,op7_4, (outs GPR:$wb),
17350b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListDPair:$Vd),
17360b57cec5SDimitry Andric                        IIC_VLD1x2u,
17370b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17380b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
17390b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17400b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17410b57cec5SDimitry Andric  }
17420b57cec5SDimitry Andric}
17430b57cec5SDimitry Andric
17440b57cec5SDimitry Andricdefm VST1d8wb  : VST1DWB<{0,0,0,?}, "8",  addrmode6align64>;
17450b57cec5SDimitry Andricdefm VST1d16wb : VST1DWB<{0,1,0,?}, "16", addrmode6align64>;
17460b57cec5SDimitry Andricdefm VST1d32wb : VST1DWB<{1,0,0,?}, "32", addrmode6align64>;
17470b57cec5SDimitry Andricdefm VST1d64wb : VST1DWB<{1,1,0,?}, "64", addrmode6align64>;
17480b57cec5SDimitry Andric
17490b57cec5SDimitry Andricdefm VST1q8wb  : VST1QWB<{0,0,?,?}, "8",  addrmode6align64or128>;
17500b57cec5SDimitry Andricdefm VST1q16wb : VST1QWB<{0,1,?,?}, "16", addrmode6align64or128>;
17510b57cec5SDimitry Andricdefm VST1q32wb : VST1QWB<{1,0,?,?}, "32", addrmode6align64or128>;
17520b57cec5SDimitry Andricdefm VST1q64wb : VST1QWB<{1,1,?,?}, "64", addrmode6align64or128>;
17530b57cec5SDimitry Andric
17540b57cec5SDimitry Andric// ...with 3 registers
17550b57cec5SDimitry Andricclass VST1D3<bits<4> op7_4, string Dt, Operand AddrMode>
17560b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0110, op7_4, (outs),
17570b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListThreeD:$Vd),
17580b57cec5SDimitry Andric          IIC_VST1x3, "vst1", Dt, "$Vd, $Rn", "", []>, Sched<[WriteVST3]> {
17590b57cec5SDimitry Andric  let Rm = 0b1111;
17600b57cec5SDimitry Andric  let Inst{4} = Rn{4};
17610b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
17620b57cec5SDimitry Andric}
17630b57cec5SDimitry Andricmulticlass VST1D3WB<bits<4> op7_4, string Dt, Operand AddrMode> {
17640b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
17650b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListThreeD:$Vd), IIC_VLD1x3u,
17660b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
17670b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
17680b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
17690b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17700b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17710b57cec5SDimitry Andric  }
17720b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0110,op7_4, (outs GPR:$wb),
17730b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListThreeD:$Vd),
17740b57cec5SDimitry Andric                        IIC_VLD1x3u,
17750b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
17760b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
17770b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
17780b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
17790b57cec5SDimitry Andric  }
17800b57cec5SDimitry Andric}
17810b57cec5SDimitry Andric
17820b57cec5SDimitry Andricdef VST1d8T     : VST1D3<{0,0,0,?}, "8",  addrmode6align64>;
17830b57cec5SDimitry Andricdef VST1d16T    : VST1D3<{0,1,0,?}, "16", addrmode6align64>;
17840b57cec5SDimitry Andricdef VST1d32T    : VST1D3<{1,0,0,?}, "32", addrmode6align64>;
17850b57cec5SDimitry Andricdef VST1d64T    : VST1D3<{1,1,0,?}, "64", addrmode6align64>;
17860b57cec5SDimitry Andric
17870b57cec5SDimitry Andricdefm VST1d8Twb  : VST1D3WB<{0,0,0,?}, "8",  addrmode6align64>;
17880b57cec5SDimitry Andricdefm VST1d16Twb : VST1D3WB<{0,1,0,?}, "16", addrmode6align64>;
17890b57cec5SDimitry Andricdefm VST1d32Twb : VST1D3WB<{1,0,0,?}, "32", addrmode6align64>;
17900b57cec5SDimitry Andricdefm VST1d64Twb : VST1D3WB<{1,1,0,?}, "64", addrmode6align64>;
17910b57cec5SDimitry Andric
17920b57cec5SDimitry Andricdef VST1d8TPseudo             : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
17930b57cec5SDimitry Andricdef VST1d16TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
17940b57cec5SDimitry Andricdef VST1d32TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
17950b57cec5SDimitry Andricdef VST1d64TPseudo            : VSTQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
17960b57cec5SDimitry Andricdef VST1d64TPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
17970b57cec5SDimitry Andricdef VST1d64TPseudoWB_register : VSTQQWBPseudo<IIC_VST1x3u>, Sched<[WriteVST3]>;
17980b57cec5SDimitry Andric
17990b57cec5SDimitry Andricdef VST1q8HighTPseudo     : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18000b57cec5SDimitry Andricdef VST1q8LowTPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18010b57cec5SDimitry Andricdef VST1q16HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18020b57cec5SDimitry Andricdef VST1q16LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18030b57cec5SDimitry Andricdef VST1q32HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18040b57cec5SDimitry Andricdef VST1q32LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18050b57cec5SDimitry Andricdef VST1q64HighTPseudo    : VSTQQQQPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18060b57cec5SDimitry Andricdef VST1q64LowTPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x3>, Sched<[WriteVST3]>;
18070b57cec5SDimitry Andric
18080b57cec5SDimitry Andric// ...with 4 registers
18090b57cec5SDimitry Andricclass VST1D4<bits<4> op7_4, string Dt, Operand AddrMode>
18100b57cec5SDimitry Andric  : NLdSt<0, 0b00, 0b0010, op7_4, (outs),
18110b57cec5SDimitry Andric          (ins AddrMode:$Rn, VecListFourD:$Vd),
18120b57cec5SDimitry Andric          IIC_VST1x4, "vst1", Dt, "$Vd, $Rn", "",
18130b57cec5SDimitry Andric          []>, Sched<[WriteVST4]> {
18140b57cec5SDimitry Andric  let Rm = 0b1111;
18150b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
18160b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST1Instruction";
18170b57cec5SDimitry Andric}
18180b57cec5SDimitry Andricmulticlass VST1D4WB<bits<4> op7_4, string Dt, Operand AddrMode> {
18190b57cec5SDimitry Andric  def _fixed : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18200b57cec5SDimitry Andric                    (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1x4u,
18210b57cec5SDimitry Andric                     "vst1", Dt, "$Vd, $Rn!",
18220b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18230b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
18240b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18250b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18260b57cec5SDimitry Andric  }
18270b57cec5SDimitry Andric  def _register : NLdSt<0,0b00,0b0010,op7_4, (outs GPR:$wb),
18280b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
18290b57cec5SDimitry Andric                        IIC_VLD1x4u,
18300b57cec5SDimitry Andric                        "vst1", Dt, "$Vd, $Rn, $Rm",
18310b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
18320b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
18330b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST1Instruction";
18340b57cec5SDimitry Andric  }
18350b57cec5SDimitry Andric}
18360b57cec5SDimitry Andric
18370b57cec5SDimitry Andricdef VST1d8Q     : VST1D4<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18380b57cec5SDimitry Andricdef VST1d16Q    : VST1D4<{0,1,?,?}, "16", addrmode6align64or128or256>;
18390b57cec5SDimitry Andricdef VST1d32Q    : VST1D4<{1,0,?,?}, "32", addrmode6align64or128or256>;
18400b57cec5SDimitry Andricdef VST1d64Q    : VST1D4<{1,1,?,?}, "64", addrmode6align64or128or256>;
18410b57cec5SDimitry Andric
18420b57cec5SDimitry Andricdefm VST1d8Qwb  : VST1D4WB<{0,0,?,?}, "8",  addrmode6align64or128or256>;
18430b57cec5SDimitry Andricdefm VST1d16Qwb : VST1D4WB<{0,1,?,?}, "16", addrmode6align64or128or256>;
18440b57cec5SDimitry Andricdefm VST1d32Qwb : VST1D4WB<{1,0,?,?}, "32", addrmode6align64or128or256>;
18450b57cec5SDimitry Andricdefm VST1d64Qwb : VST1D4WB<{1,1,?,?}, "64", addrmode6align64or128or256>;
18460b57cec5SDimitry Andric
18470b57cec5SDimitry Andricdef VST1d8QPseudo             : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18480b57cec5SDimitry Andricdef VST1d16QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18490b57cec5SDimitry Andricdef VST1d32QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18500b57cec5SDimitry Andricdef VST1d64QPseudo            : VSTQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18510b57cec5SDimitry Andricdef VST1d64QPseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18520b57cec5SDimitry Andricdef VST1d64QPseudoWB_register : VSTQQWBPseudo<IIC_VST1x4u>, Sched<[WriteVST4]>;
18530b57cec5SDimitry Andric
18540b57cec5SDimitry Andricdef VST1q8HighQPseudo     : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18550b57cec5SDimitry Andricdef VST1q8LowQPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18560b57cec5SDimitry Andricdef VST1q16HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18570b57cec5SDimitry Andricdef VST1q16LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18580b57cec5SDimitry Andricdef VST1q32HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18590b57cec5SDimitry Andricdef VST1q32LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18600b57cec5SDimitry Andricdef VST1q64HighQPseudo    : VSTQQQQPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18610b57cec5SDimitry Andricdef VST1q64LowQPseudo_UPD : VSTQQQQWBPseudo<IIC_VST1x4>, Sched<[WriteVST4]>;
18620b57cec5SDimitry Andric
18630b57cec5SDimitry Andric//   VST2     : Vector Store (multiple 2-element structures)
18640b57cec5SDimitry Andricclass VST2<bits<4> op11_8, bits<4> op7_4, string Dt, RegisterOperand VdTy,
18650b57cec5SDimitry Andric            InstrItinClass itin, Operand AddrMode>
18660b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs), (ins AddrMode:$Rn, VdTy:$Vd),
18670b57cec5SDimitry Andric          itin, "vst2", Dt, "$Vd, $Rn", "", []> {
18680b57cec5SDimitry Andric  let Rm = 0b1111;
18690b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
18700b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST2Instruction";
18710b57cec5SDimitry Andric}
18720b57cec5SDimitry Andric
18730b57cec5SDimitry Andricdef  VST2d8   : VST2<0b1000, {0,0,?,?}, "8",  VecListDPair, IIC_VST2,
18740b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
18750b57cec5SDimitry Andricdef  VST2d16  : VST2<0b1000, {0,1,?,?}, "16", VecListDPair, IIC_VST2,
18760b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
18770b57cec5SDimitry Andricdef  VST2d32  : VST2<0b1000, {1,0,?,?}, "32", VecListDPair, IIC_VST2,
18780b57cec5SDimitry Andric                     addrmode6align64or128>, Sched<[WriteVST2]>;
18790b57cec5SDimitry Andric
18800b57cec5SDimitry Andricdef  VST2q8   : VST2<0b0011, {0,0,?,?}, "8",  VecListFourD, IIC_VST2x2,
18810b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
18820b57cec5SDimitry Andricdef  VST2q16  : VST2<0b0011, {0,1,?,?}, "16", VecListFourD, IIC_VST2x2,
18830b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
18840b57cec5SDimitry Andricdef  VST2q32  : VST2<0b0011, {1,0,?,?}, "32", VecListFourD, IIC_VST2x2,
18850b57cec5SDimitry Andric                     addrmode6align64or128or256>, Sched<[WriteVST4]>;
18860b57cec5SDimitry Andric
18870b57cec5SDimitry Andricdef  VST2q8Pseudo  : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
18880b57cec5SDimitry Andricdef  VST2q16Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
18890b57cec5SDimitry Andricdef  VST2q32Pseudo : VSTQQPseudo<IIC_VST2x2>, Sched<[WriteVST4]>;
18900b57cec5SDimitry Andric
18910b57cec5SDimitry Andric// ...with address register writeback:
18920b57cec5SDimitry Andricmulticlass VST2DWB<bits<4> op11_8, bits<4> op7_4, string Dt,
18930b57cec5SDimitry Andric                   RegisterOperand VdTy, Operand AddrMode> {
18940b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
18950b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VdTy:$Vd), IIC_VLD1u,
18960b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
18970b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
18980b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
18990b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19000b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19010b57cec5SDimitry Andric  }
19020b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19030b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VdTy:$Vd), IIC_VLD1u,
19040b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19050b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST2]> {
19060b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19070b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19080b57cec5SDimitry Andric  }
19090b57cec5SDimitry Andric}
19100b57cec5SDimitry Andricmulticlass VST2QWB<bits<4> op7_4, string Dt, Operand AddrMode> {
19110b57cec5SDimitry Andric  def _fixed : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19120b57cec5SDimitry Andric                     (ins AddrMode:$Rn, VecListFourD:$Vd), IIC_VLD1u,
19130b57cec5SDimitry Andric                     "vst2", Dt, "$Vd, $Rn!",
19140b57cec5SDimitry Andric                     "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19150b57cec5SDimitry Andric    let Rm = 0b1101; // NLdSt will assign to the right encoding bits.
19160b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19170b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19180b57cec5SDimitry Andric  }
19190b57cec5SDimitry Andric  def _register : NLdSt<0, 0b00, 0b0011, op7_4, (outs GPR:$wb),
19200b57cec5SDimitry Andric                        (ins AddrMode:$Rn, rGPR:$Rm, VecListFourD:$Vd),
19210b57cec5SDimitry Andric                        IIC_VLD1u,
19220b57cec5SDimitry Andric                        "vst2", Dt, "$Vd, $Rn, $Rm",
19230b57cec5SDimitry Andric                        "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
19240b57cec5SDimitry Andric    let Inst{5-4} = Rn{5-4};
19250b57cec5SDimitry Andric    let DecoderMethod = "DecodeVLDST2Instruction";
19260b57cec5SDimitry Andric  }
19270b57cec5SDimitry Andric}
19280b57cec5SDimitry Andric
19290b57cec5SDimitry Andricdefm VST2d8wb    : VST2DWB<0b1000, {0,0,?,?}, "8",  VecListDPair,
19300b57cec5SDimitry Andric                           addrmode6align64or128>;
19310b57cec5SDimitry Andricdefm VST2d16wb   : VST2DWB<0b1000, {0,1,?,?}, "16", VecListDPair,
19320b57cec5SDimitry Andric                           addrmode6align64or128>;
19330b57cec5SDimitry Andricdefm VST2d32wb   : VST2DWB<0b1000, {1,0,?,?}, "32", VecListDPair,
19340b57cec5SDimitry Andric                           addrmode6align64or128>;
19350b57cec5SDimitry Andric
19360b57cec5SDimitry Andricdefm VST2q8wb    : VST2QWB<{0,0,?,?}, "8", addrmode6align64or128or256>;
19370b57cec5SDimitry Andricdefm VST2q16wb   : VST2QWB<{0,1,?,?}, "16", addrmode6align64or128or256>;
19380b57cec5SDimitry Andricdefm VST2q32wb   : VST2QWB<{1,0,?,?}, "32", addrmode6align64or128or256>;
19390b57cec5SDimitry Andric
19400b57cec5SDimitry Andricdef VST2q8PseudoWB_fixed     : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19410b57cec5SDimitry Andricdef VST2q16PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19420b57cec5SDimitry Andricdef VST2q32PseudoWB_fixed    : VSTQQWBfixedPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19430b57cec5SDimitry Andricdef VST2q8PseudoWB_register  : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19440b57cec5SDimitry Andricdef VST2q16PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19450b57cec5SDimitry Andricdef VST2q32PseudoWB_register : VSTQQWBregisterPseudo<IIC_VST2x2u>, Sched<[WriteVST4]>;
19460b57cec5SDimitry Andric
19470b57cec5SDimitry Andric// ...with double-spaced registers
19480b57cec5SDimitry Andricdef VST2b8      : VST2<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced, IIC_VST2,
19490b57cec5SDimitry Andric                      addrmode6align64or128>;
19500b57cec5SDimitry Andricdef VST2b16     : VST2<0b1001, {0,1,?,?}, "16", VecListDPairSpaced, IIC_VST2,
19510b57cec5SDimitry Andric                      addrmode6align64or128>;
19520b57cec5SDimitry Andricdef VST2b32     : VST2<0b1001, {1,0,?,?}, "32", VecListDPairSpaced, IIC_VST2,
19530b57cec5SDimitry Andric                      addrmode6align64or128>;
19540b57cec5SDimitry Andricdefm VST2b8wb   : VST2DWB<0b1001, {0,0,?,?}, "8",  VecListDPairSpaced,
19550b57cec5SDimitry Andric                          addrmode6align64or128>;
19560b57cec5SDimitry Andricdefm VST2b16wb  : VST2DWB<0b1001, {0,1,?,?}, "16", VecListDPairSpaced,
19570b57cec5SDimitry Andric                          addrmode6align64or128>;
19580b57cec5SDimitry Andricdefm VST2b32wb  : VST2DWB<0b1001, {1,0,?,?}, "32", VecListDPairSpaced,
19590b57cec5SDimitry Andric                          addrmode6align64or128>;
19600b57cec5SDimitry Andric
19610b57cec5SDimitry Andric//   VST3     : Vector Store (multiple 3-element structures)
19620b57cec5SDimitry Andricclass VST3D<bits<4> op11_8, bits<4> op7_4, string Dt>
19630b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
19640b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3,
19650b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn", "", []>, Sched<[WriteVST3]> {
19660b57cec5SDimitry Andric  let Rm = 0b1111;
19670b57cec5SDimitry Andric  let Inst{4} = Rn{4};
19680b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
19690b57cec5SDimitry Andric}
19700b57cec5SDimitry Andric
19710b57cec5SDimitry Andricdef  VST3d8   : VST3D<0b0100, {0,0,0,?}, "8">;
19720b57cec5SDimitry Andricdef  VST3d16  : VST3D<0b0100, {0,1,0,?}, "16">;
19730b57cec5SDimitry Andricdef  VST3d32  : VST3D<0b0100, {1,0,0,?}, "32">;
19740b57cec5SDimitry Andric
19750b57cec5SDimitry Andricdef  VST3d8Pseudo  : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
19760b57cec5SDimitry Andricdef  VST3d16Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
19770b57cec5SDimitry Andricdef  VST3d32Pseudo : VSTQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
19780b57cec5SDimitry Andric
19790b57cec5SDimitry Andric// ...with address register writeback:
19800b57cec5SDimitry Andricclass VST3DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
19810b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
19820b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
19830b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3), IIC_VST3u,
19840b57cec5SDimitry Andric          "vst3", Dt, "\\{$Vd, $src2, $src3\\}, $Rn$Rm",
19850b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST3]> {
19860b57cec5SDimitry Andric  let Inst{4} = Rn{4};
19870b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST3Instruction";
19880b57cec5SDimitry Andric}
19890b57cec5SDimitry Andric
19900b57cec5SDimitry Andricdef VST3d8_UPD  : VST3DWB<0b0100, {0,0,0,?}, "8">;
19910b57cec5SDimitry Andricdef VST3d16_UPD : VST3DWB<0b0100, {0,1,0,?}, "16">;
19920b57cec5SDimitry Andricdef VST3d32_UPD : VST3DWB<0b0100, {1,0,0,?}, "32">;
19930b57cec5SDimitry Andric
19940b57cec5SDimitry Andricdef VST3d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
19950b57cec5SDimitry Andricdef VST3d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
19960b57cec5SDimitry Andricdef VST3d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
19970b57cec5SDimitry Andric
19980b57cec5SDimitry Andric// ...with double-spaced registers:
19990b57cec5SDimitry Andricdef VST3q8      : VST3D<0b0101, {0,0,0,?}, "8">;
20000b57cec5SDimitry Andricdef VST3q16     : VST3D<0b0101, {0,1,0,?}, "16">;
20010b57cec5SDimitry Andricdef VST3q32     : VST3D<0b0101, {1,0,0,?}, "32">;
20020b57cec5SDimitry Andricdef VST3q8_UPD  : VST3DWB<0b0101, {0,0,0,?}, "8">;
20030b57cec5SDimitry Andricdef VST3q16_UPD : VST3DWB<0b0101, {0,1,0,?}, "16">;
20040b57cec5SDimitry Andricdef VST3q32_UPD : VST3DWB<0b0101, {1,0,0,?}, "32">;
20050b57cec5SDimitry Andric
20060b57cec5SDimitry Andricdef VST3q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20070b57cec5SDimitry Andricdef VST3q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20080b57cec5SDimitry Andricdef VST3q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20090b57cec5SDimitry Andric
20100b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
20110b57cec5SDimitry Andricdef VST3q8oddPseudo   : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20120b57cec5SDimitry Andricdef VST3q16oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20130b57cec5SDimitry Andricdef VST3q32oddPseudo  : VSTQQQQPseudo<IIC_VST3>, Sched<[WriteVST3]>;
20140b57cec5SDimitry Andric
20150b57cec5SDimitry Andricdef VST3q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20160b57cec5SDimitry Andricdef VST3q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20170b57cec5SDimitry Andricdef VST3q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST3u>, Sched<[WriteVST3]>;
20180b57cec5SDimitry Andric
20190b57cec5SDimitry Andric//   VST4     : Vector Store (multiple 4-element structures)
20200b57cec5SDimitry Andricclass VST4D<bits<4> op11_8, bits<4> op7_4, string Dt>
20210b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs),
20220b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4),
20230b57cec5SDimitry Andric          IIC_VST4, "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn",
20240b57cec5SDimitry Andric          "", []>, Sched<[WriteVST4]> {
20250b57cec5SDimitry Andric  let Rm = 0b1111;
20260b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
20270b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
20280b57cec5SDimitry Andric}
20290b57cec5SDimitry Andric
20300b57cec5SDimitry Andricdef  VST4d8   : VST4D<0b0000, {0,0,?,?}, "8">;
20310b57cec5SDimitry Andricdef  VST4d16  : VST4D<0b0000, {0,1,?,?}, "16">;
20320b57cec5SDimitry Andricdef  VST4d32  : VST4D<0b0000, {1,0,?,?}, "32">;
20330b57cec5SDimitry Andric
20340b57cec5SDimitry Andricdef  VST4d8Pseudo  : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20350b57cec5SDimitry Andricdef  VST4d16Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20360b57cec5SDimitry Andricdef  VST4d32Pseudo : VSTQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20370b57cec5SDimitry Andric
20380b57cec5SDimitry Andric// ...with address register writeback:
20390b57cec5SDimitry Andricclass VST4DWB<bits<4> op11_8, bits<4> op7_4, string Dt>
20400b57cec5SDimitry Andric  : NLdSt<0, 0b00, op11_8, op7_4, (outs GPR:$wb),
20410b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
20420b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4), IIC_VST4u,
20430b57cec5SDimitry Andric           "vst4", Dt, "\\{$Vd, $src2, $src3, $src4\\}, $Rn$Rm",
20440b57cec5SDimitry Andric          "$Rn.addr = $wb", []>, Sched<[WriteVST4]> {
20450b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
20460b57cec5SDimitry Andric  let DecoderMethod = "DecodeVLDST4Instruction";
20470b57cec5SDimitry Andric}
20480b57cec5SDimitry Andric
20490b57cec5SDimitry Andricdef VST4d8_UPD  : VST4DWB<0b0000, {0,0,?,?}, "8">;
20500b57cec5SDimitry Andricdef VST4d16_UPD : VST4DWB<0b0000, {0,1,?,?}, "16">;
20510b57cec5SDimitry Andricdef VST4d32_UPD : VST4DWB<0b0000, {1,0,?,?}, "32">;
20520b57cec5SDimitry Andric
20530b57cec5SDimitry Andricdef VST4d8Pseudo_UPD  : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20540b57cec5SDimitry Andricdef VST4d16Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20550b57cec5SDimitry Andricdef VST4d32Pseudo_UPD : VSTQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20560b57cec5SDimitry Andric
20570b57cec5SDimitry Andric// ...with double-spaced registers:
20580b57cec5SDimitry Andricdef VST4q8      : VST4D<0b0001, {0,0,?,?}, "8">;
20590b57cec5SDimitry Andricdef VST4q16     : VST4D<0b0001, {0,1,?,?}, "16">;
20600b57cec5SDimitry Andricdef VST4q32     : VST4D<0b0001, {1,0,?,?}, "32">;
20610b57cec5SDimitry Andricdef VST4q8_UPD  : VST4DWB<0b0001, {0,0,?,?}, "8">;
20620b57cec5SDimitry Andricdef VST4q16_UPD : VST4DWB<0b0001, {0,1,?,?}, "16">;
20630b57cec5SDimitry Andricdef VST4q32_UPD : VST4DWB<0b0001, {1,0,?,?}, "32">;
20640b57cec5SDimitry Andric
20650b57cec5SDimitry Andricdef VST4q8Pseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20660b57cec5SDimitry Andricdef VST4q16Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20670b57cec5SDimitry Andricdef VST4q32Pseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20680b57cec5SDimitry Andric
20690b57cec5SDimitry Andric// ...alternate versions to be allocated odd register numbers:
20700b57cec5SDimitry Andricdef VST4q8oddPseudo   : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20710b57cec5SDimitry Andricdef VST4q16oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20720b57cec5SDimitry Andricdef VST4q32oddPseudo  : VSTQQQQPseudo<IIC_VST4>, Sched<[WriteVST4]>;
20730b57cec5SDimitry Andric
20740b57cec5SDimitry Andricdef VST4q8oddPseudo_UPD  : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20750b57cec5SDimitry Andricdef VST4q16oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20760b57cec5SDimitry Andricdef VST4q32oddPseudo_UPD : VSTQQQQWBPseudo<IIC_VST4u>, Sched<[WriteVST4]>;
20770b57cec5SDimitry Andric
20780b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
20790b57cec5SDimitry Andric
20800b57cec5SDimitry Andric// Classes for VST*LN pseudo-instructions with multi-register operands.
20810b57cec5SDimitry Andric// These are expanded to real instructions after register allocation.
20820b57cec5SDimitry Andricclass VSTQLNPseudo<InstrItinClass itin>
20830b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QPR:$src, nohash_imm:$lane),
20840b57cec5SDimitry Andric                itin, "">;
20850b57cec5SDimitry Andricclass VSTQLNWBPseudo<InstrItinClass itin>
20860b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
20870b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QPR:$src,
20880b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
20890b57cec5SDimitry Andricclass VSTQQLNPseudo<InstrItinClass itin>
20900b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQPR:$src, nohash_imm:$lane),
20910b57cec5SDimitry Andric                itin, "">;
20920b57cec5SDimitry Andricclass VSTQQLNWBPseudo<InstrItinClass itin>
20930b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
20940b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQPR:$src,
20950b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
20960b57cec5SDimitry Andricclass VSTQQQQLNPseudo<InstrItinClass itin>
20970b57cec5SDimitry Andric  : PseudoNLdSt<(outs), (ins addrmode6:$addr, QQQQPR:$src, nohash_imm:$lane),
20980b57cec5SDimitry Andric                itin, "">;
20990b57cec5SDimitry Andricclass VSTQQQQLNWBPseudo<InstrItinClass itin>
21000b57cec5SDimitry Andric  : PseudoNLdSt<(outs GPR:$wb),
21010b57cec5SDimitry Andric                (ins addrmode6:$addr, am6offset:$offset, QQQQPR:$src,
21020b57cec5SDimitry Andric                 nohash_imm:$lane), itin, "$addr.addr = $wb">;
21030b57cec5SDimitry Andric
21040b57cec5SDimitry Andric//   VST1LN   : Vector Store (single element from one lane)
21050b57cec5SDimitry Andricclass VST1LN<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
21060b57cec5SDimitry Andric             PatFrag StoreOp, SDNode ExtractOp, Operand AddrMode>
21070b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
21080b57cec5SDimitry Andric          (ins AddrMode:$Rn, DPR:$Vd, nohash_imm:$lane),
21090b57cec5SDimitry Andric          IIC_VST1ln, "vst1", Dt, "\\{$Vd[$lane]\\}, $Rn", "",
21100b57cec5SDimitry Andric          [(StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane), AddrMode:$Rn)]>,
21110b57cec5SDimitry Andric     Sched<[WriteVST1]> {
21120b57cec5SDimitry Andric  let Rm = 0b1111;
21130b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
21140b57cec5SDimitry Andric}
21150b57cec5SDimitry Andricclass VST1QLNPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
21160b57cec5SDimitry Andric  : VSTQLNPseudo<IIC_VST1ln>, Sched<[WriteVST1]> {
21170b57cec5SDimitry Andric  let Pattern = [(StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
21180b57cec5SDimitry Andric                          addrmode6:$addr)];
21190b57cec5SDimitry Andric}
21200b57cec5SDimitry Andric
21210b57cec5SDimitry Andricdef VST1LNd8  : VST1LN<0b0000, {?,?,?,0}, "8", v8i8, truncstorei8,
21220b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21230b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
21240b57cec5SDimitry Andric}
21250b57cec5SDimitry Andricdef VST1LNd16 : VST1LN<0b0100, {?,?,0,?}, "16", v4i16, truncstorei16,
21260b57cec5SDimitry Andric                       ARMvgetlaneu, addrmode6> {
21270b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
21280b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
21290b57cec5SDimitry Andric}
21300b57cec5SDimitry Andric
21310b57cec5SDimitry Andricdef VST1LNd32 : VST1LN<0b1000, {?,0,?,?}, "32", v2i32, store, extractelt,
21320b57cec5SDimitry Andric                       addrmode6oneL32> {
21330b57cec5SDimitry Andric  let Inst{7}   = lane{0};
21340b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
21350b57cec5SDimitry Andric}
21360b57cec5SDimitry Andric
21370b57cec5SDimitry Andricdef VST1LNq8Pseudo  : VST1QLNPseudo<v16i8, truncstorei8, ARMvgetlaneu>;
21380b57cec5SDimitry Andricdef VST1LNq16Pseudo : VST1QLNPseudo<v8i16, truncstorei16, ARMvgetlaneu>;
21390b57cec5SDimitry Andricdef VST1LNq32Pseudo : VST1QLNPseudo<v4i32, store, extractelt>;
21400b57cec5SDimitry Andric
21410b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
21420b57cec5SDimitry Andricdef : Pat<(store (extractelt (v2f32 DPR:$src), imm:$lane), addrmode6:$addr),
21430b57cec5SDimitry Andric          (VST1LNd32 addrmode6:$addr, DPR:$src, imm:$lane)>;
21440b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f32 QPR:$src), imm:$lane), addrmode6:$addr),
21450b57cec5SDimitry Andric          (VST1LNq32Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
21460b57cec5SDimitry Andric
21470b57cec5SDimitry Andricdef : Pat<(store (extractelt (v4f16 DPR:$src), imm:$lane), addrmode6:$addr),
21480b57cec5SDimitry Andric          (VST1LNd16 addrmode6:$addr, DPR:$src, imm:$lane)>;
21490b57cec5SDimitry Andricdef : Pat<(store (extractelt (v8f16 QPR:$src), imm:$lane), addrmode6:$addr),
21500b57cec5SDimitry Andric          (VST1LNq16Pseudo addrmode6:$addr, QPR:$src, imm:$lane)>;
21510b57cec5SDimitry Andric}
21520b57cec5SDimitry Andric
21530b57cec5SDimitry Andric// ...with address register writeback:
21540b57cec5SDimitry Andricclass VST1LNWB<bits<4> op11_8, bits<4> op7_4, string Dt, ValueType Ty,
21550b57cec5SDimitry Andric               PatFrag StoreOp, SDNode ExtractOp, Operand AdrMode>
21560b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
21570b57cec5SDimitry Andric          (ins AdrMode:$Rn, am6offset:$Rm,
21580b57cec5SDimitry Andric           DPR:$Vd, nohash_imm:$lane), IIC_VST1lnu, "vst1", Dt,
21590b57cec5SDimitry Andric          "\\{$Vd[$lane]\\}, $Rn$Rm",
21600b57cec5SDimitry Andric          "$Rn.addr = $wb",
21610b57cec5SDimitry Andric          [(set GPR:$wb, (StoreOp (ExtractOp (Ty DPR:$Vd), imm:$lane),
21620b57cec5SDimitry Andric                                  AdrMode:$Rn, am6offset:$Rm))]>,
21630b57cec5SDimitry Andric    Sched<[WriteVST1]> {
21640b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST1LN";
21650b57cec5SDimitry Andric}
21660b57cec5SDimitry Andricclass VST1QLNWBPseudo<ValueType Ty, PatFrag StoreOp, SDNode ExtractOp>
21670b57cec5SDimitry Andric  : VSTQLNWBPseudo<IIC_VST1lnu>, Sched<[WriteVST1]> {
21680b57cec5SDimitry Andric  let Pattern = [(set GPR:$wb, (StoreOp (ExtractOp (Ty QPR:$src), imm:$lane),
21690b57cec5SDimitry Andric                                        addrmode6:$addr, am6offset:$offset))];
21700b57cec5SDimitry Andric}
21710b57cec5SDimitry Andric
21720b57cec5SDimitry Andricdef VST1LNd8_UPD  : VST1LNWB<0b0000, {?,?,?,0}, "8", v8i8, post_truncsti8,
21730b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
21740b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
21750b57cec5SDimitry Andric}
21760b57cec5SDimitry Andricdef VST1LNd16_UPD : VST1LNWB<0b0100, {?,?,0,?}, "16", v4i16, post_truncsti16,
21770b57cec5SDimitry Andric                             ARMvgetlaneu, addrmode6> {
21780b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
21790b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
21800b57cec5SDimitry Andric}
21810b57cec5SDimitry Andricdef VST1LNd32_UPD : VST1LNWB<0b1000, {?,0,?,?}, "32", v2i32, post_store,
21820b57cec5SDimitry Andric                             extractelt, addrmode6oneL32> {
21830b57cec5SDimitry Andric  let Inst{7}   = lane{0};
21840b57cec5SDimitry Andric  let Inst{5-4} = Rn{5-4};
21850b57cec5SDimitry Andric}
21860b57cec5SDimitry Andric
21870b57cec5SDimitry Andricdef VST1LNq8Pseudo_UPD  : VST1QLNWBPseudo<v16i8, post_truncsti8, ARMvgetlaneu>;
21880b57cec5SDimitry Andricdef VST1LNq16Pseudo_UPD : VST1QLNWBPseudo<v8i16, post_truncsti16,ARMvgetlaneu>;
21890b57cec5SDimitry Andricdef VST1LNq32Pseudo_UPD : VST1QLNWBPseudo<v4i32, post_store, extractelt>;
21900b57cec5SDimitry Andric
21910b57cec5SDimitry Andriclet mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1 in {
21920b57cec5SDimitry Andric
21930b57cec5SDimitry Andric//   VST2LN   : Vector Store (single 2-element structure from one lane)
21940b57cec5SDimitry Andricclass VST2LN<bits<4> op11_8, bits<4> op7_4, string Dt>
21950b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
21960b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, nohash_imm:$lane),
21970b57cec5SDimitry Andric          IIC_VST2ln, "vst2", Dt, "\\{$Vd[$lane], $src2[$lane]\\}, $Rn",
21980b57cec5SDimitry Andric          "", []>, Sched<[WriteVST1]> {
21990b57cec5SDimitry Andric  let Rm = 0b1111;
22000b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22010b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22020b57cec5SDimitry Andric}
22030b57cec5SDimitry Andric
22040b57cec5SDimitry Andricdef VST2LNd8  : VST2LN<0b0001, {?,?,?,?}, "8"> {
22050b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22060b57cec5SDimitry Andric}
22070b57cec5SDimitry Andricdef VST2LNd16 : VST2LN<0b0101, {?,?,0,?}, "16"> {
22080b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22090b57cec5SDimitry Andric}
22100b57cec5SDimitry Andricdef VST2LNd32 : VST2LN<0b1001, {?,0,0,?}, "32"> {
22110b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22120b57cec5SDimitry Andric}
22130b57cec5SDimitry Andric
22140b57cec5SDimitry Andricdef VST2LNd8Pseudo  : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22150b57cec5SDimitry Andricdef VST2LNd16Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22160b57cec5SDimitry Andricdef VST2LNd32Pseudo : VSTQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22170b57cec5SDimitry Andric
22180b57cec5SDimitry Andric// ...with double-spaced registers:
22190b57cec5SDimitry Andricdef VST2LNq16 : VST2LN<0b0101, {?,?,1,?}, "16"> {
22200b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22210b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22220b57cec5SDimitry Andric}
22230b57cec5SDimitry Andricdef VST2LNq32 : VST2LN<0b1001, {?,1,0,?}, "32"> {
22240b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22250b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22260b57cec5SDimitry Andric}
22270b57cec5SDimitry Andric
22280b57cec5SDimitry Andricdef VST2LNq16Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22290b57cec5SDimitry Andricdef VST2LNq32Pseudo : VSTQQLNPseudo<IIC_VST2ln>, Sched<[WriteVST1]>;
22300b57cec5SDimitry Andric
22310b57cec5SDimitry Andric// ...with address register writeback:
22320b57cec5SDimitry Andricclass VST2LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
22330b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
22340b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
22350b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, nohash_imm:$lane), IIC_VST2lnu, "vst2", Dt,
22360b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane]\\}, $Rn$Rm",
22370b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
22380b57cec5SDimitry Andric  let Inst{4}   = Rn{4};
22390b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST2LN";
22400b57cec5SDimitry Andric}
22410b57cec5SDimitry Andric
22420b57cec5SDimitry Andricdef VST2LNd8_UPD  : VST2LNWB<0b0001, {?,?,?,?}, "8"> {
22430b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22440b57cec5SDimitry Andric}
22450b57cec5SDimitry Andricdef VST2LNd16_UPD : VST2LNWB<0b0101, {?,?,0,?}, "16"> {
22460b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22470b57cec5SDimitry Andric}
22480b57cec5SDimitry Andricdef VST2LNd32_UPD : VST2LNWB<0b1001, {?,0,0,?}, "32"> {
22490b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22500b57cec5SDimitry Andric}
22510b57cec5SDimitry Andric
22520b57cec5SDimitry Andricdef VST2LNd8Pseudo_UPD  : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22530b57cec5SDimitry Andricdef VST2LNd16Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22540b57cec5SDimitry Andricdef VST2LNd32Pseudo_UPD : VSTQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22550b57cec5SDimitry Andric
22560b57cec5SDimitry Andricdef VST2LNq16_UPD : VST2LNWB<0b0101, {?,?,1,?}, "16"> {
22570b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22580b57cec5SDimitry Andric}
22590b57cec5SDimitry Andricdef VST2LNq32_UPD : VST2LNWB<0b1001, {?,1,0,?}, "32"> {
22600b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22610b57cec5SDimitry Andric}
22620b57cec5SDimitry Andric
22630b57cec5SDimitry Andricdef VST2LNq16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22640b57cec5SDimitry Andricdef VST2LNq32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST2lnu>, Sched<[WriteVST1]>;
22650b57cec5SDimitry Andric
22660b57cec5SDimitry Andric//   VST3LN   : Vector Store (single 3-element structure from one lane)
22670b57cec5SDimitry Andricclass VST3LN<bits<4> op11_8, bits<4> op7_4, string Dt>
22680b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
22690b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3,
22700b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST3ln, "vst3", Dt,
22710b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn", "", []>,
22720b57cec5SDimitry Andric    Sched<[WriteVST2]> {
22730b57cec5SDimitry Andric  let Rm = 0b1111;
22740b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
22750b57cec5SDimitry Andric}
22760b57cec5SDimitry Andric
22770b57cec5SDimitry Andricdef VST3LNd8  : VST3LN<0b0010, {?,?,?,0}, "8"> {
22780b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
22790b57cec5SDimitry Andric}
22800b57cec5SDimitry Andricdef VST3LNd16 : VST3LN<0b0110, {?,?,0,0}, "16"> {
22810b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22820b57cec5SDimitry Andric}
22830b57cec5SDimitry Andricdef VST3LNd32 : VST3LN<0b1010, {?,0,0,0}, "32"> {
22840b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22850b57cec5SDimitry Andric}
22860b57cec5SDimitry Andric
22870b57cec5SDimitry Andricdef VST3LNd8Pseudo  : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
22880b57cec5SDimitry Andricdef VST3LNd16Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
22890b57cec5SDimitry Andricdef VST3LNd32Pseudo : VSTQQLNPseudo<IIC_VST3ln>, Sched<[WriteVST2]>;
22900b57cec5SDimitry Andric
22910b57cec5SDimitry Andric// ...with double-spaced registers:
22920b57cec5SDimitry Andricdef VST3LNq16 : VST3LN<0b0110, {?,?,1,0}, "16"> {
22930b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
22940b57cec5SDimitry Andric}
22950b57cec5SDimitry Andricdef VST3LNq32 : VST3LN<0b1010, {?,1,0,0}, "32"> {
22960b57cec5SDimitry Andric  let Inst{7}   = lane{0};
22970b57cec5SDimitry Andric}
22980b57cec5SDimitry Andric
22990b57cec5SDimitry Andricdef VST3LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23000b57cec5SDimitry Andricdef VST3LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST3ln>;
23010b57cec5SDimitry Andric
23020b57cec5SDimitry Andric// ...with address register writeback:
23030b57cec5SDimitry Andricclass VST3LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
23040b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
23050b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
23060b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, nohash_imm:$lane),
23070b57cec5SDimitry Andric          IIC_VST3lnu, "vst3", Dt,
23080b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane]\\}, $Rn$Rm",
23090b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
23100b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST3LN";
23110b57cec5SDimitry Andric}
23120b57cec5SDimitry Andric
23130b57cec5SDimitry Andricdef VST3LNd8_UPD  : VST3LNWB<0b0010, {?,?,?,0}, "8"> {
23140b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23150b57cec5SDimitry Andric}
23160b57cec5SDimitry Andricdef VST3LNd16_UPD : VST3LNWB<0b0110, {?,?,0,0}, "16"> {
23170b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23180b57cec5SDimitry Andric}
23190b57cec5SDimitry Andricdef VST3LNd32_UPD : VST3LNWB<0b1010, {?,0,0,0}, "32"> {
23200b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23210b57cec5SDimitry Andric}
23220b57cec5SDimitry Andric
23230b57cec5SDimitry Andricdef VST3LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23240b57cec5SDimitry Andricdef VST3LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23250b57cec5SDimitry Andricdef VST3LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23260b57cec5SDimitry Andric
23270b57cec5SDimitry Andricdef VST3LNq16_UPD : VST3LNWB<0b0110, {?,?,1,0}, "16"> {
23280b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23290b57cec5SDimitry Andric}
23300b57cec5SDimitry Andricdef VST3LNq32_UPD : VST3LNWB<0b1010, {?,1,0,0}, "32"> {
23310b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23320b57cec5SDimitry Andric}
23330b57cec5SDimitry Andric
23340b57cec5SDimitry Andricdef VST3LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23350b57cec5SDimitry Andricdef VST3LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST3lnu>, Sched<[WriteVST2]>;
23360b57cec5SDimitry Andric
23370b57cec5SDimitry Andric//   VST4LN   : Vector Store (single 4-element structure from one lane)
23380b57cec5SDimitry Andricclass VST4LN<bits<4> op11_8, bits<4> op7_4, string Dt>
23390b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs),
23400b57cec5SDimitry Andric          (ins addrmode6:$Rn, DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4,
23410b57cec5SDimitry Andric           nohash_imm:$lane), IIC_VST4ln, "vst4", Dt,
23420b57cec5SDimitry Andric          "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn",
23430b57cec5SDimitry Andric          "", []>, Sched<[WriteVST2]> {
23440b57cec5SDimitry Andric  let Rm = 0b1111;
23450b57cec5SDimitry Andric  let Inst{4} = Rn{4};
23460b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
23470b57cec5SDimitry Andric}
23480b57cec5SDimitry Andric
23490b57cec5SDimitry Andricdef VST4LNd8  : VST4LN<0b0011, {?,?,?,?}, "8"> {
23500b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23510b57cec5SDimitry Andric}
23520b57cec5SDimitry Andricdef VST4LNd16 : VST4LN<0b0111, {?,?,0,?}, "16"> {
23530b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23540b57cec5SDimitry Andric}
23550b57cec5SDimitry Andricdef VST4LNd32 : VST4LN<0b1011, {?,0,?,?}, "32"> {
23560b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23570b57cec5SDimitry Andric  let Inst{5} = Rn{5};
23580b57cec5SDimitry Andric}
23590b57cec5SDimitry Andric
23600b57cec5SDimitry Andricdef VST4LNd8Pseudo  : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
23610b57cec5SDimitry Andricdef VST4LNd16Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
23620b57cec5SDimitry Andricdef VST4LNd32Pseudo : VSTQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
23630b57cec5SDimitry Andric
23640b57cec5SDimitry Andric// ...with double-spaced registers:
23650b57cec5SDimitry Andricdef VST4LNq16 : VST4LN<0b0111, {?,?,1,?}, "16"> {
23660b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23670b57cec5SDimitry Andric}
23680b57cec5SDimitry Andricdef VST4LNq32 : VST4LN<0b1011, {?,1,?,?}, "32"> {
23690b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23700b57cec5SDimitry Andric  let Inst{5} = Rn{5};
23710b57cec5SDimitry Andric}
23720b57cec5SDimitry Andric
23730b57cec5SDimitry Andricdef VST4LNq16Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
23740b57cec5SDimitry Andricdef VST4LNq32Pseudo : VSTQQQQLNPseudo<IIC_VST4ln>, Sched<[WriteVST2]>;
23750b57cec5SDimitry Andric
23760b57cec5SDimitry Andric// ...with address register writeback:
23770b57cec5SDimitry Andricclass VST4LNWB<bits<4> op11_8, bits<4> op7_4, string Dt>
23780b57cec5SDimitry Andric  : NLdStLn<1, 0b00, op11_8, op7_4, (outs GPR:$wb),
23790b57cec5SDimitry Andric          (ins addrmode6:$Rn, am6offset:$Rm,
23800b57cec5SDimitry Andric           DPR:$Vd, DPR:$src2, DPR:$src3, DPR:$src4, nohash_imm:$lane),
23810b57cec5SDimitry Andric          IIC_VST4lnu, "vst4", Dt,
23820b57cec5SDimitry Andric  "\\{$Vd[$lane], $src2[$lane], $src3[$lane], $src4[$lane]\\}, $Rn$Rm",
23830b57cec5SDimitry Andric          "$Rn.addr = $wb", []> {
23840b57cec5SDimitry Andric  let Inst{4} = Rn{4};
23850b57cec5SDimitry Andric  let DecoderMethod = "DecodeVST4LN";
23860b57cec5SDimitry Andric}
23870b57cec5SDimitry Andric
23880b57cec5SDimitry Andricdef VST4LNd8_UPD  : VST4LNWB<0b0011, {?,?,?,?}, "8"> {
23890b57cec5SDimitry Andric  let Inst{7-5} = lane{2-0};
23900b57cec5SDimitry Andric}
23910b57cec5SDimitry Andricdef VST4LNd16_UPD : VST4LNWB<0b0111, {?,?,0,?}, "16"> {
23920b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
23930b57cec5SDimitry Andric}
23940b57cec5SDimitry Andricdef VST4LNd32_UPD : VST4LNWB<0b1011, {?,0,?,?}, "32"> {
23950b57cec5SDimitry Andric  let Inst{7}   = lane{0};
23960b57cec5SDimitry Andric  let Inst{5} = Rn{5};
23970b57cec5SDimitry Andric}
23980b57cec5SDimitry Andric
23990b57cec5SDimitry Andricdef VST4LNd8Pseudo_UPD  : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24000b57cec5SDimitry Andricdef VST4LNd16Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24010b57cec5SDimitry Andricdef VST4LNd32Pseudo_UPD : VSTQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24020b57cec5SDimitry Andric
24030b57cec5SDimitry Andricdef VST4LNq16_UPD : VST4LNWB<0b0111, {?,?,1,?}, "16"> {
24040b57cec5SDimitry Andric  let Inst{7-6} = lane{1-0};
24050b57cec5SDimitry Andric}
24060b57cec5SDimitry Andricdef VST4LNq32_UPD : VST4LNWB<0b1011, {?,1,?,?}, "32"> {
24070b57cec5SDimitry Andric  let Inst{7}   = lane{0};
24080b57cec5SDimitry Andric  let Inst{5} = Rn{5};
24090b57cec5SDimitry Andric}
24100b57cec5SDimitry Andric
24110b57cec5SDimitry Andricdef VST4LNq16Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24120b57cec5SDimitry Andricdef VST4LNq32Pseudo_UPD : VSTQQQQLNWBPseudo<IIC_VST4lnu>, Sched<[WriteVST2]>;
24130b57cec5SDimitry Andric
24140b57cec5SDimitry Andric} // mayStore = 1, hasSideEffects = 0, hasExtraSrcRegAllocReq = 1
24150b57cec5SDimitry Andric
24160b57cec5SDimitry Andric// Use vld1/vst1 for unaligned f64 load / store
24170b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
24180b57cec5SDimitry Andricdef : Pat<(f64 (hword_alignedload addrmode6:$addr)),
24190b57cec5SDimitry Andric          (VLD1d16 addrmode6:$addr)>;
24200b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (f64 DPR:$value), addrmode6:$addr),
24210b57cec5SDimitry Andric          (VST1d16 addrmode6:$addr, DPR:$value)>;
24220b57cec5SDimitry Andricdef : Pat<(f64 (byte_alignedload addrmode6:$addr)),
24230b57cec5SDimitry Andric          (VLD1d8 addrmode6:$addr)>;
24240b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (f64 DPR:$value), addrmode6:$addr),
24250b57cec5SDimitry Andric          (VST1d8 addrmode6:$addr, DPR:$value)>;
24260b57cec5SDimitry Andric}
24270b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
24280b57cec5SDimitry Andricdef : Pat<(f64 (non_word_alignedload addrmode6:$addr)),
24290b57cec5SDimitry Andric          (VLD1d64 addrmode6:$addr)>;
24300b57cec5SDimitry Andricdef : Pat<(non_word_alignedstore (f64 DPR:$value), addrmode6:$addr),
24310b57cec5SDimitry Andric          (VST1d64 addrmode6:$addr, DPR:$value)>;
24320b57cec5SDimitry Andric}
24330b57cec5SDimitry Andric
24340b57cec5SDimitry Andric// Use vld1/vst1 for Q and QQ. Also use them for unaligned v2f64
24350b57cec5SDimitry Andric// load / store if it's legal.
24360b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
24370b57cec5SDimitry Andricdef : Pat<(v2f64 (dword_alignedload addrmode6:$addr)),
24380b57cec5SDimitry Andric          (VLD1q64 addrmode6:$addr)>;
24390b57cec5SDimitry Andricdef : Pat<(dword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24400b57cec5SDimitry Andric          (VST1q64 addrmode6:$addr, QPR:$value)>;
24410b57cec5SDimitry Andric}
24420b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
24430b57cec5SDimitry Andricdef : Pat<(v2f64 (word_alignedload addrmode6:$addr)),
24440b57cec5SDimitry Andric          (VLD1q32 addrmode6:$addr)>;
24450b57cec5SDimitry Andricdef : Pat<(word_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24460b57cec5SDimitry Andric          (VST1q32 addrmode6:$addr, QPR:$value)>;
24470b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
24480b57cec5SDimitry Andric          (VLD1q16 addrmode6:$addr)>;
24490b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24500b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, QPR:$value)>;
24510b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
24520b57cec5SDimitry Andric          (VLD1q8 addrmode6:$addr)>;
24530b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
24540b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, QPR:$value)>;
24550b57cec5SDimitry Andric}
24560b57cec5SDimitry Andric
24570b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
24580b57cec5SDimitry Andric// Instruction Classes
24590b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
24600b57cec5SDimitry Andric
24610b57cec5SDimitry Andric// Basic 2-register operations: double- and quad-register.
24620b57cec5SDimitry Andricclass N2VD<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
24630b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
24640b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
24650b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
24660b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VUNAD, OpcodeStr, Dt,"$Vd, $Vm", "",
24670b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm))))]>;
24680b57cec5SDimitry Andricclass N2VQ<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
24690b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op4, string OpcodeStr,
24700b57cec5SDimitry Andric           string Dt, ValueType ResTy, ValueType OpTy, SDNode OpNode>
24710b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
24720b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VUNAQ, OpcodeStr, Dt,"$Vd, $Vm", "",
24730b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm))))]>;
24740b57cec5SDimitry Andric
24750b57cec5SDimitry Andric// Basic 2-register intrinsics, both double- and quad-register.
24760b57cec5SDimitry Andricclass N2VDInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
24770b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
24780b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
24790b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
24800b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
24810b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
24820b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
24830b57cec5SDimitry Andricclass N2VQInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
24840b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op4,
24850b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
24860b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
24870b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
24880b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
24890b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
24900b57cec5SDimitry Andric
24910b57cec5SDimitry Andric// Same as above, but not predicated.
24920b57cec5SDimitry Andricclass N2VDIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
24930b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
24940b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
24950b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 0,  (outs DPR:$Vd), (ins DPR:$Vm),
24960b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
24970b57cec5SDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
24980b57cec5SDimitry Andric
24990b57cec5SDimitry Andricclass N2VQIntnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op7,
25000b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25010b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25020b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, 1,  (outs QPR:$Vd), (ins QPR:$Vm),
25030b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25040b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25050b57cec5SDimitry Andric
25060b57cec5SDimitry Andric// Similar to NV2VQIntnp with some more encoding bits exposed (crypto).
25070b57cec5SDimitry Andricclass N2VQIntXnp<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25080b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25090b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25100b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,  (outs QPR:$Vd), (ins QPR:$Vm),
25110b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25120b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
25130b57cec5SDimitry Andric
25140b57cec5SDimitry Andric// Same as N2VQIntXnp but with Vd as a src register.
25150b57cec5SDimitry Andricclass N2VQIntX2np<bits<2> op19_18, bits<2> op17_16, bits<3> op10_8, bit op6,
25160b57cec5SDimitry Andric              bit op7, InstrItinClass itin, string OpcodeStr, string Dt,
25170b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
25180b57cec5SDimitry Andric  : N2Vnp<op19_18, op17_16, op10_8, op7, op6,
25190b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vm),
25200b57cec5SDimitry Andric          itin, OpcodeStr, Dt,
25210b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vm))))]> {
25220b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
25230b57cec5SDimitry Andric}
25240b57cec5SDimitry Andric
25250b57cec5SDimitry Andric// Narrow 2-register operations.
25260b57cec5SDimitry Andricclass N2VN<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25270b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25280b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25290b57cec5SDimitry Andric           ValueType TyD, ValueType TyQ, SDNode OpNode>
25300b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25310b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25320b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (OpNode (TyQ QPR:$Vm))))]>;
25330b57cec5SDimitry Andric
25340b57cec5SDimitry Andric// Narrow 2-register intrinsics.
25350b57cec5SDimitry Andricclass N2VNInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25360b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25370b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25380b57cec5SDimitry Andric              ValueType TyD, ValueType TyQ, SDPatternOperator IntOp>
25390b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs DPR:$Vd),
25400b57cec5SDimitry Andric        (ins QPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25410b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vm))))]>;
25420b57cec5SDimitry Andric
25430b57cec5SDimitry Andric// Long 2-register operations (currently only used for VMOVL).
25440b57cec5SDimitry Andricclass N2VL<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25450b57cec5SDimitry Andric           bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25460b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25470b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode>
25480b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
25490b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25500b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vm))))]>;
25510b57cec5SDimitry Andric
25520b57cec5SDimitry Andric// Long 2-register intrinsics.
25530b57cec5SDimitry Andricclass N2VLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
25540b57cec5SDimitry Andric              bits<2> op17_16, bits<5> op11_7, bit op6, bit op4,
25550b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
25560b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
25570b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, op6, op4, (outs QPR:$Vd),
25580b57cec5SDimitry Andric        (ins DPR:$Vm), itin, OpcodeStr, Dt, "$Vd, $Vm", "",
25590b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vm))))]>;
25600b57cec5SDimitry Andric
25610b57cec5SDimitry Andric// 2-register shuffles (VTRN/VZIP/VUZP), both double- and quad-register.
25620b57cec5SDimitry Andricclass N2VDShuffle<bits<2> op19_18, bits<5> op11_7, string OpcodeStr, string Dt>
25630b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 0, 0, (outs DPR:$Vd, DPR:$Vm),
25640b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$src2), IIC_VPERMD,
25650b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm",
25660b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
25670b57cec5SDimitry Andricclass N2VQShuffle<bits<2> op19_18, bits<5> op11_7,
25680b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt>
25690b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b10, op11_7, 1, 0, (outs QPR:$Vd, QPR:$Vm),
25700b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$src2), itin, OpcodeStr, Dt, "$Vd, $Vm",
25710b57cec5SDimitry Andric        "$src1 = $Vd, $src2 = $Vm", []>;
25720b57cec5SDimitry Andric
25730b57cec5SDimitry Andric// Basic 3-register operations: double- and quad-register.
25740b57cec5SDimitry Andricclass N3VD<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
25750b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
25760b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
25770b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
25780b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
25790b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
25800b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
25810b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
25820b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
25830b57cec5SDimitry Andric  let isCommutable = Commutable;
25840b57cec5SDimitry Andric}
25850b57cec5SDimitry Andric// Same as N3VD but no data type.
25860b57cec5SDimitry Andricclass N3VDX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
25870b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
25880b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy,
25890b57cec5SDimitry Andric           SDNode OpNode, bit Commutable>
25900b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 0, op4,
25910b57cec5SDimitry Andric         (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
25920b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
25930b57cec5SDimitry Andric         [(set DPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>{
25940b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
25950b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
25960b57cec5SDimitry Andric  let isCommutable = Commutable;
25970b57cec5SDimitry Andric}
25980b57cec5SDimitry Andric
25990b57cec5SDimitry Andricclass N3VDSL<bits<2> op21_20, bits<4> op11_8,
26000b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
26010b57cec5SDimitry Andric             ValueType Ty, SDNode ShOp>
26020b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
26030b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
26040b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
26050b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26060b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26070b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),imm:$lane)))))]> {
26080b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26090b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26100b57cec5SDimitry Andric  let isCommutable = 0;
26110b57cec5SDimitry Andric}
26120b57cec5SDimitry Andricclass N3VDSL16<bits<2> op21_20, bits<4> op11_8,
26130b57cec5SDimitry Andric               string OpcodeStr, string Dt, ValueType Ty, SDNode ShOp>
26140b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
26150b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
26160b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16D, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane","",
26170b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
26180b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$Vn),
26190b57cec5SDimitry Andric                        (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
26200b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26210b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26220b57cec5SDimitry Andric  let isCommutable = 0;
26230b57cec5SDimitry Andric}
26240b57cec5SDimitry Andric
26250b57cec5SDimitry Andricclass N3VQ<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26260b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
26270b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26280b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
26290b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
26300b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26310b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
26320b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26330b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26340b57cec5SDimitry Andric  let isCommutable = Commutable;
26350b57cec5SDimitry Andric}
26360b57cec5SDimitry Andricclass N3VQX<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26370b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr,
26380b57cec5SDimitry Andric           ValueType ResTy, ValueType OpTy, SDNode OpNode, bit Commutable>
26390b57cec5SDimitry Andric  : N3VX<op24, op23, op21_20, op11_8, 1, op4,
26400b57cec5SDimitry Andric         (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
26410b57cec5SDimitry Andric         OpcodeStr, "$Vd, $Vn, $Vm", "",
26420b57cec5SDimitry Andric         [(set QPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>{
26430b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26440b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26450b57cec5SDimitry Andric  let isCommutable = Commutable;
26460b57cec5SDimitry Andric}
26470b57cec5SDimitry Andricclass N3VQSL<bits<2> op21_20, bits<4> op11_8,
26480b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
26490b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, SDNode ShOp>
26500b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
26510b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
26520b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
26530b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
26540b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
26550b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
26560b57cec5SDimitry Andric                                                imm:$lane)))))]> {
26570b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26580b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26590b57cec5SDimitry Andric  let isCommutable = 0;
26600b57cec5SDimitry Andric}
26610b57cec5SDimitry Andricclass N3VQSL16<bits<2> op21_20, bits<4> op11_8, string OpcodeStr, string Dt,
26620b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDNode ShOp>
26630b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
26640b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
26650b57cec5SDimitry Andric        NVMulSLFrm, IIC_VMULi16Q, OpcodeStr, Dt,"$Vd, $Vn, $Vm$lane", "",
26660b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
26670b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$Vn),
26680b57cec5SDimitry Andric                           (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
26690b57cec5SDimitry Andric                                                imm:$lane)))))]> {
26700b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26710b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26720b57cec5SDimitry Andric  let isCommutable = 0;
26730b57cec5SDimitry Andric}
26740b57cec5SDimitry Andric
26750b57cec5SDimitry Andric// Basic 3-register intrinsics, both double- and quad-register.
26760b57cec5SDimitry Andricclass N3VDInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
26770b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
26780b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
26790b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
26800b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), f, itin,
26810b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
26820b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]> {
26830b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
26840b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
26850b57cec5SDimitry Andric  let isCommutable = Commutable;
26860b57cec5SDimitry Andric}
26870b57cec5SDimitry Andric
26880b57cec5SDimitry Andricclass N3VDIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
26890b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
26900b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
26910b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
26920b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
26930b57cec5SDimitry Andric          (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
26940b57cec5SDimitry Andric          [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
26950b57cec5SDimitry Andric
26960b57cec5SDimitry Andricclass N3VDIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
26970b57cec5SDimitry Andric                string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
26980b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
26990b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
27000b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27010b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27020b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27030b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
27040b57cec5SDimitry Andric                                           imm:$lane)))))]> {
27050b57cec5SDimitry Andric  let isCommutable = 0;
27060b57cec5SDimitry Andric}
27070b57cec5SDimitry Andric
27080b57cec5SDimitry Andricclass N3VDIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27090b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType Ty, SDPatternOperator IntOp>
27100b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
27110b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27120b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27130b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
27140b57cec5SDimitry Andric              (Ty (IntOp (Ty DPR:$Vn),
27150b57cec5SDimitry Andric                         (Ty (ARMvduplane (Ty DPR_8:$Vm), imm:$lane)))))]> {
27160b57cec5SDimitry Andric  let isCommutable = 0;
27170b57cec5SDimitry Andric}
27180b57cec5SDimitry Andricclass N3VDIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27190b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27200b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27210b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
27220b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vm, DPR:$Vn), f, itin,
27230b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
27240b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (OpTy DPR:$Vn))))]> {
27250b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
27260b57cec5SDimitry Andric  let isCommutable = 0;
27270b57cec5SDimitry Andric}
27280b57cec5SDimitry Andric
27290b57cec5SDimitry Andricclass N3VQInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27300b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27310b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp, bit Commutable>
27320b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
27330b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin,
27340b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
27350b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]> {
27360b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
27370b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
27380b57cec5SDimitry Andric  let isCommutable = Commutable;
27390b57cec5SDimitry Andric}
27400b57cec5SDimitry Andric
27410b57cec5SDimitry Andricclass N3VQIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
27420b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
27430b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
27440b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
27450b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
27460b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), f, itin, OpcodeStr, Dt,
27470b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
27480b57cec5SDimitry Andric
27490b57cec5SDimitry Andric// Same as N3VQIntnp but with Vd as a src register.
27500b57cec5SDimitry Andricclass N3VQInt3np<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
27510b57cec5SDimitry Andric                bit op4, Format f, InstrItinClass itin, string OpcodeStr,
27520b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
27530b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
27540b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
27550b57cec5SDimitry Andric          (outs QPR:$Vd), (ins QPR:$src, QPR:$Vn, QPR:$Vm),
27560b57cec5SDimitry Andric          f, itin, OpcodeStr, Dt,
27570b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src), (OpTy QPR:$Vn),
27580b57cec5SDimitry Andric                                       (OpTy QPR:$Vm))))]> {
27590b57cec5SDimitry Andric  let Constraints = "$src = $Vd";
27600b57cec5SDimitry Andric}
27610b57cec5SDimitry Andric
27620b57cec5SDimitry Andricclass N3VQIntSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27630b57cec5SDimitry Andric                string OpcodeStr, string Dt,
27640b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27650b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
27660b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
27670b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27680b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
27690b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
27700b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
27710b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
27720b57cec5SDimitry Andric  let isCommutable = 0;
27730b57cec5SDimitry Andric}
27740b57cec5SDimitry Andricclass N3VQIntSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
27750b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
27760b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27770b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
27780b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
27790b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
27800b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
27810b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$Vn),
27820b57cec5SDimitry Andric                            (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
27830b57cec5SDimitry Andric                                                 imm:$lane)))))]> {
27840b57cec5SDimitry Andric  let isCommutable = 0;
27850b57cec5SDimitry Andric}
27860b57cec5SDimitry Andricclass N3VQIntSh<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27870b57cec5SDimitry Andric              Format f, InstrItinClass itin, string OpcodeStr, string Dt,
27880b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
27890b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
27900b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vm, QPR:$Vn), f, itin,
27910b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm, $Vn", "",
27920b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (OpTy QPR:$Vn))))]> {
27930b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vm = $Vd";
27940b57cec5SDimitry Andric  let isCommutable = 0;
27950b57cec5SDimitry Andric}
27960b57cec5SDimitry Andric
27970b57cec5SDimitry Andric// Multiply-Add/Sub operations: double- and quad-register.
27980b57cec5SDimitry Andricclass N3VDMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
27990b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
28000b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator MulOp, SDPatternOperator OpNode>
28010b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
28020b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
28030b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28040b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
28050b57cec5SDimitry Andric                             (Ty (MulOp DPR:$Vn, DPR:$Vm)))))]>;
28060b57cec5SDimitry Andric
28070b57cec5SDimitry Andricclass N3VDMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28080b57cec5SDimitry Andric                  string OpcodeStr, string Dt,
28090b57cec5SDimitry Andric                  ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28100b57cec5SDimitry Andric  : N3VLane32<0, 1, op21_20, op11_8, 1, 0,
28110b57cec5SDimitry Andric        (outs DPR:$Vd),
28120b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28130b57cec5SDimitry Andric        NVMulSLFrm, itin,
28140b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28150b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28160b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28170b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28180b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_VFP2:$Vm),
28190b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28200b57cec5SDimitry Andricclass N3VDMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28210b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
28220b57cec5SDimitry Andric                    ValueType Ty, SDPatternOperator MulOp, SDPatternOperator ShOp>
28230b57cec5SDimitry Andric  : N3VLane16<0, 1, op21_20, op11_8, 1, 0,
28240b57cec5SDimitry Andric        (outs DPR:$Vd),
28250b57cec5SDimitry Andric        (ins DPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28260b57cec5SDimitry Andric        NVMulSLFrm, itin,
28270b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28280b57cec5SDimitry Andric        [(set (Ty DPR:$Vd),
28290b57cec5SDimitry Andric              (Ty (ShOp (Ty DPR:$src1),
28300b57cec5SDimitry Andric                        (Ty (MulOp DPR:$Vn,
28310b57cec5SDimitry Andric                                   (Ty (ARMvduplane (Ty DPR_8:$Vm),
28320b57cec5SDimitry Andric                                                     imm:$lane)))))))]>;
28330b57cec5SDimitry Andric
28340b57cec5SDimitry Andricclass N3VQMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28350b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt, ValueType Ty,
28360b57cec5SDimitry Andric                SDPatternOperator MulOp, SDPatternOperator OpNode>
28370b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
28380b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
28390b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28400b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
28410b57cec5SDimitry Andric                             (Ty (MulOp QPR:$Vn, QPR:$Vm)))))]>;
28420b57cec5SDimitry Andricclass N3VQMulOpSL<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28430b57cec5SDimitry Andric                  string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
28440b57cec5SDimitry Andric                  SDPatternOperator MulOp, SDPatternOperator ShOp>
28450b57cec5SDimitry Andric  : N3VLane32<1, 1, op21_20, op11_8, 1, 0,
28460b57cec5SDimitry Andric        (outs QPR:$Vd),
28470b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
28480b57cec5SDimitry Andric        NVMulSLFrm, itin,
28490b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28500b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28510b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$src1),
28520b57cec5SDimitry Andric                           (ResTy (MulOp QPR:$Vn,
28530b57cec5SDimitry Andric                                   (ResTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
28540b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
28550b57cec5SDimitry Andricclass N3VQMulOpSL16<bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
28560b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
28570b57cec5SDimitry Andric                    ValueType ResTy, ValueType OpTy,
28580b57cec5SDimitry Andric                    SDPatternOperator MulOp, SDPatternOperator ShOp>
28590b57cec5SDimitry Andric  : N3VLane16<1, 1, op21_20, op11_8, 1, 0,
28600b57cec5SDimitry Andric        (outs QPR:$Vd),
28610b57cec5SDimitry Andric        (ins QPR:$src1, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
28620b57cec5SDimitry Andric        NVMulSLFrm, itin,
28630b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
28640b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
28650b57cec5SDimitry Andric              (ResTy (ShOp (ResTy QPR:$src1),
28660b57cec5SDimitry Andric                           (ResTy (MulOp QPR:$Vn,
28670b57cec5SDimitry Andric                                   (ResTy (ARMvduplane (OpTy DPR_8:$Vm),
28680b57cec5SDimitry Andric                                                        imm:$lane)))))))]>;
28690b57cec5SDimitry Andric
28700b57cec5SDimitry Andric// Neon Intrinsic-Op instructions (VABA): double- and quad-register.
28710b57cec5SDimitry Andricclass N3VDIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28720b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
28730b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
28740b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
28750b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
28760b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28770b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (OpNode DPR:$src1,
28780b57cec5SDimitry Andric                             (Ty (IntOp (Ty DPR:$Vn), (Ty DPR:$Vm))))))]>;
28790b57cec5SDimitry Andricclass N3VQIntOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28800b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
28810b57cec5SDimitry Andric                ValueType Ty, SDPatternOperator IntOp, SDNode OpNode>
28820b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
28830b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
28840b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28850b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (OpNode QPR:$src1,
28860b57cec5SDimitry Andric                             (Ty (IntOp (Ty QPR:$Vn), (Ty QPR:$Vm))))))]>;
28870b57cec5SDimitry Andric
28880b57cec5SDimitry Andric// Neon 3-argument intrinsics, both double- and quad-register.
28890b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
28900b57cec5SDimitry Andricclass N3VDInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28910b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
28920b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
28930b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
28940b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
28950b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
28960b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$src1),
28970b57cec5SDimitry Andric                                      (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
28980b57cec5SDimitry Andricclass N3VQInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
28990b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29000b57cec5SDimitry Andric               ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29010b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
29020b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
29030b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29040b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$src1),
29050b57cec5SDimitry Andric                                      (OpTy QPR:$Vn), (OpTy QPR:$Vm))))]>;
29060b57cec5SDimitry Andric
29070b57cec5SDimitry Andric// Long Multiply-Add/Sub operations.
29080b57cec5SDimitry Andricclass N3VLMulOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29090b57cec5SDimitry Andric                InstrItinClass itin, string OpcodeStr, string Dt,
29100b57cec5SDimitry Andric                ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29110b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29120b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29130b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29140b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
29150b57cec5SDimitry Andric                                (TyQ (MulOp (TyD DPR:$Vn),
29160b57cec5SDimitry Andric                                            (TyD DPR:$Vm)))))]>;
29170b57cec5SDimitry Andricclass N3VLMulOpSL<bit op24, bits<2> op21_20, bits<4> op11_8,
29180b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
29190b57cec5SDimitry Andric                  ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29200b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29210b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
29220b57cec5SDimitry Andric        NVMulSLFrm, itin,
29230b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29240b57cec5SDimitry Andric        [(set QPR:$Vd,
29250b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
29260b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
29270b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),
29280b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
29290b57cec5SDimitry Andricclass N3VLMulOpSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
29300b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
29310b57cec5SDimitry Andric                    ValueType TyQ, ValueType TyD, SDNode MulOp, SDNode OpNode>
29320b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0, (outs QPR:$Vd),
29330b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
29340b57cec5SDimitry Andric        NVMulSLFrm, itin,
29350b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29360b57cec5SDimitry Andric        [(set QPR:$Vd,
29370b57cec5SDimitry Andric          (OpNode (TyQ QPR:$src1),
29380b57cec5SDimitry Andric                  (TyQ (MulOp (TyD DPR:$Vn),
29390b57cec5SDimitry Andric                              (TyD (ARMvduplane (TyD DPR_8:$Vm),
29400b57cec5SDimitry Andric                                                 imm:$lane))))))]>;
29410b57cec5SDimitry Andric
29420b57cec5SDimitry Andric// Long Intrinsic-Op vector operations with explicit extend (VABAL).
29430b57cec5SDimitry Andricclass N3VLIntExtOp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29440b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
29450b57cec5SDimitry Andric                   ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
29460b57cec5SDimitry Andric                   SDNode OpNode>
29470b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29480b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29490b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29500b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$src1),
29510b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
29520b57cec5SDimitry Andric                                                        (TyD DPR:$Vm)))))))]>;
29530b57cec5SDimitry Andric
29540b57cec5SDimitry Andric// Neon Long 3-argument intrinsic.  The destination register is
29550b57cec5SDimitry Andric// a quad-register and is also used as the first source operand register.
29560b57cec5SDimitry Andricclass N3VLInt3<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29570b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
29580b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDPatternOperator IntOp>
29590b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29600b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
29610b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "$src1 = $Vd",
29620b57cec5SDimitry Andric        [(set QPR:$Vd,
29630b57cec5SDimitry Andric          (TyQ (IntOp (TyQ QPR:$src1), (TyD DPR:$Vn), (TyD DPR:$Vm))))]>;
29640b57cec5SDimitry Andricclass N3VLInt3SL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
29650b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
29660b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29670b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
29680b57cec5SDimitry Andric        (outs QPR:$Vd),
29690b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
29700b57cec5SDimitry Andric        NVMulSLFrm, itin,
29710b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29720b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
29730b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
29740b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
29750b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
29760b57cec5SDimitry Andric                                                imm:$lane)))))]>;
29770b57cec5SDimitry Andricclass N3VLInt3SL16<bit op24, bits<2> op21_20, bits<4> op11_8,
29780b57cec5SDimitry Andric                   InstrItinClass itin, string OpcodeStr, string Dt,
29790b57cec5SDimitry Andric                   ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
29800b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
29810b57cec5SDimitry Andric        (outs QPR:$Vd),
29820b57cec5SDimitry Andric        (ins QPR:$src1, DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
29830b57cec5SDimitry Andric        NVMulSLFrm, itin,
29840b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "$src1 = $Vd",
29850b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
29860b57cec5SDimitry Andric              (ResTy (IntOp (ResTy QPR:$src1),
29870b57cec5SDimitry Andric                            (OpTy DPR:$Vn),
29880b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
29890b57cec5SDimitry Andric                                                imm:$lane)))))]>;
29900b57cec5SDimitry Andric
29910b57cec5SDimitry Andric// Narrowing 3-register intrinsics.
29920b57cec5SDimitry Andricclass N3VNInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
29930b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType TyD, ValueType TyQ,
29940b57cec5SDimitry Andric              SDPatternOperator IntOp, bit Commutable>
29950b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
29960b57cec5SDimitry Andric        (outs DPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINi4D,
29970b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
29980b57cec5SDimitry Andric        [(set DPR:$Vd, (TyD (IntOp (TyQ QPR:$Vn), (TyQ QPR:$Vm))))]> {
29990b57cec5SDimitry Andric  let isCommutable = Commutable;
30000b57cec5SDimitry Andric}
30010b57cec5SDimitry Andric
30020b57cec5SDimitry Andric// Long 3-register operations.
30030b57cec5SDimitry Andricclass N3VL<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30040b57cec5SDimitry Andric           InstrItinClass itin, string OpcodeStr, string Dt,
30050b57cec5SDimitry Andric           ValueType TyQ, ValueType TyD, SDNode OpNode, bit Commutable>
30060b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30070b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30080b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30090b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (OpNode (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
30100b57cec5SDimitry Andric  let isCommutable = Commutable;
30110b57cec5SDimitry Andric}
30120b57cec5SDimitry Andric
30130b57cec5SDimitry Andricclass N3VLSL<bit op24, bits<2> op21_20, bits<4> op11_8,
30140b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
30150b57cec5SDimitry Andric             ValueType TyQ, ValueType TyD, SDNode OpNode>
30160b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30170b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30180b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30190b57cec5SDimitry Andric        [(set QPR:$Vd,
30200b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30210b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_VFP2:$Vm),imm:$lane)))))]>;
30220b57cec5SDimitry Andricclass N3VLSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30230b57cec5SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
30240b57cec5SDimitry Andric               ValueType TyQ, ValueType TyD, SDNode OpNode>
30250b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30260b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30270b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30280b57cec5SDimitry Andric        [(set QPR:$Vd,
30290b57cec5SDimitry Andric          (TyQ (OpNode (TyD DPR:$Vn),
30300b57cec5SDimitry Andric                       (TyD (ARMvduplane (TyD DPR_8:$Vm), imm:$lane)))))]>;
30310b57cec5SDimitry Andric
30320b57cec5SDimitry Andric// Long 3-register operations with explicitly extended operands.
30330b57cec5SDimitry Andricclass N3VLExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30340b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
30350b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDNode OpNode, SDNode ExtOp,
30360b57cec5SDimitry Andric              bit Commutable>
30370b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30380b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30390b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30400b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ (ExtOp (TyD DPR:$Vn))),
30410b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
30420b57cec5SDimitry Andric  let isCommutable = Commutable;
30430b57cec5SDimitry Andric}
30440b57cec5SDimitry Andric
30450b57cec5SDimitry Andric// Long 3-register intrinsics with explicit extend (VABDL).
30460b57cec5SDimitry Andricclass N3VLIntExt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30470b57cec5SDimitry Andric                 InstrItinClass itin, string OpcodeStr, string Dt,
30480b57cec5SDimitry Andric                 ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, SDNode ExtOp,
30490b57cec5SDimitry Andric                 bit Commutable>
30500b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30510b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30520b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30530b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (ExtOp (TyD (IntOp (TyD DPR:$Vn),
30540b57cec5SDimitry Andric                                                (TyD DPR:$Vm))))))]> {
30550b57cec5SDimitry Andric  let isCommutable = Commutable;
30560b57cec5SDimitry Andric}
30570b57cec5SDimitry Andric
30580b57cec5SDimitry Andric// Long 3-register intrinsics.
30590b57cec5SDimitry Andricclass N3VLInt<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
30600b57cec5SDimitry Andric              InstrItinClass itin, string OpcodeStr, string Dt,
30610b57cec5SDimitry Andric              ValueType TyQ, ValueType TyD, SDPatternOperator IntOp, bit Commutable>
30620b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
30630b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
30640b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
30650b57cec5SDimitry Andric        [(set QPR:$Vd, (TyQ (IntOp (TyD DPR:$Vn), (TyD DPR:$Vm))))]> {
30660b57cec5SDimitry Andric  let isCommutable = Commutable;
30670b57cec5SDimitry Andric}
30680b57cec5SDimitry Andric
30690b57cec5SDimitry Andric// Same as above, but not predicated.
30700b57cec5SDimitry Andricclass N3VLIntnp<bits<5> op27_23, bits<2> op21_20, bits<4> op11_8, bit op6,
30710b57cec5SDimitry Andric                bit op4, InstrItinClass itin, string OpcodeStr,
30720b57cec5SDimitry Andric                string Dt, ValueType ResTy, ValueType OpTy,
30730b57cec5SDimitry Andric                SDPatternOperator IntOp, bit Commutable>
30740b57cec5SDimitry Andric  : N3Vnp<op27_23, op21_20, op11_8, op6, op4,
30750b57cec5SDimitry Andric          (outs QPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin, OpcodeStr, Dt,
30760b57cec5SDimitry Andric          [(set QPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vn), (OpTy DPR:$Vm))))]>;
30770b57cec5SDimitry Andric
30780b57cec5SDimitry Andricclass N3VLIntSL<bit op24, bits<2> op21_20, bits<4> op11_8, InstrItinClass itin,
30790b57cec5SDimitry Andric                string OpcodeStr, string Dt,
30800b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30810b57cec5SDimitry Andric  : N3VLane32<op24, 1, op21_20, op11_8, 1, 0,
30820b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
30830b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30840b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30850b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
30860b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_VFP2:$Vm),
30870b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30880b57cec5SDimitry Andricclass N3VLIntSL16<bit op24, bits<2> op21_20, bits<4> op11_8,
30890b57cec5SDimitry Andric                  InstrItinClass itin, string OpcodeStr, string Dt,
30900b57cec5SDimitry Andric                  ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
30910b57cec5SDimitry Andric  : N3VLane16<op24, 1, op21_20, op11_8, 1, 0,
30920b57cec5SDimitry Andric        (outs QPR:$Vd), (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$lane),
30930b57cec5SDimitry Andric        NVMulSLFrm, itin, OpcodeStr, Dt, "$Vd, $Vn, $Vm$lane", "",
30940b57cec5SDimitry Andric        [(set (ResTy QPR:$Vd),
30950b57cec5SDimitry Andric              (ResTy (IntOp (OpTy DPR:$Vn),
30960b57cec5SDimitry Andric                            (OpTy (ARMvduplane (OpTy DPR_8:$Vm),
30970b57cec5SDimitry Andric                                                imm:$lane)))))]>;
30980b57cec5SDimitry Andric
30990b57cec5SDimitry Andric// Wide 3-register operations.
31000b57cec5SDimitry Andricclass N3VW<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
31010b57cec5SDimitry Andric           string OpcodeStr, string Dt, ValueType TyQ, ValueType TyD,
31020b57cec5SDimitry Andric           SDNode OpNode, SDNode ExtOp, bit Commutable>
31030b57cec5SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
31040b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VSUBiD,
31050b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
31060b57cec5SDimitry Andric        [(set QPR:$Vd, (OpNode (TyQ QPR:$Vn),
31070b57cec5SDimitry Andric                                (TyQ (ExtOp (TyD DPR:$Vm)))))]> {
31080b57cec5SDimitry Andric  // All of these have a two-operand InstAlias.
31090b57cec5SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
31100b57cec5SDimitry Andric  let isCommutable = Commutable;
31110b57cec5SDimitry Andric}
31120b57cec5SDimitry Andric
31130b57cec5SDimitry Andric// Pairwise long 2-register intrinsics, both double- and quad-register.
31140b57cec5SDimitry Andricclass N2VDPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31150b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31160b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31170b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31180b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4, (outs DPR:$Vd),
31190b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31200b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm))))]>;
31210b57cec5SDimitry Andricclass N2VQPLInt<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31220b57cec5SDimitry Andric                bits<2> op17_16, bits<5> op11_7, bit op4,
31230b57cec5SDimitry Andric                string OpcodeStr, string Dt,
31240b57cec5SDimitry Andric                ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31250b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4, (outs QPR:$Vd),
31260b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
31270b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm))))]>;
31280b57cec5SDimitry Andric
31290b57cec5SDimitry Andric// Pairwise long 2-register accumulate intrinsics,
31300b57cec5SDimitry Andric// both double- and quad-register.
31310b57cec5SDimitry Andric// The destination register is also used as the first source operand register.
31320b57cec5SDimitry Andricclass N2VDPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31330b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
31340b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
31350b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31360b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 0, op4,
31370b57cec5SDimitry Andric        (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vm), IIC_VPALiD,
31380b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
31390b57cec5SDimitry Andric        [(set DPR:$Vd, (ResTy (IntOp (ResTy DPR:$src1), (OpTy DPR:$Vm))))]>;
31400b57cec5SDimitry Andricclass N2VQPLInt2<bits<2> op24_23, bits<2> op21_20, bits<2> op19_18,
31410b57cec5SDimitry Andric                 bits<2> op17_16, bits<5> op11_7, bit op4,
31420b57cec5SDimitry Andric                 string OpcodeStr, string Dt,
31430b57cec5SDimitry Andric                 ValueType ResTy, ValueType OpTy, SDPatternOperator IntOp>
31440b57cec5SDimitry Andric  : N2V<op24_23, op21_20, op19_18, op17_16, op11_7, 1, op4,
31450b57cec5SDimitry Andric        (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vm), IIC_VPALiQ,
31460b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "$src1 = $Vd",
31470b57cec5SDimitry Andric        [(set QPR:$Vd, (ResTy (IntOp (ResTy QPR:$src1), (OpTy QPR:$Vm))))]>;
31480b57cec5SDimitry Andric
31490b57cec5SDimitry Andric// Shift by immediate,
31500b57cec5SDimitry Andric// both double- and quad-register.
31510b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
31520b57cec5SDimitry Andricclass N2VDSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
31530b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
31540b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
31550b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
31560b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), f, itin,
31570b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
31580b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (OpNode (Ty DPR:$Vm), (i32 imm:$SIMM))))]>;
31590b57cec5SDimitry Andricclass N2VQSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
31600b57cec5SDimitry Andric             Format f, InstrItinClass itin, Operand ImmTy,
31610b57cec5SDimitry Andric             string OpcodeStr, string Dt, ValueType Ty, SDNode OpNode>
31620b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
31630b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), f, itin,
31640b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
31650b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (OpNode (Ty QPR:$Vm), (i32 imm:$SIMM))))]>;
31660b57cec5SDimitry Andric}
31670b57cec5SDimitry Andric
31680b57cec5SDimitry Andric// Long shift by immediate.
31690b57cec5SDimitry Andricclass N2VLSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
31700b57cec5SDimitry Andric             string OpcodeStr, string Dt,
31710b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
31720b57cec5SDimitry Andric             SDPatternOperator OpNode>
31730b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
31740b57cec5SDimitry Andric           (outs QPR:$Vd), (ins DPR:$Vm, ImmTy:$SIMM), N2RegVShLFrm,
31750b57cec5SDimitry Andric           IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
31760b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (OpNode (OpTy DPR:$Vm), ImmTy:$SIMM)))]>;
31770b57cec5SDimitry Andric
31780b57cec5SDimitry Andric// Narrow shift by immediate.
31790b57cec5SDimitry Andricclass N2VNSh<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6, bit op4,
31800b57cec5SDimitry Andric             InstrItinClass itin, string OpcodeStr, string Dt,
31810b57cec5SDimitry Andric             ValueType ResTy, ValueType OpTy, Operand ImmTy,
31820b57cec5SDimitry Andric             SDPatternOperator OpNode>
31830b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, op6, op4,
31840b57cec5SDimitry Andric           (outs DPR:$Vd), (ins QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, itin,
31850b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
31860b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (OpNode (OpTy QPR:$Vm),
31870b57cec5SDimitry Andric                                          (i32 ImmTy:$SIMM))))]>;
31880b57cec5SDimitry Andric
31890b57cec5SDimitry Andric// Shift right by immediate and accumulate,
31900b57cec5SDimitry Andric// both double- and quad-register.
31910b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
31920b57cec5SDimitry Andricclass N2VDShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
31930b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
31940b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
31950b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
31960b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
31970b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
31980b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (add DPR:$src1,
31990b57cec5SDimitry Andric                                (Ty (ShOp DPR:$Vm, (i32 imm:$SIMM))))))]>;
32000b57cec5SDimitry Andricclass N2VQShAdd<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32010b57cec5SDimitry Andric                Operand ImmTy, string OpcodeStr, string Dt,
32020b57cec5SDimitry Andric                ValueType Ty, SDNode ShOp>
32030b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32040b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), N2RegVShRFrm, IIC_VPALiD,
32050b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32060b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (add QPR:$src1,
32070b57cec5SDimitry Andric                                (Ty (ShOp QPR:$Vm, (i32 imm:$SIMM))))))]>;
32080b57cec5SDimitry Andric}
32090b57cec5SDimitry Andric
32100b57cec5SDimitry Andric// Shift by immediate and insert,
32110b57cec5SDimitry Andric// both double- and quad-register.
32120b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
32130b57cec5SDimitry Andricclass N2VDShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32140b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32150b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32160b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4, (outs DPR:$Vd),
32170b57cec5SDimitry Andric           (ins DPR:$src1, DPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiD,
32180b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32190b57cec5SDimitry Andric           [(set DPR:$Vd, (Ty (ShOp DPR:$src1, DPR:$Vm, (i32 imm:$SIMM))))]>;
32200b57cec5SDimitry Andricclass N2VQShIns<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32210b57cec5SDimitry Andric                Operand ImmTy, Format f, string OpcodeStr, string Dt,
32220b57cec5SDimitry Andric                ValueType Ty,SDNode ShOp>
32230b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4, (outs QPR:$Vd),
32240b57cec5SDimitry Andric           (ins QPR:$src1, QPR:$Vm, ImmTy:$SIMM), f, IIC_VSHLiQ,
32250b57cec5SDimitry Andric           OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "$src1 = $Vd",
32260b57cec5SDimitry Andric           [(set QPR:$Vd, (Ty (ShOp QPR:$src1, QPR:$Vm, (i32 imm:$SIMM))))]>;
32270b57cec5SDimitry Andric}
32280b57cec5SDimitry Andric
32290b57cec5SDimitry Andric// Convert, with fractional bits immediate,
32300b57cec5SDimitry Andric// both double- and quad-register.
32310b57cec5SDimitry Andricclass N2VCvtD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32320b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
32330b57cec5SDimitry Andric              SDPatternOperator IntOp>
32340b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 0, op4,
32350b57cec5SDimitry Andric           (outs DPR:$Vd), (ins DPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
32360b57cec5SDimitry Andric           IIC_VUNAD, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32370b57cec5SDimitry Andric           [(set DPR:$Vd, (ResTy (IntOp (OpTy DPR:$Vm), (i32 imm:$SIMM))))]>;
32380b57cec5SDimitry Andricclass N2VCvtQ<bit op24, bit op23, bits<4> op11_8, bit op7, bit op4,
32390b57cec5SDimitry Andric              string OpcodeStr, string Dt, ValueType ResTy, ValueType OpTy,
32400b57cec5SDimitry Andric              SDPatternOperator IntOp>
32410b57cec5SDimitry Andric  : N2VImm<op24, op23, op11_8, op7, 1, op4,
32420b57cec5SDimitry Andric           (outs QPR:$Vd), (ins QPR:$Vm, neon_vcvt_imm32:$SIMM), NVCVTFrm,
32430b57cec5SDimitry Andric           IIC_VUNAQ, OpcodeStr, Dt, "$Vd, $Vm, $SIMM", "",
32440b57cec5SDimitry Andric           [(set QPR:$Vd, (ResTy (IntOp (OpTy QPR:$Vm), (i32 imm:$SIMM))))]>;
32450b57cec5SDimitry Andric
32460b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
32470b57cec5SDimitry Andric// Multiclasses
32480b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
32490b57cec5SDimitry Andric
32500b57cec5SDimitry Andric// Abbreviations used in multiclass suffixes:
32510b57cec5SDimitry Andric//   Q = quarter int (8 bit) elements
32520b57cec5SDimitry Andric//   H = half int (16 bit) elements
32530b57cec5SDimitry Andric//   S = single int (32 bit) elements
32540b57cec5SDimitry Andric//   D = double int (64 bit) elements
32550b57cec5SDimitry Andric
32560b57cec5SDimitry Andric// Neon 2-register vector operations and intrinsics.
32570b57cec5SDimitry Andric
32580b57cec5SDimitry Andric// Neon 2-register comparisons.
32590b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
32600b57cec5SDimitry Andricmulticlass N2V_QHS_cmp<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
32610b57cec5SDimitry Andric                       bits<5> op11_7, bit op4, string opc, string Dt,
3262480093f4SDimitry Andric                       string asm, PatFrag fc> {
32630b57cec5SDimitry Andric  // 64-bit vector types.
32640b57cec5SDimitry Andric  def v8i8  : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 0, op4,
32650b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
32660b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3267480093f4SDimitry Andric                  [(set DPR:$Vd, (v8i8 (ARMvcmpz (v8i8 DPR:$Vm), fc)))]>;
32680b57cec5SDimitry Andric  def v4i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
32690b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
32700b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3271480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4i16 DPR:$Vm), fc)))]>;
32720b57cec5SDimitry Andric  def v2i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
32730b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
32740b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3275480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2i32 DPR:$Vm), fc)))]>;
32760b57cec5SDimitry Andric  def v2f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 0, op4,
32770b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
32780b57cec5SDimitry Andric                  opc, "f32", asm, "",
3279480093f4SDimitry Andric                  [(set DPR:$Vd, (v2i32 (ARMvcmpz (v2f32 DPR:$Vm), fc)))]> {
32800b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
32810b57cec5SDimitry Andric  }
32820b57cec5SDimitry Andric  def v4f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 0, op4,
32830b57cec5SDimitry Andric                  (outs DPR:$Vd), (ins DPR:$Vm), NoItinerary,
32840b57cec5SDimitry Andric                  opc, "f16", asm, "",
3285480093f4SDimitry Andric                  [(set DPR:$Vd, (v4i16 (ARMvcmpz (v4f16 DPR:$Vm), fc)))]>,
32860b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
32870b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
32880b57cec5SDimitry Andric  }
32890b57cec5SDimitry Andric
32900b57cec5SDimitry Andric  // 128-bit vector types.
32910b57cec5SDimitry Andric  def v16i8 : N2V<op24_23, op21_20, 0b00, op17_16, op11_7, 1, op4,
32920b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
32930b57cec5SDimitry Andric                  opc, !strconcat(Dt, "8"), asm, "",
3294480093f4SDimitry Andric                  [(set QPR:$Vd, (v16i8 (ARMvcmpz (v16i8 QPR:$Vm), fc)))]>;
32950b57cec5SDimitry Andric  def v8i16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
32960b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
32970b57cec5SDimitry Andric                  opc, !strconcat(Dt, "16"), asm, "",
3298480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8i16 QPR:$Vm), fc)))]>;
32990b57cec5SDimitry Andric  def v4i32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33000b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33010b57cec5SDimitry Andric                  opc, !strconcat(Dt, "32"), asm, "",
3302480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4i32 QPR:$Vm), fc)))]>;
33030b57cec5SDimitry Andric  def v4f32 : N2V<op24_23, op21_20, 0b10, op17_16, op11_7, 1, op4,
33040b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33050b57cec5SDimitry Andric                  opc, "f32", asm, "",
3306480093f4SDimitry Andric                  [(set QPR:$Vd, (v4i32 (ARMvcmpz (v4f32 QPR:$Vm), fc)))]> {
33070b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33080b57cec5SDimitry Andric  }
33090b57cec5SDimitry Andric  def v8f16 : N2V<op24_23, op21_20, 0b01, op17_16, op11_7, 1, op4,
33100b57cec5SDimitry Andric                  (outs QPR:$Vd), (ins QPR:$Vm), NoItinerary,
33110b57cec5SDimitry Andric                  opc, "f16", asm, "",
3312480093f4SDimitry Andric                  [(set QPR:$Vd, (v8i16 (ARMvcmpz (v8f16 QPR:$Vm), fc)))]>,
33130b57cec5SDimitry Andric              Requires<[HasNEON,HasFullFP16]> {
33140b57cec5SDimitry Andric    let Inst{10} = 1; // overwrite F = 1
33150b57cec5SDimitry Andric  }
33160b57cec5SDimitry Andric}
33170b57cec5SDimitry Andric
33188bcb0991SDimitry Andric// Neon 3-register comparisons.
33198bcb0991SDimitry Andricclass N3VQ_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
33208bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3321480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
33228bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 1, op4,
33238bcb0991SDimitry Andric        (outs QPR:$Vd), (ins QPR:$Vn, QPR:$Vm), N3RegFrm, itin,
33248bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3325480093f4SDimitry Andric        [(set QPR:$Vd, (ResTy (ARMvcmp (OpTy QPR:$Vn), (OpTy QPR:$Vm), fc)))]> {
33268bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
33278bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
33288bcb0991SDimitry Andric  let isCommutable = Commutable;
33298bcb0991SDimitry Andric}
33308bcb0991SDimitry Andric
33318bcb0991SDimitry Andricclass N3VD_cmp<bit op24, bit op23, bits<2> op21_20, bits<4> op11_8, bit op4,
33328bcb0991SDimitry Andric               InstrItinClass itin, string OpcodeStr, string Dt,
3333480093f4SDimitry Andric               ValueType ResTy, ValueType OpTy, PatFrag fc, bit Commutable>
33348bcb0991SDimitry Andric  : N3V<op24, op23, op21_20, op11_8, 0, op4,
33358bcb0991SDimitry Andric        (outs DPR:$Vd), (ins DPR:$Vn, DPR:$Vm), N3RegFrm, itin,
33368bcb0991SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vn, $Vm", "",
3337480093f4SDimitry Andric        [(set DPR:$Vd, (ResTy (ARMvcmp (OpTy DPR:$Vn), (OpTy DPR:$Vm), fc)))]> {
33388bcb0991SDimitry Andric  // All of these have a two-operand InstAlias.
33398bcb0991SDimitry Andric  let TwoOperandAliasConstraint = "$Vn = $Vd";
33408bcb0991SDimitry Andric  let isCommutable = Commutable;
33418bcb0991SDimitry Andric}
33428bcb0991SDimitry Andric
33438bcb0991SDimitry Andricmulticlass N3V_QHS_cmp<bit op24, bit op23, bits<4> op11_8, bit op4,
33448bcb0991SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
33458bcb0991SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
33468bcb0991SDimitry Andric                       string OpcodeStr, string Dt,
3347480093f4SDimitry Andric                       PatFrag fc, bit Commutable = 0> {
33488bcb0991SDimitry Andric  // 64-bit vector types.
33498bcb0991SDimitry Andric  def v8i8  : N3VD_cmp<op24, op23, 0b00, op11_8, op4, itinD16,
33508bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
33518bcb0991SDimitry Andric                       v8i8, v8i8, fc, Commutable>;
33528bcb0991SDimitry Andric  def v4i16 : N3VD_cmp<op24, op23, 0b01, op11_8, op4, itinD16,
33538bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
33548bcb0991SDimitry Andric                       v4i16, v4i16, fc, Commutable>;
33558bcb0991SDimitry Andric  def v2i32 : N3VD_cmp<op24, op23, 0b10, op11_8, op4, itinD32,
33568bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
33578bcb0991SDimitry Andric                       v2i32, v2i32, fc, Commutable>;
33588bcb0991SDimitry Andric
33598bcb0991SDimitry Andric  // 128-bit vector types.
33608bcb0991SDimitry Andric  def v16i8 : N3VQ_cmp<op24, op23, 0b00, op11_8, op4, itinQ16,
33618bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"),
33628bcb0991SDimitry Andric                       v16i8, v16i8, fc, Commutable>;
33638bcb0991SDimitry Andric  def v8i16 : N3VQ_cmp<op24, op23, 0b01, op11_8, op4, itinQ16,
33648bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"),
33658bcb0991SDimitry Andric                       v8i16, v8i16, fc, Commutable>;
33668bcb0991SDimitry Andric  def v4i32 : N3VQ_cmp<op24, op23, 0b10, op11_8, op4, itinQ32,
33678bcb0991SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"),
33688bcb0991SDimitry Andric                       v4i32, v4i32, fc, Commutable>;
33698bcb0991SDimitry Andric}
33708bcb0991SDimitry Andric
33710b57cec5SDimitry Andric
33720b57cec5SDimitry Andric// Neon 2-register vector intrinsics,
33730b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
33740b57cec5SDimitry Andricmulticlass N2VInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
33750b57cec5SDimitry Andric                      bits<5> op11_7, bit op4,
33760b57cec5SDimitry Andric                      InstrItinClass itinD, InstrItinClass itinQ,
33770b57cec5SDimitry Andric                      string OpcodeStr, string Dt, SDPatternOperator IntOp> {
33780b57cec5SDimitry Andric  // 64-bit vector types.
33790b57cec5SDimitry Andric  def v8i8  : N2VDInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
33800b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
33810b57cec5SDimitry Andric  def v4i16 : N2VDInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
33820b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "16"),v4i16,v4i16,IntOp>;
33830b57cec5SDimitry Andric  def v2i32 : N2VDInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
33840b57cec5SDimitry Andric                      itinD, OpcodeStr, !strconcat(Dt, "32"),v2i32,v2i32,IntOp>;
33850b57cec5SDimitry Andric
33860b57cec5SDimitry Andric  // 128-bit vector types.
33870b57cec5SDimitry Andric  def v16i8 : N2VQInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
33880b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "8"), v16i8,v16i8,IntOp>;
33890b57cec5SDimitry Andric  def v8i16 : N2VQInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
33900b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "16"),v8i16,v8i16,IntOp>;
33910b57cec5SDimitry Andric  def v4i32 : N2VQInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
33920b57cec5SDimitry Andric                      itinQ, OpcodeStr, !strconcat(Dt, "32"),v4i32,v4i32,IntOp>;
33930b57cec5SDimitry Andric}
33940b57cec5SDimitry Andric
33950b57cec5SDimitry Andric
33960b57cec5SDimitry Andric// Neon Narrowing 2-register vector operations,
33970b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
33980b57cec5SDimitry Andricmulticlass N2VN_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
33990b57cec5SDimitry Andric                    bits<5> op11_7, bit op6, bit op4,
34000b57cec5SDimitry Andric                    InstrItinClass itin, string OpcodeStr, string Dt,
34010b57cec5SDimitry Andric                    SDNode OpNode> {
34020b57cec5SDimitry Andric  def v8i8  : N2VN<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34030b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "16"),
34040b57cec5SDimitry Andric                   v8i8, v8i16, OpNode>;
34050b57cec5SDimitry Andric  def v4i16 : N2VN<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34060b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "32"),
34070b57cec5SDimitry Andric                   v4i16, v4i32, OpNode>;
34080b57cec5SDimitry Andric  def v2i32 : N2VN<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34090b57cec5SDimitry Andric                   itin, OpcodeStr, !strconcat(Dt, "64"),
34100b57cec5SDimitry Andric                   v2i32, v2i64, OpNode>;
34110b57cec5SDimitry Andric}
34120b57cec5SDimitry Andric
34130b57cec5SDimitry Andric// Neon Narrowing 2-register vector intrinsics,
34140b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34150b57cec5SDimitry Andricmulticlass N2VNInt_HSD<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
34160b57cec5SDimitry Andric                       bits<5> op11_7, bit op6, bit op4,
34170b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
34180b57cec5SDimitry Andric                       SDPatternOperator IntOp> {
34190b57cec5SDimitry Andric  def v8i8  : N2VNInt<op24_23, op21_20, 0b00, op17_16, op11_7, op6, op4,
34200b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "16"),
34210b57cec5SDimitry Andric                      v8i8, v8i16, IntOp>;
34220b57cec5SDimitry Andric  def v4i16 : N2VNInt<op24_23, op21_20, 0b01, op17_16, op11_7, op6, op4,
34230b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "32"),
34240b57cec5SDimitry Andric                      v4i16, v4i32, IntOp>;
34250b57cec5SDimitry Andric  def v2i32 : N2VNInt<op24_23, op21_20, 0b10, op17_16, op11_7, op6, op4,
34260b57cec5SDimitry Andric                      itin, OpcodeStr, !strconcat(Dt, "64"),
34270b57cec5SDimitry Andric                      v2i32, v2i64, IntOp>;
34280b57cec5SDimitry Andric}
34290b57cec5SDimitry Andric
34300b57cec5SDimitry Andric
34310b57cec5SDimitry Andric// Neon Lengthening 2-register vector intrinsic (currently specific to VMOVL).
34320b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
34330b57cec5SDimitry Andricmulticlass N2VL_QHS<bits<2> op24_23, bits<5> op11_7, bit op6, bit op4,
34340b57cec5SDimitry Andric                    string OpcodeStr, string Dt, SDNode OpNode> {
34350b57cec5SDimitry Andric  def v8i16 : N2VL<op24_23, 0b00, 0b10, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34360b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, OpNode>;
34370b57cec5SDimitry Andric  def v4i32 : N2VL<op24_23, 0b01, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34380b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
34390b57cec5SDimitry Andric  def v2i64 : N2VL<op24_23, 0b10, 0b00, 0b00, op11_7, op6, op4, IIC_VQUNAiD,
34400b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
34410b57cec5SDimitry Andric}
34420b57cec5SDimitry Andric
34430b57cec5SDimitry Andric
34440b57cec5SDimitry Andric// Neon 3-register vector operations.
34450b57cec5SDimitry Andric
34460b57cec5SDimitry Andric// First with only element sizes of 8, 16 and 32 bits:
34470b57cec5SDimitry Andricmulticlass N3V_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
34480b57cec5SDimitry Andric                   InstrItinClass itinD16, InstrItinClass itinD32,
34490b57cec5SDimitry Andric                   InstrItinClass itinQ16, InstrItinClass itinQ32,
34500b57cec5SDimitry Andric                   string OpcodeStr, string Dt,
34510b57cec5SDimitry Andric                   SDNode OpNode, bit Commutable = 0> {
34520b57cec5SDimitry Andric  // 64-bit vector types.
34530b57cec5SDimitry Andric  def v8i8  : N3VD<op24, op23, 0b00, op11_8, op4, itinD16,
34540b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
34550b57cec5SDimitry Andric                   v8i8, v8i8, OpNode, Commutable>;
34560b57cec5SDimitry Andric  def v4i16 : N3VD<op24, op23, 0b01, op11_8, op4, itinD16,
34570b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
34580b57cec5SDimitry Andric                   v4i16, v4i16, OpNode, Commutable>;
34590b57cec5SDimitry Andric  def v2i32 : N3VD<op24, op23, 0b10, op11_8, op4, itinD32,
34600b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
34610b57cec5SDimitry Andric                   v2i32, v2i32, OpNode, Commutable>;
34620b57cec5SDimitry Andric
34630b57cec5SDimitry Andric  // 128-bit vector types.
34640b57cec5SDimitry Andric  def v16i8 : N3VQ<op24, op23, 0b00, op11_8, op4, itinQ16,
34650b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
34660b57cec5SDimitry Andric                   v16i8, v16i8, OpNode, Commutable>;
34670b57cec5SDimitry Andric  def v8i16 : N3VQ<op24, op23, 0b01, op11_8, op4, itinQ16,
34680b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
34690b57cec5SDimitry Andric                   v8i16, v8i16, OpNode, Commutable>;
34700b57cec5SDimitry Andric  def v4i32 : N3VQ<op24, op23, 0b10, op11_8, op4, itinQ32,
34710b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
34720b57cec5SDimitry Andric                   v4i32, v4i32, OpNode, Commutable>;
34730b57cec5SDimitry Andric}
34740b57cec5SDimitry Andric
34750b57cec5SDimitry Andricmulticlass N3VSL_HS<bits<4> op11_8, string OpcodeStr, SDNode ShOp> {
34760b57cec5SDimitry Andric  def v4i16 : N3VDSL16<0b01, op11_8, OpcodeStr, "i16", v4i16, ShOp>;
34770b57cec5SDimitry Andric  def v2i32 : N3VDSL<0b10, op11_8, IIC_VMULi32D, OpcodeStr, "i32", v2i32, ShOp>;
34780b57cec5SDimitry Andric  def v8i16 : N3VQSL16<0b01, op11_8, OpcodeStr, "i16", v8i16, v4i16, ShOp>;
34790b57cec5SDimitry Andric  def v4i32 : N3VQSL<0b10, op11_8, IIC_VMULi32Q, OpcodeStr, "i32",
34800b57cec5SDimitry Andric                     v4i32, v2i32, ShOp>;
34810b57cec5SDimitry Andric}
34820b57cec5SDimitry Andric
34830b57cec5SDimitry Andric// ....then also with element size 64 bits:
34840b57cec5SDimitry Andricmulticlass N3V_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
34850b57cec5SDimitry Andric                    InstrItinClass itinD, InstrItinClass itinQ,
34860b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
34870b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0>
34880b57cec5SDimitry Andric  : N3V_QHS<op24, op23, op11_8, op4, itinD, itinD, itinQ, itinQ,
34890b57cec5SDimitry Andric            OpcodeStr, Dt, OpNode, Commutable> {
34900b57cec5SDimitry Andric  def v1i64 : N3VD<op24, op23, 0b11, op11_8, op4, itinD,
34910b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
34920b57cec5SDimitry Andric                   v1i64, v1i64, OpNode, Commutable>;
34930b57cec5SDimitry Andric  def v2i64 : N3VQ<op24, op23, 0b11, op11_8, op4, itinQ,
34940b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "64"),
34950b57cec5SDimitry Andric                   v2i64, v2i64, OpNode, Commutable>;
34960b57cec5SDimitry Andric}
34970b57cec5SDimitry Andric
34980b57cec5SDimitry Andric
34990b57cec5SDimitry Andric// Neon 3-register vector intrinsics.
35000b57cec5SDimitry Andric
35010b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
35020b57cec5SDimitry Andricmulticlass N3VInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35030b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35040b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35050b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35060b57cec5SDimitry Andric                     SDPatternOperator IntOp, bit Commutable = 0> {
35070b57cec5SDimitry Andric  // 64-bit vector types.
35080b57cec5SDimitry Andric  def v4i16 : N3VDInt<op24, op23, 0b01, op11_8, op4, f, itinD16,
35090b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35100b57cec5SDimitry Andric                      v4i16, v4i16, IntOp, Commutable>;
35110b57cec5SDimitry Andric  def v2i32 : N3VDInt<op24, op23, 0b10, op11_8, op4, f, itinD32,
35120b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35130b57cec5SDimitry Andric                      v2i32, v2i32, IntOp, Commutable>;
35140b57cec5SDimitry Andric
35150b57cec5SDimitry Andric  // 128-bit vector types.
35160b57cec5SDimitry Andric  def v8i16 : N3VQInt<op24, op23, 0b01, op11_8, op4, f, itinQ16,
35170b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35180b57cec5SDimitry Andric                      v8i16, v8i16, IntOp, Commutable>;
35190b57cec5SDimitry Andric  def v4i32 : N3VQInt<op24, op23, 0b10, op11_8, op4, f, itinQ32,
35200b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35210b57cec5SDimitry Andric                      v4i32, v4i32, IntOp, Commutable>;
35220b57cec5SDimitry Andric}
35230b57cec5SDimitry Andricmulticlass N3VInt_HSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35240b57cec5SDimitry Andric                     InstrItinClass itinD16, InstrItinClass itinD32,
35250b57cec5SDimitry Andric                     InstrItinClass itinQ16, InstrItinClass itinQ32,
35260b57cec5SDimitry Andric                     string OpcodeStr, string Dt,
35270b57cec5SDimitry Andric                     SDPatternOperator IntOp> {
35280b57cec5SDimitry Andric  // 64-bit vector types.
35290b57cec5SDimitry Andric  def v4i16 : N3VDIntSh<op24, op23, 0b01, op11_8, op4, f, itinD16,
35300b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35310b57cec5SDimitry Andric                      v4i16, v4i16, IntOp>;
35320b57cec5SDimitry Andric  def v2i32 : N3VDIntSh<op24, op23, 0b10, op11_8, op4, f, itinD32,
35330b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35340b57cec5SDimitry Andric                      v2i32, v2i32, IntOp>;
35350b57cec5SDimitry Andric
35360b57cec5SDimitry Andric  // 128-bit vector types.
35370b57cec5SDimitry Andric  def v8i16 : N3VQIntSh<op24, op23, 0b01, op11_8, op4, f, itinQ16,
35380b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
35390b57cec5SDimitry Andric                      v8i16, v8i16, IntOp>;
35400b57cec5SDimitry Andric  def v4i32 : N3VQIntSh<op24, op23, 0b10, op11_8, op4, f, itinQ32,
35410b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
35420b57cec5SDimitry Andric                      v4i32, v4i32, IntOp>;
35430b57cec5SDimitry Andric}
35440b57cec5SDimitry Andric
35450b57cec5SDimitry Andricmulticlass N3VIntSL_HS<bits<4> op11_8,
35460b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
35470b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
35480b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
35490b57cec5SDimitry Andric  def v4i16 : N3VDIntSL16<0b01, op11_8, itinD16,
35500b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp>;
35510b57cec5SDimitry Andric  def v2i32 : N3VDIntSL<0b10, op11_8, itinD32,
35520b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp>;
35530b57cec5SDimitry Andric  def v8i16 : N3VQIntSL16<0b01, op11_8, itinQ16,
35540b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16, IntOp>;
35550b57cec5SDimitry Andric  def v4i32 : N3VQIntSL<0b10, op11_8, itinQ32,
35560b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32, IntOp>;
35570b57cec5SDimitry Andric}
35580b57cec5SDimitry Andric
35590b57cec5SDimitry Andric// ....then also with element size of 8 bits:
35600b57cec5SDimitry Andricmulticlass N3VInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35610b57cec5SDimitry Andric                      InstrItinClass itinD16, InstrItinClass itinD32,
35620b57cec5SDimitry Andric                      InstrItinClass itinQ16, InstrItinClass itinQ32,
35630b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
35640b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0>
35650b57cec5SDimitry Andric  : N3VInt_HS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
35660b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp, Commutable> {
35670b57cec5SDimitry Andric  def v8i8  : N3VDInt<op24, op23, 0b00, op11_8, op4, f, itinD16,
35680b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
35690b57cec5SDimitry Andric                      v8i8, v8i8, IntOp, Commutable>;
35700b57cec5SDimitry Andric  def v16i8 : N3VQInt<op24, op23, 0b00, op11_8, op4, f, itinQ16,
35710b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
35720b57cec5SDimitry Andric                      v16i8, v16i8, IntOp, Commutable>;
35730b57cec5SDimitry Andric}
35740b57cec5SDimitry Andricmulticlass N3VInt_QHSSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35750b57cec5SDimitry Andric                      InstrItinClass itinD16, InstrItinClass itinD32,
35760b57cec5SDimitry Andric                      InstrItinClass itinQ16, InstrItinClass itinQ32,
35770b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
35780b57cec5SDimitry Andric                      SDPatternOperator IntOp>
35790b57cec5SDimitry Andric  : N3VInt_HSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
35800b57cec5SDimitry Andric              OpcodeStr, Dt, IntOp> {
35810b57cec5SDimitry Andric  def v8i8  : N3VDIntSh<op24, op23, 0b00, op11_8, op4, f, itinD16,
35820b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
35830b57cec5SDimitry Andric                      v8i8, v8i8, IntOp>;
35840b57cec5SDimitry Andric  def v16i8 : N3VQIntSh<op24, op23, 0b00, op11_8, op4, f, itinQ16,
35850b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
35860b57cec5SDimitry Andric                      v16i8, v16i8, IntOp>;
35870b57cec5SDimitry Andric}
35880b57cec5SDimitry Andric
35890b57cec5SDimitry Andric
35900b57cec5SDimitry Andric// ....then also with element size of 64 bits:
35910b57cec5SDimitry Andricmulticlass N3VInt_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
35920b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
35930b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
35940b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
35950b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
35960b57cec5SDimitry Andric  : N3VInt_QHS<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
35970b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp, Commutable> {
35980b57cec5SDimitry Andric  def v1i64 : N3VDInt<op24, op23, 0b11, op11_8, op4, f, itinD32,
35990b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36000b57cec5SDimitry Andric                      v1i64, v1i64, IntOp, Commutable>;
36010b57cec5SDimitry Andric  def v2i64 : N3VQInt<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36020b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36030b57cec5SDimitry Andric                      v2i64, v2i64, IntOp, Commutable>;
36040b57cec5SDimitry Andric}
36050b57cec5SDimitry Andricmulticlass N3VInt_QHSDSh<bit op24, bit op23, bits<4> op11_8, bit op4, Format f,
36060b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
36070b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
36080b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36090b57cec5SDimitry Andric                       SDPatternOperator IntOp>
36100b57cec5SDimitry Andric  : N3VInt_QHSSh<op24, op23, op11_8, op4, f, itinD16, itinD32, itinQ16, itinQ32,
36110b57cec5SDimitry Andric               OpcodeStr, Dt, IntOp> {
36120b57cec5SDimitry Andric  def v1i64 : N3VDIntSh<op24, op23, 0b11, op11_8, op4, f, itinD32,
36130b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36140b57cec5SDimitry Andric                      v1i64, v1i64, IntOp>;
36150b57cec5SDimitry Andric  def v2i64 : N3VQIntSh<op24, op23, 0b11, op11_8, op4, f, itinQ32,
36160b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36170b57cec5SDimitry Andric                      v2i64, v2i64, IntOp>;
36180b57cec5SDimitry Andric}
36190b57cec5SDimitry Andric
36200b57cec5SDimitry Andric// Neon Narrowing 3-register vector intrinsics,
36210b57cec5SDimitry Andric//   source operand element sizes of 16, 32 and 64 bits:
36220b57cec5SDimitry Andricmulticlass N3VNInt_HSD<bit op24, bit op23, bits<4> op11_8, bit op4,
36230b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36240b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0> {
36250b57cec5SDimitry Andric  def v8i8  : N3VNInt<op24, op23, 0b00, op11_8, op4,
36260b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36270b57cec5SDimitry Andric                      v8i8, v8i16, IntOp, Commutable>;
36280b57cec5SDimitry Andric  def v4i16 : N3VNInt<op24, op23, 0b01, op11_8, op4,
36290b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36300b57cec5SDimitry Andric                      v4i16, v4i32, IntOp, Commutable>;
36310b57cec5SDimitry Andric  def v2i32 : N3VNInt<op24, op23, 0b10, op11_8, op4,
36320b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "64"),
36330b57cec5SDimitry Andric                      v2i32, v2i64, IntOp, Commutable>;
36340b57cec5SDimitry Andric}
36350b57cec5SDimitry Andric
36360b57cec5SDimitry Andric
36370b57cec5SDimitry Andric// Neon Long 3-register vector operations.
36380b57cec5SDimitry Andric
36390b57cec5SDimitry Andricmulticlass N3VL_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
36400b57cec5SDimitry Andric                    InstrItinClass itin16, InstrItinClass itin32,
36410b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
36420b57cec5SDimitry Andric                    SDNode OpNode, bit Commutable = 0> {
36430b57cec5SDimitry Andric  def v8i16 : N3VL<op24, op23, 0b00, op11_8, op4, itin16,
36440b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
36450b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, Commutable>;
36460b57cec5SDimitry Andric  def v4i32 : N3VL<op24, op23, 0b01, op11_8, op4, itin16,
36470b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
36480b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, Commutable>;
36490b57cec5SDimitry Andric  def v2i64 : N3VL<op24, op23, 0b10, op11_8, op4, itin32,
36500b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
36510b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, Commutable>;
36520b57cec5SDimitry Andric}
36530b57cec5SDimitry Andric
36540b57cec5SDimitry Andricmulticlass N3VLSL_HS<bit op24, bits<4> op11_8,
36550b57cec5SDimitry Andric                     InstrItinClass itin, string OpcodeStr, string Dt,
36560b57cec5SDimitry Andric                     SDNode OpNode> {
36570b57cec5SDimitry Andric  def v4i16 : N3VLSL16<op24, 0b01, op11_8, itin, OpcodeStr,
36580b57cec5SDimitry Andric                       !strconcat(Dt, "16"), v4i32, v4i16, OpNode>;
36590b57cec5SDimitry Andric  def v2i32 : N3VLSL<op24, 0b10, op11_8, itin, OpcodeStr,
36600b57cec5SDimitry Andric                     !strconcat(Dt, "32"), v2i64, v2i32, OpNode>;
36610b57cec5SDimitry Andric}
36620b57cec5SDimitry Andric
36630b57cec5SDimitry Andricmulticlass N3VLExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
36640b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
36650b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
36660b57cec5SDimitry Andric                       SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
36670b57cec5SDimitry Andric  def v8i16 : N3VLExt<op24, op23, 0b00, op11_8, op4, itin16,
36680b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
36690b57cec5SDimitry Andric                      v8i16, v8i8, OpNode, ExtOp, Commutable>;
36700b57cec5SDimitry Andric  def v4i32 : N3VLExt<op24, op23, 0b01, op11_8, op4, itin16,
36710b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36720b57cec5SDimitry Andric                      v4i32, v4i16, OpNode, ExtOp, Commutable>;
36730b57cec5SDimitry Andric  def v2i64 : N3VLExt<op24, op23, 0b10, op11_8, op4, itin32,
36740b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36750b57cec5SDimitry Andric                      v2i64, v2i32, OpNode, ExtOp, Commutable>;
36760b57cec5SDimitry Andric}
36770b57cec5SDimitry Andric
36780b57cec5SDimitry Andric// Neon Long 3-register vector intrinsics.
36790b57cec5SDimitry Andric
36800b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
36810b57cec5SDimitry Andricmulticlass N3VLInt_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
36820b57cec5SDimitry Andric                      InstrItinClass itin16, InstrItinClass itin32,
36830b57cec5SDimitry Andric                      string OpcodeStr, string Dt,
36840b57cec5SDimitry Andric                      SDPatternOperator IntOp, bit Commutable = 0> {
36850b57cec5SDimitry Andric  def v4i32 : N3VLInt<op24, op23, 0b01, op11_8, op4, itin16,
36860b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "16"),
36870b57cec5SDimitry Andric                      v4i32, v4i16, IntOp, Commutable>;
36880b57cec5SDimitry Andric  def v2i64 : N3VLInt<op24, op23, 0b10, op11_8, op4, itin32,
36890b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "32"),
36900b57cec5SDimitry Andric                      v2i64, v2i32, IntOp, Commutable>;
36910b57cec5SDimitry Andric}
36920b57cec5SDimitry Andric
36930b57cec5SDimitry Andricmulticlass N3VLIntSL_HS<bit op24, bits<4> op11_8,
36940b57cec5SDimitry Andric                        InstrItinClass itin, string OpcodeStr, string Dt,
36950b57cec5SDimitry Andric                        SDPatternOperator IntOp> {
36960b57cec5SDimitry Andric  def v4i16 : N3VLIntSL16<op24, 0b01, op11_8, itin,
36970b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
36980b57cec5SDimitry Andric  def v2i32 : N3VLIntSL<op24, 0b10, op11_8, itin,
36990b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
37000b57cec5SDimitry Andric}
37010b57cec5SDimitry Andric
37020b57cec5SDimitry Andric// ....then also with element size of 8 bits:
37030b57cec5SDimitry Andricmulticlass N3VLInt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37040b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
37050b57cec5SDimitry Andric                       string OpcodeStr, string Dt,
37060b57cec5SDimitry Andric                       SDPatternOperator IntOp, bit Commutable = 0>
37070b57cec5SDimitry Andric  : N3VLInt_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt,
37080b57cec5SDimitry Andric               IntOp, Commutable> {
37090b57cec5SDimitry Andric  def v8i16 : N3VLInt<op24, op23, 0b00, op11_8, op4, itin16,
37100b57cec5SDimitry Andric                      OpcodeStr, !strconcat(Dt, "8"),
37110b57cec5SDimitry Andric                      v8i16, v8i8, IntOp, Commutable>;
37120b57cec5SDimitry Andric}
37130b57cec5SDimitry Andric
37140b57cec5SDimitry Andric// ....with explicit extend (VABDL).
37150b57cec5SDimitry Andricmulticlass N3VLIntExt_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37160b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
37170b57cec5SDimitry Andric                       SDPatternOperator IntOp, SDNode ExtOp, bit Commutable = 0> {
37180b57cec5SDimitry Andric  def v8i16 : N3VLIntExt<op24, op23, 0b00, op11_8, op4, itin,
37190b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"),
37200b57cec5SDimitry Andric                         v8i16, v8i8, IntOp, ExtOp, Commutable>;
37210b57cec5SDimitry Andric  def v4i32 : N3VLIntExt<op24, op23, 0b01, op11_8, op4, itin,
37220b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"),
37230b57cec5SDimitry Andric                         v4i32, v4i16, IntOp, ExtOp, Commutable>;
37240b57cec5SDimitry Andric  def v2i64 : N3VLIntExt<op24, op23, 0b10, op11_8, op4, itin,
37250b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"),
37260b57cec5SDimitry Andric                         v2i64, v2i32, IntOp, ExtOp, Commutable>;
37270b57cec5SDimitry Andric}
37280b57cec5SDimitry Andric
37290b57cec5SDimitry Andric
37300b57cec5SDimitry Andric// Neon Wide 3-register vector intrinsics,
37310b57cec5SDimitry Andric//   source operand element sizes of 8, 16 and 32 bits:
37320b57cec5SDimitry Andricmulticlass N3VW_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37330b57cec5SDimitry Andric                    string OpcodeStr, string Dt,
37340b57cec5SDimitry Andric                    SDNode OpNode, SDNode ExtOp, bit Commutable = 0> {
37350b57cec5SDimitry Andric  def v8i16 : N3VW<op24, op23, 0b00, op11_8, op4,
37360b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "8"),
37370b57cec5SDimitry Andric                   v8i16, v8i8, OpNode, ExtOp, Commutable>;
37380b57cec5SDimitry Andric  def v4i32 : N3VW<op24, op23, 0b01, op11_8, op4,
37390b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "16"),
37400b57cec5SDimitry Andric                   v4i32, v4i16, OpNode, ExtOp, Commutable>;
37410b57cec5SDimitry Andric  def v2i64 : N3VW<op24, op23, 0b10, op11_8, op4,
37420b57cec5SDimitry Andric                   OpcodeStr, !strconcat(Dt, "32"),
37430b57cec5SDimitry Andric                   v2i64, v2i32, OpNode, ExtOp, Commutable>;
37440b57cec5SDimitry Andric}
37450b57cec5SDimitry Andric
37460b57cec5SDimitry Andric
37470b57cec5SDimitry Andric// Neon Multiply-Op vector operations,
37480b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
37490b57cec5SDimitry Andricmulticlass N3VMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37500b57cec5SDimitry Andric                        InstrItinClass itinD16, InstrItinClass itinD32,
37510b57cec5SDimitry Andric                        InstrItinClass itinQ16, InstrItinClass itinQ32,
37520b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDNode OpNode> {
37530b57cec5SDimitry Andric  // 64-bit vector types.
37540b57cec5SDimitry Andric  def v8i8  : N3VDMulOp<op24, op23, 0b00, op11_8, op4, itinD16,
37550b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, mul, OpNode>;
37560b57cec5SDimitry Andric  def v4i16 : N3VDMulOp<op24, op23, 0b01, op11_8, op4, itinD16,
37570b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, OpNode>;
37580b57cec5SDimitry Andric  def v2i32 : N3VDMulOp<op24, op23, 0b10, op11_8, op4, itinD32,
37590b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, OpNode>;
37600b57cec5SDimitry Andric
37610b57cec5SDimitry Andric  // 128-bit vector types.
37620b57cec5SDimitry Andric  def v16i8 : N3VQMulOp<op24, op23, 0b00, op11_8, op4, itinQ16,
37630b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, mul, OpNode>;
37640b57cec5SDimitry Andric  def v8i16 : N3VQMulOp<op24, op23, 0b01, op11_8, op4, itinQ16,
37650b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, mul, OpNode>;
37660b57cec5SDimitry Andric  def v4i32 : N3VQMulOp<op24, op23, 0b10, op11_8, op4, itinQ32,
37670b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, mul, OpNode>;
37680b57cec5SDimitry Andric}
37690b57cec5SDimitry Andric
37700b57cec5SDimitry Andricmulticlass N3VMulOpSL_HS<bits<4> op11_8,
37710b57cec5SDimitry Andric                         InstrItinClass itinD16, InstrItinClass itinD32,
37720b57cec5SDimitry Andric                         InstrItinClass itinQ16, InstrItinClass itinQ32,
37730b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator ShOp> {
37740b57cec5SDimitry Andric  def v4i16 : N3VDMulOpSL16<0b01, op11_8, itinD16,
37750b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v4i16, mul, ShOp>;
37760b57cec5SDimitry Andric  def v2i32 : N3VDMulOpSL<0b10, op11_8, itinD32,
37770b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v2i32, mul, ShOp>;
37780b57cec5SDimitry Andric  def v8i16 : N3VQMulOpSL16<0b01, op11_8, itinQ16,
37790b57cec5SDimitry Andric                            OpcodeStr, !strconcat(Dt, "16"), v8i16, v4i16,
37800b57cec5SDimitry Andric                            mul, ShOp>;
37810b57cec5SDimitry Andric  def v4i32 : N3VQMulOpSL<0b10, op11_8, itinQ32,
37820b57cec5SDimitry Andric                          OpcodeStr, !strconcat(Dt, "32"), v4i32, v2i32,
37830b57cec5SDimitry Andric                          mul, ShOp>;
37840b57cec5SDimitry Andric}
37850b57cec5SDimitry Andric
37860b57cec5SDimitry Andric// Neon Intrinsic-Op vector operations,
37870b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
37880b57cec5SDimitry Andricmulticlass N3VIntOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
37890b57cec5SDimitry Andric                        InstrItinClass itinD, InstrItinClass itinQ,
37900b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp,
37910b57cec5SDimitry Andric                        SDNode OpNode> {
37920b57cec5SDimitry Andric  // 64-bit vector types.
37930b57cec5SDimitry Andric  def v8i8  : N3VDIntOp<op24, op23, 0b00, op11_8, op4, itinD,
37940b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, IntOp, OpNode>;
37950b57cec5SDimitry Andric  def v4i16 : N3VDIntOp<op24, op23, 0b01, op11_8, op4, itinD,
37960b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, IntOp, OpNode>;
37970b57cec5SDimitry Andric  def v2i32 : N3VDIntOp<op24, op23, 0b10, op11_8, op4, itinD,
37980b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, IntOp, OpNode>;
37990b57cec5SDimitry Andric
38000b57cec5SDimitry Andric  // 128-bit vector types.
38010b57cec5SDimitry Andric  def v16i8 : N3VQIntOp<op24, op23, 0b00, op11_8, op4, itinQ,
38020b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, IntOp, OpNode>;
38030b57cec5SDimitry Andric  def v8i16 : N3VQIntOp<op24, op23, 0b01, op11_8, op4, itinQ,
38040b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, IntOp, OpNode>;
38050b57cec5SDimitry Andric  def v4i32 : N3VQIntOp<op24, op23, 0b10, op11_8, op4, itinQ,
38060b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, IntOp, OpNode>;
38070b57cec5SDimitry Andric}
38080b57cec5SDimitry Andric
38090b57cec5SDimitry Andric// Neon 3-argument intrinsics,
38100b57cec5SDimitry Andric//   element sizes of 16 and 32 bits:
38110b57cec5SDimitry Andricmulticlass N3VInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
38120b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38130b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
38140b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
38150b57cec5SDimitry Andric  // 64-bit vector types.
38160b57cec5SDimitry Andric  def v4i16 : N3VDInt3<op24, op23, 0b01, op11_8, op4, itinD16,
38170b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i16, v4i16, IntOp>;
38180b57cec5SDimitry Andric  def v2i32 : N3VDInt3<op24, op23, 0b10, op11_8, op4, itinD32,
38190b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i32, v2i32, IntOp>;
38200b57cec5SDimitry Andric
38210b57cec5SDimitry Andric  // 128-bit vector types.
38220b57cec5SDimitry Andric  def v8i16 : N3VQInt3<op24, op23, 0b01, op11_8, op4, itinQ16,
38230b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v8i16, v8i16, IntOp>;
38240b57cec5SDimitry Andric  def v4i32 : N3VQInt3<op24, op23, 0b10, op11_8, op4, itinQ32,
38250b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v4i32, v4i32, IntOp>;
38260b57cec5SDimitry Andric}
38270b57cec5SDimitry Andric
38280b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38290b57cec5SDimitry Andricmulticlass N3VInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38300b57cec5SDimitry Andric                       InstrItinClass itinD16, InstrItinClass itinD32,
38310b57cec5SDimitry Andric                       InstrItinClass itinQ16, InstrItinClass itinQ32,
38320b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp>
38330b57cec5SDimitry Andric           :N3VInt3_HS <op24, op23, op11_8, op4, itinD16, itinD32,
38340b57cec5SDimitry Andric                        itinQ16, itinQ32, OpcodeStr, Dt, IntOp>{
38350b57cec5SDimitry Andric  // 64-bit vector types.
38360b57cec5SDimitry Andric  def v8i8  : N3VDInt3<op24, op23, 0b00, op11_8, op4, itinD16,
38370b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i8, v8i8, IntOp>;
38380b57cec5SDimitry Andric  // 128-bit vector types.
38390b57cec5SDimitry Andric  def v16i8 : N3VQInt3<op24, op23, 0b00, op11_8, op4, itinQ16,
38400b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v16i8, v16i8, IntOp>;
38410b57cec5SDimitry Andric}
38420b57cec5SDimitry Andric
38430b57cec5SDimitry Andric// Neon Long Multiply-Op vector operations,
38440b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
38450b57cec5SDimitry Andricmulticlass N3VLMulOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38460b57cec5SDimitry Andric                         InstrItinClass itin16, InstrItinClass itin32,
38470b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode MulOp,
38480b57cec5SDimitry Andric                         SDNode OpNode> {
38490b57cec5SDimitry Andric  def v8i16 : N3VLMulOp<op24, op23, 0b00, op11_8, op4, itin16, OpcodeStr,
38500b57cec5SDimitry Andric                        !strconcat(Dt, "8"), v8i16, v8i8, MulOp, OpNode>;
38510b57cec5SDimitry Andric  def v4i32 : N3VLMulOp<op24, op23, 0b01, op11_8, op4, itin16, OpcodeStr,
38520b57cec5SDimitry Andric                        !strconcat(Dt, "16"), v4i32, v4i16, MulOp, OpNode>;
38530b57cec5SDimitry Andric  def v2i64 : N3VLMulOp<op24, op23, 0b10, op11_8, op4, itin32, OpcodeStr,
38540b57cec5SDimitry Andric                        !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
38550b57cec5SDimitry Andric}
38560b57cec5SDimitry Andric
38570b57cec5SDimitry Andricmulticlass N3VLMulOpSL_HS<bit op24, bits<4> op11_8, string OpcodeStr,
38580b57cec5SDimitry Andric                          string Dt, SDNode MulOp, SDNode OpNode> {
38590b57cec5SDimitry Andric  def v4i16 : N3VLMulOpSL16<op24, 0b01, op11_8, IIC_VMACi16D, OpcodeStr,
38600b57cec5SDimitry Andric                            !strconcat(Dt,"16"), v4i32, v4i16, MulOp, OpNode>;
38610b57cec5SDimitry Andric  def v2i32 : N3VLMulOpSL<op24, 0b10, op11_8, IIC_VMACi32D, OpcodeStr,
38620b57cec5SDimitry Andric                          !strconcat(Dt, "32"), v2i64, v2i32, MulOp, OpNode>;
38630b57cec5SDimitry Andric}
38640b57cec5SDimitry Andric
38650b57cec5SDimitry Andric
38660b57cec5SDimitry Andric// Neon Long 3-argument intrinsics.
38670b57cec5SDimitry Andric
38680b57cec5SDimitry Andric// First with only element sizes of 16 and 32 bits:
38690b57cec5SDimitry Andricmulticlass N3VLInt3_HS<bit op24, bit op23, bits<4> op11_8, bit op4,
38700b57cec5SDimitry Andric                       InstrItinClass itin16, InstrItinClass itin32,
38710b57cec5SDimitry Andric                       string OpcodeStr, string Dt, SDPatternOperator IntOp> {
38720b57cec5SDimitry Andric  def v4i32 : N3VLInt3<op24, op23, 0b01, op11_8, op4, itin16,
38730b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, IntOp>;
38740b57cec5SDimitry Andric  def v2i64 : N3VLInt3<op24, op23, 0b10, op11_8, op4, itin32,
38750b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
38760b57cec5SDimitry Andric}
38770b57cec5SDimitry Andric
38780b57cec5SDimitry Andricmulticlass N3VLInt3SL_HS<bit op24, bits<4> op11_8,
38790b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
38800b57cec5SDimitry Andric  def v4i16 : N3VLInt3SL16<op24, 0b01, op11_8, IIC_VMACi16D,
38810b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt,"16"), v4i32, v4i16, IntOp>;
38820b57cec5SDimitry Andric  def v2i32 : N3VLInt3SL<op24, 0b10, op11_8, IIC_VMACi32D,
38830b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, IntOp>;
38840b57cec5SDimitry Andric}
38850b57cec5SDimitry Andric
38860b57cec5SDimitry Andric// ....then also with element size of 8 bits:
38870b57cec5SDimitry Andricmulticlass N3VLInt3_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38880b57cec5SDimitry Andric                        InstrItinClass itin16, InstrItinClass itin32,
38890b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp>
38900b57cec5SDimitry Andric  : N3VLInt3_HS<op24, op23, op11_8, op4, itin16, itin32, OpcodeStr, Dt, IntOp> {
38910b57cec5SDimitry Andric  def v8i16 : N3VLInt3<op24, op23, 0b00, op11_8, op4, itin16,
38920b57cec5SDimitry Andric                       OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, IntOp>;
38930b57cec5SDimitry Andric}
38940b57cec5SDimitry Andric
38950b57cec5SDimitry Andric// ....with explicit extend (VABAL).
38960b57cec5SDimitry Andricmulticlass N3VLIntExtOp_QHS<bit op24, bit op23, bits<4> op11_8, bit op4,
38970b57cec5SDimitry Andric                            InstrItinClass itin, string OpcodeStr, string Dt,
38980b57cec5SDimitry Andric                            SDPatternOperator IntOp, SDNode ExtOp, SDNode OpNode> {
38990b57cec5SDimitry Andric  def v8i16 : N3VLIntExtOp<op24, op23, 0b00, op11_8, op4, itin,
39000b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8,
39010b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39020b57cec5SDimitry Andric  def v4i32 : N3VLIntExtOp<op24, op23, 0b01, op11_8, op4, itin,
39030b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16,
39040b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39050b57cec5SDimitry Andric  def v2i64 : N3VLIntExtOp<op24, op23, 0b10, op11_8, op4, itin,
39060b57cec5SDimitry Andric                           OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32,
39070b57cec5SDimitry Andric                           IntOp, ExtOp, OpNode>;
39080b57cec5SDimitry Andric}
39090b57cec5SDimitry Andric
39100b57cec5SDimitry Andric
39110b57cec5SDimitry Andric// Neon Pairwise long 2-register intrinsics,
39120b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39130b57cec5SDimitry Andricmulticlass N2VPLInt_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
39140b57cec5SDimitry Andric                        bits<5> op11_7, bit op4,
39150b57cec5SDimitry Andric                        string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39160b57cec5SDimitry Andric  // 64-bit vector types.
39170b57cec5SDimitry Andric  def v8i8  : N2VDPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39180b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
39190b57cec5SDimitry Andric  def v4i16 : N2VDPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39200b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
39210b57cec5SDimitry Andric  def v2i32 : N2VDPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39220b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
39230b57cec5SDimitry Andric
39240b57cec5SDimitry Andric  // 128-bit vector types.
39250b57cec5SDimitry Andric  def v16i8 : N2VQPLInt<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39260b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
39270b57cec5SDimitry Andric  def v8i16 : N2VQPLInt<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39280b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
39290b57cec5SDimitry Andric  def v4i32 : N2VQPLInt<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39300b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
39310b57cec5SDimitry Andric}
39320b57cec5SDimitry Andric
39330b57cec5SDimitry Andric
39340b57cec5SDimitry Andric// Neon Pairwise long 2-register accumulate intrinsics,
39350b57cec5SDimitry Andric//   element sizes of 8, 16 and 32 bits:
39360b57cec5SDimitry Andricmulticlass N2VPLInt2_QHS<bits<2> op24_23, bits<2> op21_20, bits<2> op17_16,
39370b57cec5SDimitry Andric                         bits<5> op11_7, bit op4,
39380b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDPatternOperator IntOp> {
39390b57cec5SDimitry Andric  // 64-bit vector types.
39400b57cec5SDimitry Andric  def v8i8  : N2VDPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39410b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v4i16, v8i8, IntOp>;
39420b57cec5SDimitry Andric  def v4i16 : N2VDPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39430b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v2i32, v4i16, IntOp>;
39440b57cec5SDimitry Andric  def v2i32 : N2VDPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39450b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v1i64, v2i32, IntOp>;
39460b57cec5SDimitry Andric
39470b57cec5SDimitry Andric  // 128-bit vector types.
39480b57cec5SDimitry Andric  def v16i8 : N2VQPLInt2<op24_23, op21_20, 0b00, op17_16, op11_7, op4,
39490b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "8"), v8i16, v16i8, IntOp>;
39500b57cec5SDimitry Andric  def v8i16 : N2VQPLInt2<op24_23, op21_20, 0b01, op17_16, op11_7, op4,
39510b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "16"), v4i32, v8i16, IntOp>;
39520b57cec5SDimitry Andric  def v4i32 : N2VQPLInt2<op24_23, op21_20, 0b10, op17_16, op11_7, op4,
39530b57cec5SDimitry Andric                         OpcodeStr, !strconcat(Dt, "32"), v2i64, v4i32, IntOp>;
39540b57cec5SDimitry Andric}
39550b57cec5SDimitry Andric
39560b57cec5SDimitry Andric
39570b57cec5SDimitry Andric// Neon 2-register vector shift by immediate,
39580b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
39590b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
39600b57cec5SDimitry Andricmulticlass N2VShL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
39610b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
39620b57cec5SDimitry Andric                       SDNode OpNode> {
39630b57cec5SDimitry Andric  // 64-bit vector types.
39640b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39650b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
39660b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
39670b57cec5SDimitry Andric  }
39680b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39690b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
39700b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
39710b57cec5SDimitry Andric  }
39720b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39730b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
39740b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
39750b57cec5SDimitry Andric  }
39760b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
39770b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
39780b57cec5SDimitry Andric                             // imm6 = xxxxxx
39790b57cec5SDimitry Andric
39800b57cec5SDimitry Andric  // 128-bit vector types.
39810b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39820b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
39830b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
39840b57cec5SDimitry Andric  }
39850b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39860b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
39870b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
39880b57cec5SDimitry Andric  }
39890b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShLFrm, itin, i32imm,
39900b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
39910b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
39920b57cec5SDimitry Andric  }
39930b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShLFrm, itin, i32imm,
39940b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
39950b57cec5SDimitry Andric                             // imm6 = xxxxxx
39960b57cec5SDimitry Andric}
39970b57cec5SDimitry Andricmulticlass N2VShR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
39980b57cec5SDimitry Andric                       InstrItinClass itin, string OpcodeStr, string Dt,
39990b57cec5SDimitry Andric                       string baseOpc, SDNode OpNode> {
40000b57cec5SDimitry Andric  // 64-bit vector types.
40010b57cec5SDimitry Andric  def v8i8  : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40020b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v8i8, OpNode> {
40030b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40040b57cec5SDimitry Andric  }
40050b57cec5SDimitry Andric  def v4i16 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40060b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v4i16, OpNode> {
40070b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40080b57cec5SDimitry Andric  }
40090b57cec5SDimitry Andric  def v2i32 : N2VDSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40100b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v2i32, OpNode> {
40110b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40120b57cec5SDimitry Andric  }
40130b57cec5SDimitry Andric  def v1i64 : N2VDSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40140b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v1i64, OpNode>;
40150b57cec5SDimitry Andric                             // imm6 = xxxxxx
40160b57cec5SDimitry Andric
40170b57cec5SDimitry Andric  // 128-bit vector types.
40180b57cec5SDimitry Andric  def v16i8 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm8,
40190b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "8"), v16i8, OpNode> {
40200b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40210b57cec5SDimitry Andric  }
40220b57cec5SDimitry Andric  def v8i16 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm16,
40230b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "16"), v8i16, OpNode> {
40240b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40250b57cec5SDimitry Andric  }
40260b57cec5SDimitry Andric  def v4i32 : N2VQSh<op24, op23, op11_8, 0, op4, N2RegVShRFrm, itin, shr_imm32,
40270b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"), v4i32, OpNode> {
40280b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40290b57cec5SDimitry Andric  }
40300b57cec5SDimitry Andric  def v2i64 : N2VQSh<op24, op23, op11_8, 1, op4, N2RegVShRFrm, itin, shr_imm64,
40310b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"), v2i64, OpNode>;
40320b57cec5SDimitry Andric                             // imm6 = xxxxxx
40330b57cec5SDimitry Andric}
40340b57cec5SDimitry Andric
40350b57cec5SDimitry Andric// Neon Shift-Accumulate vector operations,
40360b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
40370b57cec5SDimitry Andricmulticlass N2VShAdd_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40380b57cec5SDimitry Andric                         string OpcodeStr, string Dt, SDNode ShOp> {
40390b57cec5SDimitry Andric  // 64-bit vector types.
40400b57cec5SDimitry Andric  def v8i8  : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
40410b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v8i8, ShOp> {
40420b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40430b57cec5SDimitry Andric  }
40440b57cec5SDimitry Andric  def v4i16 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
40450b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v4i16, ShOp> {
40460b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40470b57cec5SDimitry Andric  }
40480b57cec5SDimitry Andric  def v2i32 : N2VDShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
40490b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v2i32, ShOp> {
40500b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40510b57cec5SDimitry Andric  }
40520b57cec5SDimitry Andric  def v1i64 : N2VDShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
40530b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v1i64, ShOp>;
40540b57cec5SDimitry Andric                             // imm6 = xxxxxx
40550b57cec5SDimitry Andric
40560b57cec5SDimitry Andric  // 128-bit vector types.
40570b57cec5SDimitry Andric  def v16i8 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm8,
40580b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "8"), v16i8, ShOp> {
40590b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40600b57cec5SDimitry Andric  }
40610b57cec5SDimitry Andric  def v8i16 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm16,
40620b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "16"), v8i16, ShOp> {
40630b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40640b57cec5SDimitry Andric  }
40650b57cec5SDimitry Andric  def v4i32 : N2VQShAdd<op24, op23, op11_8, 0, op4, shr_imm32,
40660b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "32"), v4i32, ShOp> {
40670b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40680b57cec5SDimitry Andric  }
40690b57cec5SDimitry Andric  def v2i64 : N2VQShAdd<op24, op23, op11_8, 1, op4, shr_imm64,
40700b57cec5SDimitry Andric                        OpcodeStr, !strconcat(Dt, "64"), v2i64, ShOp>;
40710b57cec5SDimitry Andric                             // imm6 = xxxxxx
40720b57cec5SDimitry Andric}
40730b57cec5SDimitry Andric
40740b57cec5SDimitry Andric// Neon Shift-Insert vector operations,
40750b57cec5SDimitry Andric//   with f of either N2RegVShLFrm or N2RegVShRFrm
40760b57cec5SDimitry Andric//   element sizes of 8, 16, 32 and 64 bits:
40770b57cec5SDimitry Andricmulticlass N2VShInsL_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
40780b57cec5SDimitry Andric                          string OpcodeStr> {
40790b57cec5SDimitry Andric  // 64-bit vector types.
40800b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
40810b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v8i8, NEONvsliImm> {
40820b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
40830b57cec5SDimitry Andric  }
40840b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
40850b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v4i16, NEONvsliImm> {
40860b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
40870b57cec5SDimitry Andric  }
40880b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, i32imm,
40890b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v2i32, NEONvsliImm> {
40900b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
40910b57cec5SDimitry Andric  }
40920b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, i32imm,
40930b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v1i64, NEONvsliImm>;
40940b57cec5SDimitry Andric                             // imm6 = xxxxxx
40950b57cec5SDimitry Andric
40960b57cec5SDimitry Andric  // 128-bit vector types.
40970b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
40980b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "8", v16i8, NEONvsliImm> {
40990b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41000b57cec5SDimitry Andric  }
41010b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41020b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "16", v8i16, NEONvsliImm> {
41030b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41040b57cec5SDimitry Andric  }
41050b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, i32imm,
41060b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "32", v4i32, NEONvsliImm> {
41070b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41080b57cec5SDimitry Andric  }
41090b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, i32imm,
41100b57cec5SDimitry Andric                        N2RegVShLFrm, OpcodeStr, "64", v2i64, NEONvsliImm>;
41110b57cec5SDimitry Andric                             // imm6 = xxxxxx
41120b57cec5SDimitry Andric}
41130b57cec5SDimitry Andricmulticlass N2VShInsR_QHSD<bit op24, bit op23, bits<4> op11_8, bit op4,
41140b57cec5SDimitry Andric                          string OpcodeStr> {
41150b57cec5SDimitry Andric  // 64-bit vector types.
41160b57cec5SDimitry Andric  def v8i8  : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm8,
41170b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v8i8, NEONvsriImm> {
41180b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41190b57cec5SDimitry Andric  }
41200b57cec5SDimitry Andric  def v4i16 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm16,
41210b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v4i16, NEONvsriImm> {
41220b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41230b57cec5SDimitry Andric  }
41240b57cec5SDimitry Andric  def v2i32 : N2VDShIns<op24, op23, op11_8, 0, op4, shr_imm32,
41250b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v2i32, NEONvsriImm> {
41260b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41270b57cec5SDimitry Andric  }
41280b57cec5SDimitry Andric  def v1i64 : N2VDShIns<op24, op23, op11_8, 1, op4, shr_imm64,
41290b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v1i64, NEONvsriImm>;
41300b57cec5SDimitry Andric                             // imm6 = xxxxxx
41310b57cec5SDimitry Andric
41320b57cec5SDimitry Andric  // 128-bit vector types.
41330b57cec5SDimitry Andric  def v16i8 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm8,
41340b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "8", v16i8, NEONvsriImm> {
41350b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41360b57cec5SDimitry Andric  }
41370b57cec5SDimitry Andric  def v8i16 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm16,
41380b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "16", v8i16, NEONvsriImm> {
41390b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41400b57cec5SDimitry Andric  }
41410b57cec5SDimitry Andric  def v4i32 : N2VQShIns<op24, op23, op11_8, 0, op4, shr_imm32,
41420b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "32", v4i32, NEONvsriImm> {
41430b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41440b57cec5SDimitry Andric  }
41450b57cec5SDimitry Andric  def v2i64 : N2VQShIns<op24, op23, op11_8, 1, op4, shr_imm64,
41460b57cec5SDimitry Andric                        N2RegVShRFrm, OpcodeStr, "64", v2i64, NEONvsriImm>;
41470b57cec5SDimitry Andric                             // imm6 = xxxxxx
41480b57cec5SDimitry Andric}
41490b57cec5SDimitry Andric
41500b57cec5SDimitry Andric// Neon Shift Long operations,
41510b57cec5SDimitry Andric//   element sizes of 8, 16, 32 bits:
41520b57cec5SDimitry Andricmulticlass N2VLSh_QHS<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
41530b57cec5SDimitry Andric                      bit op4, string OpcodeStr, string Dt,
41540b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
41550b57cec5SDimitry Andric  def v8i16 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
41560b57cec5SDimitry Andric              OpcodeStr, !strconcat(Dt, "8"), v8i16, v8i8, imm1_7, OpNode> {
41570b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41580b57cec5SDimitry Andric  }
41590b57cec5SDimitry Andric  def v4i32 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
41600b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "16"), v4i32, v4i16, imm1_15, OpNode> {
41610b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41620b57cec5SDimitry Andric  }
41630b57cec5SDimitry Andric  def v2i64 : N2VLSh<op24, op23, op11_8, op7, op6, op4,
41640b57cec5SDimitry Andric               OpcodeStr, !strconcat(Dt, "32"), v2i64, v2i32, imm1_31, OpNode> {
41650b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41660b57cec5SDimitry Andric  }
41670b57cec5SDimitry Andric}
41680b57cec5SDimitry Andric
41690b57cec5SDimitry Andric// Neon Shift Narrow operations,
41700b57cec5SDimitry Andric//   element sizes of 16, 32, 64 bits:
41710b57cec5SDimitry Andricmulticlass N2VNSh_HSD<bit op24, bit op23, bits<4> op11_8, bit op7, bit op6,
41720b57cec5SDimitry Andric                      bit op4, InstrItinClass itin, string OpcodeStr, string Dt,
41730b57cec5SDimitry Andric                      SDPatternOperator OpNode> {
41740b57cec5SDimitry Andric  def v8i8 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
41750b57cec5SDimitry Andric                    OpcodeStr, !strconcat(Dt, "16"),
41760b57cec5SDimitry Andric                    v8i8, v8i16, shr_imm8, OpNode> {
41770b57cec5SDimitry Andric    let Inst{21-19} = 0b001; // imm6 = 001xxx
41780b57cec5SDimitry Andric  }
41790b57cec5SDimitry Andric  def v4i16 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
41800b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "32"),
41810b57cec5SDimitry Andric                     v4i16, v4i32, shr_imm16, OpNode> {
41820b57cec5SDimitry Andric    let Inst{21-20} = 0b01;  // imm6 = 01xxxx
41830b57cec5SDimitry Andric  }
41840b57cec5SDimitry Andric  def v2i32 : N2VNSh<op24, op23, op11_8, op7, op6, op4, itin,
41850b57cec5SDimitry Andric                     OpcodeStr, !strconcat(Dt, "64"),
41860b57cec5SDimitry Andric                     v2i32, v2i64, shr_imm32, OpNode> {
41870b57cec5SDimitry Andric    let Inst{21} = 0b1;      // imm6 = 1xxxxx
41880b57cec5SDimitry Andric  }
41890b57cec5SDimitry Andric}
41900b57cec5SDimitry Andric
41910b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
41920b57cec5SDimitry Andric// Instruction Definitions.
41930b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
41940b57cec5SDimitry Andric
41950b57cec5SDimitry Andric// Vector Add Operations.
41960b57cec5SDimitry Andric
41970b57cec5SDimitry Andric//   VADD     : Vector Add (integer and floating-point)
41980b57cec5SDimitry Andricdefm VADD     : N3V_QHSD<0, 0, 0b1000, 0, IIC_VBINiD, IIC_VBINiQ, "vadd", "i",
41990b57cec5SDimitry Andric                         add, 1>;
42000b57cec5SDimitry Andricdef  VADDfd   : N3VD<0, 0, 0b00, 0b1101, 0, IIC_VBIND, "vadd", "f32",
42010b57cec5SDimitry Andric                     v2f32, v2f32, fadd, 1>;
42020b57cec5SDimitry Andricdef  VADDfq   : N3VQ<0, 0, 0b00, 0b1101, 0, IIC_VBINQ, "vadd", "f32",
42030b57cec5SDimitry Andric                     v4f32, v4f32, fadd, 1>;
42040b57cec5SDimitry Andricdef  VADDhd   : N3VD<0, 0, 0b01, 0b1101, 0, IIC_VBIND, "vadd", "f16",
42050b57cec5SDimitry Andric                     v4f16, v4f16, fadd, 1>,
42060b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42070b57cec5SDimitry Andricdef  VADDhq   : N3VQ<0, 0, 0b01, 0b1101, 0, IIC_VBINQ, "vadd", "f16",
42080b57cec5SDimitry Andric                     v8f16, v8f16, fadd, 1>,
42090b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42100b57cec5SDimitry Andric//   VADDL    : Vector Add Long (Q = D + D)
42110b57cec5SDimitry Andricdefm VADDLs   : N3VLExt_QHS<0,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
42120b57cec5SDimitry Andric                            "vaddl", "s", add, sext, 1>;
42130b57cec5SDimitry Andricdefm VADDLu   : N3VLExt_QHS<1,1,0b0000,0, IIC_VSHLiD, IIC_VSHLiD,
42140b57cec5SDimitry Andric                            "vaddl", "u", add, zext, 1>;
42150b57cec5SDimitry Andric//   VADDW    : Vector Add Wide (Q = Q + D)
42160b57cec5SDimitry Andricdefm VADDWs   : N3VW_QHS<0,1,0b0001,0, "vaddw", "s", add, sext, 0>;
42170b57cec5SDimitry Andricdefm VADDWu   : N3VW_QHS<1,1,0b0001,0, "vaddw", "u", add, zext, 0>;
42180b57cec5SDimitry Andric//   VHADD    : Vector Halving Add
42190b57cec5SDimitry Andricdefm VHADDs   : N3VInt_QHS<0, 0, 0b0000, 0, N3RegFrm,
42200b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42210b57cec5SDimitry Andric                           "vhadd", "s", int_arm_neon_vhadds, 1>;
42220b57cec5SDimitry Andricdefm VHADDu   : N3VInt_QHS<1, 0, 0b0000, 0, N3RegFrm,
42230b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42240b57cec5SDimitry Andric                           "vhadd", "u", int_arm_neon_vhaddu, 1>;
42250b57cec5SDimitry Andric//   VRHADD   : Vector Rounding Halving Add
42260b57cec5SDimitry Andricdefm VRHADDs  : N3VInt_QHS<0, 0, 0b0001, 0, N3RegFrm,
42270b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42280b57cec5SDimitry Andric                           "vrhadd", "s", int_arm_neon_vrhadds, 1>;
42290b57cec5SDimitry Andricdefm VRHADDu  : N3VInt_QHS<1, 0, 0b0001, 0, N3RegFrm,
42300b57cec5SDimitry Andric                           IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
42310b57cec5SDimitry Andric                           "vrhadd", "u", int_arm_neon_vrhaddu, 1>;
42320b57cec5SDimitry Andric//   VQADD    : Vector Saturating Add
42330b57cec5SDimitry Andricdefm VQADDs   : N3VInt_QHSD<0, 0, 0b0000, 1, N3RegFrm,
42340b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4235480093f4SDimitry Andric                            "vqadd", "s", saddsat, 1>;
42360b57cec5SDimitry Andricdefm VQADDu   : N3VInt_QHSD<1, 0, 0b0000, 1, N3RegFrm,
42370b57cec5SDimitry Andric                            IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q, IIC_VBINi4Q,
4238480093f4SDimitry Andric                            "vqadd", "u", uaddsat, 1>;
42390b57cec5SDimitry Andric//   VADDHN   : Vector Add and Narrow Returning High Half (D = Q + Q)
42400b57cec5SDimitry Andricdefm VADDHN   : N3VNInt_HSD<0,1,0b0100,0, "vaddhn", "i", null_frag, 1>;
42410b57cec5SDimitry Andric//   VRADDHN  : Vector Rounding Add and Narrow Returning High Half (D = Q + Q)
42420b57cec5SDimitry Andricdefm VRADDHN  : N3VNInt_HSD<1,1,0b0100,0, "vraddhn", "i",
42430b57cec5SDimitry Andric                            int_arm_neon_vraddhn, 1>;
42440b57cec5SDimitry Andric
42450b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
42460b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (add (v8i16 QPR:$Vn), QPR:$Vm), 8))),
42470b57cec5SDimitry Andric          (VADDHNv8i8 QPR:$Vn, QPR:$Vm)>;
42480b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (add (v4i32 QPR:$Vn), QPR:$Vm), 16))),
42490b57cec5SDimitry Andric          (VADDHNv4i16 QPR:$Vn, QPR:$Vm)>;
42500b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (add (v2i64 QPR:$Vn), QPR:$Vm), 32))),
42510b57cec5SDimitry Andric          (VADDHNv2i32 QPR:$Vn, QPR:$Vm)>;
42520b57cec5SDimitry Andric}
42530b57cec5SDimitry Andric
42540b57cec5SDimitry Andric// Vector Multiply Operations.
42550b57cec5SDimitry Andric
42560b57cec5SDimitry Andric//   VMUL     : Vector Multiply (integer, polynomial and floating-point)
42570b57cec5SDimitry Andricdefm VMUL     : N3V_QHS<0, 0, 0b1001, 1, IIC_VMULi16D, IIC_VMULi32D,
42580b57cec5SDimitry Andric                        IIC_VMULi16Q, IIC_VMULi32Q, "vmul", "i", mul, 1>;
42590b57cec5SDimitry Andricdef  VMULpd   : N3VDInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16D, "vmul",
42600b57cec5SDimitry Andric                        "p8", v8i8, v8i8, int_arm_neon_vmulp, 1>;
42610b57cec5SDimitry Andricdef  VMULpq   : N3VQInt<1, 0, 0b00, 0b1001, 1, N3RegFrm, IIC_VMULi16Q, "vmul",
42620b57cec5SDimitry Andric                        "p8", v16i8, v16i8, int_arm_neon_vmulp, 1>;
42630b57cec5SDimitry Andricdef  VMULfd   : N3VD<1, 0, 0b00, 0b1101, 1, IIC_VFMULD, "vmul", "f32",
42640b57cec5SDimitry Andric                     v2f32, v2f32, fmul, 1>;
42650b57cec5SDimitry Andricdef  VMULfq   : N3VQ<1, 0, 0b00, 0b1101, 1, IIC_VFMULQ, "vmul", "f32",
42660b57cec5SDimitry Andric                     v4f32, v4f32, fmul, 1>;
42670b57cec5SDimitry Andricdef  VMULhd   : N3VD<1, 0, 0b01, 0b1101, 1, IIC_VFMULD, "vmul", "f16",
42680b57cec5SDimitry Andric                     v4f16, v4f16, fmul, 1>,
42690b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42700b57cec5SDimitry Andricdef  VMULhq   : N3VQ<1, 0, 0b01, 0b1101, 1, IIC_VFMULQ, "vmul", "f16",
42710b57cec5SDimitry Andric                     v8f16, v8f16, fmul, 1>,
42720b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42730b57cec5SDimitry Andricdefm VMULsl   : N3VSL_HS<0b1000, "vmul", mul>;
42740b57cec5SDimitry Andricdef  VMULslfd : N3VDSL<0b10, 0b1001, IIC_VBIND, "vmul", "f32", v2f32, fmul>;
42750b57cec5SDimitry Andricdef  VMULslfq : N3VQSL<0b10, 0b1001, IIC_VBINQ, "vmul", "f32", v4f32,
42760b57cec5SDimitry Andric                       v2f32, fmul>;
42770b57cec5SDimitry Andricdef  VMULslhd : N3VDSL16<0b01, 0b1001, "vmul", "f16", v4f16, fmul>,
42780b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42790b57cec5SDimitry Andricdef  VMULslhq : N3VQSL16<0b01, 0b1001, "vmul", "f16", v8f16,
42800b57cec5SDimitry Andric                       v4f16, fmul>,
42810b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
42820b57cec5SDimitry Andric
42830b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
42840b57cec5SDimitry Andricdef : Pat<(v8i16 (mul (v8i16 QPR:$src1),
42850b57cec5SDimitry Andric                      (v8i16 (ARMvduplane (v8i16 QPR:$src2), imm:$lane)))),
42860b57cec5SDimitry Andric          (v8i16 (VMULslv8i16 (v8i16 QPR:$src1),
42870b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src2,
42880b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
42890b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
42900b57cec5SDimitry Andricdef : Pat<(v4i32 (mul (v4i32 QPR:$src1),
42910b57cec5SDimitry Andric                      (v4i32 (ARMvduplane (v4i32 QPR:$src2), imm:$lane)))),
42920b57cec5SDimitry Andric          (v4i32 (VMULslv4i32 (v4i32 QPR:$src1),
42930b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src2,
42940b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
42950b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
42960b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul (v4f32 QPR:$src1),
42970b57cec5SDimitry Andric                       (v4f32 (ARMvduplane (v4f32 QPR:$src2), imm:$lane)))),
42980b57cec5SDimitry Andric          (v4f32 (VMULslfq (v4f32 QPR:$src1),
42990b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src2,
43000b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
43010b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
43020b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul (v8f16 QPR:$src1),
43030b57cec5SDimitry Andric                       (v8f16 (ARMvduplane (v8f16 QPR:$src2), imm:$lane)))),
43040b57cec5SDimitry Andric          (v8f16 (VMULslhq(v8f16 QPR:$src1),
43050b57cec5SDimitry Andric                           (v4f16 (EXTRACT_SUBREG QPR:$src2,
43060b57cec5SDimitry Andric                                   (DSubReg_i16_reg imm:$lane))),
43070b57cec5SDimitry Andric                           (SubReg_i16_lane imm:$lane)))>;
43080b57cec5SDimitry Andric
43090b57cec5SDimitry Andricdef : Pat<(v2f32 (fmul DPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43100b57cec5SDimitry Andric          (VMULslfd DPR:$Rn,
43110b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43120b57cec5SDimitry Andric            (i32 0))>;
43130b57cec5SDimitry Andricdef : Pat<(v4f16 (fmul DPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43140b57cec5SDimitry Andric          (VMULslhd DPR:$Rn,
4315*5ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43160b57cec5SDimitry Andric            (i32 0))>;
43170b57cec5SDimitry Andricdef : Pat<(v4f32 (fmul QPR:$Rn, (ARMvdup (f32 SPR:$Rm)))),
43180b57cec5SDimitry Andric          (VMULslfq QPR:$Rn,
43190b57cec5SDimitry Andric            (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$Rm, ssub_0),
43200b57cec5SDimitry Andric            (i32 0))>;
43210b57cec5SDimitry Andricdef : Pat<(v8f16 (fmul QPR:$Rn, (ARMvdup (f16 HPR:$Rm)))),
43220b57cec5SDimitry Andric          (VMULslhq QPR:$Rn,
4323*5ffd83dbSDimitry Andric            (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)), (f16 HPR:$Rm), ssub_0),
43240b57cec5SDimitry Andric            (i32 0))>;
43250b57cec5SDimitry Andric}
43260b57cec5SDimitry Andric
43270b57cec5SDimitry Andric//   VQDMULH  : Vector Saturating Doubling Multiply Returning High Half
43280b57cec5SDimitry Andricdefm VQDMULH  : N3VInt_HS<0, 0, 0b1011, 0, N3RegFrm, IIC_VMULi16D, IIC_VMULi32D,
43290b57cec5SDimitry Andric                          IIC_VMULi16Q, IIC_VMULi32Q,
43300b57cec5SDimitry Andric                          "vqdmulh", "s", int_arm_neon_vqdmulh, 1>;
43310b57cec5SDimitry Andricdefm VQDMULHsl: N3VIntSL_HS<0b1100, IIC_VMULi16D, IIC_VMULi32D,
43320b57cec5SDimitry Andric                            IIC_VMULi16Q, IIC_VMULi32Q,
43330b57cec5SDimitry Andric                            "vqdmulh", "s",  int_arm_neon_vqdmulh>;
43340b57cec5SDimitry Andric
43350b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43360b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqdmulh (v8i16 QPR:$src1),
43370b57cec5SDimitry Andric                                       (v8i16 (ARMvduplane (v8i16 QPR:$src2),
43380b57cec5SDimitry Andric                                                            imm:$lane)))),
43390b57cec5SDimitry Andric          (v8i16 (VQDMULHslv8i16 (v8i16 QPR:$src1),
43400b57cec5SDimitry Andric                                 (v4i16 (EXTRACT_SUBREG QPR:$src2,
43410b57cec5SDimitry Andric                                         (DSubReg_i16_reg imm:$lane))),
43420b57cec5SDimitry Andric                                 (SubReg_i16_lane imm:$lane)))>;
43430b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqdmulh (v4i32 QPR:$src1),
43440b57cec5SDimitry Andric                                       (v4i32 (ARMvduplane (v4i32 QPR:$src2),
43450b57cec5SDimitry Andric                                                            imm:$lane)))),
43460b57cec5SDimitry Andric          (v4i32 (VQDMULHslv4i32 (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 Andric}
43510b57cec5SDimitry Andric
43520b57cec5SDimitry Andric//   VQRDMULH : Vector Rounding Saturating Doubling Multiply Returning High Half
43530b57cec5SDimitry Andricdefm VQRDMULH   : N3VInt_HS<1, 0, 0b1011, 0, N3RegFrm,
43540b57cec5SDimitry Andric                            IIC_VMULi16D,IIC_VMULi32D,IIC_VMULi16Q,IIC_VMULi32Q,
43550b57cec5SDimitry Andric                            "vqrdmulh", "s", int_arm_neon_vqrdmulh, 1>;
43560b57cec5SDimitry Andricdefm VQRDMULHsl : N3VIntSL_HS<0b1101, IIC_VMULi16D, IIC_VMULi32D,
43570b57cec5SDimitry Andric                              IIC_VMULi16Q, IIC_VMULi32Q,
43580b57cec5SDimitry Andric                              "vqrdmulh", "s",  int_arm_neon_vqrdmulh>;
43590b57cec5SDimitry Andric
43600b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
43610b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$src1),
43620b57cec5SDimitry Andric                                        (v8i16 (ARMvduplane (v8i16 QPR:$src2),
43630b57cec5SDimitry Andric                                                             imm:$lane)))),
43640b57cec5SDimitry Andric          (v8i16 (VQRDMULHslv8i16 (v8i16 QPR:$src1),
43650b57cec5SDimitry Andric                                  (v4i16 (EXTRACT_SUBREG QPR:$src2,
43660b57cec5SDimitry Andric                                          (DSubReg_i16_reg imm:$lane))),
43670b57cec5SDimitry Andric                                  (SubReg_i16_lane imm:$lane)))>;
43680b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$src1),
43690b57cec5SDimitry Andric                                        (v4i32 (ARMvduplane (v4i32 QPR:$src2),
43700b57cec5SDimitry Andric                                                             imm:$lane)))),
43710b57cec5SDimitry Andric          (v4i32 (VQRDMULHslv4i32 (v4i32 QPR:$src1),
43720b57cec5SDimitry Andric                                  (v2i32 (EXTRACT_SUBREG QPR:$src2,
43730b57cec5SDimitry Andric                                          (DSubReg_i32_reg imm:$lane))),
43740b57cec5SDimitry Andric                                  (SubReg_i32_lane imm:$lane)))>;
43750b57cec5SDimitry Andric}
43760b57cec5SDimitry Andric
43770b57cec5SDimitry Andric//   VMULL    : Vector Multiply Long (integer and polynomial) (Q = D * D)
43780b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
43790b57cec5SDimitry Andric    DecoderNamespace = "NEONData" in {
43800b57cec5SDimitry Andric  defm VMULLs   : N3VL_QHS<0,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4381*5ffd83dbSDimitry Andric                           "vmull", "s", ARMvmulls, 1>;
43820b57cec5SDimitry Andric  defm VMULLu   : N3VL_QHS<1,1,0b1100,0, IIC_VMULi16D, IIC_VMULi32D,
4383*5ffd83dbSDimitry Andric                           "vmull", "u", ARMvmullu, 1>;
43840b57cec5SDimitry Andric  def  VMULLp8   :  N3VLInt<0, 1, 0b00, 0b1110, 0, IIC_VMULi16D, "vmull", "p8",
43850b57cec5SDimitry Andric                            v8i16, v8i8, int_arm_neon_vmullp, 1>;
43860b57cec5SDimitry Andric  def  VMULLp64  : N3VLIntnp<0b00101, 0b10, 0b1110, 0, 0, NoItinerary,
43870b57cec5SDimitry Andric                          "vmull", "p64", v2i64, v1i64, int_arm_neon_vmullp, 1>,
43880b57cec5SDimitry Andric                    Requires<[HasV8, HasCrypto]>;
43890b57cec5SDimitry Andric}
4390*5ffd83dbSDimitry Andricdefm VMULLsls : N3VLSL_HS<0, 0b1010, IIC_VMULi16D, "vmull", "s", ARMvmulls>;
4391*5ffd83dbSDimitry Andricdefm VMULLslu : N3VLSL_HS<1, 0b1010, IIC_VMULi16D, "vmull", "u", ARMvmullu>;
43920b57cec5SDimitry Andric
43930b57cec5SDimitry Andric//   VQDMULL  : Vector Saturating Doubling Multiply Long (Q = D * D)
43940b57cec5SDimitry Andricdefm VQDMULL  : N3VLInt_HS<0,1,0b1101,0, IIC_VMULi16D, IIC_VMULi32D,
43950b57cec5SDimitry Andric                           "vqdmull", "s", int_arm_neon_vqdmull, 1>;
43960b57cec5SDimitry Andricdefm VQDMULLsl: N3VLIntSL_HS<0, 0b1011, IIC_VMULi16D,
43970b57cec5SDimitry Andric                             "vqdmull", "s", int_arm_neon_vqdmull>;
43980b57cec5SDimitry Andric
43990b57cec5SDimitry Andric// Vector Multiply-Accumulate and Multiply-Subtract Operations.
44000b57cec5SDimitry Andric
44010b57cec5SDimitry Andric//   VMLA     : Vector Multiply Accumulate (integer and floating-point)
44020b57cec5SDimitry Andricdefm VMLA     : N3VMulOp_QHS<0, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
44030b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44040b57cec5SDimitry Andricdef  VMLAfd   : N3VDMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACD, "vmla", "f32",
44050b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
44060b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44070b57cec5SDimitry Andricdef  VMLAfq   : N3VQMulOp<0, 0, 0b00, 0b1101, 1, IIC_VMACQ, "vmla", "f32",
44080b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
44090b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44100b57cec5SDimitry Andricdef  VMLAhd   : N3VDMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACD, "vmla", "f16",
44110b57cec5SDimitry Andric                          v4f16, fmul_su, fadd_mlx>,
44120b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44130b57cec5SDimitry Andricdef  VMLAhq   : N3VQMulOp<0, 0, 0b01, 0b1101, 1, IIC_VMACQ, "vmla", "f16",
44140b57cec5SDimitry Andric                          v8f16, fmul_su, fadd_mlx>,
44150b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44160b57cec5SDimitry Andricdefm VMLAsl   : N3VMulOpSL_HS<0b0000, IIC_VMACi16D, IIC_VMACi32D,
44170b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmla", "i", add>;
44180b57cec5SDimitry Andricdef  VMLAslfd : N3VDMulOpSL<0b10, 0b0001, IIC_VMACD, "vmla", "f32",
44190b57cec5SDimitry Andric                            v2f32, fmul_su, fadd_mlx>,
44200b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44210b57cec5SDimitry Andricdef  VMLAslfq : N3VQMulOpSL<0b10, 0b0001, IIC_VMACQ, "vmla", "f32",
44220b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fadd_mlx>,
44230b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
44240b57cec5SDimitry Andricdef  VMLAslhd : N3VDMulOpSL16<0b01, 0b0001, IIC_VMACD, "vmla", "f16",
44250b57cec5SDimitry Andric                            v4f16, fmul, fadd>,
44260b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44270b57cec5SDimitry Andricdef  VMLAslhq : N3VQMulOpSL16<0b01, 0b0001, IIC_VMACQ, "vmla", "f16",
44280b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fadd>,
44290b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
44300b57cec5SDimitry Andric
44310b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
44320b57cec5SDimitry Andricdef : Pat<(v8i16 (add (v8i16 QPR:$src1),
44330b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
44340b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
44350b57cec5SDimitry Andric          (v8i16 (VMLAslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
44360b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
44370b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
44380b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
44390b57cec5SDimitry Andric
44400b57cec5SDimitry Andricdef : Pat<(v4i32 (add (v4i32 QPR:$src1),
44410b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
44420b57cec5SDimitry Andric                       (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
44430b57cec5SDimitry Andric          (v4i32 (VMLAslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
44440b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
44450b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
44460b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
44470b57cec5SDimitry Andric}
44480b57cec5SDimitry Andric
44490b57cec5SDimitry Andricdef : Pat<(v4f32 (fadd_mlx (v4f32 QPR:$src1),
44500b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
44510b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
44520b57cec5SDimitry Andric          (v4f32 (VMLAslfq (v4f32 QPR:$src1),
44530b57cec5SDimitry Andric                           (v4f32 QPR:$src2),
44540b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
44550b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
44560b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
44570b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
44580b57cec5SDimitry Andric
44590b57cec5SDimitry Andric//   VMLAL    : Vector Multiply Accumulate Long (Q += D * D)
44600b57cec5SDimitry Andricdefm VMLALs   : N3VLMulOp_QHS<0,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4461*5ffd83dbSDimitry Andric                              "vmlal", "s", ARMvmulls, add>;
44620b57cec5SDimitry Andricdefm VMLALu   : N3VLMulOp_QHS<1,1,0b1000,0, IIC_VMACi16D, IIC_VMACi32D,
4463*5ffd83dbSDimitry Andric                              "vmlal", "u", ARMvmullu, add>;
44640b57cec5SDimitry Andric
4465*5ffd83dbSDimitry Andricdefm VMLALsls : N3VLMulOpSL_HS<0, 0b0010, "vmlal", "s", ARMvmulls, add>;
4466*5ffd83dbSDimitry Andricdefm VMLALslu : N3VLMulOpSL_HS<1, 0b0010, "vmlal", "u", ARMvmullu, add>;
44670b57cec5SDimitry Andric
44680b57cec5SDimitry Andriclet Predicates = [HasNEON, HasV8_1a] in {
44690b57cec5SDimitry Andric  // v8.1a Neon Rounding Double Multiply-Op vector operations,
44700b57cec5SDimitry Andric  // VQRDMLAH : Vector Saturating Rounding Doubling Multiply Accumulate Long
44710b57cec5SDimitry Andric  //            (Q += D * D)
44720b57cec5SDimitry Andric  defm VQRDMLAH : N3VInt3_HS<1, 0, 0b1011, 1, IIC_VMACi16D, IIC_VMACi32D,
44730b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
44740b57cec5SDimitry Andric                             null_frag>;
4475480093f4SDimitry Andric  def : Pat<(v4i16 (saddsat
44760b57cec5SDimitry Andric                     (v4i16 DPR:$src1),
44770b57cec5SDimitry Andric                     (v4i16 (int_arm_neon_vqrdmulh (v4i16 DPR:$Vn),
44780b57cec5SDimitry Andric                                                   (v4i16 DPR:$Vm))))),
44790b57cec5SDimitry Andric            (v4i16 (VQRDMLAHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4480480093f4SDimitry Andric  def : Pat<(v2i32 (saddsat
44810b57cec5SDimitry Andric                     (v2i32 DPR:$src1),
44820b57cec5SDimitry Andric                     (v2i32 (int_arm_neon_vqrdmulh (v2i32 DPR:$Vn),
44830b57cec5SDimitry Andric                                                   (v2i32 DPR:$Vm))))),
44840b57cec5SDimitry Andric            (v2i32 (VQRDMLAHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4485480093f4SDimitry Andric  def : Pat<(v8i16 (saddsat
44860b57cec5SDimitry Andric                     (v8i16 QPR:$src1),
44870b57cec5SDimitry Andric                     (v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$Vn),
44880b57cec5SDimitry Andric                                                   (v8i16 QPR:$Vm))))),
44890b57cec5SDimitry Andric            (v8i16 (VQRDMLAHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4490480093f4SDimitry Andric  def : Pat<(v4i32 (saddsat
44910b57cec5SDimitry Andric                     (v4i32 QPR:$src1),
44920b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$Vn),
44930b57cec5SDimitry Andric                                                   (v4i32 QPR:$Vm))))),
44940b57cec5SDimitry Andric            (v4i32 (VQRDMLAHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
44950b57cec5SDimitry Andric
44960b57cec5SDimitry Andric  defm VQRDMLAHsl : N3VMulOpSL_HS<0b1110, IIC_VMACi16D, IIC_VMACi32D,
44970b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlah", "s",
44980b57cec5SDimitry Andric                                  null_frag>;
4499480093f4SDimitry Andric  def : Pat<(v4i16 (saddsat
45000b57cec5SDimitry Andric                     (v4i16 DPR:$src1),
45010b57cec5SDimitry Andric                     (v4i16 (int_arm_neon_vqrdmulh
45020b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
45030b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
45040b57cec5SDimitry Andric                                                   imm:$lane)))))),
45050b57cec5SDimitry Andric            (v4i16 (VQRDMLAHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm,
45060b57cec5SDimitry Andric                                    imm:$lane))>;
4507480093f4SDimitry Andric  def : Pat<(v2i32 (saddsat
45080b57cec5SDimitry Andric                     (v2i32 DPR:$src1),
45090b57cec5SDimitry Andric                     (v2i32 (int_arm_neon_vqrdmulh
45100b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
45110b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
45120b57cec5SDimitry Andric                                                   imm:$lane)))))),
45130b57cec5SDimitry Andric            (v2i32 (VQRDMLAHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
45140b57cec5SDimitry Andric                                    imm:$lane))>;
4515480093f4SDimitry Andric  def : Pat<(v8i16 (saddsat
45160b57cec5SDimitry Andric                     (v8i16 QPR:$src1),
45170b57cec5SDimitry Andric                     (v8i16 (int_arm_neon_vqrdmulh
45180b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
45190b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
45200b57cec5SDimitry Andric                                                   imm:$lane)))))),
45210b57cec5SDimitry Andric            (v8i16 (VQRDMLAHslv8i16 (v8i16 QPR:$src1),
45220b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
45230b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
45240b57cec5SDimitry Andric                                             QPR:$src3,
45250b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
45260b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
4527480093f4SDimitry Andric  def : Pat<(v4i32 (saddsat
45280b57cec5SDimitry Andric                     (v4i32 QPR:$src1),
45290b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqrdmulh
45300b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
45310b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
45320b57cec5SDimitry Andric                                                   imm:$lane)))))),
45330b57cec5SDimitry Andric            (v4i32 (VQRDMLAHslv4i32 (v4i32 QPR:$src1),
45340b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
45350b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
45360b57cec5SDimitry Andric                                             QPR:$src3,
45370b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
45380b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
45390b57cec5SDimitry Andric
45400b57cec5SDimitry Andric  //   VQRDMLSH : Vector Saturating Rounding Doubling Multiply Subtract Long
45410b57cec5SDimitry Andric  //              (Q -= D * D)
45420b57cec5SDimitry Andric  defm VQRDMLSH : N3VInt3_HS<1, 0, 0b1100, 1, IIC_VMACi16D, IIC_VMACi32D,
45430b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
45440b57cec5SDimitry Andric                             null_frag>;
4545480093f4SDimitry Andric  def : Pat<(v4i16 (ssubsat
45460b57cec5SDimitry Andric                     (v4i16 DPR:$src1),
45470b57cec5SDimitry Andric                     (v4i16 (int_arm_neon_vqrdmulh (v4i16 DPR:$Vn),
45480b57cec5SDimitry Andric                                                   (v4i16 DPR:$Vm))))),
45490b57cec5SDimitry Andric            (v4i16 (VQRDMLSHv4i16 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4550480093f4SDimitry Andric  def : Pat<(v2i32 (ssubsat
45510b57cec5SDimitry Andric                     (v2i32 DPR:$src1),
45520b57cec5SDimitry Andric                     (v2i32 (int_arm_neon_vqrdmulh (v2i32 DPR:$Vn),
45530b57cec5SDimitry Andric                                                   (v2i32 DPR:$Vm))))),
45540b57cec5SDimitry Andric            (v2i32 (VQRDMLSHv2i32 DPR:$src1, DPR:$Vn, DPR:$Vm))>;
4555480093f4SDimitry Andric  def : Pat<(v8i16 (ssubsat
45560b57cec5SDimitry Andric                     (v8i16 QPR:$src1),
45570b57cec5SDimitry Andric                     (v8i16 (int_arm_neon_vqrdmulh (v8i16 QPR:$Vn),
45580b57cec5SDimitry Andric                                                   (v8i16 QPR:$Vm))))),
45590b57cec5SDimitry Andric            (v8i16 (VQRDMLSHv8i16 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
4560480093f4SDimitry Andric  def : Pat<(v4i32 (ssubsat
45610b57cec5SDimitry Andric                     (v4i32 QPR:$src1),
45620b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqrdmulh (v4i32 QPR:$Vn),
45630b57cec5SDimitry Andric                                                   (v4i32 QPR:$Vm))))),
45640b57cec5SDimitry Andric            (v4i32 (VQRDMLSHv4i32 QPR:$src1, QPR:$Vn, QPR:$Vm))>;
45650b57cec5SDimitry Andric
45660b57cec5SDimitry Andric  defm VQRDMLSHsl : N3VMulOpSL_HS<0b1111, IIC_VMACi16D, IIC_VMACi32D,
45670b57cec5SDimitry Andric                                  IIC_VMACi16Q, IIC_VMACi32Q, "vqrdmlsh", "s",
45680b57cec5SDimitry Andric                                  null_frag>;
4569480093f4SDimitry Andric  def : Pat<(v4i16 (ssubsat
45700b57cec5SDimitry Andric                     (v4i16 DPR:$src1),
45710b57cec5SDimitry Andric                     (v4i16 (int_arm_neon_vqrdmulh
45720b57cec5SDimitry Andric                              (v4i16 DPR:$Vn),
45730b57cec5SDimitry Andric                              (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
45740b57cec5SDimitry Andric                                                   imm:$lane)))))),
45750b57cec5SDimitry Andric            (v4i16 (VQRDMLSHslv4i16 DPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane))>;
4576480093f4SDimitry Andric  def : Pat<(v2i32 (ssubsat
45770b57cec5SDimitry Andric                     (v2i32 DPR:$src1),
45780b57cec5SDimitry Andric                     (v2i32 (int_arm_neon_vqrdmulh
45790b57cec5SDimitry Andric                              (v2i32 DPR:$Vn),
45800b57cec5SDimitry Andric                              (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
45810b57cec5SDimitry Andric                                                   imm:$lane)))))),
45820b57cec5SDimitry Andric            (v2i32 (VQRDMLSHslv2i32 DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
45830b57cec5SDimitry Andric                                    imm:$lane))>;
4584480093f4SDimitry Andric  def : Pat<(v8i16 (ssubsat
45850b57cec5SDimitry Andric                     (v8i16 QPR:$src1),
45860b57cec5SDimitry Andric                     (v8i16 (int_arm_neon_vqrdmulh
45870b57cec5SDimitry Andric                              (v8i16 QPR:$src2),
45880b57cec5SDimitry Andric                              (v8i16 (ARMvduplane (v8i16 QPR:$src3),
45890b57cec5SDimitry Andric                                                   imm:$lane)))))),
45900b57cec5SDimitry Andric            (v8i16 (VQRDMLSHslv8i16 (v8i16 QPR:$src1),
45910b57cec5SDimitry Andric                                    (v8i16 QPR:$src2),
45920b57cec5SDimitry Andric                                    (v4i16 (EXTRACT_SUBREG
45930b57cec5SDimitry Andric                                             QPR:$src3,
45940b57cec5SDimitry Andric                                             (DSubReg_i16_reg imm:$lane))),
45950b57cec5SDimitry Andric                                    (SubReg_i16_lane imm:$lane)))>;
4596480093f4SDimitry Andric  def : Pat<(v4i32 (ssubsat
45970b57cec5SDimitry Andric                     (v4i32 QPR:$src1),
45980b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqrdmulh
45990b57cec5SDimitry Andric                              (v4i32 QPR:$src2),
46000b57cec5SDimitry Andric                              (v4i32 (ARMvduplane (v4i32 QPR:$src3),
46010b57cec5SDimitry Andric                                                    imm:$lane)))))),
46020b57cec5SDimitry Andric            (v4i32 (VQRDMLSHslv4i32 (v4i32 QPR:$src1),
46030b57cec5SDimitry Andric                                    (v4i32 QPR:$src2),
46040b57cec5SDimitry Andric                                    (v2i32 (EXTRACT_SUBREG
46050b57cec5SDimitry Andric                                             QPR:$src3,
46060b57cec5SDimitry Andric                                             (DSubReg_i32_reg imm:$lane))),
46070b57cec5SDimitry Andric                                    (SubReg_i32_lane imm:$lane)))>;
46080b57cec5SDimitry Andric}
46090b57cec5SDimitry Andric//   VQDMLAL  : Vector Saturating Doubling Multiply Accumulate Long (Q += D * D)
46100b57cec5SDimitry Andricdefm VQDMLAL  : N3VLInt3_HS<0, 1, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46110b57cec5SDimitry Andric                            "vqdmlal", "s", null_frag>;
46120b57cec5SDimitry Andricdefm VQDMLALsl: N3VLInt3SL_HS<0, 0b0011, "vqdmlal", "s", null_frag>;
46130b57cec5SDimitry Andric
46140b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4615480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46160b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46170b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
46180b57cec5SDimitry Andric          (VQDMLALv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4619480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46200b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46210b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
46220b57cec5SDimitry Andric          (VQDMLALv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4623480093f4SDimitry Andricdef : Pat<(v4i32 (saddsat (v4i32 QPR:$src1),
46240b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
46250b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
46260b57cec5SDimitry Andric                                                     imm:$lane)))))),
46270b57cec5SDimitry Andric          (VQDMLALslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4628480093f4SDimitry Andricdef : Pat<(v2i64 (saddsat (v2i64 QPR:$src1),
46290b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
46300b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
46310b57cec5SDimitry Andric                                                     imm:$lane)))))),
46320b57cec5SDimitry Andric          (VQDMLALslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
46330b57cec5SDimitry Andric}
46340b57cec5SDimitry Andric
46350b57cec5SDimitry Andric//   VMLS     : Vector Multiply Subtract (integer and floating-point)
46360b57cec5SDimitry Andricdefm VMLS     : N3VMulOp_QHS<1, 0, 0b1001, 0, IIC_VMACi16D, IIC_VMACi32D,
46370b57cec5SDimitry Andric                             IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46380b57cec5SDimitry Andricdef  VMLSfd   : N3VDMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACD, "vmls", "f32",
46390b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
46400b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46410b57cec5SDimitry Andricdef  VMLSfq   : N3VQMulOp<0, 0, 0b10, 0b1101, 1, IIC_VMACQ, "vmls", "f32",
46420b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
46430b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46440b57cec5SDimitry Andricdef  VMLShd   : N3VDMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACD, "vmls", "f16",
46450b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
46460b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46470b57cec5SDimitry Andricdef  VMLShq   : N3VQMulOp<0, 0, 0b11, 0b1101, 1, IIC_VMACQ, "vmls", "f16",
46480b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
46490b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46500b57cec5SDimitry Andricdefm VMLSsl   : N3VMulOpSL_HS<0b0100, IIC_VMACi16D, IIC_VMACi32D,
46510b57cec5SDimitry Andric                              IIC_VMACi16Q, IIC_VMACi32Q, "vmls", "i", sub>;
46520b57cec5SDimitry Andricdef  VMLSslfd : N3VDMulOpSL<0b10, 0b0101, IIC_VMACD, "vmls", "f32",
46530b57cec5SDimitry Andric                            v2f32, fmul_su, fsub_mlx>,
46540b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46550b57cec5SDimitry Andricdef  VMLSslfq : N3VQMulOpSL<0b10, 0b0101, IIC_VMACQ, "vmls", "f32",
46560b57cec5SDimitry Andric                            v4f32, v2f32, fmul_su, fsub_mlx>,
46570b57cec5SDimitry Andric                Requires<[HasNEON, UseFPVMLx]>;
46580b57cec5SDimitry Andricdef  VMLSslhd : N3VDMulOpSL16<0b01, 0b0101, IIC_VMACD, "vmls", "f16",
46590b57cec5SDimitry Andric                            v4f16, fmul, fsub>,
46600b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46610b57cec5SDimitry Andricdef  VMLSslhq : N3VQMulOpSL16<0b01, 0b0101, IIC_VMACQ, "vmls", "f16",
46620b57cec5SDimitry Andric                            v8f16, v4f16, fmul, fsub>,
46630b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16, UseFPVMLx]>;
46640b57cec5SDimitry Andric
46650b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
46660b57cec5SDimitry Andricdef : Pat<(v8i16 (sub (v8i16 QPR:$src1),
46670b57cec5SDimitry Andric                  (mul (v8i16 QPR:$src2),
46680b57cec5SDimitry Andric                       (v8i16 (ARMvduplane (v8i16 QPR:$src3), imm:$lane))))),
46690b57cec5SDimitry Andric          (v8i16 (VMLSslv8i16 (v8i16 QPR:$src1), (v8i16 QPR:$src2),
46700b57cec5SDimitry Andric                              (v4i16 (EXTRACT_SUBREG QPR:$src3,
46710b57cec5SDimitry Andric                                      (DSubReg_i16_reg imm:$lane))),
46720b57cec5SDimitry Andric                              (SubReg_i16_lane imm:$lane)))>;
46730b57cec5SDimitry Andric
46740b57cec5SDimitry Andricdef : Pat<(v4i32 (sub (v4i32 QPR:$src1),
46750b57cec5SDimitry Andric                  (mul (v4i32 QPR:$src2),
46760b57cec5SDimitry Andric                     (v4i32 (ARMvduplane (v4i32 QPR:$src3), imm:$lane))))),
46770b57cec5SDimitry Andric          (v4i32 (VMLSslv4i32 (v4i32 QPR:$src1), (v4i32 QPR:$src2),
46780b57cec5SDimitry Andric                              (v2i32 (EXTRACT_SUBREG QPR:$src3,
46790b57cec5SDimitry Andric                                      (DSubReg_i32_reg imm:$lane))),
46800b57cec5SDimitry Andric                              (SubReg_i32_lane imm:$lane)))>;
46810b57cec5SDimitry Andric}
46820b57cec5SDimitry Andric
46830b57cec5SDimitry Andricdef : Pat<(v4f32 (fsub_mlx (v4f32 QPR:$src1),
46840b57cec5SDimitry Andric                  (fmul_su (v4f32 QPR:$src2),
46850b57cec5SDimitry Andric                        (v4f32 (ARMvduplane (v4f32 QPR:$src3), imm:$lane))))),
46860b57cec5SDimitry Andric          (v4f32 (VMLSslfq (v4f32 QPR:$src1), (v4f32 QPR:$src2),
46870b57cec5SDimitry Andric                           (v2f32 (EXTRACT_SUBREG QPR:$src3,
46880b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
46890b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>,
46900b57cec5SDimitry Andric          Requires<[HasNEON, UseFPVMLx]>;
46910b57cec5SDimitry Andric
46920b57cec5SDimitry Andric//   VMLSL    : Vector Multiply Subtract Long (Q -= D * D)
46930b57cec5SDimitry Andricdefm VMLSLs   : N3VLMulOp_QHS<0,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4694*5ffd83dbSDimitry Andric                              "vmlsl", "s", ARMvmulls, sub>;
46950b57cec5SDimitry Andricdefm VMLSLu   : N3VLMulOp_QHS<1,1,0b1010,0, IIC_VMACi16D, IIC_VMACi32D,
4696*5ffd83dbSDimitry Andric                              "vmlsl", "u", ARMvmullu, sub>;
46970b57cec5SDimitry Andric
4698*5ffd83dbSDimitry Andricdefm VMLSLsls : N3VLMulOpSL_HS<0, 0b0110, "vmlsl", "s", ARMvmulls, sub>;
4699*5ffd83dbSDimitry Andricdefm VMLSLslu : N3VLMulOpSL_HS<1, 0b0110, "vmlsl", "u", ARMvmullu, sub>;
47000b57cec5SDimitry Andric
47010b57cec5SDimitry Andric//   VQDMLSL  : Vector Saturating Doubling Multiply Subtract Long (Q -= D * D)
47020b57cec5SDimitry Andricdefm VQDMLSL  : N3VLInt3_HS<0, 1, 0b1011, 0, IIC_VMACi16D, IIC_VMACi32D,
47030b57cec5SDimitry Andric                            "vqdmlsl", "s", null_frag>;
47040b57cec5SDimitry Andricdefm VQDMLSLsl: N3VLInt3SL_HS<0, 0b0111, "vqdmlsl", "s", null_frag>;
47050b57cec5SDimitry Andric
47060b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
4707480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47080b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47090b57cec5SDimitry Andric                                                  (v4i16 DPR:$Vm))))),
47100b57cec5SDimitry Andric          (VQDMLSLv4i32 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4711480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47120b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47130b57cec5SDimitry Andric                                                  (v2i32 DPR:$Vm))))),
47140b57cec5SDimitry Andric          (VQDMLSLv2i64 QPR:$src1, DPR:$Vn, DPR:$Vm)>;
4715480093f4SDimitry Andricdef : Pat<(v4i32 (ssubsat (v4i32 QPR:$src1),
47160b57cec5SDimitry Andric                     (v4i32 (int_arm_neon_vqdmull (v4i16 DPR:$Vn),
47170b57cec5SDimitry Andric                                (v4i16 (ARMvduplane (v4i16 DPR_8:$Vm),
47180b57cec5SDimitry Andric                                                     imm:$lane)))))),
47190b57cec5SDimitry Andric          (VQDMLSLslv4i16 QPR:$src1, DPR:$Vn, DPR_8:$Vm, imm:$lane)>;
4720480093f4SDimitry Andricdef : Pat<(v2i64 (ssubsat (v2i64 QPR:$src1),
47210b57cec5SDimitry Andric                     (v2i64 (int_arm_neon_vqdmull (v2i32 DPR:$Vn),
47220b57cec5SDimitry Andric                                (v2i32 (ARMvduplane (v2i32 DPR_VFP2:$Vm),
47230b57cec5SDimitry Andric                                                     imm:$lane)))))),
47240b57cec5SDimitry Andric          (VQDMLSLslv2i32 QPR:$src1, DPR:$Vn, DPR_VFP2:$Vm, imm:$lane)>;
47250b57cec5SDimitry Andric}
47260b57cec5SDimitry Andric
47270b57cec5SDimitry Andric// Fused Vector Multiply-Accumulate and Fused Multiply-Subtract Operations.
47280b57cec5SDimitry Andricdef  VFMAfd   : N3VDMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACD, "vfma", "f32",
47290b57cec5SDimitry Andric                          v2f32, fmul_su, fadd_mlx>,
47300b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47310b57cec5SDimitry Andric
47320b57cec5SDimitry Andricdef  VFMAfq   : N3VQMulOp<0, 0, 0b00, 0b1100, 1, IIC_VFMACQ, "vfma", "f32",
47330b57cec5SDimitry Andric                          v4f32, fmul_su, fadd_mlx>,
47340b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47350b57cec5SDimitry Andricdef  VFMAhd   : N3VDMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACD, "vfma", "f16",
47360b57cec5SDimitry Andric                          v4f16, fmul, fadd>,
47370b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47380b57cec5SDimitry Andric
47390b57cec5SDimitry Andricdef  VFMAhq   : N3VQMulOp<0, 0, 0b01, 0b1100, 1, IIC_VFMACQ, "vfma", "f16",
47400b57cec5SDimitry Andric                          v8f16, fmul, fadd>,
47410b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47420b57cec5SDimitry Andric
47430b57cec5SDimitry Andric//   Fused Vector Multiply Subtract (floating-point)
47440b57cec5SDimitry Andricdef  VFMSfd   : N3VDMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACD, "vfms", "f32",
47450b57cec5SDimitry Andric                          v2f32, fmul_su, fsub_mlx>,
47460b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47470b57cec5SDimitry Andricdef  VFMSfq   : N3VQMulOp<0, 0, 0b10, 0b1100, 1, IIC_VFMACQ, "vfms", "f32",
47480b57cec5SDimitry Andric                          v4f32, fmul_su, fsub_mlx>,
47490b57cec5SDimitry Andric                Requires<[HasNEON,HasVFP4,UseFusedMAC]>;
47500b57cec5SDimitry Andricdef  VFMShd   : N3VDMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACD, "vfms", "f16",
47510b57cec5SDimitry Andric                          v4f16, fmul, fsub>,
47520b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47530b57cec5SDimitry Andricdef  VFMShq   : N3VQMulOp<0, 0, 0b11, 0b1100, 1, IIC_VFMACQ, "vfms", "f16",
47540b57cec5SDimitry Andric                          v8f16, fmul, fsub>,
47550b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16,UseFusedMAC]>;
47560b57cec5SDimitry Andric
47570b57cec5SDimitry Andric// Match @llvm.fma.* intrinsics
47580b57cec5SDimitry Andricdef : Pat<(v4f16 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
47590b57cec5SDimitry Andric          (VFMAhd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47600b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
47610b57cec5SDimitry Andricdef : Pat<(v8f16 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
47620b57cec5SDimitry Andric          (VFMAhq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47630b57cec5SDimitry Andric          Requires<[HasNEON,HasFullFP16]>;
47640b57cec5SDimitry Andricdef : Pat<(v2f32 (fma DPR:$Vn, DPR:$Vm, DPR:$src1)),
47650b57cec5SDimitry Andric          (VFMAfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47660b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
47670b57cec5SDimitry Andricdef : Pat<(v4f32 (fma QPR:$Vn, QPR:$Vm, QPR:$src1)),
47680b57cec5SDimitry Andric          (VFMAfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47690b57cec5SDimitry Andric          Requires<[HasNEON,HasVFP4]>;
47700b57cec5SDimitry Andricdef : Pat<(v2f32 (fma (fneg DPR:$Vn), DPR:$Vm, DPR:$src1)),
47710b57cec5SDimitry Andric          (VFMSfd DPR:$src1, DPR:$Vn, DPR:$Vm)>,
47720b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
47730b57cec5SDimitry Andricdef : Pat<(v4f32 (fma (fneg QPR:$Vn), QPR:$Vm, QPR:$src1)),
47740b57cec5SDimitry Andric          (VFMSfq QPR:$src1, QPR:$Vn, QPR:$Vm)>,
47750b57cec5SDimitry Andric      Requires<[HasNEON,HasVFP4]>;
47760b57cec5SDimitry Andric
47770b57cec5SDimitry Andric// ARMv8.2a dot product instructions.
47780b57cec5SDimitry Andric// We put them in the VFPV8 decoder namespace because the ARM and Thumb
47790b57cec5SDimitry Andric// encodings are the same and thus no further bit twiddling is necessary
47800b57cec5SDimitry Andric// in the disassembler.
4781*5ffd83dbSDimitry Andricclass VDOT<bit op6, bit op4, bit op23, RegisterClass RegTy, string Asm,
4782*5ffd83dbSDimitry Andric           string AsmTy, ValueType AccumTy, ValueType InputTy,
47830b57cec5SDimitry Andric           SDPatternOperator OpNode> :
4784*5ffd83dbSDimitry Andric      N3Vnp<{0b1100, op23}, 0b10, 0b1101, op6, op4, (outs RegTy:$dst),
47850b57cec5SDimitry Andric            (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm), N3RegFrm, IIC_VDOTPROD,
47860b57cec5SDimitry Andric            Asm, AsmTy,
47870b57cec5SDimitry Andric            [(set (AccumTy RegTy:$dst),
47880b57cec5SDimitry Andric                  (OpNode (AccumTy RegTy:$Vd),
47890b57cec5SDimitry Andric                          (InputTy RegTy:$Vn),
47900b57cec5SDimitry Andric                          (InputTy RegTy:$Vm)))]> {
47910b57cec5SDimitry Andric  let Predicates = [HasDotProd];
47920b57cec5SDimitry Andric  let DecoderNamespace = "VFPV8";
47930b57cec5SDimitry Andric  let Constraints = "$dst = $Vd";
47940b57cec5SDimitry Andric}
47950b57cec5SDimitry Andric
4796*5ffd83dbSDimitry Andricdef VUDOTD : VDOT<0, 1, 0, DPR, "vudot", "u8", v2i32, v8i8,  int_arm_neon_udot>;
4797*5ffd83dbSDimitry Andricdef VSDOTD : VDOT<0, 0, 0, DPR, "vsdot", "s8", v2i32, v8i8,  int_arm_neon_sdot>;
4798*5ffd83dbSDimitry Andricdef VUDOTQ : VDOT<1, 1, 0, QPR, "vudot", "u8", v4i32, v16i8, int_arm_neon_udot>;
4799*5ffd83dbSDimitry Andricdef VSDOTQ : VDOT<1, 0, 0, QPR, "vsdot", "s8", v4i32, v16i8, int_arm_neon_sdot>;
48000b57cec5SDimitry Andric
48010b57cec5SDimitry Andric// Indexed dot product instructions:
48020b57cec5SDimitry Andricmulticlass DOTI<string opc, string dt, bit Q, bit U, RegisterClass Ty,
48030b57cec5SDimitry Andric           ValueType AccumType, ValueType InputType, SDPatternOperator OpNode,
48040b57cec5SDimitry Andric           dag RHS> {
48050b57cec5SDimitry Andric  def "" : N3Vnp<0b11100, 0b10, 0b1101, Q, U, (outs Ty:$dst),
48060b57cec5SDimitry Andric                 (ins Ty:$Vd, Ty:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane),
48070b57cec5SDimitry Andric                 N3RegFrm, IIC_VDOTPROD, opc, dt, []> {
48080b57cec5SDimitry Andric    bit lane;
48090b57cec5SDimitry Andric    let Inst{5} = lane;
48100b57cec5SDimitry Andric    let AsmString = !strconcat(opc, ".", dt, "\t$Vd, $Vn, $Vm$lane");
48110b57cec5SDimitry Andric    let Constraints = "$dst = $Vd";
48120b57cec5SDimitry Andric    let Predicates = [HasDotProd];
48130b57cec5SDimitry Andric    let DecoderNamespace = "VFPV8";
48140b57cec5SDimitry Andric  }
48150b57cec5SDimitry Andric
48160b57cec5SDimitry Andric  def : Pat<
48170b57cec5SDimitry Andric    (AccumType (OpNode (AccumType Ty:$Vd),
48180b57cec5SDimitry Andric                       (InputType Ty:$Vn),
48190b57cec5SDimitry Andric                       (InputType (bitconvert (AccumType
48200b57cec5SDimitry Andric                                  (ARMvduplane (AccumType Ty:$Vm),
48210b57cec5SDimitry Andric                                                 VectorIndex32:$lane)))))),
48220b57cec5SDimitry Andric    (!cast<Instruction>(NAME) Ty:$Vd, Ty:$Vn, RHS, VectorIndex32:$lane)>;
48230b57cec5SDimitry Andric}
48240b57cec5SDimitry Andric
48250b57cec5SDimitry Andricdefm VUDOTDI : DOTI<"vudot", "u8", 0b0, 0b1, DPR, v2i32, v8i8,
48260b57cec5SDimitry Andric                    int_arm_neon_udot, (v2i32 DPR_VFP2:$Vm)>;
48270b57cec5SDimitry Andricdefm VSDOTDI : DOTI<"vsdot", "s8", 0b0, 0b0, DPR, v2i32, v8i8,
48280b57cec5SDimitry Andric                    int_arm_neon_sdot, (v2i32 DPR_VFP2:$Vm)>;
48290b57cec5SDimitry Andricdefm VUDOTQI : DOTI<"vudot", "u8", 0b1, 0b1, QPR, v4i32, v16i8,
48300b57cec5SDimitry Andric                    int_arm_neon_udot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48310b57cec5SDimitry Andricdefm VSDOTQI : DOTI<"vsdot", "s8", 0b1, 0b0, QPR, v4i32, v16i8,
48320b57cec5SDimitry Andric                    int_arm_neon_sdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
48330b57cec5SDimitry Andric
4834*5ffd83dbSDimitry Andric// v8.6A matrix multiplication extension
4835*5ffd83dbSDimitry Andriclet Predicates = [HasMatMulInt8] in {
4836*5ffd83dbSDimitry Andric  class N3VMatMul<bit B, bit U, string Asm, string AsmTy,
4837*5ffd83dbSDimitry Andric                  SDPatternOperator OpNode>
4838*5ffd83dbSDimitry Andric        : N3Vnp<{0b1100, B}, 0b10, 0b1100, 1, U, (outs QPR:$dst),
4839*5ffd83dbSDimitry Andric                (ins QPR:$Vd, QPR:$Vn, QPR:$Vm), N3RegFrm, NoItinerary,
4840*5ffd83dbSDimitry Andric                Asm, AsmTy,
4841*5ffd83dbSDimitry Andric                [(set (v4i32 QPR:$dst), (OpNode (v4i32 QPR:$Vd),
4842*5ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vn),
4843*5ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vm)))]> {
4844*5ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
4845*5ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
4846*5ffd83dbSDimitry Andric  }
4847*5ffd83dbSDimitry Andric
4848*5ffd83dbSDimitry Andric  multiclass N3VMixedDotLane<bit Q, bit U, string Asm, string AsmTy, RegisterClass RegTy,
4849*5ffd83dbSDimitry Andric                        ValueType AccumTy, ValueType InputTy, SDPatternOperator OpNode,
4850*5ffd83dbSDimitry Andric                        dag RHS> {
4851*5ffd83dbSDimitry Andric
4852*5ffd83dbSDimitry Andric    def "" : N3Vnp<0b11101, 0b00, 0b1101, Q, U, (outs RegTy:$dst),
4853*5ffd83dbSDimitry Andric                (ins RegTy:$Vd, RegTy:$Vn, DPR_VFP2:$Vm, VectorIndex32:$lane), N3RegFrm,
4854*5ffd83dbSDimitry Andric                 NoItinerary, Asm, AsmTy, []> {
4855*5ffd83dbSDimitry Andric      bit lane;
4856*5ffd83dbSDimitry Andric      let Inst{5} = lane;
4857*5ffd83dbSDimitry Andric      let AsmString = !strconcat(Asm, ".", AsmTy, "\t$Vd, $Vn, $Vm$lane");
4858*5ffd83dbSDimitry Andric      let DecoderNamespace = "VFPV8";
4859*5ffd83dbSDimitry Andric      let Constraints = "$dst = $Vd";
4860*5ffd83dbSDimitry Andric    }
4861*5ffd83dbSDimitry Andric
4862*5ffd83dbSDimitry Andric    def : Pat<
4863*5ffd83dbSDimitry Andric      (AccumTy (OpNode (AccumTy RegTy:$Vd),
4864*5ffd83dbSDimitry Andric                       (InputTy RegTy:$Vn),
4865*5ffd83dbSDimitry Andric                       (InputTy (bitconvert (AccumTy
4866*5ffd83dbSDimitry Andric                                (ARMvduplane (AccumTy RegTy:$Vm),
4867*5ffd83dbSDimitry Andric                                              VectorIndex32:$lane)))))),
4868*5ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4869*5ffd83dbSDimitry Andric
4870*5ffd83dbSDimitry Andric  }
4871*5ffd83dbSDimitry Andric
4872*5ffd83dbSDimitry Andric  multiclass SUDOTLane<bit Q, RegisterClass RegTy, ValueType AccumTy, ValueType InputTy, dag RHS>
4873*5ffd83dbSDimitry Andric        : N3VMixedDotLane<Q, 1, "vsudot", "u8", RegTy, AccumTy, InputTy, null_frag, null_frag> {
4874*5ffd83dbSDimitry Andric    def : Pat<
4875*5ffd83dbSDimitry Andric      (AccumTy (int_arm_neon_usdot (AccumTy RegTy:$Vd),
4876*5ffd83dbSDimitry Andric                                   (InputTy (bitconvert (AccumTy
4877*5ffd83dbSDimitry Andric                                            (ARMvduplane (AccumTy RegTy:$Vm),
4878*5ffd83dbSDimitry Andric                                                          VectorIndex32:$lane)))),
4879*5ffd83dbSDimitry Andric                                   (InputTy RegTy:$Vn))),
4880*5ffd83dbSDimitry Andric      (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
4881*5ffd83dbSDimitry Andric  }
4882*5ffd83dbSDimitry Andric
4883*5ffd83dbSDimitry Andric  def VSMMLA  : N3VMatMul<0, 0, "vsmmla",  "s8", int_arm_neon_smmla>;
4884*5ffd83dbSDimitry Andric  def VUMMLA  : N3VMatMul<0, 1, "vummla",  "u8", int_arm_neon_ummla>;
4885*5ffd83dbSDimitry Andric  def VUSMMLA : N3VMatMul<1, 0, "vusmmla", "s8", int_arm_neon_usmmla>;
4886*5ffd83dbSDimitry Andric  def VUSDOTD : VDOT<0, 0, 1, DPR, "vusdot", "s8", v2i32, v8i8,  int_arm_neon_usdot>;
4887*5ffd83dbSDimitry Andric  def VUSDOTQ : VDOT<1, 0, 1, QPR, "vusdot", "s8", v4i32, v16i8, int_arm_neon_usdot>;
4888*5ffd83dbSDimitry Andric
4889*5ffd83dbSDimitry Andric  defm VUSDOTDI : N3VMixedDotLane<0, 0, "vusdot", "s8", DPR, v2i32, v8i8,
4890*5ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (v2i32 DPR_VFP2:$Vm)>;
4891*5ffd83dbSDimitry Andric  defm VUSDOTQI : N3VMixedDotLane<1, 0, "vusdot", "s8", QPR, v4i32, v16i8,
4892*5ffd83dbSDimitry Andric                                  int_arm_neon_usdot, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4893*5ffd83dbSDimitry Andric  defm VSUDOTDI : SUDOTLane<0, DPR, v2i32, v8i8, (v2i32 DPR_VFP2:$Vm)>;
4894*5ffd83dbSDimitry Andric  defm VSUDOTQI : SUDOTLane<1, QPR, v4i32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
4895*5ffd83dbSDimitry Andric}
48960b57cec5SDimitry Andric
48970b57cec5SDimitry Andric// ARMv8.3 complex operations
48980b57cec5SDimitry Andricclass BaseN3VCP8ComplexTied<bit op21, bit op4, bit s, bit q,
48990b57cec5SDimitry Andric                            InstrItinClass itin, dag oops, dag iops,
49000b57cec5SDimitry Andric                            string opc, string dt, list<dag> pattern>
49010b57cec5SDimitry Andric  : N3VCP8<{?,?}, {op21,s}, q, op4, oops,
49020b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "$src1 = $Vd", pattern>{
49030b57cec5SDimitry Andric  bits<2> rot;
49040b57cec5SDimitry Andric  let Inst{24-23} = rot;
49050b57cec5SDimitry Andric}
49060b57cec5SDimitry Andric
49070b57cec5SDimitry Andricclass BaseN3VCP8ComplexOdd<bit op23, bit op21, bit op4, bit s, bit q,
49080b57cec5SDimitry Andric                           InstrItinClass itin, dag oops, dag iops, string opc,
49090b57cec5SDimitry Andric                            string dt, list<dag> pattern>
49100b57cec5SDimitry Andric  : N3VCP8<{?,op23}, {op21,s}, q, op4, oops,
49110b57cec5SDimitry Andric           iops, itin, opc, dt, "$Vd, $Vn, $Vm, $rot", "", pattern> {
49120b57cec5SDimitry Andric  bits<1> rot;
49130b57cec5SDimitry Andric  let Inst{24} = rot;
49140b57cec5SDimitry Andric}
49150b57cec5SDimitry Andric
49160b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane32<bit op4, bit s, bit q, InstrItinClass itin,
49170b57cec5SDimitry Andric                                  dag oops, dag iops, string opc, string dt,
49180b57cec5SDimitry Andric                                  list<dag> pattern>
49190b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49200b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49210b57cec5SDimitry Andric  bits<2> rot;
49220b57cec5SDimitry Andric  bit lane;
49230b57cec5SDimitry Andric
49240b57cec5SDimitry Andric  let Inst{21-20} = rot;
49250b57cec5SDimitry Andric  let Inst{5} = lane;
49260b57cec5SDimitry Andric}
49270b57cec5SDimitry Andric
49280b57cec5SDimitry Andricclass BaseN3VCP8ComplexTiedLane64<bit op4, bit s, bit q, InstrItinClass itin,
49290b57cec5SDimitry Andric                            dag oops, dag iops, string opc, string dt,
49300b57cec5SDimitry Andric                            list<dag> pattern>
49310b57cec5SDimitry Andric  : N3VLaneCP8<s, {?,?}, q, op4, oops, iops, itin, opc, dt,
49320b57cec5SDimitry Andric               "$Vd, $Vn, $Vm$lane, $rot", "$src1 = $Vd", pattern> {
49330b57cec5SDimitry Andric  bits<2> rot;
49340b57cec5SDimitry Andric  bit lane;
49350b57cec5SDimitry Andric
49360b57cec5SDimitry Andric  let Inst{21-20} = rot;
49370b57cec5SDimitry Andric  let Inst{5} = Vm{4};
49380b57cec5SDimitry Andric  // This is needed because the lane operand does not have any bits in the
49390b57cec5SDimitry Andric  // encoding (it only has one possible value), so we need to manually set it
49400b57cec5SDimitry Andric  // to it's default value.
49410b57cec5SDimitry Andric  let DecoderMethod = "DecodeNEONComplexLane64Instruction";
49420b57cec5SDimitry Andric}
49430b57cec5SDimitry Andric
49440b57cec5SDimitry Andricmulticlass N3VCP8ComplexTied<bit op21, bit op4,
49450b57cec5SDimitry Andric                       string OpcodeStr, SDPatternOperator Op> {
49460b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49470b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 0, IIC_VMACD, (outs DPR:$Vd),
49480b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49490b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49500b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexTied<op21, op4, 0, 1, IIC_VMACQ, (outs QPR:$Vd),
49510b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49520b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49530b57cec5SDimitry Andric  }
49540b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
49550b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 0, IIC_VMACD, (outs DPR:$Vd),
49560b57cec5SDimitry Andric              (ins DPR:$src1, DPR:$Vn, DPR:$Vm, complexrotateop:$rot),
49570b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49580b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexTied<op21, op4, 1, 1, IIC_VMACQ, (outs QPR:$Vd),
49590b57cec5SDimitry Andric              (ins QPR:$src1, QPR:$Vn, QPR:$Vm, complexrotateop:$rot),
49600b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49610b57cec5SDimitry Andric  }
49620b57cec5SDimitry Andric}
49630b57cec5SDimitry Andric
49640b57cec5SDimitry Andricmulticlass N3VCP8ComplexOdd<bit op23, bit op21, bit op4,
49650b57cec5SDimitry Andric                       string OpcodeStr, SDPatternOperator Op> {
49660b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49670b57cec5SDimitry Andric  def v4f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 0, IIC_VMACD,
49680b57cec5SDimitry Andric              (outs DPR:$Vd),
49690b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
49700b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49710b57cec5SDimitry Andric  def v8f16 : BaseN3VCP8ComplexOdd<op23, op21, op4, 0, 1, IIC_VMACQ,
49720b57cec5SDimitry Andric              (outs QPR:$Vd),
49730b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
49740b57cec5SDimitry Andric              OpcodeStr, "f16", []>;
49750b57cec5SDimitry Andric  }
49760b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
49770b57cec5SDimitry Andric  def v2f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 0, IIC_VMACD,
49780b57cec5SDimitry Andric              (outs DPR:$Vd),
49790b57cec5SDimitry Andric              (ins DPR:$Vn, DPR:$Vm, complexrotateopodd:$rot),
49800b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49810b57cec5SDimitry Andric  def v4f32 : BaseN3VCP8ComplexOdd<op23, op21, op4, 1, 1, IIC_VMACQ,
49820b57cec5SDimitry Andric              (outs QPR:$Vd),
49830b57cec5SDimitry Andric              (ins QPR:$Vn, QPR:$Vm, complexrotateopodd:$rot),
49840b57cec5SDimitry Andric              OpcodeStr, "f32", []>;
49850b57cec5SDimitry Andric  }
49860b57cec5SDimitry Andric}
49870b57cec5SDimitry Andric
49880b57cec5SDimitry Andric// These instructions index by pairs of lanes, so the VectorIndexes are twice
49890b57cec5SDimitry Andric// as wide as the data types.
49900b57cec5SDimitry Andricmulticlass N3VCP8ComplexTiedLane<bit op4, string OpcodeStr,
49910b57cec5SDimitry Andric                                 SDPatternOperator Op> {
49920b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
49930b57cec5SDimitry Andric  def v4f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 0, IIC_VMACD,
49940b57cec5SDimitry Andric                      (outs DPR:$Vd),
49950b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR_VFP2:$Vm,
49960b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
49970b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
49980b57cec5SDimitry Andric  def v8f16_indexed : BaseN3VCP8ComplexTiedLane32<op4, 0, 1, IIC_VMACQ,
49990b57cec5SDimitry Andric                      (outs QPR:$Vd),
50000b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR_VFP2:$Vm,
50010b57cec5SDimitry Andric                      VectorIndex32:$lane, complexrotateop:$rot),
50020b57cec5SDimitry Andric                      OpcodeStr, "f16", []>;
50030b57cec5SDimitry Andric  }
50040b57cec5SDimitry Andric  let Predicates = [HasNEON,HasV8_3a] in {
50050b57cec5SDimitry Andric  def v2f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 0, IIC_VMACD,
50060b57cec5SDimitry Andric                      (outs DPR:$Vd),
50070b57cec5SDimitry Andric                      (ins DPR:$src1, DPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50080b57cec5SDimitry Andric                      complexrotateop:$rot),
50090b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50100b57cec5SDimitry Andric  def v4f32_indexed : BaseN3VCP8ComplexTiedLane64<op4, 1, 1, IIC_VMACQ,
50110b57cec5SDimitry Andric                      (outs QPR:$Vd),
50120b57cec5SDimitry Andric                      (ins QPR:$src1, QPR:$Vn, DPR:$Vm, VectorIndex64:$lane,
50130b57cec5SDimitry Andric                      complexrotateop:$rot),
50140b57cec5SDimitry Andric                      OpcodeStr, "f32", []>;
50150b57cec5SDimitry Andric  }
50160b57cec5SDimitry Andric}
50170b57cec5SDimitry Andric
50180b57cec5SDimitry Andricdefm VCMLA : N3VCP8ComplexTied<1, 0, "vcmla", null_frag>;
50190b57cec5SDimitry Andricdefm VCADD : N3VCP8ComplexOdd<1, 0, 0, "vcadd", null_frag>;
50200b57cec5SDimitry Andricdefm VCMLA : N3VCP8ComplexTiedLane<0, "vcmla", null_frag>;
50210b57cec5SDimitry Andric
5022480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a,HasFullFP16] in {
5023480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot90 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5024480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 0))>;
5025480093f4SDimitry Andric  def : Pat<(v4f16 (int_arm_neon_vcadd_rot270 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm))),
5026480093f4SDimitry Andric            (VCADDv4f16 (v4f16 DPR:$Rn), (v4f16 DPR:$Rm), (i32 1))>;
5027480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot90 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5028480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 0))>;
5029480093f4SDimitry Andric  def : Pat<(v8f16 (int_arm_neon_vcadd_rot270 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm))),
5030480093f4SDimitry Andric            (VCADDv8f16 (v8f16 QPR:$Rn), (v8f16 QPR:$Rm), (i32 1))>;
5031480093f4SDimitry Andric}
5032480093f4SDimitry Andriclet Predicates = [HasNEON,HasV8_3a] in {
5033480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot90 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5034480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 0))>;
5035480093f4SDimitry Andric  def : Pat<(v2f32 (int_arm_neon_vcadd_rot270 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm))),
5036480093f4SDimitry Andric            (VCADDv2f32 (v2f32 DPR:$Rn), (v2f32 DPR:$Rm), (i32 1))>;
5037480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot90 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5038480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 0))>;
5039480093f4SDimitry Andric  def : Pat<(v4f32 (int_arm_neon_vcadd_rot270 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm))),
5040480093f4SDimitry Andric            (VCADDv4f32 (v4f32 QPR:$Rn), (v4f32 QPR:$Rm), (i32 1))>;
5041480093f4SDimitry Andric}
5042480093f4SDimitry Andric
50430b57cec5SDimitry Andric// Vector Subtract Operations.
50440b57cec5SDimitry Andric
50450b57cec5SDimitry Andric//   VSUB     : Vector Subtract (integer and floating-point)
50460b57cec5SDimitry Andricdefm VSUB     : N3V_QHSD<1, 0, 0b1000, 0, IIC_VSUBiD, IIC_VSUBiQ,
50470b57cec5SDimitry Andric                         "vsub", "i", sub, 0>;
50480b57cec5SDimitry Andricdef  VSUBfd   : N3VD<0, 0, 0b10, 0b1101, 0, IIC_VBIND, "vsub", "f32",
50490b57cec5SDimitry Andric                     v2f32, v2f32, fsub, 0>;
50500b57cec5SDimitry Andricdef  VSUBfq   : N3VQ<0, 0, 0b10, 0b1101, 0, IIC_VBINQ, "vsub", "f32",
50510b57cec5SDimitry Andric                     v4f32, v4f32, fsub, 0>;
50520b57cec5SDimitry Andricdef  VSUBhd   : N3VD<0, 0, 0b11, 0b1101, 0, IIC_VBIND, "vsub", "f16",
50530b57cec5SDimitry Andric                     v4f16, v4f16, fsub, 0>,
50540b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50550b57cec5SDimitry Andricdef  VSUBhq   : N3VQ<0, 0, 0b11, 0b1101, 0, IIC_VBINQ, "vsub", "f16",
50560b57cec5SDimitry Andric                     v8f16, v8f16, fsub, 0>,
50570b57cec5SDimitry Andric                Requires<[HasNEON,HasFullFP16]>;
50580b57cec5SDimitry Andric//   VSUBL    : Vector Subtract Long (Q = D - D)
50590b57cec5SDimitry Andricdefm VSUBLs   : N3VLExt_QHS<0,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
50600b57cec5SDimitry Andric                            "vsubl", "s", sub, sext, 0>;
50610b57cec5SDimitry Andricdefm VSUBLu   : N3VLExt_QHS<1,1,0b0010,0, IIC_VSHLiD, IIC_VSHLiD,
50620b57cec5SDimitry Andric                            "vsubl", "u", sub, zext, 0>;
50630b57cec5SDimitry Andric//   VSUBW    : Vector Subtract Wide (Q = Q - D)
50640b57cec5SDimitry Andricdefm VSUBWs   : N3VW_QHS<0,1,0b0011,0, "vsubw", "s", sub, sext, 0>;
50650b57cec5SDimitry Andricdefm VSUBWu   : N3VW_QHS<1,1,0b0011,0, "vsubw", "u", sub, zext, 0>;
50660b57cec5SDimitry Andric//   VHSUB    : Vector Halving Subtract
50670b57cec5SDimitry Andricdefm VHSUBs   : N3VInt_QHS<0, 0, 0b0010, 0, N3RegFrm,
50680b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
50690b57cec5SDimitry Andric                           "vhsub", "s", int_arm_neon_vhsubs, 0>;
50700b57cec5SDimitry Andricdefm VHSUBu   : N3VInt_QHS<1, 0, 0b0010, 0, N3RegFrm,
50710b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
50720b57cec5SDimitry Andric                           "vhsub", "u", int_arm_neon_vhsubu, 0>;
50730b57cec5SDimitry Andric//   VQSUB    : Vector Saturing Subtract
50740b57cec5SDimitry Andricdefm VQSUBs   : N3VInt_QHSD<0, 0, 0b0010, 1, N3RegFrm,
50750b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5076480093f4SDimitry Andric                            "vqsub", "s", ssubsat, 0>;
50770b57cec5SDimitry Andricdefm VQSUBu   : N3VInt_QHSD<1, 0, 0b0010, 1, N3RegFrm,
50780b57cec5SDimitry Andric                            IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
5079480093f4SDimitry Andric                            "vqsub", "u", usubsat, 0>;
50800b57cec5SDimitry Andric//   VSUBHN   : Vector Subtract and Narrow Returning High Half (D = Q - Q)
50810b57cec5SDimitry Andricdefm VSUBHN   : N3VNInt_HSD<0,1,0b0110,0, "vsubhn", "i", null_frag, 0>;
50820b57cec5SDimitry Andric//   VRSUBHN  : Vector Rounding Subtract and Narrow Returning High Half (D=Q-Q)
50830b57cec5SDimitry Andricdefm VRSUBHN  : N3VNInt_HSD<1,1,0b0110,0, "vrsubhn", "i",
50840b57cec5SDimitry Andric                            int_arm_neon_vrsubhn, 0>;
50850b57cec5SDimitry Andric
50860b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
50870b57cec5SDimitry Andricdef : Pat<(v8i8  (trunc (ARMvshruImm (sub (v8i16 QPR:$Vn), QPR:$Vm), 8))),
50880b57cec5SDimitry Andric          (VSUBHNv8i8 QPR:$Vn, QPR:$Vm)>;
50890b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (sub (v4i32 QPR:$Vn), QPR:$Vm), 16))),
50900b57cec5SDimitry Andric          (VSUBHNv4i16 QPR:$Vn, QPR:$Vm)>;
50910b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (sub (v2i64 QPR:$Vn), QPR:$Vm), 32))),
50920b57cec5SDimitry Andric          (VSUBHNv2i32 QPR:$Vn, QPR:$Vm)>;
50930b57cec5SDimitry Andric}
50940b57cec5SDimitry Andric
50950b57cec5SDimitry Andric// Vector Comparisons.
50960b57cec5SDimitry Andric
50970b57cec5SDimitry Andric//   VCEQ     : Vector Compare Equal
50988bcb0991SDimitry Andricdefm VCEQ     : N3V_QHS_cmp<1, 0, 0b1000, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5099480093f4SDimitry Andric                            IIC_VSUBi4Q, "vceq", "i", ARMCCeq, 1>;
51008bcb0991SDimitry Andricdef  VCEQfd   : N3VD_cmp<0,0,0b00,0b1110,0, IIC_VBIND, "vceq", "f32", v2i32, v2f32,
5101480093f4SDimitry Andric                         ARMCCeq, 1>;
51028bcb0991SDimitry Andricdef  VCEQfq   : N3VQ_cmp<0,0,0b00,0b1110,0, IIC_VBINQ, "vceq", "f32", v4i32, v4f32,
5103480093f4SDimitry Andric                         ARMCCeq, 1>;
51048bcb0991SDimitry Andricdef  VCEQhd   : N3VD_cmp<0,0,0b01,0b1110,0, IIC_VBIND, "vceq", "f16", v4i16, v4f16,
5105480093f4SDimitry Andric                         ARMCCeq, 1>,
51060b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51078bcb0991SDimitry Andricdef  VCEQhq   : N3VQ_cmp<0,0,0b01,0b1110,0, IIC_VBINQ, "vceq", "f16", v8i16, v8f16,
5108480093f4SDimitry Andric                         ARMCCeq, 1>,
51090b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51100b57cec5SDimitry Andric
51110b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in
51120b57cec5SDimitry Andricdefm VCEQz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00010, 0, "vceq", "i",
5113480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCeq>;
51140b57cec5SDimitry Andric
51150b57cec5SDimitry Andric//   VCGE     : Vector Compare Greater Than or Equal
51168bcb0991SDimitry Andricdefm VCGEs    : N3V_QHS_cmp<0, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5117480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "s", ARMCCge, 0>;
51188bcb0991SDimitry Andricdefm VCGEu    : N3V_QHS_cmp<1, 0, 0b0011, 1, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5119480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcge", "u", ARMCChs, 0>;
51208bcb0991SDimitry Andricdef  VCGEfd   : N3VD_cmp<1,0,0b00,0b1110,0, IIC_VBIND, "vcge", "f32", v2i32, v2f32,
5121480093f4SDimitry Andric                         ARMCCge, 0>;
51228bcb0991SDimitry Andricdef  VCGEfq   : N3VQ_cmp<1,0,0b00,0b1110,0, IIC_VBINQ, "vcge", "f32", v4i32, v4f32,
5123480093f4SDimitry Andric                         ARMCCge, 0>;
51248bcb0991SDimitry Andricdef  VCGEhd   : N3VD_cmp<1,0,0b01,0b1110,0, IIC_VBIND, "vcge", "f16", v4i16, v4f16,
5125480093f4SDimitry Andric                         ARMCCge, 0>,
51260b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51278bcb0991SDimitry Andricdef  VCGEhq   : N3VQ_cmp<1,0,0b01,0b1110,0, IIC_VBINQ, "vcge", "f16", v8i16, v8f16,
5128480093f4SDimitry Andric                         ARMCCge, 0>,
51290b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51300b57cec5SDimitry Andric
51310b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51320b57cec5SDimitry Andricdefm VCGEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00001, 0, "vcge", "s",
5133480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCge>;
51340b57cec5SDimitry Andricdefm VCLEz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00011, 0, "vcle", "s",
5135480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCle>;
51360b57cec5SDimitry Andric}
51370b57cec5SDimitry Andric
51380b57cec5SDimitry Andric//   VCGT     : Vector Compare Greater Than
51398bcb0991SDimitry Andricdefm VCGTs    : N3V_QHS_cmp<0, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5140480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "s", ARMCCgt, 0>;
51418bcb0991SDimitry Andricdefm VCGTu    : N3V_QHS_cmp<1, 0, 0b0011, 0, IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q,
5142480093f4SDimitry Andric                            IIC_VSUBi4Q, "vcgt", "u", ARMCChi, 0>;
51438bcb0991SDimitry Andricdef  VCGTfd   : N3VD_cmp<1,0,0b10,0b1110,0, IIC_VBIND, "vcgt", "f32", v2i32, v2f32,
5144480093f4SDimitry Andric                         ARMCCgt, 0>;
51458bcb0991SDimitry Andricdef  VCGTfq   : N3VQ_cmp<1,0,0b10,0b1110,0, IIC_VBINQ, "vcgt", "f32", v4i32, v4f32,
5146480093f4SDimitry Andric                         ARMCCgt, 0>;
51478bcb0991SDimitry Andricdef  VCGThd   : N3VD_cmp<1,0,0b11,0b1110,0, IIC_VBIND, "vcgt", "f16", v4i16, v4f16,
5148480093f4SDimitry Andric                         ARMCCgt, 0>,
51490b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51508bcb0991SDimitry Andricdef  VCGThq   : N3VQ_cmp<1,0,0b11,0b1110,0, IIC_VBINQ, "vcgt", "f16", v8i16, v8f16,
5151480093f4SDimitry Andric                         ARMCCgt, 0>,
51520b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
51530b57cec5SDimitry Andric
51540b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vm = $Vd" in {
51550b57cec5SDimitry Andricdefm VCGTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00000, 0, "vcgt", "s",
5156480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCCgt>;
51570b57cec5SDimitry Andricdefm VCLTz    : N2V_QHS_cmp<0b11, 0b11, 0b01, 0b00100, 0, "vclt", "s",
5158480093f4SDimitry Andric                            "$Vd, $Vm, #0", ARMCClt>;
51590b57cec5SDimitry Andric}
51600b57cec5SDimitry Andric
51610b57cec5SDimitry Andric//   VACGE    : Vector Absolute Compare Greater Than or Equal (aka VCAGE)
51620b57cec5SDimitry Andricdef  VACGEfd   : N3VDInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
51630b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacge, 0>;
51640b57cec5SDimitry Andricdef  VACGEfq   : N3VQInt<1, 0, 0b00, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
51650b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacge, 0>;
51660b57cec5SDimitry Andricdef  VACGEhd   : N3VDInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacge",
51670b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacge, 0>,
51680b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51690b57cec5SDimitry Andricdef  VACGEhq   : N3VQInt<1, 0, 0b01, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacge",
51700b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacge, 0>,
51710b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51720b57cec5SDimitry Andric//   VACGT    : Vector Absolute Compare Greater Than (aka VCAGT)
51730b57cec5SDimitry Andricdef  VACGTfd   : N3VDInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
51740b57cec5SDimitry Andric                        "f32", v2i32, v2f32, int_arm_neon_vacgt, 0>;
51750b57cec5SDimitry Andricdef  VACGTfq   : N3VQInt<1, 0, 0b10, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
51760b57cec5SDimitry Andric                        "f32", v4i32, v4f32, int_arm_neon_vacgt, 0>;
51770b57cec5SDimitry Andricdef  VACGThd   : N3VDInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBIND, "vacgt",
51780b57cec5SDimitry Andric                        "f16", v4i16, v4f16, int_arm_neon_vacgt, 0>,
51790b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51800b57cec5SDimitry Andricdef  VACGThq   : N3VQInt<1, 0, 0b11, 0b1110, 1, N3RegFrm, IIC_VBINQ, "vacgt",
51810b57cec5SDimitry Andric                        "f16", v8i16, v8f16, int_arm_neon_vacgt, 0>,
51820b57cec5SDimitry Andric                 Requires<[HasNEON, HasFullFP16]>;
51830b57cec5SDimitry Andric//   VTST     : Vector Test Bits
51840b57cec5SDimitry Andricdefm VTST     : N3V_QHS<0, 0, 0b1000, 1, IIC_VBINi4D, IIC_VBINi4D, IIC_VBINi4Q,
51850b57cec5SDimitry Andric                        IIC_VBINi4Q, "vtst", "", NEONvtst, 1>;
51860b57cec5SDimitry Andric
51870b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
51880b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
51890b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vn, $Vm",
51900b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
51910b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
51920b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
51930b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vn, $Vm",
51940b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
51950b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
51960b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
51970b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
51980b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vn, $Vm",
51990b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52000b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52010b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vn, pred:$p)>;
52020b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vn, $Vm",
52030b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vn, pred:$p)>;
52040b57cec5SDimitry Andric}
52050b57cec5SDimitry Andric
52060b57cec5SDimitry Andric// +fp16fml Floating Point Multiplication Variants
52070b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFP16FML], DecoderNamespace= "VFPV8" in {
52080b57cec5SDimitry Andric
52090b57cec5SDimitry Andricclass N3VCP8F16Q1<string asm, RegisterClass Td, RegisterClass Tn,
52100b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52110b57cec5SDimitry Andric  : N3VCP8<op1, op2, 1, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52120b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52130b57cec5SDimitry Andric
52140b57cec5SDimitry Andricclass N3VCP8F16Q0<string asm, RegisterClass Td, RegisterClass Tn,
52150b57cec5SDimitry Andric                RegisterClass Tm, bits<2> op1, bits<2> op2, bit op3>
52160b57cec5SDimitry Andric  : N3VCP8Q0<op1, op2, 0, op3, (outs Td:$Vd), (ins Tn:$Vn, Tm:$Vm), NoItinerary,
52170b57cec5SDimitry Andric           asm, "f16", "$Vd, $Vn, $Vm", "", []>;
52180b57cec5SDimitry Andric
52190b57cec5SDimitry Andric// Vd, Vs, Vs[0-15], Idx[0-1]
52200b57cec5SDimitry Andricclass VFMD<string opc, string type, bits<2> S>
52210b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 0, 1, (outs DPR:$Vd),
52220b57cec5SDimitry Andric               (ins SPR:$Vn, SPR_8:$Vm, VectorIndex32:$idx),
52230b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52240b57cec5SDimitry Andric  bit idx;
52250b57cec5SDimitry Andric  let Inst{3} = idx;
52260b57cec5SDimitry Andric  let Inst{19-16} = Vn{4-1};
52270b57cec5SDimitry Andric  let Inst{7}     = Vn{0};
52280b57cec5SDimitry Andric  let Inst{5}     = Vm{0};
52290b57cec5SDimitry Andric  let Inst{2-0}   = Vm{3-1};
52300b57cec5SDimitry Andric}
52310b57cec5SDimitry Andric
52320b57cec5SDimitry Andric// Vq, Vd, Vd[0-7], Idx[0-3]
52330b57cec5SDimitry Andricclass VFMQ<string opc, string type, bits<2> S>
52340b57cec5SDimitry Andric  : N3VLaneCP8<0, S, 1, 1, (outs QPR:$Vd),
52350b57cec5SDimitry Andric               (ins DPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
52360b57cec5SDimitry Andric               IIC_VMACD, opc, type, "$Vd, $Vn, $Vm$idx", "", []> {
52370b57cec5SDimitry Andric  bits<2> idx;
52380b57cec5SDimitry Andric  let Inst{5} = idx{1};
52390b57cec5SDimitry Andric  let Inst{3} = idx{0};
52400b57cec5SDimitry Andric}
52410b57cec5SDimitry Andric
52420b57cec5SDimitry Andric//                                                op1   op2   op3
52430b57cec5SDimitry Andricdef VFMALD  : N3VCP8F16Q0<"vfmal", DPR, SPR, SPR, 0b00, 0b10, 1>;
52440b57cec5SDimitry Andricdef VFMSLD  : N3VCP8F16Q0<"vfmsl", DPR, SPR, SPR, 0b01, 0b10, 1>;
52450b57cec5SDimitry Andricdef VFMALQ  : N3VCP8F16Q1<"vfmal", QPR, DPR, DPR, 0b00, 0b10, 1>;
52460b57cec5SDimitry Andricdef VFMSLQ  : N3VCP8F16Q1<"vfmsl", QPR, DPR, DPR, 0b01, 0b10, 1>;
52470b57cec5SDimitry Andricdef VFMALDI : VFMD<"vfmal", "f16", 0b00>;
52480b57cec5SDimitry Andricdef VFMSLDI : VFMD<"vfmsl", "f16", 0b01>;
52490b57cec5SDimitry Andricdef VFMALQI : VFMQ<"vfmal", "f16", 0b00>;
52500b57cec5SDimitry Andricdef VFMSLQI : VFMQ<"vfmsl", "f16", 0b01>;
52510b57cec5SDimitry Andric} // HasNEON, HasFP16FML
52520b57cec5SDimitry Andric
52530b57cec5SDimitry Andric
52540b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52550b57cec5SDimitry Andric                   (VACGTfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52560b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f32 $Vd, $Vm",
52570b57cec5SDimitry Andric                   (VACGTfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52580b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52590b57cec5SDimitry Andric                   (VACGEfd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52600b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f32 $Vd, $Vm",
52610b57cec5SDimitry Andric                   (VACGEfq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52620b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
52630b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
52640b57cec5SDimitry Andric                   (VACGThd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52650b57cec5SDimitry Andricdef: NEONInstAlias<"vaclt${p}.f16 $Vd, $Vm",
52660b57cec5SDimitry Andric                   (VACGThq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52670b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
52680b57cec5SDimitry Andric                   (VACGEhd DPR:$Vd, DPR:$Vm, DPR:$Vd, pred:$p)>;
52690b57cec5SDimitry Andricdef: NEONInstAlias<"vacle${p}.f16 $Vd, $Vm",
52700b57cec5SDimitry Andric                   (VACGEhq QPR:$Vd, QPR:$Vm, QPR:$Vd, pred:$p)>;
52710b57cec5SDimitry Andric}
52720b57cec5SDimitry Andric
52730b57cec5SDimitry Andric// Vector Bitwise Operations.
52740b57cec5SDimitry Andric
52750b57cec5SDimitry Andricdef vnotd : PatFrag<(ops node:$in),
52760b57cec5SDimitry Andric                    (xor node:$in, (bitconvert (v8i8 NEONimmAllOnesV)))>;
52770b57cec5SDimitry Andricdef vnotq : PatFrag<(ops node:$in),
52780b57cec5SDimitry Andric                    (xor node:$in, (bitconvert (v16i8 NEONimmAllOnesV)))>;
52790b57cec5SDimitry Andric
52800b57cec5SDimitry Andric
52810b57cec5SDimitry Andric//   VAND     : Vector Bitwise AND
52820b57cec5SDimitry Andricdef  VANDd    : N3VDX<0, 0, 0b00, 0b0001, 1, IIC_VBINiD, "vand",
52830b57cec5SDimitry Andric                      v2i32, v2i32, and, 1>;
52840b57cec5SDimitry Andricdef  VANDq    : N3VQX<0, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "vand",
52850b57cec5SDimitry Andric                      v4i32, v4i32, and, 1>;
52860b57cec5SDimitry Andric
52870b57cec5SDimitry Andric//   VEOR     : Vector Bitwise Exclusive OR
52880b57cec5SDimitry Andricdef  VEORd    : N3VDX<1, 0, 0b00, 0b0001, 1, IIC_VBINiD, "veor",
52890b57cec5SDimitry Andric                      v2i32, v2i32, xor, 1>;
52900b57cec5SDimitry Andricdef  VEORq    : N3VQX<1, 0, 0b00, 0b0001, 1, IIC_VBINiQ, "veor",
52910b57cec5SDimitry Andric                      v4i32, v4i32, xor, 1>;
52920b57cec5SDimitry Andric
52930b57cec5SDimitry Andric//   VORR     : Vector Bitwise OR
52940b57cec5SDimitry Andricdef  VORRd    : N3VDX<0, 0, 0b10, 0b0001, 1, IIC_VBINiD, "vorr",
52950b57cec5SDimitry Andric                      v2i32, v2i32, or, 1>;
52960b57cec5SDimitry Andricdef  VORRq    : N3VQX<0, 0, 0b10, 0b0001, 1, IIC_VBINiQ, "vorr",
52970b57cec5SDimitry Andric                      v4i32, v4i32, or, 1>;
52980b57cec5SDimitry Andric
52990b57cec5SDimitry Andricdef VORRiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 0, 1,
53000b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
53010b57cec5SDimitry Andric                          IIC_VMOVImm,
53020b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53030b57cec5SDimitry Andric                          [(set DPR:$Vd,
5304*5ffd83dbSDimitry Andric                            (v4i16 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53050b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53060b57cec5SDimitry Andric}
53070b57cec5SDimitry Andric
53080b57cec5SDimitry Andricdef VORRiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 0, 1,
53090b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
53100b57cec5SDimitry Andric                          IIC_VMOVImm,
53110b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53120b57cec5SDimitry Andric                          [(set DPR:$Vd,
5313*5ffd83dbSDimitry Andric                            (v2i32 (ARMvorrImm DPR:$src, timm:$SIMM)))]> {
53140b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53150b57cec5SDimitry Andric}
53160b57cec5SDimitry Andric
53170b57cec5SDimitry Andricdef VORRiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 0, 1,
53180b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
53190b57cec5SDimitry Andric                          IIC_VMOVImm,
53200b57cec5SDimitry Andric                          "vorr", "i16", "$Vd, $SIMM", "$src = $Vd",
53210b57cec5SDimitry Andric                          [(set QPR:$Vd,
5322*5ffd83dbSDimitry Andric                            (v8i16 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53230b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53240b57cec5SDimitry Andric}
53250b57cec5SDimitry Andric
53260b57cec5SDimitry Andricdef VORRiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 0, 1,
53270b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
53280b57cec5SDimitry Andric                          IIC_VMOVImm,
53290b57cec5SDimitry Andric                          "vorr", "i32", "$Vd, $SIMM", "$src = $Vd",
53300b57cec5SDimitry Andric                          [(set QPR:$Vd,
5331*5ffd83dbSDimitry Andric                            (v4i32 (ARMvorrImm QPR:$src, timm:$SIMM)))]> {
53320b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53330b57cec5SDimitry Andric}
53340b57cec5SDimitry Andric
53350b57cec5SDimitry Andric
53360b57cec5SDimitry Andric//   VBIC     : Vector Bitwise Bit Clear (AND NOT)
53370b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
53380b57cec5SDimitry Andricdef  VBICd    : N3VX<0, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
53390b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
53400b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
53410b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (and DPR:$Vn,
53420b57cec5SDimitry Andric                                                 (vnotd DPR:$Vm))))]>;
53430b57cec5SDimitry Andricdef  VBICq    : N3VX<0, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
53440b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
53450b57cec5SDimitry Andric                     "vbic", "$Vd, $Vn, $Vm", "",
53460b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (and QPR:$Vn,
53470b57cec5SDimitry Andric                                                 (vnotq QPR:$Vm))))]>;
53480b57cec5SDimitry Andric}
53490b57cec5SDimitry Andric
53500b57cec5SDimitry Andricdef VBICiv4i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 0, 1, 1,
53510b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI16:$SIMM, DPR:$src),
53520b57cec5SDimitry Andric                          IIC_VMOVImm,
53530b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
53540b57cec5SDimitry Andric                          [(set DPR:$Vd,
5355*5ffd83dbSDimitry Andric                            (v4i16 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
53560b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53570b57cec5SDimitry Andric}
53580b57cec5SDimitry Andric
53590b57cec5SDimitry Andricdef VBICiv2i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 0, 1, 1,
53600b57cec5SDimitry Andric                          (outs DPR:$Vd), (ins nImmSplatI32:$SIMM, DPR:$src),
53610b57cec5SDimitry Andric                          IIC_VMOVImm,
53620b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
53630b57cec5SDimitry Andric                          [(set DPR:$Vd,
5364*5ffd83dbSDimitry Andric                            (v2i32 (ARMvbicImm DPR:$src, timm:$SIMM)))]> {
53650b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53660b57cec5SDimitry Andric}
53670b57cec5SDimitry Andric
53680b57cec5SDimitry Andricdef VBICiv8i16 : N1ModImm<1, 0b000, {1,0,?,1}, 0, 1, 1, 1,
53690b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI16:$SIMM, QPR:$src),
53700b57cec5SDimitry Andric                          IIC_VMOVImm,
53710b57cec5SDimitry Andric                          "vbic", "i16", "$Vd, $SIMM", "$src = $Vd",
53720b57cec5SDimitry Andric                          [(set QPR:$Vd,
5373*5ffd83dbSDimitry Andric                            (v8i16 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
53740b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
53750b57cec5SDimitry Andric}
53760b57cec5SDimitry Andric
53770b57cec5SDimitry Andricdef VBICiv4i32 : N1ModImm<1, 0b000, {0,?,?,1}, 0, 1, 1, 1,
53780b57cec5SDimitry Andric                          (outs QPR:$Vd), (ins nImmSplatI32:$SIMM, QPR:$src),
53790b57cec5SDimitry Andric                          IIC_VMOVImm,
53800b57cec5SDimitry Andric                          "vbic", "i32", "$Vd, $SIMM", "$src = $Vd",
53810b57cec5SDimitry Andric                          [(set QPR:$Vd,
5382*5ffd83dbSDimitry Andric                            (v4i32 (ARMvbicImm QPR:$src, timm:$SIMM)))]> {
53830b57cec5SDimitry Andric  let Inst{10-9} = SIMM{10-9};
53840b57cec5SDimitry Andric}
53850b57cec5SDimitry Andric
53860b57cec5SDimitry Andric//   VORN     : Vector Bitwise OR NOT
53870b57cec5SDimitry Andricdef  VORNd    : N3VX<0, 0, 0b11, 0b0001, 0, 1, (outs DPR:$Vd),
53880b57cec5SDimitry Andric                     (ins DPR:$Vn, DPR:$Vm), N3RegFrm, IIC_VBINiD,
53890b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
53900b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (or DPR:$Vn,
53910b57cec5SDimitry Andric                                                (vnotd DPR:$Vm))))]>;
53920b57cec5SDimitry Andricdef  VORNq    : N3VX<0, 0, 0b11, 0b0001, 1, 1, (outs QPR:$Vd),
53930b57cec5SDimitry Andric                     (ins QPR:$Vn, QPR:$Vm), N3RegFrm, IIC_VBINiQ,
53940b57cec5SDimitry Andric                     "vorn", "$Vd, $Vn, $Vm", "",
53950b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (or QPR:$Vn,
53960b57cec5SDimitry Andric                                                (vnotq QPR:$Vm))))]>;
53970b57cec5SDimitry Andric
53980b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT (Immediate)
53990b57cec5SDimitry Andric
54000b57cec5SDimitry Andriclet isReMaterializable = 1 in {
54010b57cec5SDimitry Andric
54020b57cec5SDimitry Andricdef VMVNv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 1, 1, (outs DPR:$Vd),
54030b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54040b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54050b57cec5SDimitry Andric                         [(set DPR:$Vd, (v4i16 (ARMvmvnImm timm:$SIMM)))]> {
54060b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54070b57cec5SDimitry Andric}
54080b57cec5SDimitry Andric
54090b57cec5SDimitry Andricdef VMVNv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 1, 1, (outs QPR:$Vd),
54100b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
54110b57cec5SDimitry Andric                         "vmvn", "i16", "$Vd, $SIMM", "",
54120b57cec5SDimitry Andric                         [(set QPR:$Vd, (v8i16 (ARMvmvnImm timm:$SIMM)))]> {
54130b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
54140b57cec5SDimitry Andric}
54150b57cec5SDimitry Andric
54160b57cec5SDimitry Andricdef VMVNv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 1, 1, (outs DPR:$Vd),
54170b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54180b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54190b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2i32 (ARMvmvnImm timm:$SIMM)))]> {
54200b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54210b57cec5SDimitry Andric}
54220b57cec5SDimitry Andric
54230b57cec5SDimitry Andricdef VMVNv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 1, 1, (outs QPR:$Vd),
54240b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
54250b57cec5SDimitry Andric                         "vmvn", "i32", "$Vd, $SIMM", "",
54260b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4i32 (ARMvmvnImm timm:$SIMM)))]> {
54270b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
54280b57cec5SDimitry Andric}
54290b57cec5SDimitry Andric}
54300b57cec5SDimitry Andric
54310b57cec5SDimitry Andric//   VMVN     : Vector Bitwise NOT
54320b57cec5SDimitry Andricdef  VMVNd    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 0, 0,
54330b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$Vm), IIC_VSUBiD,
54340b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
54350b57cec5SDimitry Andric                     [(set DPR:$Vd, (v2i32 (vnotd DPR:$Vm)))]>;
54360b57cec5SDimitry Andricdef  VMVNq    : N2VX<0b11, 0b11, 0b00, 0b00, 0b01011, 1, 0,
54370b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$Vm), IIC_VSUBiD,
54380b57cec5SDimitry Andric                     "vmvn", "$Vd, $Vm", "",
54390b57cec5SDimitry Andric                     [(set QPR:$Vd, (v4i32 (vnotq QPR:$Vm)))]>;
54400b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
54410b57cec5SDimitry Andricdef : Pat<(v2i32 (vnotd DPR:$src)), (VMVNd DPR:$src)>;
54420b57cec5SDimitry Andricdef : Pat<(v4i32 (vnotq QPR:$src)), (VMVNq QPR:$src)>;
54430b57cec5SDimitry Andric}
54440b57cec5SDimitry Andric
54450b57cec5SDimitry Andric//   VBSL     : Vector Bitwise Select
54460b57cec5SDimitry Andricdef  VBSLd    : N3VX<1, 0, 0b01, 0b0001, 0, 1, (outs DPR:$Vd),
54470b57cec5SDimitry Andric                     (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
54480b57cec5SDimitry Andric                     N3RegFrm, IIC_VCNTiD,
54490b57cec5SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
54500b57cec5SDimitry Andric                     [(set DPR:$Vd,
54510b57cec5SDimitry Andric                           (v2i32 (NEONvbsl DPR:$src1, DPR:$Vn, DPR:$Vm)))]>;
54520b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
54530b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vbsl (v8i8 DPR:$src1),
54540b57cec5SDimitry Andric                                   (v8i8 DPR:$Vn), (v8i8 DPR:$Vm))),
54550b57cec5SDimitry Andric          (VBSLd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
54560b57cec5SDimitry Andricdef : Pat<(v4i16 (int_arm_neon_vbsl (v4i16 DPR:$src1),
54570b57cec5SDimitry Andric                                    (v4i16 DPR:$Vn), (v4i16 DPR:$Vm))),
54580b57cec5SDimitry Andric          (VBSLd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
54590b57cec5SDimitry Andricdef : Pat<(v2i32 (int_arm_neon_vbsl (v2i32 DPR:$src1),
54600b57cec5SDimitry Andric                                    (v2i32 DPR:$Vn), (v2i32 DPR:$Vm))),
54610b57cec5SDimitry Andric          (VBSLd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
54620b57cec5SDimitry Andricdef : Pat<(v2f32 (int_arm_neon_vbsl (v2f32 DPR:$src1),
54630b57cec5SDimitry Andric                                    (v2f32 DPR:$Vn), (v2f32 DPR:$Vm))),
54640b57cec5SDimitry Andric          (VBSLd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
54650b57cec5SDimitry Andricdef : Pat<(v1i64 (int_arm_neon_vbsl (v1i64 DPR:$src1),
54660b57cec5SDimitry Andric                                    (v1i64 DPR:$Vn), (v1i64 DPR:$Vm))),
54670b57cec5SDimitry Andric          (VBSLd DPR:$src1, DPR:$Vn, DPR:$Vm)>;
54680b57cec5SDimitry Andric
54690b57cec5SDimitry Andricdef : Pat<(v2i32 (or (and DPR:$Vn, DPR:$Vd),
54700b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
54710b57cec5SDimitry Andric          (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
54720b57cec5SDimitry Andric
54730b57cec5SDimitry Andricdef : Pat<(v1i64 (or (and DPR:$Vn, DPR:$Vd),
54740b57cec5SDimitry Andric                     (and DPR:$Vm, (vnotd DPR:$Vd)))),
54750b57cec5SDimitry Andric          (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm)>;
54760b57cec5SDimitry Andric}
54770b57cec5SDimitry Andric
54780b57cec5SDimitry Andricdef  VBSLq    : N3VX<1, 0, 0b01, 0b0001, 1, 1, (outs QPR:$Vd),
54790b57cec5SDimitry Andric                     (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
54800b57cec5SDimitry Andric                     N3RegFrm, IIC_VCNTiQ,
54810b57cec5SDimitry Andric                     "vbsl", "$Vd, $Vn, $Vm", "$src1 = $Vd",
54820b57cec5SDimitry Andric                     [(set QPR:$Vd,
54830b57cec5SDimitry Andric                           (v4i32 (NEONvbsl QPR:$src1, QPR:$Vn, QPR:$Vm)))]>;
54840b57cec5SDimitry Andric
54850b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
54860b57cec5SDimitry Andricdef : Pat<(v16i8 (int_arm_neon_vbsl (v16i8 QPR:$src1),
54870b57cec5SDimitry Andric                                   (v16i8 QPR:$Vn), (v16i8 QPR:$Vm))),
54880b57cec5SDimitry Andric          (VBSLq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
54890b57cec5SDimitry Andricdef : Pat<(v8i16 (int_arm_neon_vbsl (v8i16 QPR:$src1),
54900b57cec5SDimitry Andric                                    (v8i16 QPR:$Vn), (v8i16 QPR:$Vm))),
54910b57cec5SDimitry Andric          (VBSLq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
54920b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_vbsl (v4i32 QPR:$src1),
54930b57cec5SDimitry Andric                                    (v4i32 QPR:$Vn), (v4i32 QPR:$Vm))),
54940b57cec5SDimitry Andric          (VBSLq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
54950b57cec5SDimitry Andricdef : Pat<(v4f32 (int_arm_neon_vbsl (v4f32 QPR:$src1),
54960b57cec5SDimitry Andric                                    (v4f32 QPR:$Vn), (v4f32 QPR:$Vm))),
54970b57cec5SDimitry Andric          (VBSLq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
54980b57cec5SDimitry Andricdef : Pat<(v2i64 (int_arm_neon_vbsl (v2i64 QPR:$src1),
54990b57cec5SDimitry Andric                                    (v2i64 QPR:$Vn), (v2i64 QPR:$Vm))),
55000b57cec5SDimitry Andric          (VBSLq QPR:$src1, QPR:$Vn, QPR:$Vm)>;
55010b57cec5SDimitry Andric
55020b57cec5SDimitry Andricdef : Pat<(v4i32 (or (and QPR:$Vn, QPR:$Vd),
55030b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
55040b57cec5SDimitry Andric          (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55050b57cec5SDimitry Andricdef : Pat<(v2i64 (or (and QPR:$Vn, QPR:$Vd),
55060b57cec5SDimitry Andric                     (and QPR:$Vm, (vnotq QPR:$Vd)))),
55070b57cec5SDimitry Andric          (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm)>;
55080b57cec5SDimitry Andric}
55090b57cec5SDimitry Andric
55100b57cec5SDimitry Andric//   VBIF     : Vector Bitwise Insert if False
55110b57cec5SDimitry Andric//              like VBSL but with: "vbif $dst, $src3, $src1", "$src2 = $dst",
55120b57cec5SDimitry Andric// FIXME: This instruction's encoding MAY NOT BE correct.
55130b57cec5SDimitry Andricdef  VBIFd    : N3VX<1, 0, 0b11, 0b0001, 0, 1,
55140b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
55150b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
55160b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
55170b57cec5SDimitry Andric                     []>;
55180b57cec5SDimitry Andricdef  VBIFq    : N3VX<1, 0, 0b11, 0b0001, 1, 1,
55190b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
55200b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
55210b57cec5SDimitry Andric                     "vbif", "$Vd, $Vn, $Vm", "$src1 = $Vd",
55220b57cec5SDimitry Andric                     []>;
55230b57cec5SDimitry Andric
55240b57cec5SDimitry Andric//   VBIT     : Vector Bitwise Insert if True
55250b57cec5SDimitry Andric//              like VBSL but with: "vbit $dst, $src2, $src1", "$src3 = $dst",
55260b57cec5SDimitry Andric// FIXME: This instruction's encoding MAY NOT BE correct.
55270b57cec5SDimitry Andricdef  VBITd    : N3VX<1, 0, 0b10, 0b0001, 0, 1,
55280b57cec5SDimitry Andric                     (outs DPR:$Vd), (ins DPR:$src1, DPR:$Vn, DPR:$Vm),
55290b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiD,
55300b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
55310b57cec5SDimitry Andric                     []>;
55320b57cec5SDimitry Andricdef  VBITq    : N3VX<1, 0, 0b10, 0b0001, 1, 1,
55330b57cec5SDimitry Andric                     (outs QPR:$Vd), (ins QPR:$src1, QPR:$Vn, QPR:$Vm),
55340b57cec5SDimitry Andric                     N3RegFrm, IIC_VBINiQ,
55350b57cec5SDimitry Andric                     "vbit", "$Vd, $Vn, $Vm", "$src1 = $Vd",
55360b57cec5SDimitry Andric                     []>;
55370b57cec5SDimitry Andric
55380b57cec5SDimitry Andric// VBIT/VBIF are not yet implemented.  The TwoAddress pass will not go looking
55390b57cec5SDimitry Andric// for equivalent operations with different register constraints; it just
55400b57cec5SDimitry Andric// inserts copies.
55410b57cec5SDimitry Andric
55420b57cec5SDimitry Andric// Vector Absolute Differences.
55430b57cec5SDimitry Andric
55440b57cec5SDimitry Andric//   VABD     : Vector Absolute Difference
55450b57cec5SDimitry Andricdefm VABDs    : N3VInt_QHS<0, 0, 0b0111, 0, N3RegFrm,
55460b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
55470b57cec5SDimitry Andric                           "vabd", "s", int_arm_neon_vabds, 1>;
55480b57cec5SDimitry Andricdefm VABDu    : N3VInt_QHS<1, 0, 0b0111, 0, N3RegFrm,
55490b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
55500b57cec5SDimitry Andric                           "vabd", "u", int_arm_neon_vabdu, 1>;
55510b57cec5SDimitry Andricdef  VABDfd   : N3VDInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBIND,
55520b57cec5SDimitry Andric                        "vabd", "f32", v2f32, v2f32, int_arm_neon_vabds, 1>;
55530b57cec5SDimitry Andricdef  VABDfq   : N3VQInt<1, 0, 0b10, 0b1101, 0, N3RegFrm, IIC_VBINQ,
55540b57cec5SDimitry Andric                        "vabd", "f32", v4f32, v4f32, int_arm_neon_vabds, 1>;
55550b57cec5SDimitry Andricdef  VABDhd   : N3VDInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBIND,
55560b57cec5SDimitry Andric                        "vabd", "f16", v4f16, v4f16, int_arm_neon_vabds, 1>,
55570b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
55580b57cec5SDimitry Andricdef  VABDhq   : N3VQInt<1, 0, 0b11, 0b1101, 0, N3RegFrm, IIC_VBINQ,
55590b57cec5SDimitry Andric                        "vabd", "f16", v8f16, v8f16, int_arm_neon_vabds, 1>,
55600b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
55610b57cec5SDimitry Andric
55620b57cec5SDimitry Andric//   VABDL    : Vector Absolute Difference Long (Q = | D - D |)
55630b57cec5SDimitry Andricdefm VABDLs   : N3VLIntExt_QHS<0,1,0b0111,0, IIC_VSUBi4Q,
55640b57cec5SDimitry Andric                               "vabdl", "s", int_arm_neon_vabds, zext, 1>;
55650b57cec5SDimitry Andricdefm VABDLu   : N3VLIntExt_QHS<1,1,0b0111,0, IIC_VSUBi4Q,
55660b57cec5SDimitry Andric                               "vabdl", "u", int_arm_neon_vabdu, zext, 1>;
55670b57cec5SDimitry Andric
55680b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55690b57cec5SDimitry Andricdef : Pat<(v8i16 (abs (sub (zext (v8i8 DPR:$opA)), (zext (v8i8 DPR:$opB))))),
55700b57cec5SDimitry Andric          (VABDLuv8i16 DPR:$opA, DPR:$opB)>;
55710b57cec5SDimitry Andricdef : Pat<(v4i32 (abs (sub (zext (v4i16 DPR:$opA)), (zext (v4i16 DPR:$opB))))),
55720b57cec5SDimitry Andric          (VABDLuv4i32 DPR:$opA, DPR:$opB)>;
55730b57cec5SDimitry Andric}
55740b57cec5SDimitry Andric
55750b57cec5SDimitry Andric// ISD::ABS is not legal for v2i64, so VABDL needs to be matched from the
55760b57cec5SDimitry Andric// shift/xor pattern for ABS.
55770b57cec5SDimitry Andric
55780b57cec5SDimitry Andricdef abd_shr :
55790b57cec5SDimitry Andric    PatFrag<(ops node:$in1, node:$in2, node:$shift),
55800b57cec5SDimitry Andric            (ARMvshrsImm (sub (zext node:$in1),
55810b57cec5SDimitry Andric                            (zext node:$in2)), (i32 $shift))>;
55820b57cec5SDimitry Andric
55830b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
55840b57cec5SDimitry Andricdef : Pat<(xor (v4i32 (bitconvert (v2i64 (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)))),
55850b57cec5SDimitry Andric               (v4i32 (bitconvert (v2i64 (add (sub (zext (v2i32 DPR:$opA)),
55860b57cec5SDimitry Andric                                                   (zext (v2i32 DPR:$opB))),
55870b57cec5SDimitry Andric                                         (abd_shr (v2i32 DPR:$opA), (v2i32 DPR:$opB), 63)))))),
55880b57cec5SDimitry Andric          (VABDLuv2i64 DPR:$opA, DPR:$opB)>;
55890b57cec5SDimitry Andric}
55900b57cec5SDimitry Andric
55910b57cec5SDimitry Andric//   VABA     : Vector Absolute Difference and Accumulate
55920b57cec5SDimitry Andricdefm VABAs    : N3VIntOp_QHS<0,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
55930b57cec5SDimitry Andric                             "vaba", "s", int_arm_neon_vabds, add>;
55940b57cec5SDimitry Andricdefm VABAu    : N3VIntOp_QHS<1,0,0b0111,1, IIC_VABAD, IIC_VABAQ,
55950b57cec5SDimitry Andric                             "vaba", "u", int_arm_neon_vabdu, add>;
55960b57cec5SDimitry Andric
55970b57cec5SDimitry Andric//   VABAL    : Vector Absolute Difference and Accumulate Long (Q += | D - D |)
55980b57cec5SDimitry Andricdefm VABALs   : N3VLIntExtOp_QHS<0,1,0b0101,0, IIC_VABAD,
55990b57cec5SDimitry Andric                                 "vabal", "s", int_arm_neon_vabds, zext, add>;
56000b57cec5SDimitry Andricdefm VABALu   : N3VLIntExtOp_QHS<1,1,0b0101,0, IIC_VABAD,
56010b57cec5SDimitry Andric                                 "vabal", "u", int_arm_neon_vabdu, zext, add>;
56020b57cec5SDimitry Andric
56030b57cec5SDimitry Andric// Vector Maximum and Minimum.
56040b57cec5SDimitry Andric
56050b57cec5SDimitry Andric//   VMAX     : Vector Maximum
56060b57cec5SDimitry Andricdefm VMAXs    : N3VInt_QHS<0, 0, 0b0110, 0, N3RegFrm,
56070b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56080b57cec5SDimitry Andric                           "vmax", "s", smax, 1>;
56090b57cec5SDimitry Andricdefm VMAXu    : N3VInt_QHS<1, 0, 0b0110, 0, N3RegFrm,
56100b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56110b57cec5SDimitry Andric                           "vmax", "u", umax, 1>;
56120b57cec5SDimitry Andricdef  VMAXfd   : N3VDInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBIND,
56130b57cec5SDimitry Andric                        "vmax", "f32",
56140b57cec5SDimitry Andric                        v2f32, v2f32, fmaximum, 1>;
56150b57cec5SDimitry Andricdef  VMAXfq   : N3VQInt<0, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VBINQ,
56160b57cec5SDimitry Andric                        "vmax", "f32",
56170b57cec5SDimitry Andric                        v4f32, v4f32, fmaximum, 1>;
56180b57cec5SDimitry Andricdef  VMAXhd   : N3VDInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBIND,
56190b57cec5SDimitry Andric                        "vmax", "f16",
56200b57cec5SDimitry Andric                        v4f16, v4f16, fmaximum, 1>,
56210b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56220b57cec5SDimitry Andricdef  VMAXhq   : N3VQInt<0, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VBINQ,
56230b57cec5SDimitry Andric                        "vmax", "f16",
56240b57cec5SDimitry Andric                        v8f16, v8f16, fmaximum, 1>,
56250b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56260b57cec5SDimitry Andric
56270b57cec5SDimitry Andric// VMAXNM
56280b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
56290b57cec5SDimitry Andric  def NEON_VMAXNMNDf  : N3VDIntnp<0b00110, 0b00, 0b1111, 0, 1,
56300b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f32",
56310b57cec5SDimitry Andric                                  v2f32, v2f32, fmaxnum, 1>,
56320b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
56330b57cec5SDimitry Andric  def NEON_VMAXNMNQf  : N3VQIntnp<0b00110, 0b00, 0b1111, 1, 1,
56340b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f32",
56350b57cec5SDimitry Andric                                  v4f32, v4f32, fmaxnum, 1>,
56360b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
56370b57cec5SDimitry Andric  def NEON_VMAXNMNDh  : N3VDIntnp<0b00110, 0b01, 0b1111, 0, 1,
56380b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f16",
56390b57cec5SDimitry Andric                                  v4f16, v4f16, fmaxnum, 1>,
56400b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON, HasFullFP16]>;
56410b57cec5SDimitry Andric  def NEON_VMAXNMNQh  : N3VQIntnp<0b00110, 0b01, 0b1111, 1, 1,
56420b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vmaxnm", "f16",
56430b57cec5SDimitry Andric                                  v8f16, v8f16, fmaxnum, 1>,
56440b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON, HasFullFP16]>;
56450b57cec5SDimitry Andric}
56460b57cec5SDimitry Andric
56470b57cec5SDimitry Andric//   VMIN     : Vector Minimum
56480b57cec5SDimitry Andricdefm VMINs    : N3VInt_QHS<0, 0, 0b0110, 1, N3RegFrm,
56490b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56500b57cec5SDimitry Andric                           "vmin", "s", smin, 1>;
56510b57cec5SDimitry Andricdefm VMINu    : N3VInt_QHS<1, 0, 0b0110, 1, N3RegFrm,
56520b57cec5SDimitry Andric                           IIC_VSUBi4D, IIC_VSUBi4D, IIC_VSUBi4Q, IIC_VSUBi4Q,
56530b57cec5SDimitry Andric                           "vmin", "u", umin, 1>;
56540b57cec5SDimitry Andricdef  VMINfd   : N3VDInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBIND,
56550b57cec5SDimitry Andric                        "vmin", "f32",
56560b57cec5SDimitry Andric                        v2f32, v2f32, fminimum, 1>;
56570b57cec5SDimitry Andricdef  VMINfq   : N3VQInt<0, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VBINQ,
56580b57cec5SDimitry Andric                        "vmin", "f32",
56590b57cec5SDimitry Andric                        v4f32, v4f32, fminimum, 1>;
56600b57cec5SDimitry Andricdef  VMINhd   : N3VDInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBIND,
56610b57cec5SDimitry Andric                        "vmin", "f16",
56620b57cec5SDimitry Andric                        v4f16, v4f16, fminimum, 1>,
56630b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56640b57cec5SDimitry Andricdef  VMINhq   : N3VQInt<0, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VBINQ,
56650b57cec5SDimitry Andric                        "vmin", "f16",
56660b57cec5SDimitry Andric                        v8f16, v8f16, fminimum, 1>,
56670b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
56680b57cec5SDimitry Andric
56690b57cec5SDimitry Andric// VMINNM
56700b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
56710b57cec5SDimitry Andric  def NEON_VMINNMNDf  : N3VDIntnp<0b00110, 0b10, 0b1111, 0, 1,
56720b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f32",
56730b57cec5SDimitry Andric                                  v2f32, v2f32, fminnum, 1>,
56740b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
56750b57cec5SDimitry Andric  def NEON_VMINNMNQf  : N3VQIntnp<0b00110, 0b10, 0b1111, 1, 1,
56760b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f32",
56770b57cec5SDimitry Andric                                  v4f32, v4f32, fminnum, 1>,
56780b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON]>;
56790b57cec5SDimitry Andric  def NEON_VMINNMNDh  : N3VDIntnp<0b00110, 0b11, 0b1111, 0, 1,
56800b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f16",
56810b57cec5SDimitry Andric                                  v4f16, v4f16, fminnum, 1>,
56820b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON, HasFullFP16]>;
56830b57cec5SDimitry Andric  def NEON_VMINNMNQh  : N3VQIntnp<0b00110, 0b11, 0b1111, 1, 1,
56840b57cec5SDimitry Andric                                  N3RegFrm, NoItinerary, "vminnm", "f16",
56850b57cec5SDimitry Andric                                  v8f16, v8f16, fminnum, 1>,
56860b57cec5SDimitry Andric                                  Requires<[HasV8, HasNEON, HasFullFP16]>;
56870b57cec5SDimitry Andric}
56880b57cec5SDimitry Andric
56890b57cec5SDimitry Andric// Vector Pairwise Operations.
56900b57cec5SDimitry Andric
56910b57cec5SDimitry Andric//   VPADD    : Vector Pairwise Add
56920b57cec5SDimitry Andricdef  VPADDi8  : N3VDInt<0, 0, 0b00, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
56930b57cec5SDimitry Andric                        "vpadd", "i8",
56940b57cec5SDimitry Andric                        v8i8, v8i8, int_arm_neon_vpadd, 0>;
56950b57cec5SDimitry Andricdef  VPADDi16 : N3VDInt<0, 0, 0b01, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
56960b57cec5SDimitry Andric                        "vpadd", "i16",
56970b57cec5SDimitry Andric                        v4i16, v4i16, int_arm_neon_vpadd, 0>;
56980b57cec5SDimitry Andricdef  VPADDi32 : N3VDInt<0, 0, 0b10, 0b1011, 1, N3RegFrm, IIC_VSHLiD,
56990b57cec5SDimitry Andric                        "vpadd", "i32",
57000b57cec5SDimitry Andric                        v2i32, v2i32, int_arm_neon_vpadd, 0>;
57010b57cec5SDimitry Andricdef  VPADDf   : N3VDInt<1, 0, 0b00, 0b1101, 0, N3RegFrm,
57020b57cec5SDimitry Andric                        IIC_VPBIND, "vpadd", "f32",
57030b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vpadd, 0>;
57040b57cec5SDimitry Andricdef  VPADDh   : N3VDInt<1, 0, 0b01, 0b1101, 0, N3RegFrm,
57050b57cec5SDimitry Andric                        IIC_VPBIND, "vpadd", "f16",
57060b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vpadd, 0>,
57070b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57080b57cec5SDimitry Andric
57090b57cec5SDimitry Andric//   VPADDL   : Vector Pairwise Add Long
57100b57cec5SDimitry Andricdefm VPADDLs  : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00100, 0, "vpaddl", "s",
57110b57cec5SDimitry Andric                             int_arm_neon_vpaddls>;
57120b57cec5SDimitry Andricdefm VPADDLu  : N2VPLInt_QHS<0b11, 0b11, 0b00, 0b00101, 0, "vpaddl", "u",
57130b57cec5SDimitry Andric                             int_arm_neon_vpaddlu>;
57140b57cec5SDimitry Andric
57150b57cec5SDimitry Andric//   VPADAL   : Vector Pairwise Add and Accumulate Long
57160b57cec5SDimitry Andricdefm VPADALs  : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01100, 0, "vpadal", "s",
57170b57cec5SDimitry Andric                              int_arm_neon_vpadals>;
57180b57cec5SDimitry Andricdefm VPADALu  : N2VPLInt2_QHS<0b11, 0b11, 0b00, 0b01101, 0, "vpadal", "u",
57190b57cec5SDimitry Andric                              int_arm_neon_vpadalu>;
57200b57cec5SDimitry Andric
57210b57cec5SDimitry Andric//   VPMAX    : Vector Pairwise Maximum
57220b57cec5SDimitry Andricdef  VPMAXs8  : N3VDInt<0, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57230b57cec5SDimitry Andric                        "s8", v8i8, v8i8, int_arm_neon_vpmaxs, 0>;
57240b57cec5SDimitry Andricdef  VPMAXs16 : N3VDInt<0, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57250b57cec5SDimitry Andric                        "s16", v4i16, v4i16, int_arm_neon_vpmaxs, 0>;
57260b57cec5SDimitry Andricdef  VPMAXs32 : N3VDInt<0, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57270b57cec5SDimitry Andric                        "s32", v2i32, v2i32, int_arm_neon_vpmaxs, 0>;
57280b57cec5SDimitry Andricdef  VPMAXu8  : N3VDInt<1, 0, 0b00, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57290b57cec5SDimitry Andric                        "u8", v8i8, v8i8, int_arm_neon_vpmaxu, 0>;
57300b57cec5SDimitry Andricdef  VPMAXu16 : N3VDInt<1, 0, 0b01, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57310b57cec5SDimitry Andric                        "u16", v4i16, v4i16, int_arm_neon_vpmaxu, 0>;
57320b57cec5SDimitry Andricdef  VPMAXu32 : N3VDInt<1, 0, 0b10, 0b1010, 0, N3RegFrm, IIC_VSUBi4D, "vpmax",
57330b57cec5SDimitry Andric                        "u32", v2i32, v2i32, int_arm_neon_vpmaxu, 0>;
57340b57cec5SDimitry Andricdef  VPMAXf   : N3VDInt<1, 0, 0b00, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
57350b57cec5SDimitry Andric                        "f32", v2f32, v2f32, int_arm_neon_vpmaxs, 0>;
57360b57cec5SDimitry Andricdef  VPMAXh   : N3VDInt<1, 0, 0b01, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmax",
57370b57cec5SDimitry Andric                        "f16", v4f16, v4f16, int_arm_neon_vpmaxs, 0>,
57380b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57390b57cec5SDimitry Andric
57400b57cec5SDimitry Andric//   VPMIN    : Vector Pairwise Minimum
57410b57cec5SDimitry Andricdef  VPMINs8  : N3VDInt<0, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57420b57cec5SDimitry Andric                        "s8", v8i8, v8i8, int_arm_neon_vpmins, 0>;
57430b57cec5SDimitry Andricdef  VPMINs16 : N3VDInt<0, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57440b57cec5SDimitry Andric                        "s16", v4i16, v4i16, int_arm_neon_vpmins, 0>;
57450b57cec5SDimitry Andricdef  VPMINs32 : N3VDInt<0, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57460b57cec5SDimitry Andric                        "s32", v2i32, v2i32, int_arm_neon_vpmins, 0>;
57470b57cec5SDimitry Andricdef  VPMINu8  : N3VDInt<1, 0, 0b00, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57480b57cec5SDimitry Andric                        "u8", v8i8, v8i8, int_arm_neon_vpminu, 0>;
57490b57cec5SDimitry Andricdef  VPMINu16 : N3VDInt<1, 0, 0b01, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57500b57cec5SDimitry Andric                        "u16", v4i16, v4i16, int_arm_neon_vpminu, 0>;
57510b57cec5SDimitry Andricdef  VPMINu32 : N3VDInt<1, 0, 0b10, 0b1010, 1, N3RegFrm, IIC_VSUBi4D, "vpmin",
57520b57cec5SDimitry Andric                        "u32", v2i32, v2i32, int_arm_neon_vpminu, 0>;
57530b57cec5SDimitry Andricdef  VPMINf   : N3VDInt<1, 0, 0b10, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
57540b57cec5SDimitry Andric                        "f32", v2f32, v2f32, int_arm_neon_vpmins, 0>;
57550b57cec5SDimitry Andricdef  VPMINh   : N3VDInt<1, 0, 0b11, 0b1111, 0, N3RegFrm, IIC_VPBIND, "vpmin",
57560b57cec5SDimitry Andric                        "f16", v4f16, v4f16, int_arm_neon_vpmins, 0>,
57570b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57580b57cec5SDimitry Andric
57590b57cec5SDimitry Andric// Vector Reciprocal and Reciprocal Square Root Estimate and Step.
57600b57cec5SDimitry Andric
57610b57cec5SDimitry Andric//   VRECPE   : Vector Reciprocal Estimate
57620b57cec5SDimitry Andricdef  VRECPEd  : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
57630b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "u32",
57640b57cec5SDimitry Andric                        v2i32, v2i32, int_arm_neon_vrecpe>;
57650b57cec5SDimitry Andricdef  VRECPEq  : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01000, 0,
57660b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "u32",
57670b57cec5SDimitry Andric                        v4i32, v4i32, int_arm_neon_vrecpe>;
57680b57cec5SDimitry Andricdef  VRECPEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
57690b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "f32",
57700b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrecpe>;
57710b57cec5SDimitry Andricdef  VRECPEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01010, 0,
57720b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "f32",
57730b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrecpe>;
57740b57cec5SDimitry Andricdef  VRECPEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
57750b57cec5SDimitry Andric                        IIC_VUNAD, "vrecpe", "f16",
57760b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrecpe>,
57770b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57780b57cec5SDimitry Andricdef  VRECPEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01010, 0,
57790b57cec5SDimitry Andric                        IIC_VUNAQ, "vrecpe", "f16",
57800b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrecpe>,
57810b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57820b57cec5SDimitry Andric
57830b57cec5SDimitry Andric//   VRECPS   : Vector Reciprocal Step
57840b57cec5SDimitry Andricdef  VRECPSfd : N3VDInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
57850b57cec5SDimitry Andric                        IIC_VRECSD, "vrecps", "f32",
57860b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrecps, 1>;
57870b57cec5SDimitry Andricdef  VRECPSfq : N3VQInt<0, 0, 0b00, 0b1111, 1, N3RegFrm,
57880b57cec5SDimitry Andric                        IIC_VRECSQ, "vrecps", "f32",
57890b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrecps, 1>;
57900b57cec5SDimitry Andricdef  VRECPShd : N3VDInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
57910b57cec5SDimitry Andric                        IIC_VRECSD, "vrecps", "f16",
57920b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrecps, 1>,
57930b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57940b57cec5SDimitry Andricdef  VRECPShq : N3VQInt<0, 0, 0b01, 0b1111, 1, N3RegFrm,
57950b57cec5SDimitry Andric                        IIC_VRECSQ, "vrecps", "f16",
57960b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrecps, 1>,
57970b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
57980b57cec5SDimitry Andric
57990b57cec5SDimitry Andric//   VRSQRTE  : Vector Reciprocal Square Root Estimate
58000b57cec5SDimitry Andricdef  VRSQRTEd  : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
58010b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "u32",
58020b57cec5SDimitry Andric                         v2i32, v2i32, int_arm_neon_vrsqrte>;
58030b57cec5SDimitry Andricdef  VRSQRTEq  : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01001, 0,
58040b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "u32",
58050b57cec5SDimitry Andric                         v4i32, v4i32, int_arm_neon_vrsqrte>;
58060b57cec5SDimitry Andricdef  VRSQRTEfd : N2VDInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
58070b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "f32",
58080b57cec5SDimitry Andric                         v2f32, v2f32, int_arm_neon_vrsqrte>;
58090b57cec5SDimitry Andricdef  VRSQRTEfq : N2VQInt<0b11, 0b11, 0b10, 0b11, 0b01011, 0,
58100b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "f32",
58110b57cec5SDimitry Andric                         v4f32, v4f32, int_arm_neon_vrsqrte>;
58120b57cec5SDimitry Andricdef  VRSQRTEhd : N2VDInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
58130b57cec5SDimitry Andric                         IIC_VUNAD, "vrsqrte", "f16",
58140b57cec5SDimitry Andric                         v4f16, v4f16, int_arm_neon_vrsqrte>,
58150b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58160b57cec5SDimitry Andricdef  VRSQRTEhq : N2VQInt<0b11, 0b11, 0b01, 0b11, 0b01011, 0,
58170b57cec5SDimitry Andric                         IIC_VUNAQ, "vrsqrte", "f16",
58180b57cec5SDimitry Andric                         v8f16, v8f16, int_arm_neon_vrsqrte>,
58190b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58200b57cec5SDimitry Andric
58210b57cec5SDimitry Andric//   VRSQRTS  : Vector Reciprocal Square Root Step
58220b57cec5SDimitry Andricdef VRSQRTSfd : N3VDInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
58230b57cec5SDimitry Andric                        IIC_VRECSD, "vrsqrts", "f32",
58240b57cec5SDimitry Andric                        v2f32, v2f32, int_arm_neon_vrsqrts, 1>;
58250b57cec5SDimitry Andricdef VRSQRTSfq : N3VQInt<0, 0, 0b10, 0b1111, 1, N3RegFrm,
58260b57cec5SDimitry Andric                        IIC_VRECSQ, "vrsqrts", "f32",
58270b57cec5SDimitry Andric                        v4f32, v4f32, int_arm_neon_vrsqrts, 1>;
58280b57cec5SDimitry Andricdef VRSQRTShd : N3VDInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
58290b57cec5SDimitry Andric                        IIC_VRECSD, "vrsqrts", "f16",
58300b57cec5SDimitry Andric                        v4f16, v4f16, int_arm_neon_vrsqrts, 1>,
58310b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58320b57cec5SDimitry Andricdef VRSQRTShq : N3VQInt<0, 0, 0b11, 0b1111, 1, N3RegFrm,
58330b57cec5SDimitry Andric                        IIC_VRECSQ, "vrsqrts", "f16",
58340b57cec5SDimitry Andric                        v8f16, v8f16, int_arm_neon_vrsqrts, 1>,
58350b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
58360b57cec5SDimitry Andric
58370b57cec5SDimitry Andric// Vector Shifts.
58380b57cec5SDimitry Andric
58390b57cec5SDimitry Andric//   VSHL     : Vector Shift
58400b57cec5SDimitry Andricdefm VSHLs    : N3VInt_QHSDSh<0, 0, 0b0100, 0, N3RegVShFrm,
58410b57cec5SDimitry Andric                            IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
58420b57cec5SDimitry Andric                            "vshl", "s", int_arm_neon_vshifts>;
58430b57cec5SDimitry Andricdefm VSHLu    : N3VInt_QHSDSh<1, 0, 0b0100, 0, N3RegVShFrm,
58440b57cec5SDimitry Andric                            IIC_VSHLiD, IIC_VSHLiD, IIC_VSHLiQ, IIC_VSHLiQ,
58450b57cec5SDimitry Andric                            "vshl", "u", int_arm_neon_vshiftu>;
58460b57cec5SDimitry Andric
58470b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
58480b57cec5SDimitry Andricdef : Pat<(v8i8 (ARMvshls (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
58490b57cec5SDimitry Andric          (VSHLsv8i8 DPR:$Dn, DPR:$Dm)>;
58500b57cec5SDimitry Andricdef : Pat<(v4i16 (ARMvshls (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
58510b57cec5SDimitry Andric          (VSHLsv4i16 DPR:$Dn, DPR:$Dm)>;
58520b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvshls (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
58530b57cec5SDimitry Andric          (VSHLsv2i32 DPR:$Dn, DPR:$Dm)>;
58540b57cec5SDimitry Andricdef : Pat<(v1i64 (ARMvshls (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
58550b57cec5SDimitry Andric          (VSHLsv1i64 DPR:$Dn, DPR:$Dm)>;
58560b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvshls (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
58570b57cec5SDimitry Andric          (VSHLsv16i8 QPR:$Dn, QPR:$Dm)>;
58580b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshls (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
58590b57cec5SDimitry Andric          (VSHLsv8i16 QPR:$Dn, QPR:$Dm)>;
58600b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshls (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
58610b57cec5SDimitry Andric          (VSHLsv4i32 QPR:$Dn, QPR:$Dm)>;
58620b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshls (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
58630b57cec5SDimitry Andric          (VSHLsv2i64 QPR:$Dn, QPR:$Dm)>;
58640b57cec5SDimitry Andric
58650b57cec5SDimitry Andricdef : Pat<(v8i8 (ARMvshlu (v8i8 DPR:$Dn), (v8i8 DPR:$Dm))),
58660b57cec5SDimitry Andric          (VSHLuv8i8 DPR:$Dn, DPR:$Dm)>;
58670b57cec5SDimitry Andricdef : Pat<(v4i16 (ARMvshlu (v4i16 DPR:$Dn), (v4i16 DPR:$Dm))),
58680b57cec5SDimitry Andric          (VSHLuv4i16 DPR:$Dn, DPR:$Dm)>;
58690b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvshlu (v2i32 DPR:$Dn), (v2i32 DPR:$Dm))),
58700b57cec5SDimitry Andric          (VSHLuv2i32 DPR:$Dn, DPR:$Dm)>;
58710b57cec5SDimitry Andricdef : Pat<(v1i64 (ARMvshlu (v1i64 DPR:$Dn), (v1i64 DPR:$Dm))),
58720b57cec5SDimitry Andric          (VSHLuv1i64 DPR:$Dn, DPR:$Dm)>;
58730b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvshlu (v16i8 QPR:$Dn), (v16i8 QPR:$Dm))),
58740b57cec5SDimitry Andric          (VSHLuv16i8 QPR:$Dn, QPR:$Dm)>;
58750b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlu (v8i16 QPR:$Dn), (v8i16 QPR:$Dm))),
58760b57cec5SDimitry Andric          (VSHLuv8i16 QPR:$Dn, QPR:$Dm)>;
58770b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlu (v4i32 QPR:$Dn), (v4i32 QPR:$Dm))),
58780b57cec5SDimitry Andric          (VSHLuv4i32 QPR:$Dn, QPR:$Dm)>;
58790b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlu (v2i64 QPR:$Dn), (v2i64 QPR:$Dm))),
58800b57cec5SDimitry Andric          (VSHLuv2i64 QPR:$Dn, QPR:$Dm)>;
58810b57cec5SDimitry Andric
58820b57cec5SDimitry Andric}
58830b57cec5SDimitry Andric
58840b57cec5SDimitry Andric//   VSHL     : Vector Shift Left (Immediate)
58850b57cec5SDimitry Andricdefm VSHLi    : N2VShL_QHSD<0, 1, 0b0101, 1, IIC_VSHLiD, "vshl", "i", ARMvshlImm>;
58860b57cec5SDimitry Andric
58870b57cec5SDimitry Andric//   VSHR     : Vector Shift Right (Immediate)
58880b57cec5SDimitry Andricdefm VSHRs    : N2VShR_QHSD<0, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "s", "VSHRs",
58890b57cec5SDimitry Andric                            ARMvshrsImm>;
58900b57cec5SDimitry Andricdefm VSHRu    : N2VShR_QHSD<1, 1, 0b0000, 1, IIC_VSHLiD, "vshr", "u", "VSHRu",
58910b57cec5SDimitry Andric                            ARMvshruImm>;
58920b57cec5SDimitry Andric
58930b57cec5SDimitry Andric//   VSHLL    : Vector Shift Left Long
58940b57cec5SDimitry Andricdefm VSHLLs   : N2VLSh_QHS<0, 1, 0b1010, 0, 0, 1, "vshll", "s",
58950b57cec5SDimitry Andric  PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (sext node:$LHS), node:$RHS)>>;
58960b57cec5SDimitry Andricdefm VSHLLu   : N2VLSh_QHS<1, 1, 0b1010, 0, 0, 1, "vshll", "u",
58970b57cec5SDimitry Andric  PatFrag<(ops node:$LHS, node:$RHS), (ARMvshlImm (zext node:$LHS), node:$RHS)>>;
58980b57cec5SDimitry Andric
58990b57cec5SDimitry Andric//   VSHLL    : Vector Shift Left Long (with maximum shift count)
59000b57cec5SDimitry Andricclass N2VLShMax<bit op24, bit op23, bits<6> op21_16, bits<4> op11_8, bit op7,
59010b57cec5SDimitry Andric                bit op6, bit op4, string OpcodeStr, string Dt, ValueType ResTy,
59020b57cec5SDimitry Andric                ValueType OpTy, Operand ImmTy>
59030b57cec5SDimitry Andric  : N2VLSh<op24, op23, op11_8, op7, op6, op4, OpcodeStr, Dt,
59040b57cec5SDimitry Andric           ResTy, OpTy, ImmTy, null_frag> {
59050b57cec5SDimitry Andric  let Inst{21-16} = op21_16;
59060b57cec5SDimitry Andric  let DecoderMethod = "DecodeVSHLMaxInstruction";
59070b57cec5SDimitry Andric}
59080b57cec5SDimitry Andricdef  VSHLLi8  : N2VLShMax<1, 1, 0b110010, 0b0011, 0, 0, 0, "vshll", "i8",
59090b57cec5SDimitry Andric                          v8i16, v8i8, imm8>;
59100b57cec5SDimitry Andricdef  VSHLLi16 : N2VLShMax<1, 1, 0b110110, 0b0011, 0, 0, 0, "vshll", "i16",
59110b57cec5SDimitry Andric                          v4i32, v4i16, imm16>;
59120b57cec5SDimitry Andricdef  VSHLLi32 : N2VLShMax<1, 1, 0b111010, 0b0011, 0, 0, 0, "vshll", "i32",
59130b57cec5SDimitry Andric                          v2i64, v2i32, imm32>;
59140b57cec5SDimitry Andric
59150b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
59160b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (zext (v8i8 DPR:$Rn)), (i32 8))),
59170b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
59180b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (zext (v4i16 DPR:$Rn)), (i32 16))),
59190b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
59200b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (zext (v2i32 DPR:$Rn)), (i32 32))),
59210b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
59220b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (sext (v8i8 DPR:$Rn)), (i32 8))),
59230b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
59240b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (sext (v4i16 DPR:$Rn)), (i32 16))),
59250b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
59260b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (sext (v2i32 DPR:$Rn)), (i32 32))),
59270b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
59280b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvshlImm (anyext (v8i8 DPR:$Rn)), (i32 8))),
59290b57cec5SDimitry Andric          (VSHLLi8 DPR:$Rn, 8)>;
59300b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvshlImm (anyext (v4i16 DPR:$Rn)), (i32 16))),
59310b57cec5SDimitry Andric          (VSHLLi16 DPR:$Rn, 16)>;
59320b57cec5SDimitry Andricdef : Pat<(v2i64 (ARMvshlImm (anyext (v2i32 DPR:$Rn)), (i32 32))),
59330b57cec5SDimitry Andric          (VSHLLi32 DPR:$Rn, 32)>;
59340b57cec5SDimitry Andric}
59350b57cec5SDimitry Andric
59360b57cec5SDimitry Andric//   VSHRN    : Vector Shift Right and Narrow
59370b57cec5SDimitry Andricdefm VSHRN    : N2VNSh_HSD<0,1,0b1000,0,0,1, IIC_VSHLiD, "vshrn", "i",
59380b57cec5SDimitry Andric                           PatFrag<(ops node:$Rn, node:$amt),
59390b57cec5SDimitry Andric                                   (trunc (ARMvshrsImm node:$Rn, node:$amt))>>;
59400b57cec5SDimitry Andric
59410b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
59420b57cec5SDimitry Andricdef : Pat<(v8i8 (trunc (ARMvshruImm (v8i16 QPR:$Vn), shr_imm8:$amt))),
59430b57cec5SDimitry Andric          (VSHRNv8i8 QPR:$Vn, shr_imm8:$amt)>;
59440b57cec5SDimitry Andricdef : Pat<(v4i16 (trunc (ARMvshruImm (v4i32 QPR:$Vn), shr_imm16:$amt))),
59450b57cec5SDimitry Andric          (VSHRNv4i16 QPR:$Vn, shr_imm16:$amt)>;
59460b57cec5SDimitry Andricdef : Pat<(v2i32 (trunc (ARMvshruImm (v2i64 QPR:$Vn), shr_imm32:$amt))),
59470b57cec5SDimitry Andric          (VSHRNv2i32 QPR:$Vn, shr_imm32:$amt)>;
59480b57cec5SDimitry Andric}
59490b57cec5SDimitry Andric
59500b57cec5SDimitry Andric//   VRSHL    : Vector Rounding Shift
59510b57cec5SDimitry Andricdefm VRSHLs   : N3VInt_QHSDSh<0, 0, 0b0101, 0, N3RegVShFrm,
59520b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59530b57cec5SDimitry Andric                            "vrshl", "s", int_arm_neon_vrshifts>;
59540b57cec5SDimitry Andricdefm VRSHLu   : N3VInt_QHSDSh<1, 0, 0b0101, 0, N3RegVShFrm,
59550b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59560b57cec5SDimitry Andric                            "vrshl", "u", int_arm_neon_vrshiftu>;
59570b57cec5SDimitry Andric//   VRSHR    : Vector Rounding Shift Right
59580b57cec5SDimitry Andricdefm VRSHRs   : N2VShR_QHSD<0,1,0b0010,1, IIC_VSHLi4D, "vrshr", "s", "VRSHRs",
59590b57cec5SDimitry Andric                            NEONvrshrsImm>;
59600b57cec5SDimitry Andricdefm VRSHRu   : N2VShR_QHSD<1,1,0b0010,1, IIC_VSHLi4D, "vrshr", "u", "VRSHRu",
59610b57cec5SDimitry Andric                            NEONvrshruImm>;
59620b57cec5SDimitry Andric
59630b57cec5SDimitry Andric//   VRSHRN   : Vector Rounding Shift Right and Narrow
59640b57cec5SDimitry Andricdefm VRSHRN   : N2VNSh_HSD<0, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vrshrn", "i",
59650b57cec5SDimitry Andric                           NEONvrshrnImm>;
59660b57cec5SDimitry Andric
59670b57cec5SDimitry Andric//   VQSHL    : Vector Saturating Shift
59680b57cec5SDimitry Andricdefm VQSHLs   : N3VInt_QHSDSh<0, 0, 0b0100, 1, N3RegVShFrm,
59690b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59700b57cec5SDimitry Andric                            "vqshl", "s", int_arm_neon_vqshifts>;
59710b57cec5SDimitry Andricdefm VQSHLu   : N3VInt_QHSDSh<1, 0, 0b0100, 1, N3RegVShFrm,
59720b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59730b57cec5SDimitry Andric                            "vqshl", "u", int_arm_neon_vqshiftu>;
59740b57cec5SDimitry Andric//   VQSHL    : Vector Saturating Shift Left (Immediate)
59750b57cec5SDimitry Andricdefm VQSHLsi  : N2VShL_QHSD<0,1,0b0111,1, IIC_VSHLi4D, "vqshl", "s",NEONvqshlsImm>;
59760b57cec5SDimitry Andricdefm VQSHLui  : N2VShL_QHSD<1,1,0b0111,1, IIC_VSHLi4D, "vqshl", "u",NEONvqshluImm>;
59770b57cec5SDimitry Andric
59780b57cec5SDimitry Andric//   VQSHLU   : Vector Saturating Shift Left (Immediate, Unsigned)
59790b57cec5SDimitry Andricdefm VQSHLsu  : N2VShL_QHSD<1,1,0b0110,1, IIC_VSHLi4D,"vqshlu","s",NEONvqshlsuImm>;
59800b57cec5SDimitry Andric
59810b57cec5SDimitry Andric//   VQSHRN   : Vector Saturating Shift Right and Narrow
59820b57cec5SDimitry Andricdefm VQSHRNs  : N2VNSh_HSD<0, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "s",
59830b57cec5SDimitry Andric                           NEONvqshrnsImm>;
59840b57cec5SDimitry Andricdefm VQSHRNu  : N2VNSh_HSD<1, 1, 0b1001, 0, 0, 1, IIC_VSHLi4D, "vqshrn", "u",
59850b57cec5SDimitry Andric                           NEONvqshrnuImm>;
59860b57cec5SDimitry Andric
59870b57cec5SDimitry Andric//   VQSHRUN  : Vector Saturating Shift Right and Narrow (Unsigned)
59880b57cec5SDimitry Andricdefm VQSHRUN  : N2VNSh_HSD<1, 1, 0b1000, 0, 0, 1, IIC_VSHLi4D, "vqshrun", "s",
59890b57cec5SDimitry Andric                           NEONvqshrnsuImm>;
59900b57cec5SDimitry Andric
59910b57cec5SDimitry Andric//   VQRSHL   : Vector Saturating Rounding Shift
59920b57cec5SDimitry Andricdefm VQRSHLs  : N3VInt_QHSDSh<0, 0, 0b0101, 1, N3RegVShFrm,
59930b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59940b57cec5SDimitry Andric                            "vqrshl", "s", int_arm_neon_vqrshifts>;
59950b57cec5SDimitry Andricdefm VQRSHLu  : N3VInt_QHSDSh<1, 0, 0b0101, 1, N3RegVShFrm,
59960b57cec5SDimitry Andric                            IIC_VSHLi4D, IIC_VSHLi4D, IIC_VSHLi4Q, IIC_VSHLi4Q,
59970b57cec5SDimitry Andric                            "vqrshl", "u", int_arm_neon_vqrshiftu>;
59980b57cec5SDimitry Andric
59990b57cec5SDimitry Andric//   VQRSHRN  : Vector Saturating Rounding Shift Right and Narrow
60000b57cec5SDimitry Andricdefm VQRSHRNs : N2VNSh_HSD<0, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "s",
60010b57cec5SDimitry Andric                           NEONvqrshrnsImm>;
60020b57cec5SDimitry Andricdefm VQRSHRNu : N2VNSh_HSD<1, 1, 0b1001, 0, 1, 1, IIC_VSHLi4D, "vqrshrn", "u",
60030b57cec5SDimitry Andric                           NEONvqrshrnuImm>;
60040b57cec5SDimitry Andric
60050b57cec5SDimitry Andric//   VQRSHRUN : Vector Saturating Rounding Shift Right and Narrow (Unsigned)
60060b57cec5SDimitry Andricdefm VQRSHRUN : N2VNSh_HSD<1, 1, 0b1000, 0, 1, 1, IIC_VSHLi4D, "vqrshrun", "s",
60070b57cec5SDimitry Andric                           NEONvqrshrnsuImm>;
60080b57cec5SDimitry Andric
60090b57cec5SDimitry Andric//   VSRA     : Vector Shift Right and Accumulate
60100b57cec5SDimitry Andricdefm VSRAs    : N2VShAdd_QHSD<0, 1, 0b0001, 1, "vsra", "s", ARMvshrsImm>;
60110b57cec5SDimitry Andricdefm VSRAu    : N2VShAdd_QHSD<1, 1, 0b0001, 1, "vsra", "u", ARMvshruImm>;
60120b57cec5SDimitry Andric//   VRSRA    : Vector Rounding Shift Right and Accumulate
60130b57cec5SDimitry Andricdefm VRSRAs   : N2VShAdd_QHSD<0, 1, 0b0011, 1, "vrsra", "s", NEONvrshrsImm>;
60140b57cec5SDimitry Andricdefm VRSRAu   : N2VShAdd_QHSD<1, 1, 0b0011, 1, "vrsra", "u", NEONvrshruImm>;
60150b57cec5SDimitry Andric
60160b57cec5SDimitry Andric//   VSLI     : Vector Shift Left and Insert
60170b57cec5SDimitry Andricdefm VSLI     : N2VShInsL_QHSD<1, 1, 0b0101, 1, "vsli">;
60180b57cec5SDimitry Andric
60190b57cec5SDimitry Andric//   VSRI     : Vector Shift Right and Insert
60200b57cec5SDimitry Andricdefm VSRI     : N2VShInsR_QHSD<1, 1, 0b0100, 1, "vsri">;
60210b57cec5SDimitry Andric
60220b57cec5SDimitry Andric// Vector Absolute and Saturating Absolute.
60230b57cec5SDimitry Andric
60240b57cec5SDimitry Andric//   VABS     : Vector Absolute Value
60250b57cec5SDimitry Andricdefm VABS     : N2VInt_QHS<0b11, 0b11, 0b01, 0b00110, 0,
60260b57cec5SDimitry Andric                           IIC_VUNAiD, IIC_VUNAiQ, "vabs", "s", abs>;
60270b57cec5SDimitry Andricdef  VABSfd   : N2VD<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
60280b57cec5SDimitry Andric                     "vabs", "f32",
60290b57cec5SDimitry Andric                     v2f32, v2f32, fabs>;
60300b57cec5SDimitry Andricdef  VABSfq   : N2VQ<0b11, 0b11, 0b10, 0b01, 0b01110, 0,
60310b57cec5SDimitry Andric                     "vabs", "f32",
60320b57cec5SDimitry Andric                      v4f32, v4f32, fabs>;
60330b57cec5SDimitry Andricdef  VABShd   : N2VD<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
60340b57cec5SDimitry Andric                     "vabs", "f16",
60350b57cec5SDimitry Andric                     v4f16, v4f16, fabs>,
60360b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
60370b57cec5SDimitry Andricdef  VABShq   : N2VQ<0b11, 0b11, 0b01, 0b01, 0b01110, 0,
60380b57cec5SDimitry Andric                     "vabs", "f16",
60390b57cec5SDimitry Andric                      v8f16, v8f16, fabs>,
60400b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
60410b57cec5SDimitry Andric
60420b57cec5SDimitry Andric//   VQABS    : Vector Saturating Absolute Value
60430b57cec5SDimitry Andricdefm VQABS    : N2VInt_QHS<0b11, 0b11, 0b00, 0b01110, 0,
60440b57cec5SDimitry Andric                           IIC_VQUNAiD, IIC_VQUNAiQ, "vqabs", "s",
60450b57cec5SDimitry Andric                           int_arm_neon_vqabs>;
60460b57cec5SDimitry Andric
60470b57cec5SDimitry Andric// Vector Negate.
60480b57cec5SDimitry Andric
60490b57cec5SDimitry Andricdef vnegd  : PatFrag<(ops node:$in),
60500b57cec5SDimitry Andric                     (sub (bitconvert (v2i32 NEONimmAllZerosV)), node:$in)>;
60510b57cec5SDimitry Andricdef vnegq  : PatFrag<(ops node:$in),
60520b57cec5SDimitry Andric                     (sub (bitconvert (v4i32 NEONimmAllZerosV)), node:$in)>;
60530b57cec5SDimitry Andric
60540b57cec5SDimitry Andricclass VNEGD<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
60550b57cec5SDimitry Andric  : N2V<0b11, 0b11, size, 0b01, 0b00111, 0, 0, (outs DPR:$Vd), (ins DPR:$Vm),
60560b57cec5SDimitry Andric        IIC_VSHLiD, OpcodeStr, Dt, "$Vd, $Vm", "",
60570b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (vnegd DPR:$Vm)))]>;
60580b57cec5SDimitry Andricclass VNEGQ<bits<2> size, string OpcodeStr, string Dt, ValueType Ty>
60590b57cec5SDimitry Andric  : N2V<0b11, 0b11, size, 0b01, 0b00111, 1, 0, (outs QPR:$Vd), (ins QPR:$Vm),
60600b57cec5SDimitry Andric        IIC_VSHLiQ, OpcodeStr, Dt, "$Vd, $Vm", "",
60610b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (vnegq QPR:$Vm)))]>;
60620b57cec5SDimitry Andric
60630b57cec5SDimitry Andric//   VNEG     : Vector Negate (integer)
60640b57cec5SDimitry Andricdef  VNEGs8d  : VNEGD<0b00, "vneg", "s8", v8i8>;
60650b57cec5SDimitry Andricdef  VNEGs16d : VNEGD<0b01, "vneg", "s16", v4i16>;
60660b57cec5SDimitry Andricdef  VNEGs32d : VNEGD<0b10, "vneg", "s32", v2i32>;
60670b57cec5SDimitry Andricdef  VNEGs8q  : VNEGQ<0b00, "vneg", "s8", v16i8>;
60680b57cec5SDimitry Andricdef  VNEGs16q : VNEGQ<0b01, "vneg", "s16", v8i16>;
60690b57cec5SDimitry Andricdef  VNEGs32q : VNEGQ<0b10, "vneg", "s32", v4i32>;
60700b57cec5SDimitry Andric
60710b57cec5SDimitry Andric//   VNEG     : Vector Negate (floating-point)
60720b57cec5SDimitry Andricdef  VNEGfd   : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 0, 0,
60730b57cec5SDimitry Andric                    (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
60740b57cec5SDimitry Andric                    "vneg", "f32", "$Vd, $Vm", "",
60750b57cec5SDimitry Andric                    [(set DPR:$Vd, (v2f32 (fneg DPR:$Vm)))]>;
60760b57cec5SDimitry Andricdef  VNEGf32q : N2V<0b11, 0b11, 0b10, 0b01, 0b01111, 1, 0,
60770b57cec5SDimitry Andric                    (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
60780b57cec5SDimitry Andric                    "vneg", "f32", "$Vd, $Vm", "",
60790b57cec5SDimitry Andric                    [(set QPR:$Vd, (v4f32 (fneg QPR:$Vm)))]>;
60800b57cec5SDimitry Andricdef  VNEGhd   : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 0, 0,
60810b57cec5SDimitry Andric                    (outs DPR:$Vd), (ins DPR:$Vm), IIC_VUNAD,
60820b57cec5SDimitry Andric                    "vneg", "f16", "$Vd, $Vm", "",
60830b57cec5SDimitry Andric                    [(set DPR:$Vd, (v4f16 (fneg DPR:$Vm)))]>,
60840b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
60850b57cec5SDimitry Andricdef  VNEGhq   : N2V<0b11, 0b11, 0b01, 0b01, 0b01111, 1, 0,
60860b57cec5SDimitry Andric                    (outs QPR:$Vd), (ins QPR:$Vm), IIC_VUNAQ,
60870b57cec5SDimitry Andric                    "vneg", "f16", "$Vd, $Vm", "",
60880b57cec5SDimitry Andric                    [(set QPR:$Vd, (v8f16 (fneg QPR:$Vm)))]>,
60890b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
60900b57cec5SDimitry Andric
60910b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
60920b57cec5SDimitry Andricdef : Pat<(v8i8  (vnegd  DPR:$src)), (VNEGs8d DPR:$src)>;
60930b57cec5SDimitry Andricdef : Pat<(v4i16 (vnegd  DPR:$src)), (VNEGs16d DPR:$src)>;
60940b57cec5SDimitry Andricdef : Pat<(v2i32 (vnegd  DPR:$src)), (VNEGs32d DPR:$src)>;
60950b57cec5SDimitry Andricdef : Pat<(v16i8 (vnegq QPR:$src)), (VNEGs8q QPR:$src)>;
60960b57cec5SDimitry Andricdef : Pat<(v8i16 (vnegq QPR:$src)), (VNEGs16q QPR:$src)>;
60970b57cec5SDimitry Andricdef : Pat<(v4i32 (vnegq QPR:$src)), (VNEGs32q QPR:$src)>;
60980b57cec5SDimitry Andric}
60990b57cec5SDimitry Andric
61000b57cec5SDimitry Andric//   VQNEG    : Vector Saturating Negate
61010b57cec5SDimitry Andricdefm VQNEG    : N2VInt_QHS<0b11, 0b11, 0b00, 0b01111, 0,
61020b57cec5SDimitry Andric                           IIC_VQUNAiD, IIC_VQUNAiQ, "vqneg", "s",
61030b57cec5SDimitry Andric                           int_arm_neon_vqneg>;
61040b57cec5SDimitry Andric
61050b57cec5SDimitry Andric// Vector Bit Counting Operations.
61060b57cec5SDimitry Andric
61070b57cec5SDimitry Andric//   VCLS     : Vector Count Leading Sign Bits
61080b57cec5SDimitry Andricdefm VCLS     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01000, 0,
61090b57cec5SDimitry Andric                           IIC_VCNTiD, IIC_VCNTiQ, "vcls", "s",
61100b57cec5SDimitry Andric                           int_arm_neon_vcls>;
61110b57cec5SDimitry Andric//   VCLZ     : Vector Count Leading Zeros
61120b57cec5SDimitry Andricdefm VCLZ     : N2VInt_QHS<0b11, 0b11, 0b00, 0b01001, 0,
61130b57cec5SDimitry Andric                           IIC_VCNTiD, IIC_VCNTiQ, "vclz", "i",
61140b57cec5SDimitry Andric                           ctlz>;
61150b57cec5SDimitry Andric//   VCNT     : Vector Count One Bits
61160b57cec5SDimitry Andricdef  VCNTd    : N2VDInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
61170b57cec5SDimitry Andric                        IIC_VCNTiD, "vcnt", "8",
61180b57cec5SDimitry Andric                        v8i8, v8i8, ctpop>;
61190b57cec5SDimitry Andricdef  VCNTq    : N2VQInt<0b11, 0b11, 0b00, 0b00, 0b01010, 0,
61200b57cec5SDimitry Andric                        IIC_VCNTiQ, "vcnt", "8",
61210b57cec5SDimitry Andric                        v16i8, v16i8, ctpop>;
61220b57cec5SDimitry Andric
61230b57cec5SDimitry Andric// Vector Swap
61240b57cec5SDimitry Andricdef  VSWPd    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 0, 0,
61250b57cec5SDimitry Andric                     (outs DPR:$Vd, DPR:$Vm), (ins DPR:$in1, DPR:$in2),
61260b57cec5SDimitry Andric                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
61270b57cec5SDimitry Andric                     []>;
61280b57cec5SDimitry Andricdef  VSWPq    : N2VX<0b11, 0b11, 0b00, 0b10, 0b00000, 1, 0,
61290b57cec5SDimitry Andric                     (outs QPR:$Vd, QPR:$Vm), (ins QPR:$in1, QPR:$in2),
61300b57cec5SDimitry Andric                     NoItinerary, "vswp", "$Vd, $Vm", "$in1 = $Vd, $in2 = $Vm",
61310b57cec5SDimitry Andric                     []>;
61320b57cec5SDimitry Andric
61330b57cec5SDimitry Andric// Vector Move Operations.
61340b57cec5SDimitry Andric
61350b57cec5SDimitry Andric//   VMOV     : Vector Move (Register)
61360b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p} $Vd, $Vm",
61370b57cec5SDimitry Andric                    (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
61380b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p} $Vd, $Vm",
61390b57cec5SDimitry Andric                    (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
61400b57cec5SDimitry Andric
61410b57cec5SDimitry Andric//   VMOV     : Vector Move (Immediate)
61420b57cec5SDimitry Andric
61430b57cec5SDimitry Andric// Although VMOVs are not strictly speaking cheap, they are as expensive
61440b57cec5SDimitry Andric// as their copies counterpart (VORR), so we should prefer rematerialization
61450b57cec5SDimitry Andric// over splitting when it applies.
61460b57cec5SDimitry Andriclet isReMaterializable = 1, isAsCheapAsAMove=1 in {
61470b57cec5SDimitry Andricdef VMOVv8i8  : N1ModImm<1, 0b000, 0b1110, 0, 0, 0, 1, (outs DPR:$Vd),
61480b57cec5SDimitry Andric                         (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
61490b57cec5SDimitry Andric                         "vmov", "i8", "$Vd, $SIMM", "",
61500b57cec5SDimitry Andric                         [(set DPR:$Vd, (v8i8 (ARMvmovImm timm:$SIMM)))]>;
61510b57cec5SDimitry Andricdef VMOVv16i8 : N1ModImm<1, 0b000, 0b1110, 0, 1, 0, 1, (outs QPR:$Vd),
61520b57cec5SDimitry Andric                         (ins nImmSplatI8:$SIMM), IIC_VMOVImm,
61530b57cec5SDimitry Andric                         "vmov", "i8", "$Vd, $SIMM", "",
61540b57cec5SDimitry Andric                         [(set QPR:$Vd, (v16i8 (ARMvmovImm timm:$SIMM)))]>;
61550b57cec5SDimitry Andric
61560b57cec5SDimitry Andricdef VMOVv4i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 0, 0, 1, (outs DPR:$Vd),
61570b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
61580b57cec5SDimitry Andric                         "vmov", "i16", "$Vd, $SIMM", "",
61590b57cec5SDimitry Andric                         [(set DPR:$Vd, (v4i16 (ARMvmovImm timm:$SIMM)))]> {
61600b57cec5SDimitry Andric  let Inst{9} = SIMM{9};
61610b57cec5SDimitry Andric}
61620b57cec5SDimitry Andric
61630b57cec5SDimitry Andricdef VMOVv8i16 : N1ModImm<1, 0b000, {1,0,?,0}, 0, 1, 0, 1, (outs QPR:$Vd),
61640b57cec5SDimitry Andric                         (ins nImmSplatI16:$SIMM), IIC_VMOVImm,
61650b57cec5SDimitry Andric                         "vmov", "i16", "$Vd, $SIMM", "",
61660b57cec5SDimitry Andric                         [(set QPR:$Vd, (v8i16 (ARMvmovImm timm:$SIMM)))]> {
61670b57cec5SDimitry Andric let Inst{9} = SIMM{9};
61680b57cec5SDimitry Andric}
61690b57cec5SDimitry Andric
61700b57cec5SDimitry Andricdef VMOVv2i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 0, 0, 1, (outs DPR:$Vd),
61710b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
61720b57cec5SDimitry Andric                         "vmov", "i32", "$Vd, $SIMM", "",
61730b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2i32 (ARMvmovImm timm:$SIMM)))]> {
61740b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
61750b57cec5SDimitry Andric}
61760b57cec5SDimitry Andric
61770b57cec5SDimitry Andricdef VMOVv4i32 : N1ModImm<1, 0b000, {?,?,?,?}, 0, 1, 0, 1, (outs QPR:$Vd),
61780b57cec5SDimitry Andric                         (ins nImmVMOVI32:$SIMM), IIC_VMOVImm,
61790b57cec5SDimitry Andric                         "vmov", "i32", "$Vd, $SIMM", "",
61800b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4i32 (ARMvmovImm timm:$SIMM)))]> {
61810b57cec5SDimitry Andric  let Inst{11-8} = SIMM{11-8};
61820b57cec5SDimitry Andric}
61830b57cec5SDimitry Andric
61840b57cec5SDimitry Andricdef VMOVv1i64 : N1ModImm<1, 0b000, 0b1110, 0, 0, 1, 1, (outs DPR:$Vd),
61850b57cec5SDimitry Andric                         (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
61860b57cec5SDimitry Andric                         "vmov", "i64", "$Vd, $SIMM", "",
61870b57cec5SDimitry Andric                         [(set DPR:$Vd, (v1i64 (ARMvmovImm timm:$SIMM)))]>;
61880b57cec5SDimitry Andricdef VMOVv2i64 : N1ModImm<1, 0b000, 0b1110, 0, 1, 1, 1, (outs QPR:$Vd),
61890b57cec5SDimitry Andric                         (ins nImmSplatI64:$SIMM), IIC_VMOVImm,
61900b57cec5SDimitry Andric                         "vmov", "i64", "$Vd, $SIMM", "",
61910b57cec5SDimitry Andric                         [(set QPR:$Vd, (v2i64 (ARMvmovImm timm:$SIMM)))]>;
61920b57cec5SDimitry Andric
61930b57cec5SDimitry Andricdef VMOVv2f32 : N1ModImm<1, 0b000, 0b1111, 0, 0, 0, 1, (outs DPR:$Vd),
61940b57cec5SDimitry Andric                         (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
61950b57cec5SDimitry Andric                         "vmov", "f32", "$Vd, $SIMM", "",
61960b57cec5SDimitry Andric                         [(set DPR:$Vd, (v2f32 (ARMvmovFPImm timm:$SIMM)))]>;
61970b57cec5SDimitry Andricdef VMOVv4f32 : N1ModImm<1, 0b000, 0b1111, 0, 1, 0, 1, (outs QPR:$Vd),
61980b57cec5SDimitry Andric                         (ins nImmVMOVF32:$SIMM), IIC_VMOVImm,
61990b57cec5SDimitry Andric                         "vmov", "f32", "$Vd, $SIMM", "",
62000b57cec5SDimitry Andric                         [(set QPR:$Vd, (v4f32 (ARMvmovFPImm timm:$SIMM)))]>;
62010b57cec5SDimitry Andric} // isReMaterializable, isAsCheapAsAMove
62020b57cec5SDimitry Andric
62030b57cec5SDimitry Andric// Add support for bytes replication feature, so it could be GAS compatible.
62040b57cec5SDimitry Andricmulticlass NEONImmReplicateI8InstAlias<ValueType To> {
62050b57cec5SDimitry Andric  // E.g. instructions below:
62060b57cec5SDimitry Andric  // "vmov.i32 d0, #0xffffffff"
62070b57cec5SDimitry Andric  // "vmov.i32 d0, #0xabababab"
62080b57cec5SDimitry Andric  // "vmov.i16 d0, #0xabab"
62090b57cec5SDimitry Andric  // are incorrect, but we could deal with such cases.
62100b57cec5SDimitry Andric  // For last two instructions, for example, it should emit:
62110b57cec5SDimitry Andric  // "vmov.i8 d0, #0xab"
62120b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62130b57cec5SDimitry Andric                      (VMOVv8i8 DPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
62140b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62150b57cec5SDimitry Andric                      (VMOVv16i8 QPR:$Vd, nImmVMOVIReplicate<i8, To>:$Vm, pred:$p)>;
62160b57cec5SDimitry Andric  // Also add same support for VMVN instructions. So instruction:
62170b57cec5SDimitry Andric  // "vmvn.i32 d0, #0xabababab"
62180b57cec5SDimitry Andric  // actually means:
62190b57cec5SDimitry Andric  // "vmov.i8 d0, #0x54"
62200b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
62210b57cec5SDimitry Andric                      (VMOVv8i8 DPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
62220b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
62230b57cec5SDimitry Andric                      (VMOVv16i8 QPR:$Vd, nImmVINVIReplicate<i8, To>:$Vm, pred:$p)>;
62240b57cec5SDimitry Andric}
62250b57cec5SDimitry Andric
62260b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i16>;
62270b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i32>;
62280b57cec5SDimitry Andricdefm : NEONImmReplicateI8InstAlias<i64>;
62290b57cec5SDimitry Andric
62300b57cec5SDimitry Andric// Similar to above for types other than i8, e.g.:
62310b57cec5SDimitry Andric// "vmov.i32 d0, #0xab00ab00" -> "vmov.i16 d0, #0xab00"
62320b57cec5SDimitry Andric// "vmvn.i64 q0, #0xab000000ab000000" -> "vmvn.i32 q0, #0xab000000"
62330b57cec5SDimitry Andric// In this case we do not canonicalize VMVN to VMOV
62340b57cec5SDimitry Andricmulticlass NEONImmReplicateInstAlias<ValueType From, NeonI V8, NeonI V16,
62350b57cec5SDimitry Andric                                     NeonI NV8, NeonI NV16, ValueType To> {
62360b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62370b57cec5SDimitry Andric                      (V8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
62380b57cec5SDimitry Andric  def : NEONInstAlias<"vmov${p}.i" # To.Size # " $Vd, $Vm",
62390b57cec5SDimitry Andric                      (V16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
62400b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
62410b57cec5SDimitry Andric                      (NV8 DPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
62420b57cec5SDimitry Andric  def : NEONInstAlias<"vmvn${p}.i" # To.Size # " $Vd, $Vm",
62430b57cec5SDimitry Andric                      (NV16 QPR:$Vd, nImmVMOVIReplicate<From, To>:$Vm, pred:$p)>;
62440b57cec5SDimitry Andric}
62450b57cec5SDimitry Andric
62460b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
62470b57cec5SDimitry Andric                                      VMVNv4i16, VMVNv8i16, i32>;
62480b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i16, VMOVv4i16, VMOVv8i16,
62490b57cec5SDimitry Andric                                      VMVNv4i16, VMVNv8i16, i64>;
62500b57cec5SDimitry Andricdefm : NEONImmReplicateInstAlias<i32, VMOVv2i32, VMOVv4i32,
62510b57cec5SDimitry Andric                                      VMVNv2i32, VMVNv4i32, i64>;
62520b57cec5SDimitry Andric// TODO: add "VMOV <-> VMVN" conversion for cases like
62530b57cec5SDimitry Andric// "vmov.i32 d0, #0xffaaffaa" -> "vmvn.i16 d0, #0x55"
62540b57cec5SDimitry Andric// "vmvn.i32 d0, #0xaaffaaff" -> "vmov.i16 d0, #0xff00"
62550b57cec5SDimitry Andric
62560b57cec5SDimitry Andric// On some CPUs the two instructions "vmov.i32 dD, #0" and "vmov.i32 qD, #0"
62570b57cec5SDimitry Andric// require zero cycles to execute so they should be used wherever possible for
62580b57cec5SDimitry Andric// setting a register to zero.
62590b57cec5SDimitry Andric
62600b57cec5SDimitry Andric// Even without these pseudo-insts we would probably end up with the correct
62610b57cec5SDimitry Andric// instruction, but we could not mark the general ones with "isAsCheapAsAMove"
62620b57cec5SDimitry Andric// since they are sometimes rather expensive (in general).
62630b57cec5SDimitry Andric
62640b57cec5SDimitry Andriclet AddedComplexity = 50, isAsCheapAsAMove = 1, isReMaterializable = 1 in {
62650b57cec5SDimitry Andric  def VMOVD0 : ARMPseudoExpand<(outs DPR:$Vd), (ins), 4, IIC_VMOVImm,
62660b57cec5SDimitry Andric                               [(set DPR:$Vd, (v2i32 NEONimmAllZerosV))],
62670b57cec5SDimitry Andric                               (VMOVv2i32 DPR:$Vd, 0, (ops 14, zero_reg))>,
62680b57cec5SDimitry Andric               Requires<[HasZCZ]>;
62690b57cec5SDimitry Andric  def VMOVQ0 : ARMPseudoExpand<(outs QPR:$Vd), (ins), 4, IIC_VMOVImm,
62700b57cec5SDimitry Andric                               [(set QPR:$Vd, (v4i32 NEONimmAllZerosV))],
62710b57cec5SDimitry Andric                               (VMOVv4i32 QPR:$Vd, 0, (ops 14, zero_reg))>,
62720b57cec5SDimitry Andric               Requires<[HasZCZ]>;
62730b57cec5SDimitry Andric}
62740b57cec5SDimitry Andric
62750b57cec5SDimitry Andric//   VMOV     : Vector Get Lane (move scalar to ARM core register)
62760b57cec5SDimitry Andric
62770b57cec5SDimitry Andricdef VGETLNs8  : NVGetLane<{1,1,1,0,0,1,?,1}, 0b1011, {?,?},
62780b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
62790b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "s8", "$R, $V$lane",
62800b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlanes (v8i8 DPR:$V),
62810b57cec5SDimitry Andric                                           imm:$lane))]> {
62820b57cec5SDimitry Andric  let Inst{21}  = lane{2};
62830b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
62840b57cec5SDimitry Andric}
62850b57cec5SDimitry Andricdef VGETLNs16 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, {?,1},
62860b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
62870b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "s16", "$R, $V$lane",
62880b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlanes (v4i16 DPR:$V),
62890b57cec5SDimitry Andric                                           imm:$lane))]> {
62900b57cec5SDimitry Andric  let Inst{21} = lane{1};
62910b57cec5SDimitry Andric  let Inst{6}  = lane{0};
62920b57cec5SDimitry Andric}
62930b57cec5SDimitry Andricdef VGETLNu8  : NVGetLane<{1,1,1,0,1,1,?,1}, 0b1011, {?,?},
62940b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex8:$lane),
62950b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "u8", "$R, $V$lane",
62960b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlaneu (v8i8 DPR:$V),
62970b57cec5SDimitry Andric                                           imm:$lane))]> {
62980b57cec5SDimitry Andric  let Inst{21}  = lane{2};
62990b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
63000b57cec5SDimitry Andric}
63010b57cec5SDimitry Andricdef VGETLNu16 : NVGetLane<{1,1,1,0,1,0,?,1}, 0b1011, {?,1},
63020b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex16:$lane),
63030b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "u16", "$R, $V$lane",
63040b57cec5SDimitry Andric                          [(set GPR:$R, (ARMvgetlaneu (v4i16 DPR:$V),
63050b57cec5SDimitry Andric                                           imm:$lane))]> {
63060b57cec5SDimitry Andric  let Inst{21} = lane{1};
63070b57cec5SDimitry Andric  let Inst{6}  = lane{0};
63080b57cec5SDimitry Andric}
63090b57cec5SDimitry Andricdef VGETLNi32 : NVGetLane<{1,1,1,0,0,0,?,1}, 0b1011, 0b00,
63100b57cec5SDimitry Andric                          (outs GPR:$R), (ins DPR:$V, VectorIndex32:$lane),
63110b57cec5SDimitry Andric                          IIC_VMOVSI, "vmov", "32", "$R, $V$lane",
63120b57cec5SDimitry Andric                          [(set GPR:$R, (extractelt (v2i32 DPR:$V),
63130b57cec5SDimitry Andric                                           imm:$lane))]>,
63140b57cec5SDimitry Andric                Requires<[HasFPRegs, HasFastVGETLNi32]> {
63150b57cec5SDimitry Andric  let Inst{21} = lane{0};
63160b57cec5SDimitry Andric}
63170b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
63180b57cec5SDimitry Andric// def VGETLNf32: see FMRDH and FMRDL in ARMInstrVFP.td
63190b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v16i8 QPR:$src), imm:$lane),
63200b57cec5SDimitry Andric          (VGETLNs8 (v8i8 (EXTRACT_SUBREG QPR:$src,
63210b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
63220b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
63230b57cec5SDimitry Andricdef : Pat<(ARMvgetlanes (v8i16 QPR:$src), imm:$lane),
63240b57cec5SDimitry Andric          (VGETLNs16 (v4i16 (EXTRACT_SUBREG QPR:$src,
63250b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
63260b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
63270b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v16i8 QPR:$src), imm:$lane),
63280b57cec5SDimitry Andric          (VGETLNu8 (v8i8 (EXTRACT_SUBREG QPR:$src,
63290b57cec5SDimitry Andric                           (DSubReg_i8_reg imm:$lane))),
63300b57cec5SDimitry Andric                     (SubReg_i8_lane imm:$lane))>;
63310b57cec5SDimitry Andricdef : Pat<(ARMvgetlaneu (v8i16 QPR:$src), imm:$lane),
63320b57cec5SDimitry Andric          (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
63330b57cec5SDimitry Andric                             (DSubReg_i16_reg imm:$lane))),
63340b57cec5SDimitry Andric                     (SubReg_i16_lane imm:$lane))>;
63350b57cec5SDimitry Andric}
63360b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
63370b57cec5SDimitry Andric          (VGETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src,
63380b57cec5SDimitry Andric                             (DSubReg_i32_reg imm:$lane))),
63390b57cec5SDimitry Andric                     (SubReg_i32_lane imm:$lane))>,
63400b57cec5SDimitry Andric      Requires<[HasNEON, HasFastVGETLNi32]>;
63410b57cec5SDimitry Andricdef : Pat<(extractelt (v2i32 DPR:$src), imm:$lane),
63420b57cec5SDimitry Andric          (COPY_TO_REGCLASS
63430b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
63440b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
63450b57cec5SDimitry Andricdef : Pat<(extractelt (v4i32 QPR:$src), imm:$lane),
63460b57cec5SDimitry Andric          (COPY_TO_REGCLASS
63470b57cec5SDimitry Andric            (i32 (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane))), GPR)>,
63480b57cec5SDimitry Andric      Requires<[HasNEON, HasSlowVGETLNi32]>;
63490b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
63500b57cec5SDimitry Andricdef : Pat<(extractelt (v2f32 DPR:$src1), imm:$src2),
63510b57cec5SDimitry Andric          (EXTRACT_SUBREG (v2f32 (COPY_TO_REGCLASS (v2f32 DPR:$src1),DPR_VFP2)),
63520b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
63530b57cec5SDimitry Andricdef : Pat<(extractelt (v4f32 QPR:$src1), imm:$src2),
63540b57cec5SDimitry Andric          (EXTRACT_SUBREG (v4f32 (COPY_TO_REGCLASS (v4f32 QPR:$src1),QPR_VFP2)),
63550b57cec5SDimitry Andric                          (SSubReg_f32_reg imm:$src2))>;
63560b57cec5SDimitry Andric//def : Pat<(extractelt (v2i64 QPR:$src1), imm:$src2),
63570b57cec5SDimitry Andric//          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
63580b57cec5SDimitry Andricdef : Pat<(extractelt (v2f64 QPR:$src1), imm:$src2),
63590b57cec5SDimitry Andric          (EXTRACT_SUBREG QPR:$src1, (DSubReg_f64_reg imm:$src2))>;
63600b57cec5SDimitry Andric}
63610b57cec5SDimitry Andric
6362*5ffd83dbSDimitry Andricmulticlass ExtractEltEvenF16<ValueType VT4, ValueType VT8> {
6363*5ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_even:$lane),
63640b57cec5SDimitry Andric              (EXTRACT_SUBREG
6365*5ffd83dbSDimitry Andric                  (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
63660b57cec5SDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
6367*5ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_even:$lane),
6368*5ffd83dbSDimitry Andric              (EXTRACT_SUBREG
6369*5ffd83dbSDimitry Andric                  (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
6370*5ffd83dbSDimitry Andric                  (SSubReg_f16_reg imm_even:$lane))>;
6371*5ffd83dbSDimitry Andric}
63720b57cec5SDimitry Andric
6373*5ffd83dbSDimitry Andricmulticlass ExtractEltOddF16VMOVH<ValueType VT4, ValueType VT8> {
6374*5ffd83dbSDimitry Andric  def : Pat<(extractelt (VT4 DPR:$src), imm_odd:$lane),
63750b57cec5SDimitry Andric            (COPY_TO_REGCLASS
63760b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
6377*5ffd83dbSDimitry Andric                        (v2f32 (COPY_TO_REGCLASS (VT4 DPR:$src), DPR_VFP2)),
63780b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
63790b57cec5SDimitry Andric              HPR)>;
6380*5ffd83dbSDimitry Andric  def : Pat<(extractelt (VT8 QPR:$src), imm_odd:$lane),
63810b57cec5SDimitry Andric            (COPY_TO_REGCLASS
63820b57cec5SDimitry Andric              (VMOVH (EXTRACT_SUBREG
6383*5ffd83dbSDimitry Andric                        (v4f32 (COPY_TO_REGCLASS (VT8 QPR:$src), QPR_VFP2)),
63840b57cec5SDimitry Andric                        (SSubReg_f16_reg imm_odd:$lane))),
63850b57cec5SDimitry Andric              HPR)>;
63860b57cec5SDimitry Andric}
63870b57cec5SDimitry Andric
6388*5ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
6389*5ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4f16, v8f16>;
6390*5ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4f16, v8f16>;
6391*5ffd83dbSDimitry Andric}
6392*5ffd83dbSDimitry Andric
6393*5ffd83dbSDimitry Andriclet AddedComplexity = 1, Predicates = [HasNEON, HasBF16, HasFullFP16] in {
6394*5ffd83dbSDimitry Andric  // If VMOVH (vmovx.f16) is available use it to extract BF16 from the odd lanes
6395*5ffd83dbSDimitry Andric  defm : ExtractEltOddF16VMOVH<v4bf16, v8bf16>;
6396*5ffd83dbSDimitry Andric}
6397*5ffd83dbSDimitry Andric
6398*5ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
6399*5ffd83dbSDimitry Andric  defm : ExtractEltEvenF16<v4bf16, v8bf16>;
6400*5ffd83dbSDimitry Andric
6401*5ffd83dbSDimitry Andric  // Otherwise, if VMOVH is not available resort to extracting the odd lane
6402*5ffd83dbSDimitry Andric  // into a GPR and then moving to HPR
6403*5ffd83dbSDimitry Andric  def : Pat<(extractelt (v4bf16 DPR:$src), imm_odd:$lane),
6404*5ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
6405*5ffd83dbSDimitry Andric              (VGETLNu16 (v4bf16 DPR:$src), imm:$lane),
6406*5ffd83dbSDimitry Andric              HPR)>;
6407*5ffd83dbSDimitry Andric
6408*5ffd83dbSDimitry Andric  def : Pat<(extractelt (v8bf16 QPR:$src), imm_odd:$lane),
6409*5ffd83dbSDimitry Andric            (COPY_TO_REGCLASS
6410*5ffd83dbSDimitry Andric              (VGETLNu16 (v4i16 (EXTRACT_SUBREG QPR:$src,
6411*5ffd83dbSDimitry Andric                                                (DSubReg_i16_reg imm:$lane))),
6412*5ffd83dbSDimitry Andric                         (SubReg_i16_lane imm:$lane)),
6413*5ffd83dbSDimitry Andric              HPR)>;
6414*5ffd83dbSDimitry Andric}
6415*5ffd83dbSDimitry Andric
64160b57cec5SDimitry Andric//   VMOV     : Vector Set Lane (move ARM core register to scalar)
64170b57cec5SDimitry Andric
64180b57cec5SDimitry Andriclet Constraints = "$src1 = $V" in {
64190b57cec5SDimitry Andricdef VSETLNi8  : NVSetLane<{1,1,1,0,0,1,?,0}, 0b1011, {?,?}, (outs DPR:$V),
64200b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex8:$lane),
64210b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "8", "$V$lane, $R",
64220b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v8i8 DPR:$src1),
64230b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
64240b57cec5SDimitry Andric  let Inst{21}  = lane{2};
64250b57cec5SDimitry Andric  let Inst{6-5} = lane{1-0};
64260b57cec5SDimitry Andric}
64270b57cec5SDimitry Andricdef VSETLNi16 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, {?,1}, (outs DPR:$V),
64280b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex16:$lane),
64290b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "16", "$V$lane, $R",
64300b57cec5SDimitry Andric                          [(set DPR:$V, (vector_insert (v4i16 DPR:$src1),
64310b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]> {
64320b57cec5SDimitry Andric  let Inst{21} = lane{1};
64330b57cec5SDimitry Andric  let Inst{6}  = lane{0};
64340b57cec5SDimitry Andric}
64350b57cec5SDimitry Andricdef VSETLNi32 : NVSetLane<{1,1,1,0,0,0,?,0}, 0b1011, 0b00, (outs DPR:$V),
64360b57cec5SDimitry Andric                          (ins DPR:$src1, GPR:$R, VectorIndex32:$lane),
64370b57cec5SDimitry Andric                          IIC_VMOVISL, "vmov", "32", "$V$lane, $R",
64380b57cec5SDimitry Andric                          [(set DPR:$V, (insertelt (v2i32 DPR:$src1),
64390b57cec5SDimitry Andric                                           GPR:$R, imm:$lane))]>,
64400b57cec5SDimitry Andric                Requires<[HasVFP2]> {
64410b57cec5SDimitry Andric  let Inst{21} = lane{0};
64420b57cec5SDimitry Andric  // This instruction is equivalent as
64430b57cec5SDimitry Andric  // $V = INSERT_SUBREG $src1, $R, translateImmToSubIdx($imm)
64440b57cec5SDimitry Andric  let isInsertSubreg = 1;
64450b57cec5SDimitry Andric}
64460b57cec5SDimitry Andric}
64470b57cec5SDimitry Andric
6448*5ffd83dbSDimitry Andric// TODO: for odd lanes we could optimize this a bit by using the VINS
6449*5ffd83dbSDimitry Andric// FullFP16 instruction when it is available
6450*5ffd83dbSDimitry Andricmulticlass InsertEltF16<ValueType VTScalar, ValueType VT4, ValueType VT8> {
6451*5ffd83dbSDimitry Andric  def : Pat<(insertelt (VT4 DPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6452*5ffd83dbSDimitry Andric            (VT4 (VSETLNi16 DPR:$src1,
6453*5ffd83dbSDimitry Andric                 (COPY_TO_REGCLASS HPR:$src2, GPR), imm:$lane))>;
6454*5ffd83dbSDimitry Andric  def : Pat<(insertelt (VT8 QPR:$src1), (VTScalar HPR:$src2), imm:$lane),
6455*5ffd83dbSDimitry Andric            (VT8 (INSERT_SUBREG QPR:$src1,
6456*5ffd83dbSDimitry Andric                    (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
6457*5ffd83dbSDimitry Andric                                        (DSubReg_i16_reg imm:$lane))),
6458*5ffd83dbSDimitry Andric                              (COPY_TO_REGCLASS HPR:$src2, GPR),
6459*5ffd83dbSDimitry Andric                              (SubReg_i16_lane imm:$lane))),
6460*5ffd83dbSDimitry Andric                    (DSubReg_i16_reg imm:$lane)))>;
6461*5ffd83dbSDimitry Andric}
6462*5ffd83dbSDimitry Andric
64630b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
64640b57cec5SDimitry Andricdef : Pat<(vector_insert (v16i8 QPR:$src1), GPR:$src2, imm:$lane),
64650b57cec5SDimitry Andric          (v16i8 (INSERT_SUBREG QPR:$src1,
64660b57cec5SDimitry Andric                  (v8i8 (VSETLNi8 (v8i8 (EXTRACT_SUBREG QPR:$src1,
64670b57cec5SDimitry Andric                                   (DSubReg_i8_reg imm:$lane))),
64680b57cec5SDimitry Andric                            GPR:$src2, (SubReg_i8_lane imm:$lane))),
64690b57cec5SDimitry Andric                  (DSubReg_i8_reg imm:$lane)))>;
64700b57cec5SDimitry Andricdef : Pat<(vector_insert (v8i16 QPR:$src1), GPR:$src2, imm:$lane),
64710b57cec5SDimitry Andric          (v8i16 (INSERT_SUBREG QPR:$src1,
64720b57cec5SDimitry Andric                  (v4i16 (VSETLNi16 (v4i16 (EXTRACT_SUBREG QPR:$src1,
64730b57cec5SDimitry Andric                                     (DSubReg_i16_reg imm:$lane))),
64740b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i16_lane imm:$lane))),
64750b57cec5SDimitry Andric                  (DSubReg_i16_reg imm:$lane)))>;
64760b57cec5SDimitry Andricdef : Pat<(insertelt (v4i32 QPR:$src1), GPR:$src2, imm:$lane),
64770b57cec5SDimitry Andric          (v4i32 (INSERT_SUBREG QPR:$src1,
64780b57cec5SDimitry Andric                  (v2i32 (VSETLNi32 (v2i32 (EXTRACT_SUBREG QPR:$src1,
64790b57cec5SDimitry Andric                                     (DSubReg_i32_reg imm:$lane))),
64800b57cec5SDimitry Andric                             GPR:$src2, (SubReg_i32_lane imm:$lane))),
64810b57cec5SDimitry Andric                  (DSubReg_i32_reg imm:$lane)))>;
64820b57cec5SDimitry Andric
64830b57cec5SDimitry Andricdef : Pat<(v2f32 (insertelt DPR:$src1, SPR:$src2, imm:$src3)),
64840b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (COPY_TO_REGCLASS DPR:$src1, DPR_VFP2)),
64850b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
64860b57cec5SDimitry Andricdef : Pat<(v4f32 (insertelt QPR:$src1, SPR:$src2, imm:$src3)),
64870b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (COPY_TO_REGCLASS QPR:$src1, QPR_VFP2)),
64880b57cec5SDimitry Andric                                SPR:$src2, (SSubReg_f32_reg imm:$src3))>;
64890b57cec5SDimitry Andric
6490*5ffd83dbSDimitry Andricdefm : InsertEltF16<f16, v4f16, v8f16>;
64910b57cec5SDimitry Andric
64920b57cec5SDimitry Andric//def : Pat<(v2i64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
64930b57cec5SDimitry Andric//          (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
64940b57cec5SDimitry Andricdef : Pat<(v2f64 (insertelt QPR:$src1, DPR:$src2, imm:$src3)),
64950b57cec5SDimitry Andric          (INSERT_SUBREG QPR:$src1, DPR:$src2, (DSubReg_f64_reg imm:$src3))>;
64960b57cec5SDimitry Andric
64970b57cec5SDimitry Andricdef : Pat<(v2f32 (scalar_to_vector SPR:$src)),
64980b57cec5SDimitry Andric          (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
64990b57cec5SDimitry Andricdef : Pat<(v2f64 (scalar_to_vector (f64 DPR:$src))),
65000b57cec5SDimitry Andric          (INSERT_SUBREG (v2f64 (IMPLICIT_DEF)), DPR:$src, dsub_0)>;
65010b57cec5SDimitry Andricdef : Pat<(v4f32 (scalar_to_vector SPR:$src)),
65020b57cec5SDimitry Andric          (INSERT_SUBREG (v4f32 (IMPLICIT_DEF)), SPR:$src, ssub_0)>;
65030b57cec5SDimitry Andric
65040b57cec5SDimitry Andricdef : Pat<(v8i8 (scalar_to_vector GPR:$src)),
65050b57cec5SDimitry Andric          (VSETLNi8  (v8i8  (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
65060b57cec5SDimitry Andricdef : Pat<(v4i16 (scalar_to_vector GPR:$src)),
65070b57cec5SDimitry Andric          (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
65080b57cec5SDimitry Andricdef : Pat<(v2i32 (scalar_to_vector GPR:$src)),
65090b57cec5SDimitry Andric          (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0))>;
65100b57cec5SDimitry Andric
65110b57cec5SDimitry Andricdef : Pat<(v16i8 (scalar_to_vector GPR:$src)),
65120b57cec5SDimitry Andric          (INSERT_SUBREG (v16i8 (IMPLICIT_DEF)),
65130b57cec5SDimitry Andric                         (VSETLNi8 (v8i8 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
65140b57cec5SDimitry Andric                         dsub_0)>;
65150b57cec5SDimitry Andricdef : Pat<(v8i16 (scalar_to_vector GPR:$src)),
65160b57cec5SDimitry Andric          (INSERT_SUBREG (v8i16 (IMPLICIT_DEF)),
65170b57cec5SDimitry Andric                         (VSETLNi16 (v4i16 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
65180b57cec5SDimitry Andric                         dsub_0)>;
65190b57cec5SDimitry Andricdef : Pat<(v4i32 (scalar_to_vector GPR:$src)),
65200b57cec5SDimitry Andric          (INSERT_SUBREG (v4i32 (IMPLICIT_DEF)),
65210b57cec5SDimitry Andric                         (VSETLNi32 (v2i32 (IMPLICIT_DEF)), GPR:$src, (i32 0)),
65220b57cec5SDimitry Andric                         dsub_0)>;
65230b57cec5SDimitry Andric}
65240b57cec5SDimitry Andric
6525*5ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in
6526*5ffd83dbSDimitry Andricdefm : InsertEltF16<bf16, v4bf16, v8bf16>;
6527*5ffd83dbSDimitry Andric
65280b57cec5SDimitry Andric//   VDUP     : Vector Duplicate (from ARM core register to all elements)
65290b57cec5SDimitry Andric
65300b57cec5SDimitry Andricclass VDUPD<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
65310b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs DPR:$V), (ins GPR:$R),
65320b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
65330b57cec5SDimitry Andric          [(set DPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
65340b57cec5SDimitry Andricclass VDUPQ<bits<8> opcod1, bits<2> opcod3, string Dt, ValueType Ty>
65350b57cec5SDimitry Andric  : NVDup<opcod1, 0b1011, opcod3, (outs QPR:$V), (ins GPR:$R),
65360b57cec5SDimitry Andric          IIC_VMOVIS, "vdup", Dt, "$V, $R",
65370b57cec5SDimitry Andric          [(set QPR:$V, (Ty (ARMvdup (i32 GPR:$R))))]>;
65380b57cec5SDimitry Andric
65390b57cec5SDimitry Andricdef  VDUP8d   : VDUPD<0b11101100, 0b00, "8", v8i8>;
65400b57cec5SDimitry Andricdef  VDUP16d  : VDUPD<0b11101000, 0b01, "16", v4i16>;
65410b57cec5SDimitry Andricdef  VDUP32d  : VDUPD<0b11101000, 0b00, "32", v2i32>,
65420b57cec5SDimitry Andric                Requires<[HasNEON, HasFastVDUP32]>;
65430b57cec5SDimitry Andricdef  VDUP8q   : VDUPQ<0b11101110, 0b00, "8", v16i8>;
65440b57cec5SDimitry Andricdef  VDUP16q  : VDUPQ<0b11101010, 0b01, "16", v8i16>;
65450b57cec5SDimitry Andricdef  VDUP32q  : VDUPQ<0b11101010, 0b00, "32", v4i32>;
65460b57cec5SDimitry Andric
65470b57cec5SDimitry Andric// ARMvdup patterns for uarchs with fast VDUP.32.
65480b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32d GPR:$R)>,
65490b57cec5SDimitry Andric      Requires<[HasNEON,HasFastVDUP32]>;
65500b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VDUP32q GPR:$R)>,
65510b57cec5SDimitry Andric      Requires<[HasNEON]>;
65520b57cec5SDimitry Andric
65530b57cec5SDimitry Andric// ARMvdup patterns for uarchs with slow VDUP.32 - use VMOVDRR instead.
65540b57cec5SDimitry Andricdef : Pat<(v2i32 (ARMvdup (i32 GPR:$R))), (VMOVDRR GPR:$R, GPR:$R)>,
65550b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
65560b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 (bitconvert GPR:$R)))), (VMOVDRR GPR:$R, GPR:$R)>,
65570b57cec5SDimitry Andric      Requires<[HasNEON,HasSlowVDUP32]>;
65580b57cec5SDimitry Andric
65590b57cec5SDimitry Andric//   VDUP     : Vector Duplicate Lane (from scalar to all elements)
65600b57cec5SDimitry Andric
65610b57cec5SDimitry Andricclass VDUPLND<bits<4> op19_16, string OpcodeStr, string Dt,
65620b57cec5SDimitry Andric              ValueType Ty, Operand IdxTy>
65630b57cec5SDimitry Andric  : NVDupLane<op19_16, 0, (outs DPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
65640b57cec5SDimitry Andric              IIC_VMOVD, OpcodeStr, Dt, "$Vd, $Vm$lane",
65650b57cec5SDimitry Andric              [(set DPR:$Vd, (Ty (ARMvduplane (Ty DPR:$Vm), imm:$lane)))]>;
65660b57cec5SDimitry Andric
65670b57cec5SDimitry Andricclass VDUPLNQ<bits<4> op19_16, string OpcodeStr, string Dt,
65680b57cec5SDimitry Andric              ValueType ResTy, ValueType OpTy, Operand IdxTy>
65690b57cec5SDimitry Andric  : NVDupLane<op19_16, 1, (outs QPR:$Vd), (ins DPR:$Vm, IdxTy:$lane),
65700b57cec5SDimitry Andric              IIC_VMOVQ, OpcodeStr, Dt, "$Vd, $Vm$lane",
65710b57cec5SDimitry Andric              [(set QPR:$Vd, (ResTy (ARMvduplane (OpTy DPR:$Vm),
65720b57cec5SDimitry Andric                                      VectorIndex32:$lane)))]>;
65730b57cec5SDimitry Andric
65740b57cec5SDimitry Andric// Inst{19-16} is partially specified depending on the element size.
65750b57cec5SDimitry Andric
65760b57cec5SDimitry Andricdef VDUPLN8d  : VDUPLND<{?,?,?,1}, "vdup", "8", v8i8, VectorIndex8> {
65770b57cec5SDimitry Andric  bits<3> lane;
65780b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
65790b57cec5SDimitry Andric}
65800b57cec5SDimitry Andricdef VDUPLN16d : VDUPLND<{?,?,1,0}, "vdup", "16", v4i16, VectorIndex16> {
65810b57cec5SDimitry Andric  bits<2> lane;
65820b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
65830b57cec5SDimitry Andric}
65840b57cec5SDimitry Andricdef VDUPLN32d : VDUPLND<{?,1,0,0}, "vdup", "32", v2i32, VectorIndex32> {
65850b57cec5SDimitry Andric  bits<1> lane;
65860b57cec5SDimitry Andric  let Inst{19} = lane{0};
65870b57cec5SDimitry Andric}
65880b57cec5SDimitry Andricdef VDUPLN8q  : VDUPLNQ<{?,?,?,1}, "vdup", "8", v16i8, v8i8, VectorIndex8> {
65890b57cec5SDimitry Andric  bits<3> lane;
65900b57cec5SDimitry Andric  let Inst{19-17} = lane{2-0};
65910b57cec5SDimitry Andric}
65920b57cec5SDimitry Andricdef VDUPLN16q : VDUPLNQ<{?,?,1,0}, "vdup", "16", v8i16, v4i16, VectorIndex16> {
65930b57cec5SDimitry Andric  bits<2> lane;
65940b57cec5SDimitry Andric  let Inst{19-18} = lane{1-0};
65950b57cec5SDimitry Andric}
65960b57cec5SDimitry Andricdef VDUPLN32q : VDUPLNQ<{?,1,0,0}, "vdup", "32", v4i32, v2i32, VectorIndex32> {
65970b57cec5SDimitry Andric  bits<1> lane;
65980b57cec5SDimitry Andric  let Inst{19} = lane{0};
65990b57cec5SDimitry Andric}
66000b57cec5SDimitry Andric
66010b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
66020b57cec5SDimitry Andricdef : Pat<(v4f16 (ARMvduplane (v4f16 DPR:$Vm), imm:$lane)),
66030b57cec5SDimitry Andric          (VDUPLN32d DPR:$Vm, imm:$lane)>;
66040b57cec5SDimitry Andric
66050b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
66060b57cec5SDimitry Andric          (VDUPLN32d DPR:$Vm, imm:$lane)>;
66070b57cec5SDimitry Andric
66080b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v2f32 DPR:$Vm), imm:$lane)),
66090b57cec5SDimitry Andric          (VDUPLN32q DPR:$Vm, imm:$lane)>;
66100b57cec5SDimitry Andric
66110b57cec5SDimitry Andricdef : Pat<(v16i8 (ARMvduplane (v16i8 QPR:$src), imm:$lane)),
66120b57cec5SDimitry Andric          (v16i8 (VDUPLN8q (v8i8 (EXTRACT_SUBREG QPR:$src,
66130b57cec5SDimitry Andric                                  (DSubReg_i8_reg imm:$lane))),
66140b57cec5SDimitry Andric                           (SubReg_i8_lane imm:$lane)))>;
66150b57cec5SDimitry Andricdef : Pat<(v8i16 (ARMvduplane (v8i16 QPR:$src), imm:$lane)),
66160b57cec5SDimitry Andric          (v8i16 (VDUPLN16q (v4i16 (EXTRACT_SUBREG QPR:$src,
66170b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
66180b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
66190b57cec5SDimitry Andricdef : Pat<(v8f16 (ARMvduplane (v8f16 QPR:$src), imm:$lane)),
66200b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (v4f16 (EXTRACT_SUBREG QPR:$src,
66210b57cec5SDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
66220b57cec5SDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
66230b57cec5SDimitry Andricdef : Pat<(v4i32 (ARMvduplane (v4i32 QPR:$src), imm:$lane)),
66240b57cec5SDimitry Andric          (v4i32 (VDUPLN32q (v2i32 (EXTRACT_SUBREG QPR:$src,
66250b57cec5SDimitry Andric                                    (DSubReg_i32_reg imm:$lane))),
66260b57cec5SDimitry Andric                            (SubReg_i32_lane imm:$lane)))>;
66270b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvduplane (v4f32 QPR:$src), imm:$lane)),
66280b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (v2f32 (EXTRACT_SUBREG QPR:$src,
66290b57cec5SDimitry Andric                                   (DSubReg_i32_reg imm:$lane))),
66300b57cec5SDimitry Andric                           (SubReg_i32_lane imm:$lane)))>;
66310b57cec5SDimitry Andric
6632*5ffd83dbSDimitry Andricdef : Pat<(v4f16 (ARMvdup (f16 HPR:$src))),
66330b57cec5SDimitry Andric          (v4f16 (VDUPLN16d (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6634*5ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
66350b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvdup (f32 SPR:$src))),
66360b57cec5SDimitry Andric          (v2f32 (VDUPLN32d (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
66370b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
66380b57cec5SDimitry Andricdef : Pat<(v4f32 (ARMvdup (f32 SPR:$src))),
66390b57cec5SDimitry Andric          (v4f32 (VDUPLN32q (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
66400b57cec5SDimitry Andric                             SPR:$src, ssub_0), (i32 0)))>;
6641*5ffd83dbSDimitry Andricdef : Pat<(v8f16 (ARMvdup (f16 HPR:$src))),
66420b57cec5SDimitry Andric          (v8f16 (VDUPLN16q (INSERT_SUBREG (v4f16 (IMPLICIT_DEF)),
6643*5ffd83dbSDimitry Andric                             (f16 HPR:$src), ssub_0), (i32 0)))>;
6644*5ffd83dbSDimitry Andric}
6645*5ffd83dbSDimitry Andric
6646*5ffd83dbSDimitry Andriclet Predicates = [HasNEON, HasBF16] in {
6647*5ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvduplane (v4bf16 DPR:$Vm), imm:$lane)),
6648*5ffd83dbSDimitry Andric          (VDUPLN16d DPR:$Vm, imm:$lane)>;
6649*5ffd83dbSDimitry Andric
6650*5ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvduplane (v8bf16 QPR:$src), imm:$lane)),
6651*5ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (v4bf16 (EXTRACT_SUBREG QPR:$src,
6652*5ffd83dbSDimitry Andric                                    (DSubReg_i16_reg imm:$lane))),
6653*5ffd83dbSDimitry Andric                            (SubReg_i16_lane imm:$lane)))>;
6654*5ffd83dbSDimitry Andric
6655*5ffd83dbSDimitry Andricdef : Pat<(v4bf16 (ARMvdup (bf16 HPR:$src))),
6656*5ffd83dbSDimitry Andric          (v4bf16 (VDUPLN16d (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6657*5ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
6658*5ffd83dbSDimitry Andricdef : Pat<(v8bf16 (ARMvdup (bf16 HPR:$src))),
6659*5ffd83dbSDimitry Andric          (v8bf16 (VDUPLN16q (INSERT_SUBREG (v4bf16 (IMPLICIT_DEF)),
6660*5ffd83dbSDimitry Andric                             (bf16 HPR:$src), ssub_0), (i32 0)))>;
66610b57cec5SDimitry Andric}
66620b57cec5SDimitry Andric
66630b57cec5SDimitry Andric//   VMOVN    : Vector Narrowing Move
66640b57cec5SDimitry Andricdefm VMOVN    : N2VN_HSD<0b11,0b11,0b10,0b00100,0,0, IIC_VMOVN,
66650b57cec5SDimitry Andric                         "vmovn", "i", trunc>;
66660b57cec5SDimitry Andric//   VQMOVN   : Vector Saturating Narrowing Move
66670b57cec5SDimitry Andricdefm VQMOVNs  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,0,0, IIC_VQUNAiD,
66680b57cec5SDimitry Andric                            "vqmovn", "s", int_arm_neon_vqmovns>;
66690b57cec5SDimitry Andricdefm VQMOVNu  : N2VNInt_HSD<0b11,0b11,0b10,0b00101,1,0, IIC_VQUNAiD,
66700b57cec5SDimitry Andric                            "vqmovn", "u", int_arm_neon_vqmovnu>;
66710b57cec5SDimitry Andricdefm VQMOVNsu : N2VNInt_HSD<0b11,0b11,0b10,0b00100,1,0, IIC_VQUNAiD,
66720b57cec5SDimitry Andric                            "vqmovun", "s", int_arm_neon_vqmovnsu>;
66730b57cec5SDimitry Andric//   VMOVL    : Vector Lengthening Move
66740b57cec5SDimitry Andricdefm VMOVLs   : N2VL_QHS<0b01,0b10100,0,1, "vmovl", "s", sext>;
66750b57cec5SDimitry Andricdefm VMOVLu   : N2VL_QHS<0b11,0b10100,0,1, "vmovl", "u", zext>;
66760b57cec5SDimitry Andric
66770b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
66780b57cec5SDimitry Andricdef : Pat<(v8i16 (anyext (v8i8 DPR:$Vm))), (VMOVLuv8i16 DPR:$Vm)>;
66790b57cec5SDimitry Andricdef : Pat<(v4i32 (anyext (v4i16 DPR:$Vm))), (VMOVLuv4i32 DPR:$Vm)>;
66800b57cec5SDimitry Andricdef : Pat<(v2i64 (anyext (v2i32 DPR:$Vm))), (VMOVLuv2i64 DPR:$Vm)>;
66810b57cec5SDimitry Andric}
66820b57cec5SDimitry Andric
66830b57cec5SDimitry Andric// Vector Conversions.
66840b57cec5SDimitry Andric
66850b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Integers
66860b57cec5SDimitry Andricdef  VCVTf2sd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
66870b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_sint>;
66880b57cec5SDimitry Andricdef  VCVTf2ud : N2VD<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
66890b57cec5SDimitry Andric                     v2i32, v2f32, fp_to_uint>;
66900b57cec5SDimitry Andricdef  VCVTs2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
66910b57cec5SDimitry Andric                     v2f32, v2i32, sint_to_fp>;
66920b57cec5SDimitry Andricdef  VCVTu2fd : N2VD<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
66930b57cec5SDimitry Andric                     v2f32, v2i32, uint_to_fp>;
66940b57cec5SDimitry Andric
66950b57cec5SDimitry Andricdef  VCVTf2sq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01110, 0, "vcvt", "s32.f32",
66960b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_sint>;
66970b57cec5SDimitry Andricdef  VCVTf2uq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01111, 0, "vcvt", "u32.f32",
66980b57cec5SDimitry Andric                     v4i32, v4f32, fp_to_uint>;
66990b57cec5SDimitry Andricdef  VCVTs2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01100, 0, "vcvt", "f32.s32",
67000b57cec5SDimitry Andric                     v4f32, v4i32, sint_to_fp>;
67010b57cec5SDimitry Andricdef  VCVTu2fq : N2VQ<0b11, 0b11, 0b10, 0b11, 0b01101, 0, "vcvt", "f32.u32",
67020b57cec5SDimitry Andric                     v4f32, v4i32, uint_to_fp>;
67030b57cec5SDimitry Andric
67040b57cec5SDimitry Andricdef  VCVTh2sd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
67050b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_sint>,
67060b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67070b57cec5SDimitry Andricdef  VCVTh2ud : N2VD<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
67080b57cec5SDimitry Andric                     v4i16, v4f16, fp_to_uint>,
67090b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67100b57cec5SDimitry Andricdef  VCVTs2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
67110b57cec5SDimitry Andric                     v4f16, v4i16, sint_to_fp>,
67120b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67130b57cec5SDimitry Andricdef  VCVTu2hd : N2VD<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
67140b57cec5SDimitry Andric                     v4f16, v4i16, uint_to_fp>,
67150b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67160b57cec5SDimitry Andric
67170b57cec5SDimitry Andricdef  VCVTh2sq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01110, 0, "vcvt", "s16.f16",
67180b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_sint>,
67190b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67200b57cec5SDimitry Andricdef  VCVTh2uq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01111, 0, "vcvt", "u16.f16",
67210b57cec5SDimitry Andric                     v8i16, v8f16, fp_to_uint>,
67220b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67230b57cec5SDimitry Andricdef  VCVTs2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01100, 0, "vcvt", "f16.s16",
67240b57cec5SDimitry Andric                     v8f16, v8i16, sint_to_fp>,
67250b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67260b57cec5SDimitry Andricdef  VCVTu2hq : N2VQ<0b11, 0b11, 0b01, 0b11, 0b01101, 0, "vcvt", "f16.u16",
67270b57cec5SDimitry Andric                     v8f16, v8i16, uint_to_fp>,
67280b57cec5SDimitry Andric                Requires<[HasNEON, HasFullFP16]>;
67290b57cec5SDimitry Andric
67300b57cec5SDimitry Andric// VCVT{A, N, P, M}
67310b57cec5SDimitry Andricmulticlass VCVT_FPI<string op, bits<3> op10_8, SDPatternOperator IntS,
67320b57cec5SDimitry Andric                    SDPatternOperator IntU> {
67330b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
67340b57cec5SDimitry Andric    def SDf : N2VDIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
67350b57cec5SDimitry Andric                       "s32.f32", v2i32, v2f32, IntS>, Requires<[HasV8, HasNEON]>;
67360b57cec5SDimitry Andric    def SQf : N2VQIntnp<0b10, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
67370b57cec5SDimitry Andric                       "s32.f32", v4i32, v4f32, IntS>, Requires<[HasV8, HasNEON]>;
67380b57cec5SDimitry Andric    def UDf : N2VDIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
67390b57cec5SDimitry Andric                       "u32.f32", v2i32, v2f32, IntU>, Requires<[HasV8, HasNEON]>;
67400b57cec5SDimitry Andric    def UQf : N2VQIntnp<0b10, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
67410b57cec5SDimitry Andric                       "u32.f32", v4i32, v4f32, IntU>, Requires<[HasV8, HasNEON]>;
67420b57cec5SDimitry Andric    def SDh : N2VDIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
67430b57cec5SDimitry Andric                       "s16.f16", v4i16, v4f16, IntS>,
67440b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
67450b57cec5SDimitry Andric    def SQh : N2VQIntnp<0b01, 0b11, op10_8, 0, NoItinerary, !strconcat("vcvt", op),
67460b57cec5SDimitry Andric                       "s16.f16", v8i16, v8f16, IntS>,
67470b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
67480b57cec5SDimitry Andric    def UDh : N2VDIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
67490b57cec5SDimitry Andric                       "u16.f16", v4i16, v4f16, IntU>,
67500b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
67510b57cec5SDimitry Andric    def UQh : N2VQIntnp<0b01, 0b11, op10_8, 1, NoItinerary, !strconcat("vcvt", op),
67520b57cec5SDimitry Andric                       "u16.f16", v8i16, v8f16, IntU>,
67530b57cec5SDimitry Andric              Requires<[HasV8, HasNEON, HasFullFP16]>;
67540b57cec5SDimitry Andric  }
67550b57cec5SDimitry Andric}
67560b57cec5SDimitry Andric
67570b57cec5SDimitry Andricdefm VCVTAN : VCVT_FPI<"a", 0b000, int_arm_neon_vcvtas, int_arm_neon_vcvtau>;
67580b57cec5SDimitry Andricdefm VCVTNN : VCVT_FPI<"n", 0b001, int_arm_neon_vcvtns, int_arm_neon_vcvtnu>;
67590b57cec5SDimitry Andricdefm VCVTPN : VCVT_FPI<"p", 0b010, int_arm_neon_vcvtps, int_arm_neon_vcvtpu>;
67600b57cec5SDimitry Andricdefm VCVTMN : VCVT_FPI<"m", 0b011, int_arm_neon_vcvtms, int_arm_neon_vcvtmu>;
67610b57cec5SDimitry Andric
67620b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Floating-Point and Fixed-Point.
67630b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTD" in {
67640b57cec5SDimitry Andricdef VCVTf2xsd : N2VCvtD<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
67650b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxs>;
67660b57cec5SDimitry Andricdef VCVTf2xud : N2VCvtD<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
67670b57cec5SDimitry Andric                        v2i32, v2f32, int_arm_neon_vcvtfp2fxu>;
67680b57cec5SDimitry Andricdef VCVTxs2fd : N2VCvtD<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
67690b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxs2fp>;
67700b57cec5SDimitry Andricdef VCVTxu2fd : N2VCvtD<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
67710b57cec5SDimitry Andric                        v2f32, v2i32, int_arm_neon_vcvtfxu2fp>;
67720b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
67730b57cec5SDimitry Andricdef VCVTh2xsd : N2VCvtD<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
67740b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxs>;
67750b57cec5SDimitry Andricdef VCVTh2xud : N2VCvtD<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
67760b57cec5SDimitry Andric                        v4i16, v4f16, int_arm_neon_vcvtfp2fxu>;
67770b57cec5SDimitry Andricdef VCVTxs2hd : N2VCvtD<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
67780b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxs2fp>;
67790b57cec5SDimitry Andricdef VCVTxu2hd : N2VCvtD<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
67800b57cec5SDimitry Andric                        v4f16, v4i16, int_arm_neon_vcvtfxu2fp>;
67810b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
67820b57cec5SDimitry Andric}
67830b57cec5SDimitry Andric
67840b57cec5SDimitry Andriclet DecoderMethod = "DecodeVCVTQ" in {
67850b57cec5SDimitry Andricdef VCVTf2xsq : N2VCvtQ<0, 1, 0b1111, 0, 1, "vcvt", "s32.f32",
67860b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxs>;
67870b57cec5SDimitry Andricdef VCVTf2xuq : N2VCvtQ<1, 1, 0b1111, 0, 1, "vcvt", "u32.f32",
67880b57cec5SDimitry Andric                        v4i32, v4f32, int_arm_neon_vcvtfp2fxu>;
67890b57cec5SDimitry Andricdef VCVTxs2fq : N2VCvtQ<0, 1, 0b1110, 0, 1, "vcvt", "f32.s32",
67900b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxs2fp>;
67910b57cec5SDimitry Andricdef VCVTxu2fq : N2VCvtQ<1, 1, 0b1110, 0, 1, "vcvt", "f32.u32",
67920b57cec5SDimitry Andric                        v4f32, v4i32, int_arm_neon_vcvtfxu2fp>;
67930b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in {
67940b57cec5SDimitry Andricdef VCVTh2xsq : N2VCvtQ<0, 1, 0b1101, 0, 1, "vcvt", "s16.f16",
67950b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxs>;
67960b57cec5SDimitry Andricdef VCVTh2xuq : N2VCvtQ<1, 1, 0b1101, 0, 1, "vcvt", "u16.f16",
67970b57cec5SDimitry Andric                        v8i16, v8f16, int_arm_neon_vcvtfp2fxu>;
67980b57cec5SDimitry Andricdef VCVTxs2hq : N2VCvtQ<0, 1, 0b1100, 0, 1, "vcvt", "f16.s16",
67990b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxs2fp>;
68000b57cec5SDimitry Andricdef VCVTxu2hq : N2VCvtQ<1, 1, 0b1100, 0, 1, "vcvt", "f16.u16",
68010b57cec5SDimitry Andric                        v8f16, v8i16, int_arm_neon_vcvtfxu2fp>;
68020b57cec5SDimitry Andric} // Predicates = [HasNEON, HasFullFP16]
68030b57cec5SDimitry Andric}
68040b57cec5SDimitry Andric
68050b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Dd, $Dm, #0",
68060b57cec5SDimitry Andric                    (VCVTf2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
68070b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Dd, $Dm, #0",
68080b57cec5SDimitry Andric                    (VCVTf2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
68090b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Dd, $Dm, #0",
68100b57cec5SDimitry Andric                    (VCVTs2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
68110b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Dd, $Dm, #0",
68120b57cec5SDimitry Andric                    (VCVTu2fd DPR:$Dd, DPR:$Dm, pred:$p)>;
68130b57cec5SDimitry Andric
68140b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s32.f32 $Qd, $Qm, #0",
68150b57cec5SDimitry Andric                    (VCVTf2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
68160b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u32.f32 $Qd, $Qm, #0",
68170b57cec5SDimitry Andric                    (VCVTf2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
68180b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.s32 $Qd, $Qm, #0",
68190b57cec5SDimitry Andric                    (VCVTs2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
68200b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f32.u32 $Qd, $Qm, #0",
68210b57cec5SDimitry Andric                    (VCVTu2fq QPR:$Qd, QPR:$Qm, pred:$p)>;
68220b57cec5SDimitry Andric
68230b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Dd, $Dm, #0",
68240b57cec5SDimitry Andric                    (VCVTh2sd DPR:$Dd, DPR:$Dm, pred:$p)>;
68250b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Dd, $Dm, #0",
68260b57cec5SDimitry Andric                    (VCVTh2ud DPR:$Dd, DPR:$Dm, pred:$p)>;
68270b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Dd, $Dm, #0",
68280b57cec5SDimitry Andric                    (VCVTs2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
68290b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Dd, $Dm, #0",
68300b57cec5SDimitry Andric                    (VCVTu2hd DPR:$Dd, DPR:$Dm, pred:$p)>;
68310b57cec5SDimitry Andric
68320b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.s16.f16 $Qd, $Qm, #0",
68330b57cec5SDimitry Andric                    (VCVTh2sq QPR:$Qd, QPR:$Qm, pred:$p)>;
68340b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.u16.f16 $Qd, $Qm, #0",
68350b57cec5SDimitry Andric                    (VCVTh2uq QPR:$Qd, QPR:$Qm, pred:$p)>;
68360b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.s16 $Qd, $Qm, #0",
68370b57cec5SDimitry Andric                    (VCVTs2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
68380b57cec5SDimitry Andricdef : NEONInstAlias<"vcvt${p}.f16.u16 $Qd, $Qm, #0",
68390b57cec5SDimitry Andric                    (VCVTu2hq QPR:$Qd, QPR:$Qm, pred:$p)>;
68400b57cec5SDimitry Andric
68410b57cec5SDimitry Andric
68420b57cec5SDimitry Andric//   VCVT     : Vector Convert Between Half-Precision and Single-Precision.
68430b57cec5SDimitry Andricdef  VCVTf2h  : N2VNInt<0b11, 0b11, 0b01, 0b10, 0b01100, 0, 0,
68440b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f16.f32",
68450b57cec5SDimitry Andric                        v4i16, v4f32, int_arm_neon_vcvtfp2hf>,
68460b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
68470b57cec5SDimitry Andricdef  VCVTh2f  : N2VLInt<0b11, 0b11, 0b01, 0b10, 0b01110, 0, 0,
68480b57cec5SDimitry Andric                        IIC_VUNAQ, "vcvt", "f32.f16",
68490b57cec5SDimitry Andric                        v4f32, v4i16, int_arm_neon_vcvthf2fp>,
68500b57cec5SDimitry Andric                Requires<[HasNEON, HasFP16]>;
68510b57cec5SDimitry Andric
68520b57cec5SDimitry Andric// Vector Reverse.
68530b57cec5SDimitry Andric
68540b57cec5SDimitry Andric//   VREV64   : Vector Reverse elements within 64-bit doublewords
68550b57cec5SDimitry Andric
68560b57cec5SDimitry Andricclass VREV64D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
68570b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 0, 0, (outs DPR:$Vd),
68580b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
68590b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
68600b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev64 (Ty DPR:$Vm))))]>;
68610b57cec5SDimitry Andricclass VREV64Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
68620b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00000, 1, 0, (outs QPR:$Vd),
68630b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
68640b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
68650b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev64 (Ty QPR:$Vm))))]>;
68660b57cec5SDimitry Andric
68670b57cec5SDimitry Andricdef VREV64d8  : VREV64D<0b00, "vrev64", "8", v8i8>;
68680b57cec5SDimitry Andricdef VREV64d16 : VREV64D<0b01, "vrev64", "16", v4i16>;
68690b57cec5SDimitry Andricdef VREV64d32 : VREV64D<0b10, "vrev64", "32", v2i32>;
68700b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
68710b57cec5SDimitry Andricdef : Pat<(v2f32 (ARMvrev64 (v2f32 DPR:$Vm))), (VREV64d32 DPR:$Vm)>;
68720b57cec5SDimitry Andric}
68730b57cec5SDimitry Andric
68740b57cec5SDimitry Andricdef VREV64q8  : VREV64Q<0b00, "vrev64", "8", v16i8>;
68750b57cec5SDimitry Andricdef VREV64q16 : VREV64Q<0b01, "vrev64", "16", v8i16>;
68760b57cec5SDimitry Andricdef VREV64q32 : VREV64Q<0b10, "vrev64", "32", v4i32>;
68770b57cec5SDimitry Andric
68780b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
6879480093f4SDimitry Andric  def : Pat<(v4f32 (ARMvrev64 (v4f32 QPR:$Vm))),
6880480093f4SDimitry Andric            (VREV64q32 QPR:$Vm)>;
6881480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev64 (v8f16 QPR:$Vm))),
6882480093f4SDimitry Andric            (VREV64q16 QPR:$Vm)>;
6883480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev64 (v4f16 DPR:$Vm))),
6884480093f4SDimitry Andric            (VREV64d16 DPR:$Vm)>;
68850b57cec5SDimitry Andric}
68860b57cec5SDimitry Andric
68870b57cec5SDimitry Andric//   VREV32   : Vector Reverse elements within 32-bit words
68880b57cec5SDimitry Andric
68890b57cec5SDimitry Andricclass VREV32D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
68900b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 0, 0, (outs DPR:$Vd),
68910b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
68920b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
68930b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev32 (Ty DPR:$Vm))))]>;
68940b57cec5SDimitry Andricclass VREV32Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
68950b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00001, 1, 0, (outs QPR:$Vd),
68960b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
68970b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
68980b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev32 (Ty QPR:$Vm))))]>;
68990b57cec5SDimitry Andric
69000b57cec5SDimitry Andricdef VREV32d8  : VREV32D<0b00, "vrev32", "8", v8i8>;
69010b57cec5SDimitry Andricdef VREV32d16 : VREV32D<0b01, "vrev32", "16", v4i16>;
69020b57cec5SDimitry Andric
69030b57cec5SDimitry Andricdef VREV32q8  : VREV32Q<0b00, "vrev32", "8", v16i8>;
69040b57cec5SDimitry Andricdef VREV32q16 : VREV32Q<0b01, "vrev32", "16", v8i16>;
69050b57cec5SDimitry Andric
6906480093f4SDimitry Andriclet Predicates = [HasNEON] in {
6907480093f4SDimitry Andric  def : Pat<(v8f16 (ARMvrev32 (v8f16 QPR:$Vm))),
6908480093f4SDimitry Andric            (VREV32q16 QPR:$Vm)>;
6909480093f4SDimitry Andric  def : Pat<(v4f16 (ARMvrev32 (v4f16 DPR:$Vm))),
6910480093f4SDimitry Andric            (VREV32d16 DPR:$Vm)>;
6911480093f4SDimitry Andric}
6912480093f4SDimitry Andric
69130b57cec5SDimitry Andric//   VREV16   : Vector Reverse elements within 16-bit halfwords
69140b57cec5SDimitry Andric
69150b57cec5SDimitry Andricclass VREV16D<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69160b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 0, 0, (outs DPR:$Vd),
69170b57cec5SDimitry Andric        (ins DPR:$Vm), IIC_VMOVD,
69180b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69190b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (ARMvrev16 (Ty DPR:$Vm))))]>;
69200b57cec5SDimitry Andricclass VREV16Q<bits<2> op19_18, string OpcodeStr, string Dt, ValueType Ty>
69210b57cec5SDimitry Andric  : N2V<0b11, 0b11, op19_18, 0b00, 0b00010, 1, 0, (outs QPR:$Vd),
69220b57cec5SDimitry Andric        (ins QPR:$Vm), IIC_VMOVQ,
69230b57cec5SDimitry Andric        OpcodeStr, Dt, "$Vd, $Vm", "",
69240b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (ARMvrev16 (Ty QPR:$Vm))))]>;
69250b57cec5SDimitry Andric
69260b57cec5SDimitry Andricdef VREV16d8  : VREV16D<0b00, "vrev16", "8", v8i8>;
69270b57cec5SDimitry Andricdef VREV16q8  : VREV16Q<0b00, "vrev16", "8", v16i8>;
69280b57cec5SDimitry Andric
69290b57cec5SDimitry Andric// Other Vector Shuffles.
69300b57cec5SDimitry Andric
69310b57cec5SDimitry Andric//  Aligned extractions: really just dropping registers
69320b57cec5SDimitry Andric
69330b57cec5SDimitry Andricclass AlignedVEXTq<ValueType DestTy, ValueType SrcTy, SDNodeXForm LaneCVT>
69340b57cec5SDimitry Andric      : Pat<(DestTy (vector_extract_subvec (SrcTy QPR:$src), (i32 imm:$start))),
69350b57cec5SDimitry Andric             (EXTRACT_SUBREG (SrcTy QPR:$src), (LaneCVT imm:$start))>,
69360b57cec5SDimitry Andric        Requires<[HasNEON]>;
69370b57cec5SDimitry Andric
69380b57cec5SDimitry Andricdef : AlignedVEXTq<v8i8, v16i8, DSubReg_i8_reg>;
69390b57cec5SDimitry Andric
69400b57cec5SDimitry Andricdef : AlignedVEXTq<v4i16, v8i16, DSubReg_i16_reg>;
69410b57cec5SDimitry Andric
69420b57cec5SDimitry Andricdef : AlignedVEXTq<v2i32, v4i32, DSubReg_i32_reg>;
69430b57cec5SDimitry Andric
69440b57cec5SDimitry Andricdef : AlignedVEXTq<v1i64, v2i64, DSubReg_f64_reg>;
69450b57cec5SDimitry Andric
69460b57cec5SDimitry Andricdef : AlignedVEXTq<v2f32, v4f32, DSubReg_i32_reg>;
69470b57cec5SDimitry Andric
69480b57cec5SDimitry Andricdef : AlignedVEXTq<v4f16, v8f16, DSubReg_i16_reg>; // v8f16 -> v4f16
69490b57cec5SDimitry Andric
69500b57cec5SDimitry Andric//   VEXT     : Vector Extract
69510b57cec5SDimitry Andric
69520b57cec5SDimitry Andric
69530b57cec5SDimitry Andric// All of these have a two-operand InstAlias.
69540b57cec5SDimitry Andriclet TwoOperandAliasConstraint = "$Vn = $Vd" in {
69550b57cec5SDimitry Andricclass VEXTd<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
69560b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},0,0, (outs DPR:$Vd),
69570b57cec5SDimitry Andric        (ins DPR:$Vn, DPR:$Vm, immTy:$index), NVExtFrm,
69580b57cec5SDimitry Andric        IIC_VEXTD, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
69590b57cec5SDimitry Andric        [(set DPR:$Vd, (Ty (NEONvext (Ty DPR:$Vn),
69600b57cec5SDimitry Andric                                     (Ty DPR:$Vm), imm:$index)))]> {
69610b57cec5SDimitry Andric  bits<3> index;
69620b57cec5SDimitry Andric  let Inst{11} = 0b0;
69630b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
69640b57cec5SDimitry Andric}
69650b57cec5SDimitry Andric
69660b57cec5SDimitry Andricclass VEXTq<string OpcodeStr, string Dt, ValueType Ty, Operand immTy>
69670b57cec5SDimitry Andric  : N3V<0,1,0b11,{?,?,?,?},1,0, (outs QPR:$Vd),
69680b57cec5SDimitry Andric        (ins QPR:$Vn, QPR:$Vm, imm0_15:$index), NVExtFrm,
69690b57cec5SDimitry Andric        IIC_VEXTQ, OpcodeStr, Dt, "$Vd, $Vn, $Vm, $index", "",
69700b57cec5SDimitry Andric        [(set QPR:$Vd, (Ty (NEONvext (Ty QPR:$Vn),
69710b57cec5SDimitry Andric                                     (Ty QPR:$Vm), imm:$index)))]> {
69720b57cec5SDimitry Andric  bits<4> index;
69730b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
69740b57cec5SDimitry Andric}
69750b57cec5SDimitry Andric}
69760b57cec5SDimitry Andric
69770b57cec5SDimitry Andricdef VEXTd8  : VEXTd<"vext", "8",  v8i8, imm0_7> {
69780b57cec5SDimitry Andric  let Inst{10-8} = index{2-0};
69790b57cec5SDimitry Andric}
69800b57cec5SDimitry Andricdef VEXTd16 : VEXTd<"vext", "16", v4i16, imm0_3> {
69810b57cec5SDimitry Andric  let Inst{10-9} = index{1-0};
69820b57cec5SDimitry Andric  let Inst{8}    = 0b0;
69830b57cec5SDimitry Andric}
69840b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
69850b57cec5SDimitry Andricdef : Pat<(v4f16 (NEONvext (v4f16 DPR:$Vn), (v4f16 DPR:$Vm), (i32 imm:$index))),
69860b57cec5SDimitry Andric          (VEXTd16 DPR:$Vn, DPR:$Vm, imm:$index)>;
69870b57cec5SDimitry Andric}
69880b57cec5SDimitry Andric
69890b57cec5SDimitry Andricdef VEXTd32 : VEXTd<"vext", "32", v2i32, imm0_1> {
69900b57cec5SDimitry Andric  let Inst{10}     = index{0};
69910b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
69920b57cec5SDimitry Andric}
69930b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
69940b57cec5SDimitry Andricdef : Pat<(v2f32 (NEONvext (v2f32 DPR:$Vn), (v2f32 DPR:$Vm), (i32 imm:$index))),
69950b57cec5SDimitry Andric          (VEXTd32 DPR:$Vn, DPR:$Vm, imm:$index)>;
69960b57cec5SDimitry Andric}
69970b57cec5SDimitry Andric
69980b57cec5SDimitry Andricdef VEXTq8  : VEXTq<"vext", "8",  v16i8, imm0_15> {
69990b57cec5SDimitry Andric  let Inst{11-8} = index{3-0};
70000b57cec5SDimitry Andric}
70010b57cec5SDimitry Andricdef VEXTq16 : VEXTq<"vext", "16", v8i16, imm0_7> {
70020b57cec5SDimitry Andric  let Inst{11-9} = index{2-0};
70030b57cec5SDimitry Andric  let Inst{8}    = 0b0;
70040b57cec5SDimitry Andric}
70050b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
70060b57cec5SDimitry Andricdef : Pat<(v8f16 (NEONvext (v8f16 QPR:$Vn), (v8f16 QPR:$Vm), (i32 imm:$index))),
70070b57cec5SDimitry Andric          (VEXTq16 QPR:$Vn, QPR:$Vm, imm:$index)>;
70080b57cec5SDimitry Andric}
70090b57cec5SDimitry Andric
70100b57cec5SDimitry Andricdef VEXTq32 : VEXTq<"vext", "32", v4i32, imm0_3> {
70110b57cec5SDimitry Andric  let Inst{11-10} = index{1-0};
70120b57cec5SDimitry Andric  let Inst{9-8}    = 0b00;
70130b57cec5SDimitry Andric}
70140b57cec5SDimitry Andricdef VEXTq64 : VEXTq<"vext", "64", v2i64, imm0_1> {
70150b57cec5SDimitry Andric  let Inst{11} = index{0};
70160b57cec5SDimitry Andric  let Inst{10-8}    = 0b000;
70170b57cec5SDimitry Andric}
70180b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
70190b57cec5SDimitry Andricdef : Pat<(v4f32 (NEONvext (v4f32 QPR:$Vn), (v4f32 QPR:$Vm), (i32 imm:$index))),
70200b57cec5SDimitry Andric          (VEXTq32 QPR:$Vn, QPR:$Vm, imm:$index)>;
70210b57cec5SDimitry Andric}
70220b57cec5SDimitry Andric
70230b57cec5SDimitry Andric//   VTRN     : Vector Transpose
70240b57cec5SDimitry Andric
70250b57cec5SDimitry Andricdef  VTRNd8   : N2VDShuffle<0b00, 0b00001, "vtrn", "8">;
70260b57cec5SDimitry Andricdef  VTRNd16  : N2VDShuffle<0b01, 0b00001, "vtrn", "16">;
70270b57cec5SDimitry Andricdef  VTRNd32  : N2VDShuffle<0b10, 0b00001, "vtrn", "32">;
70280b57cec5SDimitry Andric
70290b57cec5SDimitry Andricdef  VTRNq8   : N2VQShuffle<0b00, 0b00001, IIC_VPERMQ, "vtrn", "8">;
70300b57cec5SDimitry Andricdef  VTRNq16  : N2VQShuffle<0b01, 0b00001, IIC_VPERMQ, "vtrn", "16">;
70310b57cec5SDimitry Andricdef  VTRNq32  : N2VQShuffle<0b10, 0b00001, IIC_VPERMQ, "vtrn", "32">;
70320b57cec5SDimitry Andric
70330b57cec5SDimitry Andric//   VUZP     : Vector Unzip (Deinterleave)
70340b57cec5SDimitry Andric
70350b57cec5SDimitry Andricdef  VUZPd8   : N2VDShuffle<0b00, 0b00010, "vuzp", "8">;
70360b57cec5SDimitry Andricdef  VUZPd16  : N2VDShuffle<0b01, 0b00010, "vuzp", "16">;
70370b57cec5SDimitry Andric// vuzp.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
70380b57cec5SDimitry Andricdef : NEONInstAlias<"vuzp${p}.32 $Dd, $Dm",
70390b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
70400b57cec5SDimitry Andric
70410b57cec5SDimitry Andricdef  VUZPq8   : N2VQShuffle<0b00, 0b00010, IIC_VPERMQ3, "vuzp", "8">;
70420b57cec5SDimitry Andricdef  VUZPq16  : N2VQShuffle<0b01, 0b00010, IIC_VPERMQ3, "vuzp", "16">;
70430b57cec5SDimitry Andricdef  VUZPq32  : N2VQShuffle<0b10, 0b00010, IIC_VPERMQ3, "vuzp", "32">;
70440b57cec5SDimitry Andric
70450b57cec5SDimitry Andric//   VZIP     : Vector Zip (Interleave)
70460b57cec5SDimitry Andric
70470b57cec5SDimitry Andricdef  VZIPd8   : N2VDShuffle<0b00, 0b00011, "vzip", "8">;
70480b57cec5SDimitry Andricdef  VZIPd16  : N2VDShuffle<0b01, 0b00011, "vzip", "16">;
70490b57cec5SDimitry Andric// vzip.32 Dd, Dm is a pseudo-instruction expanded to vtrn.32 Dd, Dm.
70500b57cec5SDimitry Andricdef : NEONInstAlias<"vzip${p}.32 $Dd, $Dm",
70510b57cec5SDimitry Andric                    (VTRNd32 DPR:$Dd, DPR:$Dm, pred:$p)>;
70520b57cec5SDimitry Andric
70530b57cec5SDimitry Andricdef  VZIPq8   : N2VQShuffle<0b00, 0b00011, IIC_VPERMQ3, "vzip", "8">;
70540b57cec5SDimitry Andricdef  VZIPq16  : N2VQShuffle<0b01, 0b00011, IIC_VPERMQ3, "vzip", "16">;
70550b57cec5SDimitry Andricdef  VZIPq32  : N2VQShuffle<0b10, 0b00011, IIC_VPERMQ3, "vzip", "32">;
70560b57cec5SDimitry Andric
70570b57cec5SDimitry Andric// Vector Table Lookup and Table Extension.
70580b57cec5SDimitry Andric
70590b57cec5SDimitry Andric//   VTBL     : Vector Table Lookup
70600b57cec5SDimitry Andriclet DecoderMethod = "DecodeTBLInstruction" in {
70610b57cec5SDimitry Andricdef  VTBL1
70620b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,0,0, (outs DPR:$Vd),
70630b57cec5SDimitry Andric        (ins VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB1,
70640b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "",
70650b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (NEONvtbl1 VecListOneD:$Vn, DPR:$Vm)))]>;
70660b57cec5SDimitry Andric
70670b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
70680b57cec5SDimitry Andricdef  VTBL2
70690b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,0,0, (outs DPR:$Vd),
70700b57cec5SDimitry Andric        (ins VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB2,
70710b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
70720b57cec5SDimitry Andricdef  VTBL3
70730b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,0,0, (outs DPR:$Vd),
70740b57cec5SDimitry Andric        (ins VecListThreeD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTB3,
70750b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
70760b57cec5SDimitry Andricdef  VTBL4
70770b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,0,0, (outs DPR:$Vd),
70780b57cec5SDimitry Andric        (ins VecListFourD:$Vn, DPR:$Vm),
70790b57cec5SDimitry Andric        NVTBLFrm, IIC_VTB4,
70800b57cec5SDimitry Andric        "vtbl", "8", "$Vd, $Vn, $Vm", "", []>;
70810b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
70820b57cec5SDimitry Andric
70830b57cec5SDimitry Andricdef  VTBL3Pseudo
70840b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB3, "", []>;
70850b57cec5SDimitry Andricdef  VTBL4Pseudo
70860b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins QQPR:$tbl, DPR:$src), IIC_VTB4, "", []>;
70870b57cec5SDimitry Andric
70880b57cec5SDimitry Andric//   VTBX     : Vector Table Extension
70890b57cec5SDimitry Andricdef  VTBX1
70900b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1000,1,0, (outs DPR:$Vd),
70910b57cec5SDimitry Andric        (ins DPR:$orig, VecListOneD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX1,
70920b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd",
70930b57cec5SDimitry Andric        [(set DPR:$Vd, (v8i8 (int_arm_neon_vtbx1
70940b57cec5SDimitry Andric                               DPR:$orig, VecListOneD:$Vn, DPR:$Vm)))]>;
70950b57cec5SDimitry Andriclet hasExtraSrcRegAllocReq = 1 in {
70960b57cec5SDimitry Andricdef  VTBX2
70970b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1001,1,0, (outs DPR:$Vd),
70980b57cec5SDimitry Andric        (ins DPR:$orig, VecListDPair:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX2,
70990b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm", "$orig = $Vd", []>;
71000b57cec5SDimitry Andricdef  VTBX3
71010b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1010,1,0, (outs DPR:$Vd),
71020b57cec5SDimitry Andric        (ins DPR:$orig, VecListThreeD:$Vn, DPR:$Vm),
71030b57cec5SDimitry Andric        NVTBLFrm, IIC_VTBX3,
71040b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
71050b57cec5SDimitry Andric        "$orig = $Vd", []>;
71060b57cec5SDimitry Andricdef  VTBX4
71070b57cec5SDimitry Andric  : N3V<1,1,0b11,0b1011,1,0, (outs DPR:$Vd),
71080b57cec5SDimitry Andric        (ins DPR:$orig, VecListFourD:$Vn, DPR:$Vm), NVTBLFrm, IIC_VTBX4,
71090b57cec5SDimitry Andric        "vtbx", "8", "$Vd, $Vn, $Vm",
71100b57cec5SDimitry Andric        "$orig = $Vd", []>;
71110b57cec5SDimitry Andric} // hasExtraSrcRegAllocReq = 1
71120b57cec5SDimitry Andric
71130b57cec5SDimitry Andricdef  VTBX3Pseudo
71140b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
71150b57cec5SDimitry Andric                IIC_VTBX3, "$orig = $dst", []>;
71160b57cec5SDimitry Andricdef  VTBX4Pseudo
71170b57cec5SDimitry Andric  : PseudoNeonI<(outs DPR:$dst), (ins DPR:$orig, QQPR:$tbl, DPR:$src),
71180b57cec5SDimitry Andric                IIC_VTBX4, "$orig = $dst", []>;
71190b57cec5SDimitry Andric} // DecoderMethod = "DecodeTBLInstruction"
71200b57cec5SDimitry Andric
71210b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
71220b57cec5SDimitry Andricdef : Pat<(v8i8 (NEONvtbl2 v8i8:$Vn0, v8i8:$Vn1, v8i8:$Vm)),
71230b57cec5SDimitry Andric          (v8i8 (VTBL2 (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
71240b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
71250b57cec5SDimitry Andric                       v8i8:$Vm))>;
71260b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx2 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
71270b57cec5SDimitry Andric                                    v8i8:$Vm)),
71280b57cec5SDimitry Andric          (v8i8 (VTBX2 v8i8:$orig,
71290b57cec5SDimitry Andric                       (REG_SEQUENCE DPair, v8i8:$Vn0, dsub_0,
71300b57cec5SDimitry Andric                                            v8i8:$Vn1, dsub_1),
71310b57cec5SDimitry Andric                       v8i8:$Vm))>;
71320b57cec5SDimitry Andric
71330b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl3 v8i8:$Vn0, v8i8:$Vn1,
71340b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
71350b57cec5SDimitry Andric          (v8i8 (VTBL3Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
71360b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
71370b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
71380b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
71390b57cec5SDimitry Andric                             v8i8:$Vm))>;
71400b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx3 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
71410b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vm)),
71420b57cec5SDimitry Andric          (v8i8 (VTBX3Pseudo v8i8:$orig,
71430b57cec5SDimitry Andric                             (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
71440b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
71450b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
71460b57cec5SDimitry Andric                                                 (v8i8 (IMPLICIT_DEF)), dsub_3),
71470b57cec5SDimitry Andric                             v8i8:$Vm))>;
71480b57cec5SDimitry Andric
71490b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbl4 v8i8:$Vn0, v8i8:$Vn1,
71500b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
71510b57cec5SDimitry Andric          (v8i8 (VTBL4Pseudo (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
71520b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
71530b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
71540b57cec5SDimitry Andric                                                 v8i8:$Vn3, dsub_3),
71550b57cec5SDimitry Andric                             v8i8:$Vm))>;
71560b57cec5SDimitry Andricdef : Pat<(v8i8 (int_arm_neon_vtbx4 v8i8:$orig, v8i8:$Vn0, v8i8:$Vn1,
71570b57cec5SDimitry Andric                                    v8i8:$Vn2, v8i8:$Vn3, v8i8:$Vm)),
71580b57cec5SDimitry Andric          (v8i8 (VTBX4Pseudo v8i8:$orig,
71590b57cec5SDimitry Andric                             (REG_SEQUENCE QQPR, v8i8:$Vn0, dsub_0,
71600b57cec5SDimitry Andric                                                 v8i8:$Vn1, dsub_1,
71610b57cec5SDimitry Andric                                                 v8i8:$Vn2, dsub_2,
71620b57cec5SDimitry Andric                                                 v8i8:$Vn3, dsub_3),
71630b57cec5SDimitry Andric                             v8i8:$Vm))>;
71640b57cec5SDimitry Andric}
71650b57cec5SDimitry Andric
71660b57cec5SDimitry Andric// VRINT      : Vector Rounding
71670b57cec5SDimitry Andricmulticlass VRINT_FPI<string op, bits<3> op9_7, SDPatternOperator Int> {
71680b57cec5SDimitry Andric  let PostEncoderMethod = "NEONThumb2V8PostEncoder", DecoderNamespace = "v8NEON" in {
71690b57cec5SDimitry Andric    def Df : N2VDIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
71700b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
71710b57cec5SDimitry Andric                      v2f32, v2f32, Int>, Requires<[HasV8, HasNEON]> {
71720b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
71730b57cec5SDimitry Andric    }
71740b57cec5SDimitry Andric    def Qf : N2VQIntnp<0b10, 0b10, 0b100, 0, NoItinerary,
71750b57cec5SDimitry Andric                      !strconcat("vrint", op), "f32",
71760b57cec5SDimitry Andric                      v4f32, v4f32, Int>, Requires<[HasV8, HasNEON]> {
71770b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
71780b57cec5SDimitry Andric    }
71790b57cec5SDimitry Andric    def Dh : N2VDIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
71800b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
71810b57cec5SDimitry Andric                      v4f16, v4f16, Int>,
71820b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
71830b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
71840b57cec5SDimitry Andric    }
71850b57cec5SDimitry Andric    def Qh : N2VQIntnp<0b01, 0b10, 0b100, 0, NoItinerary,
71860b57cec5SDimitry Andric                      !strconcat("vrint", op), "f16",
71870b57cec5SDimitry Andric                      v8f16, v8f16, Int>,
71880b57cec5SDimitry Andric             Requires<[HasV8, HasNEON, HasFullFP16]> {
71890b57cec5SDimitry Andric      let Inst{9-7} = op9_7;
71900b57cec5SDimitry Andric    }
71910b57cec5SDimitry Andric  }
71920b57cec5SDimitry Andric
71930b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Dd, $Dm"),
71940b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Df") DPR:$Dd, DPR:$Dm)>;
71950b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f32.f32\t$Qd, $Qm"),
71960b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qf") QPR:$Qd, QPR:$Qm)>;
71970b57cec5SDimitry Andric  let Predicates = [HasNEON, HasFullFP16] in {
71980b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Dd, $Dm"),
71990b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Dh") DPR:$Dd, DPR:$Dm)>;
72000b57cec5SDimitry Andric  def : NEONInstAlias<!strconcat("vrint", op, ".f16.f16\t$Qd, $Qm"),
72010b57cec5SDimitry Andric                  (!cast<Instruction>(NAME#"Qh") QPR:$Qd, QPR:$Qm)>;
72020b57cec5SDimitry Andric  }
72030b57cec5SDimitry Andric}
72040b57cec5SDimitry Andric
72050b57cec5SDimitry Andricdefm VRINTNN : VRINT_FPI<"n", 0b000, int_arm_neon_vrintn>;
72060b57cec5SDimitry Andricdefm VRINTXN : VRINT_FPI<"x", 0b001, int_arm_neon_vrintx>;
72070b57cec5SDimitry Andricdefm VRINTAN : VRINT_FPI<"a", 0b010, int_arm_neon_vrinta>;
72080b57cec5SDimitry Andricdefm VRINTZN : VRINT_FPI<"z", 0b011, int_arm_neon_vrintz>;
72090b57cec5SDimitry Andricdefm VRINTMN : VRINT_FPI<"m", 0b101, int_arm_neon_vrintm>;
72100b57cec5SDimitry Andricdefm VRINTPN : VRINT_FPI<"p", 0b111, int_arm_neon_vrintp>;
72110b57cec5SDimitry Andric
72120b57cec5SDimitry Andric// Cryptography instructions
72130b57cec5SDimitry Andriclet PostEncoderMethod = "NEONThumb2DataIPostEncoder",
72140b57cec5SDimitry Andric    DecoderNamespace = "v8Crypto", hasSideEffects = 0 in {
72150b57cec5SDimitry Andric  class AES<string op, bit op7, bit op6, SDPatternOperator Int>
72160b57cec5SDimitry Andric    : N2VQIntXnp<0b00, 0b00, 0b011, op6, op7, NoItinerary,
72170b57cec5SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>,
72180b57cec5SDimitry Andric      Requires<[HasV8, HasCrypto]>;
72190b57cec5SDimitry Andric  class AES2Op<string op, bit op7, bit op6, SDPatternOperator Int>
72200b57cec5SDimitry Andric    : N2VQIntX2np<0b00, 0b00, 0b011, op6, op7, NoItinerary,
72210b57cec5SDimitry Andric                 !strconcat("aes", op), "8", v16i8, v16i8, Int>,
72220b57cec5SDimitry Andric      Requires<[HasV8, HasCrypto]>;
72230b57cec5SDimitry Andric  class N2SHA<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
72240b57cec5SDimitry Andric              SDPatternOperator Int>
72250b57cec5SDimitry Andric    : N2VQIntXnp<0b10, op17_16, op10_8, op6, op7, NoItinerary,
72260b57cec5SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>,
72270b57cec5SDimitry Andric      Requires<[HasV8, HasCrypto]>;
72280b57cec5SDimitry Andric  class N2SHA2Op<string op, bits<2> op17_16, bits<3> op10_8, bit op7, bit op6,
72290b57cec5SDimitry Andric              SDPatternOperator Int>
72300b57cec5SDimitry Andric    : N2VQIntX2np<0b10, op17_16, op10_8, op6, op7, NoItinerary,
72310b57cec5SDimitry Andric                 !strconcat("sha", op), "32", v4i32, v4i32, Int>,
72320b57cec5SDimitry Andric      Requires<[HasV8, HasCrypto]>;
72330b57cec5SDimitry Andric  class N3SHA3Op<string op, bits<5> op27_23, bits<2> op21_20, SDPatternOperator Int>
72340b57cec5SDimitry Andric    : N3VQInt3np<op27_23, op21_20, 0b1100, 1, 0, N3RegFrm, NoItinerary,
72350b57cec5SDimitry Andric                !strconcat("sha", op), "32", v4i32, v4i32, Int, 0>,
72360b57cec5SDimitry Andric      Requires<[HasV8, HasCrypto]>;
72370b57cec5SDimitry Andric}
72380b57cec5SDimitry Andric
72390b57cec5SDimitry Andricdef AESD : AES2Op<"d", 0, 1, int_arm_neon_aesd>;
72400b57cec5SDimitry Andricdef AESE : AES2Op<"e", 0, 0, int_arm_neon_aese>;
72410b57cec5SDimitry Andricdef AESIMC : AES<"imc", 1, 1, int_arm_neon_aesimc>;
72420b57cec5SDimitry Andricdef AESMC : AES<"mc", 1, 0, int_arm_neon_aesmc>;
72430b57cec5SDimitry Andric
72440b57cec5SDimitry Andricdef SHA1H : N2SHA<"1h", 0b01, 0b010, 1, 1, null_frag>;
72450b57cec5SDimitry Andricdef SHA1SU1 : N2SHA2Op<"1su1", 0b10, 0b011, 1, 0, int_arm_neon_sha1su1>;
72460b57cec5SDimitry Andricdef SHA256SU0 : N2SHA2Op<"256su0", 0b10, 0b011, 1, 1, int_arm_neon_sha256su0>;
72470b57cec5SDimitry Andricdef SHA1C : N3SHA3Op<"1c", 0b00100, 0b00, null_frag>;
72480b57cec5SDimitry Andricdef SHA1M : N3SHA3Op<"1m", 0b00100, 0b10, null_frag>;
72490b57cec5SDimitry Andricdef SHA1P : N3SHA3Op<"1p", 0b00100, 0b01, null_frag>;
72500b57cec5SDimitry Andricdef SHA1SU0 : N3SHA3Op<"1su0", 0b00100, 0b11, int_arm_neon_sha1su0>;
72510b57cec5SDimitry Andricdef SHA256H : N3SHA3Op<"256h", 0b00110, 0b00, int_arm_neon_sha256h>;
72520b57cec5SDimitry Andricdef SHA256H2 : N3SHA3Op<"256h2", 0b00110, 0b01, int_arm_neon_sha256h2>;
72530b57cec5SDimitry Andricdef SHA256SU1 : N3SHA3Op<"256su1", 0b00110, 0b10, int_arm_neon_sha256su1>;
72540b57cec5SDimitry Andric
72550b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
72560b57cec5SDimitry Andricdef : Pat<(i32 (int_arm_neon_sha1h i32:$Rn)),
72570b57cec5SDimitry Andric          (COPY_TO_REGCLASS (f32 (EXTRACT_SUBREG
72580b57cec5SDimitry Andric              (SHA1H (SUBREG_TO_REG (i64 0),
72590b57cec5SDimitry Andric                                    (f32 (COPY_TO_REGCLASS i32:$Rn, SPR)),
72600b57cec5SDimitry Andric                                    ssub_0)),
72610b57cec5SDimitry Andric              ssub_0)), GPR)>;
72620b57cec5SDimitry Andric
72630b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1c v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
72640b57cec5SDimitry Andric          (SHA1C v4i32:$hash_abcd,
72650b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
72660b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
72670b57cec5SDimitry Andric                                ssub_0),
72680b57cec5SDimitry Andric                 v4i32:$wk)>;
72690b57cec5SDimitry Andric
72700b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1m v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
72710b57cec5SDimitry Andric          (SHA1M v4i32:$hash_abcd,
72720b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
72730b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
72740b57cec5SDimitry Andric                                ssub_0),
72750b57cec5SDimitry Andric                 v4i32:$wk)>;
72760b57cec5SDimitry Andric
72770b57cec5SDimitry Andricdef : Pat<(v4i32 (int_arm_neon_sha1p v4i32:$hash_abcd, i32:$hash_e, v4i32:$wk)),
72780b57cec5SDimitry Andric          (SHA1P v4i32:$hash_abcd,
72790b57cec5SDimitry Andric                 (SUBREG_TO_REG (i64 0),
72800b57cec5SDimitry Andric                                (f32 (COPY_TO_REGCLASS i32:$hash_e, SPR)),
72810b57cec5SDimitry Andric                                ssub_0),
72820b57cec5SDimitry Andric                 v4i32:$wk)>;
72830b57cec5SDimitry Andric}
72840b57cec5SDimitry Andric
72850b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
72860b57cec5SDimitry Andric// NEON instructions for single-precision FP math
72870b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
72880b57cec5SDimitry Andric
72890b57cec5SDimitry Andricclass N2VSPat<SDNode OpNode, NeonI Inst>
72900b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a)),
72910b57cec5SDimitry Andric              (EXTRACT_SUBREG
72920b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
72930b57cec5SDimitry Andric                (INSERT_SUBREG
72940b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
72950b57cec5SDimitry Andric                 SPR:$a, ssub_0)), DPR_VFP2)), ssub_0)>;
72960b57cec5SDimitry Andric
72970b57cec5SDimitry Andricclass N3VSPat<SDNode OpNode, NeonI Inst>
72980b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$a, SPR:$b)),
72990b57cec5SDimitry Andric              (EXTRACT_SUBREG
73000b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
73010b57cec5SDimitry Andric                (INSERT_SUBREG
73020b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73030b57cec5SDimitry Andric                 SPR:$a, ssub_0),
73040b57cec5SDimitry Andric                (INSERT_SUBREG
73050b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73060b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
73070b57cec5SDimitry Andric
73080b57cec5SDimitry Andricclass N3VSPatFP16<SDNode OpNode, NeonI Inst>
73090b57cec5SDimitry Andric  : NEONFPPat<(f16 (OpNode HPR:$a, HPR:$b)),
73100b57cec5SDimitry Andric              (EXTRACT_SUBREG
73110b57cec5SDimitry Andric               (v4f16 (COPY_TO_REGCLASS (Inst
73120b57cec5SDimitry Andric                (INSERT_SUBREG
73130b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
73140b57cec5SDimitry Andric                 HPR:$a, ssub_0),
73150b57cec5SDimitry Andric                (INSERT_SUBREG
73160b57cec5SDimitry Andric                 (v4f16 (COPY_TO_REGCLASS (v4f16 (IMPLICIT_DEF)), DPR_VFP2)),
73170b57cec5SDimitry Andric                 HPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
73180b57cec5SDimitry Andric
73190b57cec5SDimitry Andricclass N3VSMulOpPat<SDNode MulNode, SDNode OpNode, NeonI Inst>
73200b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode SPR:$acc, (f32 (MulNode SPR:$a, SPR:$b)))),
73210b57cec5SDimitry Andric              (EXTRACT_SUBREG
73220b57cec5SDimitry Andric               (v2f32 (COPY_TO_REGCLASS (Inst
73230b57cec5SDimitry Andric                (INSERT_SUBREG
73240b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73250b57cec5SDimitry Andric                 SPR:$acc, ssub_0),
73260b57cec5SDimitry Andric                (INSERT_SUBREG
73270b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73280b57cec5SDimitry Andric                 SPR:$a, ssub_0),
73290b57cec5SDimitry Andric                (INSERT_SUBREG
73300b57cec5SDimitry Andric                 (v2f32 (COPY_TO_REGCLASS (v2f32 (IMPLICIT_DEF)), DPR_VFP2)),
73310b57cec5SDimitry Andric                 SPR:$b, ssub_0)), DPR_VFP2)), ssub_0)>;
73320b57cec5SDimitry Andric
73330b57cec5SDimitry Andricclass NVCVTIFPat<SDNode OpNode, NeonI Inst>
73340b57cec5SDimitry Andric  : NEONFPPat<(f32 (OpNode GPR:$a)),
73350b57cec5SDimitry Andric              (f32 (EXTRACT_SUBREG
73360b57cec5SDimitry Andric                     (v2f32 (Inst
73370b57cec5SDimitry Andric                       (INSERT_SUBREG
73380b57cec5SDimitry Andric                         (v2f32 (IMPLICIT_DEF)),
73390b57cec5SDimitry Andric                         (i32 (COPY_TO_REGCLASS GPR:$a, SPR)), ssub_0))),
73400b57cec5SDimitry Andric                     ssub_0))>;
73410b57cec5SDimitry Andricclass NVCVTFIPat<SDNode OpNode, NeonI Inst>
73420b57cec5SDimitry Andric  : NEONFPPat<(i32 (OpNode SPR:$a)),
73430b57cec5SDimitry Andric              (i32 (EXTRACT_SUBREG
73440b57cec5SDimitry Andric                     (v2f32 (Inst (INSERT_SUBREG (v2f32 (IMPLICIT_DEF)),
73450b57cec5SDimitry Andric                                                 SPR:$a, ssub_0))),
73460b57cec5SDimitry Andric                     ssub_0))>;
73470b57cec5SDimitry Andric
73480b57cec5SDimitry Andricdef : N3VSPat<fadd, VADDfd>;
73490b57cec5SDimitry Andricdef : N3VSPat<fsub, VSUBfd>;
73500b57cec5SDimitry Andricdef : N3VSPat<fmul, VMULfd>;
73510b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VMLAfd>,
73520b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
73530b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VMLSfd>,
73540b57cec5SDimitry Andric      Requires<[HasNEON, UseNEONForFP, UseFPVMLx]>;
73550b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fadd, VFMAfd>,
73560b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
73570b57cec5SDimitry Andricdef : N3VSMulOpPat<fmul, fsub, VFMSfd>,
73580b57cec5SDimitry Andric      Requires<[HasVFP4, UseNEONForFP, UseFusedMAC]>;
73590b57cec5SDimitry Andricdef : N2VSPat<fabs, VABSfd>;
73600b57cec5SDimitry Andricdef : N2VSPat<fneg, VNEGfd>;
73610b57cec5SDimitry Andricdef : N3VSPatFP16<fmaximum, VMAXhd>, Requires<[HasFullFP16]>;
73620b57cec5SDimitry Andricdef : N3VSPatFP16<fminimum, VMINhd>, Requires<[HasFullFP16]>;
73630b57cec5SDimitry Andricdef : N3VSPat<fmaximum, VMAXfd>, Requires<[HasNEON]>;
73640b57cec5SDimitry Andricdef : N3VSPat<fminimum, VMINfd>, Requires<[HasNEON]>;
73650b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_sint, VCVTf2sd>;
73660b57cec5SDimitry Andricdef : NVCVTFIPat<fp_to_uint, VCVTf2ud>;
73670b57cec5SDimitry Andricdef : NVCVTIFPat<sint_to_fp, VCVTs2fd>;
73680b57cec5SDimitry Andricdef : NVCVTIFPat<uint_to_fp, VCVTu2fd>;
73690b57cec5SDimitry Andric
73700b57cec5SDimitry Andric// NEON doesn't have any f64 conversions, so provide patterns to make
73710b57cec5SDimitry Andric// sure the VFP conversions match when extracting from a vector.
73720b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
73730b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
73740b57cec5SDimitry Andricdef : VFPPat<(f64 (sint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
73750b57cec5SDimitry Andric             (VSITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
73760b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v2i32 DPR:$src), imm:$lane))),
73770b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>;
73780b57cec5SDimitry Andricdef : VFPPat<(f64 (uint_to_fp (extractelt (v4i32 QPR:$src), imm:$lane))),
73790b57cec5SDimitry Andric             (VUITOD (EXTRACT_SUBREG QPR:$src, (SSubReg_f32_reg imm:$lane)))>;
73800b57cec5SDimitry Andric
73810b57cec5SDimitry Andric
73820b57cec5SDimitry Andric// Prefer VMOVDRR for i32 -> f32 bitcasts, it can write all DPR registers.
73830b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert GPR:$a)),
73840b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
73850b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
73860b57cec5SDimitry Andricdef : Pat<(arm_vmovsr GPR:$a),
73870b57cec5SDimitry Andric          (EXTRACT_SUBREG (VMOVDRR GPR:$a, GPR:$a), ssub_0)>,
73880b57cec5SDimitry Andric        Requires<[HasNEON, DontUseVMOVSR]>;
73890b57cec5SDimitry Andric
73900b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
7391*5ffd83dbSDimitry Andric// Non-Instruction Patterns or Endianess - Revert Patterns
73920b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
73930b57cec5SDimitry Andric
73940b57cec5SDimitry Andric// bit_convert
73950b57cec5SDimitry Andric// 64 bit conversions
73960b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
73970b57cec5SDimitry Andricdef : Pat<(f64   (bitconvert (v1i64 DPR:$src))), (f64   DPR:$src)>;
73980b57cec5SDimitry Andricdef : Pat<(v1i64 (bitconvert (f64   DPR:$src))), (v1i64 DPR:$src)>;
73990b57cec5SDimitry Andric
74000b57cec5SDimitry Andricdef : Pat<(v2f32 (bitconvert (v2i32 DPR:$src))), (v2f32 DPR:$src)>;
74010b57cec5SDimitry Andricdef : Pat<(v2i32 (bitconvert (v2f32 DPR:$src))), (v2i32 DPR:$src)>;
74020b57cec5SDimitry Andric
74030b57cec5SDimitry Andricdef : Pat<(v4i16 (bitconvert (v4f16 DPR:$src))), (v4i16  DPR:$src)>;
74040b57cec5SDimitry Andricdef : Pat<(v4f16 (bitconvert (v4i16 DPR:$src))), (v4f16  DPR:$src)>;
74050b57cec5SDimitry Andric
7406*5ffd83dbSDimitry Andricdef : Pat<(v4i16 (bitconvert (v4bf16 DPR:$src))), (v4i16  DPR:$src)>;
7407*5ffd83dbSDimitry Andricdef : Pat<(v4bf16 (bitconvert (v4i16 DPR:$src))), (v4bf16  DPR:$src)>;
7408*5ffd83dbSDimitry Andric
74090b57cec5SDimitry Andric// 128 bit conversions
74100b57cec5SDimitry Andricdef : Pat<(v2f64 (bitconvert (v2i64 QPR:$src))), (v2f64 QPR:$src)>;
74110b57cec5SDimitry Andricdef : Pat<(v2i64 (bitconvert (v2f64 QPR:$src))), (v2i64 QPR:$src)>;
74120b57cec5SDimitry Andric
74130b57cec5SDimitry Andricdef : Pat<(v4i32 (bitconvert (v4f32 QPR:$src))), (v4i32 QPR:$src)>;
74140b57cec5SDimitry Andricdef : Pat<(v4f32 (bitconvert (v4i32 QPR:$src))), (v4f32 QPR:$src)>;
74150b57cec5SDimitry Andric
74160b57cec5SDimitry Andricdef : Pat<(v8i16 (bitconvert (v8f16 QPR:$src))), (v8i16  QPR:$src)>;
74170b57cec5SDimitry Andricdef : Pat<(v8f16 (bitconvert (v8i16 QPR:$src))), (v8f16  QPR:$src)>;
7418*5ffd83dbSDimitry Andric
7419*5ffd83dbSDimitry Andricdef : Pat<(v8i16 (bitconvert (v8bf16 QPR:$src))), (v8i16  QPR:$src)>;
7420*5ffd83dbSDimitry Andricdef : Pat<(v8bf16 (bitconvert (v8i16 QPR:$src))), (v8bf16  QPR:$src)>;
74210b57cec5SDimitry Andric}
74220b57cec5SDimitry Andric
74230b57cec5SDimitry Andriclet Predicates = [IsLE,HasNEON] in {
74240b57cec5SDimitry Andric  // 64 bit conversions
74250b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (f64   DPR:$src)>;
74260b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (f64   DPR:$src)>;
74270b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (f64   DPR:$src)>;
7428*5ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (f64   DPR:$src)>;
74290b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (f64   DPR:$src)>;
74300b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (f64   DPR:$src)>;
74310b57cec5SDimitry Andric
74320b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (v1i64 DPR:$src)>;
74330b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (v1i64 DPR:$src)>;
74340b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (v1i64 DPR:$src)>;
7435*5ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (v1i64 DPR:$src)>;
74360b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (v1i64 DPR:$src)>;
74370b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (v1i64 DPR:$src)>;
74380b57cec5SDimitry Andric
74390b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (v2f32 DPR:$src)>;
74400b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (v2f32 DPR:$src)>;
74410b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (v2f32 DPR:$src)>;
7442*5ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (v2f32 DPR:$src)>;
74430b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (v2f32 DPR:$src)>;
74440b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (v2f32 DPR:$src)>;
74450b57cec5SDimitry Andric
74460b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (v2i32 DPR:$src)>;
74470b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (v2i32 DPR:$src)>;
74480b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (v2i32 DPR:$src)>;
7449*5ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (v2i32 DPR:$src)>;
74500b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (v2i32 DPR:$src)>;
74510b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (v2i32 DPR:$src)>;
74520b57cec5SDimitry Andric
74530b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (v4f16 DPR:$src)>;
74540b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (v4f16 DPR:$src)>;
74550b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (v4f16 DPR:$src)>;
74560b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (v4f16 DPR:$src)>;
74570b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (v4f16 DPR:$src)>;
74580b57cec5SDimitry Andric
7459*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (v4bf16 DPR:$src)>;
7460*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (v4bf16 DPR:$src)>;
7461*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (v4bf16 DPR:$src)>;
7462*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (v4bf16 DPR:$src)>;
7463*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (v4bf16 DPR:$src)>;
7464*5ffd83dbSDimitry Andric
74650b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (v4i16 DPR:$src)>;
74660b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (v4i16 DPR:$src)>;
74670b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (v4i16 DPR:$src)>;
74680b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (v4i16 DPR:$src)>;
74690b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (v4i16 DPR:$src)>;
74700b57cec5SDimitry Andric
74710b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (v8i8  DPR:$src)>;
74720b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (v8i8  DPR:$src)>;
74730b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (v8i8  DPR:$src)>;
74740b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (v8i8  DPR:$src)>;
74750b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (v8i8  DPR:$src)>;
7476*5ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (v8i8  DPR:$src)>;
74770b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (v8i8  DPR:$src)>;
74780b57cec5SDimitry Andric
74790b57cec5SDimitry Andric  // 128 bit conversions
74800b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (v2f64 QPR:$src)>;
74810b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (v2f64 QPR:$src)>;
74820b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (v2f64 QPR:$src)>;
7483*5ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (v2f64 QPR:$src)>;
74840b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (v2f64 QPR:$src)>;
74850b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (v2f64 QPR:$src)>;
74860b57cec5SDimitry Andric
74870b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (v2i64 QPR:$src)>;
74880b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (v2i64 QPR:$src)>;
74890b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (v2i64 QPR:$src)>;
7490*5ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (v2i64 QPR:$src)>;
74910b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (v2i64 QPR:$src)>;
74920b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (v2i64 QPR:$src)>;
74930b57cec5SDimitry Andric
74940b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (v4f32 QPR:$src)>;
74950b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (v4f32 QPR:$src)>;
74960b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (v4f32 QPR:$src)>;
7497*5ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (v4f32 QPR:$src)>;
74980b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (v4f32 QPR:$src)>;
74990b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (v4f32 QPR:$src)>;
75000b57cec5SDimitry Andric
75010b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (v4i32 QPR:$src)>;
75020b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (v4i32 QPR:$src)>;
75030b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (v4i32 QPR:$src)>;
7504*5ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (v4i32 QPR:$src)>;
75050b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (v4i32 QPR:$src)>;
75060b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (v4i32 QPR:$src)>;
75070b57cec5SDimitry Andric
75080b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (v8f16 QPR:$src)>;
75090b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (v8f16 QPR:$src)>;
75100b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (v8f16 QPR:$src)>;
75110b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (v8f16 QPR:$src)>;
75120b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (v8f16 QPR:$src)>;
75130b57cec5SDimitry Andric
7514*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (v8bf16 QPR:$src)>;
7515*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (v8bf16 QPR:$src)>;
7516*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (v8bf16 QPR:$src)>;
7517*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (v8bf16 QPR:$src)>;
7518*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (v8bf16 QPR:$src)>;
7519*5ffd83dbSDimitry Andric
75200b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (v8i16 QPR:$src)>;
75210b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (v8i16 QPR:$src)>;
75220b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (v8i16 QPR:$src)>;
75230b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (v8i16 QPR:$src)>;
75240b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (v8i16 QPR:$src)>;
75250b57cec5SDimitry Andric
75260b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (v16i8 QPR:$src)>;
75270b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (v16i8 QPR:$src)>;
75280b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (v16i8 QPR:$src)>;
75290b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (v16i8 QPR:$src)>;
75300b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (v16i8 QPR:$src)>;
7531*5ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (v16i8 QPR:$src)>;
75320b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (v16i8 QPR:$src)>;
75330b57cec5SDimitry Andric}
75340b57cec5SDimitry Andric
75350b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
75360b57cec5SDimitry Andric  // 64 bit conversions
75370b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
75380b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
75390b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7540*5ffd83dbSDimitry Andric  def : Pat<(f64   (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
75410b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
75420b57cec5SDimitry Andric  def : Pat<(f64   (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
75430b57cec5SDimitry Andric
75440b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2f32 DPR:$src))), (VREV64d32 DPR:$src)>;
75450b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v2i32 DPR:$src))), (VREV64d32 DPR:$src)>;
75460b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4f16 DPR:$src))), (VREV64d16 DPR:$src)>;
7547*5ffd83dbSDimitry Andric  def : Pat<(v1i64 (bitconvert (v4bf16 DPR:$src))), (VREV64d16 DPR:$src)>;
75480b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v4i16 DPR:$src))), (VREV64d16 DPR:$src)>;
75490b57cec5SDimitry Andric  def : Pat<(v1i64 (bitconvert (v8i8  DPR:$src))), (VREV64d8  DPR:$src)>;
75500b57cec5SDimitry Andric
75510b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
75520b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
75530b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7554*5ffd83dbSDimitry Andric  def : Pat<(v2f32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
75550b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
75560b57cec5SDimitry Andric  def : Pat<(v2f32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
75570b57cec5SDimitry Andric
75580b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (f64   DPR:$src))), (VREV64d32 DPR:$src)>;
75590b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v1i64 DPR:$src))), (VREV64d32 DPR:$src)>;
75600b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4f16 DPR:$src))), (VREV32d16 DPR:$src)>;
7561*5ffd83dbSDimitry Andric  def : Pat<(v2i32 (bitconvert (v4bf16 DPR:$src))), (VREV32d16 DPR:$src)>;
75620b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v4i16 DPR:$src))), (VREV32d16 DPR:$src)>;
75630b57cec5SDimitry Andric  def : Pat<(v2i32 (bitconvert (v8i8  DPR:$src))), (VREV32d8  DPR:$src)>;
75640b57cec5SDimitry Andric
75650b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
75660b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
75670b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
75680b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
75690b57cec5SDimitry Andric  def : Pat<(v4f16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
75700b57cec5SDimitry Andric
7571*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
7572*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
7573*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
7574*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
7575*5ffd83dbSDimitry Andric  def : Pat<(v4bf16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
7576*5ffd83dbSDimitry Andric
75770b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (f64   DPR:$src))), (VREV64d16 DPR:$src)>;
75780b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v1i64 DPR:$src))), (VREV64d16 DPR:$src)>;
75790b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2f32 DPR:$src))), (VREV32d16 DPR:$src)>;
75800b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v2i32 DPR:$src))), (VREV32d16 DPR:$src)>;
75810b57cec5SDimitry Andric  def : Pat<(v4i16 (bitconvert (v8i8  DPR:$src))), (VREV16d8  DPR:$src)>;
75820b57cec5SDimitry Andric
75830b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (f64   DPR:$src))), (VREV64d8  DPR:$src)>;
75840b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v1i64 DPR:$src))), (VREV64d8  DPR:$src)>;
75850b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2f32 DPR:$src))), (VREV32d8  DPR:$src)>;
75860b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v2i32 DPR:$src))), (VREV32d8  DPR:$src)>;
75870b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4f16 DPR:$src))), (VREV16d8  DPR:$src)>;
7588*5ffd83dbSDimitry Andric  def : Pat<(v8i8  (bitconvert (v4bf16 DPR:$src))), (VREV16d8  DPR:$src)>;
75890b57cec5SDimitry Andric  def : Pat<(v8i8  (bitconvert (v4i16 DPR:$src))), (VREV16d8  DPR:$src)>;
75900b57cec5SDimitry Andric
75910b57cec5SDimitry Andric  // 128 bit conversions
75920b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
75930b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
75940b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7595*5ffd83dbSDimitry Andric  def : Pat<(v2f64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
75960b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
75970b57cec5SDimitry Andric  def : Pat<(v2f64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
75980b57cec5SDimitry Andric
75990b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4f32 QPR:$src))), (VREV64q32 QPR:$src)>;
76000b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v4i32 QPR:$src))), (VREV64q32 QPR:$src)>;
76010b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8f16 QPR:$src))), (VREV64q16 QPR:$src)>;
7602*5ffd83dbSDimitry Andric  def : Pat<(v2i64 (bitconvert (v8bf16 QPR:$src))), (VREV64q16 QPR:$src)>;
76030b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v8i16 QPR:$src))), (VREV64q16 QPR:$src)>;
76040b57cec5SDimitry Andric  def : Pat<(v2i64 (bitconvert (v16i8 QPR:$src))), (VREV64q8  QPR:$src)>;
76050b57cec5SDimitry Andric
76060b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
76070b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
76080b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7609*5ffd83dbSDimitry Andric  def : Pat<(v4f32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
76100b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
76110b57cec5SDimitry Andric  def : Pat<(v4f32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
76120b57cec5SDimitry Andric
76130b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2f64 QPR:$src))), (VREV64q32 QPR:$src)>;
76140b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v2i64 QPR:$src))), (VREV64q32 QPR:$src)>;
76150b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8f16 QPR:$src))), (VREV32q16 QPR:$src)>;
7616*5ffd83dbSDimitry Andric  def : Pat<(v4i32 (bitconvert (v8bf16 QPR:$src))), (VREV32q16 QPR:$src)>;
76170b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v8i16 QPR:$src))), (VREV32q16 QPR:$src)>;
76180b57cec5SDimitry Andric  def : Pat<(v4i32 (bitconvert (v16i8 QPR:$src))), (VREV32q8  QPR:$src)>;
76190b57cec5SDimitry Andric
76200b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
76210b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
76220b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
76230b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
76240b57cec5SDimitry Andric  def : Pat<(v8f16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
76250b57cec5SDimitry Andric
7626*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
7627*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
7628*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
7629*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
7630*5ffd83dbSDimitry Andric  def : Pat<(v8bf16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
7631*5ffd83dbSDimitry Andric
76320b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2f64 QPR:$src))), (VREV64q16 QPR:$src)>;
76330b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v2i64 QPR:$src))), (VREV64q16 QPR:$src)>;
76340b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4f32 QPR:$src))), (VREV32q16 QPR:$src)>;
76350b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v4i32 QPR:$src))), (VREV32q16 QPR:$src)>;
76360b57cec5SDimitry Andric  def : Pat<(v8i16 (bitconvert (v16i8 QPR:$src))), (VREV16q8  QPR:$src)>;
76370b57cec5SDimitry Andric
76380b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2f64 QPR:$src))), (VREV64q8  QPR:$src)>;
76390b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v2i64 QPR:$src))), (VREV64q8  QPR:$src)>;
76400b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4f32 QPR:$src))), (VREV32q8  QPR:$src)>;
76410b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v4i32 QPR:$src))), (VREV32q8  QPR:$src)>;
76420b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8f16 QPR:$src))), (VREV16q8  QPR:$src)>;
7643*5ffd83dbSDimitry Andric  def : Pat<(v16i8 (bitconvert (v8bf16 QPR:$src))), (VREV16q8  QPR:$src)>;
76440b57cec5SDimitry Andric  def : Pat<(v16i8 (bitconvert (v8i16 QPR:$src))), (VREV16q8  QPR:$src)>;
76450b57cec5SDimitry Andric}
76460b57cec5SDimitry Andric
7647*5ffd83dbSDimitry Andriclet Predicates = [HasNEON] in {
7648*5ffd83dbSDimitry Andric  // Here we match the specific SDNode type 'ARMVectorRegCastImpl'
7649*5ffd83dbSDimitry Andric  // rather than the more general 'ARMVectorRegCast' which would also
7650*5ffd83dbSDimitry Andric  // match some bitconverts. If we use the latter in cases where the
7651*5ffd83dbSDimitry Andric  // input and output types are the same, the bitconvert gets elided
7652*5ffd83dbSDimitry Andric  // and we end up generating a nonsense match of nothing.
7653*5ffd83dbSDimitry Andric
7654*5ffd83dbSDimitry Andric  foreach VT = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7655*5ffd83dbSDimitry Andric    foreach VT2 = [ v16i8, v8i16, v8f16, v8bf16, v4i32, v4f32, v2i64, v2f64 ] in
7656*5ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 QPR:$src))), (VT QPR:$src)>;
7657*5ffd83dbSDimitry Andric
7658*5ffd83dbSDimitry Andric  foreach VT = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7659*5ffd83dbSDimitry Andric    foreach VT2 = [ v8i8, v4i16, v4f16, v4bf16, v2i32, v2f32, v1i64, f64 ] in
7660*5ffd83dbSDimitry Andric      def : Pat<(VT (ARMVectorRegCastImpl (VT2 DPR:$src))), (VT DPR:$src)>;
7661*5ffd83dbSDimitry Andric}
7662*5ffd83dbSDimitry Andric
76630b57cec5SDimitry Andric// Use VLD1/VST1 + VREV for non-word-aligned v2f64 load/store on Big Endian
76640b57cec5SDimitry Andriclet Predicates = [IsBE,HasNEON] in {
76650b57cec5SDimitry Andricdef : Pat<(v2f64 (byte_alignedload addrmode6:$addr)),
76660b57cec5SDimitry Andric          (VREV64q8 (VLD1q8 addrmode6:$addr))>;
76670b57cec5SDimitry Andricdef : Pat<(byte_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
76680b57cec5SDimitry Andric          (VST1q8 addrmode6:$addr, (VREV64q8 QPR:$value))>;
76690b57cec5SDimitry Andricdef : Pat<(v2f64 (hword_alignedload addrmode6:$addr)),
76700b57cec5SDimitry Andric          (VREV64q16 (VLD1q16 addrmode6:$addr))>;
76710b57cec5SDimitry Andricdef : Pat<(hword_alignedstore (v2f64 QPR:$value), addrmode6:$addr),
76720b57cec5SDimitry Andric          (VST1q16 addrmode6:$addr, (VREV64q16 QPR:$value))>;
76730b57cec5SDimitry Andric}
76740b57cec5SDimitry Andric
76750b57cec5SDimitry Andric// Fold extracting an element out of a v2i32 into a vfp register.
76760b57cec5SDimitry Andricdef : Pat<(f32 (bitconvert (i32 (extractelt (v2i32 DPR:$src), imm:$lane)))),
76770b57cec5SDimitry Andric          (f32 (EXTRACT_SUBREG DPR:$src, (SSubReg_f32_reg imm:$lane)))>,
76780b57cec5SDimitry Andric      Requires<[HasNEON]>;
76790b57cec5SDimitry Andric
76800b57cec5SDimitry Andric// Vector lengthening move with load, matching extending loads.
76810b57cec5SDimitry Andric
76820b57cec5SDimitry Andric// extload, zextload and sextload for a standard lengthening load. Example:
76830b57cec5SDimitry Andric// Lengthen_Single<"8", "i16", "8"> =
76840b57cec5SDimitry Andric//     Pat<(v8i16 (extloadvi8 addrmode6:$addr))
76850b57cec5SDimitry Andric//         (VMOVLuv8i16 (VLD1d8 addrmode6:$addr,
76860b57cec5SDimitry Andric//                              (f64 (IMPLICIT_DEF)), (i32 0)))>;
76870b57cec5SDimitry Andricmulticlass Lengthen_Single<string DestLanes, string DestTy, string SrcTy> {
76880b57cec5SDimitry Andric  let AddedComplexity = 10 in {
76890b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
76900b57cec5SDimitry Andric                    (!cast<PatFrag>("extloadvi" # SrcTy) addrmode6:$addr)),
76910b57cec5SDimitry Andric                  (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
76920b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
76930b57cec5SDimitry Andric             Requires<[HasNEON]>;
76940b57cec5SDimitry Andric
76950b57cec5SDimitry Andric  def _Z : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
76960b57cec5SDimitry Andric                  (!cast<PatFrag>("zextloadvi" # SrcTy) addrmode6:$addr)),
76970b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLuv" # DestLanes # DestTy)
76980b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
76990b57cec5SDimitry Andric           Requires<[HasNEON]>;
77000b57cec5SDimitry Andric
77010b57cec5SDimitry Andric  def _S : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77020b57cec5SDimitry Andric                  (!cast<PatFrag>("sextloadvi" # SrcTy) addrmode6:$addr)),
77030b57cec5SDimitry Andric                (!cast<Instruction>("VMOVLsv" # DestLanes # DestTy)
77040b57cec5SDimitry Andric                    (!cast<Instruction>("VLD1d" # SrcTy) addrmode6:$addr))>,
77050b57cec5SDimitry Andric           Requires<[HasNEON]>;
77060b57cec5SDimitry Andric  }
77070b57cec5SDimitry Andric}
77080b57cec5SDimitry Andric
77090b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load which only uses
77100b57cec5SDimitry Andric// half the lanes available. Example:
77110b57cec5SDimitry Andric// Lengthen_HalfSingle<"4", "i16", "8", "i16", "i8"> =
77120b57cec5SDimitry Andric//     Pat<(v4i16 (extloadvi8 addrmode6oneL32:$addr)),
77130b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
77140b57cec5SDimitry Andric//                                      (f64 (IMPLICIT_DEF)), (i32 0))),
77150b57cec5SDimitry Andric//                         dsub_0)>;
77160b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle<string DestLanes, string DestTy, string SrcTy,
77170b57cec5SDimitry Andric                               string InsnLanes, string InsnTy> {
77180b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77190b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
77200b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
77210b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
77220b57cec5SDimitry Andric         dsub_0)>,
77230b57cec5SDimitry Andric             Requires<[HasNEON]>;
77240b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77250b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
77260b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
77270b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
77280b57cec5SDimitry Andric         dsub_0)>,
77290b57cec5SDimitry Andric             Requires<[HasNEON]>;
77300b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77310b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
77320b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
77330b57cec5SDimitry Andric         (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
77340b57cec5SDimitry Andric         dsub_0)>,
77350b57cec5SDimitry Andric             Requires<[HasNEON]>;
77360b57cec5SDimitry Andric}
77370b57cec5SDimitry Andric
77380b57cec5SDimitry Andric// The following class definition is basically a copy of the
77390b57cec5SDimitry Andric// Lengthen_HalfSingle definition above, however with an additional parameter
77400b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
77410b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
77420b57cec5SDimitry Andricmulticlass Lengthen_HalfSingle_Big_Endian<string DestLanes, string DestTy, string SrcTy,
77430b57cec5SDimitry Andric                               string InsnLanes, string InsnTy, string RevLanes> {
77440b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77450b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
77460b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
77470b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
77480b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
77490b57cec5SDimitry Andric         dsub_0)>,
77500b57cec5SDimitry Andric             Requires<[HasNEON]>;
77510b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77520b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
77530b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # InsnLanes # InsnTy)
77540b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
77550b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
77560b57cec5SDimitry Andric         dsub_0)>,
77570b57cec5SDimitry Andric             Requires<[HasNEON]>;
77580b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77590b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
77600b57cec5SDimitry Andric       (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # InsnLanes # InsnTy)
77610b57cec5SDimitry Andric         (!cast<Instruction>("VREV32d" # RevLanes)
77620b57cec5SDimitry Andric           (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
77630b57cec5SDimitry Andric         dsub_0)>,
77640b57cec5SDimitry Andric             Requires<[HasNEON]>;
77650b57cec5SDimitry Andric}
77660b57cec5SDimitry Andric
77670b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
77680b57cec5SDimitry Andric// lengthening load, to quadruple the initial length.
77690b57cec5SDimitry Andric//
77700b57cec5SDimitry Andric// Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32"> =
77710b57cec5SDimitry Andric//     Pat<(v4i32 (extloadvi8 addrmode6oneL32:$addr))
77720b57cec5SDimitry Andric//         (EXTRACT_SUBREG (VMOVLuv4i32
77730b57cec5SDimitry Andric//           (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd32 addrmode6oneL32:$addr,
77740b57cec5SDimitry Andric//                                                   (f64 (IMPLICIT_DEF)),
77750b57cec5SDimitry Andric//                                                   (i32 0))),
77760b57cec5SDimitry Andric//                           dsub_0)),
77770b57cec5SDimitry Andric//           dsub_0)>;
77780b57cec5SDimitry Andricmulticlass Lengthen_Double<string DestLanes, string DestTy, string SrcTy,
77790b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
77800b57cec5SDimitry Andric                           string Insn2Ty> {
77810b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77820b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
77830b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
77840b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
77850b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
77860b57cec5SDimitry Andric             dsub_0))>,
77870b57cec5SDimitry Andric             Requires<[HasNEON]>;
77880b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77890b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
77900b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
77910b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
77920b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
77930b57cec5SDimitry Andric             dsub_0))>,
77940b57cec5SDimitry Andric             Requires<[HasNEON]>;
77950b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
77960b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
77970b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
77980b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
77990b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78000b57cec5SDimitry Andric             dsub_0))>,
78010b57cec5SDimitry Andric             Requires<[HasNEON]>;
78020b57cec5SDimitry Andric}
78030b57cec5SDimitry Andric
78040b57cec5SDimitry Andric// The following class definition is basically a copy of the
78050b57cec5SDimitry Andric// Lengthen_Double definition above, however with an additional parameter
78060b57cec5SDimitry Andric// "RevLanes" to select the correct VREV32dXX instruction. This is to convert
78070b57cec5SDimitry Andric// data loaded by VLD1LN into proper vector format in big endian mode.
78080b57cec5SDimitry Andricmulticlass Lengthen_Double_Big_Endian<string DestLanes, string DestTy, string SrcTy,
78090b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
78100b57cec5SDimitry Andric                           string Insn2Ty, string RevLanes> {
78110b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78120b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6oneL32:$addr)),
78130b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78140b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78150b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
78160b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78170b57cec5SDimitry Andric             dsub_0))>,
78180b57cec5SDimitry Andric             Requires<[HasNEON]>;
78190b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78200b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6oneL32:$addr)),
78210b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78220b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78230b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
78240b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78250b57cec5SDimitry Andric             dsub_0))>,
78260b57cec5SDimitry Andric             Requires<[HasNEON]>;
78270b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78280b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6oneL32:$addr)),
78290b57cec5SDimitry Andric         (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
78300b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
78310b57cec5SDimitry Andric            (!cast<Instruction>("VREV32d" # RevLanes)
78320b57cec5SDimitry Andric             (VLD1LNd32 addrmode6oneL32:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78330b57cec5SDimitry Andric             dsub_0))>,
78340b57cec5SDimitry Andric             Requires<[HasNEON]>;
78350b57cec5SDimitry Andric}
78360b57cec5SDimitry Andric
78370b57cec5SDimitry Andric// extload, zextload and sextload for a lengthening load followed by another
78380b57cec5SDimitry Andric// lengthening load, to quadruple the initial length, but which ends up only
78390b57cec5SDimitry Andric// requiring half the available lanes (a 64-bit outcome instead of a 128-bit).
78400b57cec5SDimitry Andric//
78410b57cec5SDimitry Andric// Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32"> =
78420b57cec5SDimitry Andric// Pat<(v2i32 (extloadvi8 addrmode6:$addr))
78430b57cec5SDimitry Andric//     (EXTRACT_SUBREG (VMOVLuv4i32
78440b57cec5SDimitry Andric//       (EXTRACT_SUBREG (VMOVLuv8i16 (VLD1LNd16 addrmode6:$addr,
78450b57cec5SDimitry Andric//                                               (f64 (IMPLICIT_DEF)), (i32 0))),
78460b57cec5SDimitry Andric//                       dsub_0)),
78470b57cec5SDimitry Andric//       dsub_0)>;
78480b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble<string DestLanes, string DestTy, string SrcTy,
78490b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
78500b57cec5SDimitry Andric                           string Insn2Ty> {
78510b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78520b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
78530b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78540b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78550b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78560b57cec5SDimitry Andric             dsub_0)),
78570b57cec5SDimitry Andric          dsub_0)>,
78580b57cec5SDimitry Andric             Requires<[HasNEON]>;
78590b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78600b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
78610b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78620b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78630b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78640b57cec5SDimitry Andric             dsub_0)),
78650b57cec5SDimitry Andric          dsub_0)>,
78660b57cec5SDimitry Andric              Requires<[HasNEON]>;
78670b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78680b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
78690b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
78700b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
78710b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0))),
78720b57cec5SDimitry Andric             dsub_0)),
78730b57cec5SDimitry Andric          dsub_0)>,
78740b57cec5SDimitry Andric             Requires<[HasNEON]>;
78750b57cec5SDimitry Andric}
78760b57cec5SDimitry Andric
78770b57cec5SDimitry Andric// The following class definition is basically a copy of the
78780b57cec5SDimitry Andric// Lengthen_HalfDouble definition above, however with an additional VREV16d8
78790b57cec5SDimitry Andric// instruction to convert data loaded by VLD1LN into proper vector format
78800b57cec5SDimitry Andric// in big endian mode.
78810b57cec5SDimitry Andricmulticlass Lengthen_HalfDouble_Big_Endian<string DestLanes, string DestTy, string SrcTy,
78820b57cec5SDimitry Andric                           string Insn1Lanes, string Insn1Ty, string Insn2Lanes,
78830b57cec5SDimitry Andric                           string Insn2Ty> {
78840b57cec5SDimitry Andric  def _Any : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78850b57cec5SDimitry Andric                   (!cast<PatFrag>("extloadv" # SrcTy) addrmode6:$addr)),
78860b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78870b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78880b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
78890b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78900b57cec5SDimitry Andric             dsub_0)),
78910b57cec5SDimitry Andric          dsub_0)>,
78920b57cec5SDimitry Andric             Requires<[HasNEON]>;
78930b57cec5SDimitry Andric  def _Z   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
78940b57cec5SDimitry Andric                   (!cast<PatFrag>("zextloadv" # SrcTy) addrmode6:$addr)),
78950b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn2Lanes # Insn2Ty)
78960b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLuv" # Insn1Lanes # Insn1Ty)
78970b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
78980b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
78990b57cec5SDimitry Andric             dsub_0)),
79000b57cec5SDimitry Andric          dsub_0)>,
79010b57cec5SDimitry Andric             Requires<[HasNEON]>;
79020b57cec5SDimitry Andric  def _S   : Pat<(!cast<ValueType>("v" # DestLanes # DestTy)
79030b57cec5SDimitry Andric                   (!cast<PatFrag>("sextloadv" # SrcTy) addrmode6:$addr)),
79040b57cec5SDimitry Andric         (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn2Lanes # Insn2Ty)
79050b57cec5SDimitry Andric           (EXTRACT_SUBREG (!cast<Instruction>("VMOVLsv" # Insn1Lanes # Insn1Ty)
79060b57cec5SDimitry Andric            (!cast<Instruction>("VREV16d8")
79070b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr, (f64 (IMPLICIT_DEF)), (i32 0)))),
79080b57cec5SDimitry Andric             dsub_0)),
79090b57cec5SDimitry Andric          dsub_0)>,
79100b57cec5SDimitry Andric             Requires<[HasNEON]>;
79110b57cec5SDimitry Andric}
79120b57cec5SDimitry Andric
79130b57cec5SDimitry Andricdefm : Lengthen_Single<"8", "i16", "8">; // v8i8 -> v8i16
79140b57cec5SDimitry Andricdefm : Lengthen_Single<"4", "i32", "16">; // v4i16 -> v4i32
79150b57cec5SDimitry Andricdefm : Lengthen_Single<"2", "i64", "32">; // v2i32 -> v2i64
79160b57cec5SDimitry Andric
79170b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
79180b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"4", "i16", "i8", "8", "i16">; // v4i8 -> v4i16
79190b57cec5SDimitry Andric  defm : Lengthen_HalfSingle<"2", "i32", "i16", "4", "i32">; // v2i16 -> v2i32
79200b57cec5SDimitry Andric
79210b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
79220b57cec5SDimitry Andric  defm : Lengthen_Double<"4", "i32", "i8", "8", "i16", "4", "i32">;
79230b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
79240b57cec5SDimitry Andric  defm : Lengthen_HalfDouble<"2", "i32", "i8", "8", "i16", "4", "i32">;
79250b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
79260b57cec5SDimitry Andric  defm : Lengthen_Double<"2", "i64", "i16", "4", "i32", "2", "i64">;
79270b57cec5SDimitry Andric}
79280b57cec5SDimitry Andric
79290b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
79300b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"4", "i16", "i8", "8", "i16", "8">; // v4i8 -> v4i16
79310b57cec5SDimitry Andric  defm : Lengthen_HalfSingle_Big_Endian<"2", "i32", "i16", "4", "i32", "16">; // v2i16 -> v2i32
79320b57cec5SDimitry Andric
79330b57cec5SDimitry Andric  // Double lengthening - v4i8 -> v4i16 -> v4i32
79340b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"4", "i32", "i8", "8", "i16", "4", "i32", "8">;
79350b57cec5SDimitry Andric  // v2i8 -> v2i16 -> v2i32
79360b57cec5SDimitry Andric  defm : Lengthen_HalfDouble_Big_Endian<"2", "i32", "i8", "8", "i16", "4", "i32">;
79370b57cec5SDimitry Andric  // v2i16 -> v2i32 -> v2i64
79380b57cec5SDimitry Andric  defm : Lengthen_Double_Big_Endian<"2", "i64", "i16", "4", "i32", "2", "i64", "16">;
79390b57cec5SDimitry Andric}
79400b57cec5SDimitry Andric
79410b57cec5SDimitry Andric// Triple lengthening - v2i8 -> v2i16 -> v2i32 -> v2i64
79420b57cec5SDimitry Andriclet Predicates = [HasNEON,IsLE] in {
79430b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
79440b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
79450b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
79460b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
79470b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
79480b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
79490b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
79500b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
79510b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
79520b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
79530b57cec5SDimitry Andric           (VLD1LNd16 addrmode6:$addr,
79540b57cec5SDimitry Andric                      (f64 (IMPLICIT_DEF)), (i32 0))), dsub_0)), dsub_0))>;
79550b57cec5SDimitry Andric}
79560b57cec5SDimitry Andric// The following patterns are basically a copy of the patterns above,
79570b57cec5SDimitry Andric// however with an additional VREV16d instruction to convert data
79580b57cec5SDimitry Andric// loaded by VLD1LN into proper vector format in big endian mode.
79590b57cec5SDimitry Andriclet Predicates = [HasNEON,IsBE] in {
79600b57cec5SDimitry Andric  def : Pat<(v2i64 (extloadvi8 addrmode6:$addr)),
79610b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
79620b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
79630b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
79640b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
79650b57cec5SDimitry Andric  def : Pat<(v2i64 (zextloadvi8 addrmode6:$addr)),
79660b57cec5SDimitry Andric        (VMOVLuv2i64 (EXTRACT_SUBREG (VMOVLuv4i32 (EXTRACT_SUBREG (VMOVLuv8i16
79670b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
79680b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
79690b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
79700b57cec5SDimitry Andric  def : Pat<(v2i64 (sextloadvi8 addrmode6:$addr)),
79710b57cec5SDimitry Andric        (VMOVLsv2i64 (EXTRACT_SUBREG (VMOVLsv4i32 (EXTRACT_SUBREG (VMOVLsv8i16
79720b57cec5SDimitry Andric           (!cast<Instruction>("VREV16d8")
79730b57cec5SDimitry Andric             (VLD1LNd16 addrmode6:$addr,
79740b57cec5SDimitry Andric                        (f64 (IMPLICIT_DEF)), (i32 0)))), dsub_0)), dsub_0))>;
79750b57cec5SDimitry Andric}
79760b57cec5SDimitry Andric
79770b57cec5SDimitry Andriclet Predicates = [HasNEON] in {
79780b57cec5SDimitry Andricdef : Pat<(v2i64 (concat_vectors DPR:$Dn, DPR:$Dm)),
79790b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79800b57cec5SDimitry Andricdef : Pat<(v4i32 (concat_vectors DPR:$Dn, DPR:$Dm)),
79810b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79820b57cec5SDimitry Andricdef : Pat<(v8i16 (concat_vectors DPR:$Dn, DPR:$Dm)),
79830b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79840b57cec5SDimitry Andricdef : Pat<(v16i8 (concat_vectors DPR:$Dn, DPR:$Dm)),
79850b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79860b57cec5SDimitry Andricdef : Pat<(v4f32 (concat_vectors DPR:$Dn, DPR:$Dm)),
79870b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79880b57cec5SDimitry Andricdef : Pat<(v8f16 (concat_vectors DPR:$Dn, DPR:$Dm)),
79890b57cec5SDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
7990*5ffd83dbSDimitry Andricdef : Pat<(v8bf16 (concat_vectors DPR:$Dn, DPR:$Dm)),
7991*5ffd83dbSDimitry Andric          (REG_SEQUENCE QPR, DPR:$Dn, dsub_0, DPR:$Dm, dsub_1)>;
79920b57cec5SDimitry Andric}
79930b57cec5SDimitry Andric
79940b57cec5SDimitry Andric//===----------------------------------------------------------------------===//
79950b57cec5SDimitry Andric// Assembler aliases
79960b57cec5SDimitry Andric//
79970b57cec5SDimitry Andric
79980b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdhr${p} $Dd, $Rn",
79990b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 1, pred:$p)>;
80000b57cec5SDimitry Andricdef : VFP2InstAlias<"fmdlr${p} $Dd, $Rn",
80010b57cec5SDimitry Andric                    (VSETLNi32 DPR:$Dd, GPR:$Rn, 0, pred:$p)>;
80020b57cec5SDimitry Andric
80030b57cec5SDimitry Andric// VAND/VBIC/VEOR/VORR accept but do not require a type suffix.
80040b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
80050b57cec5SDimitry Andric                         (VANDd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
80060b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vd, $Vn, $Vm",
80070b57cec5SDimitry Andric                         (VANDq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
80080b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
80090b57cec5SDimitry Andric                         (VBICd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
80100b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbic${p}", "$Vd, $Vn, $Vm",
80110b57cec5SDimitry Andric                         (VBICq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
80120b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
80130b57cec5SDimitry Andric                         (VEORd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
80140b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vd, $Vn, $Vm",
80150b57cec5SDimitry Andric                         (VEORq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
80160b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
80170b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
80180b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vd, $Vn, $Vm",
80190b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
80200b57cec5SDimitry Andric// ... two-operand aliases
80210b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
80220b57cec5SDimitry Andric                         (VANDd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
80230b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vand${p}", "$Vdn, $Vm",
80240b57cec5SDimitry Andric                         (VANDq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
80250b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
80260b57cec5SDimitry Andric                         (VEORd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
80270b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"veor${p}", "$Vdn, $Vm",
80280b57cec5SDimitry Andric                         (VEORq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
80290b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
80300b57cec5SDimitry Andric                         (VORRd DPR:$Vdn, DPR:$Vdn, DPR:$Vm, pred:$p)>;
80310b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vorr${p}", "$Vdn, $Vm",
80320b57cec5SDimitry Andric                         (VORRq QPR:$Vdn, QPR:$Vdn, QPR:$Vm, pred:$p)>;
80330b57cec5SDimitry Andric// ... immediates
80340b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
80350b57cec5SDimitry Andric                    (VBICiv4i16 DPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
80360b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
80370b57cec5SDimitry Andric                    (VBICiv2i32 DPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
80380b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i16 $Vd, $imm",
80390b57cec5SDimitry Andric                    (VBICiv8i16 QPR:$Vd, nImmSplatNotI16:$imm, pred:$p)>;
80400b57cec5SDimitry Andricdef : NEONInstAlias<"vand${p}.i32 $Vd, $imm",
80410b57cec5SDimitry Andric                    (VBICiv4i32 QPR:$Vd, nImmSplatNotI32:$imm, pred:$p)>;
80420b57cec5SDimitry Andric
80430b57cec5SDimitry Andric
80440b57cec5SDimitry Andric// VLD1 single-lane pseudo-instructions. These need special handling for
80450b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
80460b57cec5SDimitry Andricdef VLD1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr",
80470b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
80480b57cec5SDimitry Andric                      pred:$p)>;
80490b57cec5SDimitry Andricdef VLD1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr",
80500b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
80510b57cec5SDimitry Andric                      pred:$p)>;
80520b57cec5SDimitry Andricdef VLD1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr",
80530b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
80540b57cec5SDimitry Andric                      pred:$p)>;
80550b57cec5SDimitry Andric
80560b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_8 :
80570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr!",
80580b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
80590b57cec5SDimitry Andric                      pred:$p)>;
80600b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_16 :
80610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr!",
80620b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
80630b57cec5SDimitry Andric                      pred:$p)>;
80640b57cec5SDimitry Andricdef VLD1LNdWB_fixed_Asm_32 :
80650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr!",
80660b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
80670b57cec5SDimitry Andric                      pred:$p)>;
80680b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_8 :
80690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".8", "$list, $addr, $Rm",
80700b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
80710b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
80720b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_16 :
80730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".16", "$list, $addr, $Rm",
80740b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
80750b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
80760b57cec5SDimitry Andricdef VLD1LNdWB_register_Asm_32 :
80770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld1${p}", ".32", "$list, $addr, $Rm",
80780b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
80790b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
80800b57cec5SDimitry Andric
80810b57cec5SDimitry Andric
80820b57cec5SDimitry Andric// VST1 single-lane pseudo-instructions. These need special handling for
80830b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
80840b57cec5SDimitry Andricdef VST1LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr",
80850b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
80860b57cec5SDimitry Andric                      pred:$p)>;
80870b57cec5SDimitry Andricdef VST1LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr",
80880b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
80890b57cec5SDimitry Andric                      pred:$p)>;
80900b57cec5SDimitry Andricdef VST1LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr",
80910b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
80920b57cec5SDimitry Andric                      pred:$p)>;
80930b57cec5SDimitry Andric
80940b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_8 :
80950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr!",
80960b57cec5SDimitry Andric                 (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
80970b57cec5SDimitry Andric                      pred:$p)>;
80980b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_16 :
80990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr!",
81000b57cec5SDimitry Andric                 (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81010b57cec5SDimitry Andric                      pred:$p)>;
81020b57cec5SDimitry Andricdef VST1LNdWB_fixed_Asm_32 :
81030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr!",
81040b57cec5SDimitry Andric                 (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81050b57cec5SDimitry Andric                      pred:$p)>;
81060b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_8 :
81070b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".8", "$list, $addr, $Rm",
81080b57cec5SDimitry Andric                  (ins VecListOneDByteIndexed:$list, addrmode6alignNone:$addr,
81090b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81100b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_16 :
81110b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".16", "$list, $addr, $Rm",
81120b57cec5SDimitry Andric                  (ins VecListOneDHWordIndexed:$list, addrmode6align16:$addr,
81130b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81140b57cec5SDimitry Andricdef VST1LNdWB_register_Asm_32 :
81150b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst1${p}", ".32", "$list, $addr, $Rm",
81160b57cec5SDimitry Andric                  (ins VecListOneDWordIndexed:$list, addrmode6align32:$addr,
81170b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81180b57cec5SDimitry Andric
81190b57cec5SDimitry Andric// VLD2 single-lane pseudo-instructions. These need special handling for
81200b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81210b57cec5SDimitry Andricdef VLD2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr",
81220b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
81230b57cec5SDimitry Andric                  pred:$p)>;
81240b57cec5SDimitry Andricdef VLD2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
81250b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
81260b57cec5SDimitry Andric                      pred:$p)>;
81270b57cec5SDimitry Andricdef VLD2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
81280b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr, pred:$p)>;
81290b57cec5SDimitry Andricdef VLD2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr",
81300b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
81310b57cec5SDimitry Andric                      pred:$p)>;
81320b57cec5SDimitry Andricdef VLD2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr",
81330b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
81340b57cec5SDimitry Andric                      pred:$p)>;
81350b57cec5SDimitry Andric
81360b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_8 :
81370b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr!",
81380b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
81390b57cec5SDimitry Andric                      pred:$p)>;
81400b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_16 :
81410b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
81420b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
81430b57cec5SDimitry Andric                      pred:$p)>;
81440b57cec5SDimitry Andricdef VLD2LNdWB_fixed_Asm_32 :
81450b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
81460b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
81470b57cec5SDimitry Andric                      pred:$p)>;
81480b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_16 :
81490b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr!",
81500b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
81510b57cec5SDimitry Andric                      pred:$p)>;
81520b57cec5SDimitry Andricdef VLD2LNqWB_fixed_Asm_32 :
81530b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr!",
81540b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
81550b57cec5SDimitry Andric                      pred:$p)>;
81560b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_8 :
81570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".8", "$list, $addr, $Rm",
81580b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
81590b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81600b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_16 :
81610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
81620b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
81630b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81640b57cec5SDimitry Andricdef VLD2LNdWB_register_Asm_32 :
81650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
81660b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
81670b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81680b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_16 :
81690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".16", "$list, $addr, $Rm",
81700b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
81710b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81720b57cec5SDimitry Andricdef VLD2LNqWB_register_Asm_32 :
81730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld2${p}", ".32", "$list, $addr, $Rm",
81740b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
81750b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
81760b57cec5SDimitry Andric
81770b57cec5SDimitry Andric
81780b57cec5SDimitry Andric// VST2 single-lane pseudo-instructions. These need special handling for
81790b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
81800b57cec5SDimitry Andricdef VST2LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr",
81810b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
81820b57cec5SDimitry Andric                      pred:$p)>;
81830b57cec5SDimitry Andricdef VST2LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
81840b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
81850b57cec5SDimitry Andric                      pred:$p)>;
81860b57cec5SDimitry Andricdef VST2LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
81870b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
81880b57cec5SDimitry Andric                      pred:$p)>;
81890b57cec5SDimitry Andricdef VST2LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr",
81900b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
81910b57cec5SDimitry Andric                      pred:$p)>;
81920b57cec5SDimitry Andricdef VST2LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr",
81930b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
81940b57cec5SDimitry Andric                      pred:$p)>;
81950b57cec5SDimitry Andric
81960b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_8 :
81970b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr!",
81980b57cec5SDimitry Andric                 (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
81990b57cec5SDimitry Andric                      pred:$p)>;
82000b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_16 :
82010b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
82020b57cec5SDimitry Andric                 (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82030b57cec5SDimitry Andric                      pred:$p)>;
82040b57cec5SDimitry Andricdef VST2LNdWB_fixed_Asm_32 :
82050b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
82060b57cec5SDimitry Andric                 (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82070b57cec5SDimitry Andric                      pred:$p)>;
82080b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_16 :
82090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16", "$list, $addr!",
82100b57cec5SDimitry Andric                 (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82110b57cec5SDimitry Andric                      pred:$p)>;
82120b57cec5SDimitry Andricdef VST2LNqWB_fixed_Asm_32 :
82130b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr!",
82140b57cec5SDimitry Andric                 (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82150b57cec5SDimitry Andric                      pred:$p)>;
82160b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_8 :
82170b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".8", "$list, $addr, $Rm",
82180b57cec5SDimitry Andric                  (ins VecListTwoDByteIndexed:$list, addrmode6align16:$addr,
82190b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82200b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_16 :
82210b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
82220b57cec5SDimitry Andric                  (ins VecListTwoDHWordIndexed:$list, addrmode6align32:$addr,
82230b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82240b57cec5SDimitry Andricdef VST2LNdWB_register_Asm_32 :
82250b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
82260b57cec5SDimitry Andric                  (ins VecListTwoDWordIndexed:$list, addrmode6align64:$addr,
82270b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82280b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_16 :
82290b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".16","$list, $addr, $Rm",
82300b57cec5SDimitry Andric                  (ins VecListTwoQHWordIndexed:$list, addrmode6align32:$addr,
82310b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82320b57cec5SDimitry Andricdef VST2LNqWB_register_Asm_32 :
82330b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst2${p}", ".32", "$list, $addr, $Rm",
82340b57cec5SDimitry Andric                  (ins VecListTwoQWordIndexed:$list, addrmode6align64:$addr,
82350b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82360b57cec5SDimitry Andric
82370b57cec5SDimitry Andric// VLD3 all-lanes pseudo-instructions. These need special handling for
82380b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
82390b57cec5SDimitry Andricdef VLD3DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
82400b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82410b57cec5SDimitry Andric                    pred:$p)>;
82420b57cec5SDimitry Andricdef VLD3DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
82430b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82440b57cec5SDimitry Andric                    pred:$p)>;
82450b57cec5SDimitry Andricdef VLD3DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
82460b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82470b57cec5SDimitry Andric                    pred:$p)>;
82480b57cec5SDimitry Andricdef VLD3DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
82490b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82500b57cec5SDimitry Andric                    pred:$p)>;
82510b57cec5SDimitry Andricdef VLD3DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
82520b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82530b57cec5SDimitry Andric                    pred:$p)>;
82540b57cec5SDimitry Andricdef VLD3DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
82550b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82560b57cec5SDimitry Andric                    pred:$p)>;
82570b57cec5SDimitry Andric
82580b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_8 :
82590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
82600b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82610b57cec5SDimitry Andric                    pred:$p)>;
82620b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_16 :
82630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
82640b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82650b57cec5SDimitry Andric                    pred:$p)>;
82660b57cec5SDimitry Andricdef VLD3DUPdWB_fixed_Asm_32 :
82670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
82680b57cec5SDimitry Andric               (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82690b57cec5SDimitry Andric                    pred:$p)>;
82700b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_8 :
82710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
82720b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82730b57cec5SDimitry Andric                    pred:$p)>;
82740b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_16 :
82750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
82760b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82770b57cec5SDimitry Andric                    pred:$p)>;
82780b57cec5SDimitry Andricdef VLD3DUPqWB_fixed_Asm_32 :
82790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
82800b57cec5SDimitry Andric               (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82810b57cec5SDimitry Andric                    pred:$p)>;
82820b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_8 :
82830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
82840b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82850b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82860b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_16 :
82870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
82880b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82890b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82900b57cec5SDimitry Andricdef VLD3DUPdWB_register_Asm_32 :
82910b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
82920b57cec5SDimitry Andric                  (ins VecListThreeDAllLanes:$list, addrmode6dupalignNone:$addr,
82930b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82940b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_8 :
82950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
82960b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
82970b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
82980b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_16 :
82990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
83000b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83010b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83020b57cec5SDimitry Andricdef VLD3DUPqWB_register_Asm_32 :
83030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
83040b57cec5SDimitry Andric                  (ins VecListThreeQAllLanes:$list, addrmode6dupalignNone:$addr,
83050b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83060b57cec5SDimitry Andric
83070b57cec5SDimitry Andric
83080b57cec5SDimitry Andric// VLD3 single-lane pseudo-instructions. These need special handling for
83090b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
83100b57cec5SDimitry Andricdef VLD3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83110b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
83120b57cec5SDimitry Andric                    pred:$p)>;
83130b57cec5SDimitry Andricdef VLD3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83140b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
83150b57cec5SDimitry Andric                    pred:$p)>;
83160b57cec5SDimitry Andricdef VLD3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83170b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
83180b57cec5SDimitry Andric                    pred:$p)>;
83190b57cec5SDimitry Andricdef VLD3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83200b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
83210b57cec5SDimitry Andric                    pred:$p)>;
83220b57cec5SDimitry Andricdef VLD3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83230b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
83240b57cec5SDimitry Andric                    pred:$p)>;
83250b57cec5SDimitry Andric
83260b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_8 :
83270b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83280b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
83290b57cec5SDimitry Andric                    pred:$p)>;
83300b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_16 :
83310b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83320b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
83330b57cec5SDimitry Andric                    pred:$p)>;
83340b57cec5SDimitry Andricdef VLD3LNdWB_fixed_Asm_32 :
83350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83360b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
83370b57cec5SDimitry Andric                    pred:$p)>;
83380b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_16 :
83390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83400b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
83410b57cec5SDimitry Andric                    pred:$p)>;
83420b57cec5SDimitry Andricdef VLD3LNqWB_fixed_Asm_32 :
83430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83440b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
83450b57cec5SDimitry Andric                    pred:$p)>;
83460b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_8 :
83470b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
83480b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
83490b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83500b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_16 :
83510b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
83520b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
83530b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
83540b57cec5SDimitry Andricdef VLD3LNdWB_register_Asm_32 :
83550b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
83560b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
83570b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83580b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_16 :
83590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
83600b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
83610b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
83620b57cec5SDimitry Andricdef VLD3LNqWB_register_Asm_32 :
83630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
83640b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
83650b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
83660b57cec5SDimitry Andric
83670b57cec5SDimitry Andric// VLD3 multiple structure pseudo-instructions. These need special handling for
83680b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
83690b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
83700b57cec5SDimitry Andricdef VLD3dAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83710b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83720b57cec5SDimitry Andricdef VLD3dAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83730b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83740b57cec5SDimitry Andricdef VLD3dAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83750b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83760b57cec5SDimitry Andricdef VLD3qAsm_8 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr",
83770b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
83780b57cec5SDimitry Andricdef VLD3qAsm_16 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr",
83790b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
83800b57cec5SDimitry Andricdef VLD3qAsm_32 : NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr",
83810b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
83820b57cec5SDimitry Andric
83830b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_8 :
83840b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83850b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83860b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_16 :
83870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83880b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83890b57cec5SDimitry Andricdef VLD3dWB_fixed_Asm_32 :
83900b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
83910b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
83920b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_8 :
83930b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr!",
83940b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
83950b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_16 :
83960b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr!",
83970b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
83980b57cec5SDimitry Andricdef VLD3qWB_fixed_Asm_32 :
83990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr!",
84000b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84010b57cec5SDimitry Andricdef VLD3dWB_register_Asm_8 :
84020b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
84030b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
84040b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84050b57cec5SDimitry Andricdef VLD3dWB_register_Asm_16 :
84060b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84070b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
84080b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84090b57cec5SDimitry Andricdef VLD3dWB_register_Asm_32 :
84100b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84110b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
84120b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84130b57cec5SDimitry Andricdef VLD3qWB_register_Asm_8 :
84140b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".8", "$list, $addr, $Rm",
84150b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
84160b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84170b57cec5SDimitry Andricdef VLD3qWB_register_Asm_16 :
84180b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".16", "$list, $addr, $Rm",
84190b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
84200b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84210b57cec5SDimitry Andricdef VLD3qWB_register_Asm_32 :
84220b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld3${p}", ".32", "$list, $addr, $Rm",
84230b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
84240b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84250b57cec5SDimitry Andric
84260b57cec5SDimitry Andric// VST3 single-lane pseudo-instructions. These need special handling for
84270b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
84280b57cec5SDimitry Andricdef VST3LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
84290b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84300b57cec5SDimitry Andric                    pred:$p)>;
84310b57cec5SDimitry Andricdef VST3LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
84320b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84330b57cec5SDimitry Andric                    pred:$p)>;
84340b57cec5SDimitry Andricdef VST3LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
84350b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84360b57cec5SDimitry Andric                    pred:$p)>;
84370b57cec5SDimitry Andricdef VST3LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
84380b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84390b57cec5SDimitry Andric                    pred:$p)>;
84400b57cec5SDimitry Andricdef VST3LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
84410b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84420b57cec5SDimitry Andric                    pred:$p)>;
84430b57cec5SDimitry Andric
84440b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_8 :
84450b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
84460b57cec5SDimitry Andric               (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84470b57cec5SDimitry Andric                    pred:$p)>;
84480b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_16 :
84490b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
84500b57cec5SDimitry Andric               (ins VecListThreeDHWordIndexed:$list, addrmode6alignNone:$addr,
84510b57cec5SDimitry Andric                    pred:$p)>;
84520b57cec5SDimitry Andricdef VST3LNdWB_fixed_Asm_32 :
84530b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
84540b57cec5SDimitry Andric               (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84550b57cec5SDimitry Andric                    pred:$p)>;
84560b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_16 :
84570b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
84580b57cec5SDimitry Andric               (ins VecListThreeQHWordIndexed:$list, addrmode6alignNone:$addr,
84590b57cec5SDimitry Andric                    pred:$p)>;
84600b57cec5SDimitry Andricdef VST3LNqWB_fixed_Asm_32 :
84610b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
84620b57cec5SDimitry Andric               (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84630b57cec5SDimitry Andric                    pred:$p)>;
84640b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_8 :
84650b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
84660b57cec5SDimitry Andric                  (ins VecListThreeDByteIndexed:$list, addrmode6alignNone:$addr,
84670b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84680b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_16 :
84690b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
84700b57cec5SDimitry Andric                  (ins VecListThreeDHWordIndexed:$list,
84710b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84720b57cec5SDimitry Andricdef VST3LNdWB_register_Asm_32 :
84730b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
84740b57cec5SDimitry Andric                  (ins VecListThreeDWordIndexed:$list, addrmode6alignNone:$addr,
84750b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84760b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_16 :
84770b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
84780b57cec5SDimitry Andric                  (ins VecListThreeQHWordIndexed:$list,
84790b57cec5SDimitry Andric                       addrmode6alignNone:$addr, rGPR:$Rm, pred:$p)>;
84800b57cec5SDimitry Andricdef VST3LNqWB_register_Asm_32 :
84810b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
84820b57cec5SDimitry Andric                  (ins VecListThreeQWordIndexed:$list, addrmode6alignNone:$addr,
84830b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
84840b57cec5SDimitry Andric
84850b57cec5SDimitry Andric
84860b57cec5SDimitry Andric// VST3 multiple structure pseudo-instructions. These need special handling for
84870b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
84880b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
84890b57cec5SDimitry Andricdef VST3dAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
84900b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84910b57cec5SDimitry Andricdef VST3dAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
84920b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84930b57cec5SDimitry Andricdef VST3dAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
84940b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
84950b57cec5SDimitry Andricdef VST3qAsm_8 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr",
84960b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84970b57cec5SDimitry Andricdef VST3qAsm_16 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr",
84980b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
84990b57cec5SDimitry Andricdef VST3qAsm_32 : NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr",
85000b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85010b57cec5SDimitry Andric
85020b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_8 :
85030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
85040b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85050b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_16 :
85060b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85070b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85080b57cec5SDimitry Andricdef VST3dWB_fixed_Asm_32 :
85090b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85100b57cec5SDimitry Andric               (ins VecListThreeD:$list, addrmode6align64:$addr, pred:$p)>;
85110b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_8 :
85120b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr!",
85130b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85140b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_16 :
85150b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr!",
85160b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85170b57cec5SDimitry Andricdef VST3qWB_fixed_Asm_32 :
85180b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr!",
85190b57cec5SDimitry Andric               (ins VecListThreeQ:$list, addrmode6align64:$addr, pred:$p)>;
85200b57cec5SDimitry Andricdef VST3dWB_register_Asm_8 :
85210b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
85220b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85230b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85240b57cec5SDimitry Andricdef VST3dWB_register_Asm_16 :
85250b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85260b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85270b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85280b57cec5SDimitry Andricdef VST3dWB_register_Asm_32 :
85290b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85300b57cec5SDimitry Andric                  (ins VecListThreeD:$list, addrmode6align64:$addr,
85310b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85320b57cec5SDimitry Andricdef VST3qWB_register_Asm_8 :
85330b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".8", "$list, $addr, $Rm",
85340b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85350b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85360b57cec5SDimitry Andricdef VST3qWB_register_Asm_16 :
85370b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".16", "$list, $addr, $Rm",
85380b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85390b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85400b57cec5SDimitry Andricdef VST3qWB_register_Asm_32 :
85410b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst3${p}", ".32", "$list, $addr, $Rm",
85420b57cec5SDimitry Andric                  (ins VecListThreeQ:$list, addrmode6align64:$addr,
85430b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85440b57cec5SDimitry Andric
85450b57cec5SDimitry Andric// VLD4 all-lanes pseudo-instructions. These need special handling for
85460b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
85470b57cec5SDimitry Andricdef VLD4DUPdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
85480b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
85490b57cec5SDimitry Andric                    pred:$p)>;
85500b57cec5SDimitry Andricdef VLD4DUPdAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
85510b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
85520b57cec5SDimitry Andric                    pred:$p)>;
85530b57cec5SDimitry Andricdef VLD4DUPdAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
85540b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
85550b57cec5SDimitry Andric                    pred:$p)>;
85560b57cec5SDimitry Andricdef VLD4DUPqAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
85570b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
85580b57cec5SDimitry Andric                    pred:$p)>;
85590b57cec5SDimitry Andricdef VLD4DUPqAsm_16: NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
85600b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
85610b57cec5SDimitry Andric                    pred:$p)>;
85620b57cec5SDimitry Andricdef VLD4DUPqAsm_32: NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
85630b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
85640b57cec5SDimitry Andric                    pred:$p)>;
85650b57cec5SDimitry Andric
85660b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_8 :
85670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
85680b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
85690b57cec5SDimitry Andric                    pred:$p)>;
85700b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_16 :
85710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
85720b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
85730b57cec5SDimitry Andric                    pred:$p)>;
85740b57cec5SDimitry Andricdef VLD4DUPdWB_fixed_Asm_32 :
85750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
85760b57cec5SDimitry Andric               (ins VecListFourDAllLanes:$list, addrmode6dupalign64or128:$addr,
85770b57cec5SDimitry Andric                    pred:$p)>;
85780b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_8 :
85790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
85800b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
85810b57cec5SDimitry Andric                    pred:$p)>;
85820b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_16 :
85830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
85840b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
85850b57cec5SDimitry Andric                    pred:$p)>;
85860b57cec5SDimitry Andricdef VLD4DUPqWB_fixed_Asm_32 :
85870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
85880b57cec5SDimitry Andric               (ins VecListFourQAllLanes:$list, addrmode6dupalign64or128:$addr,
85890b57cec5SDimitry Andric                    pred:$p)>;
85900b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_8 :
85910b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
85920b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign32:$addr,
85930b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85940b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_16 :
85950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
85960b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list, addrmode6dupalign64:$addr,
85970b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
85980b57cec5SDimitry Andricdef VLD4DUPdWB_register_Asm_32 :
85990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
86000b57cec5SDimitry Andric                  (ins VecListFourDAllLanes:$list,
86010b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
86020b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_8 :
86030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
86040b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign32:$addr,
86050b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86060b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_16 :
86070b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
86080b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list, addrmode6dupalign64:$addr,
86090b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86100b57cec5SDimitry Andricdef VLD4DUPqWB_register_Asm_32 :
86110b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
86120b57cec5SDimitry Andric                  (ins VecListFourQAllLanes:$list,
86130b57cec5SDimitry Andric                       addrmode6dupalign64or128:$addr, rGPR:$Rm, pred:$p)>;
86140b57cec5SDimitry Andric
86150b57cec5SDimitry Andric
86160b57cec5SDimitry Andric// VLD4 single-lane pseudo-instructions. These need special handling for
86170b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
86180b57cec5SDimitry Andricdef VLD4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86190b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
86200b57cec5SDimitry Andric                    pred:$p)>;
86210b57cec5SDimitry Andricdef VLD4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86220b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
86230b57cec5SDimitry Andric                    pred:$p)>;
86240b57cec5SDimitry Andricdef VLD4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86250b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
86260b57cec5SDimitry Andric                    pred:$p)>;
86270b57cec5SDimitry Andricdef VLD4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86280b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
86290b57cec5SDimitry Andric                    pred:$p)>;
86300b57cec5SDimitry Andricdef VLD4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86310b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
86320b57cec5SDimitry Andric                    pred:$p)>;
86330b57cec5SDimitry Andric
86340b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_8 :
86350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
86360b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
86370b57cec5SDimitry Andric                    pred:$p)>;
86380b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_16 :
86390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86400b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
86410b57cec5SDimitry Andric                    pred:$p)>;
86420b57cec5SDimitry Andricdef VLD4LNdWB_fixed_Asm_32 :
86430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
86440b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
86450b57cec5SDimitry Andric                    pred:$p)>;
86460b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_16 :
86470b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
86480b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
86490b57cec5SDimitry Andric                    pred:$p)>;
86500b57cec5SDimitry Andricdef VLD4LNqWB_fixed_Asm_32 :
86510b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
86520b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
86530b57cec5SDimitry Andric                    pred:$p)>;
86540b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_8 :
86550b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
86560b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
86570b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86580b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_16 :
86590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
86600b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
86610b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86620b57cec5SDimitry Andricdef VLD4LNdWB_register_Asm_32 :
86630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
86640b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
86650b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
86660b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_16 :
86670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
86680b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
86690b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
86700b57cec5SDimitry Andricdef VLD4LNqWB_register_Asm_32 :
86710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
86720b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
86730b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
86740b57cec5SDimitry Andric
86750b57cec5SDimitry Andric
86760b57cec5SDimitry Andric
86770b57cec5SDimitry Andric// VLD4 multiple structure pseudo-instructions. These need special handling for
86780b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
86790b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
86800b57cec5SDimitry Andricdef VLD4dAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86810b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
86820b57cec5SDimitry Andric                pred:$p)>;
86830b57cec5SDimitry Andricdef VLD4dAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86840b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
86850b57cec5SDimitry Andric                pred:$p)>;
86860b57cec5SDimitry Andricdef VLD4dAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86870b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
86880b57cec5SDimitry Andric                pred:$p)>;
86890b57cec5SDimitry Andricdef VLD4qAsm_8 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr",
86900b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
86910b57cec5SDimitry Andric                pred:$p)>;
86920b57cec5SDimitry Andricdef VLD4qAsm_16 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr",
86930b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
86940b57cec5SDimitry Andric                pred:$p)>;
86950b57cec5SDimitry Andricdef VLD4qAsm_32 : NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr",
86960b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
86970b57cec5SDimitry Andric                pred:$p)>;
86980b57cec5SDimitry Andric
86990b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_8 :
87000b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
87010b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87020b57cec5SDimitry Andric                pred:$p)>;
87030b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_16 :
87040b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87050b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87060b57cec5SDimitry Andric                pred:$p)>;
87070b57cec5SDimitry Andricdef VLD4dWB_fixed_Asm_32 :
87080b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87090b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87100b57cec5SDimitry Andric                pred:$p)>;
87110b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_8 :
87120b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr!",
87130b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87140b57cec5SDimitry Andric                pred:$p)>;
87150b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_16 :
87160b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr!",
87170b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87180b57cec5SDimitry Andric                pred:$p)>;
87190b57cec5SDimitry Andricdef VLD4qWB_fixed_Asm_32 :
87200b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr!",
87210b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87220b57cec5SDimitry Andric                pred:$p)>;
87230b57cec5SDimitry Andricdef VLD4dWB_register_Asm_8 :
87240b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87250b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87260b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87270b57cec5SDimitry Andricdef VLD4dWB_register_Asm_16 :
87280b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87290b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87300b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87310b57cec5SDimitry Andricdef VLD4dWB_register_Asm_32 :
87320b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87330b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
87340b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87350b57cec5SDimitry Andricdef VLD4qWB_register_Asm_8 :
87360b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".8", "$list, $addr, $Rm",
87370b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87380b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87390b57cec5SDimitry Andricdef VLD4qWB_register_Asm_16 :
87400b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".16", "$list, $addr, $Rm",
87410b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87420b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87430b57cec5SDimitry Andricdef VLD4qWB_register_Asm_32 :
87440b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vld4${p}", ".32", "$list, $addr, $Rm",
87450b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
87460b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87470b57cec5SDimitry Andric
87480b57cec5SDimitry Andric// VST4 single-lane pseudo-instructions. These need special handling for
87490b57cec5SDimitry Andric// the lane index that an InstAlias can't handle, so we use these instead.
87500b57cec5SDimitry Andricdef VST4LNdAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
87510b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87520b57cec5SDimitry Andric                    pred:$p)>;
87530b57cec5SDimitry Andricdef VST4LNdAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
87540b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87550b57cec5SDimitry Andric                    pred:$p)>;
87560b57cec5SDimitry Andricdef VST4LNdAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
87570b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87580b57cec5SDimitry Andric                    pred:$p)>;
87590b57cec5SDimitry Andricdef VST4LNqAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
87600b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87610b57cec5SDimitry Andric                    pred:$p)>;
87620b57cec5SDimitry Andricdef VST4LNqAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
87630b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87640b57cec5SDimitry Andric                    pred:$p)>;
87650b57cec5SDimitry Andric
87660b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_8 :
87670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
87680b57cec5SDimitry Andric               (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87690b57cec5SDimitry Andric                    pred:$p)>;
87700b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_16 :
87710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
87720b57cec5SDimitry Andric               (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87730b57cec5SDimitry Andric                    pred:$p)>;
87740b57cec5SDimitry Andricdef VST4LNdWB_fixed_Asm_32 :
87750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
87760b57cec5SDimitry Andric               (ins VecListFourDWordIndexed:$list, addrmode6align64or128:$addr,
87770b57cec5SDimitry Andric                    pred:$p)>;
87780b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_16 :
87790b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
87800b57cec5SDimitry Andric               (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
87810b57cec5SDimitry Andric                    pred:$p)>;
87820b57cec5SDimitry Andricdef VST4LNqWB_fixed_Asm_32 :
87830b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
87840b57cec5SDimitry Andric               (ins VecListFourQWordIndexed:$list, addrmode6align64or128:$addr,
87850b57cec5SDimitry Andric                    pred:$p)>;
87860b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_8 :
87870b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
87880b57cec5SDimitry Andric                  (ins VecListFourDByteIndexed:$list, addrmode6align32:$addr,
87890b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87900b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_16 :
87910b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
87920b57cec5SDimitry Andric                  (ins VecListFourDHWordIndexed:$list, addrmode6align64:$addr,
87930b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
87940b57cec5SDimitry Andricdef VST4LNdWB_register_Asm_32 :
87950b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
87960b57cec5SDimitry Andric                  (ins VecListFourDWordIndexed:$list,
87970b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
87980b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_16 :
87990b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
88000b57cec5SDimitry Andric                  (ins VecListFourQHWordIndexed:$list, addrmode6align64:$addr,
88010b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88020b57cec5SDimitry Andricdef VST4LNqWB_register_Asm_32 :
88030b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
88040b57cec5SDimitry Andric                  (ins VecListFourQWordIndexed:$list,
88050b57cec5SDimitry Andric                       addrmode6align64or128:$addr, rGPR:$Rm, pred:$p)>;
88060b57cec5SDimitry Andric
88070b57cec5SDimitry Andric
88080b57cec5SDimitry Andric// VST4 multiple structure pseudo-instructions. These need special handling for
88090b57cec5SDimitry Andric// the vector operands that the normal instructions don't yet model.
88100b57cec5SDimitry Andric// FIXME: Remove these when the register classes and instructions are updated.
88110b57cec5SDimitry Andricdef VST4dAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
88120b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88130b57cec5SDimitry Andric                    pred:$p)>;
88140b57cec5SDimitry Andricdef VST4dAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88150b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88160b57cec5SDimitry Andric                    pred:$p)>;
88170b57cec5SDimitry Andricdef VST4dAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88180b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88190b57cec5SDimitry Andric                    pred:$p)>;
88200b57cec5SDimitry Andricdef VST4qAsm_8 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr",
88210b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88220b57cec5SDimitry Andric                    pred:$p)>;
88230b57cec5SDimitry Andricdef VST4qAsm_16 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr",
88240b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88250b57cec5SDimitry Andric                    pred:$p)>;
88260b57cec5SDimitry Andricdef VST4qAsm_32 : NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr",
88270b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88280b57cec5SDimitry Andric                    pred:$p)>;
88290b57cec5SDimitry Andric
88300b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_8 :
88310b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
88320b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88330b57cec5SDimitry Andric                    pred:$p)>;
88340b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_16 :
88350b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88360b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88370b57cec5SDimitry Andric                    pred:$p)>;
88380b57cec5SDimitry Andricdef VST4dWB_fixed_Asm_32 :
88390b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88400b57cec5SDimitry Andric               (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88410b57cec5SDimitry Andric                    pred:$p)>;
88420b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_8 :
88430b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr!",
88440b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88450b57cec5SDimitry Andric                    pred:$p)>;
88460b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_16 :
88470b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr!",
88480b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88490b57cec5SDimitry Andric                    pred:$p)>;
88500b57cec5SDimitry Andricdef VST4qWB_fixed_Asm_32 :
88510b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr!",
88520b57cec5SDimitry Andric               (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88530b57cec5SDimitry Andric                    pred:$p)>;
88540b57cec5SDimitry Andricdef VST4dWB_register_Asm_8 :
88550b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
88560b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88570b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88580b57cec5SDimitry Andricdef VST4dWB_register_Asm_16 :
88590b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
88600b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88610b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88620b57cec5SDimitry Andricdef VST4dWB_register_Asm_32 :
88630b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
88640b57cec5SDimitry Andric                  (ins VecListFourD:$list, addrmode6align64or128or256:$addr,
88650b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88660b57cec5SDimitry Andricdef VST4qWB_register_Asm_8 :
88670b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".8", "$list, $addr, $Rm",
88680b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88690b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88700b57cec5SDimitry Andricdef VST4qWB_register_Asm_16 :
88710b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".16", "$list, $addr, $Rm",
88720b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88730b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88740b57cec5SDimitry Andricdef VST4qWB_register_Asm_32 :
88750b57cec5SDimitry Andric        NEONDataTypeAsmPseudoInst<"vst4${p}", ".32", "$list, $addr, $Rm",
88760b57cec5SDimitry Andric                  (ins VecListFourQ:$list, addrmode6align64or128or256:$addr,
88770b57cec5SDimitry Andric                       rGPR:$Rm, pred:$p)>;
88780b57cec5SDimitry Andric
88790b57cec5SDimitry Andric// VMOV/VMVN takes an optional datatype suffix
88800b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
88810b57cec5SDimitry Andric                         (VORRd DPR:$Vd, DPR:$Vm, DPR:$Vm, pred:$p)>;
88820b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmov${p}", "$Vd, $Vm",
88830b57cec5SDimitry Andric                         (VORRq QPR:$Vd, QPR:$Vm, QPR:$Vm, pred:$p)>;
88840b57cec5SDimitry Andric
88850b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
88860b57cec5SDimitry Andric                         (VMVNd DPR:$Vd, DPR:$Vm, pred:$p)>;
88870b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vmvn${p}", "$Vd, $Vm",
88880b57cec5SDimitry Andric                         (VMVNq QPR:$Vd, QPR:$Vm, pred:$p)>;
88890b57cec5SDimitry Andric
88900b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
88910b57cec5SDimitry Andric// D-register versions.
88920b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Dd, $Dn, $Dm",
88930b57cec5SDimitry Andric                    (VCGEsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
88940b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Dd, $Dn, $Dm",
88950b57cec5SDimitry Andric                    (VCGEsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
88960b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Dd, $Dn, $Dm",
88970b57cec5SDimitry Andric                    (VCGEsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
88980b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Dd, $Dn, $Dm",
88990b57cec5SDimitry Andric                    (VCGEuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89000b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Dd, $Dn, $Dm",
89010b57cec5SDimitry Andric                    (VCGEuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89020b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Dd, $Dn, $Dm",
89030b57cec5SDimitry Andric                    (VCGEuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89040b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Dd, $Dn, $Dm",
89050b57cec5SDimitry Andric                    (VCGEfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89060b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
89070b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Dd, $Dn, $Dm",
89080b57cec5SDimitry Andric                    (VCGEhd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89090b57cec5SDimitry Andric// Q-register versions.
89100b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s8 $Qd, $Qn, $Qm",
89110b57cec5SDimitry Andric                    (VCGEsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89120b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s16 $Qd, $Qn, $Qm",
89130b57cec5SDimitry Andric                    (VCGEsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89140b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.s32 $Qd, $Qn, $Qm",
89150b57cec5SDimitry Andric                    (VCGEsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89160b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u8 $Qd, $Qn, $Qm",
89170b57cec5SDimitry Andric                    (VCGEuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89180b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u16 $Qd, $Qn, $Qm",
89190b57cec5SDimitry Andric                    (VCGEuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89200b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.u32 $Qd, $Qn, $Qm",
89210b57cec5SDimitry Andric                    (VCGEuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89220b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f32 $Qd, $Qn, $Qm",
89230b57cec5SDimitry Andric                    (VCGEfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89240b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
89250b57cec5SDimitry Andricdef : NEONInstAlias<"vcle${p}.f16 $Qd, $Qn, $Qm",
89260b57cec5SDimitry Andric                    (VCGEhq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89270b57cec5SDimitry Andric
89280b57cec5SDimitry Andric// VCLT (register) is an assembler alias for VCGT w/ the operands reversed.
89290b57cec5SDimitry Andric// D-register versions.
89300b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Dd, $Dn, $Dm",
89310b57cec5SDimitry Andric                    (VCGTsv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89320b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Dd, $Dn, $Dm",
89330b57cec5SDimitry Andric                    (VCGTsv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89340b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Dd, $Dn, $Dm",
89350b57cec5SDimitry Andric                    (VCGTsv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89360b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Dd, $Dn, $Dm",
89370b57cec5SDimitry Andric                    (VCGTuv8i8 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89380b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Dd, $Dn, $Dm",
89390b57cec5SDimitry Andric                    (VCGTuv4i16 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89400b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Dd, $Dn, $Dm",
89410b57cec5SDimitry Andric                    (VCGTuv2i32 DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89420b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Dd, $Dn, $Dm",
89430b57cec5SDimitry Andric                    (VCGTfd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89440b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
89450b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Dd, $Dn, $Dm",
89460b57cec5SDimitry Andric                    (VCGThd DPR:$Dd, DPR:$Dm, DPR:$Dn, pred:$p)>;
89470b57cec5SDimitry Andric// Q-register versions.
89480b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s8 $Qd, $Qn, $Qm",
89490b57cec5SDimitry Andric                    (VCGTsv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89500b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s16 $Qd, $Qn, $Qm",
89510b57cec5SDimitry Andric                    (VCGTsv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89520b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.s32 $Qd, $Qn, $Qm",
89530b57cec5SDimitry Andric                    (VCGTsv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89540b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u8 $Qd, $Qn, $Qm",
89550b57cec5SDimitry Andric                    (VCGTuv16i8 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89560b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u16 $Qd, $Qn, $Qm",
89570b57cec5SDimitry Andric                    (VCGTuv8i16 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89580b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.u32 $Qd, $Qn, $Qm",
89590b57cec5SDimitry Andric                    (VCGTuv4i32 QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89600b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f32 $Qd, $Qn, $Qm",
89610b57cec5SDimitry Andric                    (VCGTfq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89620b57cec5SDimitry Andriclet Predicates = [HasNEON, HasFullFP16] in
89630b57cec5SDimitry Andricdef : NEONInstAlias<"vclt${p}.f16 $Qd, $Qn, $Qm",
89640b57cec5SDimitry Andric                    (VCGThq QPR:$Qd, QPR:$Qm, QPR:$Qn, pred:$p)>;
89650b57cec5SDimitry Andric
89660b57cec5SDimitry Andric// VSWP allows, but does not require, a type suffix.
89670b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
89680b57cec5SDimitry Andric                         (VSWPd DPR:$Vd, DPR:$Vm, pred:$p)>;
89690b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vswp${p}", "$Vd, $Vm",
89700b57cec5SDimitry Andric                         (VSWPq QPR:$Vd, QPR:$Vm, pred:$p)>;
89710b57cec5SDimitry Andric
89720b57cec5SDimitry Andric// VBIF, VBIT, and VBSL allow, but do not require, a type suffix.
89730b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
89740b57cec5SDimitry Andric                         (VBIFd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
89750b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
89760b57cec5SDimitry Andric                         (VBITd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
89770b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
89780b57cec5SDimitry Andric                         (VBSLd DPR:$Vd, DPR:$Vn, DPR:$Vm, pred:$p)>;
89790b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbif${p}", "$Vd, $Vn, $Vm",
89800b57cec5SDimitry Andric                         (VBIFq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
89810b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbit${p}", "$Vd, $Vn, $Vm",
89820b57cec5SDimitry Andric                         (VBITq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
89830b57cec5SDimitry Andricdefm : NEONDTAnyInstAlias<"vbsl${p}", "$Vd, $Vn, $Vm",
89840b57cec5SDimitry Andric                         (VBSLq QPR:$Vd, QPR:$Vn, QPR:$Vm, pred:$p)>;
89850b57cec5SDimitry Andric
89860b57cec5SDimitry Andric// "vmov Rd, #-imm" can be handled via "vmvn".
89870b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
89880b57cec5SDimitry Andric                    (VMVNv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
89890b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.i32 $Vd, $imm",
89900b57cec5SDimitry Andric                    (VMVNv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
89910b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
89920b57cec5SDimitry Andric                    (VMOVv2i32 DPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
89930b57cec5SDimitry Andricdef : NEONInstAlias<"vmvn${p}.i32 $Vd, $imm",
89940b57cec5SDimitry Andric                    (VMOVv4i32 QPR:$Vd, nImmVMOVI32Neg:$imm, pred:$p)>;
89950b57cec5SDimitry Andric
89960b57cec5SDimitry Andric// 'gas' compatibility aliases for quad-word instructions. Strictly speaking,
89970b57cec5SDimitry Andric// these should restrict to just the Q register variants, but the register
89980b57cec5SDimitry Andric// classes are enough to match correctly regardless, so we keep it simple
89990b57cec5SDimitry Andric// and just use MnemonicAlias.
90000b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vbicq", "vbic">;
90010b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vandq", "vand">;
90020b57cec5SDimitry Andricdef : NEONMnemonicAlias<"veorq", "veor">;
90030b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vorrq", "vorr">;
90040b57cec5SDimitry Andric
90050b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq", "vmov">;
90060b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmvnq", "vmvn">;
90070b57cec5SDimitry Andric// Explicit versions for floating point so that the FPImm variants get
90080b57cec5SDimitry Andric// handled early. The parser gets confused otherwise.
90090b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f32", "vmov.f32">;
90100b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmovq.f64", "vmov.f64">;
90110b57cec5SDimitry Andric
90120b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vaddq", "vadd">;
90130b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vsubq", "vsub">;
90140b57cec5SDimitry Andric
90150b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vminq", "vmin">;
90160b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmaxq", "vmax">;
90170b57cec5SDimitry Andric
90180b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vmulq", "vmul">;
90190b57cec5SDimitry Andric
90200b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vabsq", "vabs">;
90210b57cec5SDimitry Andric
90220b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshlq", "vshl">;
90230b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vshrq", "vshr">;
90240b57cec5SDimitry Andric
90250b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcvtq", "vcvt">;
90260b57cec5SDimitry Andric
90270b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vcleq", "vcle">;
90280b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vceqq", "vceq">;
90290b57cec5SDimitry Andric
90300b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vzipq", "vzip">;
90310b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vswpq", "vswp">;
90320b57cec5SDimitry Andric
90330b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.f32", "vrecpe.f32">;
90340b57cec5SDimitry Andricdef : NEONMnemonicAlias<"vrecpeq.u32", "vrecpe.u32">;
90350b57cec5SDimitry Andric
90360b57cec5SDimitry Andric
90370b57cec5SDimitry Andric// Alias for loading floating point immediates that aren't representable
90380b57cec5SDimitry Andric// using the vmov.f32 encoding but the bitpattern is representable using
90390b57cec5SDimitry Andric// the .i32 encoding.
90400b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
90410b57cec5SDimitry Andric                     (VMOVv4i32 QPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
90420b57cec5SDimitry Andricdef : NEONInstAlias<"vmov${p}.f32 $Vd, $imm",
90430b57cec5SDimitry Andric                     (VMOVv2i32 DPR:$Vd, nImmVMOVI32:$imm, pred:$p)>;
9044*5ffd83dbSDimitry Andric
9045*5ffd83dbSDimitry Andric// ARMv8.6a BFloat16 instructions.
9046*5ffd83dbSDimitry Andriclet Predicates = [HasBF16, HasNEON] in {
9047*5ffd83dbSDimitry Andricclass BF16VDOT<bits<5> op27_23, bits<2> op21_20, bit op6,
9048*5ffd83dbSDimitry Andric               dag oops, dag iops, list<dag> pattern>
9049*5ffd83dbSDimitry Andric   : N3Vnp<op27_23, op21_20, 0b1101, op6, 0, oops, iops,
9050*5ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "", pattern>
9051*5ffd83dbSDimitry Andric{
9052*5ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
9053*5ffd83dbSDimitry Andric}
9054*5ffd83dbSDimitry Andric
9055*5ffd83dbSDimitry Andricclass BF16VDOTS<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy, ValueType InputTy>
9056*5ffd83dbSDimitry Andric   : BF16VDOT<0b11000, 0b00,  Q, (outs RegTy:$dst),
9057*5ffd83dbSDimitry Andric              (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
9058*5ffd83dbSDimitry Andric            [(set (AccumTy RegTy:$dst),
9059*5ffd83dbSDimitry Andric                  (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
9060*5ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vn),
9061*5ffd83dbSDimitry Andric                                      (InputTy RegTy:$Vm)))]> {
9062*5ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
9063*5ffd83dbSDimitry Andric  let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
9064*5ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
9065*5ffd83dbSDimitry Andric}
9066*5ffd83dbSDimitry Andric
9067*5ffd83dbSDimitry Andricmulticlass BF16VDOTI<bit Q, RegisterClass RegTy, string opc, ValueType AccumTy,
9068*5ffd83dbSDimitry Andric                     ValueType InputTy, dag RHS> {
9069*5ffd83dbSDimitry Andric
9070*5ffd83dbSDimitry Andric  def "" : BF16VDOT<0b11100, 0b00, Q, (outs RegTy:$dst),
9071*5ffd83dbSDimitry Andric                    (ins RegTy:$Vd, RegTy:$Vn,
9072*5ffd83dbSDimitry Andric                    DPR_VFP2:$Vm, VectorIndex32:$lane), []> {
9073*5ffd83dbSDimitry Andric    bit lane;
9074*5ffd83dbSDimitry Andric    let Inst{5} = lane;
9075*5ffd83dbSDimitry Andric    let Constraints = "$dst = $Vd";
9076*5ffd83dbSDimitry Andric    let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm$lane");
9077*5ffd83dbSDimitry Andric    let DecoderNamespace = "VFPV8";
9078*5ffd83dbSDimitry Andric  }
9079*5ffd83dbSDimitry Andric
9080*5ffd83dbSDimitry Andric  def : Pat<
9081*5ffd83dbSDimitry Andric    (AccumTy (int_arm_neon_bfdot (AccumTy RegTy:$Vd),
9082*5ffd83dbSDimitry Andric                                 (InputTy RegTy:$Vn),
9083*5ffd83dbSDimitry Andric                                 (InputTy (bitconvert (AccumTy
9084*5ffd83dbSDimitry Andric                                          (ARMvduplane (AccumTy RegTy:$Vm),
9085*5ffd83dbSDimitry Andric                                                        VectorIndex32:$lane)))))),
9086*5ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) RegTy:$Vd, RegTy:$Vn, RHS, VectorIndex32:$lane)>;
9087*5ffd83dbSDimitry Andric}
9088*5ffd83dbSDimitry Andric
9089*5ffd83dbSDimitry Andricdef BF16VDOTS_VDOTD : BF16VDOTS<0, DPR, "vdot", v2f32, v8i8>;
9090*5ffd83dbSDimitry Andricdef BF16VDOTS_VDOTQ : BF16VDOTS<1, QPR, "vdot", v4f32, v16i8>;
9091*5ffd83dbSDimitry Andric
9092*5ffd83dbSDimitry Andricdefm BF16VDOTI_VDOTD : BF16VDOTI<0, DPR, "vdot", v2f32, v8i8, (v2f32 DPR_VFP2:$Vm)>;
9093*5ffd83dbSDimitry Andricdefm BF16VDOTI_VDOTQ : BF16VDOTI<1, QPR, "vdot", v4f32, v16i8, (EXTRACT_SUBREG QPR:$Vm, dsub_0)>;
9094*5ffd83dbSDimitry Andric
9095*5ffd83dbSDimitry Andricclass BF16MM<bit Q, RegisterClass RegTy,
9096*5ffd83dbSDimitry Andric             string opc>
9097*5ffd83dbSDimitry Andric   : N3Vnp<0b11000, 0b00, 0b1100, Q, 0,
9098*5ffd83dbSDimitry Andric           (outs RegTy:$dst), (ins RegTy:$Vd, RegTy:$Vn, RegTy:$Vm),
9099*5ffd83dbSDimitry Andric           N3RegFrm, IIC_VDOTPROD, "", "",
9100*5ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst), (int_arm_neon_bfmmla (v4f32 QPR:$Vd),
9101*5ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vn),
9102*5ffd83dbSDimitry Andric                                                (v16i8 QPR:$Vm)))]> {
9103*5ffd83dbSDimitry Andric   let Constraints = "$dst = $Vd";
9104*5ffd83dbSDimitry Andric   let AsmString = !strconcat(opc, ".bf16", "\t$Vd, $Vn, $Vm");
9105*5ffd83dbSDimitry Andric   let DecoderNamespace = "VFPV8";
9106*5ffd83dbSDimitry Andric}
9107*5ffd83dbSDimitry Andric
9108*5ffd83dbSDimitry Andricdef VMMLA : BF16MM<1, QPR, "vmmla">;
9109*5ffd83dbSDimitry Andric
9110*5ffd83dbSDimitry Andricclass VBF16MALQ<bit T, string suffix, SDPatternOperator OpNode>
9111*5ffd83dbSDimitry Andric  : N3VCP8<0b00, 0b11, T, 1,
9112*5ffd83dbSDimitry Andric           (outs QPR:$dst), (ins QPR:$Vd, QPR:$Vn, QPR:$Vm),
9113*5ffd83dbSDimitry Andric           NoItinerary, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm", "",
9114*5ffd83dbSDimitry Andric                [(set (v4f32 QPR:$dst),
9115*5ffd83dbSDimitry Andric                      (OpNode (v4f32 QPR:$Vd),
9116*5ffd83dbSDimitry Andric                              (v16i8 QPR:$Vn),
9117*5ffd83dbSDimitry Andric                              (v16i8 QPR:$Vm)))]> {
9118*5ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
9119*5ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
9120*5ffd83dbSDimitry Andric}
9121*5ffd83dbSDimitry Andric
9122*5ffd83dbSDimitry Andricdef VBF16MALTQ: VBF16MALQ<1, "t", int_arm_neon_bfmlalt>;
9123*5ffd83dbSDimitry Andricdef VBF16MALBQ: VBF16MALQ<0, "b", int_arm_neon_bfmlalb>;
9124*5ffd83dbSDimitry Andric
9125*5ffd83dbSDimitry Andricmulticlass VBF16MALQI<bit T, string suffix, SDPatternOperator OpNode> {
9126*5ffd83dbSDimitry Andric  def "" : N3VLaneCP8<0, 0b11, T, 1, (outs QPR:$dst),
9127*5ffd83dbSDimitry Andric              (ins QPR:$Vd, QPR:$Vn, DPR_8:$Vm, VectorIndex16:$idx),
9128*5ffd83dbSDimitry Andric               IIC_VMACD, "vfma" # suffix, "bf16", "$Vd, $Vn, $Vm$idx", "", []> {
9129*5ffd83dbSDimitry Andric  bits<2> idx;
9130*5ffd83dbSDimitry Andric  let Inst{5} = idx{1};
9131*5ffd83dbSDimitry Andric  let Inst{3} = idx{0};
9132*5ffd83dbSDimitry Andric  let Constraints = "$dst = $Vd";
9133*5ffd83dbSDimitry Andric  let DecoderNamespace = "VFPV8";
9134*5ffd83dbSDimitry Andric  }
9135*5ffd83dbSDimitry Andric
9136*5ffd83dbSDimitry Andric  def : Pat<
9137*5ffd83dbSDimitry Andric    (v4f32 (OpNode (v4f32 QPR:$Vd),
9138*5ffd83dbSDimitry Andric                   (v16i8 QPR:$Vn),
9139*5ffd83dbSDimitry Andric                   (v16i8 (bitconvert (v8bf16 (ARMvduplane (v8bf16 QPR:$Vm),
9140*5ffd83dbSDimitry Andric                                                           VectorIndex16:$lane)))))),
9141*5ffd83dbSDimitry Andric    (!cast<Instruction>(NAME) QPR:$Vd,
9142*5ffd83dbSDimitry Andric                              QPR:$Vn,
9143*5ffd83dbSDimitry Andric                              (EXTRACT_SUBREG QPR:$Vm,
9144*5ffd83dbSDimitry Andric                                (DSubReg_i16_reg VectorIndex16:$lane)),
9145*5ffd83dbSDimitry Andric                              (SubReg_i16_lane VectorIndex16:$lane))>;
9146*5ffd83dbSDimitry Andric}
9147*5ffd83dbSDimitry Andric
9148*5ffd83dbSDimitry Andricdefm VBF16MALTQI: VBF16MALQI<1, "t", int_arm_neon_bfmlalt>;
9149*5ffd83dbSDimitry Andricdefm VBF16MALBQI: VBF16MALQI<0, "b", int_arm_neon_bfmlalb>;
9150*5ffd83dbSDimitry Andric
9151*5ffd83dbSDimitry Andricdef BF16_VCVT :  N2V<0b11, 0b11, 0b01, 0b10, 0b01100, 1, 0,
9152*5ffd83dbSDimitry Andric                    (outs DPR:$Vd), (ins QPR:$Vm),
9153*5ffd83dbSDimitry Andric                    NoItinerary, "vcvt", "bf16.f32", "$Vd, $Vm", "", []>;
9154*5ffd83dbSDimitry Andric}
9155*5ffd83dbSDimitry Andric// End of BFloat16 instructions
9156