aboutsummaryrefslogtreecommitdiff
path: root/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc
diff options
context:
space:
mode:
Diffstat (limited to 'backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc')
-rw-r--r--backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc853
1 files changed, 853 insertions, 0 deletions
diff --git a/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc
new file mode 100644
index 0000000..940da64
--- /dev/null
+++ b/backend/lib/Target/RISCV/RISCVGISelFloating.rccdesc
@@ -0,0 +1,853 @@
+selection_rules:
+ -
+ id: select_g_fcmp_oeq_s32
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: oeq }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 32 }
+ - { index: 3, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FEQ_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fcmp_olt_s32
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: olt }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 32 }
+ - { index: 3, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FLT_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fcmp_ole_s32
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: ole }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 32 }
+ - { index: 3, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FLE_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fcmp_oeq_s64
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: oeq }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 64 }
+ - { index: 3, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FEQ_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fcmp_olt_s64
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: olt }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 64 }
+ - { index: 3, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FLT_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fcmp_ole_s64
+ priority: 100
+ match:
+ opcode: G_FCMP
+ result_type: { kind: scalar, bits: 64 }
+ floating_predicate: { index: 1, value: ole }
+ operand_types:
+ - { index: 2, kind: scalar, bits: 64 }
+ - { index: 3, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FLE_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 2 }, { operand: 3 }]
+ -
+ id: select_g_fadd_s32
+ priority: 100
+ match:
+ opcode: G_FADD
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FADD_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fadd_s64
+ priority: 100
+ match:
+ opcode: G_FADD
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FADD_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fsub_s32
+ priority: 100
+ match:
+ opcode: G_FSUB
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSUB_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fsub_s64
+ priority: 100
+ match:
+ opcode: G_FSUB
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSUB_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fmul_s32
+ priority: 100
+ match:
+ opcode: G_FMUL
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMUL_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fmul_s64
+ priority: 100
+ match:
+ opcode: G_FMUL
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMUL_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fdiv_s32
+ priority: 100
+ match:
+ opcode: G_FDIV
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FDIV_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fdiv_s64
+ priority: 100
+ match:
+ opcode: G_FDIV
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FDIV_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { immediate: 7 }]
+ -
+ id: select_g_fma_s32
+ priority: 100
+ match:
+ opcode: G_FMA
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ - { index: 3, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMADD_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { operand: 3 }, { immediate: 7 }]
+ -
+ id: select_g_fma_s64
+ priority: 100
+ match:
+ opcode: G_FMA
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ - { index: 3, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMADD_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }, { operand: 3 }, { immediate: 7 }]
+ -
+ id: select_g_fsqrt_s32
+ priority: 100
+ match:
+ opcode: G_FSQRT
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSQRT_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_fsqrt_s64
+ priority: 100
+ match:
+ opcode: G_FSQRT
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSQRT_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_fneg_s32
+ priority: 100
+ match:
+ opcode: G_FNEG
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJN_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 1 }]
+ -
+ id: select_g_fneg_s64
+ priority: 100
+ match:
+ opcode: G_FNEG
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJN_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 1 }]
+ -
+ id: select_g_fabs_s32
+ priority: 100
+ match:
+ opcode: G_FABS
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJX_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 1 }]
+ -
+ id: select_g_fabs_s64
+ priority: 100
+ match:
+ opcode: G_FABS
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJX_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 1 }]
+ -
+ id: select_g_fcopysign_s32_fneg
+ priority: 200
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ def_use:
+ - operand: 2
+ opcode: G_FNEG
+ captures:
+ - { id: sign, operand: 1 }
+ apply:
+ instructions:
+ - opcode: FSGNJN_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { captured_operand: sign }]
+ erase_operand_definitions: [2]
+ -
+ id: select_g_fcopysign_s64_fneg
+ priority: 200
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ def_use:
+ - operand: 2
+ opcode: G_FNEG
+ captures:
+ - { id: sign, operand: 1 }
+ apply:
+ instructions:
+ - opcode: FSGNJN_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { captured_operand: sign }]
+ erase_operand_definitions: [2]
+ -
+ id: select_g_fcopysign_s32_s32
+ priority: 100
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJ_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fcopysign_s64_s64
+ priority: 100
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJ_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fcopysign_s32_s64
+ priority: 100
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJ_S
+ root: true
+ operands:
+ - { operand: 0 }
+ - { operand: 1 }
+ - { complex: fcopysign_to_s32, operand: 2 }
+ -
+ id: select_g_fcopysign_s64_s32
+ priority: 100
+ match:
+ opcode: G_FCOPYSIGN
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FSGNJ_D
+ root: true
+ operands:
+ - { operand: 0 }
+ - { operand: 1 }
+ - { complex: fcopysign_to_s64, operand: 2 }
+ -
+ id: select_g_fminnum_s32
+ priority: 100
+ match:
+ opcode: G_FMINNUM
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMIN_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fminnum_s64
+ priority: 100
+ match:
+ opcode: G_FMINNUM
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMIN_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fmaxnum_s32
+ priority: 100
+ match:
+ opcode: G_FMAXNUM
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ - { index: 2, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMAX_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fmaxnum_s64
+ priority: 100
+ match:
+ opcode: G_FMAXNUM
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ - { index: 2, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ - { index: 2, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FMAX_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { operand: 2 }]
+ -
+ id: select_g_fpext_s32_to_s64
+ priority: 100
+ match:
+ opcode: G_FPEXT
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_D_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 0 }]
+ -
+ id: select_g_fptrunc_s64_to_s32
+ priority: 100
+ match:
+ opcode: G_FPTRUNC
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_S_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_fptosi_s32
+ priority: 100
+ match:
+ opcode: G_FPTOSI
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_L_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 1 }]
+ -
+ id: select_g_fptosi_s64
+ priority: 100
+ match:
+ opcode: G_FPTOSI
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_L_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 1 }]
+ -
+ id: select_g_fptoui_s32
+ priority: 100
+ match:
+ opcode: G_FPTOUI
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_LU_S
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 1 }]
+ -
+ id: select_g_fptoui_s64
+ priority: 100
+ match:
+ opcode: G_FPTOUI
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: GPR }
+ - { index: 1, bank: FPR }
+ apply:
+ instructions:
+ - opcode: FCVT_LU_D
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 1 }]
+ -
+ id: select_g_sitofp_s32
+ priority: 100
+ match:
+ opcode: G_SITOFP
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ instructions:
+ - opcode: FCVT_S_L
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_sitofp_s64
+ priority: 100
+ match:
+ opcode: G_SITOFP
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ instructions:
+ - opcode: FCVT_D_L
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_uitofp_s32
+ priority: 100
+ match:
+ opcode: G_UITOFP
+ result_type: { kind: scalar, bits: 32 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ instructions:
+ - opcode: FCVT_S_LU
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_uitofp_s64
+ priority: 100
+ match:
+ opcode: G_UITOFP
+ result_type: { kind: scalar, bits: 64 }
+ operand_types:
+ - { index: 1, kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ instructions:
+ - opcode: FCVT_D_LU
+ root: true
+ operands: [{ operand: 0 }, { operand: 1 }, { immediate: 7 }]
+ -
+ id: select_g_select_fpr32
+ priority: 100
+ match:
+ opcode: G_SELECT
+ result_type: { kind: scalar, bits: 32 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: Select_FPR32_Using_CC_GPR
+ root: true
+ operands:
+ - { operand: 0 }
+ - { complex: select_condition_lhs, operand: 1 }
+ - { complex: select_condition_rhs, operand: 1 }
+ - { complex: select_condition_code, operand: 1 }
+ - { operand: 2 }
+ - { operand: 3 }
+ -
+ id: select_g_select_fpr64
+ priority: 100
+ match:
+ opcode: G_SELECT
+ result_type: { kind: scalar, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ - { index: 2, bank: FPR }
+ - { index: 3, bank: FPR }
+ apply:
+ instructions:
+ - opcode: Select_FPR64_Using_CC_GPR
+ root: true
+ operands:
+ - { operand: 0 }
+ - { complex: select_condition_lhs, operand: 1 }
+ - { complex: select_condition_rhs, operand: 1 }
+ - { complex: select_condition_code, operand: 1 }
+ - { operand: 2 }
+ - { operand: 3 }
+ -
+ id: select_g_fpextload_s32_to_s64
+ priority: 300
+ match:
+ opcode: G_FPEXTLOAD
+ result_type: { kind: scalar, bits: 64 }
+ memory: { index: 0, bytes: 4 }
+ operand_types:
+ - { index: 1, kind: pointer, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ temporaries:
+ - { id: loaded, type: { kind: scalar, bits: 32 } }
+ instructions:
+ - opcode: FLW
+ root: true
+ operands:
+ - { temporary: loaded, flags: [define] }
+ - { complex: addr_reg_imm_base, operand: 1 }
+ - { complex: addr_reg_imm_offset, operand: 1 }
+ - opcode: FCVT_D_S
+ root: false
+ operands:
+ - { operand: 0 }
+ - { temporary: loaded, flags: [use] }
+ - { immediate: 0 }
+ -
+ id: select_g_fptruncstore_s64_to_s32
+ priority: 300
+ match:
+ opcode: G_FPTRUNCSTORE
+ memory: { index: 0, bytes: 4 }
+ operand_types:
+ - { index: 0, kind: scalar, bits: 64 }
+ - { index: 1, kind: pointer, bits: 64 }
+ operand_banks:
+ - { index: 0, bank: FPR }
+ - { index: 1, bank: GPR }
+ apply:
+ temporaries:
+ - { id: rounded, type: { kind: scalar, bits: 32 } }
+ instructions:
+ - opcode: FCVT_S_D
+ root: false
+ operands:
+ - { temporary: rounded, flags: [define] }
+ - { operand: 0 }
+ - { immediate: 7 }
+ - opcode: FSW
+ root: true
+ operands:
+ - { temporary: rounded, flags: [use] }
+ - { complex: addr_reg_imm_base, operand: 1 }
+ - { complex: addr_reg_imm_offset, operand: 1 }