qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH v1 4/5] target-ppc: add vector bit permute doubl


From: Richard Henderson
Subject: Re: [Qemu-devel] [PATCH v1 4/5] target-ppc: add vector bit permute doubleword instruction
Date: Thu, 4 Aug 2016 22:19:31 +0530
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.1

On 08/04/2016 06:33 PM, Rajalakshmi Srinivasaraghavan wrote:
+    uint64_t perm = 0;

Move the variable inside the loop.

+    VECTOR_FOR_INORDER_I(i, u64) {
+        perm = 0;
+        VECTOR_FOR_INORDER_I(j, u16) {

Surely this is more clearly written as

  for (j = 0; j < 8; ++j)

since u16 really has nothing to do with this.

+            int index = VBPERMQ_INDEX(b, (i * 8) + j);
+            if (index < 64) {
+                uint64_t mask = (1ull << (63 - (index & 0x3F)));
+                if (a->u64[VBPERMQ_DW(index)] & mask) {
+                    perm |= (0x80 >> j);
+                }
+            }
+            r->u64[i] = perm;
+        }
+    }

The final assignment of perm is done in the wrong loop.


r~



reply via email to

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