jtony marked 6 inline comments as done.
jtony added inline comments.

================
Comment at: lib/CodeGen/CGBuiltin.cpp:8433
+    if (getTarget().isLittleEndian()) {
+      switch (Index) {
+      case 0:
----------------
nemanjai wrote:
> The switch is overkill. You should just implement this in an obvious way 
> (i.e. the same way as described in the ISA).
> For big endian:
> `ElemIdx0 = (Index & 2;) >> 1`
> `ElemIdx1 = 2 + (Index & 1)`
> 
> For little endian:
> `ElemIdx0 = (~Index & 1) + 2;`
> `ElemIdx1 = ~Index & 2 >> 1;`
> 
> (of course, please verify the expressions).
Good call, fixed as suggested.


https://reviews.llvm.org/D33053



_______________________________________________
cfe-commits mailing list
cfe-commits@lists.llvm.org
http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to