September 27, 2016
On Tuesday, 27 September 2016 at 07:01:37 UTC, Jacob Carlborg wrote:
> On 2016-09-27 02:52, Joakim wrote:
>> On Monday, 26 September 2016 at 20:11:19 UTC, Ilya Yaroshenko wrote:
>>> Yes, the same true for Mir too. A precompiled library based on top of
>>> Mir GLAS can be used with DMD.
>>
>> Are you sure about this?  I thought there were ABI incompatibilities
>> between D compilers.
>
> They're not ABI compatible.

They are (except Win32?), but we need to exclude DRuntime dependency. Mir does not use Druntime and will not use it anyway because DRuntime is not `nothrow @nogc`.
September 27, 2016
On Tuesday, 27 September 2016 at 08:53:36 UTC, Ilya Yaroshenko wrote:
> On Tuesday, 27 September 2016 at 07:01:37 UTC, Jacob Carlborg wrote:
>> On 2016-09-27 02:52, Joakim wrote:
>>> On Monday, 26 September 2016 at 20:11:19 UTC, Ilya Yaroshenko wrote:
>>>> Yes, the same true for Mir too. A precompiled library based on top of
>>>> Mir GLAS can be used with DMD.
>>>
>>> Are you sure about this?  I thought there were ABI incompatibilities
>>> between D compilers.
>>
>> They're not ABI compatible.
>
> They are (except Win32?), but we need to exclude DRuntime dependency. Mir does not use Druntime and will not use it anyway because DRuntime is not `nothrow @nogc`.

I mean extern(C) code
September 27, 2016
On 2016-09-27 10:50, Ilya Yaroshenko wrote:

> No, LDC for example does not have the issue
> https://issues.dlang.org/show_bug.cgi?id=16488 and others too.

Does LDC has: "Lightweight `nothrow @nogc` threads, implemented using `struct`s" ?

-- 
/Jacob Carlborg
September 27, 2016
On Tuesday, 27 September 2016 at 03:49:18 UTC, Walter Bright wrote:
> On 9/26/2016 11:43 AM, Ilya Yaroshenko wrote:
>>> I think we need to make it a point to support Mir in dmd. -- Andrei
>>
>> Required features for Level 3:
>> 1. https://issues.dlang.org/show_bug.cgi?id=16489
>> 2. https://issues.dlang.org/show_bug.cgi?id=16488
>> 3. AVX & AVX2 floating point vector arithmetic
>> 4. Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)
>> 5. Generic routine to pack and unpack real and imaginary parts. For usage
>> example, see
>> https://github.com/libmir/mir/blob/master/source/mir/glas/internal/copy.d#L699
>
> Could you provide more detail on these, please?
>
> For example, on the last link there is no documentation on what those templates do or what their parameters are. For example,
>
>   template _mix0(V)
>   {
>     import ldc.simd;
>     enum _pred(size_t a) = (a & 1) == 0 ? a / 2 : a / 2 + V.length;
>     alias _mix0 = shufflevector!(V, staticMap!(_pred, Iota!(V.length)));
>   }
>
> ??
>
> I'd like to see each of the points at least put into an Enhancement Request on bugzilla, where we can evaluate them in an organized fashion. (Like what you've done for (1) and (2).)

Bug report for (5) https://issues.dlang.org/show_bug.cgi?id=16550 :

----
Vec1
re0 im0 re1 im1 re2 im2 re3 im3 // __vector(float[8])

Vec2
re4 im4 re5 im5 re6 im6 re7 im7 // __vector(float[8])
----
< unpack ------ pack >
----
VecReal
re0 re1 re2 re3 re4 re5 re6 re7 // __vector(float[8])

VecIm
im0 im1 im2 im3 im4 im5 im6 im7 // __vector(float[8])
----
September 27, 2016
On 2016-09-27 10:53, Ilya Yaroshenko wrote:

> They are (except Win32?), but we need to exclude DRuntime dependency.
> Mir does not use Druntime and will not use it anyway because DRuntime is
> not `nothrow @nogc`.

I tried this using ldc 1.1.0 beta 2 (Frontend, druntime and Phobos are at version 2.071.1) and DMD 2.071.1:

$ cat main.d
module main;

import std.stdio;

