From c2dc1e184e7eda2b52873ea16d29e80ccefcc7ab Mon Sep 17 00:00:00 2001 From: David Given Date: Mon, 17 Sep 2018 13:13:39 +0100 Subject: [PATCH] rotate() now generates valid code. --- mach/proto/mcg/treebuilder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mach/proto/mcg/treebuilder.c b/mach/proto/mcg/treebuilder.c index ac811fc14..5f9eebf86 100644 --- a/mach/proto/mcg/treebuilder.c +++ b/mach/proto/mcg/treebuilder.c @@ -717,6 +717,10 @@ static void rotate(int opcode, int size, int irop, int irop_reverse) struct ir* left = pop(size); struct ir* bits = new_wordir(8 * size); + /* Fix left and right so we can refer to them multiple times. */ + appendir(right); + appendir(left); + /* a rol b -> (a << b) | (a >> (32 - b)) */ push( new_ir2(