Skip to content

Commit

Permalink
Refactor how powerpc ncg pushes constants.
Browse files Browse the repository at this point in the history
When loc (load constant) pushes a constant, it now checks the value of
the constant and pushes any of 7 tokens.  These tokens allow stack
patterns to recognize 16-bit signed integers (CONST2), 16-bit unsigned
integers (UCONST2), multiples of 0x10000 (CONST_HZ), and other
interesting forms of constants.

Use the new constant tokens in the rules for adi, sbi, and, ior, xor.
Adjust a few other rules to understand the new tokens.

Require that SUM_RC has a signed 16-bit constant, and OR_RC and XOR_RC
each have an unsigned 16-bit constant.  The moves from SUM_RC, OR_RC,
XOR_RC to GPR no longer touch the scratch register, because the
constant is not too big.
  • Loading branch information
kernigh committed Oct 16, 2016
1 parent baa1522 commit 7c64dab
Showing 1 changed file with 179 additions and 96 deletions.
Loading

0 comments on commit 7c64dab

Please sign in to comment.