add undef()
[soc.git] / src / soc / decoder / helpers.py
index 41ab2c789c337c8075a01985adcc1ffb6ce2fdba..b1d8b87f3298e8cf9366d5cf914bc454716cbd09 100644 (file)
@@ -129,6 +129,13 @@ def le(a, b):
 def length(a):
     return len(a)
 
+
+def undef(v):
+    """ function that, for Power spec purposes, returns undefined bits of
+        the same shape as the input bits, however, for purposes of matching
+        POWER9's behavior returns the input bits unchanged."""
+    return v
+
 # For these tests I tried to find power instructions that would let me
 # isolate each of these helper operations. So for instance, when I was
 # testing the MASK() function, I chose rlwinm and rldicl because if I