Closed michaeljclark closed 7 years ago
Experiments show that non-local sign extension does not improve performance, and may degrade performance, potentially because the microarchitecture may perform move elimination for adjacent sign extension instructions (possibly handled in the renamer).
The following 32-bit operations are required to sign extend their results:
The code currently emits sign extension code after each operation. If the emitter keeps track of the width of the last operation, it would be possible to sign extend the register lazily either when it is used as input to a 64-bit operation or at a branch tail or the end of a trace.