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

Tim Northover t.p.northover at gmail.com
Mon Aug 19 03:01:51 PDT 2013


Hi Hao,

> I  create a patch to reuse vshll_n and vget_high.
> As a result, there is no built-in
> __builtin_neon_vshll_high_n_v/__builtin_neon_vmovl_high_n_v and no need to
> handle them in CGBuiltin.cpp.

Thanks very much for taking a look at this. I just meant it as a vague
wish for the future, so seeing a patch was a very nice surprise!

I've just got one issue with the current patch:

+  case OpMovlHi:
+    s = TypeString(proto[1], typestr) + " a = __a;\n  " + s;

What's the purpose of this line? It looks like it just adds dead code
to the definition.

Longer term (and I don't expect you to do this now!), I'm not sure
this approach will scale though. It still seems to require special C++
code to handle each of the _high_ intrinsics; it just puts that code
in NeonEmitter rather than CGBuiltin.

It might be possible to do this with some kind of modified Inst that
just says "do that other one, but extract the high part of vectors
first".

The idea being you could write

def SHLL_HIGH_N : SLongInst<"vshlll_high_n", "ndi", "HcHsHiHUcHUsHUi",
"vshll_n">;

and it would automatically generate the correct delegation. The
difficulty will be doing that without making it too hacky.

Tim.



More information about the llvm-commits mailing list