Re: Using YMM registers causes an undefined label error

2021-03-19 Thread z via Digitalmars-d-learn
On Tuesday, 9 March 2021 at 20:33:01 UTC, z wrote: On Tuesday, 9 March 2021 at 20:23:48 UTC, z wrote: On Friday, 5 March 2021 at 12:57:43 UTC, z wrote: ... Then it seems the only way to get AVX-compatible inline assembly(ldc.llvmasm excluded) is to use an external assembler. For example :

Re: Using YMM registers causes an undefined label error

2021-03-09 Thread z via Digitalmars-d-learn
On Tuesday, 9 March 2021 at 20:23:48 UTC, z wrote: On Friday, 5 March 2021 at 12:57:43 UTC, z wrote: ... Then it seems the only way to get AVX-compatible inline assembly(ldc.llvmasm excluded) is to use an external assembler. For example : ... But i'm not really sure how to integrate that

Re: Using YMM registers causes an undefined label error

2021-03-09 Thread z via Digitalmars-d-learn
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote: ... Then it seems the only way to get AVX-compatible inline assembly(ldc.llvmasm excluded) is to use an external assembler. For example : import std.stdio; extern(C) void vxorps_d(ubyte[32]*); void main() { ubyte[32] a = 2;

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Guillaume Piolat via Digitalmars-d-learn
On Saturday, 6 March 2021 at 16:09:03 UTC, Imperatorn wrote: On Saturday, 6 March 2021 at 15:40:56 UTC, Rumbu wrote: On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote: [...] Where exactly is documented the extern(D) x86-64 calling convention? Because currently seems like a mess

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 6 March 2021 at 15:40:56 UTC, Rumbu wrote: On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote: [...] Where exactly is documented the extern(D) x86-64 calling convention? Because currently seems like a mess according to the dissasembly. First X parameters on stack from

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Rumbu via Digitalmars-d-learn
On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote: On Saturday, 6 March 2021 at 11:57:13 UTC, Imperatorn wrote: What... Is this really how it's supposed to be? Makes no sense to not use any of the existing conventions. extern(C) and extern(D) are both documented to be the same as

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread kinke via Digitalmars-d-learn
On Saturday, 6 March 2021 at 12:29:07 UTC, kinke wrote: There are other slight breakages of that 'spec', e.g., LDC's extern(D) ABI is very similar to Microsoft's __vectorcall (so that e.g. vectors are passed in registers). [Windows only, to prevent any more confusion.]

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread kinke via Digitalmars-d-learn
On Saturday, 6 March 2021 at 12:15:43 UTC, Mike Parker wrote: On Saturday, 6 March 2021 at 11:57:13 UTC, Imperatorn wrote: What... Is this really how it's supposed to be? Makes no sense to not use any of the existing conventions. extern(C) and extern(D) are both documented to be the same as

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Mike Parker via Digitalmars-d-learn
On Saturday, 6 March 2021 at 11:57:13 UTC, Imperatorn wrote: What... Is this really how it's supposed to be? Makes no sense to not use any of the existing conventions. extern(C) and extern(D) are both documented to be the same as the platform's C calling convention everywhere except x86

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread kinke via Digitalmars-d-learn
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote: XMM registers work, but as soon as they are changed into YMM DMD outputs "bad type/size of operands %s" and LDC outputs an "label YMM0 is undefined" error. Are they not supported? To illutrate : https://run.dlang.io/is/IqDHlK LDC's support

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Imperatorn via Digitalmars-d-learn
On Saturday, 6 March 2021 at 10:45:08 UTC, Rumbu wrote: On Friday, 5 March 2021 at 21:47:49 UTC, z wrote: [...] I just made some tests, it seems that D has invented his own calling convention. And it's not documented. If you decorate your function with extern(C) it should respect the

Re: Using YMM registers causes an undefined label error

2021-03-06 Thread Rumbu via Digitalmars-d-learn
On Friday, 5 March 2021 at 21:47:49 UTC, z wrote: On Friday, 5 March 2021 at 16:10:02 UTC, Rumbu wrote: First of all, in 64 bit ABI, parameters are not passed on stack, therefore a[RBP] is a nonsense. void complement32(simdbytes* a, simdbytes* b) a is in RCX, b is in RDX on Windows a is in

Re: Using YMM registers causes an undefined label error

2021-03-05 Thread z via Digitalmars-d-learn
On Friday, 5 March 2021 at 16:10:02 UTC, Rumbu wrote: First of all, in 64 bit ABI, parameters are not passed on stack, therefore a[RBP] is a nonsense. void complement32(simdbytes* a, simdbytes* b) a is in RCX, b is in RDX on Windows a is in RDI, b is in RSI on Linux I'm confused, with your

Re: Using YMM registers causes an undefined label error

2021-03-05 Thread Rumbu via Digitalmars-d-learn
On Friday, 5 March 2021 at 12:57:43 UTC, z wrote: XMM registers work, but as soon as they are changed into YMM DMD outputs "bad type/size of operands %s" and LDC outputs an "label YMM0 is undefined" error. Are they not supported? To illutrate : https://run.dlang.io/is/IqDHlK By the way, how