From 192b29274208dec8b4d421532128a351a62849f1 Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Thu, 23 Jun 2022 02:25:42 +0100 Subject: [PATCH] shorten demo --- openpower/sv/bmask.py | 24 ++++++++---------------- 1 file changed, 8 insertions(+), 16 deletions(-) diff --git a/openpower/sv/bmask.py b/openpower/sv/bmask.py index c59fc5efa..29b8c9ad3 100644 --- a/openpower/sv/bmask.py +++ b/openpower/sv/bmask.py @@ -3,25 +3,17 @@ def bmask(mode, RA, RB=None, zero=False): ra = RA & mask a1 = ra if mode&1 else ~ra mode2 = (mode >> 1) & 0b11 - if mode2 == 0: - a2 = -ra - if mode2 == 1: - a2 = ra-1 - if mode2 == 2: - a2 = ra+1 - if mode2 == 3: - a2 = ~(ra+1) + if mode2 == 0: a2 = -ra + if mode2 == 1: a2 = ra-1 + if mode2 == 2: a2 = ra+1 + if mode2 == 3: a2 = ~(ra+1) a1 = a1 & mask a2 = a2 & mask mode3 = (mode >> 3) & 0b11 - if mode3 == 0: - RT = a1 | a2 - if mode3 == 1: - RT = a1 & a2 - if mode3 == 2: - RT = a1 ^ a2 - if mode3 == 3: - RT = 0 # UNDEFINED + if mode3 == 0: RT = a1 | a2 + if mode3 == 1: RT = a1 & a2 + if mode3 == 2: RT = a1 ^ a2 + if mode3 == 3: RT = 0 # UNDEFINED RT &= mask if not zero: RT |= RA & ~mask -- 2.30.2