Displaying 20 results from an estimated 29 matches for "ext_vector_type".
2013 Oct 02
2
[LLVMdev] [CLang] Comparing vector types - invalid error and proposed fix
I was investigating an error diagnostic in the following test example:
typedef signed char char16 __attribute__((ext_vector_type(16)));
void test( char16 srcA, char16 srcB, char16 *dst) {
*dst = ( srcA == srcB );
}
which produces the message:
mismatch.c:5:10: error: assigning to 'char16' from incompatible type
'char __attribute__((ext_vector_type(16)))'
*dst = ( srcA == srcB );
^ ~~~~~...
2017 Feb 17
2
Vector trunc code generation difference between llvm-3.9 and 4.0
Correction in the C snippet:
typedef signed short v8i16_t __attribute__((ext_vector_type(8)));
v8i16_t foo (v8i16_t a, int n)
{
return a >> n;
}
Best regards
Saurabh
On 17 February 2017 at 16:21, Saurabh Verma <saurabh.verma at movidius.com>
wrote:
> Hello,
>
> We are investigating a difference in code generation for vector splat
> instructions between...
2008 Jul 18
2
[LLVMdev] Alignment of vectors
Consider the following C code:
typedef __attribute__(( ext_vector_type(2) )) float float2;
typedef __attribute__(( ext_vector_type(2) )) __attribute__(( aligned(4) ))
float float2_align2;
void foo(void)
{
const float * p;
size_t offset;
float2 tmp = *((float2_align2 *)(p+offset));
}
When compiled with clang emit-llvm I get:
define void @foo() {
entry:
%p...
2012 Feb 28
1
[LLVMdev] How to vectorize a vector type cast?
Since Clang does not seem to allow type casts, such as uchar4 to float4, between vector types, it seems it is necessary to write them as element by element conversions, such as
typedef float float4 __attribute__((ext_vector_type(4)));
typedef unsigned char uchar4 __attribute__((ext_vector_type(4)));
float4 to_float4(uchar4 in)
{
float4 out = {in.x, in.y, in.z, in.w};
return out;
}
Running this code through "clang -c -emit-llvm" and then through "opt -O2 -S", produces the following IR:
define <...
2013 Oct 02
0
[LLVMdev] [CLang] Comparing vector types - invalid error and proposed fix
Hi Martin,
On Oct 2, 2013, at 6:25 AM, Martin O'Riordan <Martin.ORiordan at movidius.com> wrote:
> I was investigating an error diagnostic in the following test example:
>
> typedef signed char char16 __attribute__((ext_vector_type(16)));
>
> void test( char16 srcA, char16 srcB, char16 *dst) {
> *dst = ( srcA == srcB );
> }
>
> which produces the message:
>
> mismatch.c:5:10: error: assigning to 'char16' from incompatible type
> 'char __attribute__((ext_vector_type(16)))'
&g...
2017 Feb 18
2
Vector trunc code generation difference between llvm-3.9 and 4.0
...ttery by exposing all of front-,
> middle-, back-end bugs. :)
>
>
>
> On Fri, Feb 17, 2017 at 9:38 AM, Saurabh Verma via llvm-dev <
> llvm-dev at lists.llvm.org> wrote:
>
>> Correction in the C snippet:
>>
>> typedef signed short v8i16_t __attribute__((ext_vector_type(8)));
>>
>> v8i16_t foo (v8i16_t a, int n)
>> {
>> return a >> n;
>> }
>>
>> Best regards
>> Saurabh
>>
>>
>>
>> On 17 February 2017 at 16:21, Saurabh Verma <saurabh.verma at movidius.com>
>> wrote:
>>...
2008 Jul 18
0
[LLVMdev] Alignment of vectors
On Fri, Jul 18, 2008 at 6:45 AM, Benedict Gaster
<benedict.gaster at amd.com> wrote:
> Consider the following C code:
>
> typedef __attribute__(( ext_vector_type(2) )) float float2;
> typedef __attribute__(( ext_vector_type(2) )) __attribute__(( aligned(4) ))
AFAIK, the aligned attribute doesn't do anything on a typedef of
anything other than a struct/union type in either gcc or clang. It
would be possible to implement something like this, but some...
2009 Dec 29
2
[LLVMdev] problem compiling x86 intrinsic function
I am trying to compile this little C-program:
=================
typedef double v2f64 __attribute__((ext_vector_type(2)));
int sse2_cmp_sd(v2f64, v2f64, char ) asm("llvm.x86.sse2.cmp.sd");
int main()
{
static int i;
static float x[10];
static float y[10];
v2f64 m1;
v2f64 m2;
int j;
i = sse2_cmp_sd(m1,m2,'z');
==========================
I expected to see inline code for o...
2017 Mar 08
2
Vector trunc code generation difference between llvm-3.9 and 4.0
...;>
>>>
>>>
>>> On Fri, Feb 17, 2017 at 9:38 AM, Saurabh Verma via llvm-dev <
>>> llvm-dev at lists.llvm.org> wrote:
>>>
>>>> Correction in the C snippet:
>>>>
>>>> typedef signed short v8i16_t __attribute__((ext_vector_type(8)));
>>>>
>>>> v8i16_t foo (v8i16_t a, int n)
>>>> {
>>>> return a >> n;
>>>> }
>>>>
>>>> Best regards
>>>> Saurabh
>>>>
>>>>
>>>>
>>>> On 17 Feb...
2010 Mar 25
0
[LLVMdev] Resizing vector values
Hello all,
I'm working on a prototype LLVM pass that would take a function operating on
'magic' vectors and produce a function operating on concrete vectors. For
example, given vadd function operating on magic 17-element vectors:
typedef float vfloat __attribute__((ext_vector_type(17)));
vfloat vadd(vfloat a, vfloat b) { return a+b; }
it should produce vadd operating on 4-element vectors:
typedef float float4 __attribute__((ext_vector_type(4)));
float4 vadd(float4 a, float4 b) { return a+b; }
In other words, I only want to change the type from vfloat to float4 for
argumen...
2010 Nov 25
1
[LLVMdev] calling c-function with a vector
Hi all,
I have the following problem: I want to call a function from llvm
(tryf in the following) which takes a vector as an argument. The
function tryf is a c-function and should output the whole vector. But
I only get 0.0. Looks like a problem with how the arguments are
passed. I havn't found anything in the docs about how vectors are
passed. Any help would be appreciated.
The llvm-code
2013 Oct 02
0
[LLVMdev] [CLang] Comparing vector types - invalid error and proposed fix
I was investigating an error diagnostic in the following test example:
typedef signed char char16 __attribute__((ext_vector_type(16)));
void test( char16 srcA, char16 srcB, char16 *dst) {
*dst = ( srcA == srcB );
}
which produces the message:
mismatch.c:5:10: error: assigning to 'char16' from incompatible type
'char __attribute__((ext_vector_type(16)))'
*dst = ( srcA == srcB );
^ ~~~~~...
2009 Dec 29
0
[LLVMdev] problem compiling x86 intrinsic function
On Dec 29, 2009, at 5:50 AM, fima rabin wrote:
> I am trying to compile this little C-program:
> =================
> typedef double v2f64 __attribute__((ext_vector_type(2)));
>
> int sse2_cmp_sd(v2f64, v2f64, char ) asm("llvm.x86.sse2.cmp.sd");
We used to support this, but there are problems with it. I actually just went to go implement this again, which illustrated why this is a bad idea. If you apply this patch to clang, it will do what you...
2008 Sep 30
4
[LLVMdev] Generalizing shuffle vector
...y do a better job in code generation.
Today, building a vector for different lengths requires a sequence of
extracting each element in the vector and inserting each element into
a new vector. With this new form, it is more straightforward to write
and reason about
typedef __attribute__(( ext_vector_type(4) )) float float4;
typedef __attribute__(( ext_vector_type(8) )) float float8;
float8 f8;
float4 f4a, f4b, f4c;
f4a = f8.hi;
f8.hi = f4b; f8.lo = f4c;
where hi and lo represent the high half and low half of the vector.
The outgoing IR is
%f4a = shufflevector <8xf32>%f8, undef, <4xi...
2008 Jul 18
1
[LLVMdev] Alignment of vectors
...i,
Comments inline.
Ben
On 18/07/2008 16:30, "Eli Friedman" <eli.friedman at gmail.com> wrote:
> On Fri, Jul 18, 2008 at 6:45 AM, Benedict Gaster
> <benedict.gaster at amd.com> wrote:
>> Consider the following C code:
>>
>> typedef __attribute__(( ext_vector_type(2) )) float float2;
>> typedef __attribute__(( ext_vector_type(2) )) __attribute__(( aligned(4) ))
>
> AFAIK, the aligned attribute doesn't do anything on a typedef of
> anything other than a struct/union type in either gcc or clang. It
> would be possible to implement somet...
2018 Dec 06
3
[RFC] Matrix support (take 2)
...ach 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 support unpadded m...
2008 Sep 30
0
[LLVMdev] Generalizing shuffle vector
On Mon, Sep 29, 2008 at 8:11 PM, Mon Ping Wang <wangmp at apple.com> wrote:
> The problem with generating insert and extracts is that we can generate poor
> code
> %tmp16 = extractelement <4 x float> %f4b, i32 0
> %f8a = insertelement <8 x float> %f8a, float %tmp16, i32 0
> %tmp18 = extractelement <4 x float> %f4b, i32 1
> %f8c
2013 Sep 26
2
[LLVMdev] ARM NEON intrinsics in clang
...ons with colleagues (notably Alberto
Magni, who added OpenCL support to clang some time ago
http://lists.cs.uiuc.edu/pipermail/cfe-dev/2010-November/012293.html) my
current plan is to implement the ARM NEON intrinsics as a shared library,
using attributes as in:
typedef float float4 __attribute__((ext_vector_type(4)));
or if that doesn't work, I will try to implement the intrinsics in clang
itself (not sure this is the best way of doing it).
Ideally, I want to be able to compile C code that includes ARM NEON
intrinsics to other targets (TI processors, e.g.).
Suggestions, comments, and recommendations...
2019 Oct 28
6
RFC: Matrix math support
...far. We should be able to iterate on that, once it becomes an issue. (Earlier discussion [5] <http://lists.llvm.org/pipermail/llvm-dev/2018-December/128331.html> )
Support in Clang
We are also planning to expose the matrix support in Clang via a matrix type on the C/C++ level (similar to the ext_vector_type attribute) together with a set of matrix builtins. Similar to the LLVM part, we would like to propose a pragmatic solution for common matrix operations, while being flexible enough to allow iterative improvements to accommodate additional requirements. The main motivation for the matrix support on...
2008 Jun 27
0
[LLVMdev] Vector instructions
...ow that works out. However, note that a
> sufficiently generalized shufflevector would remove the need for
> insertelement and extractelement to exist completely.
You should look into how this works with clang. Clang allows you to
do things like this, for example:
typedef __attribute__(( ext_vector_type(4) )) float float4;
float2 vec2, vec2_2;
float4 vec4, vec4_2;
float f;
void test2() {
vec2 = vec4.xy; // shorten
f = vec2.x; // extract elt
vec4 = vec4.yyyy; // splat
vec4.zw = vec2; // insert
}
etc. It also offers operators to extract all the even or odd elements...