diff --git a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp --- a/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp +++ b/llvm/lib/Target/RISCV/GISel/RISCVLegalizerInfo.cpp @@ -11,6 +11,8 @@ //===----------------------------------------------------------------------===// #include "RISCVLegalizerInfo.h" +#include "RISCVSubtarget.h" +#include "llvm/CodeGen/GlobalISel/LegalizerHelper.h" #include "llvm/CodeGen/TargetOpcodes.h" #include "llvm/CodeGen/ValueTypes.h" #include "llvm/IR/DerivedTypes.h" @@ -19,5 +21,63 @@ using namespace llvm; RISCVLegalizerInfo::RISCVLegalizerInfo(const RISCVSubtarget &ST) { + const LLT s1 = LLT::scalar(1); + const LLT s32 = LLT::scalar(32); + const LLT s64 = LLT::scalar(64); + const LLT XLenLLT = ST.is64Bit() ? s64 : s32; + + using namespace TargetOpcode; + + getActionDefinitionsBuilder({G_ADD, G_SUB}) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT); + + getActionDefinitionsBuilder({G_SHL, G_ASHR, G_LSHR}) + .legalFor({{XLenLLT, XLenLLT}}) + .clampScalar(0, XLenLLT, XLenLLT) + .clampScalar(1, XLenLLT, XLenLLT); + + if (ST.hasStdExtM()) { + getActionDefinitionsBuilder({G_MUL, G_SDIV, G_SREM, G_UDIV, G_UREM}) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT); + } else { + getActionDefinitionsBuilder({G_MUL, G_SDIV, G_SREM, G_UDIV, G_UREM}) + .legalFor({XLenLLT}) + .libcall() + .clampScalar(0, XLenLLT, XLenLLT); + } + + getActionDefinitionsBuilder({G_AND, G_OR, G_XOR}) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT); + + getActionDefinitionsBuilder({G_UADDO, G_UADDE, G_USUBO, G_USUBE}) + .lowerFor({{XLenLLT, s1}}); + if (ST.hasStdExtM()) { + // clang-format off + getActionDefinitionsBuilder(G_UMULO) + .lowerFor({{XLenLLT, s1}}); + + getActionDefinitionsBuilder(G_UMULH) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT); + // clang-format on + } + + getActionDefinitionsBuilder(G_ICMP) + .legalFor({XLenLLT, XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT) + .clampScalar(1, XLenLLT, XLenLLT); + + getActionDefinitionsBuilder(G_CONSTANT) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT); + + getActionDefinitionsBuilder({G_ZEXT, G_SEXT, G_ANYEXT}) + .legalFor({XLenLLT}) + .clampScalar(0, XLenLLT, XLenLLT) + .maxScalar(1, XLenLLT); + getLegacyLegalizerInfo().computeTables(); } diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu32.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu32.mir new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu32.mir @@ -0,0 +1,9310 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py:wq +# RUN: llc -mtriple=riscv32 --global-isel -run-pass=legalizer -verify-machineinstrs %s -o - \ +# RUN: | FileCheck %s --check-prefix=RV32I + +--- | + + define i32 @addi_i32(i32 %a) { + %1 = add i32 %a, 1 + ret i32 %1 + } + + define i32 @slti_i32(i32 %a) { + %1 = icmp slt i32 %a, 2 + %2 = zext i1 %1 to i32 + ret i32 %2 + } + + define i32 @sltiu_i32(i32 %a) { + %1 = icmp ult i32 %a, 3 + %2 = zext i1 %1 to i32 + ret i32 %2 + } + + define i32 @xori_i32(i32 %a) { + %1 = xor i32 %a, 4 + ret i32 %1 + } + + define i32 @ori_i32(i32 %a) { + %1 = or i32 %a, 5 + ret i32 %1 + } + + define i32 @andi_i32(i32 %a) { + %1 = and i32 %a, 6 + ret i32 %1 + } + + define i32 @slli_i32(i32 %a) { + %1 = shl i32 %a, 7 + ret i32 %1 + } + + define i32 @srli_i32(i32 %a) { + %1 = lshr i32 %a, 8 + ret i32 %1 + } + + define i32 @srli_demandedbits_i32(i32 %0) { + %2 = lshr i32 %0, 3 + %3 = or i32 %2, 1 + ret i32 %3 + } + + define i32 @srai_i32(i32 %a) { + %1 = ashr i32 %a, 9 + ret i32 %1 + } + + define i32 @muli_i32(i32 %a) { + %1 = mul i32 %a, 7 + ret i32 %a + } + + define i32 @sdivi_i32(i32 %a) { + %1 = mul i32 %a, 7 + ret i32 %a + } + + define i32 @sremi_i32(i32 %a) { + %1 = mul i32 %a, 7 + ret i32 %a + } + + define i32 @udivi_i32(i32 %a) { + %1 = mul i32 %a, 7 + ret i32 %a + } + + define i32 @uremi_i32(i32 %a) { + %1 = mul i32 %a, 7 + ret i32 %a + } + + define i32 @add_i32(i32 %a, i32 %b) { + %1 = add i32 %a, %b + ret i32 %1 + } + + define i32 @sub_i32(i32 %a, i32 %b) { + %1 = sub i32 %a, %b + ret i32 %1 + } + + define i32 @sub_negative_constant_lhs_i32(i32 %a) { + %1 = sub i32 -2, %a + ret i32 %1 + } + + define i32 @sll_i32(i32 %a, i32 %b) { + %1 = shl i32 %a, %b + ret i32 %1 + } + + define i32 @sll_negative_constant_lhs_i32(i32 %a) { + %1 = shl i32 -1, %a + ret i32 %1 + } + + define i32 @slt_i32(i32 %a, i32 %b) { + %1 = icmp slt i32 %a, %b + %2 = zext i1 %1 to i32 + ret i32 %2 + } + + define i32 @sltu_i32(i32 %a, i32 %b) { + %1 = icmp ult i32 %a, %b + %2 = zext i1 %1 to i32 + ret i32 %2 + } + + define i32 @xor_i32(i32 %a, i32 %b) { + %1 = xor i32 %a, %b + ret i32 %1 + } + + define i32 @srl_i32(i32 %a, i32 %b) { + %1 = lshr i32 %a, %b + ret i32 %1 + } + + define i32 @srl_negative_constant_lhs_i32(i32 %a) { + %1 = lshr i32 -1, %a + ret i32 %1 + } + + define i32 @sra_i32(i32 %a, i32 %b) { + %1 = ashr i32 %a, %b + ret i32 %1 + } + + define i32 @sra_negative_constant_lhs_i32(i32 %a) { + %1 = ashr i32 -2147483648, %a + ret i32 %1 + } + + define i32 @or_i32(i32 %a, i32 %b) { + %1 = or i32 %a, %b + ret i32 %1 + } + + define i32 @and_i32(i32 %a, i32 %b) { + %1 = and i32 %a, %b + ret i32 %1 + } + + define i32 @mul_i32(i32 %a, i32 %b) { + %1 = mul i32 %a, %b + ret i32 %1 + } + + define i32 @sdiv_i32(i32 %a, i32 %b) { + %1 = sdiv i32 %a, %b + ret i32 %1 + } + + define i32 @srem_i32(i32 %a, i32 %b) { + %1 = srem i32 %a, %b + ret i32 %1 + } + + define i32 @udiv_i32(i32 %a, i32 %b) { + %1 = udiv i32 %a, %b + ret i32 %1 + } + + define i32 @urem_i32(i32 %a, i32 %b) { + %1 = urem i32 %a, %b + ret i32 %1 + } + + define i8 @addi_i8(i8 %a) { + %1 = add i8 %a, 1 + ret i8 %1 + } + + define i8 @slti_i8(i8 %a) { + %1 = icmp slt i8 %a, 2 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define i8 @sltiu_i8(i8 %a) { + %1 = icmp ult i8 %a, 3 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define i8 @xori_i8(i8 %a) { + %1 = xor i8 %a, 4 + ret i8 %1 + } + + define i8 @ori_i8(i8 %a) { + %1 = or i8 %a, 5 + ret i8 %1 + } + + define i8 @andi_i8(i8 %a) { + %1 = and i8 %a, 6 + ret i8 %1 + } + + define i8 @slli_i8(i8 %a) { + %1 = shl i8 %a, 7 + ret i8 %1 + } + + define i8 @srli_i8(i8 %a) { + %1 = lshr i8 %a, 8 + ret i8 %1 + } + + define i8 @srli_demandedbits_i8(i8 %0) { + %2 = lshr i8 %0, 3 + %3 = or i8 %2, 1 + ret i8 %3 + } + + define i8 @srai_i8(i8 %a) { + %1 = ashr i8 %a, 9 + ret i8 %1 + } + + define i8 @muli_i8(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define i8 @sdivi_i8(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define i8 @sremi_i8(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define i8 @udivi_i8(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define i8 @uremi_i8(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define i8 @add_i8(i8 %a, i8 %b) { + %1 = add i8 %a, %b + ret i8 %1 + } + + define i8 @sub_i8(i8 %a, i8 %b) { + %1 = sub i8 %a, %b + ret i8 %1 + } + + define i8 @sub_negative_constant_lhs_i8(i8 %a) { + %1 = sub i8 -2, %a + ret i8 %1 + } + + define i8 @sll_i8(i8 %a, i8 %b) { + %1 = shl i8 %a, %b + ret i8 %1 + } + + define i8 @sll_negative_constant_lhs_i8(i8 %a) { + %1 = shl i8 -1, %a + ret i8 %1 + } + + define i8 @slt_i8(i8 %a, i8 %b) { + %1 = icmp slt i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define i8 @sltu_i8(i8 %a, i8 %b) { + %1 = icmp ult i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define i8 @xor_i8(i8 %a, i8 %b) { + %1 = xor i8 %a, %b + ret i8 %1 + } + + define i8 @srl_i8(i8 %a, i8 %b) { + %1 = lshr i8 %a, %b + ret i8 %1 + } + + define i8 @srl_negative_constant_lhs_i8(i8 %a) { + %1 = lshr i8 -1, %a + ret i8 %1 + } + + define i8 @sra_i8(i8 %a, i8 %b) { + %1 = ashr i8 %a, %b + ret i8 %1 + } + + define i8 @sra_negative_constant_lhs_i8(i8 %a) { + %1 = ashr i8 0, %a + ret i8 %1 + } + + define i8 @or_i8(i8 %a, i8 %b) { + %1 = or i8 %a, %b + ret i8 %1 + } + + define i8 @and_i8(i8 %a, i8 %b) { + %1 = and i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @addi_i8_zext(i8 %a) { + %1 = add i8 %a, 1 + ret i8 %1 + } + + define zeroext i8 @slti_i8_zext(i8 %a) { + %1 = icmp slt i8 %a, 2 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define zeroext i8 @sltiu_i8_zext(i8 %a) { + %1 = icmp ult i8 %a, 3 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define zeroext i8 @xori_i8_zext(i8 %a) { + %1 = xor i8 %a, 4 + ret i8 %1 + } + + define zeroext i8 @ori_i8_zext(i8 %a) { + %1 = or i8 %a, 5 + ret i8 %1 + } + + define zeroext i8 @andi_i8_zext(i8 %a) { + %1 = and i8 %a, 6 + ret i8 %1 + } + + define zeroext i8 @slli_i8_zext(i8 %a) { + %1 = shl i8 %a, 7 + ret i8 %1 + } + + define zeroext i8 @srli_i8_zext(i8 %a) { + %1 = lshr i8 %a, 8 + ret i8 %1 + } + + define zeroext i8 @srli_demandedbits_i8_zext(i8 %0) { + %2 = lshr i8 %0, 3 + %3 = or i8 %2, 1 + ret i8 %3 + } + + define zeroext i8 @srai_i8_zext(i8 %a) { + %1 = ashr i8 %a, 9 + ret i8 %1 + } + + define zeroext i8 @muli_i8_zext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define zeroext i8 @sdivi_i8_zext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define zeroext i8 @sremi_i8_zext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define zeroext i8 @udivi_i8_zext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define zeroext i8 @uremi_i8_zext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define zeroext i8 @add_i8_zext(i8 %a, i8 %b) { + %1 = add i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @sub_i8_zext(i8 %a, i8 %b) { + %1 = sub i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @sub_negative_constant_lhs_i8_zext(i8 %a) { + %1 = sub i8 -2, %a + ret i8 %1 + } + + define zeroext i8 @sll_i8_zext(i8 %a, i8 %b) { + %1 = shl i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @sll_negative_constant_lhs_i8_zext(i8 %a) { + %1 = shl i8 -1, %a + ret i8 %1 + } + + define zeroext i8 @slt_i8_zext(i8 %a, i8 %b) { + %1 = icmp slt i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define zeroext i8 @sltu_i8_zext(i8 %a, i8 %b) { + %1 = icmp ult i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define zeroext i8 @xor_i8_zext(i8 %a, i8 %b) { + %1 = xor i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @srl_i8_zext(i8 %a, i8 %b) { + %1 = lshr i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @srl_negative_constant_lhs_i8_zext(i8 %a) { + %1 = lshr i8 -1, %a + ret i8 %1 + } + + define zeroext i8 @sra_i8_zext(i8 %a, i8 %b) { + %1 = ashr i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @sra_negative_constant_lhs_i8_zext(i8 %a) { + %1 = ashr i8 0, %a + ret i8 %1 + } + + define zeroext i8 @or_i8_zext(i8 %a, i8 %b) { + %1 = or i8 %a, %b + ret i8 %1 + } + + define zeroext i8 @and_i8_zext(i8 %a, i8 %b) { + %1 = and i8 %a, %b + ret i8 %1 + } + + define signext i8 @addi_i8_sext(i8 %a) { + %1 = add i8 %a, 1 + ret i8 %1 + } + + define signext i8 @slti_i8_sext(i8 %a) { + %1 = icmp slt i8 %a, 2 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define signext i8 @sltiu_i8_sext(i8 %a) { + %1 = icmp ult i8 %a, 3 + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define signext i8 @xori_i8_sext(i8 %a) { + %1 = xor i8 %a, 4 + ret i8 %1 + } + + define signext i8 @ori_i8_sext(i8 %a) { + %1 = or i8 %a, 5 + ret i8 %1 + } + + define signext i8 @andi_i8_sext(i8 %a) { + %1 = and i8 %a, 6 + ret i8 %1 + } + + define signext i8 @slli_i8_sext(i8 %a) { + %1 = shl i8 %a, 7 + ret i8 %1 + } + + define signext i8 @srli_i8_sext(i8 %a) { + %1 = lshr i8 %a, 8 + ret i8 %1 + } + + define signext i8 @srli_demandedbits_i8_sext(i8 %0) { + %2 = lshr i8 %0, 3 + %3 = or i8 %2, 1 + ret i8 %3 + } + + define signext i8 @srai_i8_sext(i8 %a) { + %1 = ashr i8 %a, 9 + ret i8 %1 + } + + define signext i8 @muli_i8_sext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define signext i8 @sdivi_i8_sext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define signext i8 @sremi_i8_sext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define signext i8 @udivi_i8_sext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define signext i8 @uremi_i8_sext(i8 %a) { + %1 = mul i8 %a, 7 + ret i8 %a + } + + define signext i8 @add_i8_sext(i8 %a, i8 %b) { + %1 = add i8 %a, %b + ret i8 %1 + } + + define signext i8 @sub_i8_sext(i8 %a, i8 %b) { + %1 = sub i8 %a, %b + ret i8 %1 + } + + define signext i8 @sub_negative_constant_lhs_i8_sext(i8 %a) { + %1 = sub i8 -2, %a + ret i8 %1 + } + + define signext i8 @sll_i8_sext(i8 %a, i8 %b) { + %1 = shl i8 %a, %b + ret i8 %1 + } + + define signext i8 @sll_negative_constant_lhs_i8_sext(i8 %a) { + %1 = shl i8 -1, %a + ret i8 %1 + } + + define signext i8 @slt_i8_sext(i8 %a, i8 %b) { + %1 = icmp slt i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define signext i8 @sltu_i8_sext(i8 %a, i8 %b) { + %1 = icmp ult i8 %a, %b + %2 = zext i1 %1 to i8 + ret i8 %2 + } + + define signext i8 @xor_i8_sext(i8 %a, i8 %b) { + %1 = xor i8 %a, %b + ret i8 %1 + } + + define signext i8 @srl_i8_sext(i8 %a, i8 %b) { + %1 = lshr i8 %a, %b + ret i8 %1 + } + + define signext i8 @srl_negative_constant_lhs_i8_sext(i8 %a) { + %1 = lshr i8 -1, %a + ret i8 %1 + } + + define signext i8 @sra_i8_sext(i8 %a, i8 %b) { + %1 = ashr i8 %a, %b + ret i8 %1 + } + + define signext i8 @sra_negative_constant_lhs_i8_sext(i8 %a) { + %1 = ashr i8 0, %a + ret i8 %1 + } + + define signext i8 @or_i8_sext(i8 %a, i8 %b) { + %1 = or i8 %a, %b + ret i8 %1 + } + + define signext i8 @and_i8_sext(i8 %a, i8 %b) { + %1 = and i8 %a, %b + ret i8 %1 + } + + define i16 @addi_i16(i16 %a) { + %1 = add i16 %a, 1 + ret i16 %1 + } + + define i16 @slti_i16(i16 %a) { + %1 = icmp slt i16 %a, 2 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define i16 @sltiu_i16(i16 %a) { + %1 = icmp ult i16 %a, 3 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define i16 @xori_i16(i16 %a) { + %1 = xor i16 %a, 4 + ret i16 %1 + } + + define i16 @ori_i16(i16 %a) { + %1 = or i16 %a, 5 + ret i16 %1 + } + + define i16 @andi_i16(i16 %a) { + %1 = and i16 %a, 6 + ret i16 %1 + } + + define i16 @slli_i16(i16 %a) { + %1 = shl i16 %a, 7 + ret i16 %1 + } + + define i16 @srli_i16(i16 %a) { + %1 = lshr i16 %a, 8 + ret i16 %1 + } + + define i16 @srli_demandedbits_i16(i16 %0) { + %2 = lshr i16 %0, 3 + %3 = or i16 %2, 1 + ret i16 %3 + } + + define i16 @srai_i16(i16 %a) { + %1 = ashr i16 %a, 9 + ret i16 %1 + } + + define i16 @muli_i16(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define i16 @sdivi_i16(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define i16 @sremi_i16(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define i16 @udivi_i16(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define i16 @uremi_i16(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define i16 @add_i16(i16 %a, i16 %b) { + %1 = add i16 %a, %b + ret i16 %1 + } + + define i16 @sub_i16(i16 %a, i16 %b) { + %1 = sub i16 %a, %b + ret i16 %1 + } + + define i16 @sub_negative_constant_lhs_i16(i16 %a) { + %1 = sub i16 -2, %a + ret i16 %1 + } + + define i16 @sll_i16(i16 %a, i16 %b) { + %1 = shl i16 %a, %b + ret i16 %1 + } + + define i16 @sll_negative_constant_lhs_i16(i16 %a) { + %1 = shl i16 -1, %a + ret i16 %1 + } + + define i16 @slt_i16(i16 %a, i16 %b) { + %1 = icmp slt i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define i16 @sltu_i16(i16 %a, i16 %b) { + %1 = icmp ult i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define i16 @xor_i16(i16 %a, i16 %b) { + %1 = xor i16 %a, %b + ret i16 %1 + } + + define i16 @srl_i16(i16 %a, i16 %b) { + %1 = lshr i16 %a, %b + ret i16 %1 + } + + define i16 @srl_negative_constant_lhs_i16(i16 %a) { + %1 = lshr i16 -1, %a + ret i16 %1 + } + + define i16 @sra_i16(i16 %a, i16 %b) { + %1 = ashr i16 %a, %b + ret i16 %1 + } + + define i16 @sra_negative_constant_lhs_i16(i16 %a) { + %1 = ashr i16 0, %a + ret i16 %1 + } + + define i16 @or_i16(i16 %a, i16 %b) { + %1 = or i16 %a, %b + ret i16 %1 + } + + define i16 @and_i16(i16 %a, i16 %b) { + %1 = and i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @addi_i16_zext(i16 %a) { + %1 = add i16 %a, 1 + ret i16 %1 + } + + define zeroext i16 @slti_i16_zext(i16 %a) { + %1 = icmp slt i16 %a, 2 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define zeroext i16 @sltiu_i16_zext(i16 %a) { + %1 = icmp ult i16 %a, 3 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define zeroext i16 @xori_i16_zext(i16 %a) { + %1 = xor i16 %a, 4 + ret i16 %1 + } + + define zeroext i16 @ori_i16_zext(i16 %a) { + %1 = or i16 %a, 5 + ret i16 %1 + } + + define zeroext i16 @andi_i16_zext(i16 %a) { + %1 = and i16 %a, 6 + ret i16 %1 + } + + define zeroext i16 @slli_i16_zext(i16 %a) { + %1 = shl i16 %a, 7 + ret i16 %1 + } + + define zeroext i16 @srli_i16_zext(i16 %a) { + %1 = lshr i16 %a, 8 + ret i16 %1 + } + + define zeroext i16 @srli_demandedbits_i16_zext(i16 %0) { + %2 = lshr i16 %0, 3 + %3 = or i16 %2, 1 + ret i16 %3 + } + + define zeroext i16 @srai_i16_zext(i16 %a) { + %1 = ashr i16 %a, 9 + ret i16 %1 + } + + define zeroext i16 @muli_i16_zext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define zeroext i16 @sdivi_i16_zext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define zeroext i16 @sremi_i16_zext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define zeroext i16 @udivi_i16_zext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define zeroext i16 @uremi_i16_zext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define zeroext i16 @add_i16_zext(i16 %a, i16 %b) { + %1 = add i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @sub_i16_zext(i16 %a, i16 %b) { + %1 = sub i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @sub_negative_constant_lhs_i16_zext(i16 %a) { + %1 = sub i16 -2, %a + ret i16 %1 + } + + define zeroext i16 @sll_i16_zext(i16 %a, i16 %b) { + %1 = shl i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @sll_negative_constant_lhs_i16_zext(i16 %a) { + %1 = shl i16 -1, %a + ret i16 %1 + } + + define zeroext i16 @slt_i16_zext(i16 %a, i16 %b) { + %1 = icmp slt i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define zeroext i16 @sltu_i16_zext(i16 %a, i16 %b) { + %1 = icmp ult i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define zeroext i16 @xor_i16_zext(i16 %a, i16 %b) { + %1 = xor i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @srl_i16_zext(i16 %a, i16 %b) { + %1 = lshr i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @srl_negative_constant_lhs_i16_zext(i16 %a) { + %1 = lshr i16 -1, %a + ret i16 %1 + } + + define zeroext i16 @sra_i16_zext(i16 %a, i16 %b) { + %1 = ashr i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @sra_negative_constant_lhs_i16_zext(i16 %a) { + %1 = ashr i16 0, %a + ret i16 %1 + } + + define zeroext i16 @or_i16_zext(i16 %a, i16 %b) { + %1 = or i16 %a, %b + ret i16 %1 + } + + define zeroext i16 @and_i16_zext(i16 %a, i16 %b) { + %1 = and i16 %a, %b + ret i16 %1 + } + + define signext i16 @addi_i16_sext(i16 %a) { + %1 = add i16 %a, 1 + ret i16 %1 + } + + define signext i16 @slti_i16_sext(i16 %a) { + %1 = icmp slt i16 %a, 2 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define signext i16 @sltiu_i16_sext(i16 %a) { + %1 = icmp ult i16 %a, 3 + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define signext i16 @xori_i16_sext(i16 %a) { + %1 = xor i16 %a, 4 + ret i16 %1 + } + + define signext i16 @ori_i16_sext(i16 %a) { + %1 = or i16 %a, 5 + ret i16 %1 + } + + define signext i16 @andi_i16_sext(i16 %a) { + %1 = and i16 %a, 6 + ret i16 %1 + } + + define signext i16 @slli_i16_sext(i16 %a) { + %1 = shl i16 %a, 7 + ret i16 %1 + } + + define signext i16 @srli_i16_sext(i16 %a) { + %1 = lshr i16 %a, 8 + ret i16 %1 + } + + define signext i16 @srli_demandedbits_i16_sext(i16 %0) { + %2 = lshr i16 %0, 3 + %3 = or i16 %2, 1 + ret i16 %3 + } + + define signext i16 @srai_i16_sext(i16 %a) { + %1 = ashr i16 %a, 9 + ret i16 %1 + } + + define signext i16 @muli_i16_sext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define signext i16 @sdivi_i16_sext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define signext i16 @sremi_i16_sext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define signext i16 @udivi_i16_sext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define signext i16 @uremi_i16_sext(i16 %a) { + %1 = mul i16 %a, 7 + ret i16 %a + } + + define signext i16 @add_i16_sext(i16 %a, i16 %b) { + %1 = add i16 %a, %b + ret i16 %1 + } + + define signext i16 @sub_i16_sext(i16 %a, i16 %b) { + %1 = sub i16 %a, %b + ret i16 %1 + } + + define signext i16 @sub_negative_constant_lhs_i16_sext(i16 %a) { + %1 = sub i16 -2, %a + ret i16 %1 + } + + define signext i16 @sll_i16_sext(i16 %a, i16 %b) { + %1 = shl i16 %a, %b + ret i16 %1 + } + + define signext i16 @sll_negative_constant_lhs_i16_sext(i16 %a) { + %1 = shl i16 -1, %a + ret i16 %1 + } + + define signext i16 @slt_i16_sext(i16 %a, i16 %b) { + %1 = icmp slt i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define signext i16 @sltu_i16_sext(i16 %a, i16 %b) { + %1 = icmp ult i16 %a, %b + %2 = zext i1 %1 to i16 + ret i16 %2 + } + + define signext i16 @xor_i16_sext(i16 %a, i16 %b) { + %1 = xor i16 %a, %b + ret i16 %1 + } + + define signext i16 @srl_i16_sext(i16 %a, i16 %b) { + %1 = lshr i16 %a, %b + ret i16 %1 + } + + define signext i16 @srl_negative_constant_lhs_i16_sext(i16 %a) { + %1 = lshr i16 -1, %a + ret i16 %1 + } + + define signext i16 @sra_i16_sext(i16 %a, i16 %b) { + %1 = ashr i16 %a, %b + ret i16 %1 + } + + define signext i16 @sra_negative_constant_lhs_i16_sext(i16 %a) { + %1 = ashr i16 0, %a + ret i16 %1 + } + + define signext i16 @or_i16_sext(i16 %a, i16 %b) { + %1 = or i16 %a, %b + ret i16 %1 + } + + define signext i16 @and_i16_sext(i16 %a, i16 %b) { + %1 = and i16 %a, %b + ret i16 %1 + } + + define i64 @addi_i64(i64 %a) { + %1 = add i64 %a, 1 + ret i64 %1 + } + + define i64 @xori_i64(i64 %a) { + %1 = xor i64 %a, 4 + ret i64 %1 + } + + define i64 @ori_i64(i64 %a) { + %1 = or i64 %a, 5 + ret i64 %1 + } + + define i64 @andi_i64(i64 %a) { + %1 = and i64 %a, 6 + ret i64 %1 + } + + define i64 @srli_i64(i64 %a) { + %1 = lshr i64 %a, 8 + ret i64 %1 + } + + define i64 @srli_demandedbits_i64(i64 %0) { + %2 = lshr i64 %0, 3 + %3 = or i64 %2, 1 + ret i64 %3 + } + + define i64 @srai_i64(i64 %a) { + %1 = ashr i64 %a, 9 + ret i64 %1 + } + + define i64 @muli_i64(i64 %a) { + %1 = mul i64 %a, 7 + ret i64 %a + } + + define i64 @sdivi_i64(i64 %a) { + %1 = mul i64 %a, 7 + ret i64 %a + } + + define i64 @sremi_i64(i64 %a) { + %1 = mul i64 %a, 7 + ret i64 %a + } + + define i64 @udivi_i64(i64 %a) { + %1 = mul i64 %a, 7 + ret i64 %a + } + + define i64 @uremi_i64(i64 %a) { + %1 = mul i64 %a, 7 + ret i64 %a + } + + define i64 @add_i64(i64 %a, i64 %b) { + %1 = add i64 %a, %b + ret i64 %1 + } + + define i64 @sub_i64(i64 %a, i64 %b) { + %1 = sub i64 %a, %b + ret i64 %1 + } + + define i64 @sub_negative_constant_lhs_i64(i64 %a) { + %1 = sub i64 -2, %a + ret i64 %1 + } + + define i64 @xor_i64(i64 %a, i64 %b) { + %1 = xor i64 %a, %b + ret i64 %1 + } + + define i64 @or_i64(i64 %a, i64 %b) { + %1 = or i64 %a, %b + ret i64 %1 + } + + define i64 @and_i64(i64 %a, i64 %b) { + %1 = and i64 %a, %b + ret i64 %1 + } + + define i64 @mul_i64(i64 %a, i64 %b) { + %1 = mul i64 %a, %b + ret i64 %1 + } + + define i64 @sdiv_i64(i64 %a, i64 %b) { + %1 = sdiv i64 %a, %b + ret i64 %1 + } + + define i64 @srem_i64(i64 %a, i64 %b) { + %1 = srem i64 %a, %b + ret i64 %1 + } + + define i64 @udiv_i64(i64 %a, i64 %b) { + %1 = udiv i64 %a, %b + ret i64 %1 + } + + define i64 @urem_i64(i64 %a, i64 %b) { + %1 = urem i64 %a, %b + ret i64 %1 + } + +... +--- +name: addi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 1 + %2:_(s32) = G_ADD %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY]](s32), [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 2 + %2:_(s1) = G_ICMP intpred(slt), %0(s32), %1 + %3:_(s32) = G_ZEXT %2(s1) + $x10 = COPY %3(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 3 + %2:_(s1) = G_ICMP intpred(ult), %0(s32), %1 + %3:_(s32) = G_ZEXT %2(s1) + $x10 = COPY %3(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 4 + %2:_(s32) = G_XOR %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 5 + %2:_(s32) = G_OR %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 6 + %2:_(s32) = G_AND %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_SHL %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 8 + %2:_(s32) = G_LSHR %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 3 + %3:_(s32) = G_CONSTANT i32 1 + %2:_(s32) = G_LSHR %0, %1(s32) + %4:_(s32) = G_OR %2, %3 + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 9 + %2:_(s32) = G_ASHR %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %0(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %0(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %0(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %0(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 7 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %0(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_ADD %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_SUB %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 -2 + %2:_(s32) = G_SUB %1, %0 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[COPY1]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_SHL %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[COPY]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 -1 + %2:_(s32) = G_SHL %1, %0(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[COPY]](s32), [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s1) = G_ICMP intpred(slt), %0(s32), %1 + %3:_(s32) = G_ZEXT %2(s1) + $x10 = COPY %3(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s1) = G_ICMP intpred(ult), %0(s32), %1 + %3:_(s32) = G_ZEXT %2(s1) + $x10 = COPY %3(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_XOR %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[COPY1]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_LSHR %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[COPY]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 -1 + %2:_(s32) = G_LSHR %1, %0(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY]], [[COPY1]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_ASHR %0, %1(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i32 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2147483648 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[C]], [[COPY]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = G_CONSTANT i32 -2147483648 + %2:_(s32) = G_ASHR %1, %0(s32) + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_OR %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_AND %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: mul_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: mul_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[MUL:%[0-9]+]]:_(s32) = G_MUL [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[MUL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_MUL %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: sdiv_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sdiv_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SDIV:%[0-9]+]]:_(s32) = G_SDIV [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[SDIV]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_SDIV %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: srem_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srem_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SREM:%[0-9]+]]:_(s32) = G_SREM [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[SREM]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_SREM %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: udiv_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: udiv_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[UDIV:%[0-9]+]]:_(s32) = G_UDIV [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[UDIV]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_UDIV %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: urem_i32 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: urem_i32 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[UREM:%[0-9]+]]:_(s32) = G_UREM [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[UREM]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %0:_(s32) = COPY $x10 + %1:_(s32) = COPY $x11 + %2:_(s32) = G_UREM %0, %1 + $x10 = COPY %2(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_ADD %0, %2 + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 4 + %3:_(s8) = G_XOR %0, %2 + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 5 + %3:_(s8) = G_OR %0, %2 + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 6 + %3:_(s8) = G_AND %0, %2 + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_SHL %0, %2(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 8 + %3:_(s8) = G_LSHR %0, %2(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %4:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_LSHR %0, %2(s8) + %5:_(s8) = G_OR %3, %4 + %6:_(s32) = G_ANYEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 9 + %3:_(s8) = G_ASHR %0, %2(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ADD %0, %1 + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SUB %0, %1 + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -2 + %3:_(s8) = G_SUB %2, %0 + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SHL %0, %1(s8) + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_SHL %2, %0(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_ANYEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_ANYEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_XOR %0, %1 + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_LSHR %0, %1(s8) + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_LSHR %2, %0(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ASHR %0, %1(s8) + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i8 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 0 + %3:_(s8) = G_ASHR %2, %0(s8) + %4:_(s32) = G_ANYEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_OR %0, %1 + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i8 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i8 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_AND %0, %1 + %5:_(s32) = G_ANYEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_ADD %0, %2 + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 4 + %3:_(s8) = G_XOR %0, %2 + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 5 + %3:_(s8) = G_OR %0, %2 + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 6 + %3:_(s8) = G_AND %0, %2 + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_SHL %0, %2(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 8 + %3:_(s8) = G_LSHR %0, %2(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C3]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %4:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_LSHR %0, %2(s8) + %5:_(s8) = G_OR %3, %4 + %6:_(s32) = G_ZEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 9 + %3:_(s8) = G_ASHR %0, %2(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ADD %0, %1 + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SUB %0, %1 + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -2 + %3:_(s8) = G_SUB %2, %0 + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SHL %0, %1(s8) + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_SHL %2, %0(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_ZEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_ZEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_XOR %0, %1 + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_LSHR %0, %1(s8) + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_LSHR %2, %0(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ASHR %0, %1(s8) + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i8_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 0 + %3:_(s8) = G_ASHR %2, %0(s8) + %4:_(s32) = G_ZEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_OR %0, %1 + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i8_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i8_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_AND %0, %1 + %5:_(s32) = G_ZEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[ADD]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_ADD %0, %2 + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s8), %2 + %4:_(s8) = G_ZEXT %3(s1) + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[XOR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 4 + %3:_(s8) = G_XOR %0, %2 + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 5 + %3:_(s8) = G_OR %0, %2 + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[AND]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 6 + %3:_(s8) = G_AND %0, %2 + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_SHL %0, %2(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 8 + %3:_(s8) = G_LSHR %0, %2(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 3 + %4:_(s8) = G_CONSTANT i8 1 + %3:_(s8) = G_LSHR %0, %2(s8) + %5:_(s8) = G_OR %3, %4 + %6:_(s32) = G_SEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 9 + %3:_(s8) = G_ASHR %0, %2(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 7 + %3:_(s8) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[ADD]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ADD %0, %1 + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SUB]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SUB %0, %1 + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SUB]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -2 + %3:_(s8) = G_SUB %2, %0 + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_SHL %0, %1(s8) + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_SHL %2, %0(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_SEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s8), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s8), %1 + %5:_(s8) = G_ZEXT %4(s1) + %6:_(s32) = G_SEXT %5(s8) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[XOR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_XOR %0, %1 + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_LSHR %0, %1(s8) + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 -1 + %3:_(s8) = G_LSHR %2, %0(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_ASHR %0, %1(s8) + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i8_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 255 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s8) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %1(s32) + %2:_(s8) = G_CONSTANT i8 0 + %3:_(s8) = G_ASHR %2, %0(s8) + %4:_(s32) = G_SEXT %3(s8) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_OR %0, %1 + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i8_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i8_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s8) = G_TRUNC [[AND]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s8) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s8) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s8) = G_TRUNC %3(s32) + %4:_(s8) = G_AND %0, %1 + %5:_(s32) = G_SEXT %4(s8) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_ADD %0, %2 + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 4 + %3:_(s16) = G_XOR %0, %2 + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 5 + %3:_(s16) = G_OR %0, %2 + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 6 + %3:_(s16) = G_AND %0, %2 + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_SHL %0, %2(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 8 + %3:_(s16) = G_LSHR %0, %2(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %4:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_LSHR %0, %2(s16) + %5:_(s16) = G_OR %3, %4 + %6:_(s32) = G_ANYEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 9 + %3:_(s16) = G_ASHR %0, %2(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ANYEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ADD %0, %1 + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SUB %0, %1 + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -2 + %3:_(s16) = G_SUB %2, %0 + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SHL %0, %1(s16) + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[SHL]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_SHL %2, %0(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_ANYEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_ANYEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_XOR %0, %1 + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_LSHR %0, %1(s16) + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[LSHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_LSHR %2, %0(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ASHR %0, %1(s16) + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i16 + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: $x10 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 0 + %3:_(s16) = G_ASHR %2, %0(s16) + %4:_(s32) = G_ANYEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_OR %0, %1 + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i16 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i16 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_AND %0, %1 + %5:_(s32) = G_ANYEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_ADD %0, %2 + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 4 + %3:_(s16) = G_XOR %0, %2 + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 5 + %3:_(s16) = G_OR %0, %2 + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 6 + %3:_(s16) = G_AND %0, %2 + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_SHL %0, %2(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 8 + %3:_(s16) = G_LSHR %0, %2(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C3]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %4:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_LSHR %0, %2(s16) + %5:_(s16) = G_OR %3, %4 + %6:_(s32) = G_ZEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 9 + %3:_(s16) = G_ASHR %0, %2(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_ZEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ADD]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ADD %0, %1 + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SUB %0, %1 + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[SUB]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -2 + %3:_(s16) = G_SUB %2, %0 + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SHL %0, %1(s16) + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[SHL]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_SHL %2, %0(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_ZEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_ZEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[XOR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_XOR %0, %1 + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND2:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_LSHR %0, %1(s16) + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[LSHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_LSHR %2, %0(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ASHR %0, %1(s16) + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i16_zext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[ASHR]], [[C2]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 0 + %3:_(s16) = G_ASHR %2, %0(s16) + %4:_(s32) = G_ZEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[OR]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_OR %0, %1 + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i16_zext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i16_zext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[AND]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_AND %0, %1 + %5:_(s32) = G_ZEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: addi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_ADD %0, %2 + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slti_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slti_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 2 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 2 + %3:_(s1) = G_ICMP intpred(slt), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sltiu_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sltiu_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %3:_(s1) = G_ICMP intpred(ult), %0(s16), %2 + %4:_(s16) = G_ZEXT %3(s1) + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: xori_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: xori_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[XOR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 4 + %3:_(s16) = G_XOR %0, %2 + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: ori_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: ori_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 5 + %3:_(s16) = G_OR %0, %2 + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: andi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: andi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 6 + %3:_(s16) = G_AND %0, %2 + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slli_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: slli_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 7 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_SHL %0, %2(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srli_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C1]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 8 + %3:_(s16) = G_LSHR %0, %2(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: srli_demandedbits_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32I-LABEL: name: srli_demandedbits_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[C2]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[C]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 3 + %4:_(s16) = G_CONSTANT i16 1 + %3:_(s16) = G_LSHR %0, %2(s16) + %5:_(s16) = G_OR %3, %4 + %6:_(s32) = G_SEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: srai_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srai_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[C]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 9 + %3:_(s16) = G_ASHR %0, %2(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: muli_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: muli_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sdivi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sdivi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sremi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sremi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: udivi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: udivi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: uremi_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: uremi_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 7 + %3:_(s16) = G_MUL %0, %2 + %4:_(s32) = G_SEXT %0(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: add_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: add_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[ADD]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ADD %0, %1 + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SUB]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SUB %0, %1 + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sub_negative_constant_lhs_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SUB]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -2 + %3:_(s16) = G_SUB %2, %0 + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sll_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_SHL %0, %1(s16) + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sll_negative_constant_lhs_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sll_negative_constant_lhs_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[C]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[SHL]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_SHL %2, %0(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: slt_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: slt_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(slt), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(slt), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_SEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: sltu_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sltu_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[COPY1]](s32) + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[TRUNC]](s16), [[TRUNC1]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s1) = G_ICMP intpred(ult), %0(s16), %1 + %5:_(s16) = G_ZEXT %4(s1) + %6:_(s32) = G_SEXT %5(s16) + $x10 = COPY %6(s32) + PseudoRET implicit $x10 + +... +--- +name: xor_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xor_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[XOR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_XOR %0, %1 + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srl_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[AND]], [[AND1]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_LSHR %0, %1(s16) + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: srl_negative_constant_lhs_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: srl_negative_constant_lhs_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[C]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[LSHR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 -1 + %3:_(s16) = G_LSHR %2, %0(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sra_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[COPY]](s32) + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_ASHR %0, %1(s16) + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: sra_negative_constant_lhs_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32I-LABEL: name: sra_negative_constant_lhs_i16_sext + ; RV32I: liveins: $x10 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[C]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 65535 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C1]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[SEXT]], [[AND]](s32) + ; RV32I-NEXT: [[TRUNC1:%[0-9]+]]:_(s16) = G_TRUNC [[ASHR]](s32) + ; RV32I-NEXT: [[SEXT1:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC1]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %1:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %1(s32) + %2:_(s16) = G_CONSTANT i16 0 + %3:_(s16) = G_ASHR %2, %0(s16) + %4:_(s32) = G_SEXT %3(s16) + $x10 = COPY %4(s32) + PseudoRET implicit $x10 + +... +--- +name: or_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: or_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[OR]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_OR %0, %1 + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: and_i16_sext +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: and_i16_sext + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY1]] + ; RV32I-NEXT: [[TRUNC:%[0-9]+]]:_(s16) = G_TRUNC [[AND]](s32) + ; RV32I-NEXT: [[SEXT:%[0-9]+]]:_(s32) = G_SEXT [[TRUNC]](s16) + ; RV32I-NEXT: $x10 = COPY [[SEXT]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10 + %2:_(s32) = COPY $x10 + %0:_(s16) = G_TRUNC %2(s32) + %3:_(s32) = COPY $x11 + %1:_(s16) = G_TRUNC %3(s32) + %4:_(s16) = G_AND %0, %1 + %5:_(s32) = G_SEXT %4(s16) + $x10 = COPY %5(s32) + PseudoRET implicit $x10 + +... +--- +name: addi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: addi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[C]] + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[C]] + ; RV32I-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[C1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]] + ; RV32I-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[AND]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: $x11 = COPY [[ADD2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 1 + %4:_(s64) = G_ADD %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: xori_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: xori_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 4 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[C]] + ; RV32I-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: $x11 = COPY [[XOR1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 4 + %4:_(s64) = G_XOR %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: ori_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: ori_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 5 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[C]] + ; RV32I-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[COPY1]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: $x11 = COPY [[OR1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 5 + %4:_(s64) = G_OR %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: andi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: andi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 6 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[C]] + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: $x11 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 6 + %4:_(s64) = G_AND %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: srli_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srli_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 8 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 24 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL]] + ; RV32I-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: $x11 = COPY [[LSHR1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 8 + %4:_(s64) = G_LSHR %0, %3(s64) + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: srli_demandedbits_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srli_demandedbits_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 0 + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 3 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C2]](s32) + ; RV32I-NEXT: [[C3:%[0-9]+]]:_(s32) = G_CONSTANT i32 29 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C3]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL]] + ; RV32I-NEXT: [[LSHR1:%[0-9]+]]:_(s32) = G_LSHR [[COPY1]], [[C2]](s32) + ; RV32I-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[OR]], [[C]] + ; RV32I-NEXT: [[OR2:%[0-9]+]]:_(s32) = G_OR [[LSHR1]], [[C1]] + ; RV32I-NEXT: $x10 = COPY [[OR1]](s32) + ; RV32I-NEXT: $x11 = COPY [[OR2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 3 + %5:_(s64) = G_CONSTANT i64 1 + %4:_(s64) = G_LSHR %0, %3(s64) + %6:_(s64) = G_OR %4, %5 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: srai_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: srai_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 9 + ; RV32I-NEXT: [[LSHR:%[0-9]+]]:_(s32) = G_LSHR [[COPY]], [[C]](s32) + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 23 + ; RV32I-NEXT: [[SHL:%[0-9]+]]:_(s32) = G_SHL [[COPY1]], [[C1]](s32) + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[LSHR]], [[SHL]] + ; RV32I-NEXT: [[ASHR:%[0-9]+]]:_(s32) = G_ASHR [[COPY1]], [[C]](s32) + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: $x11 = COPY [[ASHR]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 9 + %4:_(s64) = G_ASHR %0, %3(s64) + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: muli_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: muli_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 7 + %4:_(s64) = G_MUL %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %0(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: sdivi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sdivi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 7 + %4:_(s64) = G_MUL %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %0(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: sremi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sremi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 7 + %4:_(s64) = G_MUL %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %0(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: udivi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: udivi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 7 + %4:_(s64) = G_MUL %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %0(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: uremi_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: uremi_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 7 + %4:_(s64) = G_MUL %0, %3 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %0(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: add_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: add_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: [[ADD:%[0-9]+]]:_(s32) = G_ADD [[COPY]], [[COPY2]] + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[ADD]](s32), [[COPY2]] + ; RV32I-NEXT: [[ADD1:%[0-9]+]]:_(s32) = G_ADD [[COPY1]], [[COPY3]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: [[ADD2:%[0-9]+]]:_(s32) = G_ADD [[ADD1]], [[AND]] + ; RV32I-NEXT: $x10 = COPY [[ADD]](s32) + ; RV32I-NEXT: $x11 = COPY [[ADD2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_ADD %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: sub_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: sub_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[COPY]], [[COPY2]] + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[COPY]](s32), [[COPY2]] + ; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[COPY1]], [[COPY3]] + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C]] + ; RV32I-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[AND]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: $x11 = COPY [[SUB2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_SUB %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: sub_negative_constant_lhs_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32I-LABEL: name: sub_negative_constant_lhs_i64 + ; RV32I: liveins: $x10, $x11 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[C:%[0-9]+]]:_(s32) = G_CONSTANT i32 -2 + ; RV32I-NEXT: [[C1:%[0-9]+]]:_(s32) = G_CONSTANT i32 -1 + ; RV32I-NEXT: [[SUB:%[0-9]+]]:_(s32) = G_SUB [[C]], [[COPY]] + ; RV32I-NEXT: [[ICMP:%[0-9]+]]:_(s32) = G_ICMP intpred(ult), [[C]](s32), [[COPY]] + ; RV32I-NEXT: [[SUB1:%[0-9]+]]:_(s32) = G_SUB [[C1]], [[COPY1]] + ; RV32I-NEXT: [[C2:%[0-9]+]]:_(s32) = G_CONSTANT i32 1 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[ICMP]], [[C2]] + ; RV32I-NEXT: [[SUB2:%[0-9]+]]:_(s32) = G_SUB [[SUB1]], [[AND]] + ; RV32I-NEXT: $x10 = COPY [[SUB]](s32) + ; RV32I-NEXT: $x11 = COPY [[SUB2]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %1:_(s32) = COPY $x10 + %2:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %1(s32), %2(s32) + %3:_(s64) = G_CONSTANT i64 -2 + %4:_(s64) = G_SUB %3, %0 + %5:_(s32), %6:_(s32) = G_UNMERGE_VALUES %4(s64) + $x10 = COPY %5(s32) + $x11 = COPY %6(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: xor_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: xor_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: [[XOR:%[0-9]+]]:_(s32) = G_XOR [[COPY]], [[COPY2]] + ; RV32I-NEXT: [[XOR1:%[0-9]+]]:_(s32) = G_XOR [[COPY1]], [[COPY3]] + ; RV32I-NEXT: $x10 = COPY [[XOR]](s32) + ; RV32I-NEXT: $x11 = COPY [[XOR1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_XOR %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: or_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: or_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: [[OR:%[0-9]+]]:_(s32) = G_OR [[COPY]], [[COPY2]] + ; RV32I-NEXT: [[OR1:%[0-9]+]]:_(s32) = G_OR [[COPY1]], [[COPY3]] + ; RV32I-NEXT: $x10 = COPY [[OR]](s32) + ; RV32I-NEXT: $x11 = COPY [[OR1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_OR %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: and_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: and_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: [[AND:%[0-9]+]]:_(s32) = G_AND [[COPY]], [[COPY2]] + ; RV32I-NEXT: [[AND1:%[0-9]+]]:_(s32) = G_AND [[COPY1]], [[COPY3]] + ; RV32I-NEXT: $x10 = COPY [[AND]](s32) + ; RV32I-NEXT: $x11 = COPY [[AND1]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_AND %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: mul_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: mul_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: $x12 = COPY [[COPY2]](s32) + ; RV32I-NEXT: $x13 = COPY [[COPY3]](s32) + ; RV32I-NEXT: PseudoCALL target-flags(riscv-call) &__muldi3, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11 + ; RV32I-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY4]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY5]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_MUL %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: sdiv_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: sdiv_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: $x12 = COPY [[COPY2]](s32) + ; RV32I-NEXT: $x13 = COPY [[COPY3]](s32) + ; RV32I-NEXT: PseudoCALL target-flags(riscv-call) &__divdi3, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11 + ; RV32I-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY4]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY5]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_SDIV %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: srem_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: srem_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: $x12 = COPY [[COPY2]](s32) + ; RV32I-NEXT: $x13 = COPY [[COPY3]](s32) + ; RV32I-NEXT: PseudoCALL target-flags(riscv-call) &__moddi3, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11 + ; RV32I-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY4]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY5]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_SREM %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: udiv_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: udiv_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: $x12 = COPY [[COPY2]](s32) + ; RV32I-NEXT: $x13 = COPY [[COPY3]](s32) + ; RV32I-NEXT: PseudoCALL target-flags(riscv-call) &__udivdi3, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11 + ; RV32I-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY4]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY5]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_UDIV %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... +--- +name: urem_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } + - { id: 8, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11, $x12, $x13 + + ; RV32I-LABEL: name: urem_i64 + ; RV32I: liveins: $x10, $x11, $x12, $x13 + ; RV32I-NEXT: {{ $}} + ; RV32I-NEXT: [[COPY:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY1:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: [[COPY2:%[0-9]+]]:_(s32) = COPY $x12 + ; RV32I-NEXT: [[COPY3:%[0-9]+]]:_(s32) = COPY $x13 + ; RV32I-NEXT: $x10 = COPY [[COPY]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY1]](s32) + ; RV32I-NEXT: $x12 = COPY [[COPY2]](s32) + ; RV32I-NEXT: $x13 = COPY [[COPY3]](s32) + ; RV32I-NEXT: PseudoCALL target-flags(riscv-call) &__umoddi3, implicit-def $x1, implicit $x10, implicit $x11, implicit $x12, implicit $x13, implicit-def $x10, implicit-def $x11 + ; RV32I-NEXT: [[COPY4:%[0-9]+]]:_(s32) = COPY $x10 + ; RV32I-NEXT: [[COPY5:%[0-9]+]]:_(s32) = COPY $x11 + ; RV32I-NEXT: $x10 = COPY [[COPY4]](s32) + ; RV32I-NEXT: $x11 = COPY [[COPY5]](s32) + ; RV32I-NEXT: PseudoRET implicit $x10, implicit $x11 + %2:_(s32) = COPY $x10 + %3:_(s32) = COPY $x11 + %0:_(s64) = G_MERGE_VALUES %2(s32), %3(s32) + %4:_(s32) = COPY $x12 + %5:_(s32) = COPY $x13 + %1:_(s64) = G_MERGE_VALUES %4(s32), %5(s32) + %6:_(s64) = G_UREM %0, %1 + %7:_(s32), %8:_(s32) = G_UNMERGE_VALUES %6(s64) + $x10 = COPY %7(s32) + $x11 = COPY %8(s32) + PseudoRET implicit $x10, implicit $x11 + +... diff --git a/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu64.mir b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu64.mir new file mode 100644 --- /dev/null +++ b/llvm/test/CodeGen/RISCV/GlobalISel/legalizer/alu64.mir @@ -0,0 +1,1271 @@ +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py +# NOTE: Assertions have been autogenerated by utils/update_mir_test_checks.py:wq +# RUN: llc -O0 -mtriple=riscv64 --global-isel -run-pass=legalizer %s -o - \ +# RUN: | FileCheck %s --check-prefix=RV32 + +--- | + + define i64 @addi(i64 %a) { + %1 = add i64 %a, 1 + ret i64 %1 + } + + define i64 @slti(i64 %a) { + %1 = icmp slt i64 %a, 2 + %2 = zext i1 %1 to i64 + ret i64 %2 + } + + define i64 @sltiu(i64 %a) { + %1 = icmp ult i64 %a, 3 + %2 = zext i1 %1 to i64 + ret i64 %2 + } + + define i64 @xori(i64 %a) { + %1 = xor i64 %a, 4 + ret i64 %1 + } + + define i64 @ori(i64 %a) { + %1 = or i64 %a, 5 + ret i64 %1 + } + + define i64 @andi(i64 %a) { + %1 = and i64 %a, 6 + ret i64 %1 + } + + define i64 @slli(i64 %a) { + %1 = shl i64 %a, 7 + ret i64 %1 + } + + define i64 @srli(i64 %a) { + %1 = lshr i64 %a, 8 + ret i64 %1 + } + + define i64 @srai(i64 %a) { + %1 = ashr i64 %a, 9 + ret i64 %1 + } + + define i64 @add(i64 %a, i64 %b) { + %1 = add i64 %a, %b + ret i64 %1 + } + + define i64 @sub(i64 %a, i64 %b) { + %1 = sub i64 %a, %b + ret i64 %1 + } + + define i64 @sll(i64 %a, i64 %b) { + %1 = shl i64 %a, %b + ret i64 %1 + } + + define i64 @slt(i64 %a, i64 %b) { + %1 = icmp slt i64 %a, %b + %2 = zext i1 %1 to i64 + ret i64 %2 + } + + define i64 @sltu(i64 %a, i64 %b) { + %1 = icmp ult i64 %a, %b + %2 = zext i1 %1 to i64 + ret i64 %2 + } + + define i64 @xor(i64 %a, i64 %b) { + %1 = xor i64 %a, %b + ret i64 %1 + } + + define i64 @srl(i64 %a, i64 %b) { + %1 = lshr i64 %a, %b + ret i64 %1 + } + + define i64 @sra(i64 %a, i64 %b) { + %1 = ashr i64 %a, %b + ret i64 %1 + } + + define i64 @or(i64 %a, i64 %b) { + %1 = or i64 %a, %b + ret i64 %1 + } + + define i64 @and(i64 %a, i64 %b) { + %1 = and i64 %a, %b + ret i64 %1 + } + + define signext i32 @addiw(i32 signext %a) { + %1 = add i32 %a, 123 + ret i32 %1 + } + + define signext i32 @slliw(i32 signext %a) { + %1 = shl i32 %a, 17 + ret i32 %1 + } + + define signext i32 @srliw(i32 %a) { + %1 = lshr i32 %a, 8 + ret i32 %1 + } + + define signext i32 @sraiw(i32 %a) { + %1 = ashr i32 %a, 9 + ret i32 %1 + } + + define i64 @sraiw_i64(i64 %a) { + %1 = shl i64 %a, 32 + %2 = ashr i64 %1, 41 + ret i64 %2 + } + + define signext i32 @sextw(i32 zeroext %a) { + ret i32 %a + } + + define signext i32 @addw(i32 signext %a, i32 signext %b) { + %1 = add i32 %a, %b + ret i32 %1 + } + + define signext i32 @subw(i32 signext %a, i32 signext %b) { + %1 = sub i32 %a, %b + ret i32 %1 + } + + define signext i32 @sllw(i32 signext %a, i32 zeroext %b) { + %1 = shl i32 %a, %b + ret i32 %1 + } + + define signext i32 @srlw(i32 signext %a, i32 zeroext %b) { + %1 = lshr i32 %a, %b + ret i32 %1 + } + + define signext i32 @sraw(i64 %a, i32 zeroext %b) { + %1 = trunc i64 %a to i32 + %2 = ashr i32 %1, %b + ret i32 %2 + } + + define i64 @add_hi_and_lo_negone(i64 %0) { + %2 = add nsw i64 %0, -1 + ret i64 %2 + } + + define i64 @add_hi_zero_lo_negone(i64 %0) { + %2 = add i64 %0, 4294967295 + ret i64 %2 + } + + define i64 @add_lo_negone(i64 %0) { + %2 = add nsw i64 %0, -4294967297 + ret i64 %2 + } + + define i64 @add_hi_one_lo_negone(i64 %0) { + %2 = add nsw i64 %0, 8589934591 + ret i64 %2 + } + +... +--- +name: addi +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: addi + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 1 + %2:_(s64) = G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: slti +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: slti + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 2 + ; RV32-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(slt), [[COPY]](s64), [[C]] + ; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ICMP]], [[C1]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 2 + %2:_(s1) = G_ICMP intpred(slt), %0(s64), %1 + %3:_(s64) = G_ZEXT %2(s1) + $x10 = COPY %3(s64) + PseudoRET implicit $x10 + +... +--- +name: sltiu +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: sltiu + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 3 + ; RV32-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[COPY]](s64), [[C]] + ; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ICMP]], [[C1]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 3 + %2:_(s1) = G_ICMP intpred(ult), %0(s64), %1 + %3:_(s64) = G_ZEXT %2(s1) + $x10 = COPY %3(s64) + PseudoRET implicit $x10 + +... +--- +name: xori +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: xori + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4 + ; RV32-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[XOR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 4 + %2:_(s64) = G_XOR %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: ori +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: ori + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 5 + ; RV32-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[OR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 5 + %2:_(s64) = G_OR %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: andi +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: andi + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 6 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 6 + %2:_(s64) = G_AND %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: slli +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: slli + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 7 + ; RV32-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64) + ; RV32-NEXT: $x10 = COPY [[SHL]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 7 + %2:_(s64) = G_SHL %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: srli +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: srli + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8 + ; RV32-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[C]](s64) + ; RV32-NEXT: $x10 = COPY [[LSHR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 8 + %2:_(s64) = G_LSHR %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: srai +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: srai + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 9 + ; RV32-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[C]](s64) + ; RV32-NEXT: $x10 = COPY [[ASHR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 9 + %2:_(s64) = G_ASHR %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: add +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: add + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[COPY1]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: sub +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sub + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[COPY]], [[COPY1]] + ; RV32-NEXT: $x10 = COPY [[SUB]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_SUB %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: sll +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sll + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[COPY1]](s64) + ; RV32-NEXT: $x10 = COPY [[SHL]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_SHL %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: slt +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: slt + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(slt), [[COPY]](s64), [[COPY1]] + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ICMP]], [[C]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s1) = G_ICMP intpred(slt), %0(s64), %1 + %3:_(s64) = G_ZEXT %2(s1) + $x10 = COPY %3(s64) + PseudoRET implicit $x10 + +... +--- +name: sltu +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sltu + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ICMP:%[0-9]+]]:_(s64) = G_ICMP intpred(ult), [[COPY]](s64), [[COPY1]] + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 1 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ICMP]], [[C]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s1) = G_ICMP intpred(ult), %0(s64), %1 + %3:_(s64) = G_ZEXT %2(s1) + $x10 = COPY %3(s64) + PseudoRET implicit $x10 + +... +--- +name: xor +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: xor + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[XOR:%[0-9]+]]:_(s64) = G_XOR [[COPY]], [[COPY1]] + ; RV32-NEXT: $x10 = COPY [[XOR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_XOR %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: srl +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: srl + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[COPY]], [[COPY1]](s64) + ; RV32-NEXT: $x10 = COPY [[LSHR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_LSHR %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: sra +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sra + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[COPY]], [[COPY1]](s64) + ; RV32-NEXT: $x10 = COPY [[ASHR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_ASHR %0, %1(s64) + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: or +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: or + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[OR:%[0-9]+]]:_(s64) = G_OR [[COPY]], [[COPY1]] + ; RV32-NEXT: $x10 = COPY [[OR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_OR %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: and +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: and + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[COPY1]] + ; RV32-NEXT: $x10 = COPY [[AND]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = COPY $x11 + %2:_(s64) = G_AND %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: addiw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: addiw + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 123 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[ASSERT_SEXT]], [[C]] + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[ADD]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %1:_(s64) = COPY $x10 + %2:_(s64) = G_ASSERT_SEXT %1, 32 + %0:_(s32) = G_TRUNC %2(s64) + %3:_(s32) = G_CONSTANT i32 123 + %4:_(s32) = G_ADD %0, %3 + %5:_(s64) = G_SEXT %4(s32) + $x10 = COPY %5(s64) + PseudoRET implicit $x10 + +... +--- +name: slliw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: slliw + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 17 + ; RV32-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[ASSERT_SEXT]], [[C]](s64) + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SHL]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %1:_(s64) = COPY $x10 + %2:_(s64) = G_ASSERT_SEXT %1, 32 + %0:_(s32) = G_TRUNC %2(s64) + %3:_(s32) = G_CONSTANT i32 17 + %4:_(s32) = G_SHL %0, %3(s32) + %5:_(s64) = G_SEXT %4(s32) + $x10 = COPY %5(s64) + PseudoRET implicit $x10 + +... +--- +name: srliw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: srliw + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[COPY]], [[C]] + ; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 8 + ; RV32-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[AND]], [[C1]](s64) + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %1:_(s64) = COPY $x10 + %0:_(s32) = G_TRUNC %1(s64) + %2:_(s32) = G_CONSTANT i32 8 + %3:_(s32) = G_LSHR %0, %2(s32) + %4:_(s64) = G_SEXT %3(s32) + $x10 = COPY %4(s64) + PseudoRET implicit $x10 + +... +--- +name: sraiw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: sraiw + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 9 + ; RV32-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SEXT]], [[C]](s64) + ; RV32-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[ASHR]](s64) + ; RV32-NEXT: [[SEXT1:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC1]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT1]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %1:_(s64) = COPY $x10 + %0:_(s32) = G_TRUNC %1(s64) + %2:_(s32) = G_CONSTANT i32 9 + %3:_(s32) = G_ASHR %0, %2(s32) + %4:_(s64) = G_SEXT %3(s32) + $x10 = COPY %4(s64) + PseudoRET implicit $x10 + +... +--- +name: sraiw_i64 +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: sraiw_i64 + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 32 + ; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 41 + ; RV32-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[COPY]], [[C]](s64) + ; RV32-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SHL]], [[C1]](s64) + ; RV32-NEXT: $x10 = COPY [[ASHR]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 32 + %3:_(s64) = G_CONSTANT i64 41 + %2:_(s64) = G_SHL %0, %1(s64) + %4:_(s64) = G_ASHR %2, %3(s64) + $x10 = COPY %4(s64) + PseudoRET implicit $x10 + +... +--- +name: sextw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10 + + ; RV32-LABEL: name: sextw + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY]], 32 + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[ASSERT_ZEXT]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %1:_(s64) = COPY $x10 + %2:_(s64) = G_ASSERT_ZEXT %1, 32 + %0:_(s32) = G_TRUNC %2(s64) + %3:_(s64) = G_SEXT %0(s32) + $x10 = COPY %3(s64) + PseudoRET implicit $x10 + +... +--- +name: addw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: addw + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 32 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[ASSERT_SEXT]], [[ASSERT_SEXT1]] + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[ADD]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %2:_(s64) = COPY $x10 + %3:_(s64) = G_ASSERT_SEXT %2, 32 + %0:_(s32) = G_TRUNC %3(s64) + %4:_(s64) = COPY $x11 + %5:_(s64) = G_ASSERT_SEXT %4, 32 + %1:_(s32) = G_TRUNC %5(s64) + %6:_(s32) = G_ADD %0, %1 + %7:_(s64) = G_SEXT %6(s32) + $x10 = COPY %7(s64) + PseudoRET implicit $x10 + +... +--- +name: subw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: subw + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASSERT_SEXT1:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY1]], 32 + ; RV32-NEXT: [[SUB:%[0-9]+]]:_(s64) = G_SUB [[ASSERT_SEXT]], [[ASSERT_SEXT1]] + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SUB]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %2:_(s64) = COPY $x10 + %3:_(s64) = G_ASSERT_SEXT %2, 32 + %0:_(s32) = G_TRUNC %3(s64) + %4:_(s64) = COPY $x11 + %5:_(s64) = G_ASSERT_SEXT %4, 32 + %1:_(s32) = G_TRUNC %5(s64) + %6:_(s32) = G_SUB %0, %1 + %7:_(s64) = G_SEXT %6(s32) + $x10 = COPY %7(s64) + PseudoRET implicit $x10 + +... +--- +name: sllw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sllw + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ASSERT_ZEXT]], [[C]] + ; RV32-NEXT: [[SHL:%[0-9]+]]:_(s64) = G_SHL [[ASSERT_SEXT]], [[AND]](s64) + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[SHL]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %2:_(s64) = COPY $x10 + %3:_(s64) = G_ASSERT_SEXT %2, 32 + %0:_(s32) = G_TRUNC %3(s64) + %4:_(s64) = COPY $x11 + %5:_(s64) = G_ASSERT_ZEXT %4, 32 + %1:_(s32) = G_TRUNC %5(s64) + %6:_(s32) = G_SHL %0, %1(s32) + %7:_(s64) = G_SEXT %6(s32) + $x10 = COPY %7(s64) + PseudoRET implicit $x10 + +... +--- +name: srlw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } + - { id: 7, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: srlw + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[ASSERT_SEXT:%[0-9]+]]:_(s64) = G_ASSERT_SEXT [[COPY]], 32 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ASSERT_SEXT]], [[C]] + ; RV32-NEXT: [[C1:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[AND1:%[0-9]+]]:_(s64) = G_AND [[ASSERT_ZEXT]], [[C1]] + ; RV32-NEXT: [[LSHR:%[0-9]+]]:_(s64) = G_LSHR [[AND]], [[AND1]](s64) + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[LSHR]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %2:_(s64) = COPY $x10 + %3:_(s64) = G_ASSERT_SEXT %2, 32 + %0:_(s32) = G_TRUNC %3(s64) + %4:_(s64) = COPY $x11 + %5:_(s64) = G_ASSERT_ZEXT %4, 32 + %1:_(s32) = G_TRUNC %5(s64) + %6:_(s32) = G_LSHR %0, %1(s32) + %7:_(s64) = G_SEXT %6(s32) + $x10 = COPY %7(s64) + PseudoRET implicit $x10 + +... +--- +name: sraw +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } + - { id: 3, class: _, preferred-register: '' } + - { id: 4, class: _, preferred-register: '' } + - { id: 5, class: _, preferred-register: '' } + - { id: 6, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.0): + liveins: $x10, $x11 + + ; RV32-LABEL: name: sraw + ; RV32: liveins: $x10, $x11 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[COPY1:%[0-9]+]]:_(s64) = COPY $x11 + ; RV32-NEXT: [[ASSERT_ZEXT:%[0-9]+]]:_(s64) = G_ASSERT_ZEXT [[COPY1]], 32 + ; RV32-NEXT: [[TRUNC:%[0-9]+]]:_(s32) = G_TRUNC [[COPY]](s64) + ; RV32-NEXT: [[SEXT:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC]](s32) + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[AND:%[0-9]+]]:_(s64) = G_AND [[ASSERT_ZEXT]], [[C]] + ; RV32-NEXT: [[ASHR:%[0-9]+]]:_(s64) = G_ASHR [[SEXT]], [[AND]](s64) + ; RV32-NEXT: [[TRUNC1:%[0-9]+]]:_(s32) = G_TRUNC [[ASHR]](s64) + ; RV32-NEXT: [[SEXT1:%[0-9]+]]:_(s64) = G_SEXT [[TRUNC1]](s32) + ; RV32-NEXT: $x10 = COPY [[SEXT1]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %2:_(s64) = COPY $x11 + %3:_(s64) = G_ASSERT_ZEXT %2, 32 + %1:_(s32) = G_TRUNC %3(s64) + %4:_(s32) = G_TRUNC %0(s64) + %5:_(s32) = G_ASHR %4, %1(s32) + %6:_(s64) = G_SEXT %5(s32) + $x10 = COPY %6(s64) + PseudoRET implicit $x10 + +... +--- +name: add_hi_and_lo_negone +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32-LABEL: name: add_hi_and_lo_negone + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -1 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = nsw G_ADD [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 -1 + %2:_(s64) = nsw G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: add_hi_zero_lo_negone +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32-LABEL: name: add_hi_zero_lo_negone + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 4294967295 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = G_ADD [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 4294967295 + %2:_(s64) = G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: add_lo_negone +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32-LABEL: name: add_lo_negone + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 -4294967297 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = nsw G_ADD [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 -4294967297 + %2:_(s64) = nsw G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +... +--- +name: add_hi_one_lo_negone +alignment: 4 +legalized: false +regBankSelected: false +registers: + - { id: 0, class: _, preferred-register: '' } + - { id: 1, class: _, preferred-register: '' } + - { id: 2, class: _, preferred-register: '' } +body: | + bb.1 (%ir-block.1): + liveins: $x10 + + ; RV32-LABEL: name: add_hi_one_lo_negone + ; RV32: liveins: $x10 + ; RV32-NEXT: {{ $}} + ; RV32-NEXT: [[COPY:%[0-9]+]]:_(s64) = COPY $x10 + ; RV32-NEXT: [[C:%[0-9]+]]:_(s64) = G_CONSTANT i64 8589934591 + ; RV32-NEXT: [[ADD:%[0-9]+]]:_(s64) = nsw G_ADD [[COPY]], [[C]] + ; RV32-NEXT: $x10 = COPY [[ADD]](s64) + ; RV32-NEXT: PseudoRET implicit $x10 + %0:_(s64) = COPY $x10 + %1:_(s64) = G_CONSTANT i64 8589934591 + %2:_(s64) = nsw G_ADD %0, %1 + $x10 = COPY %2(s64) + PseudoRET implicit $x10 + +...