[X86] AMD Zen 3 has macro fusion
authorRoman Lebedev <lebedev.ri@gmail.com>
Wed, 31 Mar 2021 11:14:13 +0000 (14:14 +0300)
committerRoman Lebedev <lebedev.ri@gmail.com>
Wed, 31 Mar 2021 11:31:50 +0000 (14:31 +0300)
commitce548aa236962f95ccaf59f8692ed0861f3769dd
treec3e51fc706a05e3d8a2357bc13755ba1ce99005b
parent9d474be11d71b5ae13490d3d8bd66150765560e3
[X86] AMD Zen 3 has macro fusion

This is an improvement over Zen 2, where only branch fusion is supported,
as per Agner, 21.4 Instruction fusion.
AMD SOG 17h has no mention of fusion.

AMD SOG 19h, 2.9.3 Branch Fusion
The following flag writing instructions support branch fusion
with their reg/reg, reg/imm and reg/mem forms
* CMP
* TEST
* SUB
* ADD
* INC (no fusion with branches dependent on CF)
* DEC (no fusion with branches dependent on CF)
* OR
* AND
* XOR

Agner, 22.4 Instruction fusion
<...> This applies to CMP, TEST, ADD, SUB, AND, OR, XOR, INC, DEC and
all conditional jumps, except if the arithmetic or logic instruction has a rip-relative address or
both an address displacement and an immediate operand.
llvm/lib/Target/X86/MCTargetDesc/X86BaseInfo.h
llvm/lib/Target/X86/X86.td