-
Notifications
You must be signed in to change notification settings - Fork 11.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[SveEmitter] Add SVE tuple types and builtins for svundef.
This patch adds new SVE types to Clang that describe tuples of SVE vectors. For example `svint32x2_t` which maps to the twice-as-wide vector `<vscale x 8 x i32>`. Similarly, `svint32x3_t` will map to `<vscale x 12 x i32>`. It also adds builtins to return an `undef` vector for a given SVE type. Reviewers: c-rhodes, david-arm, ctetreau, efriedma, rengolin Reviewed By: c-rhodes Tags: #clang Differential Revision: https://reviews.llvm.org/D81459
- Loading branch information
1 parent
ca2dcbd
commit 91a4a59
Showing
10 changed files
with
499 additions
and
39 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
80 changes: 80 additions & 0 deletions
80
clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_undef.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O1 -Werror -Wall -emit-llvm -o - %s | FileCheck %s | ||
|
||
#include <arm_sve.h> | ||
|
||
svint8_t test_svundef_s8() | ||
{ | ||
// CHECK-LABEL: test_svundef_s8 | ||
// CHECK: ret <vscale x 16 x i8> undef | ||
return svundef_s8(); | ||
} | ||
|
||
svint16_t test_svundef_s16() | ||
{ | ||
// CHECK-LABEL: test_svundef_s16 | ||
// CHECK: ret <vscale x 8 x i16> undef | ||
return svundef_s16(); | ||
} | ||
|
||
svint32_t test_svundef_s32() | ||
{ | ||
// CHECK-LABEL: test_svundef_s32 | ||
// CHECK: ret <vscale x 4 x i32> undef | ||
return svundef_s32(); | ||
} | ||
|
||
svint64_t test_svundef_s64() | ||
{ | ||
// CHECK-LABEL: test_svundef_s64 | ||
// CHECK: ret <vscale x 2 x i64> undef | ||
return svundef_s64(); | ||
} | ||
|
||
svuint8_t test_svundef_u8() | ||
{ | ||
// CHECK-LABEL: test_svundef_u8 | ||
// CHECK: ret <vscale x 16 x i8> undef | ||
return svundef_u8(); | ||
} | ||
|
||
svuint16_t test_svundef_u16() | ||
{ | ||
// CHECK-LABEL: test_svundef_u16 | ||
// CHECK: ret <vscale x 8 x i16> undef | ||
return svundef_u16(); | ||
} | ||
|
||
svuint32_t test_svundef_u32() | ||
{ | ||
// CHECK-LABEL: test_svundef_u32 | ||
// CHECK: ret <vscale x 4 x i32> undef | ||
return svundef_u32(); | ||
} | ||
|
||
svuint64_t test_svundef_u64() | ||
{ | ||
// CHECK-LABEL: test_svundef_u64 | ||
// CHECK: ret <vscale x 2 x i64> undef | ||
return svundef_u64(); | ||
} | ||
|
||
svfloat16_t test_svundef_f16() | ||
{ | ||
// CHECK-LABEL: test_svundef_f16 | ||
// CHECK: ret <vscale x 8 x half> undef | ||
return svundef_f16(); | ||
} | ||
|
||
svfloat32_t test_svundef_f32() | ||
{ | ||
// CHECK-LABEL: test_svundef_f32 | ||
// CHECK: ret <vscale x 4 x float> undef | ||
return svundef_f32(); | ||
} | ||
|
||
svfloat64_t test_svundef_f64() | ||
{ | ||
// CHECK-LABEL: test_svundef_f64 | ||
// CHECK: ret <vscale x 2 x double> undef | ||
return svundef_f64(); | ||
} |
80 changes: 80 additions & 0 deletions
80
clang/test/CodeGen/aarch64-sve-intrinsics/acle_sve_undef2.c
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
// RUN: %clang_cc1 -D__ARM_FEATURE_SVE -triple aarch64-none-linux-gnu -target-feature +sve -fallow-half-arguments-and-returns -S -O2 -Werror -Wall -emit-llvm -o - %s | FileCheck %s | ||
|
||
#include <arm_sve.h> | ||
|
||
svint8x2_t test_svundef2_s8() | ||
{ | ||
// CHECK-LABEL: test_svundef2_s8 | ||
// CHECK: ret <vscale x 32 x i8> undef | ||
return svundef2_s8(); | ||
} | ||
|
||
svint16x2_t test_svundef2_s16() | ||
{ | ||
// CHECK-LABEL: test_svundef2_s16 | ||
// CHECK: ret <vscale x 16 x i16> undef | ||
return svundef2_s16(); | ||
} | ||
|
||
svint32x2_t test_svundef2_s32() | ||
{ | ||
// CHECK-LABEL: test_svundef2_s32 | ||
// CHECK: ret <vscale x 8 x i32> undef | ||
return svundef2_s32(); | ||
} | ||
|
||
svint64x2_t test_svundef2_s64() | ||
{ | ||
// CHECK-LABEL: test_svundef2_s64 | ||
// CHECK: ret <vscale x 4 x i64> undef | ||
return svundef2_s64(); | ||
} | ||
|
||
svuint8x2_t test_svundef2_u8() | ||
{ | ||
// CHECK-LABEL: test_svundef2_u8 | ||
// CHECK: ret <vscale x 32 x i8> undef | ||
return svundef2_u8(); | ||
} | ||
|
||
svuint16x2_t test_svundef2_u16() | ||
{ | ||
// CHECK-LABEL: test_svundef2_u16 | ||
// CHECK: ret <vscale x 16 x i16> undef | ||
return svundef2_u16(); | ||
} | ||
|
||
svuint32x2_t test_svundef2_u32() | ||
{ | ||
// CHECK-LABEL: test_svundef2_u32 | ||
// CHECK: ret <vscale x 8 x i32> undef | ||
return svundef2_u32(); | ||
} | ||
|
||
svuint64x2_t test_svundef2_u64() | ||
{ | ||
// CHECK-LABEL: test_svundef2_u64 | ||
// CHECK: ret <vscale x 4 x i64> undef | ||
return svundef2_u64(); | ||
} | ||
|
||
svfloat16x2_t test_svundef2_f16() | ||
{ | ||
// CHECK-LABEL: test_svundef2_f16 | ||
// CHECK: ret <vscale x 16 x half> undef | ||
return svundef2_f16(); | ||
} | ||
|
||
svfloat32x2_t test_svundef2_f32() | ||
{ | ||
// CHECK-LABEL: test_svundef2_f32 | ||
// CHECK: ret <vscale x 8 x float> undef | ||
return svundef2_f32(); | ||
} | ||
|
||
svfloat64x2_t test_svundef2_f64() | ||
{ | ||
// CHECK-LABEL: test_svundef2_f64 | ||
// CHECK: ret <vscale x 4 x double> undef | ||
return svundef2_f64(); | ||
} |
Oops, something went wrong.