summary refs log tree commit diff
path: root/lisc
diff options
context:
space:
mode:
Diffstat (limited to 'lisc')
-rw-r--r--lisc/emit.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/lisc/emit.c b/lisc/emit.c
index ad46289..820e2c4 100644
--- a/lisc/emit.c
+++ b/lisc/emit.c
@@ -224,7 +224,16 @@ eins(Ins i, Fn *fn, FILE *f)
 			i.wide, i.arg[0], i.to);
 		break;
 	case OCall:
-		emitf(fn, f, "call%w %R", 1, i.arg[0]);
+		switch (rtype(i.arg[0])) {
+		default:
+			diag("emit: invalid call instruction");
+		case RCon:
+			emitf(fn, f, "callq %M", i.arg[0]);
+			break;
+		case RTmp:
+			emitf(fn, f, "call%w *%R", 1, i.arg[0]);
+			break;
+		}
 		break;
 	case OAddr:
 		emitf(fn, f, "lea%w %M, %R", i.wide, i.arg[0], i.to);