mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-08-05 13:26:55 +00:00
Implement (and document!) support for MnemonicAlias's to have Requires
directives, allowing things like this: def : MnemonicAlias<"pop", "popl">, Requires<[In32BitMode]>; def : MnemonicAlias<"pop", "popq">, Requires<[In64BitMode]>; Move the rest of the X86 MnemonicAliases over to the .td file. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117830 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -1896,7 +1896,7 @@ compiler.</p>
|
||||
The MatchInstructionImpl function performs alias processing and then does
|
||||
actual matching.</p>
|
||||
|
||||
<p>Alias processing if the phase that canonicalizes different lexical forms of
|
||||
<p>Alias processing is the phase that canonicalizes different lexical forms of
|
||||
the same instructions down to one representation. There are several different
|
||||
kinds of alias that are possible to implement and they are listed below in the
|
||||
order that they are processed (which is in order from simplest/weakest to most
|
||||
@@ -1911,7 +1911,7 @@ description.</p>
|
||||
|
||||
<p>The first phase of alias processing is simple instruction mneomonic
|
||||
remapping for classes of instructions which are allowed with two different
|
||||
mneomonics. This phase is a simple and unconditionally remapping from one input
|
||||
mnemonics. This phase is a simple and unconditionally remapping from one input
|
||||
mnemonic to one output mnemonic. It isn't possible for this form of alias to
|
||||
look at the operands at all, so the remapping must apply for all forms of a
|
||||
given mnemonic. Mnemonic aliases are defined simply, for example X86 has:
|
||||
@@ -1928,7 +1928,19 @@ def : MnemonicAlias<"ud2a", "ud2">;
|
||||
</div>
|
||||
|
||||
<p>... and many others. With a MnemonicAlias definition, the mnemonic is
|
||||
remapped simply and directly.</p>
|
||||
remapped simply and directly. Though MnemonicAlias's can't look at any aspect
|
||||
of the instruction (such as the operands) they can depend on global modes (the
|
||||
same ones supported by the matcher), through a Requires clause:</p>
|
||||
|
||||
<div class="doc_code">
|
||||
<pre>
|
||||
def : MnemonicAlias<"pushf", "pushfq">, Requires<[In64BitMode]>;
|
||||
def : MnemonicAlias<"pushf", "pushfl">, Requires<[In32BitMode]>;
|
||||
</pre>
|
||||
</div>
|
||||
|
||||
<p>In this example, the mnemonic gets mapped into different a new one depending
|
||||
on the current instruction set.</p>
|
||||
|
||||
</div>
|
||||
|
||||
|
Reference in New Issue
Block a user