changeset 274:3ae68af07fce

MIPS code-gen-all passed. PowerPC register dassop, preinc, postinc fix.
author kono
date Fri, 21 May 2004 05:29:53 +0900
parents 87b9cfc86a10
children 8f09f8bbc494
files mc-code-mips.c test/code-gen.c
diffstat 2 files changed, 488 insertions(+), 102 deletions(-) [+]
line wrap: on
line diff
--- a/mc-code-mips.c	Fri May 21 00:57:27 2004 +0900
+++ b/mc-code-mips.c	Fri May 21 05:29:53 2004 +0900
@@ -1244,7 +1244,7 @@
 	printf("\taddu %s,%s,%d\n", 
 		register_name(cadr(e2)),register_name(cadr(e2)), dir);
 	if (cadr(reg)!=e2)
-	    printf("\tmove %s,%s\n",register_name(cadr(reg)),register_name(e2));
+	    printf("\tmove %s,%s\n",register_name(reg),register_name(cadr(e2)));
 	return;
     } 
     g_expr(e2);
@@ -2268,6 +2268,8 @@
 }
 #endif
 
+#if LONGLONG_CODE
+
 static void
 lload(int creg,int reg,int offset) 
 {
@@ -2281,17 +2283,54 @@
 	printf("\tlw %s,%d(%s)\n",lregister_name_low(reg),offset,crn);
     }
 #else
-    if (creg!=regv_h(reg)) {
-	printf("\tlw %s,%d(%s)\n",lregister_name_high(reg),offset,crn);
-	printf("\tlw %s,%d(%s)\n",lregister_name_low(reg),offset+SIZE_OF_INT,crn);
-    } else {
+    if (creg!=regv_l(reg)) {
 	printf("\tlw %s,%d(%s)\n",lregister_name_low(reg),offset+SIZE_OF_INT,crn);
 	printf("\tlw %s,%d(%s)\n",lregister_name_high(reg),offset,crn);
+    } else {
+	printf("\tlw %s,%d(%s)\n",lregister_name_high(reg),offset,crn);
+	printf("\tlw %s,%d(%s)\n",lregister_name_low(reg),offset+SIZE_OF_INT,crn);
     }
 #endif
 }
 
-#if LONGLONG_CODE
+static void
+lmove(int to,int from)
+{
+    int tmp;
+    if (regv_h(to)==regv_h(from)&&(regv_l(to)==regv_l(from))) 
+	return;
+    if (regv_h(to)==regv_l(from)&&(regv_l(to)==regv_h(from))) {
+	tmp = get_register();
+	printf("\tmove %s,%s\n",register_name(tmp),lregister_name_low(from));
+	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
+	printf("\tmove %s,%s\n",lregister_name_low(to),register_name(tmp));
+	free_register(tmp);
+    } else if (regv_h(to)==regv_l(from)) {
+	printf("\tmove %s,%s\n",lregister_name_low(to),lregister_name_low(from));
+	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
+    } else {
+	printf("\tmove %s,%s\n",lregister_name_low(to),lregister_name_low(from));
+	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
+    }
+}
+
+static void
+lstore(int e2,int creg)
+{
+    char *drn = register_name(e2);
+    char *crn_h;
+    char *crn_l;
+    crn_h = lregister_name_high(creg);
+    crn_l = lregister_name_low(creg);
+#if ENDIAN==0
+    printf("\tsw %s,0(%s)\n",crn_l,drn);
+    printf("\tsw %s,%d(%s)\n",crn_h,SIZE_OF_INT,drn);
+#else
+    printf("\tsw %s,0(%s)\n",crn_h,drn);
+    printf("\tsw %s,%d(%s)\n",crn_l,SIZE_OF_INT,drn);
+#endif
+}
+
 int
 code_lrindirect(int e1, int reg, int offset, int us)
 {
@@ -3543,7 +3582,7 @@
 }
 
 static void
-code_dconst_op(char *lib,int from,int to,double value)
+code_double_lib_c(char *lib,int from,int to,double value)
 {
     code_save_stacks();
     clear_ptr_cache();
@@ -3565,6 +3604,7 @@
     char *grn,*frn;
     int d;
     int cmp=0;
+    int reg0=reg;
 
     d=(op<FOP);
     use_float(d,reg);
@@ -3579,7 +3619,7 @@
 	default:
 	    error(-1); return;
 	}
