[PATCH] ARM: Implement big endian bit-conversion for NEON types

James Molloy James.Molloy at arm.com
Mon May 12 05:26:10 PDT 2014


Hi Christian,

I've taken a closer look, and it looks like this should actually Just Work (tm).

It turns out all vector types are explicitly bitcast to v2f64 in ARMCallingConv.td:

  // Handle all vector types as either f64 or v2f64.
  CCIfType<[v1i64, v2i32, v4i16, v8i8, v2f32], CCBitConvertToType<f64>>,
  CCIfType<[v2i64, v4i32, v8i16, v16i8, v4f32], CCBitConvertToType<v2f64>>,

  CCIfType<[v2f64], CCAssignToReg<[Q0, Q1, Q2, Q3]>>,


I'm not sure why it was decided to implement that way (happened in r73095, or approximately the stone age, when Anton landed initial hard float support).

V2f64 is also coincidentally exactly the right type for proper parameter passing on Big Endian, and so yes, this should just work for hardfloat.

I'll re-review the rest of your patch now.

Cheers,

James

> -----Original Message-----
> From: Christian Pirker [mailto:cpirker at a-bix.com]
> Sent: 12 May 2014 09:52
> To: cpirker at a-bix.com; James Molloy
> Cc: kanheim at a-bix.com; Amara Emerson; llvm-commits at cs.uiuc.edu
> Subject: Re: [PATCH] ARM: Implement big endian bit-conversion for NEON
> types
>
> Hi James,
>
> I checked the following testcase:
>
>   llc -march armeb -mtriple=arm-eabi -mattr v7,neon -float-abi=hard
>
> with:
>
>   define void @test( <4 x i32> %var, <4 x i32>* %store ) {
>     store <4 x i32> %var, <4 x i32>* %store
>     ret void
>   }
>
> The generated code is as follows (both for le and be):
>
>   vst1.64 {d0, d1}, [r0:128]
>   bx lr
>
> I believe that is ABI compliant. please let me know if you think otherwise.
>
> Thanks,
> Christian
>
> http://reviews.llvm.org/D3651
>
>


-- 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




More information about the llvm-commits mailing list