[llvm] r343120 - [AArch64] Extend single-operand FP insns to match Arm ARM (NFCI)
Oliver Stannard via llvm-commits
llvm-commits at lists.llvm.org
Wed Sep 26 08:42:47 PDT 2018
Author: olista01
Date: Wed Sep 26 08:42:47 2018
New Revision: 343120
URL: http://llvm.org/viewvc/llvm-project?rev=343120&view=rev
Log:
[AArch64] Extend single-operand FP insns to match Arm ARM (NFCI)
The Armv8.3-A reference manual defines floating-point data-processing
instructions with one source operand to have an opcode of 6 bits
[20:15]. The current class in tablegen, BaseSingleOperandFPData, only
allows [18:15]. This was ok because [20:19] could only be '00', with
other encodings unallocated. Armv8.5-A brings in the FRINT group of
instructions which use other values for these bits.
This patch refactors the existing class a bit to allow using the full 6
bits of the opcode, as defined in the Arm ARM.
Patch by Pablo Barrio!
Differential revision: https://reviews.llvm.org/D52474
Modified:
llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
Modified: llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td?rev=343120&r1=343119&r2=343120&view=diff
==============================================================================
--- llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td (original)
+++ llvm/trunk/lib/Target/AArch64/AArch64InstrFormats.td Wed Sep 26 08:42:47 2018
@@ -4401,7 +4401,7 @@ multiclass FPConversion<string asm> {
//---
let mayLoad = 0, mayStore = 0, hasSideEffects = 0 in
-class BaseSingleOperandFPData<bits<4> opcode, RegisterClass regtype,
+class BaseSingleOperandFPData<bits<6> opcode, RegisterClass regtype,
ValueType vt, string asm, SDPatternOperator node>
: I<(outs regtype:$Rd), (ins regtype:$Rn), asm, "\t$Rd, $Rn", "",
[(set (vt regtype:$Rd), (node (vt regtype:$Rn)))]>,
@@ -4409,8 +4409,8 @@ class BaseSingleOperandFPData<bits<4> op
bits<5> Rd;
bits<5> Rn;
let Inst{31-24} = 0b00011110;
- let Inst{21-19} = 0b100;
- let Inst{18-15} = opcode;
+ let Inst{21} = 0b1;
+ let Inst{20-15} = opcode;
let Inst{14-10} = 0b10000;
let Inst{9-5} = Rn;
let Inst{4-0} = Rd;
@@ -4418,16 +4418,17 @@ class BaseSingleOperandFPData<bits<4> op
multiclass SingleOperandFPData<bits<4> opcode, string asm,
SDPatternOperator node = null_frag> {
- def Hr : BaseSingleOperandFPData<opcode, FPR16, f16, asm, node> {
+
+ def Hr : BaseSingleOperandFPData<{0b00,opcode}, FPR16, f16, asm, node> {
let Inst{23-22} = 0b11; // 16-bit size flag
let Predicates = [HasFullFP16];
}
- def Sr : BaseSingleOperandFPData<opcode, FPR32, f32, asm, node> {
+ def Sr : BaseSingleOperandFPData<{0b00,opcode}, FPR32, f32, asm, node> {
let Inst{23-22} = 0b00; // 32-bit size flag
}
- def Dr : BaseSingleOperandFPData<opcode, FPR64, f64, asm, node> {
+ def Dr : BaseSingleOperandFPData<{0b00,opcode}, FPR64, f64, asm, node> {
let Inst{23-22} = 0b01; // 64-bit size flag
}
}
More information about the llvm-commits
mailing list