shithub: riscv

Download patch

ref: 9e926eeb4e3c716bcbd11377c131061cd06900ef
parent: a5d8cd30bb126b301cd79393540be63558dcfe89
author: cinap_lenrek <[email protected]>
date: Sat Sep 3 15:05:28 EDT 2016

5c: do shift propagation for rotate right (ROR)

--- a/sys/src/cmd/5c/peep.c
+++ b/sys/src/cmd/5c/peep.c
@@ -45,7 +45,7 @@
 	t = 0;
 	for(r=firstr; r!=R; r=r->link) {
 		p = r->prog;
-		if(p->as == ASLL || p->as == ASRL || p->as == ASRA) {
+		if(p->as == ASLL || p->as == ASRL || p->as == ASRA || p->as == AROR) {
 			/*
 			 * elide shift into D_SHIFT operand of subsequent instruction
 			 */
@@ -668,6 +668,9 @@
 		break;
 	case ASRA:
 		o |= 2<<5;
+		break;
+	case AROR:
+		o |= 3<<5;
 		break;
 	}
 	p2->from.offset = o;