diff mc-code-ia32.c @ 167:0197ca125567

mips short
author kono
date Mon, 24 Nov 2003 13:47:21 +0900
parents 9e55cc5551fb
children b1297c82e926
line wrap: on
line diff
--- a/mc-code-ia32.c	Mon Nov 24 13:09:14 2003 +0900
+++ b/mc-code-ia32.c	Mon Nov 24 13:47:21 2003 +0900
@@ -771,14 +771,20 @@
 }
 
 void
-code_cmp_crgvar(int e1) {
-    printf("\tcmpb $0,%s\n",((NMTBL*)cadr(e1))->nm);
+code_cmp_crgvar(int e1,int sz) {
+    if (sz==1)
+	printf("\tcmpb $0,%s\n",((NMTBL*)cadr(e1))->nm);
+    else if (sz==size_of_short)
+	printf("\tcmpw $0,%s\n",((NMTBL*)cadr(e1))->nm);
 }
 
 
 void
-code_cmp_crlvar(int e1) {
-    printf("\tcmpb $0,%d(%%ebp)\n",lvar(e1));
+code_cmp_crlvar(int e1,int sz) {
+    if (sz==1)
+	printf("\tcmpb $0,%d(%%ebp)\n",lvar(e1));
+    else if (sz==size_of_short)
+	printf("\tcmpw $0,%d(%%ebp)\n",lvar(e1));
 }