qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH 12/15] Hexagon (target/hexagon) bit reverse (brev) addressing


From: Richard Henderson
Subject: Re: [PATCH 12/15] Hexagon (target/hexagon) bit reverse (brev) addressing
Date: Thu, 25 Mar 2021 10:38:10 -0600
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1

On 3/24/21 8:50 PM, Taylor Simpson wrote:
+static inline void gen_fbrev(TCGv result, TCGv src)
+{
+    /*
+     *  Bit reverse the low 16 bits of the address
+     */
+    TCGv tmp = tcg_temp_new();
+    tcg_gen_andi_tl(result, src, 0xffff0000);
+    for (int i = 0; i < 16; i++) {
+        tcg_gen_extract_tl(tmp, src, i, 1);
+        tcg_gen_deposit_tl(result, result, tmp, 15 - i, 1);
+    }
+    tcg_temp_free(tmp);
+}

This is very sub-optimal. Coordinate with rev.ng, who added this as well. But even there my suggestion was

uint32_t helper_fbrev(uint32_t x)
{
    return deposit32(x, 0, 16, revbit16(x));
}

because this operation is fairly large in tcg ops.


r~



reply via email to

[Prev in Thread] Current Thread [Next in Thread]