Skip to content

Commit

Permalink
[AArch64] Fix operand definitions of XPACI/XPACD
Browse files Browse the repository at this point in the history
The operand to these instructions is both input and output.

These are not yet emitted by the compiler and the assembler already
works fine, so can't test in this patch.  But D75044 will use XPACI
and provide test coverage for this patch as well.

Differential Revision: https://reviews.llvm.org/D84298
  • Loading branch information
momchil-velikov committed Jul 30, 2020
1 parent b8c8d1b commit ef4e665
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
9 changes: 9 additions & 0 deletions llvm/lib/Target/AArch64/AArch64InstrFormats.td
Expand Up @@ -1937,6 +1937,15 @@ class SignAuthTwoOperand<bits<4> opc, string asm,
let Inst{4-0} = Rd;
}

class ClearAuth<bits<1> data, string asm>
: I<(outs GPR64:$Rd), (ins GPR64:$Rn), asm, "\t$Rd", "$Rd = $Rn", []>, Sched<[]> {
bits<5> Rd;
let Inst{31-11} = 0b110110101100000101000;
let Inst{10} = data;
let Inst{9-5} = 0b11111;
let Inst{4-0} = Rd;
}

// Base class for the Armv8.4-A 8 and 16-bit flag manipulation instructions
class BaseFlagManipulation<bit sf, bit sz, dag iops, string asm, string ops>
: I<(outs), iops, asm, ops, "", []>,
Expand Down
4 changes: 2 additions & 2 deletions llvm/lib/Target/AArch64/AArch64InstrInfo.td
Expand Up @@ -994,8 +994,8 @@ let Predicates = [HasPA] in {
defm PAC : SignAuth<0b000, 0b010, "pac">;
defm AUT : SignAuth<0b001, 0b011, "aut">;

def XPACI : SignAuthZero<0b100, 0b00, "xpaci">;
def XPACD : SignAuthZero<0b100, 0b01, "xpacd">;
def XPACI : ClearAuth<0, "xpaci">;
def XPACD : ClearAuth<1, "xpacd">;
def PACGA : SignAuthTwoOperand<0b1100, "pacga", null_frag>;

// Combined Instructions
Expand Down

0 comments on commit ef4e665

Please sign in to comment.