-        code_double_lib(opc,RET_DREGISTER,reg,e1);
+        code_double_lib(opc,reg0==USE_CREG?RET_DREGISTER:reg,reg,e1);
     } else {
 	switch(op) {
 	case FADD: opn="add.s"; break;
@@ -3611,6 +3651,7 @@
     char *crn;
     char *frn;
     int edx,edx0=-1;
+    int reg0=reg;
 
     if (!d) {
       xreg=emit_dpop(d);
@@ -3634,13 +3675,17 @@
 	edx = edx0;
       }
       lload(edx,reg,0);
-      dtosop(op,reg,xreg);
+      dtosop(op,USE_CREG,xreg);
+      if (lreg!=RET_DREGISTER) error(-1);
+      use_reg(lreg);
       edx = emit_pop(0);
-      code_lassign(edx,reg);
+      code_lassign(edx,RET_DREGISTER);
       if (edx0!=-1)
 	free_register(edx0);
       emit_pop_free(edx);
       emit_lpop_free(xreg);
+      if (reg0!=USE_CREG && reg!=RET_DREGISTER)
+	lmove(reg,RET_DREGISTER);
       set_double(reg);
     }
 }
@@ -3676,7 +3721,7 @@
 code_dpreinc(int e1,int e2,int d,int reg) {
     char *frn;
     char *crn;
-    int  g,xreg,dreg;
+    int  g,xreg;
     char *grn;
     int dir=caddr(e1);
 
@@ -3691,7 +3736,7 @@
 	    frn=fregister_name(reg);
 	    printf("\t%s %s,%s,%s\n",dir>0?"add.s":"sub.s",crn,crn,grn);
 	    if (use && reg!=cadr(e2))
-		printf("\tmov.s %s,%s\n",crn,frn);
+		printf("\tmov.s %s,%s\n",frn,crn);
 	} else {
 	    g_expr(e2);
 	    if (!is_int_reg(creg)) error(-1);
@@ -3710,23 +3755,25 @@
     } else {
 	if (car(e2)==DREGISTER) {
 	    use_float(d,reg);
-	    code_dconst_op("dpadd",cadr(e2),cadr(e2),dir);
+	    code_double_lib_c("dpadd",cadr(e2),cadr(e2),dir);
 	    if (reg!=cadr(e2)) lmove(reg,cadr(e2));
 	    return;
 	} 
 	g_expr(e2);
 	if(!is_int_reg(creg)) error(-1);
+	xreg = ireg;
 	emit_push();
-	if (reg==USE_CREG) {
-	    dreg=get_lregister(); if (!dreg) error(-1);
-	    set_dreg(dreg,0);  // free old lreg==creg
-	} else {
-	    dreg = reg;
+	code_save_stacks();
+	lload(xreg,DREGISTER_OPERAND,0);
+	code_double_lib_c("dpadd",DREGISTER_OPERAND,RET_DREGISTER,dir);
+	xreg = emit_pop(0);
+	lstore(xreg,RET_DREGISTER);
+	if (use) {
+	    if (reg==USE_CREG)
+		set_dreg(RET_DREGISTER,0);
+	    else
+		lmove(reg,RET_DREGISTER);
 	}
-	xreg = emit_pop(0);
-	lload(xreg,dreg,0);
-	code_dconst_op("dpadd",dreg,dreg,dir);
-	code_lassign(xreg,dreg);
 	emit_pop_free(xreg);
     }
 }
@@ -3735,7 +3782,7 @@
 code_dpostinc(int e1,int e2,int d,int reg) {
     char *frn;
     char *crn;
-    int  g,xreg,dreg,nreg;
+    int  g,xreg;
     char *grn;
     int dir=caddr(e1);
 
@@ -3748,9 +3795,9 @@
 		set_freg(reg,0);
 	    }
 	    frn=fregister_name(reg);
+	    if (use && reg!=cadr(e2))
+		printf("\tmov.s %s,%s\n",frn,crn);
 	    printf("\t%s %s,%s,%s\n",dir>0?"add.s":"sub.s",crn,crn,grn);
