Imports #
"encoding/binary"
"fmt"
"strings"
"fmt"
"strings"
"fmt"
"strings"
"encoding/binary"
"fmt"
"strings"
"fmt"
"strings"
"fmt"
"strings"
const ADDI_D
const ADDI_W
const ADDU16I_D
const ADD_D
const ADD_W
const ALSL_D
const ALSL_W
const ALSL_WU
const AMADD_B
const AMADD_D
const AMADD_DB_B
const AMADD_DB_D
const AMADD_DB_H
const AMADD_DB_W
const AMADD_H
const AMADD_W
const AMAND_D
const AMAND_DB_D
const AMAND_DB_W
const AMAND_W
const AMCAS_B
const AMCAS_D
const AMCAS_DB_B
const AMCAS_DB_D
const AMCAS_DB_H
const AMCAS_DB_W
const AMCAS_H
const AMCAS_W
const AMMAX_D
const AMMAX_DB_D
const AMMAX_DB_DU
const AMMAX_DB_W
const AMMAX_DB_WU
const AMMAX_DU
const AMMAX_W
const AMMAX_WU
const AMMIN_D
const AMMIN_DB_D
const AMMIN_DB_DU
const AMMIN_DB_W
const AMMIN_DB_WU
const AMMIN_DU
const AMMIN_W
const AMMIN_WU
const AMOR_D
const AMOR_DB_D
const AMOR_DB_W
const AMOR_W
const AMSWAP_B
const AMSWAP_D
const AMSWAP_DB_B
const AMSWAP_DB_D
const AMSWAP_DB_H
const AMSWAP_DB_W
const AMSWAP_H
const AMSWAP_W
const AMXOR_D
const AMXOR_DB_D
const AMXOR_DB_W
const AMXOR_W
const AND
const ANDI
const ANDN
const ASRTGT_D
const ASRTLE_D
const B
const BCEQZ
const BCNEZ
const BEQ
const BEQZ
const BGE
const BGEU
const BITREV_4B
const BITREV_8B
const BITREV_D
const BITREV_W
const BL
const BLT
const BLTU
const BNE
const BNEZ
const BREAK
const BSTRINS_D
const BSTRINS_W
const BSTRPICK_D
const BSTRPICK_W
const BYTEPICK_D
const BYTEPICK_W
const CACOP
const CLO_D
const CLO_W
const CLZ_D
const CLZ_W
const CPUCFG
const CRCC_W_B_W
const CRCC_W_D_W
const CRCC_W_H_W
const CRCC_W_W_W
const CRC_W_B_W
const CRC_W_D_W
const CRC_W_H_W
const CRC_W_W_W
const CSRRD
const CSRWR
const CSRXCHG
const CTO_D
const CTO_W
const CTZ_D
const CTZ_W
const DBAR
const DBCL
const DIV_D
const DIV_DU
const DIV_W
const DIV_WU
const ERTN
const EXT_W_B
const EXT_W_H
Float point register
const F0
const F1
const F10
const F11
const F12
const F13
const F14
const F15
const F16
const F17
const F18
const F19
const F2
const F20
const F21
const F22
const F23
const F24
const F25
const F26
const F27
const F28
const F29
const F3
const F30
const F31
const F4
const F5
const F6
const F7
const F8
const F9
const FABS_D
const FABS_S
const FADD_D
const FADD_S
const FCC0 Fcc = iota
const FCC1
const FCC2
const FCC3
const FCC4
const FCC5
const FCC6
const FCC7
const FCLASS_D
const FCLASS_S
const FCMP_CAF_D
const FCMP_CAF_S
const FCMP_CEQ_D
const FCMP_CEQ_S
const FCMP_CLE_D
const FCMP_CLE_S
const FCMP_CLT_D
const FCMP_CLT_S
const FCMP_CNE_D
const FCMP_CNE_S
const FCMP_COR_D
const FCMP_COR_S
const FCMP_CUEQ_D
const FCMP_CUEQ_S
const FCMP_CULE_D
const FCMP_CULE_S
const FCMP_CULT_D
const FCMP_CULT_S
const FCMP_CUNE_D
const FCMP_CUNE_S
const FCMP_CUN_D
const FCMP_CUN_S
const FCMP_SAF_D
const FCMP_SAF_S
const FCMP_SEQ_D
const FCMP_SEQ_S
const FCMP_SLE_D
const FCMP_SLE_S
const FCMP_SLT_D
const FCMP_SLT_S
const FCMP_SNE_D
const FCMP_SNE_S
const FCMP_SOR_D
const FCMP_SOR_S
const FCMP_SUEQ_D
const FCMP_SUEQ_S
const FCMP_SULE_D
const FCMP_SULE_S
const FCMP_SULT_D
const FCMP_SULT_S
const FCMP_SUNE_D
const FCMP_SUNE_S
const FCMP_SUN_D
const FCMP_SUN_S
const FCOPYSIGN_D
const FCOPYSIGN_S
const FCSR0 Fcsr = iota
const FCSR1
const FCSR2
const FCSR3
const FCVT_D_S
const FCVT_S_D
const FDIV_D
const FDIV_S
const FFINT_D_L
const FFINT_D_W
const FFINT_S_L
const FFINT_S_W
const FLDGT_D
const FLDGT_S
const FLDLE_D
const FLDLE_S
const FLDX_D
const FLDX_S
const FLD_D
const FLD_S
const FLOGB_D
const FLOGB_S
const FMADD_D
const FMADD_S
const FMAXA_D
const FMAXA_S
const FMAX_D
const FMAX_S
const FMINA_D
const FMINA_S
const FMIN_D
const FMIN_S
const FMOV_D
const FMOV_S
const FMSUB_D
const FMSUB_S
const FMUL_D
const FMUL_S
const FNEG_D
const FNEG_S
const FNMADD_D
const FNMADD_S
const FNMSUB_D
const FNMSUB_S
const FRECIPE_D
const FRECIPE_S
const FRECIP_D
const FRECIP_S
const FRINT_D
const FRINT_S
const FRSQRTE_D
const FRSQRTE_S
const FRSQRT_D
const FRSQRT_S
const FSCALEB_D
const FSCALEB_S
const FSEL
const FSQRT_D
const FSQRT_S
const FSTGT_D
const FSTGT_S
const FSTLE_D
const FSTLE_S
const FSTX_D
const FSTX_S
const FST_D
const FST_S
const FSUB_D
const FSUB_S
const FTINTRM_L_D
const FTINTRM_L_S
const FTINTRM_W_D
const FTINTRM_W_S
const FTINTRNE_L_D
const FTINTRNE_L_S
const FTINTRNE_W_D
const FTINTRNE_W_S
const FTINTRP_L_D
const FTINTRP_L_S
const FTINTRP_W_D
const FTINTRP_W_S
const FTINTRZ_L_D
const FTINTRZ_L_S
const FTINTRZ_W_D
const FTINTRZ_W_S
const FTINT_L_D
const FTINT_L_S
const FTINT_W_D
const FTINT_W_S
const IBAR
const IDLE
const INVTLB
const IOCSRRD_B
const IOCSRRD_D
const IOCSRRD_H
const IOCSRRD_W
const IOCSRWR_B
const IOCSRWR_D
const IOCSRWR_H
const IOCSRWR_W
const JIRL
const LDDIR
const LDGT_B
const LDGT_D
const LDGT_H
const LDGT_W
const LDLE_B
const LDLE_D
const LDLE_H
const LDLE_W
const LDPTE
const LDPTR_D
const LDPTR_W
const LDX_B
const LDX_BU
const LDX_D
const LDX_H
const LDX_HU
const LDX_W
const LDX_WU
const LD_B
const LD_BU
const LD_D
const LD_H
const LD_HU
const LD_W
const LD_WU
const LLACQ_D
const LLACQ_W
const LL_D
const LL_W
const LU12I_W
const LU32I_D
const LU52I_D
const MASKEQZ
const MASKNEZ
const MOD_D
const MOD_DU
const MOD_W
const MOD_WU
const MOVCF2FR
const MOVCF2GR
const MOVFCSR2GR
const MOVFR2CF
const MOVFR2GR_D
const MOVFR2GR_S
const MOVFRH2GR_S
const MOVGR2CF
const MOVGR2FCSR
const MOVGR2FRH_W
const MOVGR2FR_D
const MOVGR2FR_W
const MULH_D
const MULH_DU
const MULH_W
const MULH_WU
const MULW_D_W
const MULW_D_WU
const MUL_D
const MUL_W
const NOR
const OR
const ORI
const ORN
const PCADDI
const PCADDU12I
const PCADDU18I
const PCALAU12I
const PRELD
const PRELDX
General-purpose register
const R0 Reg = iota
const R1
const R10
const R11
const R12
const R13
const R14
const R15
const R16
const R17
const R18
const R19
const R2
const R20
const R21
const R22
const R23
const R24
const R25
const R26
const R27
const R28
const R29
const R3
const R30
const R31
const R4
const R5
const R6
const R7
const R8
const R9
const RDTIMEH_W
const RDTIMEL_W
const RDTIME_D
const REVB_2H
const REVB_2W
const REVB_4H
const REVB_D
const REVH_2W
const REVH_D
const ROTRI_D
const ROTRI_W
const ROTR_D
const ROTR_W
const SCREL_D
const SCREL_W
const SC_D
const SC_Q
const SC_W
const SLLI_D
const SLLI_W
const SLL_D
const SLL_W
const SLT
const SLTI
const SLTU
const SLTUI
const SRAI_D
const SRAI_W
const SRA_D
const SRA_W
const SRLI_D
const SRLI_W
const SRL_D
const SRL_W
const STGT_B
const STGT_D
const STGT_H
const STGT_W
const STLE_B
const STLE_D
const STLE_H
const STLE_W
const STPTR_D
const STPTR_W
const STX_B
const STX_D
const STX_H
const STX_W
const ST_B
const ST_D
const ST_H
const ST_W
const SUB_D
const SUB_W
const SYSCALL
const TLBCLR
const TLBFILL
const TLBFLUSH
const TLBRD
const TLBSRCH
const TLBWR
const XOR
const XORI
const _ Op = iota
const _ instArg = iota
const arg_ca
const arg_cd
const arg_cj
const arg_code_14_0
const arg_code_4_0
11-15
const arg_csr_23_10
const arg_fa
const arg_fcsr_4_0
const arg_fcsr_9_5
1-5
const arg_fd
const arg_fj
const arg_fk
const arg_hint_14_0
26-30
const arg_hint_4_0
const arg_level_14_0
const arg_level_17_10
const arg_lsbd
const arg_lsbw
const arg_msbd
const arg_msbw
const arg_offset_15_0
const arg_offset_20_0
36~
const arg_offset_25_0
const arg_op_4_0
const arg_rd
6-10
const arg_rj
const arg_rk
const arg_sa2_16_15
16-20
const arg_sa3_17_15
const arg_seq_17_10
31-35
const arg_si12_21_10
const arg_si14_23_10
const arg_si16_25_10
const arg_si20_24_5
21-25
const arg_ui12_21_10
const arg_ui5_14_10
const arg_ui6_15_10
var decoderCover []bool
var errShort = *ast.CallExpr
var errUnknown = *ast.CallExpr
var instFormats = [...]instFormat{...}
var opstr = [...]string{...}
var plan9OpMap = map[Op]string{...}
An Args holds the instruction arguments. If an instruction has fewer than 5 arguments, the final elements in the array are nil.
type Args [5]Arg
type CodeSimm int16
float condition flags register
type Fcc uint8
float control status register
type Fcsr uint8
An Op is an Loong64 opcode.
type Op uint16
A Reg is a single register. The zero value denotes R0, not the absence of a register.
type Reg uint16
type SaSimm int16
type instArg uint16
type instArgs [5]instArg
An Arg is a single instruction argument
type Arg interface {
String() string
}
An Inst is a single instruction.
type Inst struct {
Op Op
Enc uint32
Args Args
}
type OffsetSimm struct {
Imm int32
Width uint8
}
type Simm16 struct {
Imm int16
Width uint8
}
type Simm32 struct {
Imm int32
Width uint8
}
An Imm is an integer constant.
type Uimm struct {
Imm uint32
Decimal bool
}
An instFormat describes the format of an instruction encoding.
type instFormat struct {
mask uint32
value uint32
op Op
args instArgs
}
Decode decodes the 4 bytes in src as a single instruction.
func Decode(src []byte) (inst Inst, err error)
GNUSyntax returns the GNU assembler syntax for the instruction, as defined by GNU binutils. This form typically matches the syntax defined in the Loong64 Reference Manual. See https://loongson.github.io/LoongArch-Documentation/LoongArch-Vol1-EN.html
func GNUSyntax(inst Inst) string
GoSyntax returns the Go assembler syntax for the instruction. The syntax was originally defined by Plan 9. The pc is the program counter of the instruction, used for expanding PC-relative addresses into absolute ones. The symname function queries the symbol table for the program being disassembled. Given a target address it returns the name and base address of the symbol containing the target, if any; otherwise it returns "", 0.
func GoSyntax(inst Inst, pc uint64, symname func(uint64) (string, uint64)) string
func (f Fcc) String() string
func (si Simm16) String() string
NOTE: The actual Op values are defined in tables.go. They are chosen to simplify instruction decoding and are not a dense packing from 0 to N, although the density is high, probably at least 90%.
func (op Op) String() string
func (r Reg) String() string
func (f Fcsr) String() string
func (c CodeSimm) String() string
func (i Uimm) String() string
func (i Inst) String() string
func (si Simm32) String() string
func (o OffsetSimm) String() string
func (s SaSimm) String() string
decodeArg decodes the arg described by aop from the instruction bits x. It returns nil if x cannot be decoded according to aop.
func decodeArg(aop instArg, x uint32, index int) Arg
func init()
func offsConvInt32(imm int32, width uint8) int32
func plan9Arg(inst *Inst, pc uint64, symname func(uint64) (string, uint64), arg Arg) string
func signumConvInt32(imm int32, width uint8) int32
Generated with Arrow