jasmin icon indicating copy to clipboard operation
jasmin copied to clipboard

Systematic treatment of (potentially too large) immediates

Open eponier opened this issue 4 years ago • 2 comments

Currently, during lowering, we transform some instructions (in particular additions) if the immediate they take as an argument is too large to be taken directly. We then introduce a move of this immediate to a register, and replace the immediate by this register in the original instruction. This approach has several drawbacks:

  • this introduces an extra instruction without the user noticing -> the compiler should at least emit a warning
  • this is done only for some instructions in an ad-hoc manner -> it should be done in a systematic way, dealing both with the cases where immediates are not allowed and the cases where immediates are allowed with an upper bound

eponier avatar Nov 17 '21 14:11 eponier

This could be done in a different pass after lowering.

eponier avatar Nov 17 '21 14:11 eponier

Actually, it has been decided that the pass must be optional, and disabled when we use the "strict mode".

eponier avatar Dec 07 '21 12:12 eponier