//===-- RISCVInstrGISel.td - RISC-V GISel target pseudos ----*- tablegen -*-===// // // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. // See https://llvm.org/LICENSE.txt for license information. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception // //===----------------------------------------------------------------------===// // /// \file // RISC-V GlobalISel target pseudo instruction definitions. This is kept // separately from the other tablegen files for organizational purposes, but // share the same infrastructure. // //===----------------------------------------------------------------------===// class RISCVGenericInstruction : GenericInstruction { let Namespace = "RISCV"; } // Pseudo equivalent to a RISCVISD::SRAW. def G_SRAW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::SRLW. def G_SRLW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::SLLW. def G_SLLW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::DIVW. def G_DIVW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::DIVUW. def G_DIVUW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::REMUW. def G_REMUW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::RORW. def G_RORW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::ROLW. def G_ROLW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src1, type0:$src2); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::BREV8. def G_BREV8 : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::CLZW. def G_CLZW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::CTZW. def G_CTZW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::FCVT_W_RV64. def G_FCVT_W_RV64 : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type1:$src, untyped_imm_0:$frm); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::FCVT_WU_RV64. def G_FCVT_WU_RV64 : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type1:$src, untyped_imm_0:$frm); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::FCLASS. def G_FCLASS : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type1:$src); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::READ_VLENB. def G_READ_VLENB : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::VMCLR_VL def G_VMCLR_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type1:$vl); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::VMSET_VL def G_VMSET_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type1:$vl); let hasSideEffects = false; } def : GINodeEquiv; def G_SPLAT_VECTOR_SPLIT_I64_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$passthru, type1:$hi, type1:$lo, type2:$vl); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::VSLIDEDOWN_VL def G_VSLIDEDOWN_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$merge, type0:$vec, type1:$idx, type2:$mask, type1:$vl, type1:$policy); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::VMV_V_V_VL def G_VMV_V_V_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$passthru, type0:$vec, type1:$vl); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to a RISCVISD::VSLIDEUP_VL def G_VSLIDEUP_VL : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$merge, type0:$vec, type1:$idx, type2:$mask, type3:$vl, type4:$policy); let hasSideEffects = false; } def : GINodeEquiv; // Pseudo equivalent to RISCVISD::CLSW def G_CLSW : RISCVGenericInstruction { let OutOperandList = (outs type0:$dst); let InOperandList = (ins type0:$src); let hasSideEffects = false; } def : GINodeEquiv;