-	    if (use && reg!=cadr(e2))
-		printf("\tmov.s %s,%s\n",crn,frn);
 	} else {
 	    g_expr(e2);
 	    if (!is_int_reg(creg)) error(-1);
@@ -3768,27 +3815,45 @@
 	free_register(g);
     } else {
 	if (car(e2)==DREGISTER) {
-	    use_float(d,reg);
-	    if (reg!=cadr(e2)) lmove(reg,cadr(e2));
-	    code_dconst_op("dpadd",cadr(e2),cadr(e2),dir);
+	    xreg = cadr(e2);
+	    code_double_lib_c("dpadd",xreg,RET_DREGISTER,dir);
+	    if (reg==USE_CREG) {
+		use_float(d,reg);
+		if (reg==RET_DREGISTER) {
+		    reg = get_dregister(d);
+		    set_dreg(reg,0);
+		}
+	    }
+	    if (reg==RET_DREGISTER) {
+		g = get_dregister(d);
+		lmove(g,xreg);
+		lmove(xreg,reg);
+		lmove(reg,g);
+		free_register(g);
+		return;
+	    }
+	    if (reg!=xreg) lmove(reg,xreg);
+	    lmove(xreg,RET_DREGISTER);
 	    return;
 	} 
 	g_expr(e2);
 	if(!is_int_reg(creg)) error(-1);
+	xreg = ireg;
 	emit_push();
-	nreg=get_dregister(1); if (!nreg) error(-1);
-	if (reg==USE_CREG) {
-	    dreg=get_lregister(); if (!dreg) error(-1);
-	    set_dreg(dreg,0);  // free old lreg==creg
-	} else {
-	    dreg = reg;
+	code_save_stacks();
+	use_float(1,reg);
+	lload(xreg,DREGISTER_OPERAND,0);
+	code_double_lib_c("dpadd",DREGISTER_OPERAND,RET_DREGISTER,dir);
+	xreg = emit_pop(0);
+	emit_lpush();
+	if (use) {
+	    use_longlong(reg);
+	    lload(xreg,reg,0);
 	}
-	xreg = emit_pop(0);
-	lload(xreg,dreg,0);
-	code_dconst_op("dpadd",nreg,dreg,dir);
-	code_lassign(xreg,nreg);
+	reg = emit_lpop();
+	lstore(xreg,reg);
+	emit_lpop_free(reg);
 	emit_pop_free(xreg);
-	free_register(nreg);
     }
 }
 
@@ -3908,27 +3973,6 @@
 
 /* 64bit int part */
 static void
-lmove(int to,int from)
-{
-    int tmp;
-    if (regv_h(to)==regv_h(from)&&(regv_l(to)==regv_l(from))) 
-	return;
-    if (regv_h(to)==regv_l(from)&&(regv_l(to)==regv_h(from))) {
-	tmp = get_register();
-	printf("\tmove %s,%s\n",register_name(tmp),lregister_name_low(from));
-	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
-	printf("\tmove %s,%s\n",lregister_name_low(to),register_name(tmp));
-	free_register(tmp);
-    } else if (regv_h(to)==regv_l(from)) {
-	printf("\tmove %s,%s\n",lregister_name_low(to),lregister_name_low(from));
-	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
-    } else {
-	printf("\tmove %s,%s\n",lregister_name_high(to),lregister_name_high(from));
-	printf("\tmove %s,%s\n",lregister_name_low(to),lregister_name_low(from));
-    }
-}
-
-static void
 pcond(int op,char *s,int l1)
 {
     if (op==LOP+EQ||op==LOP+NEQ) {
@@ -4077,20 +4121,8 @@
 void
 code_lassign(int e2,int creg)
 {
-    char *drn = register_name(e2);
-    char *crn_h;
-    char *crn_l;
-
     use_longlong(creg);
-    crn_h = lregister_name_high(creg);
-    crn_l = lregister_name_low(creg);
-#if ENDIAN==0
-    printf("\tsw %s,0(%s)\n",crn_l,drn);
-    printf("\tsw %s,%d(%s)\n",crn_h,SIZE_OF_INT,drn);
-#else
-    printf("\tsw %s,0(%s)\n",crn_h,drn);
-    printf("\tsw %s,%d(%s)\n",crn_l,SIZE_OF_INT,drn);
-#endif
+    lstore(e2,creg);
 }
 
 void
@@ -4242,9 +4274,11 @@
     printf("\t2:\n");
     printf("\tsll     %s,%s,%s\n",dl,cl,ol);
     printf("\t3:\n");
-    printf("\tmove    %s,%s\n",cl,dl);
-    printf("\tmove    %s,%s\n",ch,oh);
-    free_register(dreg);
+    // printf("\tmove    %s,%s\n",cl,dl);
+    // printf("\tmove    %s,%s\n",ch,oh);
+    printf("\tmove    %s,%s\n",dh,oh);
+    set_lreg(dreg,0);
+    // free_register(dreg);
 }
 
 static void
@@ -4278,9 +4312,10 @@
     printf("\t2:\n");
     printf("\tsra     %s,%s,%s\n",dh,ch,ol);
     printf("\t3:\n");
-    printf("\tmove    %s,%s\n",cl,dl);
-    printf("\tmove    %s,%s\n",ch,dh);
-    free_register(dreg);
+    // printf("\tmove    %s,%s\n",cl,dl);
+    // printf("\tmove    %s,%s\n",ch,dh);
+    set_lreg(dreg,0);
+    // free_register(dreg);
 }
 
 static void
