[PATCH] D11438: Fix x86_64 fp128 calling convention

Chih-Hung Hsieh chh at google.com
Wed Jul 22 16:12:28 PDT 2015


chh created this revision.
chh added a reviewer: echristo.
chh added subscribers: rnk, llvm-commits, enh, srhines, danalbert, davidxl.
Herald added a subscriber: tberghammer.

https://llvm.org/bugs/show_bug.cgi?id=24109
https://llvm.org/bugs/show_bug.cgi?id=23897
* Add a new FR128 register class to keep f128 values in xmm* registers,
  pass f128 values in xmm[0-7] registers, and return f128 values in xmm0.
* For x86_64, when not using soft-float and with SSE registers, keep
  f128 values in FR128 registers but use (soft-float) library functions
  for floating point operations.
* Add x86_64 ISEL patterns for f128 and i128 types: cast, load, store, and/or/xor.
* Relax type legalization checks to accept f128 type,
  whose TypeAction is TypeSoftenFloat, not TypeLegal,
  but f128 has TLI.isTypeLegal true.
* Relax GetSoftenedFloat to return in some cases f128 type SDValue,
  which is TLI.isTypeLegal but not "softened" to i128 node.
* Allow customized FASB, FNEG, FCOPYSIGN on f128 type, to generate
  optimized bitwise operators for libm functions.
  Enhance related Lower* functions to handle f128 type.
* Enhance DAGTypeLegalizer::run, SoftenFloatResult, and related functions
  to keep f128 type in register, and convert f128 operators to library calls.
* Fix Combiner, Emitter, Legalizer routines that did not handle f128 type.
* Add ExpandConstant to handle i128 constants, ExpandNode to handle ISD::Constant node.
* Enhance ISD::BITCAST node to handle f128 constant.
* Fix infinite loop in getTypeLegalizationCost when f128 is the value type.
* Expand f128 type for BR_CC, SELECT_CC, SELECT, SETCC nodes.
* Enhance X86AsmPrinter to emit f128 values in comments.
* Add unit tests for above f128 code patterns, mostly used in libm.
* TODO: Handle f128 in getRegForInlineAsmConstraint.


http://reviews.llvm.org/D11438

Files:
  include/llvm/Target/TargetLowering.h
  lib/CodeGen/SelectionDAG/DAGCombiner.cpp
  lib/CodeGen/SelectionDAG/InstrEmitter.cpp
  lib/CodeGen/SelectionDAG/LegalizeDAG.cpp
  lib/CodeGen/SelectionDAG/LegalizeFloatTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.cpp
  lib/CodeGen/SelectionDAG/LegalizeTypes.h
  lib/CodeGen/SelectionDAG/LegalizeTypesGeneric.cpp
  lib/CodeGen/SelectionDAG/SelectionDAG.cpp
  lib/CodeGen/SelectionDAG/TargetLowering.cpp
  lib/CodeGen/TargetLoweringBase.cpp
  lib/Target/X86/X86CallingConv.td
  lib/Target/X86/X86ISelLowering.cpp
  lib/Target/X86/X86InstrCompiler.td
  lib/Target/X86/X86InstrInfo.td
  lib/Target/X86/X86InstrSSE.td
  lib/Target/X86/X86MCInstLower.cpp
  lib/Target/X86/X86RegisterInfo.td
  test/CodeGen/X86/fp128-calling-conv.ll
  test/CodeGen/X86/fp128-cast.ll
  test/CodeGen/X86/fp128-compare.ll
  test/CodeGen/X86/fp128-i128.ll
  test/CodeGen/X86/fp128-libcalls.ll
  test/CodeGen/X86/fp128-load.ll
  test/CodeGen/X86/fp128-store.ll
  test/CodeGen/X86/soft-fp.ll
  utils/TableGen/X86RecognizableInstr.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D11438.30420.patch
Type: text/x-patch
Size: 79259 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20150722/b332e4a8/attachment.bin>


More information about the llvm-commits mailing list