revert bitmask changes
[libreriscv.git] / openpower / sv / bitmanip.mdwn
index 3cfe2f6d881840514b72456980b461618db69503..468c5cca54674d3c1835776594b1016886a270ff 100644 (file)
@@ -284,19 +284,22 @@ def MASK(x, y):
 uint_xlen_t bmset(RS, RB, sh)
 {
     int shamt = RB & (XLEN - 1);
-    return RS | MASK(shamt, sh)
+    mask = (2<<sh)-1;
+    return RS | (mask << shamt);
 }
 
 uint_xlen_t bmclr(RS, RB, sh)
 {
     int shamt = RB & (XLEN - 1);
-    return RS & ~MASK(shamt, sh)
+    mask = (2<<sh)-1;
+    return RS & ~(mask << shamt);
 }
 
 uint_xlen_t bminv(RS, RB, sh)
 {
     int shamt = RB & (XLEN - 1);
-    return RS ^ MASK(shamt, sh)
+    mask = (2<<sh)-1;
+    return RS ^ (mask << shamt);
 }
 
 uint_xlen_t bmext(RS, RB, sh)