mirror of
https://github.com/RPCS3/llvm.git
synced 2025-01-16 06:49:58 +00:00
PTX: Fix style issues
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@140308 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
297984d7c6
commit
05591be5ed
@ -50,56 +50,56 @@ PTXTargetLowering::PTXTargetLowering(TargetMachine &TM)
|
|||||||
setBooleanContents(ZeroOrOneBooleanContent);
|
setBooleanContents(ZeroOrOneBooleanContent);
|
||||||
setBooleanVectorContents(ZeroOrOneBooleanContent); // FIXME: Is this correct?
|
setBooleanVectorContents(ZeroOrOneBooleanContent); // FIXME: Is this correct?
|
||||||
setMinFunctionAlignment(2);
|
setMinFunctionAlignment(2);
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
/////////// Expansion //////////////
|
/////////// Expansion //////////////
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|
||||||
// (any/zero/sign) extload => load + (any/zero/sign) extend
|
// (any/zero/sign) extload => load + (any/zero/sign) extend
|
||||||
|
|
||||||
setLoadExtAction(ISD::EXTLOAD, MVT::i16, Expand);
|
setLoadExtAction(ISD::EXTLOAD, MVT::i16, Expand);
|
||||||
setLoadExtAction(ISD::ZEXTLOAD, MVT::i16, Expand);
|
setLoadExtAction(ISD::ZEXTLOAD, MVT::i16, Expand);
|
||||||
setLoadExtAction(ISD::SEXTLOAD, MVT::i16, Expand);
|
setLoadExtAction(ISD::SEXTLOAD, MVT::i16, Expand);
|
||||||
|
|
||||||
// f32 extload => load + fextend
|
// f32 extload => load + fextend
|
||||||
|
|
||||||
setLoadExtAction(ISD::EXTLOAD, MVT::f32, Expand);
|
setLoadExtAction(ISD::EXTLOAD, MVT::f32, Expand);
|
||||||
|
|
||||||
// f64 truncstore => trunc + store
|
// f64 truncstore => trunc + store
|
||||||
|
|
||||||
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
|
setTruncStoreAction(MVT::f64, MVT::f32, Expand);
|
||||||
|
|
||||||
// sign_extend_inreg => sign_extend
|
// sign_extend_inreg => sign_extend
|
||||||
|
|
||||||
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
|
setOperationAction(ISD::SIGN_EXTEND_INREG, MVT::i1, Expand);
|
||||||
|
|
||||||
// br_cc => brcond
|
// br_cc => brcond
|
||||||
|
|
||||||
setOperationAction(ISD::BR_CC, MVT::Other, Expand);
|
setOperationAction(ISD::BR_CC, MVT::Other, Expand);
|
||||||
|
|
||||||
// select_cc => setcc
|
// select_cc => setcc
|
||||||
|
|
||||||
setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
|
setOperationAction(ISD::SELECT_CC, MVT::Other, Expand);
|
||||||
setOperationAction(ISD::SELECT_CC, MVT::f32, Expand);
|
setOperationAction(ISD::SELECT_CC, MVT::f32, Expand);
|
||||||
setOperationAction(ISD::SELECT_CC, MVT::f64, Expand);
|
setOperationAction(ISD::SELECT_CC, MVT::f64, Expand);
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
//////////// Legal /////////////////
|
//////////// Legal /////////////////
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|
||||||
setOperationAction(ISD::ConstantFP, MVT::f32, Legal);
|
setOperationAction(ISD::ConstantFP, MVT::f32, Legal);
|
||||||
setOperationAction(ISD::ConstantFP, MVT::f64, Legal);
|
setOperationAction(ISD::ConstantFP, MVT::f64, Legal);
|
||||||
|
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
//////////// Custom ////////////////
|
//////////// Custom ////////////////
|
||||||
////////////////////////////////////
|
////////////////////////////////////
|
||||||
|
|
||||||
// customise setcc to use bitwise logic if possible
|
// customise setcc to use bitwise logic if possible
|
||||||
|
|
||||||
setOperationAction(ISD::SETCC, MVT::i1, Custom);
|
setOperationAction(ISD::SETCC, MVT::i1, Custom);
|
||||||
|
|
||||||
// customize translation of memory addresses
|
// customize translation of memory addresses
|
||||||
|
|
||||||
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
|
setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
|
||||||
setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
|
setOperationAction(ISD::GlobalAddress, MVT::i64, Custom);
|
||||||
|
|
||||||
@ -153,7 +153,7 @@ SDValue PTXTargetLowering::LowerSETCC(SDValue Op, SelectionDAG &DAG) const {
|
|||||||
DebugLoc dl = Op.getDebugLoc();
|
DebugLoc dl = Op.getDebugLoc();
|
||||||
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(2))->get();
|
ISD::CondCode CC = cast<CondCodeSDNode>(Op.getOperand(2))->get();
|
||||||
|
|
||||||
// Look for X == 0, X == 1, X != 0, or X != 1
|
// Look for X == 0, X == 1, X != 0, or X != 1
|
||||||
// We can simplify these to bitwise logic
|
// We can simplify these to bitwise logic
|
||||||
|
|
||||||
if (Op1.getOpcode() == ISD::Constant &&
|
if (Op1.getOpcode() == ISD::Constant &&
|
||||||
|
@ -248,7 +248,7 @@ bool PTXTargetMachine::addCommonCodeGenPasses(PassManagerBase &PM,
|
|||||||
// all the per-module stuff we're generating, including MCContext.
|
// all the per-module stuff we're generating, including MCContext.
|
||||||
MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo(),
|
MachineModuleInfo *MMI = new MachineModuleInfo(*getMCAsmInfo(),
|
||||||
*getRegisterInfo(),
|
*getRegisterInfo(),
|
||||||
&getTargetLowering()->getObjFileLowering());
|
&getTargetLowering()->getObjFileLowering());
|
||||||
PM.add(MMI);
|
PM.add(MMI);
|
||||||
OutContext = &MMI->getContext(); // Return the MCContext specifically by-ref.
|
OutContext = &MMI->getContext(); // Return the MCContext specifically by-ref.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user