|
| 1 | +//===---------------- RISCVInstrInfoXqccmp.td --------------*- tablegen -*-===// |
| 2 | +// |
| 3 | +// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. |
| 4 | +// See https://llvm.org/LICENSE.txt for license information. |
| 5 | +// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception |
| 6 | +// |
| 7 | +//===----------------------------------------------------------------------===// |
| 8 | +// |
| 9 | +// This file describes Qualcomm's Xqccmp extension. |
| 10 | +// |
| 11 | +// Xqccmp is broadly equivalent to (and incompatible with) Zcmp except the |
| 12 | +// following changes: |
| 13 | +// |
| 14 | +// - The registers are pushed in the opposite order, so `ra` and `fp` are |
| 15 | +// closest to the incoming stack pointer (to be compatible with the |
| 16 | +// frame-pointer convention), and |
| 17 | +// |
| 18 | +// - There is a new `qc.cm.pushfp` instruction which is `qc.cm.push` but it sets |
| 19 | +// `fp` to the incoming stack pointer value, as expected by the frame-pointer |
| 20 | +// convention. |
| 21 | +// |
| 22 | +//===----------------------------------------------------------------------===// |
| 23 | + |
| 24 | +//===----------------------------------------------------------------------===// |
| 25 | +// Operand and SDNode transformation definitions. |
| 26 | +//===----------------------------------------------------------------------===// |
| 27 | + |
| 28 | +//===----------------------------------------------------------------------===// |
| 29 | +// Instruction Formats |
| 30 | +//===----------------------------------------------------------------------===// |
| 31 | + |
| 32 | +//===----------------------------------------------------------------------===// |
| 33 | +// Instruction Class Templates |
| 34 | +//===----------------------------------------------------------------------===// |
| 35 | + |
| 36 | +//===----------------------------------------------------------------------===// |
| 37 | +// Instructions |
| 38 | +//===----------------------------------------------------------------------===// |
| 39 | + |
| 40 | +let DecoderNamespace = "Xqccmp", Predicates = [HasVendorXqccmp] in { |
| 41 | + |
| 42 | +let hasSideEffects = 0, mayLoad = 0, mayStore = 0 in { |
| 43 | +let Defs = [X10, X11] in |
| 44 | +def QC_CM_MVA01S : RVInst16CA<0b101011, 0b11, 0b10, (outs), |
| 45 | + (ins SR07:$rs1, SR07:$rs2), "qc.cm.mva01s", "$rs1, $rs2">, |
| 46 | + Sched<[WriteIALU, WriteIALU, ReadIALU, ReadIALU]>; |
| 47 | + |
| 48 | +let Uses = [X10, X11] in |
| 49 | +def QC_CM_MVSA01 : RVInst16CA<0b101011, 0b01, 0b10, (outs SR07:$rs1, SR07:$rs2), |
| 50 | + (ins), "qc.cm.mvsa01", "$rs1, $rs2">, |
| 51 | + Sched<[WriteIALU, WriteIALU, ReadIALU, ReadIALU]>; |
| 52 | +} // hasSideEffects = 0, mayLoad = 0, mayStore = 0 |
| 53 | + |
| 54 | +let hasSideEffects = 0, mayLoad = 0, mayStore = 1, Uses = [X2], Defs = [X2] in |
| 55 | +def QC_CM_PUSH : RVInstZcCPPP<0b11000, "qc.cm.push", negstackadj>, |
| 56 | + Sched<[WriteIALU, ReadIALU, ReadStoreData, ReadStoreData, |
| 57 | + ReadStoreData, ReadStoreData, ReadStoreData, ReadStoreData, |
| 58 | + ReadStoreData, ReadStoreData, ReadStoreData, ReadStoreData, |
| 59 | + ReadStoreData, ReadStoreData, ReadStoreData]>; |
| 60 | + |
| 61 | +let hasSideEffects = 0, mayLoad = 0, mayStore = 1, Uses = [X2], Defs = [X2, X8] in |
| 62 | +def QC_CM_PUSHFP : RVInstZcCPPP<0b11001, "qc.cm.pushfp", negstackadj>, |
| 63 | + Sched<[WriteIALU, WriteIALU, ReadIALU, ReadStoreData, ReadStoreData, |
| 64 | + ReadStoreData, ReadStoreData, ReadStoreData, ReadStoreData, |
| 65 | + ReadStoreData, ReadStoreData, ReadStoreData, ReadStoreData, |
| 66 | + ReadStoreData, ReadStoreData, ReadStoreData]>; |
| 67 | + |
| 68 | +let hasSideEffects = 0, mayLoad = 1, mayStore = 0, isReturn = 1, |
| 69 | + Uses = [X2], Defs = [X2] in |
| 70 | +def QC_CM_POPRET : RVInstZcCPPP<0b11110, "qc.cm.popret">, |
| 71 | + Sched<[WriteIALU, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 72 | + WriteLDW, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 73 | + WriteLDW, WriteLDW, WriteLDW, WriteLDW, ReadIALU]>; |
| 74 | + |
| 75 | +let hasSideEffects = 0, mayLoad = 1, mayStore = 0, isReturn = 1, |
| 76 | + Uses = [X2], Defs = [X2, X10] in |
| 77 | +def QC_CM_POPRETZ : RVInstZcCPPP<0b11100, "qc.cm.popretz">, |
| 78 | + Sched<[WriteIALU, WriteIALU, WriteLDW, WriteLDW, WriteLDW, |
| 79 | + WriteLDW, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 80 | + WriteLDW, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 81 | + ReadIALU]>; |
| 82 | + |
| 83 | +let hasSideEffects = 0, mayLoad = 1, mayStore = 0, |
| 84 | + Uses = [X2], Defs = [X2] in |
| 85 | +def QC_CM_POP : RVInstZcCPPP<0b11010, "qc.cm.pop">, |
| 86 | + Sched<[WriteIALU, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 87 | + WriteLDW, WriteLDW, WriteLDW, WriteLDW, WriteLDW, WriteLDW, |
| 88 | + WriteLDW, WriteLDW, WriteLDW, ReadIALU]>; |
| 89 | + |
| 90 | +} // DecoderNamespace = "Xqccmp", Predicates = [HasVendorXqccmp] |
| 91 | + |
| 92 | +//===----------------------------------------------------------------------===// |
| 93 | +// Aliases |
| 94 | +//===----------------------------------------------------------------------===// |
| 95 | + |
0 commit comments