Deleted Added
full compact
XCoreISelLowering.cpp (199481) XCoreISelLowering.cpp (199511)
1//===-- XCoreISelLowering.cpp - XCore DAG Lowering Implementation ------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 97 unchanged lines hidden (view full) ---

106
107 setOperationAction(ISD::TRAP, MVT::Other, Legal);
108
109 // Expand jump tables for now
110 setOperationAction(ISD::BR_JT, MVT::Other, Expand);
111 setOperationAction(ISD::JumpTable, MVT::i32, Custom);
112
113 setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
1//===-- XCoreISelLowering.cpp - XCore DAG Lowering Implementation ------===//
2//
3// The LLVM Compiler Infrastructure
4//
5// This file is distributed under the University of Illinois Open Source
6// License. See LICENSE.TXT for details.
7//
8//===----------------------------------------------------------------------===//

--- 97 unchanged lines hidden (view full) ---

106
107 setOperationAction(ISD::TRAP, MVT::Other, Legal);
108
109 // Expand jump tables for now
110 setOperationAction(ISD::BR_JT, MVT::Other, Expand);
111 setOperationAction(ISD::JumpTable, MVT::i32, Custom);
112
113 setOperationAction(ISD::GlobalAddress, MVT::i32, Custom);
114
114 setOperationAction(ISD::BlockAddress, MVT::i32 , Custom);
115
115 // Thread Local Storage
116 setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
117
118 // Conversion of i64 -> double produces constantpool nodes
119 setOperationAction(ISD::ConstantPool, MVT::i32, Custom);
120
121 // Loads
122 setLoadExtAction(ISD::EXTLOAD, MVT::i1, Promote);

--- 30 unchanged lines hidden (view full) ---

153}
154
155SDValue XCoreTargetLowering::
156LowerOperation(SDValue Op, SelectionDAG &DAG) {
157 switch (Op.getOpcode())
158 {
159 case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
160 case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
116 // Thread Local Storage
117 setOperationAction(ISD::GlobalTLSAddress, MVT::i32, Custom);
118
119 // Conversion of i64 -> double produces constantpool nodes
120 setOperationAction(ISD::ConstantPool, MVT::i32, Custom);
121
122 // Loads
123 setLoadExtAction(ISD::EXTLOAD, MVT::i1, Promote);

--- 30 unchanged lines hidden (view full) ---

154}
155
156SDValue XCoreTargetLowering::
157LowerOperation(SDValue Op, SelectionDAG &DAG) {
158 switch (Op.getOpcode())
159 {
160 case ISD::GlobalAddress: return LowerGlobalAddress(Op, DAG);
161 case ISD::GlobalTLSAddress: return LowerGlobalTLSAddress(Op, DAG);
162 case ISD::BlockAddress: return LowerBlockAddress(Op, DAG);
161 case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
162 case ISD::JumpTable: return LowerJumpTable(Op, DAG);
163 case ISD::LOAD: return LowerLOAD(Op, DAG);
164 case ISD::STORE: return LowerSTORE(Op, DAG);
165 case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG);
166 case ISD::VAARG: return LowerVAARG(Op, DAG);
167 case ISD::VASTART: return LowerVASTART(Op, DAG);
168 // FIXME: Remove these when LegalizeDAGTypes lands.

--- 114 unchanged lines hidden (view full) ---

283 const TargetData *TD = TM.getTargetData();
284 unsigned Size = TD->getTypeAllocSize(Ty);
285 SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG, dl),
286 DAG.getConstant(Size, MVT::i32));
287 return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset);
288}
289
290SDValue XCoreTargetLowering::
163 case ISD::ConstantPool: return LowerConstantPool(Op, DAG);
164 case ISD::JumpTable: return LowerJumpTable(Op, DAG);
165 case ISD::LOAD: return LowerLOAD(Op, DAG);
166 case ISD::STORE: return LowerSTORE(Op, DAG);
167 case ISD::SELECT_CC: return LowerSELECT_CC(Op, DAG);
168 case ISD::VAARG: return LowerVAARG(Op, DAG);
169 case ISD::VASTART: return LowerVASTART(Op, DAG);
170 // FIXME: Remove these when LegalizeDAGTypes lands.

--- 114 unchanged lines hidden (view full) ---

285 const TargetData *TD = TM.getTargetData();
286 unsigned Size = TD->getTypeAllocSize(Ty);
287 SDValue offset = DAG.getNode(ISD::MUL, dl, MVT::i32, BuildGetId(DAG, dl),
288 DAG.getConstant(Size, MVT::i32));
289 return DAG.getNode(ISD::ADD, dl, MVT::i32, base, offset);
290}
291
292SDValue XCoreTargetLowering::
293LowerBlockAddress(SDValue Op, SelectionDAG &DAG)
294{
295 DebugLoc DL = Op.getDebugLoc();
296
297 BlockAddress *BA = cast<BlockAddressSDNode>(Op)->getBlockAddress();
298 SDValue Result = DAG.getBlockAddress(BA, DL, /*isTarget=*/true);
299
300 return DAG.getNode(XCoreISD::PCRelativeWrapper, DL, getPointerTy(), Result);
301}
302
303SDValue XCoreTargetLowering::
291LowerConstantPool(SDValue Op, SelectionDAG &DAG)
292{
293 ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
294 // FIXME there isn't really debug info here
295 DebugLoc dl = CP->getDebugLoc();
296 EVT PtrVT = Op.getValueType();
297 SDValue Res;
298 if (CP->isMachineConstantPoolEntry()) {

--- 889 unchanged lines hidden ---
304LowerConstantPool(SDValue Op, SelectionDAG &DAG)
305{
306 ConstantPoolSDNode *CP = cast<ConstantPoolSDNode>(Op);
307 // FIXME there isn't really debug info here
308 DebugLoc dl = CP->getDebugLoc();
309 EVT PtrVT = Op.getValueType();
310 SDValue Res;
311 if (CP->isMachineConstantPoolEntry()) {

--- 889 unchanged lines hidden ---