bifrost/asm: Fix problem with the constant quadword format
It turns out that when using the constant quadword format, we sometimes need to swap the first and second constants in the quadword, or else some of the bits are corrupted when loading either constant. Doing this is tricky, since it has to happen before encoding the instructions (because we need to know which slot to load constants from) and hence we have to duplicate some of the logic for encoding immediates to figure out ahead of time which constants get grouped together. We also have to insert dummy constants earlier, since a dummy constant may have to be swapped with a non-dummy one.
Showing with 50 additions and 24 deletions