void main()
{
    writeln("foo");
}

$ ./ldc2 -c main.d && dmd main.o
Undefined symbols for architecture x86_64:
  "__D3std3utf6toUTF8FNaNbNiNfNkJG4awZAa", referenced from:
      __D3std5stdio4File17LockingTextWriter10__T3putTwZ3putMFNbNiNfwZv in main.o
  "__D3std5stdio12__ModuleInfoZ", referenced from:
      __D4main12__ModuleInfoZ in main.o
  "__D3std5stdio13trustedStdoutFNdNeZS3std5stdio4File", referenced from:
      __D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv in main.o
  "__D3std5stdio14fputc_unlockedFNbNiiPS4core4stdc5stdio7__sFILEZi", referenced from:

__D3std5stdio4File17LockingTextWriter10__T3putTwZ3putMFNfwZ12trustedFPUTCFNbNiNeiPS4core4stdc5stdio7__sFILEZi in main.o

__D3std5stdio4File17LockingTextWriter10__T3putTaZ3putMFNfaZ12trustedFPUTCFNbNiNeiPS4core4stdc5stdio7__sFILEZi in main.o
  "__D3std5stdio15fputwc_unlockedFNbNiwPS4core4stdc5stdio7__sFILEZi", referenced from:

__D3std5stdio4File17LockingTextWriter10__T3putTwZ3putMFNfwZ13trustedFPUTWCFNbNiNewPS4core4stdc5stdio7__sFILEZi in main.o

__D3std5stdio4File17LockingTextWriter10__T3putTaZ3putMFNfaZ13trustedFPUTWCFNbNiNewPS4core4stdc5stdio7__sFILEZi in main.o
  "__D3std5stdio4File17LockingTextWriter6__dtorMFNeZv", referenced from:
      __D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv in main.o

"__D3std5stdio4File17lockingTextWriterMFNfZS3std5stdio4File17LockingTextWriter", referenced from:
      __D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv in main.o
  "__D3std5stdio4File6__dtorMFNfZv", referenced from:
      __D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv in main.o

"__D3std9exception14ErrnoException6__ctorMFNeAyaAyamZC3std9exception14ErrnoException", referenced from:
      __D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFNfAyaZv in main.o

__D3std9exception187__T12errnoEnforceTiVAyaa76_2f55736572732f6a61636f622f446f776e6c6f6164732f6c6463322d312e312e302d62657461322d6f73782d7838365f36342f62696e2f2e2e2f696d706f72742f7374642f737464696f2e64Vmi2640Z12errnoEnforceFNfiLAyaZi in main.o
  "__D3std9exception14ErrnoException6__initZ", referenced from:
      __D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFNfAyaZv in main.o

__D3std9exception187__T12errnoEnforceTiVAyaa76_2f55736572732f6a61636f622f446f776e6c6f6164732f6c6463322d312e312e302d62657461322d6f73782d7838365f36342f62696e2f2e2e2f696d706f72742f7374642f737464696f2e64Vmi2640Z12errnoEnforceFNfiLAyaZi in main.o
  "__D3std9exception14ErrnoException6__vtblZ", referenced from:
      __D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFNfAyaZv in main.o

__D3std9exception187__T12errnoEnforceTiVAyaa76_2f55736572732f6a61636f622f446f776e6c6f6164732f6c6463322d312e312e302d62657461322d6f73782d7838365f36342f62696e2f2e2e2f696d706f72742f7374642f737464696f2e64Vmi2640Z12errnoEnforceFNfiLAyaZi in main.o
  "__D3std9exception14ErrnoException7__ClassZ", referenced from:
      __D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFNfAyaZv in main.o

__D3std9exception187__T12errnoEnforceTiVAyaa76_2f55736572732f6a61636f622f446f776e6c6f6164732f6c6463322d312e312e302d62657461322d6f73782d7838365f36342f62696e2f2e2e2f696d706f72742f7374642f737464696f2e64Vmi2640Z12errnoEnforceFNfiLAyaZi in main.o
  "__Dmodule_ref", referenced from:
      __D4main16__moduleinfoCtorZ in main.o
  "__d_eh_personality", referenced from:
      Dwarf Exception Unwind Info (__eh_frame) in main.o
  "__d_eh_resume_unwind", referenced from:
      __D3std5stdio16__T7writelnTAyaZ7writelnFNfAyaZv in main.o
  "__d_throw_exception", referenced from:
      __D3std5stdio4File17LockingTextWriter12__T3putTAyaZ3putMFNfAyaZv in main.o

