AnyPS5/core/relinker/codegen/src/x86
mugurc 92b20608e8 feat(relinker): convert for Rosetta with --to-rosetta
Rosetta runs AVX2, FMA, BMI1/2, F16C and MOVBE, but, unlike an Intel
host, it has neither RDSEED, CLWB nor RDPID. --to-rosetta converts
everything --to-intel does and lowers these three as well:

- RDSEED becomes RDRAND (the /6 form of the same opcode), which also
  returns a random value and sets CF.
- CLWB only writes a cache line back, so it becomes a NOP of the same
  length.
- RDPID becomes a load of 0 through an optional stub: Rosetta's TSC_AUX
  is a constant, not a processor index, so every thread reports
  processor 0. A site with no movable instruction after it for the jump
  is kept.

The flag implies --to-intel and conflicts with --windows. It is
independent of --macos: it only changes what the conversion produces, so
--macos alone leaves these instructions as they are, as on an Intel Mac,
and a title for Rosetta is relinked with --macos --to-rosetta. Intel
output is unchanged: the target is a parameter of the converter, Intel by
default.
2026-10-10 22:46:45 +03:00
..
Amd64OnlyInstructionMatcher.cpp feat(relinker): convert for Rosetta with --to-rosetta 2026-10-10 22:46:45 +03:00
ClzeroLowering.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
ClzeroOperands.cpp fix(relinker): ignore a REX prefix that is followed by another prefix 2026-10-01 13:09:11 +02:00
DecodedInstruction.cpp feat(relinker): convert for Rosetta with --to-rosetta 2026-10-10 22:46:45 +03:00
ReciprocalLowering.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
ReciprocalOperands.cpp fix(relinker): lower VRSQRTPS and VRCPPS to correctly rounded results for --to-intel 2026-10-04 14:40:16 +13:00
Sha1Lowering.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
Sha1Operands.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
Sha256Lowering.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
Sha256Operands.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
Sse4aLowering.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
Sse4aOperands.cpp fix(relinker): ignore a REX prefix that is followed by another prefix 2026-10-01 13:09:11 +02:00
StubBodyBuilder.cpp feat(relinker): relocate RIP-relative operands into --to-intel stubs 2026-10-08 11:10:38 +02:00
X64InstructionDecoder.cpp fix(relinker): decode XOP instructions 2026-10-10 19:27:24 +13:00
X64InstructionRewriter.cpp fix(relinker): classify rewrite reference sites with the instruction decoder 2026-10-08 18:20:14 +08:00