This is an archive of the discontinued LLVM Phabricator instance.

[llvm][ARM][Neon][big-endian] Fix incorrect indexing of lanes
AbandonedPublic

Authored by amilendra on Aug 15 2023, 7:32 AM.

Details

Summary

Fixes #19762 (https://bugs.llvm.org/show_bug.cgi?id=1976)

vrev64.32 reverses the order of 32-bit elements in each doubleword.
This results in the ith lane in the operand register ending up in the
jth lane of the destination register as follows.

i=0 -> j=1
i=1 -> j=0
i=2 -> j=3
i=3 -> j=2

Take this into consideration in ARM Neon Big-Endian code generation.

Diff Detail

Event Timeline

amilendra created this revision.Aug 15 2023, 7:32 AM
amilendra requested review of this revision.Aug 15 2023, 7:32 AM
Herald added a project: Restricted Project. · View Herald TranscriptAug 15 2023, 7:32 AM
olista01 requested changes to this revision.Aug 15 2023, 8:22 AM
olista01 added a subscriber: olista01.

I don't think this is the right way to fix this. Endianness shouldn't affect the ordering of lanes in registers, only when they are stored to memory. We've got some documentation on this at https://llvm.org/docs/BigEndianNEON.html.

If this is the right place to fix this, this patch only changes DSubReg_i32_reg, why do the rest not need to be modified too?

This revision now requires changes to proceed.Aug 15 2023, 8:22 AM
amilendra abandoned this revision.Sep 5 2023, 2:32 AM

Abandoning this revision because I don't think I will be working on this anytime soon.