Alamvic / druid

Meta-compiler to generate an optimised JIT compiler frontend based on an Interpreter definition
8 stars 6 forks source link

Bitwise operations should have unsigned type #110

Open guillep opened 5 months ago

guillep commented 5 months ago

Otherwise, conditionals depending on them will use signed jumps instead of unsigned jumps. For example, the next piece of code, should be translated using a jumpAbove and not a jumpGreater.

    r := (self stackTop bitAnd: 16rFFFFFFFFFFFFFFFF) > 1
             ifTrue: [ 1 ]
             ifFalse: [ 2 ].
    self pop: 1 thenPush: r
guillep commented 5 months ago

This affects bitAnd, bitOr, etc