[all-commits] [llvm/llvm-project] 23a96b: [AArch64][SVE] Support implicit lax vector convers...

Joe Ellis via All-commits all-commits at lists.llvm.org
Tue Nov 17 06:50:43 PST 2020


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 23a96b84a8d985b686a4e06dec1f7aebc0cca6c6
      https://github.com/llvm/llvm-project/commit/23a96b84a8d985b686a4e06dec1f7aebc0cca6c6
  Author: Joe Ellis <joe.ellis at arm.com>
  Date:   2020-11-17 (Tue, 17 Nov 2020)

  Changed paths:
    M clang/include/clang/AST/ASTContext.h
    M clang/lib/AST/ASTContext.cpp
    M clang/lib/Sema/SemaExpr.cpp
    M clang/lib/Sema/SemaOverload.cpp
    A clang/test/Sema/aarch64-sve-lax-vector-conversions.c
    M clang/test/Sema/attr-arm-sve-vector-bits.c
    A clang/test/SemaCXX/aarch64-sve-lax-vector-conversions.cpp

  Log Message:
  -----------
  [AArch64][SVE] Support implicit lax vector conversions for SVE types

Lax vector conversions was behaving incorrectly for implicit casts
between scalable and fixed-length vector types. For example, this:

    #include <arm_sve.h>

    #define N __ARM_FEATURE_SVE_BITS
    #define FIXED_ATTR __attribute__((arm_sve_vector_bits(N)))

    typedef svfloat32_t fixed_float32_t FIXED_ATTR;

    void allowed_depending() {
      fixed_float32_t fs32;
      svfloat64_t s64;

      fs32 = s64;
    }

... would fail because the vectors have differing lane sizes. This patch
implements the correct behaviour for
-flax-vector-conversions={none,all,integer}. Specifically:

- -flax-vector-conversions=none prevents all lax vector conversions
  between scalable and fixed-sized vectors.
- -flax-vector-conversions=integer allows lax vector conversions between
  scalable and fixed-size vectors whose element types are integers.
- -flax-vector-conversions=all allows all lax vector conversions between
  scalable and fixed-size vectors (including those with floating point
  element types).

The implicit conversions are implemented as bitcasts.

Reviewed By: fpetrogalli

Differential Revision: https://reviews.llvm.org/D91067




More information about the All-commits mailing list