__D3std9exception187__T12errnoEnforceTiVAyaa76_2f55736572732f6a61636f622f446f776e6c6f6164732f6c6463322d312e312e302d62657461322d6f73782d7838365f36342f62696e2f2e2e2f696d706f72742f7374642f737464696f2e64Vmi2640Z12errnoEnforceFNfiLAyaZi in main.o
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)
--- errorlevel 1

-- 
/Jacob Carlborg
September 27, 2016
On Tuesday, 27 September 2016 at 09:20:28 UTC, Jacob Carlborg wrote:
> On 2016-09-27 10:50, Ilya Yaroshenko wrote:
>
>> No, LDC for example does not have the issue
>> https://issues.dlang.org/show_bug.cgi?id=16488 and others too.
>
> Does LDC has: "Lightweight `nothrow @nogc` threads, implemented using `struct`s" ?

They are coming soon. LLVM has OpenCL and CUDA backend. OpenCL can be used both for CPU and GPU targets. So, yes, Mir will have [1, 2] lightweight `nothrow @nogc` threads with LDC.

1. https://github.com/libmir/dcompute
2. https://github.com/ldc-developers/ldc/pull/1786
September 27, 2016
On 9/27/16 10:50 AM, Ilya Yaroshenko wrote:
> On Tuesday, 27 September 2016 at 07:01:08 UTC, Jacob Carlborg wrote:
>> On 2016-09-26 21:49, bachmeier wrote:
>>
>>> To me, it seems pointless to support Mir in DMD. The "functionality"
>>> that it brings is speed. Nobody needing absolutely the fastest code is
>>> not going to have any interest in DMD. From what I understand of Mir
>>> (but correct me if I'm wrong) it is easy enough to replicate its
>>> functionality by linking to existing linear algebra libraries. Others
>>> can construct a compatible interface if that's something they want.
>>>
>>> I think Ilya and everyone else working on Mir should push forward with
>>> the LDC-based project. Anything else is a distraction.
>>
>> He mentions several front end issues, those apply to LDC as well.
>
> No, LDC for example does not have the issue
> https://issues.dlang.org/show_bug.cgi?id=16488 and others too.

Can we make sure all issues that Mir has with dmd and gdc be present in bugzilla and tagged with "Mir"? Thanks! -- Andrei

September 27, 2016
On Monday, 26 September 2016 at 18:43:38 UTC, Ilya Yaroshenko wrote:

> 1. Lightweight `nothrow @nogc` threads, implemented using `struct`s
> 2. Lightweight `nothrow @nogc` mutexes and barriers, implemented using `struct`s

FWIW I have some @nogc mutex and semaphore here:
https://github.com/AuburnSounds/dplug/blob/master/core/dplug/core/unchecked_sync.d

Ways to make the runtime more optional than it is would be great.
September 27, 2016
On Tuesday, 27 September 2016 at 10:20:09 UTC, Andrei Alexandrescu wrote:
> On 9/27/16 10:50 AM, Ilya Yaroshenko wrote:
>> On Tuesday, 27 September 2016 at 07:01:08 UTC, Jacob Carlborg wrote:
>>> On 2016-09-26 21:49, bachmeier wrote:
>>>
>>>> [...]
>>>
>>> He mentions several front end issues, those apply to LDC as well.
>>
>> No, LDC for example does not have the issue
>> https://issues.dlang.org/show_bug.cgi?id=16488 and others too.
>
> Can we make sure all issues that Mir has with dmd and gdc be present in bugzilla and tagged with "Mir"? Thanks! -- Andrei

Will fill them tomorrow --Ilya
September 27, 2016
On 9/27/2016 2:21 AM, Ilya Yaroshenko wrote:
> Bug report for (5) https://issues.dlang.org/show_bug.cgi?id=16550 :

Thank you. Please see my comment on it. Also, please tag all SIMD Bugzilla issues with the SIMD keyword (I already did it for 16550).