summary refs log tree commit diff
path: root/lisc/emit.c
diff options
context:
space:
mode:
authorQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-23 13:50:26 -0400
committerQuentin Carbonneaux <quentin.carbonneaux@yale.edu>2015-10-30 13:20:42 -0400
commit04b66d38db182390642f8da38b883750208b4835 (patch)
tree6b2a1c6207805131e83277df564bd07aed9ec4e1 /lisc/emit.c
parentb33febc25cce5c836bad952da472f6a54e777ed8 (diff)
downloadroux-04b66d38db182390642f8da38b883750208b4835.tar.gz
start integrating RAMem references
Diffstat (limited to 'lisc/emit.c')
-rw-r--r--lisc/emit.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/lisc/emit.c b/lisc/emit.c
index b8365c2..c4b6356 100644
--- a/lisc/emit.c
+++ b/lisc/emit.c
@@ -40,7 +40,7 @@ emitf(Fn *fn, FILE *f, char *fmt, ...)
 	int i, ty, off;
 	Ref ref;
 	Con *con;
-	struct { int i:AShift; } x;
+	struct { int i:14; } x;
 
 	va_start(ap, fmt);
 	ty = SWord;
@@ -82,9 +82,9 @@ Next:
 			assert(isreg(ref));
 			fprintf(f, "%%%s", rsub[ref.val][ty]);
 			break;
-		case RASlot:
+		case RSlot:
 		Slot:
-			x.i = ref.val & AMask;
+			x.i = ref.val;
 			assert(NAlign == 3);
 			if (x.i < 0)
 				off = -4 * x.i;
@@ -116,9 +116,12 @@ Next:
 	case 'M':
 		ref = va_arg(ap, Ref);
 		switch (rtype(ref)) {
-		default:     diag("emit: invalid memory reference");
-		case RASlot: goto Slot;
-		case RCon:   goto Con;
+		default:
+			diag("emit: invalid memory reference");
+		case RSlot:
+			goto Slot;
+		case RCon:
+			goto Con;
 		case RTmp:
 			assert(isreg(ref));
 			fprintf(f, "(%%%s)", rsub[ref.val][SLong]);