@@ -4316,13 +4351,14 @@
     printf("\t2:\n");
     printf("\tsrl     %s,%s,%s\n",dh,ch,ol);
     printf("\t3:\n");
-    printf("\tmove    %s,%s\n",cl,dl);
-    printf("\tmove    %s,%s\n",ch,dh);
-    free_register(dreg);
+    // printf("\tmove    %s,%s\n",cl,dl);
+    // printf("\tmove    %s,%s\n",ch,dh);
+    set_lreg(dreg,0);
+    // free_register(dreg);
 }
 
 static void
-code_longlong_lib(char *lib,int reg,int oreg) // ___divdi3$stub
+code_longlong_lib(char *lib,int reg,int oreg)
 {
     code_save_stacks();
     clear_ptr_cache();
@@ -4438,15 +4474,19 @@
 	break;
     case LDIV:
 	code_ldiv_lib(reg,oreg); // ___divdi3$stub
+	check_lreg(reg);
 	break;
     case LUDIV:
 	code_ludiv_lib(reg,oreg); // ___udivdi3$stub
+	check_lreg(reg);
 	break;
     case LMOD:
 	code_lmod_lib(reg,oreg); // ___moddi3$stub
+	check_lreg(reg);
 	break;
     case LUMOD:
 	code_lumod_lib(reg,oreg); // ___umoddi3$stub
+	check_lreg(reg);
 	break;
     default:
 	error(-1);
@@ -4751,8 +4791,8 @@
     if (car(e2)==LREGISTER) {
         use_longlong(reg);
 	ladd(cadr(e2),cadr(e2),dir);
-        if (cadr(reg)!=cadr(e2)) {
-	    lmove(cadr(reg),cadr(e2));
+        if (reg!=cadr(e2)) {
+	    lmove(reg,cadr(e2));
 	}
         return;
     } 
@@ -4780,7 +4820,7 @@
     int dir=caddr(e1);
     if (car(e2)==LREGISTER) {
 	use_longlong(reg);
-	lmove(cadr(reg),cadr(e2));
+	lmove(reg,cadr(e2));
 	ladd(cadr(e2),cadr(e2),dir);
         return;
     } 
@@ -4797,7 +4837,7 @@
     xreg = emit_pop(0);
     lload(xreg,dreg,0);
     ladd(dreg,nreg,dir);
-    code_lassign(xreg,nreg);
+    lstore(xreg,nreg);
     emit_pop_free(xreg);
     free_register(nreg);
 }
--- a/test/code-gen.c	Fri May 21 00:57:27 2004 +0900
+++ b/test/code-gen.c	Fri May 21 05:29:53 2004 +0900
@@ -564,6 +564,26 @@
     printf("code_rindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
 }
 
+void
+code_assign_register()
+{
+    int i1,i2; 
+    unsigned int ui1,ui2; 
+    register int *pi1,*pi2; 
+    register unsigned int *pui1,*pui2; 
+
+    i1 = -555; i2= 555;
+    ui1 = 632423423; ui2= 32394234;
+    pi1 = &i1;
+    pi2 = &i2;
+    pui1 = &ui1;
+    pui2 = &ui2;
+
+    *(pi2+i1+i2) = 3;
+    *(pui2+i1+i2) = 3;
+    printf("code_rindirect %d %d %u %u\n",*pi1,*pi2,*pui1,*pui2);
+}
+
 // code_register_assop(int e2,int op,int byte) 
 void
 code_register_assop()
@@ -760,7 +780,6 @@
 }
 
 
