Page MenuHomePhabricator

[clang,ARM] Default to -fno-lax-vector-conversions in ARM v8.1-M.

Authored by simon_tatham on Wed, Sep 4, 5:48 AM.



The ACLE intrinsics for the MVE instruction set have polymorphic
variants: you can write vaddq(v,w) and have it automatically select
vaddq_s32, vaddq_u8, vaddq_f16, ... according to the types of the
vector variables v and w.

In order to implement this using attribute((overloadable)), I need
to turn on strict type-checking between the different vector types, or
else clang will believe that any vector type matches _all_ of those
function prototypes, and won't be able to select the right one.

Also, I think this makes sense for MVE anyway, on error-checking
grounds. For NEON, where every intrinsic in C source explicitly
describes the operation it's performing, you could argue that the
distinct vector types aren't essential; but in a context where getting
the wrong type can cause silent generation of the _wrong_ code, I
think it's better to warn users as soon as possible if they've written
code that isn't using vector types consistently.

So this commit introduces a (minimal) piece of infrastructure to allow
the default for OPT_flax_vector_conversions to vary based on the
target triple, and uses it to set the default specially for
ARMSubArch_v8_1m_mainline (in which the only possible vector
architecture will be MVE).

Event Timeline

simon_tatham created this revision.Wed, Sep 4, 5:48 AM
ostannard requested changes to this revision.Wed, Sep 4, 6:37 AM


This revision now requires changes to proceed.Wed, Sep 4, 6:37 AM

Added a test.

This revision is now accepted and ready to land.Wed, Sep 11, 6:27 AM

FYI: rL371817, in case it changes what is done here.