PPCISelLowering.h revision f170cc9b2eb98efee40ee22cff6bcf401c209b00
121e463b2bf864671a87ebe386cb100ef9349a540Nate Begeman//===-- PPCISelLowering.h - PPC32 DAG Lowering Interface --------*- C++ -*-===//
27c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//
37c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//                     The LLVM Compiler Infrastructure
47c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//
54ee451de366474b9c228b4e5fa573795a715216dChris Lattner// This file is distributed under the University of Illinois Open Source
64ee451de366474b9c228b4e5fa573795a715216dChris Lattner// License. See LICENSE.TXT for details.
77c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//
87c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//===----------------------------------------------------------------------===//
97c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//
107c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner// This file defines the interfaces that PPC uses to lower LLVM code into a
117c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner// selection DAG.
127c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//
137c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner//===----------------------------------------------------------------------===//
147c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner
157c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner#ifndef LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
167c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner#define LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
177c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner
182668959b8879097db368aec7d76c455260abc75bChris Lattner#include "PPC.h"
197ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel#include "PPCRegisterInfo.h"
20331d1bc5dfe1be9090e29f9af9579888a63a9a79Chris Lattner#include "PPCSubtarget.h"
2179aa3417eb6f58d668aadfedf075240a41d35a26Craig Topper#include "llvm/CodeGen/SelectionDAG.h"
22a1514e24cc24b050f53a12650e047799358833a1Chandler Carruth#include "llvm/Target/TargetLowering.h"
237c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner
247c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattnernamespace llvm {
250bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner  namespace PPCISD {
260bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner    enum NodeType {
273c983c3dc19bb83807f978c04737b4572be90a93Nate Begeman      // Start the numbering where the builtin ops and target ops leave off.
280ba2bcfcc3149a25d08aa8aa00fb6c34a4e25bddDan Gohman      FIRST_NUMBER = ISD::BUILTIN_OP_END,
290bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner
300bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner      /// FSEL - Traditional three-operand fsel node.
310bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner      ///
320bbea954331b8f08afa5b094dfb0841829c70eaaChris Lattner      FSEL,
3395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
34c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      /// FCFID - The FCFID instruction, taking an f64 operand and producing
35c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      /// and f64 value containing the FP representation of the integer that
36c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      /// was temporarily in the f64 operand.
37c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      FCFID,
3895771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
3995771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson      /// FCTI[D,W]Z - The FCTIDZ and FCTIWZ instructions, taking an f32 or f64
40c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      /// operand, producing an f64 value containing the integer representation
41c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      /// of that FP value.
42c09eeec0ebc378644bafd04916e5efafa7d98152Nate Begeman      FCTIDZ, FCTIWZ,
4395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
44993aeb2ed93f99faf1438f1b67cd922989306828Nate Begeman      // VMADDFP, VNMSUBFP - The VMADDFP and VNMSUBFP instructions, taking
45993aeb2ed93f99faf1438f1b67cd922989306828Nate Begeman      // three v4f32 operands and producing a v4f32 result.
46993aeb2ed93f99faf1438f1b67cd922989306828Nate Begeman      VMADDFP, VNMSUBFP,
4795771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
48f1d0b2bedaa065972a5ba17259055c1176cd1497Chris Lattner      /// VPERM - The PPC VPERM Instruction.
49f1d0b2bedaa065972a5ba17259055c1176cd1497Chris Lattner      ///
50f1d0b2bedaa065972a5ba17259055c1176cd1497Chris Lattner      VPERM,
5195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
52860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// Hi/Lo - These represent the high and low 16-bit parts of a global
53860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// address respectively.  These nodes have two operands, the first of
54860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// which must be a TargetGlobalAddress, and the second of which must be a
55860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// Constant.  Selected naively, these turn into 'lis G+C' and 'li G+C',
56860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// though these are usually folded into other nodes.
57860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      Hi, Lo,
5895771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
596b16eff207f99bbde3c0f7340452a5287218772cTilmann Scheller      TOC_ENTRY,
606b16eff207f99bbde3c0f7340452a5287218772cTilmann Scheller
613a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// The following three target-specific nodes are used for calls through
623a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// function pointers in the 64-bit SVR4 ABI.
633a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller
643a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// Restore the TOC from the TOC save area of the current stack frame.
653a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// This is basically a hard coded load instruction which additionally
663a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// takes/produces a flag.
673a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      TOC_RESTORE,
683a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller
693a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// Like a regular LOAD but additionally taking/producing a flag.
703a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      LOAD,
713a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller
723a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// LOAD into r2 (also taking/producing a flag). Like TOC_RESTORE, this is
733a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      /// a hard coded load instruction.
743a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller      LOAD_TOC,
753a84dae654630a89a91a73807201b6067c4774ecTilmann Scheller
762f616bff7ef1e2e08d6d23c2a8b42ec2bfebb173Jim Laskey      /// OPRC, CHAIN = DYNALLOC(CHAIN, NEGSIZE, FRAME_INDEX)
772f616bff7ef1e2e08d6d23c2a8b42ec2bfebb173Jim Laskey      /// This instruction is lowered in PPCRegisterInfo::eliminateFrameIndex to
782f616bff7ef1e2e08d6d23c2a8b42ec2bfebb173Jim Laskey      /// compute an allocation on the stack.
792f616bff7ef1e2e08d6d23c2a8b42ec2bfebb173Jim Laskey      DYNALLOC,
8095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
81860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// GlobalBaseReg - On Darwin, this node represents the result of the mflr
82860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      /// at function entry, used for PIC code.
83860e8862c1fbd3b261da4a64a8c0096f9f373681Chris Lattner      GlobalBaseReg,
8495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
854172b10ca1adfc1026428e5f522aaab98bd939adChris Lattner      /// These nodes represent the 32-bit PPC shifts that operate on 6-bit
864172b10ca1adfc1026428e5f522aaab98bd939adChris Lattner      /// shift amounts.  These nodes are generated by the multi-precision shift
874172b10ca1adfc1026428e5f522aaab98bd939adChris Lattner      /// code.
884172b10ca1adfc1026428e5f522aaab98bd939adChris Lattner      SRL, SRA, SHL,
8995771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
90c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      /// CALL - A direct function call.
9186765fbe170198e7bb40fd8499d1354f4c786f60Ulrich Weigand      /// CALL_NOP is a call with the special NOP which follows 64-bit
925b00ceaeeabff8c25abb09926343c3fcb06053d8Hal Finkel      /// SVR4 calls.
9386765fbe170198e7bb40fd8499d1354f4c786f60Ulrich Weigand      CALL, CALL_NOP,
946b16eff207f99bbde3c0f7340452a5287218772cTilmann Scheller
95c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      /// CHAIN,FLAG = MTCTR(VAL, CHAIN[, INFLAG]) - Directly corresponds to a
96c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      /// MTCTR instruction.
97c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      MTCTR,
9895771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
99c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      /// CHAIN,FLAG = BCTRL(CHAIN, INFLAG) - Directly corresponds to a
100c703a8fbf8653ac8302ae368391a4954c307ca2cChris Lattner      /// BCTRL instruction.
10186765fbe170198e7bb40fd8499d1354f4c786f60Ulrich Weigand      BCTRL,
10295771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
1039e4dd9dfc97f3930f58ca6e47bebbd8eb5cdd8a1Nate Begeman      /// Return with a flag operand, matched by 'blr'
1049e4dd9dfc97f3930f58ca6e47bebbd8eb5cdd8a1Nate Begeman      RET_FLAG,
10595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
1065f07d5224ddc32f405d7e19de8e58e91ab2816bcDale Johannesen      /// R32 = MFCR(CRREG, INFLAG) - Represents the MFCRpseud/MFOCRF
1075f07d5224ddc32f405d7e19de8e58e91ab2816bcDale Johannesen      /// instructions.  This copies the bits corresponding to the specified
1085f07d5224ddc32f405d7e19de8e58e91ab2816bcDale Johannesen      /// CRREG into the resultant GPR.  Bits corresponding to other CR regs
1095f07d5224ddc32f405d7e19de8e58e91ab2816bcDale Johannesen      /// are undefined.
1106d92caddc4aa5fc946b294259e00cc35536e61e8Chris Lattner      MFCR,
111a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner
1127ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel      // EH_SJLJ_SETJMP - SjLj exception handling setjmp.
1137ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel      EH_SJLJ_SETJMP,
1147ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel
1157ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel      // EH_SJLJ_LONGJMP - SjLj exception handling longjmp.
1167ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel      EH_SJLJ_LONGJMP,
1177ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel
118a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner      /// RESVEC = VCMP(LHS, RHS, OPC) - Represents one of the altivec VCMP*
119a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner      /// instructions.  For lack of better number, we use the opcode number
120a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner      /// encoding for the OPC field to identify the compare.  For example, 838
121a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner      /// is VCMPGTSH.
122a17b1557ad705c56c41624e6841e19093ed31f21Chris Lattner      VCMP,
12395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
1246d92caddc4aa5fc946b294259e00cc35536e61e8Chris Lattner      /// RESVEC, OUTFLAG = VCMPo(LHS, RHS, OPC) - Represents one of the
12595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson      /// altivec VCMP*o instructions.  For lack of better number, we use the
1266d92caddc4aa5fc946b294259e00cc35536e61e8Chris Lattner      /// opcode number encoding for the OPC field to identify the compare.  For
1276d92caddc4aa5fc946b294259e00cc35536e61e8Chris Lattner      /// example, 838 is VCMPGTSH.
12890564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      VCMPo,
12995771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
13090564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      /// CHAIN = COND_BRANCH CHAIN, CRRC, OPC, DESTBB [, INFLAG] - This
13190564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      /// corresponds to the COND_BRANCH pseudo instruction.  CRRC is the
13290564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      /// condition register to branch on, OPC is the branch opcode to use (e.g.
13390564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      /// PPC::BLE), DESTBB is the destination block to branch to, and INFLAG is
13490564f26d17701e11effa2f4e0fb9a18d8a91274Chris Lattner      /// an optional input flag argument.
135d9989384592a3bd9dd374470a723ca8303071a2dChris Lattner      COND_BRANCH,
13695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
1377d35d3f432cb59d3d1c0884af3023de9b5cb10b1Ulrich Weigand      /// F8RC = FADDRTZ F8RC, F8RC - This is an FADD done with rounding
1387d35d3f432cb59d3d1c0884af3023de9b5cb10b1Ulrich Weigand      /// towards zero.  Used only as part of the long double-to-int
1397d35d3f432cb59d3d1c0884af3023de9b5cb10b1Ulrich Weigand      /// conversion sequence.
1406eaeff29b8a6990107735f7e5f5e49da38f56223Dale Johannesen      FADDRTZ,
1416eaeff29b8a6990107735f7e5f5e49da38f56223Dale Johannesen
1427d35d3f432cb59d3d1c0884af3023de9b5cb10b1Ulrich Weigand      /// F8RC = MFFS - This moves the FPSCR (not modeled) into the register.
1437d35d3f432cb59d3d1c0884af3023de9b5cb10b1Ulrich Weigand      MFFS,
14454fc97dcdc0ab747f49bd09c5a877bfd2a00e364Evan Cheng
1458608f2eff2dab5345243c40d0bca9138f2dce6f1Evan Cheng      /// LARX = This corresponds to PPC l{w|d}arx instrcution: load and
14654fc97dcdc0ab747f49bd09c5a877bfd2a00e364Evan Cheng      /// reserve indexed. This is used to implement atomic operations.
1478608f2eff2dab5345243c40d0bca9138f2dce6f1Evan Cheng      LARX,
14854fc97dcdc0ab747f49bd09c5a877bfd2a00e364Evan Cheng
1498608f2eff2dab5345243c40d0bca9138f2dce6f1Evan Cheng      /// STCX = This corresponds to PPC stcx. instrcution: store conditional
1508608f2eff2dab5345243c40d0bca9138f2dce6f1Evan Cheng      /// indexed. This is used to implement atomic operations.
1518608f2eff2dab5345243c40d0bca9138f2dce6f1Evan Cheng      STCX,
15254fc97dcdc0ab747f49bd09c5a877bfd2a00e364Evan Cheng
15330e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer      /// TC_RETURN - A tail call return.
15430e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer      ///   operand #0 chain
15530e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer      ///   operand #1 callee (register or absolute)
15630e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer      ///   operand #2 stack adjustment
15730e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer      ///   operand #3 optional in flag
158c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      TC_RETURN,
159c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman
16082b3821208286aeb43f603fdac98832bd662dad9Hal Finkel      /// ch, gl = CR6[UN]SET ch, inglue - Toggle CR bit 6 for SVR4 vararg calls
16182b3821208286aeb43f603fdac98832bd662dad9Hal Finkel      CR6SET,
16282b3821208286aeb43f603fdac98832bd662dad9Hal Finkel      CR6UNSET,
16382b3821208286aeb43f603fdac98832bd662dad9Hal Finkel
164b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// G8RC = ADDIS_GOT_TPREL_HA %X2, Symbol - Used by the initial-exec
165b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// TLS model, produces an ADDIS8 instruction that adds the GOT
166b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// base to sym@got@tprel@ha.
167b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      ADDIS_GOT_TPREL_HA,
168b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt
169b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// G8RC = LD_GOT_TPREL_L Symbol, G8RReg - Used by the initial-exec
170d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// TLS model, produces a LD instruction with base register G8RReg
171b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// and offset sym@got@tprel@l.  This completes the addition that
172b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      /// finds the offset of "sym" relative to the thread pointer.
173b453e16855f347e300f1dc0cd0dfbdd65c27b0d2Bill Schmidt      LD_GOT_TPREL_L,
174d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt
175d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// G8RC = ADD_TLS G8RReg, Symbol - Used by the initial-exec TLS
176d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// model, produces an ADD instruction that adds the contents of
177d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// G8RReg to the thread pointer.  Symbol contains a relocation
178d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// sym@tls which is to be replaced by the thread pointer and
179d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// identifies to the linker that the instruction is part of a
180d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      /// TLS sequence.
181d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt      ADD_TLS,
182d7802bf0ddcac16ee910105922492aee86a53e1bBill Schmidt
18357ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// G8RC = ADDIS_TLSGD_HA %X2, Symbol - For the general-dynamic TLS
18457ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// model, produces an ADDIS8 instruction that adds the GOT base
18557ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// register to sym@got@tlsgd@ha.
18657ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      ADDIS_TLSGD_HA,
18757ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt
18857ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// G8RC = ADDI_TLSGD_L G8RReg, Symbol - For the general-dynamic TLS
18957ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// model, produces an ADDI8 instruction that adds G8RReg to
19057ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// sym@got@tlsgd@l.
19157ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      ADDI_TLSGD_L,
19257ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt
19357ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// G8RC = GET_TLS_ADDR %X3, Symbol - For the general-dynamic TLS
19457ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      /// model, produces a call to __tls_get_addr(sym@tlsgd).
19557ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt      GET_TLS_ADDR,
19657ac1f458a754f30cf500410b438fb260f9b8fe5Bill Schmidt
197349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// G8RC = ADDIS_TLSLD_HA %X2, Symbol - For the local-dynamic TLS
198349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// model, produces an ADDIS8 instruction that adds the GOT base
199349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// register to sym@got@tlsld@ha.
200349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      ADDIS_TLSLD_HA,
201349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt
202349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// G8RC = ADDI_TLSLD_L G8RReg, Symbol - For the local-dynamic TLS
203349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// model, produces an ADDI8 instruction that adds G8RReg to
204349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// sym@got@tlsld@l.
205349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      ADDI_TLSLD_L,
206349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt
207349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// G8RC = GET_TLSLD_ADDR %X3, Symbol - For the local-dynamic TLS
208349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// model, produces a call to __tls_get_addr(sym@tlsld).
209349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      GET_TLSLD_ADDR,
210349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt
211349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// G8RC = ADDIS_DTPREL_HA %X3, Symbol, Chain - For the
212349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// local-dynamic TLS model, produces an ADDIS8 instruction
213349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// that adds X3 to sym@dtprel@ha.  The Chain operand is needed
214349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// to tie this in place following a copy to %X3 from the result
215349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// of a GET_TLSLD_ADDR.
216349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      ADDIS_DTPREL_HA,
217349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt
218349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// G8RC = ADDI_DTPREL_L G8RReg, Symbol - For the local-dynamic TLS
219349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// model, produces an ADDI8 instruction that adds G8RReg to
220349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      /// sym@got@dtprel@l.
221349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt      ADDI_DTPREL_L,
222349c2787cf9e174c8aa955bf8e3b09a405b2aeceBill Schmidt
223b34c79e4bbe5accbb54d0291e8bef5d2bfef32e4Bill Schmidt      /// VRRC = VADD_SPLAT Elt, EltSize - Temporary node to be expanded
224abc402886e407e21d845cccc15723cffd6e2dc20Bill Schmidt      /// during instruction selection to optimize a BUILD_VECTOR into
225abc402886e407e21d845cccc15723cffd6e2dc20Bill Schmidt      /// operations on splats.  This is necessary to avoid losing these
226abc402886e407e21d845cccc15723cffd6e2dc20Bill Schmidt      /// optimizations due to constant folding.
227b34c79e4bbe5accbb54d0291e8bef5d2bfef32e4Bill Schmidt      VADD_SPLAT,
228b34c79e4bbe5accbb54d0291e8bef5d2bfef32e4Bill Schmidt
22995771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson      /// CHAIN = STBRX CHAIN, GPRC, Ptr, Type - This is a
230c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// byte-swapping store instruction.  It byte-swaps the low "Type" bits of
231c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// the GPRC input, then stores it through Ptr.  Type can be either i16 or
232c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// i32.
2339ad0f4907b3ba0916a8b6cdb95d298d2ddb7d405Hal Finkel      STBRX = ISD::FIRST_TARGET_MEMORY_OPCODE,
23495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
23595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson      /// GPRC, CHAIN = LBRX CHAIN, Ptr, Type - This is a
236c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// byte-swapping load instruction.  It loads "Type" bits, byte swaps it,
237c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// then puts it in the bottom bits of the GPRC.  TYPE can be either i16
238c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      /// or i32.
23934a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      LBRX,
24034a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt
241f170cc9b2eb98efee40ee22cff6bcf401c209b00Hal Finkel      /// STFIWX - The STFIWX instruction.  The first operand is an input token
242f170cc9b2eb98efee40ee22cff6bcf401c209b00Hal Finkel      /// chain, then an f64 value to store, then an address to store it to.
243f170cc9b2eb98efee40ee22cff6bcf401c209b00Hal Finkel      STFIWX,
244f170cc9b2eb98efee40ee22cff6bcf401c209b00Hal Finkel
2458049ab15e4b638a07d6f230329945c2310eca27bHal Finkel      /// GPRC, CHAIN = LFIWAX CHAIN, Ptr - This is a floating-point
2468049ab15e4b638a07d6f230329945c2310eca27bHal Finkel      /// load which sign-extends from a 32-bit integer value into the
2478049ab15e4b638a07d6f230329945c2310eca27bHal Finkel      /// destination 64-bit register.
2488049ab15e4b638a07d6f230329945c2310eca27bHal Finkel      LFIWAX,
2498049ab15e4b638a07d6f230329945c2310eca27bHal Finkel
25053b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// G8RC = ADDIS_TOC_HA %X2, Symbol - For medium and large code model,
25153b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// produces an ADDIS8 instruction that adds the TOC base register to
25253b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// sym@toc@ha.
25334a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      ADDIS_TOC_HA,
25434a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt
25553b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// G8RC = LD_TOC_L Symbol, G8RReg - For medium and large code model,
25653b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// produces a LD instruction with base register G8RReg and offset
25753b0b0e75480121e4e01a7a76e17909e92b1762aBill Schmidt      /// sym@toc@l.  Preceded by an ADDIS_TOC_HA to form a full 32-bit offset.
25834a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      LD_TOC_L,
25934a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt
26034a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      /// G8RC = ADDI_TOC_L G8RReg, Symbol - For medium code model, produces
26134a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      /// an ADDI8 instruction that adds G8RReg to sym@toc@l.
26234a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      /// Preceded by an ADDIS_TOC_HA to form a full 32-bit offset.
26334a9d4b3b9b7858b729a1af67afa721c048fe5e7Bill Schmidt      ADDI_TOC_L
264281b55ebeccd3f0d723888c1bb9ec6e476f708f1Chris Lattner    };
2653c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner  }
2663c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner
2673c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner  /// Define some predicates that are used for node matching.
2683c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner  namespace PPC {
269ddb739e5ea6ccf6fa4f4e2a23e3da550868efaa1Chris Lattner    /// isVPKUHUMShuffleMask - Return true if this is the shuffle mask for a
270ddb739e5ea6ccf6fa4f4e2a23e3da550868efaa1Chris Lattner    /// VPKUHUM instruction.
2719008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isVPKUHUMShuffleMask(ShuffleVectorSDNode *N, bool isUnary);
27295771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
273ddb739e5ea6ccf6fa4f4e2a23e3da550868efaa1Chris Lattner    /// isVPKUWUMShuffleMask - Return true if this is the shuffle mask for a
274ddb739e5ea6ccf6fa4f4e2a23e3da550868efaa1Chris Lattner    /// VPKUWUM instruction.
2759008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isVPKUWUMShuffleMask(ShuffleVectorSDNode *N, bool isUnary);
276116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner
277116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner    /// isVMRGLShuffleMask - Return true if this is a shuffle mask suitable for
278116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner    /// a VRGL* instruction with the specified unit size (1,2 or 4 bytes).
2799008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isVMRGLShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize,
2809008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman                            bool isUnary);
281116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner
282116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner    /// isVMRGHShuffleMask - Return true if this is a shuffle mask suitable for
283116cc48e30b9c307bf3eec29c890b4ba25cd18dbChris Lattner    /// a VRGH* instruction with the specified unit size (1,2 or 4 bytes).
2849008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isVMRGHShuffleMask(ShuffleVectorSDNode *N, unsigned UnitSize,
2859008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman                            bool isUnary);
28695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
287d0608e191ff9c00af68985f246410c219d1bec57Chris Lattner    /// isVSLDOIShuffleMask - If this is a vsldoi shuffle mask, return the shift
288d0608e191ff9c00af68985f246410c219d1bec57Chris Lattner    /// amount, otherwise return -1.
289f24380e78ecc8a2db1b2116867d878b1e7c6f6edChris Lattner    int isVSLDOIShuffleMask(SDNode *N, bool isUnary);
29095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
2913c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner    /// isSplatShuffleMask - Return true if the specified VECTOR_SHUFFLE operand
2923c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner    /// specifies a splat of a single element that is suitable for input to
2933c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner    /// VSPLTB/VSPLTH/VSPLTW.
2949008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isSplatShuffleMask(ShuffleVectorSDNode *N, unsigned EltSize);
29595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
29666ffe6be0c7b50100a00cb0cc87a5d4983818572Evan Cheng    /// isAllNegativeZeroVector - Returns true if all elements of build_vector
29766ffe6be0c7b50100a00cb0cc87a5d4983818572Evan Cheng    /// are -0.0.
29866ffe6be0c7b50100a00cb0cc87a5d4983818572Evan Cheng    bool isAllNegativeZeroVector(SDNode *N);
29966ffe6be0c7b50100a00cb0cc87a5d4983818572Evan Cheng
3003c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner    /// getVSPLTImmediate - Return the appropriate VSPLT* immediate to splat the
3013c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner    /// specified isSplatShuffleMask VECTOR_SHUFFLE mask.
3027ff7e674580adad7a5bccdbd74cf9c9f05e46d0fChris Lattner    unsigned getVSPLTImmediate(SDNode *N, unsigned EltSize);
30395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
304e87192a854ff0f2f1904dd9ea282eb36059bb5afChris Lattner    /// get_VSPLTI_elt - If this is a build_vector of constants which can be
305140a58f9dfda30dbb80edd3da1b5632c178f7efcChris Lattner    /// formed by using a vspltis[bhw] instruction of the specified element
306140a58f9dfda30dbb80edd3da1b5632c178f7efcChris Lattner    /// size, return the constant being splatted.  The ByteSize field indicates
307140a58f9dfda30dbb80edd3da1b5632c178f7efcChris Lattner    /// the number of bytes of each element [124] -> [bhw].
308475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue get_VSPLTI_elt(SDNode *N, unsigned ByteSize, SelectionDAG &DAG);
3093c0f9cc90cdcb70caf0dc517b9f9206d731aeb70Chris Lattner  }
31095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
31121e463b2bf864671a87ebe386cb100ef9349a540Nate Begeman  class PPCTargetLowering : public TargetLowering {
312331d1bc5dfe1be9090e29f9af9579888a63a9a79Chris Lattner    const PPCSubtarget &PPCSubTarget;
3137ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel    const PPCRegisterInfo *PPCRegInfo;
3141e93df6f0b5ee6e36d7ec18e6035f0f5a53e5ec6Dan Gohman
3157c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner  public:
31661e729e2e9517ab2d8887bab86fb377900fa1081Dan Gohman    explicit PPCTargetLowering(PPCTargetMachine &TM);
31795771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
318da6d20f0c15205923cb2c3ef4bf9b5d77de88881Chris Lattner    /// getTargetNodeName() - This method returns the name of a target specific
319da6d20f0c15205923cb2c3ef4bf9b5d77de88881Chris Lattner    /// DAG node.
320da6d20f0c15205923cb2c3ef4bf9b5d77de88881Chris Lattner    virtual const char *getTargetNodeName(unsigned Opcode) const;
321fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner
322a6b20ced765b67a85d9219d0c8547fc9c133e14fMichael Liao    virtual MVT getScalarShiftAmountTy(EVT LHSTy) const { return MVT::i32; }
32395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
3245b8f82e35b51bf007de07a7ca9347d804084ddf8Scott Michel    /// getSetCCResultType - Return the ISD::SETCC ValueType
32528b77e968d2b01fc9da724762bd8ddcd80650e32Duncan Sands    virtual EVT getSetCCResultType(EVT VT) const;
3265b8f82e35b51bf007de07a7ca9347d804084ddf8Scott Michel
327fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// getPreIndexedAddressParts - returns true by value, base pointer and
328fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// offset pointer and addressing mode by reference if the node's address
329fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// can be legally represented as pre-indexed load / store address.
330475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual bool getPreIndexedAddressParts(SDNode *N, SDValue &Base,
331475871a144eb604ddaf37503397ba0941442e5fbDan Gohman                                           SDValue &Offset,
332144d8f09e139f691cafadbc17873943ba4c465f3Evan Cheng                                           ISD::MemIndexedMode &AM,
33373e0914848662404cf2aa18eb049ff5aae543388Dan Gohman                                           SelectionDAG &DAG) const;
33495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
335fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// SelectAddressRegReg - Given the specified addressed, check to see if it
336fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// can be represented as an indexed [r+r] operation.  Returns false if it
337fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// can be more efficiently represented with [r+imm].
338475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    bool SelectAddressRegReg(SDValue N, SDValue &Base, SDValue &Index,
33973e0914848662404cf2aa18eb049ff5aae543388Dan Gohman                             SelectionDAG &DAG) const;
34095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
341fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// SelectAddressRegImm - Returns true if the address N can be represented
342fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// by a base register plus a signed 16-bit displacement [r+imm], and if it
343fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// is not better represented as reg+reg.
344475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    bool SelectAddressRegImm(SDValue N, SDValue &Disp, SDValue &Base,
34573e0914848662404cf2aa18eb049ff5aae543388Dan Gohman                             SelectionDAG &DAG) const;
34695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
347fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// SelectAddressRegRegOnly - Given the specified addressed, force it to be
348fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// represented as an indexed [r+r] operation.
349475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    bool SelectAddressRegRegOnly(SDValue N, SDValue &Base, SDValue &Index,
35073e0914848662404cf2aa18eb049ff5aae543388Dan Gohman                                 SelectionDAG &DAG) const;
351fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner
352fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// SelectAddressRegImmShift - Returns true if the address N can be
353fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// represented by a base register plus a signed 14-bit displacement
354fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner    /// [r+imm*4].  Suitable for use by STD and friends.
355475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    bool SelectAddressRegImmShift(SDValue N, SDValue &Disp, SDValue &Base,
35673e0914848662404cf2aa18eb049ff5aae543388Dan Gohman                                  SelectionDAG &DAG) const;
357fc5b1ab94959879a91c34aee8859e652a50270d0Chris Lattner
3583f31d492a5d0fadf11290e8453f8c519a89b1302Hal Finkel    Sched::Preference getSchedulingPreference(SDNode *N) const;
35995771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
360e4bc9ea0a560d8a0ba42f5a2da617e1f1f834710Chris Lattner    /// LowerOperation - Provide custom lowering hooks for some operations.
361e4bc9ea0a560d8a0ba42f5a2da617e1f1f834710Chris Lattner    ///
362d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
3631f873003266fbdec7c2c48a965c60f4e2e35a158Chris Lattner
3641607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    /// ReplaceNodeResults - Replace the results of node with an illegal result
3651607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    /// type with new values built out of custom code.
3661607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    ///
3671607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    virtual void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results,
368d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                    SelectionDAG &DAG) const;
3691607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands
370475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
37195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
372475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual void computeMaskedBitsForTargetNode(const SDValue Op,
37395771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson                                                APInt &KnownZero,
374fd29e0eb060ea8b4d490860329234d2ae5f5952eDan Gohman                                                APInt &KnownOne,
375ea859be53ca13a1547c4675549946b74dc3c6f41Dan Gohman                                                const SelectionDAG &DAG,
376bbe77de450ef36b4f83cc3b57705a9758adbd925Chris Lattner                                                unsigned Depth = 0) const;
3774a95945fa5aa431110f50092f4a45d24772a553bNate Begeman
378af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman    virtual MachineBasicBlock *
379af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman      EmitInstrWithCustomInserter(MachineInstr *MI,
380af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman                                  MachineBasicBlock *MBB) const;
38195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson    MachineBasicBlock *EmitAtomicBinary(MachineInstr *MI,
382bdab93a2ef5d9574bb4e322e020849f9bc9c90d7Dale Johannesen                                        MachineBasicBlock *MBB, bool is64Bit,
3831fdbc1dd4e9cb42c79a30e8dc308c322e923cc52Dan Gohman                                        unsigned BinOpcode) const;
38495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson    MachineBasicBlock *EmitPartwordAtomicBinary(MachineInstr *MI,
38595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson                                                MachineBasicBlock *MBB,
3861fdbc1dd4e9cb42c79a30e8dc308c322e923cc52Dan Gohman                                            bool is8bit, unsigned Opcode) const;
38795771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
3887ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel    MachineBasicBlock *emitEHSjLjSetJmp(MachineInstr *MI,
3897ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel                                        MachineBasicBlock *MBB) const;
3907ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel
3917ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel    MachineBasicBlock *emitEHSjLjLongJmp(MachineInstr *MI,
3927ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel                                         MachineBasicBlock *MBB) const;
3937ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel
3944234f57fa02b1f04a9f52a7b3c2aa22d32ac521cChris Lattner    ConstraintType getConstraintType(const std::string &Constraint) const;
39544ab89eb376af838d1123293a79975aede501464John Thompson
39644ab89eb376af838d1123293a79975aede501464John Thompson    /// Examine constraint string and operand type and determine a weight value.
39744ab89eb376af838d1123293a79975aede501464John Thompson    /// The operand object must already have been set up with the operand type.
39844ab89eb376af838d1123293a79975aede501464John Thompson    ConstraintWeight getSingleConstraintMatchWeight(
39944ab89eb376af838d1123293a79975aede501464John Thompson      AsmOperandInfo &info, const char *constraint) const;
40044ab89eb376af838d1123293a79975aede501464John Thompson
40195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson    std::pair<unsigned, const TargetRegisterClass*>
402331d1bc5dfe1be9090e29f9af9579888a63a9a79Chris Lattner      getRegForInlineAsmConstraint(const std::string &Constraint,
403e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson                                   EVT VT) const;
404c4c6257c1a154279bf10e9498d46d6c1793dbaa7Evan Cheng
40528d08fdb9f6572cafd5aae95c7caffa3cd136d8eDale Johannesen    /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
40628d08fdb9f6572cafd5aae95c7caffa3cd136d8eDale Johannesen    /// function arguments in the caller parameter area.  This is the actual
40728d08fdb9f6572cafd5aae95c7caffa3cd136d8eDale Johannesen    /// alignment, not its logarithm.
408db125cfaf57cc83e7dd7453de2d509bc8efd0e5eChris Lattner    unsigned getByValTypeAlignment(Type *Ty) const;
40928d08fdb9f6572cafd5aae95c7caffa3cd136d8eDale Johannesen
41048884cd80b52be1528618f2e9b3425ac24e7b5caChris Lattner    /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
4111784d160e4efa75782884d451d0788b9457e67dcDale Johannesen    /// vector.  If it is invalid, don't add anything to Ops.
412475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual void LowerAsmOperandForConstraint(SDValue Op,
413100c83341676d8aae8fc34b5452563ed08b14f3eEric Christopher                                              std::string &Constraint,
414475871a144eb604ddaf37503397ba0941442e5fbDan Gohman                                              std::vector<SDValue> &Ops,
4155e764233f398b6929b67701672a5e78fec20ce2eChris Lattner                                              SelectionDAG &DAG) const;
41695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
417c9addb74883fef318140272768422656a694341fChris Lattner    /// isLegalAddressingMode - Return true if the addressing mode represented
418c9addb74883fef318140272768422656a694341fChris Lattner    /// by AM is legal for this target, for a load/store of the specified type.
419db125cfaf57cc83e7dd7453de2d509bc8efd0e5eChris Lattner    virtual bool isLegalAddressingMode(const AddrMode &AM, Type *Ty)const;
42095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
421c4c6257c1a154279bf10e9498d46d6c1793dbaa7Evan Cheng    /// isLegalAddressImmediate - Return true if the integer value can be used
422861939152debbaa15a55a196a4321837c7bc379dEvan Cheng    /// as the offset of the target addressing mode for load / store of the
423861939152debbaa15a55a196a4321837c7bc379dEvan Cheng    /// given type.
424db125cfaf57cc83e7dd7453de2d509bc8efd0e5eChris Lattner    virtual bool isLegalAddressImmediate(int64_t V, Type *Ty) const;
425861939152debbaa15a55a196a4321837c7bc379dEvan Cheng
426861939152debbaa15a55a196a4321837c7bc379dEvan Cheng    /// isLegalAddressImmediate - Return true if the GlobalValue can be used as
427861939152debbaa15a55a196a4321837c7bc379dEvan Cheng    /// the offset of the target addressing mode.
428861939152debbaa15a55a196a4321837c7bc379dEvan Cheng    virtual bool isLegalAddressImmediate(GlobalValue *GV) const;
42943c6e7cd9b0d9a3b0006650ddfac256848f10d51Nicolas Geoffray
43054aeea39a743effe88eedb43d2f7f4805e806ab5Dan Gohman    virtual bool isOffsetFoldingLegal(const GlobalAddressSDNode *GA) const;
43195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
43242642d06c915a26af1400de6ce6a53c333e5c247Evan Cheng    /// getOptimalMemOpType - Returns the target specific optimal type for load
433f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// and store operations as a result of memset, memcpy, and memmove
434f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// lowering. If DstAlign is zero that means it's safe to destination
435f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// alignment can satisfy any constraint. Similarly if SrcAlign is zero it
436f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// means there isn't a need to check it against alignment requirement,
437946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng    /// probably because the source does not need to be loaded. If 'IsMemset' is
438946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng    /// true, that means it's expanding a memset. If 'ZeroMemset' is true, that
439946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng    /// means it's a memset of zero. 'MemcpyStrSrc' indicates whether the memcpy
440946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng    /// source is constant so it does not need to be loaded.
44137f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman    /// It returns EVT::Other if the type should be determined using generic
44237f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman    /// target-independent logic.
443f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    virtual EVT
444946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng    getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
445946a3a9f22c967d5432eaab5fa464b91343477cdEvan Cheng                        bool IsMemset, bool ZeroMemset, bool MemcpyStrSrc,
44637f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman                        MachineFunction &MF) const;
44754aeea39a743effe88eedb43d2f7f4805e806ab5Dan Gohman
4482d37f7b979a24930c444f9783173a90a6e548118Hal Finkel    /// Is unaligned memory access allowed for the given type, and is it fast
4492d37f7b979a24930c444f9783173a90a6e548118Hal Finkel    /// relative to software emulation.
4502d37f7b979a24930c444f9783173a90a6e548118Hal Finkel    virtual bool allowsUnalignedMemoryAccesses(EVT VT, bool *Fast = 0) const;
4512d37f7b979a24930c444f9783173a90a6e548118Hal Finkel
452070b8dba809dd75267327cc823118bf7e171d17dHal Finkel    /// isFMAFasterThanMulAndAdd - Return true if an FMA operation is faster than
453070b8dba809dd75267327cc823118bf7e171d17dHal Finkel    /// a pair of mul and add instructions. fmuladd intrinsics will be expanded to
454070b8dba809dd75267327cc823118bf7e171d17dHal Finkel    /// FMAs when this method returns true (and FMAs are legal), otherwise fmuladd
455070b8dba809dd75267327cc823118bf7e171d17dHal Finkel    /// is expanded to mul + add.
456070b8dba809dd75267327cc823118bf7e171d17dHal Finkel    virtual bool isFMAFasterThanMulAndAdd(EVT VT) const;
457070b8dba809dd75267327cc823118bf7e171d17dHal Finkel
45854fc97dcdc0ab747f49bd09c5a877bfd2a00e364Evan Cheng  private:
459475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue getFramePointerFrameIndex(SelectionDAG & DAG) const;
460475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue getReturnAddrFrameIndex(SelectionDAG & DAG) const;
46130e62c098b5841259f8026df1c5c45c7c1182a38Arnold Schwaighofer
4620c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng    bool
4630c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng    IsEligibleForTailCallOptimization(SDValue Callee,
4640c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                      CallingConv::ID CalleeCC,
4650c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                      bool isVarArg,
4660c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                      const SmallVectorImpl<ISD::InputArg> &Ins,
4670c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                      SelectionDAG& DAG) const;
4680c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng
469475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue EmitTailCallLoadFPAndRetAddr(SelectionDAG & DAG,
47033c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen                                         int SPDiff,
47133c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen                                         SDValue Chain,
47233c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen                                         SDValue &LROpOut,
47333c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen                                         SDValue &FPOpOut,
4742a9ddfb903ae3baede7282348afae1f750905248Tilmann Scheller                                         bool isDarwinABI,
475d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                         DebugLoc dl) const;
476d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman
477d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
478d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
479d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
480d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
481fd42ed676e37c29364f53f848320b7cb706111e0Roman Divacky    SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
482d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
483d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
484d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
4854a544a79bd735967f1d33fe675ae4566dbd17813Duncan Sands    SDValue LowerINIT_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const;
4864a544a79bd735967f1d33fe675ae4566dbd17813Duncan Sands    SDValue LowerADJUST_TRAMPOLINE(SDValue Op, SelectionDAG &DAG) const;
487475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG,
488d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                         const PPCSubtarget &Subtarget) const;
4891e93df6f0b5ee6e36d7ec18e6035f0f5a53e5ec6Dan Gohman    SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG,
490d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                       const PPCSubtarget &Subtarget) const;
491475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue LowerSTACKRESTORE(SDValue Op, SelectionDAG &DAG,
492d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                const PPCSubtarget &Subtarget) const;
493475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG,
494d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                      const PPCSubtarget &Subtarget) const;
495d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSELECT_CC(SDValue Op, SelectionDAG &DAG) const;
496d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFP_TO_INT(SDValue Op, SelectionDAG &DAG, DebugLoc dl) const;
497d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
498d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const;
499d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSHL_PARTS(SDValue Op, SelectionDAG &DAG) const;
500d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSRL_PARTS(SDValue Op, SelectionDAG &DAG) const;
501d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSRA_PARTS(SDValue Op, SelectionDAG &DAG) const;
502d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
503d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
504d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
505d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSCALAR_TO_VECTOR(SDValue Op, SelectionDAG &DAG) const;
506d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerMUL(SDValue Op, SelectionDAG &DAG) const;
50798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
50898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
50965c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                            CallingConv::ID CallConv, bool isVarArg,
51098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                            const SmallVectorImpl<ISD::InputArg> &Ins,
51198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                            DebugLoc dl, SelectionDAG &DAG,
512d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                            SmallVectorImpl<SDValue> &InVals) const;
51365c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel    SDValue FinishCall(CallingConv::ID CallConv, DebugLoc dl, bool isTailCall,
51498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       bool isVarArg,
51598ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       SelectionDAG &DAG,
51698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       SmallVector<std::pair<unsigned, SDValue>, 8>
51798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                         &RegsToPass,
51898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       SDValue InFlag, SDValue Chain,
51998ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       SDValue &Callee,
52098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       int SPDiff, unsigned NumBytes,
52198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       const SmallVectorImpl<ISD::InputArg> &Ins,
522d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                       SmallVectorImpl<SDValue> &InVals) const;
52398ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
52498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
52598ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman      LowerFormalArguments(SDValue Chain,
52665c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                           CallingConv::ID CallConv, bool isVarArg,
52798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                           const SmallVectorImpl<ISD::InputArg> &Ins,
52898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                           DebugLoc dl, SelectionDAG &DAG,
529d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                           SmallVectorImpl<SDValue> &InVals) const;
53098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
53198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
532d2ea0e10cbd158c93fb870cdd03001b9cd1156b8Justin Holewinski      LowerCall(TargetLowering::CallLoweringInfo &CLI,
533d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                SmallVectorImpl<SDValue> &InVals) const;
53498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
535d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel    virtual bool
536d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel      CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
537d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel                   bool isVarArg,
538d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel                   const SmallVectorImpl<ISD::OutputArg> &Outs,
539d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel                   LLVMContext &Context) const;
540d712f935f7e027a733741e6ca67b3237a59f65d1Hal Finkel
54198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
54298ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman      LowerReturn(SDValue Chain,
54365c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                  CallingConv::ID CallConv, bool isVarArg,
54498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                  const SmallVectorImpl<ISD::OutputArg> &Outs,
545c9403659a98bf6487ab6fbf40b81628b5695c02eDan Gohman                  const SmallVectorImpl<SDValue> &OutVals,
546d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                  DebugLoc dl, SelectionDAG &DAG) const;
54798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
54898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue
549726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt      extendArgForPPC64(ISD::ArgFlagsTy Flags, EVT ObjectVT, SelectionDAG &DAG,
550726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                        SDValue ArgVal, DebugLoc dl) const;
551726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt
552726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt    void
553726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt      setMinReservedArea(MachineFunction &MF, SelectionDAG &DAG,
554726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                         unsigned nAltivecParamsAtEnd,
555726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                         unsigned MinReservedArea, bool isPPC64) const;
556726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt
557726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt    SDValue
558b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt      LowerFormalArguments_Darwin(SDValue Chain,
559b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt                                  CallingConv::ID CallConv, bool isVarArg,
560b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt                                  const SmallVectorImpl<ISD::InputArg> &Ins,
561b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt                                  DebugLoc dl, SelectionDAG &DAG,
562b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt                                  SmallVectorImpl<SDValue> &InVals) const;
563b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt    SDValue
564b2544ece597192266199ec00ece2ee5bb6273cd9Bill Schmidt      LowerFormalArguments_64SVR4(SDValue Chain,
56565c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                                  CallingConv::ID CallConv, bool isVarArg,
56698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                                  const SmallVectorImpl<ISD::InputArg> &Ins,
56798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                                  DebugLoc dl, SelectionDAG &DAG,
568d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                  SmallVectorImpl<SDValue> &InVals) const;
56998ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue
570419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt      LowerFormalArguments_32SVR4(SDValue Chain,
571419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                                  CallingConv::ID CallConv, bool isVarArg,
572419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                                  const SmallVectorImpl<ISD::InputArg> &Ins,
573419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                                  DebugLoc dl, SelectionDAG &DAG,
574419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                                  SmallVectorImpl<SDValue> &InVals) const;
57598ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
57698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue
577726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt      createMemcpyOutsideCallSeq(SDValue Arg, SDValue PtrOff,
578726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                                 SDValue CallSeqStart, ISD::ArgFlagsTy Flags,
579726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                                 SelectionDAG &DAG, DebugLoc dl) const;
580726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt
581726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt    SDValue
582726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt      LowerCall_Darwin(SDValue Chain, SDValue Callee,
583726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       CallingConv::ID CallConv,
584726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       bool isVarArg, bool isTailCall,
585726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       const SmallVectorImpl<ISD::OutputArg> &Outs,
586726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       const SmallVectorImpl<SDValue> &OutVals,
587726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       const SmallVectorImpl<ISD::InputArg> &Ins,
588726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       DebugLoc dl, SelectionDAG &DAG,
589726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt                       SmallVectorImpl<SDValue> &InVals) const;
590726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt    SDValue
591726c23705c056e4d86f0b3d833803f1d43e6eee4Bill Schmidt      LowerCall_64SVR4(SDValue Chain, SDValue Callee,
592419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                       CallingConv::ID CallConv,
5934bfcd4acbc7d12aa55f8de9af84a38422f0f6d83Evan Cheng                       bool isVarArg, bool isTailCall,
59498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       const SmallVectorImpl<ISD::OutputArg> &Outs,
595c9403659a98bf6487ab6fbf40b81628b5695c02eDan Gohman                       const SmallVectorImpl<SDValue> &OutVals,
59698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       const SmallVectorImpl<ISD::InputArg> &Ins,
59798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                       DebugLoc dl, SelectionDAG &DAG,
598d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                       SmallVectorImpl<SDValue> &InVals) const;
59998ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue
600419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt    LowerCall_32SVR4(SDValue Chain, SDValue Callee, CallingConv::ID CallConv,
601419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     bool isVarArg, bool isTailCall,
602419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     const SmallVectorImpl<ISD::OutputArg> &Outs,
603419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     const SmallVectorImpl<SDValue> &OutVals,
604419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     const SmallVectorImpl<ISD::InputArg> &Ins,
605419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     DebugLoc dl, SelectionDAG &DAG,
606419f376564d17eaef7e5b4a77b066668e4272eccBill Schmidt                     SmallVectorImpl<SDValue> &InVals) const;
6077ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel
6087ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel    SDValue lowerEH_SJLJ_SETJMP(SDValue Op, SelectionDAG &DAG) const;
6097ee74a663a3b4d4ee6b55d23362f347ed1d390c2Hal Finkel    SDValue lowerEH_SJLJ_LONGJMP(SDValue Op, SelectionDAG &DAG) const;
6107c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner  };
6117c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner}
6127c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner
6137c5a3d390a463fb50a6eee7ae3174817925e6d28Chris Lattner#endif   // LLVM_TARGET_POWERPC_PPC32ISELLOWERING_H
614