summaryrefslogtreecommitdiffstats
path: root/llvm/test/CodeGen/RISCV/alu32.ll
diff options
context:
space:
mode:
authorAlex Bradbury <asb@lowrisc.org>2018-12-13 10:49:05 +0000
committerAlex Bradbury <asb@lowrisc.org>2018-12-13 10:49:05 +0000
commit919f5fb8ca5f24ec791725a498b0e37fa70bc55a (patch)
tree4146429091d15161e9d013960b3f1c976061eb6f /llvm/test/CodeGen/RISCV/alu32.ll
parentdfe861087d0d93540d8711f6052b2ab281a258d5 (diff)
downloadbcm5719-llvm-919f5fb8ca5f24ec791725a498b0e37fa70bc55a.tar.gz
bcm5719-llvm-919f5fb8ca5f24ec791725a498b0e37fa70bc55a.zip
[RISCV] Add support for the various RISC-V FMA instruction variants
Adds support for the various RISC-V FMA instructions (fmadd, fmsub, fnmsub, fnmadd). The criteria for choosing whether a fused add or subtract is used, as well as whether the product is negated or not, is whether some of the arguments to the llvm.fma.* intrinsic are negated or not. In the tests, extraneous fadd instructions were added to avoid the negation being performed using a xor trick, which prevented the proper FMA forms from being selected and thus tested. The FMA instruction patterns might seem incorrect (e.g., fnmadd: -rs1 * rs2 - rs3), but they should be correct. The misleading names were inherited from MIPS, where the negation happens after computing the sum. The llvm.fmuladd.* intrinsics still do not generate RISC-V FMA instructions, as that depends on TargetLowering::isFMAFasterthanFMulAndFAdd. Some comments in the test files about what type of instructions are there tested were updated, to better reflect the current content of those test files. Differential Revision: https://reviews.llvm.org/D54205 Patch by Luís Marques. llvm-svn: 349023
Diffstat (limited to 'llvm/test/CodeGen/RISCV/alu32.ll')
-rw-r--r--llvm/test/CodeGen/RISCV/alu32.ll6
1 files changed, 3 insertions, 3 deletions
diff --git a/llvm/test/CodeGen/RISCV/alu32.ll b/llvm/test/CodeGen/RISCV/alu32.ll
index 6ee6ed76ee6..3776e53c306 100644
--- a/llvm/test/CodeGen/RISCV/alu32.ll
+++ b/llvm/test/CodeGen/RISCV/alu32.ll
@@ -4,9 +4,9 @@
; RUN: llc -mtriple=riscv64 -verify-machineinstrs < %s \
; RUN: | FileCheck %s -check-prefix=RV64I
-; These tests are each targeted at a particular RISC-V ALU instruction. Other
-; files in this folder exercise LLVM IR instructions that don't directly match a
-; RISC-V instruction
+; These tests are each targeted at a particular RISC-V ALU instruction. Most
+; other files in this folder exercise LLVM IR instructions that don't directly
+; match a RISC-V instruction.
; Register-immediate instructions.
OpenPOWER on IntegriCloud