shithub: riscv

Download patch

ref: aac6784fce5f1814150ea501c24f1fefce1fce12
parent: 848c477af947ac66168aedba423f224238649684
parent: f5f9ecdcfa0b27f5971509137d77a5155b4b507d
author: cinap_lenrek <[email protected]>
date: Tue Mar 17 12:13:25 EDT 2015

merge

--- a/sys/src/cmd/6c/peep.c
+++ b/sys/src/cmd/6c/peep.c
@@ -100,14 +100,27 @@
 		case AMOVQ:
 		case AMOVSS:
 		case AMOVSD:
-			if(regtyp(&p->to))
+			if(!regtyp(&p->to))
+				break;
 			if(regtyp(&p->from)) {
 				if(copyprop(r)) {
 					excise(r);
 					t++;
-				} else
+					break;
+				}
 				if(subprop(r) && copyprop(r)) {
 					excise(r);
+					t++;
+					break;
+				}
+			}
+			if(p->as != AMOVL)
+				break;
+			r1 = rnops(uniqs(r));
+			if(r1 != R){
+				p1 = r1->prog;
+				if(p1->as == AMOVLQZX && p1->from.type == p->to.type && p1->to.type == p->to.type){
+					excise(r1);
 					t++;
 				}
 			}