Skip to content

x86: Added missing MOVSXD check to PostPeepHoleOptsCpu

Summary

This merge request fixes a missing case label in PostPeepHoleOptsCpu that prevented "movslq %eax,%rax" from being optimised into "cltq", even though the code existed in PostPeepholeOptMOVSX.

System

  • Processor architecture: x86-64

What is the current bug behavior?

"movslq %eax,%rax" instructions are left as is.

What is the behavior after applying this patch?

Such instructions are now changed to "cltq" instructions, which takes 1 fewer bytes to encode.

Notes

"movslq %eax,%rax" takes 3 bytes to encode, while "cltq" takes 2. Despite this minute saving, the x86_64-win64 compiler reduces in size by 512 bytes.

Merge request reports