search for: vector_size

Displaying 20 results from an estimated 44 matches for "vector_size".

Did you mean: sector_size
2009 Oct 09
3
[LLVMdev] Help with gcc SSE intrinsics
...cbe_r1146__BITCAST_TEMPORARY.Int64 = 4ull, llvm_cbe_r1146__BITCAST_TEMPORARY .Double))); llvm_cbe_r1148 = __builtin_ia32_movddup(llvm_cbe_r1147); prog.linked.c:10393: error: incompatible types when assigning to type 'double __vector__' from type 'int' double __attribute__((vector_size(16 ))) llvm_cbe_r1147; double __attribute__((vector_size(16 ))) llvm_cbe_r1148; Any ideas what gcc is complaining about? I'm running gcc with -msse3. -Dave
2019 Oct 17
2
Static assert fails when compiler for i386
Hi Devs, Consider below testcase. $cat test.cpp #include <vector> #include<type_traits> typedef int _int4 __attribute__((vector_size(16))); typedef union{ int data[4]; struct {int x, y, z, w;}; _int4 vec; } int4; typedef int4 int3; int main() { static_assert(std::alignment_of<int4>::value <= alignof(max_align_t), "over aligned!"); } $clang++ -m32 error: static_assert failed due to requirement 'std::alignm...
2018 Apr 24
0
Help: How to define vector element type bool (v8i1) in C builtin function
...C builtin function hello everyone,I have defined intrinsic function like this: def int_mips_add_32 : GCCBuiltin<"__builtin_dongxin_add_32">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,llvm_v8i1_ty]>; Then I write a test code : typedef int v4i32 __attribute__ ((vector_size(16))); typedef bool v8i1 __attribute__ ((vector_size(1))); void foo() { v4i32 v4i32_r1,v4i32_r2,v4i32_r3; v8i1 vm_1; v4i32_r1 = __builtin_dongxin_add_32(v4i32_r2,v4i32_r2,vm_1); } but when I compile : clang -cc1 -triple mipsel-unknown-linux-gnu -emit-llvm intrinstest.c -o test...
2007 Jul 11
1
[LLVMdev] New LLVM C front-end: "clang"
...fter "#include <...> search starts here:"). Once this is built, you can compile C code (amazing, I know!). The clang driver takes a lot of GCC compatible options, which you can see with 'clang --help'. As a simple example: $ cat ~/t.c typedef float V __attribute__((vector_size(16))); V foo(V a, V b) { return a+b*a; } Preprocessing: $ clang ~/t.c -E # 1 "/Users/sabre/t.c" 1 typedef float V __attribute__((vector_size(16))); V foo(V a, V b) { return a+b*a; } Type checking: $ clang -fsyntax-only ~/t.c GCC options: $ clang -fsyntax-only ~/t.c -pedantic /User...
2016 Jan 28
2
Vectors in Sparc
...39;d love to work out what I need to do to resolve this. I'm currently not making much headway into it. I'm going to try to simplify this to the core problem I can see and hope I haven't missed anything relevant. The original code I have is as follows: typedef char vec8 __attribute__((vector_size(4))); extern vec8 foo1_8(void); extern vec8 foo2_8(void); vec8 fun8(void) { return foo1_8 () & foo2_8 (); } On x86, this compiles into this IR: ; Function Attrs: nounwind uwtable define i32 @fun8() #0 !dbg !4 { %1 = tail call i32 @foo1_8() #2, !dbg !23 %2 = tail call i32 @foo2_8() #2,...
2017 Sep 10
2
Question about quad-register
Hi All, If the target supports quad-register R0:R1:R2:R3 (Rn is 32-bit register), is it possible mapping quad-register to v4i32 so that the following example work? typedef int v4si __attribute__ ((vector_size (16))); void foo(v4si i) { v4si j = i; } I don't know how to write CallingConv.td to represent the concept of occupying quad-register R0:R1:R2:R3 once seeing v4i32. Any example that I can refer to? Thanks. Regards, chenwj -- Wei-Ren Chen (陳韋任) Homepage: https://people.cs.nct...
2018 Apr 22
0
Subject: How to define vector element type bool in builtin function
...n builtin function hello everyone,I have defined intrinsic function like this: def int_mips_add_32 : GCCBuiltin<"__builtin_dongxin_add_32">, Intrinsic<[llvm_v4i32_ty], [llvm_v4i32_ty, llvm_v4i32_ty,llvm_v8i1_ty]>; Then I write a test code : typedef int v4i32 __attribute__ ((vector_size(16))); typedef bool v8i1 __attribute__ ((vector_size(1))); void foo() { v4i32 v4i32_r1,v4i32_r2,v4i32_r3; v8i1 vm_1; v4i32_r1 = __builtin_dongxin_add_32(v4i32_r2,v4i32_r2,vm_1); } but when I compile : clang -cc1 -triple mipsel-unknown-linux-gnu -emit-llvm intrinstest.c -o test...
2016 Feb 01
2
Question about store with unaligned memory address
...; >> Thanks for response. >> >> The method is working almost of test cases which use load and store >> instructions connected with chain. There is other situation. Let's >> look at a example as follows: >> >> typedef unsigned short int UV __attribute__((vector_size (8))); >> >> void test (UV *x, UV *y) { >> *x = *y / ((UV) { 4, 4, 4, 4 }); >> } >> >> The target does not support vector type so CodeGen tries to split and >> scalarize vector to legalize type. While legalizing vector type, the >> stores of each v...
2016 Jan 29
5
Question about store with unaligned memory address
Hi Krzysztof, Thanks for response. The method is working almost of test cases which use load and store instructions connected with chain. There is other situation. Let's look at a example as follows: typedef unsigned short int UV __attribute__((vector_size (8))); void test (UV *x, UV *y) { *x = *y / ((UV) { 4, 4, 4, 4 }); } The target does not support vector type so CodeGen tries to split and scalarize vector to legalize type. While legalizing vector type, the stores of each vector elements nodes are generated from 'DAGTypeLegalizer::SplitVe...
2009 Oct 09
0
[LLVMdev] Help with gcc SSE intrinsics
...cbe_r1147); I don't see __builtin_ia32_movddup defined anywhere in the llvm-gcc sources. That's probably it. > prog.linked.c:10393: error: incompatible types when assigning to > type 'double > __vector__' > from type 'int' > > double __attribute__((vector_size(16 ))) llvm_cbe_r1147; > double __attribute__((vector_size(16 ))) llvm_cbe_r1148; > > Any ideas what gcc is complaining about? I'm running gcc with -msse3. > > -Dave > _______________________________________________ > LLVM Developers mailing li...
2011 Jun 30
1
[LLVMdev] sparse typedef int v8qi __attribute__ ((mode(V8QI))) warning
...ang seems to provide poor error messages compared to llvm-gcc. For llvm-gcc, we get the very helpful warning... libpbm3.c: In function 'packBitsWithMmxSse': libpbm3.c:120: warning: specifying vector types with __attribute__ ((mode)) is deprecated libpbm3.c:120: warning: use __attribute__ ((vector_size)) instead whereas 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 ...
2012 Feb 14
1
[LLVMdev] question on scalarization
...larized, as is done, e.g., for the Mips backend. However, I cannot find a way to force the instruction selector or type legalizer to scalarize the vectors (i.e., vector types and vector ops). Can anyone help me out? The code I am trying to compile is as follows: typedef short v2sw __attribute__ ((vector_size (8))); int main(int argc, char ** argv) { v2sw a = {1,2,3,4}; v2sw b = {5,6,7,8}; v2sw c = a; int i; for (i=0;i<argc;i++) c += b; printf("%d %d %d %d\n",c[0],c[1],c[2],c[3]); return 0; } When I compile this to bytecode with clang and then invoke llc with -march=...
2009 Sep 04
3
[LLVMdev] TOT opt does not terminate!
...O1 foo.c work fine. clang -O2 foo.c and clang -O3 foo.c do not terminate. (At least after 10 minutes) If I generate the bit code (clang-cc -emit-llvmbc) and then run: opt -O3 foo.bc it does not terminate. //foo.c int get_id(int); typedef short short2 __attribute__ ((vector_size (2))); union _X { short2 s; int i; }; typedef union _X X; inline short2 as_short2(int x) { X result; result.i = x; return result.s; } inline int as_int(short2 x) { X result; result.s = x; return result.i; } void short2_int_swap(...
2008 May 08
0
[LLVMdev] Vector code
Hi Anton, I assume that's the same as the online demo's "Show LLVM C++ API code" option (http://llvm.org/demo/)? I've tried that with a structure containing four floating-point components but it also appears to add them individually using extract/insert. Maybe I have to try an array of floats... Thanks, Anton -----Original Message----- From: llvmdev-bounces at
2019 Sep 27
2
Opportunity to split store of shuffled vector.
...ple? Sorry, I should provide a cross-platform version using vector extension of frontend :) `vector int` is a vector extension on PowerPC, which is enabled if you set target to PowerPC platforms. Example below should be successfully compiled in any platform: typedef float v4sf __attribute__ ((vector_size(16))); void foo(v4sf *a) { (*a)[0] = 1; (*a)[3] = 2; } And we can get the IR mentioned before: %0 = load <4 x float>, <4 x float>* %a, align 16 %vecins1 = shufflevector <4 x float> <float 1.000000e+00, float undef, float undef, float 2.000000e+00&...
2011 Apr 14
2
[LLVMdev] [x86 codegen] 3DNow! intrinsics not behaving as expected.
I finally got all of the 3DNow! instruction intrinsics and builtins into LLVM and Clang, however, while testing them, I've noticed that they produce incorrect results. For example: typedef float V2f __attribute__((vector_size(8))); int main() { V2f dest, a = {1.0, 3.0}, b = {10.0, 3.5}; dest = __builtin_ia32_pfadd(a, b); printf("(%f, %f)\n", dest[0], dest[1]); } Should output (11, 6.5). However, it outputs different values depending on the optimization level. Generally one of them is correct, and the o...
2008 May 08
2
[LLVMdev] Vector code
Nicolas, > Thanks for the advise, but I'm actually not trying to compile code from > text. For now I'm just trying to construct the function directly. Think of > it as the vector equivalent of the HowToUseJIT.cpp example. llvm2cpp is your friend then. It's now a separate 'target' in llc. It will generate C++ code, which will construct provided IR. -- With best
2010 Sep 21
3
[LLVMdev] Vectors in structures
...ucts aren't wrapped vectors; they wrap double or a pair of doubles, to get the size and alignment. Their only purpose is to be recognized by name by the front end and turned into a native register type. In gcc's arm_neon.h the user types aren't structs at all, they're defined using vector_size and the mangling is done as a special case. So I think there's no need to wrap these types in LLVM. Al -- IMPORTANT NOTICE: The contents of this email and any attachments are confidential and may also be privileged. If you are not the intended recipient, please notify the sender immediately...
2018 Dec 06
3
[RFC] Matrix support (take 2)
...padding after each column which is a total of 48 bytes. For option A, since it’s a new type we can just define this in the new ABI. >> >> For option B and C, on the other hand, vector alignment and padding is already mandated by the VectorType. This is part of the ABI when people use vector_size or ext_vector_type attributes on the clang side. >> >> Alignment and allocation size (including padding) is the original size of vector rounded up to the next power-of-2. So for example a 3 x 3 x float pad(1) or 12 x float is rounded up to 64 bytes. This is excessive. I also need to...
2016 Jan 30
0
Question about store with unaligned memory address
...ote: > Hi Krzysztof, > > Thanks for response. > > The method is working almost of test cases which use load and store > instructions connected with chain. There is other situation. Let's > look at a example as follows: > > typedef unsigned short int UV __attribute__((vector_size (8))); > > void test (UV *x, UV *y) { > *x = *y / ((UV) { 4, 4, 4, 4 }); > } > > The target does not support vector type so CodeGen tries to split and > scalarize vector to legalize type. While legalizing vector type, the > stores of each vector elements nodes are generat...