From 460b19aaf4b1ba1f605a032c266488a20b9fdb84 Mon Sep 17 00:00:00 2001 From: Themis Demetriades Date: Thu, 6 Jun 2024 13:19:36 +0100 Subject: [PATCH] Fix ROR shift logic --- src/execute.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/execute.c b/src/execute.c index fc436af..7ad18da 100644 --- a/src/execute.c +++ b/src/execute.c @@ -225,7 +225,7 @@ static void executeDPRegister(Machine *state, a64inst_instruction *inst) { if (arithmLogicData->type != a64inst_DPR_LOGIC) { fprintf(stderr, "Attempting to perform ROR shift on non-logic register data processing instruction!\n"); } - src2Val = truncateValue(src2Val >> shiftAmount | src2Val << (getMSBPos(regType) - shiftAmount), regType); + src2Val = truncateValue(src2Val >> shiftAmount | src2Val << (getMSBPos(regType) - shiftAmount + 1), regType); break; default: