[all-commits] [llvm/llvm-project] c43b8e: [X86] Add support for STRICT_FP_ROUND/STRICT_FP_EX...

topperc via All-commits all-commits at lists.llvm.org
Mon Nov 25 18:37:24 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: c43b8ec735e88472593ca420a5c6a17630f94066
      https://github.com/llvm/llvm-project/commit/c43b8ec735e88472593ca420a5c6a17630f94066
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2019-11-25 (Mon, 25 Nov 2019)

  Changed paths:
    M llvm/lib/Target/X86/X86ISelLowering.cpp
    A llvm/test/CodeGen/X86/fp128-cast-strict.ll

  Log Message:
  -----------
  [X86] Add support for STRICT_FP_ROUND/STRICT_FP_EXTEND from/to fp128 to/from f32/f64/f80 in 64-bit mode.

These need to emit a libcall like we do for the non-strict version.

32-bit mode needs to SoftenFloat support to be implemented for strict FP nodes.

Differential Revision: https://reviews.llvm.org/D70504


  Commit: 3dc7c5f7d83c61fdbce5ad2ab5aad716dd6d1d1e
      https://github.com/llvm/llvm-project/commit/3dc7c5f7d83c61fdbce5ad2ab5aad716dd6d1d1e
  Author: Craig Topper <craig.topper at intel.com>
  Date:   2019-11-25 (Mon, 25 Nov 2019)

  Changed paths:
    M llvm/lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp

  Log Message:
  -----------
  [LegalizeTypes] Remove code to create ISD::FP_TO_FP16 from SoftenFloatRes_FTRUNC.

There seems to have been a misunderstanding of what ISD::FTRUNC
represents. ISD::FTRUNC is equivalent to llvm.trunc which takes
a floating point value, truncates it without changing the size
of the value and returns it.

Despite its similar name, its different than the fptrunc instruction
in IR which changes a floating point value to a smaller floating
point value. fptrunc is represented by ISD::FP_ROUND in SelectionDAG.

Since the ISD::FP_TO_FP16 node takes a floating point value and
converts it to f16 its more similar to ISD::FP_ROUND. In fact there
is identical code to what is being removed here in SoftenFloatRes_FP_ROUND.

I assume this bug was never encountered because it would require
f16 to be legalized by softening rather than the default of
promoting.


Compare: https://github.com/llvm/llvm-project/compare/01d8e09fdba0...3dc7c5f7d83c


More information about the All-commits mailing list