This is part 1 subset of http://reviews.llvm.org/D11438,
without the .td and new fp128 unit tests.
Most of the changes here only apply to the new x86_64 f128 type configuration,
which is not enable in this part.
Bugs:
Changes:
- Relax type legalization checks to accept new f128 type configuration, whose TypeAction is TypeSoftenFloat, not TypeLegal, but also 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 FABS, FNEG, FCOPYSIGN on new f128 type configuration, 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 new 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.
- Add one more parameter to getCommonSubClass and firstCommonClass, to guarantee that returned common sub class will contain the specified simple value type. This extra parameter is used by EmitCopyFromReg in InstrEmitter.cpp.
- Fix infinite loop in getTypeLegalizationCost when f128 is the value type.
- Fix printOperand to handle null operand.
- Enhance ISD::BITCAST node to handle f128 constant.
- Expand new f128 type for BR_CC, SELECT_CC, SELECT, SETCC nodes.
- Enhance X86AsmPrinter to emit f128 values in comments.
Move the comment and additional check into a small helper for readability:
if ( (.... || ...) && legalToSimplifyCopysign(N1))