Thread overview
[Bug 117] Program using core.simd does not compile
Apr 08, 2014
Iain Buclaw
Apr 08, 2014
Iain Buclaw
May 13, 2014
Iain Buclaw
May 13, 2014
Iain Buclaw
May 14, 2014
Manu
May 14, 2014
Iain Buclaw
May 14, 2014
Manu
April 08, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |WONTFIX

-- 
You are receiving this mail because:
You are watching all bug changes.


April 08, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #1 from Iain Buclaw <ibuclaw@gdcproject.org> ---
__simd requires the compiler to expose D_SIMD.  Which is not implemented in GDC. And given the nature of the intrinsic, I can't see it ever being introduced.


To access SIMD instructions, instead use the gcc.builtins module.

---
  import gcc.builtins;
  float4 a = 1, b = 2;
  float4 c = __builtin_ia32_addps(a, b);
---


You can get a list of all builtins gdc exposes using:

echo "module gcc.builtins;" > builtins.d && gdc -fsyntax-only -fintfc builtins.d

Then open the file 'builtins.di' for viewing.  There is currently no maintained list of this because what is generated for gcc.builtins may change depending on target or optimisation flags passed to gdc.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 13, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #2 from jens.k.mueller@gmx.de ---
There is no __builtin_ia32_loadaps with my gdc. I'm using the latest binaries.
Is this to be expected? Probably I'm doing something wrong. I cannot find it in
the generated builtins.di and gdc says
error: undefined identifier __builtin_ia32_loadaps, did you mean function
__builtin_ia32_loadhps.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 13, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #3 from Iain Buclaw <ibuclaw@gdcproject.org> ---
There is no __builtin_ia32_loadaps in GCC either.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 13, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> ---
Quote from (Updated code example for D)
https://gcc.gnu.org/ml/gcc-help/2011-06/msg00237.html

"""
The __builtin_ia32_loadaps builtin function was removed and the
documentation is out of date.  The movaps instruction from memory is
easily generated using code like

import core.simd;

float4 loadaps(float4 *p)
{
  return *p;
}
"""

-- 
You are receiving this mail because:
You are watching all bug changes.


May 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

Manu <turkeyman@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |turkeyman@gmail.com

--- Comment #5 from Manu <turkeyman@gmail.com> ---
Might I suggest that std.simd exists to wrangle the difference between
compilers (and arch/platforms).
It's on dub, or my github. I'll finish it up when I have all the tools required
and ideally include in phobos, but what's there is usable now.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #6 from Iain Buclaw <ibuclaw@gdcproject.org> ---
(In reply to Manu from comment #5)
> Might I suggest that std.simd exists to wrangle the difference between
> compilers (and arch/platforms).
> It's on dub, or my github. I'll finish it up when I have all the tools
> required and ideally include in phobos, but what's there is usable now.

Nice to see that it's well tested too. :)

https://github.com/TurkeyMan/simd/blob/master/std/simd.d#L4224

-- 
You are receiving this mail because:
You are watching all bug changes.


May 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #7 from jens.k.mueller@gmx.de ---
Thanks for the reply. Sorry I'm fairly new to this low-level programming.

I'm looking forward to std.simd. Currently I familiarize myself with this kind of programming. I believe std.simd will be a huge relief. But first I have to feel the "real" pain. Makes me appreciate your work even more and gives me some numbers regarding possible overheads.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #8 from Manu <turkeyman@gmail.com> ---
Fair enough. Although it's a direct abstraction for most operations, so no overheads. Some algorithms which aren't supported by certain architectures need to be emulated however.

-- 
You are receiving this mail because:
You are watching all bug changes.


May 14, 2014
http://bugzilla.gdcproject.org/show_bug.cgi?id=117

--- Comment #9 from jens.k.mueller@gmx.de ---
Do you have some timeline? I'd like to see it reviewed.

-- 
You are receiving this mail because:
You are watching all bug changes.