[Vm-dev] Issue 111 in cog: Use direction aware << and >> instead of bitShift: to avoid useless Runtime test

cog at googlecode.com cog at googlecode.com
Thu Dec 27 23:46:13 UTC 2012


Status: Accepted
Owner: nicolas.... at gmail.com
Labels: Type-Enhancement Priority-Medium Performance Maintainability

New issue 111 by nicolas.... at gmail.com: Use direction aware << and >>  
instead of bitShift: to avoid useless Runtime test
http://code.google.com/p/cog/issues/detail?id=111

As reported in vm-dev mailing list "bitShift: and runtime sign discussion"
http://comments.gmane.org/gmane.comp.lang.smalltalk.squeak.vm.devel/9261

in (expr bitShift: shift),
some shift have well known direction for the programmer,
but the CCodeGenerator is unable to guess if shift is not literal.
This results in useless runtime tests.
Worse, it can increase the number of C compiler warnings after inlining.

I attach some changes to VMMaker (based on .oscog-eem.241 branch).

For sound, there is a shift sign discussion already, so we can eventually  
use directed shift too
(based on trunk -ul.32 branch).

Attachments:
	VMMaker_replace_bitShift_with_directedShift.cs  12.1 KB
	Sound_replace_bitShift_with_directedShift.cs  1.8 KB



More information about the Vm-dev mailing list