|
| 1 | +//===-- RISCVInstrInfoZicldst.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 the RISC-V instructions from the standard Integer |
| 10 | +// Conditional Load Store operations extension (Zicldst). |
| 11 | +// |
| 12 | +//===----------------------------------------------------------------------===// |
| 13 | + |
| 14 | +let hasSideEffects = 0, mayLoad = 1, mayStore = 0 in { |
| 15 | +class CondLoad_ri<bits<3> funct3, string opcodestr> |
| 16 | + : RVInstI<funct3, OPC_CUSTOM_0, (outs GPR:$rd), (ins GPRMem:$rs1, simm12:$imm12), |
| 17 | + opcodestr, "$rd, ${imm12}(${rs1})">; |
| 18 | +} |
| 19 | + |
| 20 | +let hasSideEffects = 0, mayLoad = 0, mayStore = 1 in { |
| 21 | +class CondStore_rri<bits<3> funct3, string opcodestr> |
| 22 | + : RVInstS<funct3, OPC_CUSTOM_1, (outs), |
| 23 | + (ins GPR:$rs2, GPRMem:$rs1, simm12:$imm12), |
| 24 | + opcodestr, "$rs2, ${imm12}(${rs1})">; |
| 25 | +} |
| 26 | + |
| 27 | +let Predicates = [HasStdExtZicldst] in { |
| 28 | + |
| 29 | +let IsSignExtendingOpW = 1 in { |
| 30 | +def CLB : CondLoad_ri<0b000, "clb">, Sched<[WriteLDB, ReadMemBase]>; |
| 31 | +def CLH : CondLoad_ri<0b001, "clh">, Sched<[WriteLDH, ReadMemBase]>; |
| 32 | +def CLW : CondLoad_ri<0b010, "clw">, Sched<[WriteLDW, ReadMemBase]>; |
| 33 | +def CLBU : CondLoad_ri<0b100, "clbu">, Sched<[WriteLDB, ReadMemBase]>; |
| 34 | +def CLHU : CondLoad_ri<0b101, "clhu">, Sched<[WriteLDH, ReadMemBase]>; |
| 35 | +} |
| 36 | + |
| 37 | +def CSB : CondStore_rri<0b000, "csb">, Sched<[WriteSTB, ReadStoreData, ReadMemBase]>; |
| 38 | +def CSH : CondStore_rri<0b001, "csh">, Sched<[WriteSTH, ReadStoreData, ReadMemBase]>; |
| 39 | +def CSW : CondStore_rri<0b010, "csw">, Sched<[WriteSTW, ReadStoreData, ReadMemBase]>; |
| 40 | + |
| 41 | +} // Predicates = [HasStdExtZcildst] |
| 42 | + |
| 43 | +let Predicates = [HasStdExtZicldst, IsRV64] in { |
| 44 | +def CLWU : CondLoad_ri<0b110, "clwu">, Sched<[WriteLDW, ReadMemBase]>; |
| 45 | +def CLD : CondLoad_ri<0b011, "cld">, Sched<[WriteLDD, ReadMemBase]>; |
| 46 | +def CSD : CondStore_rri<0b011, "csd">, Sched<[WriteSTD, ReadStoreData, ReadMemBase]>; |
| 47 | +} // Predicates = [HasStdExtZicldst, IsRV64] |
0 commit comments