From: Luke Kenneth Casson Leighton Date: Mon, 19 Jul 2021 13:46:25 +0000 (+0100) Subject: no need for len(j) > 1 test, half of 1 is zero which stops swap anyway X-Git-Tag: xlen-bcd~258 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a0c38e64cd71d724e38b588e76a100885bca2662;p=openpower-isa.git no need for len(j) > 1 test, half of 1 is zero which stops swap anyway --- diff --git a/src/openpower/decoder/isa/fastdctlee.py b/src/openpower/decoder/isa/fastdctlee.py index 15e3923c..d6647ac1 100644 --- a/src/openpower/decoder/isa/fastdctlee.py +++ b/src/openpower/decoder/isa/fastdctlee.py @@ -173,13 +173,12 @@ def transform2(vec): # actually: swap the *indices*... not the actual data. # incredibly... bizarrely... this works *without* having # to do anything else. - if len(j) > 1: - hz2 = halfsize // 2 - for ci, (jl, jh) in enumerate(zip(j[:hz2], jr[:hz2])): - tmp = ri[jl+halfsize] - ri[jl+halfsize] = ri[jh] - ri[jh] = tmp - print (" swap", size, i, ri[jl+halfsize], ri[jh]) + hz2 = halfsize // 2 # can be zero which stops reversing 1-item lists + for ci, (jl, jh) in enumerate(zip(j[:hz2], jr[:hz2])): + tmp = ri[jl+halfsize] + ri[jl+halfsize] = ri[jh] + ri[jh] = tmp + print (" swap", size, i, ri[jl+halfsize], ri[jh]) size //= 2 print("post-swapped", ri)