Subject: How to define vector element type bool in builtin function



Subject: How to define vector element type bool in 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.ll
I got the error:
intrinstest.c:4:9: error: unknown type name 'bool’
typedef bool v8i1 attribute ((vector_size(1)));
^
intrinstest.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 really do not know how to define a vector type whose element type is bool .Appreciate for your help






liuyu11@ict.ac.cn




> From: via llvm-dev
> Date: 2018-04-22 03:00
> To: llvm-dev
> Subject: llvm-dev Digest, Vol 166, Issue 63
>
> Send llvm-dev mailing list submissions to
> llvm-dev@lists.llvm.org
>
> To subscribe or unsubscribe via the World Wide Web, visit
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
> or, via email, send a message with subject or body ‘help’ to
> llvm-dev-request@lists.llvm.org
>
> You can reach the person managing the list at
> llvm-dev-owner@lists.llvm.org
>
> When replying, please edit your Subject line so it is more specific
> than “Re: Contents of llvm-dev digest…”
>
> Today’s Topics:
>
> 1. Re: [RFC] Turn the MachineOutliner on by default in AArch64
> under -Oz (Jon Chesterfield via llvm-dev)
> 2. How to add/use parameter attributes? Troubles with “byval”
> (edA-qa mort-ora-y via llvm-dev)
> 3. Re: [Release-testers] LLVM 5.0.2-rc2 has been tagged
> (Sylvestre Ledru via llvm-dev)
>
> ----------------------------------------------------------------------
>
> Message: 1
> Date: Sat, 21 Apr 2018 03:33:29 +0100
> From: Jon Chesterfield via llvm-dev llvm-dev@lists.llvm.org
> To: llvm-dev llvm-dev@lists.llvm.org,
> llvm-dev-request@lists.llvm.org
> Subject: Re: [llvm-dev] [RFC] Turn the MachineOutliner on by default
> in AArch64 under -Oz
> Message-ID:
> CAOUYtQB1zR-5m_7fnJf7diyZoZJby1kkhwYmtGVOwT52ttEwUQ@mail.gmail.com
> Content-Type: text/plain; charset=“utf-8”
>
> Teaching the back end about size optimization sounds great, even without
> the exciting work on MachineOutliner. It would strip some nasty hacks from
> an out of tree back end that cares about code size :slight_smile:
>
> Thank you
>
> > The first patch is one that teaches the backend about size optimization
> > levels. This is comparable to what’s done in the inliner. Today, the only
> > way to tell if something is optimizing for size is by looking at function
> > attributes. This is fine for function passes, but insufficient for module
> > passes like the MachineOutliner. The function attribute approach forces the
> > outliner to iterate over every function in the module before deciding to
> > take action. If -Oz isn’t passed in, then the outliner will not find any
> > functions worth outlining from. This would incur unnecessary compile-time
> > overhead. Thus, we decided the best course of action is to teach the
> > backend about size options.
> >
> > The second patch teaches llc to handle -Oz and -Os.
> >
> -------------- next part --------------
> An HTML attachment was scrubbed…
> URL: http://lists.llvm.org/pipermail/llvm-dev/attachments/20180421/bdb8b423/attachment-0001.html
>
> ------------------------------
>
> Message: 2
> Date: Sat, 21 Apr 2018 19:01:15 +0200
> From: edA-qa mort-ora-y via llvm-dev llvm-dev@lists.llvm.org
> To: LLVM Developers Mailing List llvm-dev@lists.llvm.org
> Subject: [llvm-dev] How to add/use parameter attributes? Troubles with
> “byval”
> Message-ID: 4643e384-6ce5-5095-2ebd-fa6244e0d7be@disemia.com
> Content-Type: text/plain; charset=utf-8
>
> I’m unable to figure out how IR attributes can be added via the C++ API.
> I need to create a function like this:
>
> %1 = call i64 @abi_call_test_tuple_2p(%struct.abi_tuple_2p* byval
> align 8 %v)
>
> Where a structure is being passed by value. I need to add the byval
> attribute somewhere (I’m not clear if this is on the function arguments
> or the type).
>
> I’m also uncertain of why that results in a different calling convention
> than just:
>
> %1 = call i64 @abi_call_test_tuple_2p(%":abi_tuple_2" %0)
>
> Does this not also pass the same structure by-value to the function?
> (It doesn’t yield the same results it appears).
>
> –
> edA-qa mort-ora-y
> http://mortoray.com/
>
> Creator of the Leaf language
> http://leaflang.org/
>
> Streaming algorithms, AI, and design on Twitch
> Twitch
>
> Twitter
> edaqa
>
> ------------------------------
>
> Message: 3
> Date: Sat, 21 Apr 2018 09:28:53 +0200
> From: Sylvestre Ledru via llvm-dev llvm-dev@lists.llvm.org
> To: tstellar@redhat.com, Release-testers
> release-testers@lists.llvm.org, llvm-dev llvm-dev@lists.llvm.org,
> cfe-dev cfe-dev@lists.llvm.org
> Subject: Re: [llvm-dev] [Release-testers] LLVM 5.0.2-rc2 has been
> tagged
> Message-ID: 296964ac-bef0-7e3d-0650-abcbbfa75d77@debian.org
> Content-Type: text/plain; charset=utf-8
>
> Le 20/04/2018 à 18:29, Tom Stellard via Release-testers a écrit :
> > On 03/29/2018 08:09 PM, Tom Stellard via Release-testers wrote:
> >> Hi,
> >>
> >> I’ve fixed the version numbering and tagged 5.0.2-rc2. Testers can
> >> begin testing.
> >>
> > So far, I’ve only received 5.0.2-rc2 binaries from 2 testers. I am
> > guessing this is due to the mix up with -rc1 and the fact that we don’t
> > normally do X.Y.2 releases.
>
> I uploaded rc1 immediately (with the version fix) and didn’t find any issue!
>
> Cheers,
> Sylvestre
>
> ------------------------------
>
> Subject: Digest Footer
>
> _______________________________________________
> llvm-dev mailing list
> llvm-dev@lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
>
> ------------------------------
>
> End of llvm-dev Digest, Vol 166, Issue 63
> *****************************************





|

bg.jpg