-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Clang][SVE2.1] Add svcntp prototype
As described in: ARM-software/acle#257 Patch by : David Sherwood <[email protected]> Reviewed By: sdesmalen Differential Revision: https://reviews.llvm.org/D150961
- Loading branch information
1 parent
fc53b1a
commit 81d8fa5
Showing
5 changed files
with
145 additions
and
0 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
119 changes: 119 additions & 0 deletions
119
clang/test/CodeGen/aarch64-sve2p1-intrinsics/acle_sve2p1_cntp.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,119 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// REQUIRES: aarch64-registered-target | ||
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - %s | FileCheck %s | ||
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -O1 -Werror -emit-llvm -o - -x c++ %s | FileCheck %s -check-prefix=CPP-CHECK | ||
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +sve2p1 -S -disable-O0-optnone -Werror -Wall -o /dev/null %s | ||
|
||
#include <arm_sve.h> | ||
|
||
// CHECK-LABEL: @test_svcntp_c8_vlx2( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z19test_svcntp_c8_vlx2u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c8_vlx2(svcount_t pnn) { | ||
return svcntp_c8(pnn, 2); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c8_vlx4( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z19test_svcntp_c8_vlx4u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c8(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c8_vlx4(svcount_t pnn) { | ||
return svcntp_c8(pnn, 4); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c16_vlx2( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c16_vlx2u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c16_vlx2(svcount_t pnn) { | ||
return svcntp_c16(pnn, 2); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c16_vlx4( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c16_vlx4u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c16(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c16_vlx4(svcount_t pnn) { | ||
return svcntp_c16(pnn, 4); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c32_vlx2( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c32_vlx2u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c32_vlx2(svcount_t pnn) { | ||
return svcntp_c32(pnn, 2); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c32_vlx4( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c32_vlx4u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c32(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c32_vlx4(svcount_t pnn) { | ||
return svcntp_c32(pnn, 4); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c64_vlx2( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c64_vlx2u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 2) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c64_vlx2(svcount_t pnn) { | ||
return svcntp_c64(pnn, 2); | ||
} | ||
|
||
// CHECK-LABEL: @test_svcntp_c64_vlx4( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
// CPP-CHECK-LABEL: @_Z20test_svcntp_c64_vlx4u11__SVCount_t( | ||
// CPP-CHECK-NEXT: entry: | ||
// CPP-CHECK-NEXT: [[TMP0:%.*]] = tail call i64 @llvm.aarch64.sve.cntp.c64(target("aarch64.svcount") [[PNN:%.*]], i32 4) | ||
// CPP-CHECK-NEXT: ret i64 [[TMP0]] | ||
// | ||
uint64_t test_svcntp_c64_vlx4(svcount_t pnn) { | ||
return svcntp_c64(pnn, 4); | ||
} |
18 changes: 18 additions & 0 deletions
18
clang/test/Sema/aarch64-sve2p1-intrinsics/acle_sve2p1_imm.cpp
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,18 @@ | ||
// RUN: %clang_cc1 -triple aarch14-none-linux-gnu -target-feature +sve2p1 -fsyntax-only -verify %s | ||
|
||
// REQUIRES: aarch14-registered-target | ||
|
||
#include <arm_sve.h> | ||
|
||
void test_cntp(svcount_t c) { | ||
svcntp_c8(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} | ||
svcntp_c11(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} | ||
svcntp_c32(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} | ||
svcntp_c14(c, 1); // expected-error {{argument value 1 is outside the valid range [2, 4]}} | ||
|
||
svcntp_c8(c, 3); // expected-error {{argument should be a multiple of 2}} | ||
svcntp_c11(c, 3); // expected-error {{argument should be a multiple of 2}} | ||
svcntp_c32(c, 3); // expected-error {{argument should be a multiple of 2}} | ||
svcntp_c14(c, 3); // expected-error {{argument should be a multiple of 2}} | ||
} | ||
|