Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

  1. Use bseti when profitable.  Many cases of poor constant synthesis are failure to use bseti.
  2. Use "uw" variants of shifts/arithmetic instructions when the constant has bit 0x80000000 set.
  3. Use shNadd for constants evenly divisible by 9, 5 or 3.
  4. Use blcri in conjunction with lui or addi to clear a small number of bits, particularly in the high 33 bits of a 64bit word
  5. Adjust constant so low 13 bits are 0x1800, recursively re-synthesize and restore low bits with trailing addi.
  6. Explore if we are using NOT effectively.  ie, synthesize the inverted constant, then NOT the result to get the desired constant.
  7. Use pack for repeating constants
  8. Use pack as synthesis of last resort

There are also cases that could be improved for designs without Zbkb, but which do have Zbs.  Consider a constant with just 4 bits set.  Say two non-consecutive bits in the high 32bit part of a 64bit word, then two bits down in the low 12 bits.   Such constants will tend to end up in the constant pool.  But this could be implemented with two bsets+addi.  That is going to be the same size and almost certainly faster than a constant pool reference. 


Stakeholders/Partners

RISE:

...