[PATCH]Clang and AArch64 backend patches to support sshll/ushll instructions

Hao Liu Hao.Liu at arm.com
Wed Aug 14 10:41:03 PDT 2013


Hi Tim,

I just misunderstood your meaning in the last email.
I think you mean by using ISD::SHL and  NEON_DUPIMM. So I Have modified the
patch for llvm (now it is version 3 in attachement, the patch for clang is
still the same).

Thanks,
-Hao

-----Original Message-----
From: llvm-commits-bounces at cs.uiuc.edu
[mailto:llvm-commits-bounces at cs.uiuc.edu] On Behalf Of Hao Liu
Sent: Wednesday, August 14, 2013 5:47 PM
To: Tim Northover
Cc: Jiangning Liu; llvm-commits
Subject: RE: [PATCH]Clang and AArch64 backend patches to support sshll/ushll
instructions

Hi Tim,

I'm just confused about the reusable duplicate node.

I think shift left, signed shift right and unsigned shift right are
different, so there are ISD::SHL, ISD::SRA and ISD::SRL operations. As a
result, we need at least 3 different NEON_SHLIMM, NEON_USHRIMM and
NEON_SSHRIMM to distinguish the differences.
You mean to use an operation like NEON_DUPimm, but I don't know how to
distinguish whether it shifts left or right. Do you mean I can use the
combination of ISD::SHL and NEON_DUPimm? But ISD::SHL require two vectors
and no immediate value.  Could you please give me an example to explain how
to use it?

Thanks,
-Hao

-----Original Message-----
From: Tim Northover [mailto:t.p.northover at gmail.com]
Sent: Wednesday, August 14, 2013 5:15 PM
To: Hao Liu
Cc: llvm-commits; Ana Pazos; Jiangning Liu
Subject: Re: [PATCH]Clang and AArch64 backend patches to support sshll/ushll
instructions

Hi Hao,

Looking very nice! Thanks for working on those changes, they were rather
substantial.

> (1)  Use IR (sext/zext, shufflevector and shl) to implement the ACLE 
> functions. As I also use shift left by immediate instruction, I also add
support for the shl instruction.

I think one minor change would make this more generic. Instead of creating
NEON_SHLIMM, couldn't you create a normal ISD::SHL operation where the
right-hand side is (say) (NEON_DUP imm)? Then when we get around to
implementing things like USHR we can just reuse that duplicate node instead
of adding more NEON_SHRIMM nodes.

> As I haven't find a better way to implement this, I don't modify this code
yet.

Ok, I think I'm happy with that for now.

Other than that, just one minor nit:

+  if (! BVN || ! BVN->isConstantSplat(SplatBits, SplatUndef, 
+ SplatBitSize,

I don't think we normally put a space between '!' and its operand.
There are some other places with this too.

Cheers.

Tim.


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


_______________________________________________
llvm-commits mailing list
llvm-commits at cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: llvm-AArch64Neon-shiftleft-shiftLong-movLong-v3.patch
Type: application/octet-stream
Size: 28705 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130814/dab1da04/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: clang-AArch64Neon-shiftleft-shiftLong-movLong-v2.patch
Type: application/octet-stream
Size: 11692 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20130814/dab1da04/attachment-0001.obj>


More information about the llvm-commits mailing list