# SPDX-License-Identifier: GPL-3.0-or-later selection_rules: - id: select_g_load_m8 priority: 300 match: opcode: G_LOAD memory: { index: 0, bytes: 1 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LBU root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_load_m16 priority: 300 match: opcode: G_LOAD memory: { index: 0, bytes: 2 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LH root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_load_m32 priority: 300 match: opcode: G_LOAD memory: { index: 0, bytes: 4 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LW root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_load_m64 priority: 300 match: opcode: G_LOAD memory: { index: 0, bytes: 8 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LD root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_sextload_m8 priority: 300 match: opcode: G_SEXTLOAD memory: { index: 0, bytes: 1 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LB root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_sextload_m16 priority: 300 match: opcode: G_SEXTLOAD memory: { index: 0, bytes: 2 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LH root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_sextload_m32 priority: 300 match: opcode: G_SEXTLOAD memory: { index: 0, bytes: 4 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LW root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_zextload_m8 priority: 300 match: opcode: G_ZEXTLOAD memory: { index: 0, bytes: 1 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LBU root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_zextload_m16 priority: 300 match: opcode: G_ZEXTLOAD memory: { index: 0, bytes: 2 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LHU root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_zextload_m32 priority: 300 match: opcode: G_ZEXTLOAD memory: { index: 0, bytes: 4 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: LWU root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_store_m8 priority: 300 match: opcode: G_STORE memory: { index: 0, bytes: 1 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: SB root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_store_m16 priority: 300 match: opcode: G_STORE memory: { index: 0, bytes: 2 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: SH root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_store_m32 priority: 300 match: opcode: G_STORE memory: { index: 0, bytes: 4 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: SW root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_store_m64 priority: 300 match: opcode: G_STORE memory: { index: 0, bytes: 8 } operand_types: - { index: 1, kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } - { index: 1, bank: GPR } apply: instructions: - opcode: SD root: true operands: - { operand: 0 } - { complex: addr_reg_imm_base, operand: 1 } - { complex: addr_reg_imm_offset, operand: 1 } - id: select_g_frame_index priority: 100 match: opcode: G_FRAME_INDEX result_type: { kind: pointer, bits: 64 } operand_banks: - { index: 0, bank: GPR } apply: instructions: - opcode: ADDI root: true operands: [{ operand: 0 }, { operand: 1 }, { immediate: 0 }]