[PATCH] AArch64 Neon Scalar Integer Compare Instructions

mcrosier at codeaurora.org mcrosier at codeaurora.org
Thu Oct 10 11:25:19 PDT 2013


> Isn't this just an int_aarch64_neon_vceq with the second argument a
> constant 0? Possibly modelled as a NEON_VDUP for selection?

Hi Tim,
I've reworked the patch so that the implicit zero is added in
CGBuiltins.cpp, but I can't seem to get the immediate zero to match
properly.  Perhaps, you or someone else could point me in the right
direction?

Patches are attached.

The immediate zero is an AArch64ISD::NEON_MOVIMM node.  The mismatched
part of the DAG looks as follows when dumped from gdb:
----------------------------------------------------------------------
    0x5724dd0: i32 = TargetConstant<0>
    0x5722580: i32 = Constant<14>
  0x5722680: v8i8 = AArch64ISD::NEON_MOVIMM 0x5724dd0, 0x5722580 [ORD=2]
0x5722880: v1i64 = bitcast 0x5722680 [ORD=2]
----------------------------------------------------------------------

My incorrect pattern is as follows:
----------------------------------------------------------------------
class NeonI_Scalar2SameMisc_cmpz_D_size<bit u, bits<5> opcode, string asmop>
  : NeonI_Scalar2SameMisc<u, 0b11, opcode,
                         (outs FPR64:$Rd), (ins FPR64:$Rn, neon_uimm0:$Imm),
                         !strconcat(asmop, " $Rd, $Rn, $Imm"),
                         [],
                         NoItinerary>;

class Neon_Scalar2SameMisc_cmpz_D_size_patterns<SDPatternOperator opnode,
                                                Instruction INSTD>
  : Pat<(v1i64 (opnode (v1i64 VPR64:$Rn), (v1i64 0))),
        (INSTD VPR64:$Rn, 0)>;
----------------------------------------------------------------------

I tried this pattern, but it was mostly a shot in the dark:

  : Pat<(v1i64 (opnode (v1i64 VPR64:$Rn), (v1i64 (bitconvert (v8i8
(Neon_movi (i32 0), (i32 timm)))))))

Any assistance would be greatly appreciated.

 Thanks,
  Chad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-neon-scalar-compare-llvm.patch
Type: text/x-patch
Size: 27068 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131010/bb3a88e8/attachment.bin>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 001-neon-scalar-compare-clang.patch
Type: text/x-patch
Size: 9347 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20131010/bb3a88e8/attachment-0001.bin>


More information about the llvm-commits mailing list