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

Hao Liu Hao.Liu at arm.com
Wed Aug 14 09:47:27 PDT 2013


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





More information about the llvm-commits mailing list