-
 // tosop(int op,int oreg)
 void
 tosop()
@@ -866,6 +885,111 @@
 }
 
 
+// tosop(int op,int oreg)
+void
+register_tosop()
+{
+    register int i1,i2,i; 
+    register unsigned int u1,u2,u; 
+    i1 = -555; i2= 555;
+    u1 = 632423423; u2= 32394234;
+
+    i = i1 + i2;
+    printf("tosop r 1 %d\n",i);
+    i = i1 - i2;
+    printf("tosop r 2 %d\n",i);
+    i = i1 / i2;
+    printf("tosop r 3 %d\n",i);
+    i = i1 * i2;
+    printf("tosop r 4 %d\n",i);
+    i = i1 | i2;
+    printf("tosop r 5 %d\n",i);
+    i = i1 & i2;
+    printf("tosop r 6 %d\n",i);
+    i = i1 ^ i2;
+    printf("tosop r 7 %d\n",i);
+    i = i1 << i2;
+    printf("tosop r 8 %d\n",i);
+    i = i1 >> i2;
+    printf("tosop r 9 %d\n",i);
+    i = i1 % i2;
+    printf("tosop r 10 %d\n",i);
+
+    u = u1 + u2;
+    printf("tosop r 1 %u\n",u);
+    u = u1 - u2;
+    printf("tosop r 2 %u\n",u);
+    u = u1 / u2;
+    printf("tosop r 3 %u\n",u);
+    u = u1 * u2;
+    printf("tosop r 4 %u\n",u);
+    u = u1 | u2;
+    printf("tosop r 5 %u\n",u);
+    u = u1 & u2;
+    printf("tosop r 6 %u\n",u);
+    u = u1 ^ u2;
+    printf("tosop r 7 %u\n",u);
+    u = u1 << u2;
+    printf("tosop r 8 %u\n",u);
+    u = u1 >> u2;
+    printf("tosop r 9 %u\n",u);
+    u = u1 % u2;
+    printf("tosop r 10 %u\n",u);
+}
+
+// oprtc(int op,int v)
+void
+register_oprtc()
+{
+    register int i1,i; 
+    register unsigned int u1,u; 
+    i1 = -555; 
+    u1 = 632423423; 
+
+    i = i1 + 3;
+    printf("oprtc r 1 %d\n",i);
+    i = i1 - 3;
+    printf("oprtc r 2 %d\n",i);
+    i = i1 / 3;
+    printf("oprtc r 3 %d\n",i);
+    i = i1 * 3;
+    printf("oprtc r 4 %d\n",i);
+    i = i1 | 234234234;
+    printf("oprtc r 5 %d\n",i);
+    i = i1 & 23234234;
+    printf("oprtc r 6 %d\n",i);
+    i = i1 ^ 23234234;
+    printf("oprtc r 7 %d\n",i);
+    i = i1 << 5;
+    printf("oprtc r 8 %d\n",i);
+    i = i1 >> 5;
+    printf("oprtc r 9 %d\n",i);
+    i = i1 % 5;
+    printf("oprtc r 10 %d\n",i);
+
+    u = u1 + 3;
+    printf("oprtc r 1 %u\n",u);
+    u = u1 - 3;
+    printf("oprtc r 2 %u\n",u);
+    u = u1 / 3;
+    printf("oprtc r 3 %u\n",u);
+    u = u1 * 3;
+    printf("oprtc r 4 %u\n",u);
+    u = u1 | 234234234;
+    printf("oprtc r 5 %u\n",u);
+    u = u1 & 234234234;
+    printf("oprtc r 6 %u\n",u);
+    u = u1 ^ 234234234;
+    printf("oprtc r 7 %u\n",u);
+    u = u1 << 5;
+    printf("oprtc r 8 %u\n",u);
+    u = u1 >> 5;
+    printf("oprtc r 9 %u\n",u);
+    u = u1 % 5;
+    printf("oprtc r 10 %u\n",u);
+}
+
+
 #if FLOAT_CODE
 // code_cmp_dregister(int e2,int d)
 void
