This is an archive of the discontinued LLVM Phabricator instance.

AArch64: Implement big endian bit-conversion for NEON types
Needs ReviewPublic

Authored by cpirker on Apr 18 2014, 7:14 AM.
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

Hi All,

This is the first patch (others to follow) based on Tim Northovers suggestion (see D3305, Tim's comment from April 13, 2014: item 2) to allow correct conversion between integer and vector data in big endian mode (data format differs wrt. endian mode).
It's an alternative approach to D2884 and enables llvm utilizing both LDR/STR and LDn/STn instructions in big endian mode.
The patch covers the conversion between floating point and vector types, and the function argument passing of vector types providing compatibility to the ARM ABI.
Big endian bit-conversions are implemented using REV64 and EXT instructions.
In addition this patch is a substitute for D3306.

Thanks,
Christian

Diff Detail

Event Timeline

cpirker updated this object.Apr 23 2014, 7:16 AM

Hi Christian,

I'm confused about this patch.

  1. You're testing 64-bit vector-to-scalar (and vice versa), but not 64-bit vector-to-vector. In fact, you've modified the vector-to-vector patterns for 128bit but not for 64-bit.
  2. You're not predicating all the patterns I think you should be. For example: "def : Pat<(v4i32 (bitconvert (v8i16 VPR128:$src))), (v4i32 VPR128:$src)>;". This is a 32-bit to 16-bit vector conversion, so surely requires a pair of REVs. The only exceptions to this should be: a) Identity conversions, which are vNfX <-> vNiX b) Single-lane-to-scalar; v1fX <-> fX | v1iX <-> iX c) Multi-lane-to-scalar; vNfX <-> f(X*N). These require predicating, but only require one REV not two.

Do you think I'm mistaken here? I did "switch off" for half the review thread and am still playing catchup.

Cheers,

James

Hi James,

the patch implements and tests both 64 and 128 vector-to-scalar (and vice versa).
I don't see any meaningful usage of vector-to-vector conversion using rev instructions.
Would you be able to provide a use case?

Thanks,
Christian

cpirker added a subscriber: Konrad.Apr 24 2014, 7:33 AM

Hi Christian,

But your patch *does* implement vector-to-vector conversions. Just for 128-bit vectors. Line 6600 to line 6634.

A vector-to-vector bitcast can exist in IR. Use cases for that aren't important - it's allowed and should be handled.

Cheers,

James

-----Original Message-----
From: Christian Pirker [mailto:cpirker@a-bix.com]
Sent: 24 April 2014 15:32
To: cpirker@a-bix.com
Cc: James Molloy; Amara Emerson; llvm-commits@cs.uiuc.edu
Subject: Re: [PATCH] AArch64: Implement big endian bit-conversion for
NEON types

Hi James,

the patch implements and tests both 64 and 128 vector-to-scalar (and vice
versa).
I don't see any meaningful usage of vector-to-vector conversion using rev
instructions.
Would you be able to provide a use case?

Thanks,
Christian

http://reviews.llvm.org/D3424

  • IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately and do not disclose the contents to any other person, use it for any purpose, or store or copy the information in any medium. Thank you.

ARM Limited, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2557590
ARM Holdings plc, Registered office 110 Fulbourn Road, Cambridge CB1 9NJ, Registered in England & Wales, Company No: 2548782

Hi James,

LLVM converts 128 bit vector types into 2x64 bit types (and vice versa) for the sake of function argument passing.
That's the reason behind these bit conversions.
I don't see any benefit in handling other types of vector conversions.

Thanks,
Christian

cpirker updated this revision to Diff 9073.May 5 2014, 7:05 AM

Hi all,

updated test file "CodeGen/AArch64/unaligned-vector-ld1-st1.ll" to comply with this patch.

Thanks,
Christian