scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

powerpc.c (981B)


      1 #include <stdlib.h>
      2 
      3 #include <scc/mach.h>
      4 #include <scc/scc.h>
      5 
      6 #include "../../as.h"
      7 #include "proc.h"
      8 
      9 TUINT maxaddr = 0xFFFF;
     10 int endian = BIG_ENDIAN;
     11 int left2right = 0;
     12 
     13 void
     14 iarch(void)
     15 {
     16 	static struct {
     17 		char *name;
     18 		char type;
     19 	} regs[] = {
     20 		"R0", AREG_R0,
     21 		"R1", AREG_R1,
     22 		"R2", AREG_R2,
     23 		"R3", AREG_R3,
     24 		"R4", AREG_R4,
     25 		"R5", AREG_R5,
     26 		"R6", AREG_R6,
     27 		"R7", AREG_R7,
     28 		"R8", AREG_R8,
     29 		"R9", AREG_R9,
     30 
     31 		"R10", AREG_R10,
     32 		"R11", AREG_R11,
     33 		"R12", AREG_R12,
     34 		"R13", AREG_R13,
     35 		"R14", AREG_R14,
     36 		"R15", AREG_R15,
     37 		"R16", AREG_R16,
     38 		"R17", AREG_R17,
     39 		"R18", AREG_R18,
     40 		"R19", AREG_R19,
     41 
     42 		"R20", AREG_R20,
     43 		"R21", AREG_R21,
     44 		"R22", AREG_R22,
     45 		"R23", AREG_R23,
     46 		"R24", AREG_R24,
     47 		"R25", AREG_R25,
     48 		"R26", AREG_R26,
     49 		"R27", AREG_R27,
     50 		"R28", AREG_R28,
     51 		"R29", AREG_R29,
     52 		"R30", AREG_R30,
     53 		"R31", AREG_R31,
     54 
     55 		NULL
     56 	}, *bp;
     57 
     58 	for (bp = regs; bp->name; ++bp) {
     59 		Symbol *sym = lookup(bp->name);
     60 		sym->flags = FREG;
     61 		sym->value = bp->type;
     62 	}
     63 }