@@ -918,6 +1042,28 @@
     printf("code_dassign %g %g %g %g\n",*pi1,*pi2,*pui1,*pui2);
 }
 
+void
+code_register_dassign()
+{
+    int i1,i2; 
+    float f1,f2; 
+    double ui1,ui2; 
+    register float *pi1,*pi2; 
+    register double *pui1,*pui2; 
+
+    i1 = -555; i2= 555;
+    f1 = -555; f2= 555;
+    ui1 = 632423423; ui2= 32394234;
+    pi1 = &f1;
+    pi2 = &f2;
+    pui1 = &ui1;
+    pui2 = &ui2;
+
+    *(pi2+i1+i2) = 3;
+    *(pui2+i1+i2) = 3;
+    printf("code_dassign %g %g %g %g\n",*pi1,*pi2,*pui1,*pui2);
+}
+
 // code_dconst(int e2,int freg,int d)
 // code_dneg(int freg,int d)
 // code_dneg(int creg) 
@@ -1097,6 +1243,34 @@
 }
 
 
+// dtosop(int op,int e1)
+void
+dtosop_register()
+{
+    register double i1,i2,i; 
+    register float u1,u2,u; 
+    i1 = -555; i2= 555;
+    u1 = 632423423; u2= 32394234;
+
+    i = i1 + i2;
+    printf("dtosop 1 %g\n",i);
+    i = i1 - i2;
+    printf("dtosop 2 %g\n",i);
+    i = i1 / i2;
+    printf("dtosop 3 %g\n",i);
+    i = i1 * i2;
+    printf("dtosop 4 %g\n",i);
+    u = u1 + u2;
+    printf("dtosop 1 %g\n",u);
+    u = u1 - u2;
+    printf("dtosop 2 %g\n",u);
+    u = u1 / u2;
+    printf("dtosop 3 %g\n",u);
+    u = u1 * u2;
+    printf("dtosop 4 %g\n",u);
+}
+
+
 // code_dassop(int op,int d) 
 void
 code_dassop()
@@ -1116,13 +1290,13 @@
     printf("code_dassop 4 %g\n",i1);
 
     ui1 += 3;
-    printf("code_dassop 1 %g\n",ui1);
+    printf("code_dassop f 1 %g\n",ui1);
     ui1 -= 3;
-    printf("code_dassop 2 %g\n",ui1);
+    printf("code_dassop f 2 %g\n",ui1);
     ui1 /= 3;
-    printf("code_dassop 3 %g\n",ui1);
+    printf("code_dassop f 3 %g\n",ui1);
     ui1 *= 3;
-    printf("code_dassop 4 %g\n",ui1);
+    printf("code_dassop f 4 %g\n",ui1);
 }
 
 // code_dassop(int op,int d) 
@@ -1144,13 +1318,13 @@
     printf("code_dassop r 4 %g\n",i1);
 
     ui1 += 3;
-    printf("code_dassop r 1 %g\n",ui1);
+    printf("code_dassop f r 1 %g\n",ui1);
     ui1 -= 3;
-    printf("code_dassop r 2 %g\n",ui1);
+    printf("code_dassop f r 2 %g\n",ui1);
     ui1 /= 3;
-    printf("code_dassop r 3 %g\n",ui1);
+    printf("code_dassop f r 3 %g\n",ui1);
     ui1 *= 3;
-    printf("code_dassop r 4 %g\n",ui1);
+    printf("code_dassop f r 4 %g\n",ui1);
 }
 
 
