[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2017-01-16 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #13 from github-bugzi...@puremagic.com ---
Commits pushed to newCTFE at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/333c68e66a73556263e59f0386c1e0c6429da242
fix Issue 16558 - [Mir] Generic unaligned load/store like (like LDC
loadUnaligned and storeUnaligned)

https://github.com/dlang/druntime/commit/60af18f87b7f27cab30535c76831d7723492e536
Merge pull request #1693 from WalterBright/loadUnaligned

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2017-01-06 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #12 from github-bugzi...@puremagic.com ---
Commits pushed to stable at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/333c68e66a73556263e59f0386c1e0c6429da242
fix Issue 16558 - [Mir] Generic unaligned load/store like (like LDC
loadUnaligned and storeUnaligned)

https://github.com/dlang/druntime/commit/60af18f87b7f27cab30535c76831d7723492e536
Merge pull request #1693 from WalterBright/loadUnaligned

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-12-27 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #11 from github-bugzi...@puremagic.com ---
Commits pushed to scope at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/333c68e66a73556263e59f0386c1e0c6429da242
fix Issue 16558 - [Mir] Generic unaligned load/store like (like LDC
loadUnaligned and storeUnaligned)

https://github.com/dlang/druntime/commit/60af18f87b7f27cab30535c76831d7723492e536
Merge pull request #1693 from WalterBright/loadUnaligned

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-11-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #10 from github-bugzi...@puremagic.com ---
Commits pushed to master at https://github.com/dlang/druntime

https://github.com/dlang/druntime/commit/333c68e66a73556263e59f0386c1e0c6429da242
fix Issue 16558 - [Mir] Generic unaligned load/store like (like LDC
loadUnaligned and storeUnaligned)

https://github.com/dlang/druntime/commit/60af18f87b7f27cab30535c76831d7723492e536
Merge pull request #1693 from WalterBright/loadUnaligned

fix Issue 16558 - [Mir] Generic unaligned load/store like (like LDC l…

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-11-19 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

github-bugzi...@puremagic.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 Resolution|--- |FIXED

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-11-15 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #9 from Walter Bright  ---
https://github.com/dlang/druntime/pull/1693

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-10 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #8 from Илья Ярошенко  ---
I completely forgot that loadUnaligned is inlineIR alias.
So, LDC can just use an alias for loadUnaligned. So, it can to be generic
function, which will an alias for LDC Druntime.

Walter, sorry for the noise!


template loadUnaligned(V)
if(is(typeof(llvmVecType!V)))
{
...
alias inlineIR!(ir, V, const(T)*) loadUnaligned;
}

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #7 from Walter Bright  ---
I propose putting the 'loadUnaligned' function in druntime. The point of having
it there is it only has to be ported once, then everyone can use it. There are
plenty of other examples of this in druntime.

> making this a function breaks LDC's fastmath optimizations.

... and ...

> A function can be inlined by LDC but it will break other possible 
> optimisations.

I find this baffling. The whole point of inlining is to enable optimizations,
not disable them. Even if this were the case, the DMD front end inlines it, and
the LLVM back end will never see the function.

Lastly, the link going to the LDC code has this:

version (LDC)
{
return loadUnaligned!vec(cast(T*) p);
}

meaning that the LDC implementation is already a wrapper template function.

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #6 from Илья Ярошенко  ---
(In reply to Andrei Alexandrescu from comment #5)
> Do you mean unaligned load/store must be generic? 

Yes. I am really sorry that my explanation was not clear before.

> Part of the core language or druntime?

Does not matter, druntime is OK too. In the same time LDC's developers should
confirm that thay are OK with the API and can make it an intrinsics for LDC
without any generic function shell on top of existing LLVM intrinsics.

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

Andrei Alexandrescu  changed:

   What|Removed |Added

 CC||and...@erdani.com

--- Comment #5 from Andrei Alexandrescu  ---
Do you mean unaligned load/store must be generic? Part of the core language or
druntime?

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #4 from Илья Ярошенко  ---
(In reply to Walter Bright from comment #3)
> So I'm not sure what the problem is.

1. A function can be inlined by LDC but it will break other possible
optimisations.
2. Complexity. LLVM provides portable, and generic API.
It allows to write generic SIMD code without multiple library backends for this
code.

All target specified logic for Mir GLAS is concentrated in the following file.
Comparing with Eigen it is very effective solution in terms of work time per
new architecture.

https://github.com/libmir/mir/blob/master/source/mir/glas/internal/config.d

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-09 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #3 from Walter Bright  ---
The following code:

  import core.simd;

  auto load(in float* p) {
enum regsz = 16;
enum N = regsz / float.sizeof;
alias vec = __vector(float[N]);
return __simd(XMM.LODUPS, *cast(const vec*) p);
  }

  auto foo(float f) {
return load();
  }

produces in D with -O -inline for foo():

_D5test23fooFNaNbNifZNhG16v:
pushRBP
movRBP,RSP
movss010h[RBP],XMM0
movupsXMM0,010h[RBP]   <=
popRBP
ret

So I'm not sure what the problem is.

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

--- Comment #2 from Илья Ярошенко  ---
This should be an intrinsic, a part of the language, not DRuntime. Lets each
compiler implements it as its devs wants. Also, making this a function breaks
LDC's fastmath optimizations.

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-10-08 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

Walter Bright  changed:

   What|Removed |Added

   Keywords||performance
 CC||bugzi...@digitalmars.com

--- Comment #1 from Walter Bright  ---
See:

https://github.com/MartinNowak/druntime/blob/23373260e65af5edea989b61d6660832fedbec15/src/core/internal/arrayop.d#L78.

--


[Issue 16558] [Mir] Generic unaligned load/store like (like LDC loadUnaligned and storeUnaligned)

2016-09-28 Thread via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=16558

Илья Ярошенко  changed:

   What|Removed |Added

   Keywords||SIMD
Summary|Generic unaligned   |[Mir] Generic unaligned
   |load/store like (like LDC   |load/store like (like LDC
   |loadUnaligned and   |loadUnaligned and
   |storeUnaligned) |storeUnaligned)

--