File: aarch64-fp8-cast.c

package info (click to toggle)
llvm-toolchain-21 1%3A21.1.6-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 2,245,028 kB
  • sloc: cpp: 7,619,726; ansic: 1,434,018; asm: 1,058,748; python: 252,740; f90: 94,671; objc: 70,685; lisp: 42,813; pascal: 18,401; sh: 8,601; ml: 5,111; perl: 4,720; makefile: 3,675; awk: 3,523; javascript: 2,409; xml: 892; fortran: 770
file content (104 lines) | stat: -rw-r--r-- 4,640 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
// RUN: %clang_cc1 -triple aarch64-none-linux-gnu -target-feature +neon -verify -emit-llvm -o - %s

// REQUIRES: aarch64-registered-target

#include <arm_neon.h>

// Bitcast between FP8 Neon vectors
mfloat8x8_t err_test_f8_f8(mfloat8x16_t x) {
    return (mfloat8x8_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}}
}

mfloat8x16_t err_testq_f8_f8(mfloat8x8_t x) {
    return (mfloat8x16_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}}
}

// Bitcast between FP8 and int8 Neon vectors
mfloat8x8_t err_test_f8_s8(int8x16_t x) {
    return (mfloat8x8_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'int8x16_t' (vector of 16 'int8_t' values) of different size}}
}

int8x8_t err_test_s8_f8(mfloat8x16_t x) {
    return (int8x8_t) x;
// expected-error@-1 {{invalid conversion between vector type 'int8x8_t' (vector of 8 'int8_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}}
}

mfloat8x16_t err_testq_f8_s8(int8x8_t x) {
    return (mfloat8x16_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'int8x8_t' (vector of 8 'int8_t' values) of different size}}
}

int8x16_t err_testq_s8_f8(mfloat8x8_t x) {
    return (int8x16_t) x;
// expected-error@-1 {{invalid conversion between vector type 'int8x16_t' (vector of 16 'int8_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}}
}

// Bitcast between FP8 and float32 Neon vectors
mfloat8x8_t err_test_f8_f32(float32x4_t x) {
    return (mfloat8x8_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and 'float32x4_t' (vector of 4 'float32_t' values) of different size}}
}

float32x2_t err_test_f32_f8(mfloat8x16_t x) {
    return (float32x2_t) x;
// expected-error@-1 {{invalid conversion between vector type 'float32x2_t' (vector of 2 'float32_t' values) and 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) of different size}}
}

mfloat8x16_t err_testq_f8_f32(float32x2_t x) {
    return (mfloat8x16_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x16_t' (vector of 16 'mfloat8_t' values) and 'float32x2_t' (vector of 2 'float32_t' values) of different size}}
}

float32x4_t err_testq_f32_f8(mfloat8x8_t x) {
    return (float32x4_t) x;
// expected-error@-1 {{invalid conversion between vector type 'float32x4_t' (vector of 4 'float32_t' values) and 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) of different size}}
}

// Bitcast between FP8 and poly128_t (which is integral)
mfloat8x8_t err_testq_f8_p128(poly128_t x) {
    return (mfloat8x8_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and integer type 'poly128_t' (aka 'unsigned __int128') of different size}}
}

poly128_t err_testq_p128_f8(mfloat8x8_t x) {
    return (poly128_t) x;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and integer type 'poly128_t' (aka 'unsigned __int128') of different size}}
}

// Bitcast between FP8 and a non-integral type
mfloat8x8_t err_test_f8_ptr(void *p) {
    return (mfloat8x8_t) p;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'void *'}}
}

void *err_test_ptr_f8(mfloat8x8_t v) {
    return (void *) v;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'void *'}}
}

mfloat8x8_t err_test_f8_dbl(double v) {
    return (mfloat8x8_t) v;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'double'}}
}

double err_test_dbl_f8(mfloat8x8_t v) {
    return (double) v;
// expected-error@-1 {{invalid conversion between vector type 'mfloat8x8_t' (vector of 8 'mfloat8_t' values) and scalar type 'double'}}
}

struct S {
    char ch[16];
};

mfloat8x16_t err_test_f8_agg(struct S s) {
    return (mfloat8x16_t) s;
// expected-error@-1 {{operand of type 'struct S' where arithmetic or pointer type is required}}
}

struct S err_test_agg_f8(mfloat8x16_t v) {
    return (struct S) v;
// expected-error@-1 {{used type 'struct S' where arithmetic or pointer type is required}}
}