changelog shortlog tags branches changeset file revisions annotate raw help

Mercurial > hg > plan9front / sys/src/cmd/7l/asmout.c

revision 7145: 84d616f1d180
parent 7144: d0b9ab522e8b
child 7170: 55bc217eb3f5
     1.1--- a/sys/src/cmd/7l/asmout.c
     1.2+++ b/sys/src/cmd/7l/asmout.c
     1.3@@ -722,27 +722,24 @@ asmout(Prog *p, Optab *o)
     1.4 		if(as == AMOV){
     1.5 			as = AORR;
     1.6 			r = REGZERO;
     1.7-		}else if(as == AMOVW){
     1.8+		}else if(as == AMOVW || as == AMOVWU){
     1.9 			as = AORRW;
    1.10 			r = REGZERO;
    1.11 		}
    1.12 		o1 = opirr(as);
    1.13-		s = o1 & S64? 64: 32;
    1.14 		mask = findmask(p->from.offset);
    1.15 		if(mask == nil)
    1.16-			mask = findmask(p->from.offset | (p->from.offset<<32));
    1.17-		if(mask != nil){
    1.18-			o1 |= ((mask->r&(s-1))<<16) | (((mask->s-1)&(s-1))<<10);
    1.19-			if(s == 64){
    1.20-				if(mask->e == 64 && ((uvlong)p->from.offset>>32) != 0)
    1.21-					o1 |= 1<<22;
    1.22-			}else{
    1.23-				u = (uvlong)p->from.offset >> 32;
    1.24-				if(u != 0 && u != 0xFFFFFFFF)
    1.25-					diag("mask needs 64 bits %#llux\n%P", p->from.offset, p);
    1.26-			}
    1.27-		}else
    1.28-			diag("invalid mask %#llux\n%P", p->from.offset, p);	/* probably shouldn't happen */
    1.29+			mask = findmask(p->from.offset | p->from.offset<<32);
    1.30+		if(mask == nil)
    1.31+			diag("invalid mask %#llux\n%P", p->from.offset, p);
    1.32+		switch(mask->e){
    1.33+		case  2: o1 |= 0xF000; break;
    1.34+		case  4: o1 |= 0xE000; break;
    1.35+		case  8: o1 |= 0xC000; break;
    1.36+		case 16: o1 |= 0x8000; break;
    1.37+		case 64: o1 |= ((o1&S64)!=0)<<22; break;
    1.38+		}
    1.39+		o1 |= (mask->r<<16) | ((mask->s-1)<<10);
    1.40 		o1 |= (r<<5) | rt;
    1.41 		break;
    1.42 
    1.43@@ -1591,7 +1588,7 @@ oaddi(long o1, long v, int r, int rt)
    1.44 }
    1.45 
    1.46 /*
    1.47- * load a a literal value into dr
    1.48+ * load a literal value into dr
    1.49  */
    1.50 static long
    1.51 omovlit(int as, Prog *p, Adr *a, int dr)