llvm-project/llvm/test/CodeGen/M68k
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
..
Alloc [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
Arith [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
Atomics [M68k] Add support for atomic instructions 2022-11-09 18:37:03 +08:00
CConv
CodeModel [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
Control [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
GlobalISel [GlobalISel] Add big endian support in CallLowering 2022-02-08 14:43:38 +00:00
ShiftRotate
CollapseMOVEM.mir
PR57660.ll [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
inline-asm.ll
is-pcrel-register-operand-legal.mir [TableGen] Remove code beads 2022-05-30 14:27:37 +08:00
link-unlnk.ll [M68k][NFC] Use OS and ABI agnostic triple in codegen tests 2022-10-23 15:26:13 -07:00
lit.local.cfg
pipeline.ll [X86] Add ExpandLargeFpConvert Pass and enable for X86 2022-12-01 13:47:43 +08:00
reserved-regs.ll
varargs.ll [M68k][test] Remove redundant CHECK-LABEL directive 2022-04-03 22:51:03 -07:00