Displaying 20 results from an estimated 37 matches for "__vector_size__".
2008 Jul 29
2
[LLVMdev] Vector types as function arguments and interfacing with C
...<2 x double> %b) nounwind {
%c = add <2 x double> %a, %b
ret <2 x double> %c
}
and then call it from C code. What is the appropriate translation of
the <2 x double> vector type into C? I've tried packed structs and
"typedef double vec_double __attribute__ ((__vector_size__ (16)))" but
in both cases, it seems that GCC passes these in as pointers rather
than in registers.
Brendan Younger
2011 Jun 30
1
[LLVMdev] sparse typedef int v8qi __attribute__ ((mode(V8QI))) warning
...as clang only produces...
libpbm3.c:120:38: error: unknown machine mode 'V8QI'
typedef int v8qi __attribute__ ((mode(V8QI)));
^
libpbm3.c:129:36: error: passing 'v8qi' (aka 'int') to parameter of incompatible type '__attribute__((__vector_size__(8 * sizeof(char)))) char'
__builtin_ia32_pcmpeqb(*(v8qi*) (&bitrow[col]), *(v8qi*) &zero64);
^~~~~~~~~~~~~~~~~~~~~~~
libpbm3.c:131:37: error: passing 'const v8qi' (aka 'const int') to parameter of incompatible type '__at...
2008 Jul 29
1
[LLVMdev] Vector types as function arguments and interfacing with C
...x double> %a, %b
>> ret <2 x double> %c
>> }
>>
>> and then call it from C code. What is the appropriate translation of
>> the <2 x double> vector type into C? I've tried packed structs and
>> "typedef double vec_double __attribute__ ((__vector_size__ (16)))"
>> but
>> in both cases, it seems that GCC passes these in as pointers rather
>> than in registers.
>
> try reading about the gcc vector extensions in the "C Extensions"
> chapter
> of the gcc docs.
I have tried GCC's vector extensions,...
2008 Jul 29
0
[LLVMdev] Vector types as function arguments and interfacing with C
...gt; %c = add <2 x double> %a, %b
> ret <2 x double> %c
> }
>
> and then call it from C code. What is the appropriate translation of
> the <2 x double> vector type into C? I've tried packed structs and
> "typedef double vec_double __attribute__ ((__vector_size__ (16)))" but
> in both cases, it seems that GCC passes these in as pointers rather
> than in registers.
try reading about the gcc vector extensions in the "C Extensions" chapter
of the gcc docs.
Ciao,
Duncan.
2008 Oct 14
2
[LLVMdev] Making GEP into vector illegal?
...a slightly more elaborate
> workaround with a union, though.
Hum what's your take on this then:
/* The Intel API is flexible enough that we must allow aliasing with
other
vector types, and their scalar components. */
/* APPLE LOCAL 4505813 */
typedef long long __m64 __attribute__ ((__vector_size__ (8),
__may_alias__));
:-)
2020 Aug 31
2
Should llvm optimize 1.0 / x ?
Hi,
Here is a small C++ program:
vec.cc:
#include <cmath>
using v4f32 = float __attribute__((__vector_size__(16)));
v4f32 fct1(v4f32 x)
{
return 1.0 / x;
}
v4f32 fct2(v4f32 x)
{
return __builtin_ia32_rcpps(x);
}
Which is compiled to:
vec.o: file format elf64-x86-64
Disassembly of section .text:
0000000000000000 <_Z4fct1Dv4_f>:
0: c4 e2 79 18 0d 00 00 vbroadcastss 0x0(%rip),%xmm1...
2008 Oct 15
0
[LLVMdev] Making GEP into vector illegal?
...karound with a union, though.
>
> Hum what's your take on this then:
>
> /* The Intel API is flexible enough that we must allow aliasing with
> other
> vector types, and their scalar components. */
> /* APPLE LOCAL 4505813 */
> typedef long long __m64 __attribute__ ((__vector_size__ (8),
> __may_alias__));
This is actually completely different AFAIK, this allows things like:
((float*)&myvec4)[2]
which is exactly what the proposal wants to continue supporting in the
IR.
-Chris
2014 Sep 30
2
[LLVMdev] size_t?
....0\include\x86intrin.h:29:
1> In file included from C:\Program Files
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
1>C:\Program Files
(x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40):
error : cannot initialize a parameter of type
'__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of 2
'int' values) with an rvalue of type '__v2si' (aka 'int')
1> return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
1> ^~~~~~~~~~~
I suspect that these might be caused by the same thin...
2009 Jul 25
2
[LLVMdev] GCC DejaGNU regressions
The GCC DejaGNU testsuite has discovered some regressions. Here's
one; this was reduced from testsuite/gcc.apple/4656532.c:
typedef long long __m64 __attribute__ ((__vector_size__ (8),
__may_alias__));
static __inline __m64 __attribute__((__always_inline__, __nodebug__))
_mm_slli_si64 (__m64 __m, int __count) {
}
__m64 x, y;
void t1(int n) {
y = _mm_slli_si64(x, n);
}
Compiled with LLVM-GCC (v76963) on Darwin/x86, this generates an ICE
in the GCC/LLVM conversion la...
2011 Nov 23
4
[LLVMdev] arm neon intrinsics cross compile error on windows system
...or element type 'uint32_t' (aka 'unsigned long')
typedef __attribute__((neon_vector_type(4))) uint32_t uint32x4_t;
^
d:/llvm_projects/llvm-3.0rc4/bin/../lib/clang/3.0/include\arm_neon.h:355:10:
error: invalid conversion between vector type
'__attribute__((__vector_size__(16 * sizeof(signed char)))) signed char'
and integer type 'int32x4_t' (aka 'long') of different size
return (int32x4_t)__builtin_neon_vmovl_v((int8x8_t)__a, 18); }
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
d:/llvm_projects/llvm-3.0rc4/bin/../lib/clang/3.0/i...
2020 Sep 01
2
Should llvm optimize 1.0 / x ?
...On Aug 31, 2020, at 2:21 PM, Alexandre Bique via llvm-dev <llvm-dev at lists.llvm.org> wrote:
> >
> > Hi,
> >
> > Here is a small C++ program:
> >
> > vec.cc:
> >
> > #include <cmath>
> >
> > using v4f32 = float __attribute__((__vector_size__(16)));
> >
> > v4f32 fct1(v4f32 x)
> > {
> > return 1.0 / x;
> > }
> >
> > v4f32 fct2(v4f32 x)
> > {
> > return __builtin_ia32_rcpps(x);
> > }
> >
> > Which is compiled to:
> >
> > vec.o: file format elf64-x86...
2008 Oct 15
3
[LLVMdev] Making GEP into vector illegal?
...gt;>
>> Hum what's your take on this then:
>>
>> /* The Intel API is flexible enough that we must allow aliasing with
>> other
>> vector types, and their scalar components. */
>> /* APPLE LOCAL 4505813 */
>> typedef long long __m64 __attribute__ ((__vector_size__ (8),
>> __may_alias__));
>
> This is actually completely different AFAIK,
That statement was that:
> float4 a;
> float* ptr_z = (float*)(&a) + 3;
``violates strict aliasing``
That assertion is wrong. The docs says:
@item may_alias
Accesses to objects with types with this...
2014 Sep 30
2
[LLVMdev] size_t?
...included from C:\Program Files
> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
> 1>C:\Program Files
> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40):
> error : cannot initialize a parameter of type
> '__attribute__((__vector_size__(2 * sizeof(int)))) int' (vector of
> 2 'int' values) with an rvalue of type '__v2si' (aka 'int')
> 1> return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
> 1> ^~~~~~~~~~~
>
> I suspect that these might be caused by the same thing...
2014 Oct 01
2
[LLVMdev] size_t?
...In file included from C:\Program Files
>> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
>> 1>C:\Program Files
>> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40): error
>> : cannot initialize a parameter of type '__attribute__((__vector_size__(2 *
>> sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type
>> '__v2si' (aka 'int')
>> 1> return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
>> 1> ^~~~~~~~~~~
>>
>> I...
2020 Sep 01
2
Vector evolution?
Hi,
Please consider the following loop:
using v4f32 = float __attribute__((__vector_size__(16)));
void fct6(v4f32 *x)
{
#pragma clang loop vectorize(enable)
for (int i = 0; i < 256; ++i)
x[i] = 7 * x[i];
}
After compiling it with:
clang++ -O3 -march=native -mtune=native \
-Rpass=loop-vectorize,slp-vectorize
-Rpass-missed=loop-vectorize,slp-vectorize
-Rpass-analysis=loop-vecto...
2008 Oct 14
0
[LLVMdev] Making GEP into vector illegal?
On Tue, Oct 14, 2008 at 1:34 PM, Daniel M Gessel <gessel at apple.com> wrote:
> In Joe programmer language (i.e. C ;) ), are we basically talking
> about disallowing:
>
> float4 a;
> float* ptr_z = &a.z;
>
> ?
That's my reading as well; the argument for not allowing it is just to
make optimization easier. We don't allow addressing individual bits
either,
2018 Apr 24
0
Help: How to define vector element type bool (v8i1) in C builtin function
...est.c:4:36: error: vector size not an integral multiple of component size
typedef bool v8i1 __attribute__ ((vector_size(1)));
^ ~
intrinstest.c:9:57: error: passing 'v8i1' (aka 'int') to parameter of incompatible type '__attribute__((__vector_size__(8 * sizeof(_Bool)))) _Bool' (vector of 8 '_Bool' values)
v4i32_r1 = __builtin_dongxin_add_32(v4i32_r2,v4i32_r2,vm_1);
I searched online ,bool is sizeof 1 byte,and Bool size is also bigger than 1bit. Is there a way I can define a variable which type is v8i1 .
Thanks
YuLiu
l...
2020 Aug 31
2
Vectorization of math function failed?
Hi,
After reading https://llvm.org/docs/Vectorizers.html#vectorization-of-function-calls
I decided to write the following C++ program:
#include <cmath>
using v4f32 = float __attribute__((__vector_size__(16)));
v4f32 fct1(v4f32 x)
{
v4f32 y;
y[0] = std::sin(x[0]);
y[1] = std::sin(x[1]);
y[2] = std::sin(x[2]);
y[3] = std::sin(x[3]);
return y;
}
v4f32 fct2(v4f32 x)
{
v4f32 y;
for (int i = 0; i < 4; ++i)
y[i] = std::sin(x[i]);
return y;
}
void fct3(float *x)
{
#pragma clang...
2014 Oct 01
2
[LLVMdev] size_t?
...ed from C:\Program Files
>>> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\immintrin.h:28:
>>> 1>C:\Program Files
>>> (x86)\LLVM\msbuild-bin\..\lib\clang\3.6.0\include\mmintrin.h(52,40): error
>>> : cannot initialize a parameter of type '__attribute__((__vector_size__(2 *
>>> sizeof(int)))) int' (vector of 2 'int' values) with an rvalue of type
>>> '__v2si' (aka 'int')
>>> 1> return __builtin_ia32_vec_ext_v2si((__v2si)__m, 0);
>>> 1> ^~~~~~~~~~~
>...
2020 Aug 14
6
Intel AMX programming model discussion.
...ming model.
1. Data type.
We'd like to have fixed vector type for AMX. Since the shape to AMX register can be configurable, the vector size is the maximum size of AMX register. That means the vector size is 1024 bytes.
The C code may look like this.
typedef int _tile_data __attribute__((__vector_size__(1024), __aligned__(64)));
_tile_data tile;
And the LLVM IR may look like this.
@tile = dso_local local_unnamed_addr global <256 x i32> zeroinitializer, align 64
For llvm IR, it is nice to have a new type x86_amxtile that can be mapped to AMX registers.
2. AMX Intrinsics.
The internal i...