windelbouwman / ppci

A compiler for ARM, X86, MSP430, xtensa and more implemented in pure Python
https://ppci.readthedocs.io/en/latest/
BSD 2-Clause "Simplified" License
337 stars 36 forks source link

ppci-cc: binary operators & | ^ and unary ~ & not supported in initializer constants #100

Open tstreiff opened 4 years ago

tstreiff commented 4 years ago

define CONST1 ...

define CONST2 ...

static int ai[] = { CONST1 | CONST2, CONST1 & 0x0f };

is not supported. The only supported operations are + - * / << >> and unary -. Any other operators make the IR generator crash (KeyError) We need to add the binary or/not/xor, and binary not.

Moreover, some of the supported operators do not work on enum types.