[all-commits] [llvm/llvm-project] 9db13b: [FPEnv] Constrained FCmp intrinsics

Ulrich Weigand via All-commits all-commits at lists.llvm.org
Sat Dec 7 02:30:41 PST 2019


  Branch: refs/heads/master
  Home:   https://github.com/llvm/llvm-project
  Commit: 9db13b5a7d43096a9ab5f7cef6e1b7e2dc9c9c63
      https://github.com/llvm/llvm-project/commit/9db13b5a7d43096a9ab5f7cef6e1b7e2dc9c9c63
  Author: Ulrich Weigand <ulrich.weigand at de.ibm.com>
  Date:   2019-12-07 (Sat, 07 Dec 2019)

  Changed paths:
    M llvm/docs/LangRef.rst
    M llvm/include/llvm/CodeGen/ISDOpcodes.h
    M llvm/include/llvm/CodeGen/TargetLowering.h
    M llvm/include/llvm/IR/ConstrainedOps.def
    M llvm/include/llvm/IR/IntrinsicInst.h
    M llvm/include/llvm/IR/Intrinsics.td
    M llvm/lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeIntegerTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorOps.cpp
    M llvm/lib/CodeGen/SelectionDAG/LegalizeVectorTypes.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGBuilder.cpp
    M llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
    M llvm/lib/IR/IntrinsicInst.cpp
    M llvm/lib/IR/Verifier.cpp
    M llvm/lib/Target/SystemZ/SystemZElimCompare.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.cpp
    M llvm/lib/Target/SystemZ/SystemZISelLowering.h
    M llvm/lib/Target/SystemZ/SystemZInstrFP.td
    M llvm/lib/Target/SystemZ/SystemZInstrVector.td
    M llvm/lib/Target/SystemZ/SystemZOperators.td
    M llvm/lib/Target/SystemZ/SystemZPatterns.td
    M llvm/lib/Target/SystemZ/SystemZShortenInst.cpp
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-01.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-02.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-03.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-04.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-05.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmp-06.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-01.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-02.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-03.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-04.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-05.ll
    A llvm/test/CodeGen/SystemZ/fp-strict-cmps-06.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmp-01.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmp-02.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmp-03.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmps-01.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmps-02.ll
    A llvm/test/CodeGen/SystemZ/vec-strict-cmps-03.ll

  Log Message:
  -----------
  [FPEnv] Constrained FCmp intrinsics

This adds support for constrained floating-point comparison intrinsics.

Specifically, we add:

      declare <ty2>
      @llvm.experimental.constrained.fcmp(<type> <op1>, <type> <op2>,
                                          metadata <condition code>,
                                          metadata <exception behavior>)
      declare <ty2>
      @llvm.experimental.constrained.fcmps(<type> <op1>, <type> <op2>,
                                           metadata <condition code>,
                                           metadata <exception behavior>)

The first variant implements an IEEE "quiet" comparison (i.e. we only
get an invalid FP exception if either argument is a SNaN), while the
second variant implements an IEEE "signaling" comparison (i.e. we get
an invalid FP exception if either argument is any NaN).

The condition code is implemented as a metadata string.  The same set
of predicates as for the fcmp instruction is supported (except for the
"true" and "false" predicates).

These new intrinsics are mapped by SelectionDAG codegen onto two new
ISD opcodes, ISD::STRICT_FSETCC and ISD::STRICT_FSETCCS, again
representing quiet vs. signaling comparison operations.  Otherwise
those nodes look like SETCC nodes, with an additional chain argument
and result as usual for strict FP nodes.  The patch includes support
for the common legalization operations for those nodes.

The patch also includes full SystemZ back-end support for the new
ISD nodes, mapping them to all available SystemZ instruction to
fully implement strict semantics (scalar and vector).

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




More information about the All-commits mailing list