llvm-project/clang/test/CodeGen/SystemZ/builtins-systemz-zvector3-error.c
Ulrich Weigand 8424bf207e [SystemZ] Add support for new cpu architecture - arch15
This patch adds support for the next-generation arch15
CPU architecture to the SystemZ backend.

This includes:
- Basic support for the new processor and its features.
- Detection of arch15 as host processor.
- Assembler/disassembler support for new instructions.
- Exploitation of new instructions for code generation.
- New vector (signed|unsigned|bool) __int128 data types.
- New LLVM intrinsics for certain new instructions.
- Support for low-level builtins mapped to new LLVM intrinsics.
- New high-level intrinsics in vecintrin.h.
- Indicate support by defining  __VEC__ == 10305.

Note: No currently available Z system supports the arch15
architecture.  Once new systems become available, the
official system name will be added as supported -march name.
2025-01-20 19:30:21 +01:00

163 lines
11 KiB
C

// REQUIRES: systemz-registered-target
// RUN: %clang_cc1 -target-cpu z15 -triple s390x-linux-gnu \
// RUN: -fzvector -flax-vector-conversions=none \
// RUN: -Wall -Wno-unused -Werror -fsyntax-only -verify %s
#include <vecintrin.h>
volatile vector signed char vsc;
volatile vector signed short vss;
volatile vector signed int vsi;
volatile vector signed long long vsl;
volatile vector signed __int128 vslll;
volatile vector unsigned char vuc;
volatile vector unsigned short vus;
volatile vector unsigned int vui;
volatile vector unsigned long long vul;
volatile vector unsigned __int128 vulll;
volatile vector bool char vbc;
volatile vector bool short vbs;
volatile vector bool int vbi;
volatile vector bool long long vbl;
volatile vector float vf;
volatile vector double vd;
volatile signed char sc;
volatile signed short ss;
volatile signed int si;
volatile signed long long sl;
volatile unsigned char uc;
volatile unsigned short us;
volatile unsigned int ui;
volatile unsigned long long ul;
volatile float f;
volatile double d;
const void * volatile cptr;
const signed char * volatile cptrsc;
const signed short * volatile cptrss;
const signed int * volatile cptrsi;
const signed long long * volatile cptrsl;
const unsigned char * volatile cptruc;
const unsigned short * volatile cptrus;
const unsigned int * volatile cptrui;
const unsigned long long * volatile cptrul;
const float * volatile cptrf;
const double * volatile cptrd;
void * volatile ptr;
signed char * volatile ptrsc;
signed short * volatile ptrss;
signed int * volatile ptrsi;
signed long long * volatile ptrsl;
unsigned char * volatile ptruc;
unsigned short * volatile ptrus;
unsigned int * volatile ptrui;
unsigned long long * volatile ptrul;
float * volatile ptrf;
double * volatile ptrd;
volatile unsigned int len;
volatile int idx;
int cc;
void test_integer(void) {
vsc = vec_sldb(vsc, vsc, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vuc = vec_sldb(vuc, vuc, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vss = vec_sldb(vss, vss, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vus = vec_sldb(vus, vus, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vsi = vec_sldb(vsi, vsi, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vui = vec_sldb(vui, vui, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vsl = vec_sldb(vsl, vsl, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vul = vec_sldb(vul, vul, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vslll = vec_sldb(vslll, vslll, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vulll = vec_sldb(vulll, vulll, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vf = vec_sldb(vf, vf, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vd = vec_sldb(vd, vd, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsld' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vsc = vec_srdb(vsc, vsc, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vuc = vec_srdb(vuc, vuc, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vss = vec_srdb(vss, vss, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vus = vec_srdb(vus, vus, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vsi = vec_srdb(vsi, vsi, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vui = vec_srdb(vui, vui, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vsl = vec_srdb(vsl, vsl, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vul = vec_srdb(vul, vul, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vslll = vec_srdb(vslll, vslll, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vulll = vec_srdb(vulll, vulll, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vf = vec_srdb(vf, vf, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
vd = vec_srdb(vd, vd, idx); // expected-error {{no matching function}} \
// expected-error {{argument to '__builtin_s390_vsrd' must be a constant integer}}
// expected-note@vecintrin.h:* 11 {{candidate function not viable}}
// expected-note@vecintrin.h:* 1 {{must be a constant integer from 0 to 7}}
}