%ra, %sp, %fp are now valid register identifiers.

This commit is contained in:
cdkersey
2015-07-06 22:20:05 -06:00
parent 60f2e494e3
commit 3242ff3354
4 changed files with 23 additions and 4 deletions

View File

@@ -5,7 +5,7 @@ namespace HarpTools {
ASM_T_DIR_GLOBAL, ASM_T_DIR_ARG_NUM, ASM_T_DIR_ARG_STRING,
ASM_T_DIR_ARG_SYM, ASM_T_DIR_ARG_R, ASM_T_DIR_ARG_W, ASM_T_DIR_ARG_X,
ASM_T_DIR_END, ASM_T_LABEL, ASM_T_PRED, ASM_T_INST,
ASM_T_PREG, ASM_T_REG, ASM_T_LIT, ASM_T_SYM,
ASM_T_PEXP
ASM_T_PREG, ASM_T_REG, ASM_T_REG_RA, ASM_T_REG_SP,
ASM_T_REG_FP, ASM_T_LIT, ASM_T_SYM, ASM_T_PEXP
};
};

View File

@@ -169,10 +169,11 @@ namespace Harp {
class AsmReader : public ObjReader {
public:
AsmReader(ArchDef arch) : wordSize(arch.getWordSize()) {}
AsmReader(ArchDef arch) :
wordSize(arch.getWordSize()), nRegs(arch.getNRegs()) {}
virtual Obj *read(std::istream &input);
private:
Size wordSize;
Size wordSize, nRegs;
};
class HOFReader : public ObjReader {