New instructions are added to AArch32 and AArch64 to aid floating-point multiplication and addition of complex numbers, where the complex numbers are packed in a vector register as a pair of elements. The Imaginary part of the number is placed in the more significant element, and the Real part of the number is placed in the less significant element.
Details
Diff Detail
Event Timeline
lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
9411 | I don't think we need 2 operand classes. They are essentially the same things, just some constants are different. | |
lib/Target/AArch64/AsmParser/AArch64AsmParser.cpp | ||
838 | We can refactor this and the next function (and create only 1), and use "PredicateMethod" in the AsmOperand class. | |
1550 | We can refactor this function and the next one and create one (template/parametric) function to avoid code duplication (see earlier comment about the operand classes). | |
lib/Target/AArch64/InstPrinter/AArch64InstPrinter.cpp | ||
1335 | Same here. |
Hi Sjoerd,
I've refactored some functionality so now there is a single operand class, separate functions are still required for the asm parser to 'addXXXOperands' though.
cheers,
sam
Hi Sjoerd,
I've refactored the SIMDThreeSameVector class that is subclassed by these instructions, eliminating the need to duplicate the encodings. I've left the indexed version of the class as it is, because it is quite a bit different from the base class.
cheers,
sam
Hi Sam, many thanks for refactoring this. Looks really good now! Just 2 nits inlined, but no need for another review.
Cheers, Sjoerd.
lib/Target/AArch64/AArch64InstrFormats.td | ||
---|---|---|
9426 | Nit: missing space after commas (also in the other predicates below) | |
lib/Target/AArch64/AArch64InstrInfo.td | ||
462 | Nit: F16 => FP16? |
I don't think we need 2 operand classes. They are essentially the same things, just some constants are different.
An example from the ARM backend is: ImmAsmOperand<int Low, int High>, where we pass the range of the imm value. I think we can do something similar here. We can then also avoid some duplication in the print and predicate functions, see also comments below.