From 9aab9652c10056418f1093356369d506e8eefd2c Mon Sep 17 00:00:00 2001 From: lkcl Date: Wed, 23 Jun 2021 11:11:35 +0100 Subject: [PATCH] --- openpower/sv/ldst.mdwn | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/openpower/sv/ldst.mdwn b/openpower/sv/ldst.mdwn index a196961ea..5994fc46d 100644 --- a/openpower/sv/ldst.mdwn +++ b/openpower/sv/ldst.mdwn @@ -87,6 +87,14 @@ with the pseudocode below, the immediate can be used to give unit stride or elem if (RAupdate.isvec) u++; if (RT.isvec) j++; + # reverses the bitorder up to "width" bits + def bitrev(val, width): + result = 0 + for _ in range(width): + result = (result << 1) | (val & 1) + val >>= 1 + return result + Indexed LD is: # format: ldop RT, RA, RB -- 2.30.2