Oups wrong list
---------- Forwarded message ---------- From: Nicolas Cellier nicolas.cellier.aka.nice@gmail.com Date: 2015-10-24 1:57 GMT+02:00 Subject: absolute value of an unsigned To: vm-dev-request@lists.squeakfoundation.org
In smalltalk (a - b) abs allways makes sense... But if ever one of the variables is translated unsigned, then C code
abs(a-b) means something else... It means (a-b) \ 16rFFFFFFFF
It should be abs((signed)(a-b)) in 32 bits (or sqInt...)
Plus the problem of abs behind defined int abs(int) (see labs post above), I strongly believe it's urgent to let
CCodeGenerator>>initializeCTranslationDictionary ... pairs := #( #& #generateAbs:on:indent:
and CCodeGenerator>>generateAnd:on:indent: correctly infer types and introduce long abs and signed cast when due.
Example of potentially wrongly generated code: shrinkObjectMemory
vm-dev@lists.squeakfoundation.org