Re: XMM Intrinsics

2020-05-08 Thread Mike Parker via Digitalmars-d-learn
On Friday, 8 May 2020 at 20:14:05 UTC, Simen Kjærås wrote: The intel-intrinsics dub package aims to provide a compiler-independent layer: https://code.dlang.org/packages/intel-intrinsics TIL, thanks! :) -- Simen DConf 2019: Not intrinsically about intrinsics -- Guillaume Piolat https:

Re: ref barfs template parameter deduction?

2020-05-08 Thread NaN via Digitalmars-d-learn
On Friday, 8 May 2020 at 22:11:57 UTC, Paul Backus wrote: On Friday, 8 May 2020 at 22:03:47 UTC, NaN wrote: The integer literal `1` is an rvalue, and can't be passed by reference. If you explicitly instantiate the templates foo and bar in the function call, you get a more informative error m

Re: ref barfs template parameter deduction?

2020-05-08 Thread Paul Backus via Digitalmars-d-learn
On Friday, 8 May 2020 at 22:03:47 UTC, NaN wrote: void bar() { bam(foo(1)); } if you change the declaration of foo or bam to "ref T x", ie.. auto foo(T)(ref T x) auto bam(T)(ref T x) then the compiler complains thus... ldc 1.17.0 (Editor #1, Compiler #1) D#1 with ldc 1.17.0 (23): Error:

ref barfs template parameter deduction?

2020-05-08 Thread NaN via Digitalmars-d-learn
Ok given the following code... auto foo(T)(T x) { struct V1 { T* what; } V1 v; return v; } auto bam(T)(T x) { struct V2 { T* what; } V2 v; return v; } void bar() { bam(foo(1)); } if you change the declaration of foo or bam to "ref T x", ie.. auto foo(T)(ref T x) a

Re: ref barfs template parameter deduction?

2020-05-08 Thread NaN via Digitalmars-d-learn
On Friday, 8 May 2020 at 22:03:47 UTC, NaN wrote: Ok given the following code... auto foo(T)(T x) { struct V1 { T* what; } V1 v; return v; } auto bam(T)(T x) { struct V2 { T* what; } V2 v; return v; } void bar() { bam(foo(1)); } Should have said that compiles fine

Re: XMM Intrinsics

2020-05-08 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 8 May 2020 at 13:09:49 UTC, kinke wrote: On Friday, 8 May 2020 at 12:49:00 UTC, Simen Kjærås wrote: How would I go about calling _mm_* functions in D in a way that is portable between D compilers? You would use core.simd: Nope one wouldn't, because that horrible interface isn't s

Re: variant visit not pure?

2020-05-08 Thread Dukc via Digitalmars-d-learn
On Thursday, 7 May 2020 at 20:12:03 UTC, learner wrote: Modules of D standard library aren't in a good shape, if everyone suggests alternatives for a basic building block as variant. I don't think Variant as a whole is the problem, when one uses it as the infinite variant it does fairly muc

Re: variant visit not pure?

2020-05-08 Thread Dukc via Digitalmars-d-learn
On Thursday, 7 May 2020 at 15:36:36 UTC, Ben Jones wrote: I've been using SumType... What are the main differences between it and TaggedAlgebraic? I have not used the the algebraic type of Taggedalgebraic tbh, but it also has a tagged union type that I have good experiences with. Unlike Phobo

Re: variant visit not pure?

2020-05-08 Thread Dukc via Digitalmars-d-learn
On Thursday, 7 May 2020 at 10:21:26 UTC, Dukc wrote: that's the reason why `std.range.enumerate` does not infer attributes for example This was wrong. `enumerate` can infer. It's `lockstep` that cannot.

Re: Surprising interaction of tuples and slicing

2020-05-08 Thread Ben Jones via Digitalmars-d-learn
On Thursday, 7 May 2020 at 23:07:40 UTC, Ali Çehreli wrote: The trouble seems to be when slicing the entire tuple. Even in that case, printing a warning would not be desired in some situations ironically in generic code where e.g. T[0..$] may appear, which is the same as T[]. Ali I agree T

Re: Is is a Bug or just me?

2020-05-08 Thread foerdi via Digitalmars-d-learn
On Friday, 8 May 2020 at 14:32:33 UTC, kinke wrote: On Friday, 8 May 2020 at 14:16:10 UTC, foerdi wrote: Now I am unsure if this is a bug or an undefined behavior that I don't know. This is a regression, and a potentially pretty bad one, so thx for tracking it down! If this is a bug, then I

Re: Is is a Bug or just me?

2020-05-08 Thread kinke via Digitalmars-d-learn
On Friday, 8 May 2020 at 14:16:10 UTC, foerdi wrote: Now I am unsure if this is a bug or an undefined behavior that I don't know. This is a regression, and a potentially pretty bad one, so thx for tracking it down! If this is a bug, then I don't know how to call it for the bug tracker. Ma

Is is a Bug or just me?

2020-05-08 Thread foerdi via Digitalmars-d-learn
Hi d community, I got a strange behavior since dmd 2.090 (dmd 2.089 is the last working version). See this reduced code: https://run.dlang.io/is/yoyHXC I would expect that foo() returns 2. My guess in foo is: The return value of val is saved locally as a ref int and then the destructor of S

Re: XMM Intrinsics

2020-05-08 Thread Marcio Martins via Digitalmars-d-learn
On Friday, 8 May 2020 at 13:56:18 UTC, kinke wrote: On Friday, 8 May 2020 at 13:30:42 UTC, Marcio Martins wrote: I saw the intel-intrinsics package, but unfortunately it stops at SEE3 and I need SSE4.2 for this. How is this library working? It's open source. :) I know, but I don't have tim

Re: XMM Intrinsics

2020-05-08 Thread kinke via Digitalmars-d-learn
On Friday, 8 May 2020 at 13:30:42 UTC, Marcio Martins wrote: I saw the intel-intrinsics package, but unfortunately it stops at SEE3 and I need SSE4.2 for this. How is this library working? It's open source. :) Will LDC/LLVM detect the name and replace it with the right instructions? If so,

Re: Are compile time generated, stable and unique IDs possible?

2020-05-08 Thread Steven Schveighoffer via Digitalmars-d-learn
On 5/8/20 8:45 AM, Robert M. Münch wrote: Let's assume I have an GUI application and I want to record some user-actions which can be replayed. And this replay should be possible even if the application layout changes. Hence, I somehow need to identify the run-time objects in a way that this i

Re: Error running concurrent process and storing results in array

2020-05-08 Thread data pulverizer via Digitalmars-d-learn
On Friday, 8 May 2020 at 13:36:22 UTC, data pulverizer wrote: ...I've disallowed calling BLAS because I'm looking at the performance of the programming language implementations rather than it's ability to call other libraries. Also BLAS is of limited use for most of all the kernel functions,

Re: Error running concurrent process and storing results in array

2020-05-08 Thread data pulverizer via Digitalmars-d-learn
On Thursday, 7 May 2020 at 14:49:43 UTC, data pulverizer wrote: After running the Julia code by the Julia community they made some changes (using views rather than passing copies of the array) and their time has come down to ~ 2.5 seconds. The plot thickens. I've run the Chapel code past the

Re: XMM Intrinsics

2020-05-08 Thread Marcio Martins via Digitalmars-d-learn
On Friday, 8 May 2020 at 13:11:02 UTC, Guillaume Piolat wrote: On Friday, 8 May 2020 at 12:38:51 UTC, Marcio Martins wrote: How would I go about calling _mm_* functions in D in a way that is portable between D compilers? Hello, I've made this library for that exact purpose: https://github.co

Re: XMM Intrinsics

2020-05-08 Thread Guillaume Piolat via Digitalmars-d-learn
On Friday, 8 May 2020 at 12:38:51 UTC, Marcio Martins wrote: How would I go about calling _mm_* functions in D in a way that is portable between D compilers? Hello, I've made this library for that exact purpose: https://github.com/AuburnSounds/intel-intrinsics Supports every intrinsic list

Re: XMM Intrinsics

2020-05-08 Thread kinke via Digitalmars-d-learn
On Friday, 8 May 2020 at 12:49:00 UTC, Simen Kjærås wrote: How would I go about calling _mm_* functions in D in a way that is portable between D compilers? You would use core.simd: Nope one wouldn't, because that horrible interface isn't supported by LDC, and I guess GDC neither. The intel

Re: XMM Intrinsics

2020-05-08 Thread Simen Kjærås via Digitalmars-d-learn
On Friday, 8 May 2020 at 12:38:51 UTC, Marcio Martins wrote: Hi, I am building a CRC32C implementation using SSE for D, because I couldn't find any readily available :[ However, I am unable to find any documentation regarding which SSE instructions are available and how I could use them in D

Are compile time generated, stable and unique IDs possible?

2020-05-08 Thread Robert M. Münch via Digitalmars-d-learn
Let's assume I have an GUI application and I want to record some user-actions which can be replayed. And this replay should be possible even if the application layout changes. Hence, I somehow need to identify the run-time objects in a way that this identification stays the same while the app

XMM Intrinsics

2020-05-08 Thread Marcio Martins via Digitalmars-d-learn
Hi, I am building a CRC32C implementation using SSE for D, because I couldn't find any readily available :[ However, I am unable to find any documentation regarding which SSE instructions are available and how I could use them in D. I can see core.simd can't seem to make any use of it. How