D ASM. Program fails

2016-01-21 Thread Iakh via Digitalmars-d-learn
This code compiles but program exits with code -11 What's wrong? import std.stdio; import core.simd; int pmovmskb(inout byte16 v) { asm { movdqa XMM0, v; pmovmskb EAX, XMM0; ret; } } void main() { byte16 a = [-1, 0, -1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,

Re: D ASM. Program fails

2016-01-22 Thread Iakh via Digitalmars-d-learn
On Friday, 22 January 2016 at 12:18:53 UTC, anonymous wrote: int pmovmskb(byte16 v) { int r; asm { movdqa XMM0, v; pmovmskb EAX, XMM0; mov r, EAX; } return r; } This code returns 0 for any input v Removed the `inout` because it doesn't make

Re: D ASM. Program fails

2016-01-22 Thread Iakh via Digitalmars-d-learn
On Friday, 22 January 2016 at 17:27:35 UTC, userABCabc123 wrote: int pmovmskb(byte16 v) { asm { naked; push RBP; mov RBP, RSP; sub RSP, 0x10; movdqa dword ptr[RBP-0x10], XMM0; movdqa XMM0, dword ptr[RBP-0x10]; pmovmskb EAX, XMM0;

Re: D ASM. Program fails

2016-01-22 Thread Iakh via Digitalmars-d-learn
On Friday, 22 January 2016 at 20:41:23 UTC, anonymous wrote: On 22.01.2016 21:34, Iakh wrote: This code returns 0 for any input v It seems to return 5 here: http://dpaste.dzfl.pl/85fb8e5c4b6b Yeah. Sorry. My bad.

Re: Constructor - the both look the same

2016-03-12 Thread Iakh via Digitalmars-d-learn
On Saturday, 12 March 2016 at 07:43:59 UTC, Joel wrote: Why does it come up with this? source/setup.d(40,16): Error: constructor inputjex.InputJex.this (Vector2!float pos, int fontSize, InputType type = cast(InputType)0) is not callable using argument types (Vector2!float, int, InputType) dm

How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
There is trick for gcc: gcc -dM -E - < /dev/null It shows all default #defines Is there way to show all version identifiers for D? For all or any compiler you know

Re: How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will try.

Re: How to list all version identifiers?

2016-03-13 Thread Iakh via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:16:36 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 16:28:50 UTC, Iakh wrote: On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will try

Re: How to list all version identifiers?

2016-03-15 Thread Iakh via Digitalmars-d-learn
On Sunday, 13 March 2016 at 20:16:36 UTC, Basile B. wrote: On Sunday, 13 March 2016 at 16:28:50 UTC, Iakh wrote: On Sunday, 13 March 2016 at 15:50:47 UTC, Basile B. wrote: trivial answer, let's say you have dcd-server running in the background: dcd-client -c8 <<< "version(" Thanks. Will try