Sub-word comparisons

Andrew Haley aph at redhat.com
Thu Nov 3 17:01:44 UTC 2016


I've got a tricky bug that I can't figure out how to fix.

I'm seeing comparisons of mixed types, and I can't figure out how to
generate decent code for them.

For example, I see a

  CompareNode(x: i8, y: i8)

which gets lowered to

  Compare(PlatformKind = BYTE, left: v59|DWORD, right: byte[0|0x0])

so I guess I'm supposed only to be comparing the bottom 8 bits of the
register.  But I can't do that: I can only compare 32- or 64-bit
quantities.  It would be possible but extremely ugly to do it by
shifting both quantities left and then doing the comparison.

It would be extremely nice if I could tell Graal that I can't do
subword arithmetic of any kind.  Is anything like that possible?

Andrew.


More information about the graal-dev mailing list