From 7b6eb743caafb5bc6846d2d47c3040025a961460 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Wed, 22 Jun 2022 14:21:42 +0100 Subject: [PATCH] found the 3 modes sof sif sbf including masked variants which was easier than expected, whew --- openpower/sv/bmask.py | 5 ++++- openpower/sv/sif.py | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/openpower/sv/bmask.py b/openpower/sv/bmask.py index 4b431837c..2d91aee55 100644 --- a/openpower/sv/bmask.py +++ b/openpower/sv/bmask.py @@ -1,6 +1,7 @@ def bmask(mode, RA, RB=None, zero=False): RT = RA if RB is not None and not zero else 0 mask = RB if RB is not None else 0xffffffffffffffff + RA = RA & mask a1 = RA if mode&1 else ~RA mode2 = (mode >> 1) & 0b11 if mode2 == 0: @@ -22,7 +23,9 @@ def bmask(mode, RA, RB=None, zero=False): RT = a1 ^ a2 return RT & mask -SBF = 0b001110 +SBF = 0b01010 +SOF = 0b01001 +SIF = 0b10000 # 10011 also works no idea why yet if __name__ == '__main__': for SBF in range(32): diff --git a/openpower/sv/sif.py b/openpower/sv/sif.py index 46f6b4504..0b9898203 100644 --- a/openpower/sv/sif.py +++ b/openpower/sv/sif.py @@ -27,7 +27,7 @@ if __name__ == '__main__': RT = sif(v3) print(bin(v3), bin(v2), bin(RT)) v3 = 0b10010101 # vmsif.m v2, v3 - v2 = 0b00000000 # v2 + v2 = 0b00000001 # v2 RT = sif(v3) print(bin(v3), bin(v2), bin(RT)) v3 = 0b00000000 # vmsif.m v2, v3 -- 2.30.2