home *** CD-ROM | disk | FTP | other *** search
- /*
- * This file discribes the 88k instruction parser functions and data types.
- */
-
- /*
- * The instruction types.
- */
- enum m88k_instruction_type {
- M88K_NONE,
- M88K_ADD,
- M88K_ADDU,
- M88K_AND,
- M88K_BB0,
- M88K_BB1,
- M88K_BCND,
- M88K_BR,
- M88K_BSR,
- M88K_CLR,
- M88K_CMP,
- M88K_DIVS,
- M88K_DIVU,
- M88K_EXT,
- M88K_EXTU,
- M88K_FADD,
- M88K_FCMP,
- M88K_FCMPU,
- M88K_FCVT,
- M88K_FDIV,
- M88K_FF0,
- M88K_FF1,
- M88K_FLDCR,
- M88K_FLT,
- M88K_FMUL,
- M88K_FSQRT,
- M88K_FSTCR,
- M88K_FSUB,
- M88K_FXCR,
- M88K_ILLOP1,
- M88K_ILLOP2,
- M88K_ILLOP3,
- M88K_INT,
- M88K_JMP,
- M88K_JSR,
- M88K_LD,
- M88K_LDA,
- M88K_LDCR,
- M88K_MAK,
- M88K_MASK,
- M88K_MOV,
- M88K_MULS,
- M88K_MULU,
- M88K_NINT,
- M88K_OR,
- M88K_PADD,
- M88K_PADDS,
- M88K_PCMP,
- M88K_PMUL,
- M88K_PPACK,
- M88K_PROT,
- M88K_PSUB,
- M88K_PSUBS,
- M88K_PUNPK,
- M88K_ROT,
- M88K_RTE,
- M88K_SET,
- M88K_ST,
- M88K_STCR,
- M88K_SUB,
- M88K_SUBU,
- M88K_TB0,
- M88K_TB1,
- M88K_TBND,
- M88K_TCND,
- M88K_TRNC,
- M88K_XCR,
- M88K_XMEM,
- M88K_XOR
- };
-
- /*
- * The operand types.
- */
- enum m88k_operand_type {
- M88K_OT_NONE,
- /* register operands */
- M88K_OT_GREG,
- M88K_OT_CREG,
- M88K_OT_FCREG,
- M88K_OT_XREG,
- /* non-register operands */
- M88K_OT_IMMED_16,
- M88K_OT_DISP_16,
- M88K_OT_DISP_26,
- M88K_OT_BIT_FIELD, /* bit field width and bit field offset */
- M88K_OT_BIT_OFFSET, /* only bit offset (rot instruction only) */
- M88K_OT_BIT_NUMBER,
- M88K_OT_COND_MATCH,
- M88K_OT_VEC_NUMBER,
- M88K_OT_PIXEL_ROTATE /* 64 bit rotate encoded in 4 bits (value times 4) */
- };
-
- /*
- * The operand formats.
- */
- enum m88k_operand_format {
- M88K_OF_NONE,
- M88K_OF_SINGLE_WORD,
- M88K_OF_DOUBLE_WORD,
- M88K_OF_QUAD_WORD,
-
- M88K_OF_FPSINGLE,
- M88K_OF_FPDOUBLE,
- M88K_OF_FPEXTENDED
- };
-
- /*
- * The memory sizes effected by load/store/xmem.
- */
- enum m88k_memory_size {
- M88K_MS_NONE,
- M88K_MS_BYTE,
- M88K_MS_HALF_WORD,
- M88K_MS_SINGLE_WORD,
- M88K_MS_DOUBLE_WORD,
- M88K_MS_QUAD_WORD
- };
-
- /*
- * The pixel arithmetic types.
- */
- enum m88k_saturating {
- M88K_SAT_NONE,
- M88K_SAT_UNSIGNED,
- M88K_SAT_MIXEDSIGNED,
- M88K_SAT_SIGNED
- };
-
- /*
- * The pixel widths.
- */
- enum m88k_pixel_width {
- M88K_PW_NIBBLE,
- M88K_PW_BYTE,
- M88K_PW_HALF,
- M88K_PW_WORD
- };
-
- /*
- * The pack shift amount for the ppack instruction.
- */
- enum m88k_pixel_pack_shift {
- M88K_PPS_NONE,
- M88K_PPS_8,
- M88K_PPS_16,
- M88K_PPS_32
- };
-
- /*
- * The structure of a parsed 88k instruction.
- */
- struct m88k_parsed_instruction {
- unsigned long opcode;
- enum m88k_instruction_type inst_type:8;
- unsigned long
- carry_in:1, /* add, addu, sub, subu */
- carry_out:1, /* add, addu, sub, subu */
- complement_src2:1, /* and, xor, or (reg) */
- upper_half:1, /* and, mask, xor, or (immed) */
- execute_next:1, /* br, bsr, bb0, bb1, bcnd, jmp, jsr */
- write_through:1, /* st */
- load_unsigned:1, /* ld.bu, ld.hu, xmem.bu, xmem.hu */
- scaled_index:1, /* xmem, ld.u, ld, st, lda[] */
- user_memory:1; /* xmem, ld.u, ld, st */
- enum m88k_memory_size ms:3; /* xmem, ld.u, ld, st */
- enum m88k_saturating sat:2; /* padds, psubs */
- enum m88k_pixel_width pw:2; /* padd,padds,psub,psubs,ppack,punpk */
- enum m88k_pixel_pack_shift pps:2; /* ppack */
-
- enum m88k_operand_type dest_type:4;
- enum m88k_operand_format dest_format:4;
-
- enum m88k_operand_type src1_type:4;
- enum m88k_operand_format src1_format:4;
-
- enum m88k_operand_type src2_type:4;
- enum m88k_operand_format src2_format:4;
- };
-
- /*
- * m88k_parse_instruction() is passed an opcode and parses it into an 88k
- * parsed instruction pointed to by inst.
- */
- extern void
- m88k_parse_instruction(
- unsigned long opcode,
- struct m88k_parsed_instruction *inst);
-
- /* names of the instruction types indexed by an enum m88k_instruction_type */
- extern const char * const m88k_instruction_names[];
-