📄 c67-gen.c
字号:
(C67_map_regs(a) << 1) | //side of src (0 << 0)); //parallel } else if (strstr(s, "STW.D *") == s) { C67_g((C67_map_regn(a) << 23) | //src (C67_map_regn(b) << 18) | //base reg A0 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(b) << 7) | //y D1/D2 base reg side (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of src (0 << 0)); //parallel } else if (strstr(s, "STH.D *") == s) { C67_g((C67_map_regn(a) << 23) | //src (C67_map_regn(b) << 18) | //base reg A0 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(b) << 7) | //y D1/D2 base reg side (5 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of src (0 << 0)); //parallel } else if (strstr(s, "STB.D *") == s) { C67_g((C67_map_regn(a) << 23) | //src (C67_map_regn(b) << 18) | //base reg A0 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(b) << 7) | //y D1/D2 base reg side (3 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of src (0 << 0)); //parallel } else if (strstr(s, "STW.D +*") == s) { ALWAYS_ASSERT(c < 32); C67_g((C67_map_regn(a) << 23) | //src (C67_map_regn(b) << 18) | //base reg A0 (c << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(b) << 7) | //y D1/D2 base reg side (7 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of src (0 << 0)); //parallel } else if (strstr(s, "LDW.D SP PRE INC") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg B15 (2 << 13) | //ucst5 (must keep 8 byte boundary) (9 << 9) | //mode 9 = pre inc ucst5 (0 << 8) | //r (LDDW bit 0) (1 << 7) | //y D1/D2 B side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDDW.D SP PRE INC") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg B15 (1 << 13) | //ucst5 (must keep 8 byte boundary) (9 << 9) | //mode 9 = pre inc ucst5 (1 << 8) | //r (LDDW bit 1) (1 << 7) | //y D1/D2 B side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDW.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (0 << 8) | //r (LDDW bit 0) (0 << 7) | //y D1/D2 A side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDDW.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (1 << 8) | //r (LDDW bit 1) (0 << 7) | //y D1/D2 A side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDH.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (0 << 8) | //r (LDDW bit 0) (0 << 7) | //y D1/D2 A side (4 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDB.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (0 << 8) | //r (LDDW bit 0) (0 << 7) | //y D1/D2 A side (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDHU.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (0 << 8) | //r (LDDW bit 0) (0 << 7) | //y D1/D2 A side (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDBU.D *+SP[A0]") == s) { C67_g((C67_map_regn(a) << 23) | //dst (15 << 18) | //base reg A15 (0 << 13) | //offset reg A0 (5 << 9) | //mode 5 = pos offset, base reg + off reg (0 << 8) | //r (LDDW bit 0) (0 << 7) | //y D1/D2 A side (1 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(a) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDW.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDDW.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (1 << 8) | //r (LDDW bit 1) (C67_map_regs(a) << 7) | //y D1/D2 src side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDH.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (4 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDB.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (2 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDHU.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (0 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDBU.D *") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (0 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (1 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "LDW.D +*") == s) { C67_g((C67_map_regn(b) << 23) | //dst (C67_map_regn(a) << 18) | //base reg A15 (1 << 13) | //cst5 (1 << 9) | //mode 1 = pos cst offset (0 << 8) | //r (LDDW bit 0) (C67_map_regs(a) << 7) | //y D1/D2 src side (6 << 4) | //ldst 3=STB, 5=STH 5, 7=STW, 6=LDW 4=LDH 2=LDB 0=LDHU 1=LDBU (1 << 2) | //opcode (C67_map_regs(b) << 1) | //side of dst (0 << 0)); //parallel } else if (strstr(s, "CMPLTSP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x3a << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPGTSP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x39 << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPEQSP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x38 << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPLTDP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x2a << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPGTDP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x29 << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPEQDP") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x28 << 6) | //opcode (0x8 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPLT") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x57 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPGT") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x47 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPEQ") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x53 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPLTU") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x5f << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "CMPGTU") == s) { xpath = C67_map_regs(a) ^ C67_map_regs(b); ALWAYS_ASSERT(C67_map_regs(c) == C67_map_regs(a)); C67_g((C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (C67_map_regn(a) << 13) | //src1 (xpath << 12) | //x use cross path for src2 (0x4f << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side for reg c (0 << 0)); //parallel } else if (strstr(s, "B DISP") == s) { C67_g((0 << 29) | //creg (0 << 28) | //z (a << 7) | //cnst (0x4 << 2) | //opcode fixed (0 << 1) | //S0/S1 (0 << 0)); //parallel } else if (strstr(s, "B.") == s) { xpath = C67_map_regs(c) ^ 1; C67_g((C67_map_regc(b) << 29) | //creg (a << 28) | //inv (0 << 23) | //dst (C67_map_regn(c) << 18) | //src2 (0 << 13) | // (xpath << 12) | //x cross path if !B side (0xd << 6) | //opcode (0x8 << 2) | //opcode fixed (1 << 1) | //must be S2 (0 << 0)); //parallel } else if (strstr(s, "MV.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (0 << 13) | //src1 (cst5) (xpath << 12) | //x cross path if opposite sides (0x2 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "SPTRUNC.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0xb << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "DPTRUNC.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst ((C67_map_regn(b) + 1) << 18) | //src2 WEIRD CPU must specify odd reg for some reason (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0x1 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "INTSP.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0x4a << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "INTSPU.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0x49 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "INTDP.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst (C67_map_regn(b) << 18) | //src2 (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0x39 << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest (0 << 0)); //parallel } else if (strstr(s, "INTDPU.L") == s) { xpath = C67_map_regs(b) ^ C67_map_regs(c); C67_g((0 << 29) | //creg (0 << 28) | //inv (C67_map_regn(c) << 23) | //dst ((C67_map_regn(b) + 1) << 18) | //src2 WEIRD CPU must specify odd reg for some reason (0 << 13) | //src1 NA (xpath << 12) | //x cross path if opposite sides (0x3b << 5) | //opcode (0x6 << 2) | //opcode fixed (C67_map_regs(c) << 1) | //side of dest
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -