1
0

tilelink2 Atomics: optimize the sign-extension circuit

This commit is contained in:
Wesley W. Terpstra
2016-09-22 15:13:35 -07:00
parent 9f1f6fc61f
commit a3e88fa13a
2 changed files with 17 additions and 13 deletions

View File

@ -13,7 +13,7 @@ package object tilelink2
def highOR(x: UInt) = {
val w = x.getWidth
def helper(s: Int, x: UInt): UInt =
if (s >= w) x else helper(s+s, x | x << s)
if (s >= w) x else helper(s+s, x | (x << s)(w-1,0))
helper(1, x)
}