February 15, 2014
Hi Kai,

It is still does not vectorize with merge-2.064 (merge-2.065)
I use ldc2 -03 -release


ldmd2 output:

LDC - the LLVM D compiler (27c078):
     based on DMD v2.064 and LLVM 3.4
     Default target: x86_64-pc-linux-gnu
     Host CPU: core-avx-i

Examples:
==========================================================
void scale(T)(T[] a, T b)
{
       foreach(ref ae; a)
           ae *= b;
}
==========================================================

.cfi_startproc
	testq	%rdi, %rdi
	je	.LBB7_2
	.align	16, 0x90
.LBB7_1:
	vmulss	(%rsi), %xmm0, %xmm1
	vmovss	%xmm1, (%rsi)
	addq	$4, %rsi
	decq	%rdi
	jne	.LBB7_1
.LBB7_2:
	ret
==========================================================
void substract(T)(T[] c, in T[] a, in T[] b)
{
       foreach(i, ref ce; c)
           ce = a[i]-b[i];
}
==========================================================
.cfi_startproc
	pushq	%rax
.Ltmp33:
	.cfi_def_cfa_offset 16
	xorl	%eax, %eax
	testq	%r8, %r8
	je	.LBB6_4
	.align	16, 0x90
.LBB6_1:
	cmpq	%rdx, %rax
	jae	.LBB6_5
	cmpq	%rdi, %rax
	jae	.LBB6_5
	vmovsd	(%rcx,%rax,8), %xmm0
	vsubsd	(%rsi,%rax,8), %xmm0, %xmm0
	vmovsd	%xmm0, (%r9,%rax,8)
	incq	%rax
	cmpq	%r8, %rax
	jb	.LBB6_1
.LBB6_4:
	popq	%rax
	ret

==========================================================

Regards,
Ilya

On Tuesday, 4 February 2014 at 06:24:02 UTC, Kai Nacke wrote:
> On Monday, 3 February 2014 at 17:57:50 UTC, Kai Nacke wrote:
>> On Monday, 3 February 2014 at 07:37:50 UTC, Ilya Yaroshenko wrote:
>>> On Monday, 3 February 2014 at 00:12:08 UTC, bearophile wrote:
>>>> Ilya Yaroshenko:
>>>>
>>>>> There is only -vectorize-slp but no -vectorize.
>>>>
>>>> Isn't -vectorize implicit in -O3 (Perhaps even in -O2)?
>>>>
>>>> Bye,
>>>> bearophile
>>>
>>> No, even with -03 -release =(.
>>>
>>> Best Regards,
>>> Ilya
>>
>> Hi Ilya,
>>
>> your command line looks ok. I think there is a bug in the command line arguments.
>> I try to fix it now.
>>
>> Regards,
>> Kai
>
> Is fixed in the merge-2.064 branch and will be in next alpha release.
>
> Regards,
> Kai
March 05, 2014
Hi Ilya!

Sorry for the long delay - I was on vacation.
I'll have another look at this. Thanks for the test case.

Regards,
Kai

On Saturday, 15 February 2014 at 20:15:00 UTC, Ilya Yaroshenko wrote:
> Hi Kai,
>
> It is still does not vectorize with merge-2.064 (merge-2.065)
> I use ldc2 -03 -release
>
>
> ldmd2 output:
>
> LDC - the LLVM D compiler (27c078):
>      based on DMD v2.064 and LLVM 3.4
>      Default target: x86_64-pc-linux-gnu
>      Host CPU: core-avx-i
>
> Examples:
> ==========================================================
> void scale(T)(T[] a, T b)
> {
>        foreach(ref ae; a)
>            ae *= b;
> }
> ==========================================================
>
> .cfi_startproc
> 	testq	%rdi, %rdi
> 	je	.LBB7_2
> 	.align	16, 0x90
> .LBB7_1:
> 	vmulss	(%rsi), %xmm0, %xmm1
> 	vmovss	%xmm1, (%rsi)
> 	addq	$4, %rsi
> 	decq	%rdi
> 	jne	.LBB7_1
> .LBB7_2:
> 	ret
> ==========================================================
> void substract(T)(T[] c, in T[] a, in T[] b)
> {
>        foreach(i, ref ce; c)
>            ce = a[i]-b[i];
> }
> ==========================================================
> .cfi_startproc
> 	pushq	%rax
> .Ltmp33:
> 	.cfi_def_cfa_offset 16
> 	xorl	%eax, %eax
> 	testq	%r8, %r8
> 	je	.LBB6_4
> 	.align	16, 0x90
> .LBB6_1:
> 	cmpq	%rdx, %rax
> 	jae	.LBB6_5
> 	cmpq	%rdi, %rax
> 	jae	.LBB6_5
> 	vmovsd	(%rcx,%rax,8), %xmm0
> 	vsubsd	(%rsi,%rax,8), %xmm0, %xmm0
> 	vmovsd	%xmm0, (%r9,%rax,8)
> 	incq	%rax
> 	cmpq	%r8, %rax
> 	jb	.LBB6_1
> .LBB6_4:
> 	popq	%rax
> 	ret
>
> ==========================================================
>
> Regards,
> Ilya
>
> On Tuesday, 4 February 2014 at 06:24:02 UTC, Kai Nacke wrote:
>> On Monday, 3 February 2014 at 17:57:50 UTC, Kai Nacke wrote:
>>> On Monday, 3 February 2014 at 07:37:50 UTC, Ilya Yaroshenko wrote:
>>>> On Monday, 3 February 2014 at 00:12:08 UTC, bearophile wrote:
>>>>> Ilya Yaroshenko:
>>>>>
>>>>>> There is only -vectorize-slp but no -vectorize.
>>>>>
>>>>> Isn't -vectorize implicit in -O3 (Perhaps even in -O2)?
>>>>>
>>>>> Bye,
>>>>> bearophile
>>>>
>>>> No, even with -03 -release =(.
>>>>
>>>> Best Regards,
>>>> Ilya
>>>
>>> Hi Ilya,
>>>
>>> your command line looks ok. I think there is a bug in the command line arguments.
>>> I try to fix it now.
>>>
>>> Regards,
>>> Kai
>>
>> Is fixed in the merge-2.064 branch and will be in next alpha release.
>>
>> Regards,
>> Kai

March 12, 2014
Hi Ilya!

On Saturday, 15 February 2014 at 20:15:00 UTC, Ilya Yaroshenko wrote:
> Hi Kai,
>
> It is still does not vectorize with merge-2.064 (merge-2.065)
> I use ldc2 -03 -release
>

With LLVM 3.5 it should work now. I still need to check if it works with LLVM 3.4, too.
Reason is a change in the way the passes are registered. I missed this change. :-(

Regards,
Kai
July 01, 2014
On Thursday, 30 January 2014 at 11:17:14 UTC, bearophile wrote:
>
> I suggest to also generate the line numbers where the GC is used.
>
> Bye,
> bearophile

Should be fixed with this PR:
https://github.com/ldc-developers/ldc/pull/660

Regards,
Kai
1 2 3
Next ›   Last »