[PATCH] D97581: [SystemZ] Introduce distinction between the jg/jl family of mnemonics for GNU as vs HLASM
Anirudh Prasad via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Mon Mar 1 09:06:07 PST 2021
anirudhp added a comment.
In D97581#2593918 <https://reviews.llvm.org/D97581#2593918>, @uweigand wrote:
> Looks good in general. Just as a cosmetic issue, it would be nicer to be able to simply write:
>
> def BRUAsm#V : MnemonicCondBranchAlias <CV<V>, "br#", "j#">;
> def BRULAsm#V : MnemonicCondBranchAlias <CV<V>, "br#l", "jg#", "att">;
> def BRUL_HLASMAsm#V : MnemonicCondBranchAlias <CV<V>, "br#l", "jl#", "hlasm">;
>
> and have the additional assembler dialect constraint based on the mnemonic handled within MnemonicCondBranchAlias. Completely untested, but would something along the following lines work?
>
> class MnemonicCondBranchAlias<CondVariant V, string from, string to,
> string asmvariant = V.asmvariant> {
> if !or(!eq(V.asmvariant, ""), !eq(V.asmvariant, asmvariant)) then
> def "" : MnemonicAlias<!subst("#", V.suffix, from), !subst("#", V.suffix, to),
> asmvariant>;
> }
>
> (It might have to be a multiclass instead of class, possibly.)
I abstracted away the implementation into `SystemZInstrFormats.td`. As you pointed out, it should be a `multiclass`.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D97581/new/
https://reviews.llvm.org/D97581
More information about the llvm-commits
mailing list