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 <mum...@gmail.com <javascript:>> > wrote: > >> >> <https://lh3.googleusercontent.com/-5n6yH4HI3KA/V8YHuRMLoiI/AAAAAAAAAC8/5zqKJIGP4wwpjw7hmKgLgTxvt3WVYKY2ACLcB/s1600/snip_20160830182427.png> >> >> >> > 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. > >> >> >> >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png>The >> >> output for the Int32 and Int64 case >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png>The >> >> following looks particularly bad for the Int32 case >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> movabsq $">>", %rax >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> movl $6, %edx >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> callq *%rax >> <https://lh3.googleusercontent.com/-UmVvAEvHCMI/V8YGuOL_FqI/AAAAAAAAACw/aH6yx-CJAvIHxB3EMYa1nuW8JOtbJjCrgCLcB/s1600/snip_20160830182032.png> >> >> >> >> <https://lh3.googleusercontent.com/-PhTsfPn5Lo0/V8YHFRbgGmI/AAAAAAAAAC4/-243A3nwrWMSKPis1vkMH85RGCjMNyGAwCLcB/s1600/snip_20160830182154.png> >> >> <https://lh3.googleusercontent.com/-RdeaFTCAHJA/V8YG2CTJ2CI/AAAAAAAAAC0/hXguNBdd6MM7VlsvMPjX-QwjyIJv140RQCLcB/s1600/snip_20160830182101.png> >> >> >