@@ -1174,10 +1348,10 @@
 {
     double i,j;
     float ui,uj;
-    i = 123123123;j = 0;
+    i = 123123;j = 0;
     printf("code_dpostinc d %g %g",i--,j--);
     printf(" %g %g\n",i,j);
-    ui = 123123123;uj = 0;
+    ui = 123123;uj = 0;
     printf("code_dpostinc f %g %g",ui++,uj--);
     printf(" %g %g\n",ui,uj);
 }
@@ -1188,10 +1362,10 @@
 {
     register double i,j;
     register float ui,uj;
-    i = 123123123;j = 0;
+    i = 123123;j = 0;
     printf("code_dpreinc r d %g %g",++i,--j);
     printf(" %g %g\n",i,j);
-    ui = 123123123;uj = 0;
+    ui = 123123;uj = 0;
     printf("code_dpreinc r f %g %g",++ui,--uj);
     printf(" %g %g\n",ui,uj);
 }
@@ -1202,10 +1376,10 @@
 {
     register double i,j;
     register float ui,uj;
-    i = 123123123;j = 0;
+    i = 123123;j = 0;
     printf("code_dpostinc r d %g %g",i--,j--);
     printf(" %g %g\n",i,j);
-    ui = 123123123;uj = 0;
+    ui = 123123;uj = 0;
     printf("code_dpostinc r f %g %g",ui++,uj--);
     printf(" %g %g\n",ui,uj);
 }
@@ -1380,6 +1554,26 @@
     printf("code_rindirect %lld %lld %llu %llu\n",*pi1,*pi2,*pui1,*pui2);
 }
 
+void
+code_lassign_register()
+{
+    long long i1,i2; 
+    unsigned long long ui1,ui2; 
+    register long long *pi1,*pi2; 
+    register unsigned long long *pui1,*pui2; 
+
+    i1 = -555; i2= 555;
+    ui1 = 632423423; ui2= 32394234;
+    pi1 = &i1;
+    pi2 = &i2;
+    pui1 = &ui1;
+    pui2 = &ui2;
+
+    *(pi2+i1+i2) = 3;
+    *(pui2+i1+i2) = 3;
+    printf("code_rindirect %lld %lld %llu %llu\n",*pi1,*pi2,*pui1,*pui2);
+}
+
 // code_lconst(int e1,int e2)
 // code_lneg(int e1,int e2)
 void
@@ -1575,6 +1769,158 @@
 }
 
 
