X-Git-Url: http://shamusworld.gotdns.org/cgi-bin/gitweb.cgi?p=rmac;a=blobdiff_plain;f=riscasm.c;h=4d62e97d7a0a11bfed64b1847a87cee659931623;hp=706cac8f10ae3bc80a99ecf3e6eb7369d3cf8e7d;hb=HEAD;hpb=d21544da607af148b96a9d926d4564800892aa4e diff --git a/riscasm.c b/riscasm.c index 706cac8..3399b81 100644 --- a/riscasm.c +++ b/riscasm.c @@ -20,8 +20,8 @@ #define DEF_MR // Declare keyword values #include "risckw.h" // Incl. generated risc keywords -#define DEF_KW // Declare keyword values -#include "kwtab.h" // Incl. generated keyword tables & defs +#define DEF_REGRISC +#include "riscregs.h" // Incl. generated keyword tables & defs #define MAXINTERNCC 26 // Maximum internal condition codes @@ -128,8 +128,8 @@ static const struct opcoderecord roptbl[] = { { MR_NORMI, RI_TWO, 56 }, { MR_NOP, RI_NONE, 57 }, { MR_SAT24, RI_ONE, 62 }, - { MR_UNPACK, RI_ONE, 63 + GPUONLY | (0 << 6) }, - { MR_PACK, RI_ONE, 63 + GPUONLY | (1 << 6) }, + { MR_UNPACK, RI_ONE, 63 + GPUONLY | (1 << 6) }, + { MR_PACK, RI_ONE, 63 + GPUONLY | (0 << 6) }, { MR_ADDQMOD, RI_NUM_32, 63 + DSPONLY }, { MR_MOVE, RI_MOVE, 0 }, { MR_LOAD, RI_LOAD, 0 }, @@ -165,7 +165,7 @@ static inline int MalformedOpcode(int signal) // static inline int IllegalIndexedRegister(int reg) { - return error("Attempted index reference with non-indexable register (r%d)", reg - KW_R0); + return error("Attempted index reference with non-indexable register (r%d)", reg - REGRISC_R0); } // @@ -190,6 +190,7 @@ static void DepositRISCInstructionWord(uint16_t opcode, int reg1, int reg2) } int value = ((opcode & 0x3F) << 10) + ((reg1 & 0x1F) << 5) + (reg2 & 0x1F); + GENLINENOSYM(); D_word(value); } @@ -202,9 +203,9 @@ static int EvaluateRegisterFromTokenStream(uint32_t fixup) // Firstly, check to see if it's a register token and return that. No // need to invoke expr() for easy cases like this. int reg = *tok & 255; - if (reg >= KW_R0 && reg <= KW_R31) + if (reg >= REGRISC_R0 && reg <= REGRISC_R31) { - reg -= KW_R0; + reg -= REGRISC_R0; tok++; return reg; } @@ -233,6 +234,7 @@ static int EvaluateRegisterFromTokenStream(uint32_t fixup) // We shouldn't get here, that should not be legal interror(9); + return 0; // Not that this will ever execute, but let's be nice and pacify gcc warnings } // @@ -421,7 +423,7 @@ int GenerateRISCCode(int state) // PC,Rd or Rs,Rd case RI_MOVE: - if (*tok == KW_PC) + if (*tok == REGRISC_PC) { parm = 51; reg1 = 0; @@ -451,8 +453,8 @@ int GenerateRISCCode(int state) if ((tok[1] == '+') || (tok[1] == '-')) { // Trying to make indexed call - if ((*tok == KW_R14) || (*tok == KW_R15)) - indexed = (*tok - KW_R0); + if ((*tok == REGRISC_R14) || (*tok == REGRISC_R15)) + indexed = (*tok - REGRISC_R0); else return IllegalIndexedRegister(*tok); } @@ -472,7 +474,7 @@ int GenerateRISCCode(int state) parm = (WORD)(reg1 - 14 + 58); tok++; - if ((*tok >= KW_R0) && (*tok <= KW_R31)) + if ((*tok >= REGRISC_R0) && (*tok <= REGRISC_R31)) indexed = 1; if (*tok == SYMBOL) @@ -548,8 +550,8 @@ int GenerateRISCCode(int state) tok++; indexed = 0; - if (((*tok == KW_R14) || (*tok == KW_R15)) && (tok[1] != ')')) - indexed = *tok - KW_R0; + if (((*tok == REGRISC_R14) || (*tok == REGRISC_R15)) && (tok[1] != ')')) + indexed = *tok - REGRISC_R0; if (!indexed) { @@ -566,7 +568,7 @@ int GenerateRISCCode(int state) parm = (WORD)(reg2 - 14 + 60); tok++; - if ((*tok >= KW_R0) && (*tok <= KW_R31)) + if ((*tok >= REGRISC_R0) && (*tok <= REGRISC_R31)) indexed = 1; if (*tok == SYMBOL)