[PATCH] D52472: [AArch64] Refactor instructions that write PSTATE (NFCI)
Oliver Stannard via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 07:44:39 PDT 2018
This revision was automatically updated to reflect the committed changes.
Closed by commit rL343113: [AArch64] Refactor instructions that write PSTATE (NFCI) (authored by olista01, committed by ).
Repository:
rL LLVM
https://reviews.llvm.org/D52472
Files:
llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
Index: llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
===================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
@@ -1173,16 +1173,23 @@
let PrintMethod = "printSystemPStateField";
}
+// Instructions to modify PSTATE, no input reg
let Defs = [NZCV] in
+class PstateWriteSimple<dag iops, string asm, string operands>
+ : SimpleSystemI<0, iops, asm, operands> {
+
+ let Inst{20-19} = 0b00;
+ let Inst{15-12} = 0b0100;
+}
+
class MSRpstateImm0_15
- : SimpleSystemI<0, (ins pstatefield4_op:$pstatefield, imm0_15:$imm),
- "msr", "\t$pstatefield, $imm">,
+ : PstateWriteSimple<(ins pstatefield4_op:$pstatefield, imm0_15:$imm), "msr",
+ "\t$pstatefield, $imm">,
Sched<[WriteSys]> {
+
bits<6> pstatefield;
bits<4> imm;
- let Inst{20-19} = 0b00;
let Inst{18-16} = pstatefield{5-3};
- let Inst{15-12} = 0b0100;
let Inst{11-8} = imm;
let Inst{7-5} = pstatefield{2-0};
@@ -1201,16 +1208,15 @@
let PrintMethod = "printSystemPStateField";
}
-let Defs = [NZCV] in
class MSRpstateImm0_1
- : SimpleSystemI<0, (ins pstatefield1_op:$pstatefield, imm0_1:$imm),
- "msr", "\t$pstatefield, $imm">,
+ : PstateWriteSimple<(ins pstatefield1_op:$pstatefield, imm0_1:$imm), "msr",
+ "\t$pstatefield, $imm">,
Sched<[WriteSys]> {
+
bits<6> pstatefield;
bit imm;
- let Inst{20-19} = 0b00;
let Inst{18-16} = pstatefield{5-3};
- let Inst{15-9} = 0b0100000;
+ let Inst{11-9} = 0b000;
let Inst{8} = imm;
let Inst{7-5} = pstatefield{2-0};
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D52472.167134.patch
Type: text/x-patch
Size: 1670 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20180926/cbd3c5ca/attachment.bin>
More information about the llvm-commits
mailing list