digitalmars.D - Druntime DMD/LDC/GDC architecture
- Ilya Yaroshenko (21/21) Jun 23 2014 Hello all!
- John Colvin (5/26) Jun 23 2014 If you look at the bottom of those _array functions you will find
- Ilya Yaroshenko (1/5) Jun 23 2014 I think it is something different. LDC has standard D inline asm.
- Kai Nacke (22/43) Jun 24 2014 Hi Ilya,
Hello all! very simple code: ------------------ double[] a, c; ... c[] += a[]; ------------------ The DMD version I can find in _arraySliceSliceAddass_d, https://github.com/D-Programming-Language/druntime/blob/master/ rc/rt/arraydouble.d . What about LDC and GDC? The _arraySliceSliceAddass_d is the same, no any version(LDC). When I compile code into assembler I found other code then in asm scope. So I suppose LDC has it's own architecture. Is it right? Where I can find it for understanding what optimization can be done by LLVM optimizer? Have GDC it's own architecture too? Best Regards, Ilya
Jun 23 2014
On Monday, 23 June 2014 at 18:09:46 UTC, Ilya Yaroshenko wrote:Hello all! very simple code: ------------------ double[] a, c; ... c[] += a[]; ------------------ The DMD version I can find in _arraySliceSliceAddass_d, https://github.com/D-Programming-Language/druntime/blob/master/ rc/rt/arraydouble.d . What about LDC and GDC? The _arraySliceSliceAddass_d is the same, no any version(LDC). When I compile code into assembler I found other code then in asm scope. So I suppose LDC has it's own architecture. Is it right? Where I can find it for understanding what optimization can be done by LLVM optimizer? Have GDC it's own architecture too? Best Regards, IlyaIf you look at the bottom of those _array functions you will find a regular loop doing the cleanup for anything missed by the inline asm. If I remember correctly, for gdc it is this loop doing the whole operation as the asm is versioned out.
Jun 23 2014
If you look at the bottom of those _array functions you will find a regular loop doing the cleanup for anything missed by the inline asm. If I remember correctly, for gdc it is this loop doing the whole operation as the asm is versioned out.I think it is something different. LDC has standard D inline asm.
Jun 23 2014
On Monday, 23 June 2014 at 18:09:46 UTC, Ilya Yaroshenko wrote:Hello all! very simple code: ------------------ double[] a, c; ... c[] += a[]; ------------------ The DMD version I can find in _arraySliceSliceAddass_d, https://github.com/D-Programming-Language/druntime/blob/master/ rc/rt/arraydouble.d . What about LDC and GDC? The _arraySliceSliceAddass_d is the same, no any version(LDC). When I compile code into assembler I found other code then in asm scope. So I suppose LDC has it's own architecture. Is it right? Where I can find it for understanding what optimization can be done by LLVM optimizer? Have GDC it's own architecture too? Best Regards, IlyaHi Ilya, I am not sure if I understand your question. I compiled this code with ldc void main() { double[] a, c; a[] = 1; c[] = 2; c[] += a[]; } (options ldc2 -c -output-ll -output-s -release -O0) and get in the main function movq 120(%rsp), %r8 movq 128(%rsp), %r9 movq 104(%rsp), %rcx movq 112(%rsp), %rdx callq _arraySliceSliceAddass_d Using -O1 or higher optimizes the call away, maybe that is the problem. Could you post the source code you are using? Regards, Kai
Jun 24 2014