This is an archive of the discontinued LLVM Phabricator instance.

[SVE][Inline-Asm] Add constraints for SVE ACLE types
ClosedPublic

Authored by kmclaughlin on Mar 5 2020, 9:07 AM.

Details

Summary

Adds the constraints described below to ensure that we
can tie variables of SVE ACLE types to operands in inline-asm:

  • y: SVE registers Z0-Z7
  • Upl: One of the low eight SVE predicate registers (P0-P7)
  • Upa: Full range of SVE predicate registers (P0-P15)

Diff Detail

Event Timeline

kmclaughlin created this revision.Mar 5 2020, 9:07 AM
Herald added a project: Restricted Project. · View Herald Transcript
efriedma added inline comments.Mar 5 2020, 10:09 AM
clang/lib/Basic/Targets/AArch64.h
95

Is "@3" some LLVM thing? I don't think I've seen it before.

clang/test/CodeGen/aarch64-sve-inline-asm-datatypes.c
3

REQUIRES: aarch64-registered-target is necessary for any test that isn't using -emit-llvm.

Generally, I'd prefer tests using -emit-llvm so we can independently verify that the IR is what we expect, vs. the backend processing the IR the way we expect.

  • Added -emit-llvm to the RUN line of aarch64-sve-inline-asm-datatypes.c test. Added some more tests here for the Upl & y constraints and removed aarch64-sve-inline-asm-vec-low.c.
  • Addressed formatting suggestions on previous patch.
kmclaughlin marked 2 inline comments as done.Mar 9 2020, 7:36 AM

Thanks for reviewing this, @efriedma!

clang/lib/Basic/Targets/AArch64.h
95

The "@" is used to indicate that this is a multi-letter constraint of a given length. This is parsed later by InlineAsm.cpp, see https://reviews.llvm.org/D66524

clang/test/CodeGen/aarch64-sve-inline-asm-datatypes.c
3

I've added -emit-llvm here and updated the CHECK lines accordingly

miyuki added a subscriber: miyuki.Mar 9 2020, 10:36 AM
This revision is now accepted and ready to land.Mar 11 2020, 6:51 PM
This revision was automatically updated to reflect the committed changes.