+// ltosop(int e1,int e2)
+void
+ltosop_register()
+{
+    register long long i1,i2,i; 
+    register unsigned long long u1,u2,u; 
+    register int ii2;
+    register unsigned int uu2;
+    i1 = -555; i2= 555;
+    u1 = 632423423; u2= 32394234;
+    ii2 = -33;
+    uu2 = 33;
+    u = 0;
+
+    i = i1 + i2;
+    printf("ltosop r 1 %lld\n",i);
+    i = i1 - i2;
+    printf("ltosop r 2 %lld\n",i);
+    i = i1 / i2;
+    printf("ltosop r 3 %lld\n",i);
+    i = i1 * i2;
+    printf("ltosop r 4 %lld\n",i);
+    i = i1 | i2;
+    printf("ltosop r 5 %lld\n",i);
+    i = i1 & i2;
+    printf("ltosop r 6 %lld\n",i);
+    i = i1 ^ i2;
+    printf("ltosop r 7 %lld\n",i);
+    i = i1 << i2;
+    printf("ltosop r 8 %lld\n",i);
+    i = i1 >> i2;
+    printf("ltosop r 9 %lld\n",i);
+    i = i1 % i2;
+    printf("ltosop r 10 %lld\n",i);
+
+    u = u1 + u2;
+    printf("ltosop r u 1 %llu\n",u);
+    u = u1 - u2;
+    printf("ltosop r u 2 %llu\n",u);
+    u = u1 / u2;
+    printf("ltosop r u 3 %llu\n",u);
+    u = u1 * u2;
+    printf("ltosop r u 4 %llu\n",u);
+    u = u1 | u2;
+    printf("ltosop r u 5 %llu\n",u);
+    u = u1 & u2;
+    printf("ltosop r u 6 %llu\n",u);
+    u = u1 ^ u2;
+    printf("ltosop r u 7 %llu\n",u);
+    u = u1 << u2;
+    printf("ltosop r u 8 %llu\n",u);
+    u = u1 >> u2;
+    printf("ltosop r u 9 %llu\n",u);
+    u = u1 % u2;
+    printf("ltosop r u 10 %llu\n",u);
+
+    i = i1 + ii2;
+    printf("litosop r 1 %lld\n",i);
+    i = i1 - ii2;
+    printf("litosop r 2 %lld\n",i);
+    i = i1 / ii2;
+    printf("litosop r 3 %lld\n",i);
+    i = i1 * ii2;
+    printf("litosop r 4 %lld\n",i);
+    i = i1 | ii2;
+    printf("litosop r 5 %lld\n",i);
+    i = i1 & ii2;
+    printf("litosop r 6 %lld\n",i);
+    i = i1 ^ ii2;
+    printf("litosop r 7 %lld\n",i);
+    i = i1 << ii2;
+    printf("litosop r 8 %lld\n",i);
+    i = i1 >> ii2;
+    printf("litosop r 9 %lld\n",i);
+    i = i1 % ii2;
+    printf("litosop r 10 %lld\n",i);
+
+    u = u1 + uu2;
+    printf("litosop r u 1 %llu\n",u);
+    u = u1 - uu2;
+    printf("litosop r u 2 %llu\n",u);
+    u = u1 / uu2;
+    printf("litosop r u 3 %llu\n",u);
+    u = u1 * uu2;
+    printf("litosop r u 4 %llu\n",u);
+    u = u1 | uu2;
+    printf("litosop r u 5 %llu\n",u);
+    u = u1 & uu2;
+    printf("litosop r u 6 %llu\n",u);
+    u = u1 ^ uu2;
+    printf("litosop r u 7 %llu\n",u);
+    u = u1 << uu2;
+    printf("litosop r u 8 %llu\n",u);
+    u = u1 >> uu2;
+    printf("litosop r u 9 %llu\n",u);
+    u = u1 % uu2;
+    printf("litosop r u 10 %llu\n",u);
+}
+
+// loprtc(int op,int v)
+void
+loprtc_register()
+{
+    register long long i1,i; 
+    register unsigned long long u1,u; 
+    i1 = -555; 
+    u1 = 632423423; 
+
+    i = i1 + 3;
+    printf("loprtc r 1 %lld\n",i);
+    i = i1 - 3;
+    printf("loprtc r 2 %lld\n",i);
+    i = i1 / 32323423423LL;
+    printf("loprtc r 3 %lld\n",i);
+    i = i1 * 323423423423LL;
+    printf("loprtc r 4 %lld\n",i);
+    i = i1 | 234234234;
+    printf("loprtc r 5 %lld\n",i);
+    i = i1 & 23234234;
+    printf("loprtc r 6 %lld\n",i);
+    i = i1 ^ 23234234;
+    printf("loprtc r 7 %lld\n",i);
+    i = i1 << 5;
+    printf("loprtc r 8 %lld\n",i);
+    i = i1 >> 5;
+    printf("loprtc r 9 %lld\n",i);
+    i = i1 % 5;
+    printf("loprtc r 10 %lld\n",i);
+
+    u = u1 + 3;
+    printf("loprtc r 1 u %llu\n",u);
+    u = u1 - 3;
+    printf("loprtc r 2 u %llu\n",u);
+    u = u1 / 32342342344234LL;
+    printf("loprtc r 3 u %llu\n",u);
+    u = u1 * 243234234232324LL;
+    printf("loprtc r 4 u %llu\n",u);
+    u = u1 | 234234234;
+    printf("loprtc r 5 u %llu\n",u);
+    u = u1 & 234234234;
+    printf("loprtc r 6 u %llu\n",u);
+    u = u1 ^ 234234234;
+    printf("loprtc r 7 u %llu\n",u);
+    u = u1 << 5;
+    printf("loprtc r 8 u %llu\n",u);
+    u = u1 >> 5;
+    printf("loprtc r 9 u %llu\n",u);
+    u = u1 % 5;
+    printf("loprtc r 10 u %llu\n",u);
+}
+
+
 // code_i2ll(int creg)
 void
 code_i2ll()