[<<][staapl][>>][..]
Tue May 5 09:16:31 CEST 2009

optimizer / semanitcs

Now pic18-unit.ss contains a series of ad-hoc rules foor peephole
optimization.  Is there a way to separate this from the core
semantics?

A good example are these:

(patterns-class
 (macro)
 ;;--------------------------------
 (word  l-opcode  s-opcode)
 ;;--------------------------------
 ((+    addlw     addwf)
  (and  andlw     andwf)
  (or   iorlw     iorwf)
  (xor  xorlw     xorwf))
 ;;---------------------------------------------------------------
 (([qw a ] [qw b] word)         ([qw (tscat: a b word)]))
 (([l-opcode a] [qw b] word)    ([l-opcode (tscat: a b word)]))
 (([qw a] word)                 ([l-opcode a]))
 (([save] [movf a 0 0] word)    ([s-opcode a 0 0]))
 ((word)                        ([s-opcode POSTDEC0 0 0])))


This contains a couple of concerns interwoven:

  * compile time evaluation (tscat: ...)
  * stack manipulation optimization
  * use of unary (one literal) and binary target ops




[Reply][About]
[<<][staapl][>>][..]