llvm-project/llvm/test/CodeGen
Freddy Ye 89f36dd8f3 [X86] Add ExpandLargeFpConvert Pass and enable for X86
As stated in
https://discourse.llvm.org/t/rfc-llc-add-expandlargeintfpconvert-pass-for-fp-int-conversion-of-large-bitint/65528,
this implementation is very similar to ExpandLargeDivRem, which expands
‘fptoui .. to’, ‘fptosi .. to’, ‘uitofp .. to’, ‘sitofp .. to’ instructions
with a bitwidth above a threshold into auto-generated functions. This is
useful for targets like x86_64 that cannot lower fp convertions with more
than 128 bits. The expanded nodes are referring from the IR generated by
`compiler-rt/lib/builtins/floattidf.c`, `compiler-rt/lib/builtins/fixdfti.c`,
and etc.

Corner cases:
1. For fp16: as there is no related builtins added in compliler-rt. So I
mainly utilized the fp32 <-> fp16 lib calls to implement.
2. For fp80: as this pass is soft fp emulation and no fp80 instructions can
help in this problem. I recommend users to deprecate this usage. For now, the
implementation uses fp128 as the temporary conversion type and inserts
fptrunc/ext at top/end of the function.
3. For bf16: as clang FE currently doesn't support bf16 algorithm operations
(convert to int, float, +, -, *, ...), this patch doesn't consider bf16 for
now.
4. For unsigned FPToI: since both default hardware behaviors and libgcc are
ignoring "returns 0 for negative input" spec. This pass follows this old way
to ignore unsigned FPToI. See this example:
https://gcc.godbolt.org/z/bnv3jqW1M

The end-to-end tests are uploaded at https://reviews.llvm.org/D138261

Reviewed By: LuoYuanke, mgehre-amd

Differential Revision: https://reviews.llvm.org/D137241
2022-12-01 13:47:43 +08:00
..
AArch64 [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
AMDGPU [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
ARC [ARC] Regenerate ldst.ll 2022-10-29 14:09:58 +01:00
ARM [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
AVR [AVR] Do not use R0/R1 on avrtiny 2022-11-28 18:05:55 +01:00
BPF [BPF] Avoid checking for intrinsics using string comparisons. NFC 2022-11-25 11:34:55 +00:00
CSKY [CSKY] Lower ISD::ConstantPool node to support getting the address of ConstantPool entry 2022-11-21 10:37:20 +08:00
DirectX [DirectX backend] Fix build and test error caused by out of sync with upstream change. 2022-11-14 12:50:23 -08:00
Generic [Hexagon] Convert tests to check 'target=hexagon-.*' 2022-11-30 13:36:10 -08:00
Hexagon [Hexagon] Further improve code generation for shuffles 2022-11-29 14:19:29 -08:00
Inputs
Lanai
LoongArch [LoongArch] Add remaining intrinsics for CRC check instructions 2022-12-01 09:40:50 +08:00
M68k [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
MIR AMDGPU: Remove ImagePSV and move images to addrspace 7 2022-11-30 11:32:34 +01:00
MLRegalloc [mlgo] More wildcarding in extra features logging for regalloc 2022-10-25 08:20:55 -07:00
MSP430
Mips [SelectionDAG] Remove deprecated MemSDNode->getAlignment() 2022-11-23 09:04:42 +00:00
NVPTX [NVPTX] Fix alignment for arguments of function pointer calls 2022-11-15 21:43:06 +03:00
PowerPC [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
RISCV [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
SPARC [SPARC] Add tail call support for 64-bit target 2022-11-26 23:29:05 -05:00
SPIRV [SPIRV] support the enqueue_kernel builtin function 2022-11-01 02:52:08 +03:00
SystemZ Revert "[SystemZ] change test to mir to better isolate miscompile; NFC" 2022-11-29 15:05:46 -05:00
Thumb [llvm-objdump] Add --no-print-imm-hex to tests depending on it. 2022-10-29 15:40:26 -07:00
Thumb2 [ARM,MVE] Update MVE_VMLA_qr for architecture change. 2022-11-29 08:47:00 +00:00
VE [SDAG] avoid udiv/urem transform for vector/scalar type mismatches 2022-11-15 11:01:18 -05:00
WebAssembly [WebAssembly] Move debug tests into DebugInfo 2022-11-29 11:13:42 -08:00
WinCFGuard
WinEH
X86 [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
XCore XCore: Register null MCTargetStreamer 2022-11-01 11:11:03 -07:00