aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/CompilerInvocation.cpp
diff options
context:
space:
mode:
authorCraig Topper <craig.topper@sifive.com>2021-03-30 09:34:56 -0700
committerCraig Topper <craig.topper@sifive.com>2021-03-30 09:47:54 -0700
commita33fcafaf0493fe30106be099070a96d10882e9d (patch)
treef44520602c28f7403839543c6af5902a374eeaa5 /clang/lib/Frontend/CompilerInvocation.cpp
parentf5e9be6fdbdbe2a11f0227963fd4c15e3c319a44 (diff)
downloadllvm-a33fcafaf0493fe30106be099070a96d10882e9d.zip
llvm-a33fcafaf0493fe30106be099070a96d10882e9d.tar.gz
llvm-a33fcafaf0493fe30106be099070a96d10882e9d.tar.bz2
[RISCV] Pass 'half' in the lower 16 bits of an f32 value when F extension is enabled, but Zfh is not.
Without Zfh the half type isn't legal, but it could still be used as an argument/return in IR. Clang will not generate this today. Previously we promoted the half value to float for arguments and returns if the F extension is enabled but Zfh isn't. Then depending on which ABI is enabled we would pass it in either an FPR or a GPR in float format. If the F extension isn't enabled, it would get passed in the lower 16 bits of a GPR in half format. With this patch the value will always in half format and will be in the lower bits of a GPR or FPR. This should be consistent with where the bits are located when Zfh is enabled. I've based this implementation off of how this is done on ARM. I've manually nan-boxed the value to 32 bits using integer ops. It looks like flw, fsw, fmv.s, fmv.w.x, fmf.x.w won't canonicalize nans so should leave the value alone. I think those are the instructions that could get used on this value. Reviewed By: kito-cheng Differential Revision: https://reviews.llvm.org/D98670
Diffstat (limited to 'clang/lib/Frontend/CompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions