October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne | On 2014-10-09 17:32, Etienne wrote: > That's very helpful, the problem remains that the API is unfamiliar. I > think most of the time, simd code will only need to be translated from > basic function calls, it would've been nice to have equivalents :-p Sorry, I think I had a bad understanding. I found out through a github issue that you need to use pragma(LDC_intrinsic, "llvm.*") [function declaration] https://github.com/ldc-developers/ldc/issues/627 And the possible gcc-style intrinsics are defined here: https://www.opensource.apple.com/source/clamav/clamav-158/clamav.Bin/clamav-0.98/libclamav/c++/llvm/include/llvm/Intrinsics.gen This really begs for at binding hat works with all compilers. |
October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne Attachments: | On Thu, 09 Oct 2014 17:19:05 -0400 Etienne via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote: > > Unforunately the gcc.buildints module seems to be generated during compilation of gdc, so you might want to get a binary version or compile it yourself to see the module. > OK, thanks ! why, ketmar to the rescue! gcc.builtins is empty module. ;-) actually, importing it works like a trigger, and then programmer has access to GCC builtins defined in GCC source. one can read GCC documentation to find more information about 'em. also, importing this module defines some types. here they are: __builtin_va_list The target's va_list type )) __builtin_clong The D equivalent of the target's C "long" type __builtin_culong The D equivalent of the target's C "unsigned long" __builtin_machine_int Signed word-sized integer __builtin_machine_uint Unsigned word-sized integer __builtin_pointer_int Signed pointer-sized integer __builtin_pointer_uint Unsigned pointer-sized integer |
October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On 2014-10-10 4:12 AM, ketmar via Digitalmars-d-learn wrote:
> actually, importing it works like a trigger, and then programmer has
> access to GCC builtins defined in GCC source. one can read GCC
> documentation to find more information about 'em.
Hi ketmar,
Which type would have to be sent to the corresponding functions? I have a hard time figuring out how to use the __m128i with the proper mangling. Does it use core.simd's Vector!x types there?
|
October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne Attachments: | On Fri, 10 Oct 2014 08:31:44 -0400 Etienne via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote: > Which type would have to be sent to the corresponding functions? I have a hard time figuring out how to use the __m128i with the proper mangling. Does it use core.simd's Vector!x types there? i know nothing about SIMD, but this compiles: import core.simd; import gcc.builtins; void main () { float4 a, b; auto tmp = __builtin_ia32_mulps(a, b); // a*b } i don't know what the hell this means, but at least it accepts types from core.simd. ;-) so i assume that other such builtins will accept other types too. |
October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to ketmar | On 2014-10-10 9:01 AM, ketmar via Digitalmars-d-learn wrote:
> import core.simd;
> import gcc.builtins;
> void main () {
> float4 a, b;
> auto tmp = __builtin_ia32_mulps(a, b); // a*b
> }
>
> i don't know what the hell this means, but at least it accepts types
> from core.simd. ;-) so i assume that other such builtins will accept
> other types too.
Nice! Nobody knows simd but they all know how to make it work. Go figure =)
|
October 10, 2014 Re: How do I write __simd(void16*, void16) ? | ||||
---|---|---|---|---|
| ||||
Posted in reply to Etienne Attachments: | On Fri, 10 Oct 2014 09:09:09 -0400 Etienne via Digitalmars-d-learn <digitalmars-d-learn@puremagic.com> wrote: > On 2014-10-10 9:01 AM, ketmar via Digitalmars-d-learn wrote: > > import core.simd; > > import gcc.builtins; > > void main () { > > float4 a, b; > > auto tmp = __builtin_ia32_mulps(a, b); // a*b > > } > > > > i don't know what the hell this means, but at least it accepts types from core.simd. ;-) so i assume that other such builtins will accept other types too. > > Nice! Nobody knows simd but they all know how to make it work. Go figure =) btw, i'm ready to do tests with 32-bit gdc if necessary. you can mail/jabber me (the address is the same ;-) if you need. |
Copyright © 1999-2021 by the D Language Foundation