Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread Erik Schnetter
With unsigned shift counts the generated code should be shorter, since
Julia then knows in which direction to shift.

-erik

On Tue, Aug 30, 2016 at 7:24 PM, mmh  wrote:

> Is there an unsafe version of >> and <<  that does not do range checks?
>
>
> On Tuesday, August 30, 2016 at 6:46:36 PM UTC-4, Yichao Yu wrote:
>>
>>
>>
>> On Tue, Aug 30, 2016 at 6:25 PM, mmh  wrote:
>>
>>>
>>> 
>>>
>>>
>>>
>> FWIW, your "simple" function has 10 operations that generates ~40
>> instructions when fully inlined including the range check for the shifts,
>> prologue, epilogue, struct return etc, that seems like a reasonable number
>> for me.
>>
>>>
>>>
>>>
>>> 
>>>
>>> The
>>> output for the Int32 and Int64 case
>>> 
>>>
>>> The
>>> following looks particularly bad for the Int32 case
>>> 
>>>
>>> 
>>>  movabsq $">>", %rax
>>> 
>>>  movl$6, %edx
>>> 
>>>  callq   *%rax
>>> 
>>>
>>>
>>>
>>> 
>>>
>>> 
>>>
>>>
>>


-- 
Erik Schnetter 
http://www.perimeterinstitute.ca/personal/eschnetter/


Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread mmh
Is there an unsafe version of >> and <<  that does not do range checks?


On Tuesday, August 30, 2016 at 6:46:36 PM UTC-4, Yichao Yu wrote:
>
>
>
> On Tue, Aug 30, 2016 at 6:25 PM, mmh > 
> wrote:
>
>>
>> 
>>
>>
>>
> FWIW, your "simple" function has 10 operations that generates ~40 
> instructions when fully inlined including the range check for the shifts, 
> prologue, epilogue, struct return etc, that seems like a reasonable number 
> for me.
>
>>
>>
>>
>> 
>>
>> The
>>  
>> output for the Int32 and Int64 case 
>> 
>>
>> The
>>  
>> following looks particularly bad for the Int32 case  
>> 
>>
>> 
>>  movabsq $">>", %rax 
>> 
>>   
>>  movl$6, %edx 
>> 
>>   
>>  callq   *%rax 
>> 
>>   
>>
>>
>> 
>>
>> 
>>
>>
>

Re: [julia-users] code_native complex for simple snippet

2016-08-30 Thread Yichao Yu
On Tue, Aug 30, 2016 at 6:25 PM, mmh  wrote:

>
> 
>
>
>
FWIW, your "simple" function has 10 operations that generates ~40
instructions when fully inlined including the range check for the shifts,
prologue, epilogue, struct return etc, that seems like a reasonable number
for me.

>
>
>
> 
>
> The
> output for the Int32 and Int64 case
> 
>
> The
> following looks particularly bad for the Int32 case
> 
>
> 
>  movabsq $">>", %rax
> 
>  movl$6, %edx
> 
>  callq   *%rax
> 
>
>
>
> 
>
> 
>
>


[julia-users] code_native complex for simple snippet

2016-08-30 Thread mmh








The
 
output for the Int32 and Int64 case 

The
 
following looks particularly bad for the Int32 case  


 movabsq $">>", %rax 

  
 movl$6, %edx 

  
 callq   *%rax