[RISCV] Add support for RVV int<->fp & fp<->fp conversions
authorFraser Cormack <fraser@codeplay.com>
Fri, 22 Jan 2021 14:54:00 +0000 (14:54 +0000)
committerFraser Cormack <fraser@codeplay.com>
Thu, 28 Jan 2021 09:50:32 +0000 (09:50 +0000)
commitfc2f27ccf3c5982a8f89d2c85d83578a713c95c7
treeb5850deb744e3655535b8f6178e04b4f7441f902
parent2393b03239c56b9bc1f6fd8bef5cdedaf0570bc7
[RISCV] Add support for RVV int<->fp & fp<->fp conversions

This patch adds support for the full range of vector int-to-float,
float-to-int, and float-to-float conversions on legal types.

Many conversions are supported natively in RVV so are lowered with
patterns. These include conversions between (element) types of the same
size, and those that are half/double the size of the input. When
conversions take place between types that are less than half or more
than double the size we must lower them using sequences of instructions
which go via intermediate types.

Reviewed By: craig.topper

Differential Revision: https://reviews.llvm.org/D95447
llvm/lib/Target/RISCV/RISCVISelLowering.cpp
llvm/lib/Target/RISCV/RISCVISelLowering.h
llvm/lib/Target/RISCV/RISCVInstrInfoVSDPatterns.td
llvm/test/CodeGen/RISCV/rvv/vfpext-sdnode.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfptoi-sdnode.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vfptrunc-sdnode.ll [new file with mode: 0644]
llvm/test/CodeGen/RISCV/rvv/vitofp-sdnode.ll [new file with mode: 0644]