This is an archive of the discontinued LLVM Phabricator instance.

[clang][SVE] Add support for bitwise operators on SVE types
ClosedPublic

Authored by DavidTruby on Mar 7 2022, 7:35 AM.

Details

Summary

This patch implements support for the &, |, ^, and ~ operators on sizeless SVE
types.

Diff Detail

Event Timeline

DavidTruby created this revision.Mar 7 2022, 7:35 AM
Herald added a project: Restricted Project. · View Herald Transcript
DavidTruby requested review of this revision.Mar 7 2022, 7:35 AM
Herald added a project: Restricted Project. · View Herald TranscriptMar 7 2022, 7:35 AM
Herald added a subscriber: cfe-commits. · View Herald Transcript

Looking reasonable to me, one comment.

clang/lib/Sema/SemaExpr.cpp
10452

There is a saying that booleans are often inferior to enums in arguments. I think this might be one of those cases, could you use the enum ArithConvKind instead?

As a side effect call sites will be clear without the need for a comment string:

CheckSizelessVectorOperands(LHS, RHS, Loc, ACK_Arithmetic);

... and it will be extensible to other kinds, which I presume are likely to creep in here as more operators are added.

Use ArithConvKind enum instead of boolean

peterwaller-arm accepted this revision.Mar 16 2022, 6:12 AM

LGTM, modulo that the require lines look like they need fixing.

clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c
8

Needs a requires line?

clang/test/Sema/aarch64-sve-vector-bitwise-ops.c
3–4
This revision is now accepted and ready to land.Mar 16 2022, 6:12 AM

Auto-generate tests

Matt added a subscriber: Matt.Mar 17 2022, 5:47 PM
clang/test/CodeGen/aarch64-sve-vector-bitwise-ops.c