From 0c2419c7f36129d268f83baf8fead20a1bab5d5e Mon Sep 17 00:00:00 2001 From: Luke Kenneth Casson Leighton Date: Mon, 5 Feb 2024 21:12:04 +0000 Subject: [PATCH] bug 1034: add crbinlog unit test --- src/openpower/test/bitmanip/bitmanip_cases.py | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) diff --git a/src/openpower/test/bitmanip/bitmanip_cases.py b/src/openpower/test/bitmanip/bitmanip_cases.py index 2e79931f..93476025 100644 --- a/src/openpower/test/bitmanip/bitmanip_cases.py +++ b/src/openpower/test/bitmanip/bitmanip_cases.py @@ -18,6 +18,20 @@ def bmatflip(ra): return result +def crbinlog(bt, ba, bfb): + lut = bfb + expected = 0 + checks = (ba, bt) # LUT positions 1<<0=ba 1<<1=bt + lut_index = 0 + for j, check in enumerate(checks): + if check & 1: + lut_index |= 1<