From 96b2b9a7e5d52f9beaafe14207f1589fdc358fca Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Tue, 25 Oct 2022 19:58:24 +0100 Subject: [PATCH] shadd pseudocode cleanup --- openpower/isa/bitmanip.mdwn | 27 ++++++++++----------------- 1 file changed, 10 insertions(+), 17 deletions(-) diff --git a/openpower/isa/bitmanip.mdwn b/openpower/isa/bitmanip.mdwn index 0863a5cb..93abde3c 100644 --- a/openpower/isa/bitmanip.mdwn +++ b/openpower/isa/bitmanip.mdwn @@ -109,15 +109,12 @@ Z23-Form Pseudo-code: + n <- (RB) switch (sm) - case (0): - sum[0:XLEN-1] <- (((RB)[0:XLEN-1-1] || [0]*1) + (RA)) - case (1): - sum[0:XLEN-1] <- (((RB)[0:XLEN-2-1] || [0]*2) + (RA)) - case (2): - sum[0:XLEN-1] <- (((RB)[0:XLEN-3-1] || [0]*3) + (RA)) - default: - sum[0:XLEN-1] <- (((RB)[0:XLEN-4-1] || [0]*4) + (RA)) + case (0): sum[0:XLEN-1] = (n[0:XLEN-1-1] || [0]*1) + (RA) + case (1): sum[0:XLEN-1] = (n[0:XLEN-2-1] || [0]*2) + (RA) + case (2): sum[0:XLEN-1] = (n[0:XLEN-3-1] || [0]*3) + (RA) + default: sum[0:XLEN-1] = (n[0:XLEN-4-1] || [0]*4) + (RA) RT <- sum Special Registers Altered: @@ -133,16 +130,12 @@ Z23-Form Pseudo-code: - n <- (([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1]) + n <- ([0]*(XLEN/2)) || (RB)[XLEN/2:XLEN-1] switch (sm) - case (0): - sum[0:XLEN-1] = ((n[0:XLEN-1-1] || [0]*1) + (RA)) - case (1): - sum[0:XLEN-1] = ((n[0:XLEN-2-1] || [0]*2) + (RA)) - case (2): - sum[0:XLEN-1] = ((n[0:XLEN-3-1] || [0]*3) + (RA)) - default: - sum[0:XLEN-1] = ((n[0:XLEN-4-1] || [0]*4) + (RA)) + case (0): sum[0:XLEN-1] = (n[0:XLEN-1-1] || [0]*1) + (RA) + case (1): sum[0:XLEN-1] = (n[0:XLEN-2-1] || [0]*2) + (RA) + case (2): sum[0:XLEN-1] = (n[0:XLEN-3-1] || [0]*3) + (RA) + default: sum[0:XLEN-1] = (n[0:XLEN-4-1] || [0]*4) + (RA) RT <- sum Special Registers Altered: -- 2.30.2