X86ISelLowering.h revision ef41ff618f2537539b538e6c7bf471c753391f92
1dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//===-- X86ISelLowering.h - X86 DAG Lowering Interface ----------*- C++ -*-===//
2dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//
3dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//                     The LLVM Compiler Infrastructure
4dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//
54ee451de366474b9c228b4e5fa573795a715216dChris Lattner// This file is distributed under the University of Illinois Open Source
64ee451de366474b9c228b4e5fa573795a715216dChris Lattner// License. See LICENSE.TXT for details.
7dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//
8dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//===----------------------------------------------------------------------===//
9dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//
10dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner// This file defines the interfaces that X86 uses to lower LLVM code into a
11dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner// selection DAG.
12dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//
13dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner//===----------------------------------------------------------------------===//
14dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
15dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner#ifndef X86ISELLOWERING_H
16dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner#define X86ISELLOWERING_H
17dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
18559806f575297866609c7bef0e5c1084dcdda9a5Evan Cheng#include "X86Subtarget.h"
192365f51ed03afe6993bae962fdc2e5a956a64cd5Anton Korobeynikov#include "X86RegisterInfo.h"
2086737665b81550fdb575f7d8cc5decc801a7813dGordon Henriksen#include "X86MachineFunctionInfo.h"
21dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner#include "llvm/Target/TargetLowering.h"
22ddc419c581ac827045d614099adaa60765ce1ebeEvan Cheng#include "llvm/Target/TargetOptions.h"
23b388eb82fb4a95e2f6d54163dfcf962b8032bae8Ted Kremenek#include "llvm/CodeGen/FastISel.h"
24dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner#include "llvm/CodeGen/SelectionDAG.h"
251b5dcc34b701639f94008658a2042abc43b9b910Rafael Espindola#include "llvm/CodeGen/CallingConvLower.h"
26dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
27dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattnernamespace llvm {
28dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  namespace X86ISD {
29d9558e0ba6ddcf2798cfb88cc56e5f1c8135eb0dEvan Cheng    // X86 Specific DAG Nodes
30dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner    enum NodeType {
31dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      // Start the numbering where the builtin ops leave off.
320ba2bcfcc3149a25d08aa8aa00fb6c34a4e25bddDan Gohman      FIRST_NUMBER = ISD::BUILTIN_OP_END,
33dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
3418efe269b12624d74c0af6104e88864d6a932344Evan Cheng      /// BSF - Bit scan forward.
3518efe269b12624d74c0af6104e88864d6a932344Evan Cheng      /// BSR - Bit scan reverse.
3618efe269b12624d74c0af6104e88864d6a932344Evan Cheng      BSF,
3718efe269b12624d74c0af6104e88864d6a932344Evan Cheng      BSR,
3818efe269b12624d74c0af6104e88864d6a932344Evan Cheng
39e3413160ca2fb42854b2a23be6b2114c1da2778cEvan Cheng      /// SHLD, SHRD - Double shift instructions. These correspond to
40e3413160ca2fb42854b2a23be6b2114c1da2778cEvan Cheng      /// X86::SHLDxx and X86::SHRDxx instructions.
41e3413160ca2fb42854b2a23be6b2114c1da2778cEvan Cheng      SHLD,
42e3413160ca2fb42854b2a23be6b2114c1da2778cEvan Cheng      SHRD,
43e3413160ca2fb42854b2a23be6b2114c1da2778cEvan Cheng
44ef6ffb17c71232af5962f9926b31508eb942cddcEvan Cheng      /// FAND - Bitwise logical AND of floating point values. This corresponds
45ef6ffb17c71232af5962f9926b31508eb942cddcEvan Cheng      /// to X86::ANDPS or X86::ANDPD.
46ef6ffb17c71232af5962f9926b31508eb942cddcEvan Cheng      FAND,
47ef6ffb17c71232af5962f9926b31508eb942cddcEvan Cheng
4868c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng      /// FOR - Bitwise logical OR of floating point values. This corresponds
4968c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng      /// to X86::ORPS or X86::ORPD.
5068c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng      FOR,
5168c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng
52223547ab3101f32252cb704a67bd757e00fdbd16Evan Cheng      /// FXOR - Bitwise logical XOR of floating point values. This corresponds
53223547ab3101f32252cb704a67bd757e00fdbd16Evan Cheng      /// to X86::XORPS or X86::XORPD.
54223547ab3101f32252cb704a67bd757e00fdbd16Evan Cheng      FXOR,
55223547ab3101f32252cb704a67bd757e00fdbd16Evan Cheng
5673d6cf12adfd915897cce7e1ba9de00f962502d5Evan Cheng      /// FSRL - Bitwise logical right shift of floating point values. These
5773d6cf12adfd915897cce7e1ba9de00f962502d5Evan Cheng      /// corresponds to X86::PSRLDQ.
5868c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng      FSRL,
5968c47cba3589b2fc079bab0836d1ae6fc3a6278dEvan Cheng
6098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman      /// CALL - These operations represent an abstract X86 call
61dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      /// instruction, which includes a bunch of information.  In particular the
62dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      /// operands of these node are:
63dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///
64dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #0 - The incoming token chain
65dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #1 - The callee
66dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #2 - The number of arg bytes the caller pushes on the stack.
67dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #3 - The number of arg bytes the callee pops off the stack.
68dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #4 - The value to pass in AL/AX/EAX (optional)
69dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #5 - The value to pass in DL/DX/EDX (optional)
70dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///
71dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      /// The result values of these nodes are:
72dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///
73dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #0 - The outgoing token chain
74dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #1 - The first register result value (optional)
75dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///     #2 - The second register result value (optional)
76dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      ///
77dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner      CALL,
7898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
796e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer      /// RDTSC_DAG - This operation implements the lowering for
80b873ff322c28ce097762355921100b677c71238dAndrew Lenharth      /// readcyclecounter
81b873ff322c28ce097762355921100b677c71238dAndrew Lenharth      RDTSC_DAG,
827df96d66729d1f33934de7b52553e5f071686041Evan Cheng
837df96d66729d1f33934de7b52553e5f071686041Evan Cheng      /// X86 compare and logical compare instructions.
847d6ff3a25d9be6fae7ad95837ba8f1a8738947b6Evan Cheng      CMP, COMI, UCOMI,
857df96d66729d1f33934de7b52553e5f071686041Evan Cheng
86c7a37d4ff2ee8ffb93ba97e9393ff582f0e79a9aDan Gohman      /// X86 bit-test instructions.
87c7a37d4ff2ee8ffb93ba97e9393ff582f0e79a9aDan Gohman      BT,
88c7a37d4ff2ee8ffb93ba97e9393ff582f0e79a9aDan Gohman
895b85654844d673939bd1ceba66cd1f5022fd7c0dChris Lattner      /// X86 SetCC. Operand 0 is condition code, and operand 1 is the EFLAGS
905b85654844d673939bd1ceba66cd1f5022fd7c0dChris Lattner      /// operand, usually produced by a CMP instruction.
91d5781fca4f8f98863560338d4f8d017389428119Evan Cheng      SETCC,
92d5781fca4f8f98863560338d4f8d017389428119Evan Cheng
93ad9c0a3d8bf625d169596547f893b9ec8b953e26Evan Cheng      // Same as SETCC except it's materialized with a sbb and the value is all
94ad9c0a3d8bf625d169596547f893b9ec8b953e26Evan Cheng      // one's or all zero's.
95c19d1c3ba2b216f0f91d71cf6fc2e983fc995854Chris Lattner      SETCC_CARRY,  // R = carry_bit ? ~0 : 0
96ad9c0a3d8bf625d169596547f893b9ec8b953e26Evan Cheng
97865f09334f67edb2000fb38c6c3c28283b88b3bfStuart Hastings      /// X86 FP SETCC, implemented with CMP{cc}SS/CMP{cc}SD.
98865f09334f67edb2000fb38c6c3c28283b88b3bfStuart Hastings      /// Operands are two FP values to compare; result is a mask of
99865f09334f67edb2000fb38c6c3c28283b88b3bfStuart Hastings      /// 0s or 1s.  Generally DTRT for C/C++ with NaNs.
100865f09334f67edb2000fb38c6c3c28283b88b3bfStuart Hastings      FSETCCss, FSETCCsd,
101865f09334f67edb2000fb38c6c3c28283b88b3bfStuart Hastings
1024fd0dee3bfe8a35bbb62c9e9dea511cbc06cec2dStuart Hastings      /// X86 MOVMSK{pd|ps}, extracts sign bits of two or four FP values,
1034fd0dee3bfe8a35bbb62c9e9dea511cbc06cec2dStuart Hastings      /// result in an integer GPR.  Needs masking for scalar result.
1044fd0dee3bfe8a35bbb62c9e9dea511cbc06cec2dStuart Hastings      FGETSIGNx86,
1054fd0dee3bfe8a35bbb62c9e9dea511cbc06cec2dStuart Hastings
1062b9f4349086247c58ed0bcd17c7d11b14b14f52bChris Lattner      /// X86 conditional moves. Operand 0 and operand 1 are the two values
1072b9f4349086247c58ed0bcd17c7d11b14b14f52bChris Lattner      /// to select from. Operand 2 is the condition code, and operand 3 is the
1082b9f4349086247c58ed0bcd17c7d11b14b14f52bChris Lattner      /// flag operand produced by a CMP or TEST instruction. It also writes a
1092b9f4349086247c58ed0bcd17c7d11b14b14f52bChris Lattner      /// flag result.
1107df96d66729d1f33934de7b52553e5f071686041Evan Cheng      CMOV,
111898101c15fa11a896deb4e2fcb73b4727e1dcc1fEvan Cheng
1122004eb6272d4787b9e08a83230fe022cbaf4deb0Dan Gohman      /// X86 conditional branches. Operand 0 is the chain operand, operand 1
1132004eb6272d4787b9e08a83230fe022cbaf4deb0Dan Gohman      /// is the block to branch if condition is true, operand 2 is the
1142004eb6272d4787b9e08a83230fe022cbaf4deb0Dan Gohman      /// condition code, and operand 3 is the flag operand produced by a CMP
115d5781fca4f8f98863560338d4f8d017389428119Evan Cheng      /// or TEST instruction.
116898101c15fa11a896deb4e2fcb73b4727e1dcc1fEvan Cheng      BRCOND,
117b077b842b64af39c8e2e9aaad327b3be446790ddEvan Cheng
1182004eb6272d4787b9e08a83230fe022cbaf4deb0Dan Gohman      /// Return with a flag operand. Operand 0 is the chain operand, operand
1192004eb6272d4787b9e08a83230fe022cbaf4deb0Dan Gohman      /// 1 is the number of bytes of stack to pop.
120b077b842b64af39c8e2e9aaad327b3be446790ddEvan Cheng      RET_FLAG,
12167f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng
12267f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng      /// REP_STOS - Repeat fill, corresponds to X86::REP_STOSx.
12367f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng      REP_STOS,
12467f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng
12567f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng      /// REP_MOVS - Repeat move, corresponds to X86::REP_MOVSx.
12667f92a76497d1f50e0dd6279c81b45689bd463f5Evan Cheng      REP_MOVS,
127223547ab3101f32252cb704a67bd757e00fdbd16Evan Cheng
1287ccced634ae0ecdc1c4f599fd3abf188c367e231Evan Cheng      /// GlobalBaseReg - On Darwin, this node represents the result of the popl
1297ccced634ae0ecdc1c4f599fd3abf188c367e231Evan Cheng      /// at function entry, used for PIC code.
1307ccced634ae0ecdc1c4f599fd3abf188c367e231Evan Cheng      GlobalBaseReg,
131a0ea0539e359f6d82218e5aa4cdf3b50b17d6fbdEvan Cheng
132056292fd738924f3f7703725d8f630983794b5a5Bill Wendling      /// Wrapper - A wrapper node for TargetConstantPool,
133056292fd738924f3f7703725d8f630983794b5a5Bill Wendling      /// TargetExternalSymbol, and TargetGlobalAddress.
134020d2e8e7aa36692af13c1215fdd6248a6d9e950Evan Cheng      Wrapper,
13548090aa8145640c023563751a8a1e1bcc09125e5Evan Cheng
1360085a28d13f86b09ba0c83e8dce81de3ba15ca2dEvan Cheng      /// WrapperRIP - Special wrapper used under X86-64 PIC mode for RIP
1370085a28d13f86b09ba0c83e8dce81de3ba15ca2dEvan Cheng      /// relative displacements.
1380085a28d13f86b09ba0c83e8dce81de3ba15ca2dEvan Cheng      WrapperRIP,
1390085a28d13f86b09ba0c83e8dce81de3ba15ca2dEvan Cheng
1400488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      /// MOVQ2DQ - Copies a 64-bit value from an MMX vector to the low word
1410488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      /// of an XMM vector, with the high word zero filled.
142eb38ebf15c326a5bb45ca9da6329cdf19ad6df95Mon P Wang      MOVQ2DQ,
143eb38ebf15c326a5bb45ca9da6329cdf19ad6df95Mon P Wang
1440488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      /// MOVDQ2Q - Copies a 64-bit value from the low word of an XMM vector
1450488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      /// to an MMX vector.  If you think this is too close to the previous
1460488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      /// mnemonic, so do I; blame Intel.
1470488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen      MOVDQ2Q,
1480488fb649a56b7fc89a5814df5308813f9e5a85dDale Johannesen
14914d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// PEXTRB - Extract an 8-bit value from a vector and zero extend it to
15014d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// i32, corresponds to X86::PEXTRB.
15114d12caf1d2de9618818646d12b30d647a860817Nate Begeman      PEXTRB,
15214d12caf1d2de9618818646d12b30d647a860817Nate Begeman
153b067a1e7e68c4446d3512c25d3a5ac55c6dd76f8Evan Cheng      /// PEXTRW - Extract a 16-bit value from a vector and zero extend it to
154653159f4aac61a7ad796e406a4899d27ffe5a789Evan Cheng      /// i32, corresponds to X86::PEXTRW.
155b067a1e7e68c4446d3512c25d3a5ac55c6dd76f8Evan Cheng      PEXTRW,
156653159f4aac61a7ad796e406a4899d27ffe5a789Evan Cheng
15714d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// INSERTPS - Insert any element of a 4 x float vector into any element
15814d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// of a destination 4 x floatvector.
15914d12caf1d2de9618818646d12b30d647a860817Nate Begeman      INSERTPS,
16014d12caf1d2de9618818646d12b30d647a860817Nate Begeman
16114d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// PINSRB - Insert the lower 8-bits of a 32-bit value to a vector,
16214d12caf1d2de9618818646d12b30d647a860817Nate Begeman      /// corresponds to X86::PINSRB.
16314d12caf1d2de9618818646d12b30d647a860817Nate Begeman      PINSRB,
16414d12caf1d2de9618818646d12b30d647a860817Nate Begeman
165653159f4aac61a7ad796e406a4899d27ffe5a789Evan Cheng      /// PINSRW - Insert the lower 16-bits of a 32-bit value to a vector,
166653159f4aac61a7ad796e406a4899d27ffe5a789Evan Cheng      /// corresponds to X86::PINSRW.
1678f2b4cc07161b56e56d6615761ea4ba08dc0e7d3Chris Lattner      PINSRW, MMX_PINSRW,
1688ca29326e19201075f6dc95781560ea9ad41ececEvan Cheng
169b9a47b824f6c8ef3989a796018bf974c09cd243fNate Begeman      /// PSHUFB - Shuffle 16 8-bit values within a vector.
170b9a47b824f6c8ef3989a796018bf974c09cd243fNate Begeman      PSHUFB,
17195771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
172b65c175d32510d32aa556d1db5e6782b411d192cNate Begeman      /// PANDN - and with not'd value.
173b65c175d32510d32aa556d1db5e6782b411d192cNate Begeman      PANDN,
17495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
175b65c175d32510d32aa556d1db5e6782b411d192cNate Begeman      /// PSIGNB/W/D - Copy integer sign.
17695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson      PSIGNB, PSIGNW, PSIGND,
17795771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
178672fb6225b381b4dcb2e88fccb79d928eaabf82cNate Begeman      /// PBLENDVB - Variable blend
179672fb6225b381b4dcb2e88fccb79d928eaabf82cNate Begeman      PBLENDVB,
18095771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
1818ca29326e19201075f6dc95781560ea9ad41ececEvan Cheng      /// FMAX, FMIN - Floating point max and min.
1828ca29326e19201075f6dc95781560ea9ad41ececEvan Cheng      ///
183b3a0417cad8b625acc3033bd5e24afb9ffd0b084Lauro Ramos Venancio      FMAX, FMIN,
1842038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman
1852038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman      /// FRSQRT, FRCP - Floating point reciprocal-sqrt and reciprocal
1862038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman      /// approximation.  Note that these typically require refinement
1872038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman      /// in order to obtain suitable precision.
1882038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman      FRSQRT, FRCP,
1892038252c6a36efd18cc0bef216fa2c5bb9236617Dan Gohman
190094fad37b90946c91a09eb9270a0dbe800f49d87Rafael Espindola      // TLSADDR - Thread Local Storage.
191094fad37b90946c91a09eb9270a0dbe800f49d87Rafael Espindola      TLSADDR,
1926e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
19330ef0e5658b0b8b04437f73f74162d5d72923f29Eric Christopher      // TLSCALL - Thread Local Storage.  When calling to an OS provided
19430ef0e5658b0b8b04437f73f74162d5d72923f29Eric Christopher      // thunk at the address from an earlier relocation.
19530ef0e5658b0b8b04437f73f74162d5d72923f29Eric Christopher      TLSCALL,
196094fad37b90946c91a09eb9270a0dbe800f49d87Rafael Espindola
1977e2ff77ef05c23db6b9c82bc7a4110e170d7f94cEvan Cheng      // EH_RETURN - Exception Handling helpers.
198c85e1716f0e45e4c18a9ef2fbe431a51ac3a4252Arnold Schwaighofer      EH_RETURN,
1996e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
2004fe3073cfb5273a3655aef0c8d50c96882f26882Arnold Schwaighofer      /// TC_RETURN - Tail call return.
2014fe3073cfb5273a3655aef0c8d50c96882f26882Arnold Schwaighofer      ///   operand #0 chain
2024fe3073cfb5273a3655aef0c8d50c96882f26882Arnold Schwaighofer      ///   operand #1 callee (register or absolute)
2034fe3073cfb5273a3655aef0c8d50c96882f26882Arnold Schwaighofer      ///   operand #2 stack adjustment
2044fe3073cfb5273a3655aef0c8d50c96882f26882Arnold Schwaighofer      ///   operand #3 optional in flag
20545b22fa9f1f085d7971cce6db4f11b353e1646c6Anton Korobeynikov      TC_RETURN,
20645b22fa9f1f085d7971cce6db4f11b353e1646c6Anton Korobeynikov
207d880b97257c7f8ec4e94948874cb87c865d9f96fEvan Cheng      // VZEXT_MOVL - Vector move low and zero extend.
208d880b97257c7f8ec4e94948874cb87c865d9f96fEvan Cheng      VZEXT_MOVL,
209d880b97257c7f8ec4e94948874cb87c865d9f96fEvan Cheng
210f26ffe987cf3643a7bd66bd9f97c34605ba7d08eEvan Cheng      // VSHL, VSRL - Vector logical left / right shift.
21130a0de94e7a5cbdcd277a93e543b0788efa78ddcNate Begeman      VSHL, VSRL,
2129008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman
2139008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman      // CMPPD, CMPPS - Vector double/float comparison.
21430a0de94e7a5cbdcd277a93e543b0788efa78ddcNate Begeman      // CMPPD, CMPPS - Vector double/float comparison.
21530a0de94e7a5cbdcd277a93e543b0788efa78ddcNate Begeman      CMPPD, CMPPS,
2166e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
21730a0de94e7a5cbdcd277a93e543b0788efa78ddcNate Begeman      // PCMP* - Vector integer comparisons.
21830a0de94e7a5cbdcd277a93e543b0788efa78ddcNate Begeman      PCMPEQB, PCMPEQW, PCMPEQD, PCMPEQQ,
219ab55ebda1c2254f98b06e770bc2dae7d05a4a366Bill Wendling      PCMPGTB, PCMPGTW, PCMPGTD, PCMPGTQ,
220ab55ebda1c2254f98b06e770bc2dae7d05a4a366Bill Wendling
221b20e0b1fddfd9099e12b84a71fbc8ccff5a12b10Chris Lattner      // ADD, SUB, SMUL, etc. - Arithmetic operations with FLAGS results.
2225b85654844d673939bd1ceba66cd1f5022fd7c0dChris Lattner      ADD, SUB, ADC, SBB, SMUL,
223e220c4b3d97bbdc9f6e8cf040942514612349c41Dan Gohman      INC, DEC, OR, XOR, AND,
22495771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
225b20e0b1fddfd9099e12b84a71fbc8ccff5a12b10Chris Lattner      UMUL, // LOW, HI, FLAGS = umul LHS, RHS
22673f24c9f0d9afd1fd65d544f2b7b7b7c77fc2238Evan Cheng
22773f24c9f0d9afd1fd65d544f2b7b7b7c77fc2238Evan Cheng      // MUL_IMM - X86 specific multiply by immediate.
22871c6753d03d1bb27d0cf997285c425d631e5807bEric Christopher      MUL_IMM,
2296e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
23071c6753d03d1bb27d0cf997285c425d631e5807bEric Christopher      // PTEST - Vector bitwise comparisons
231d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman      PTEST,
232d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman
233045573ce21282ee7d1c58e57d00a77ede8c732daBruno Cardoso Lopes      // TESTP - Vector packed fp sign bitwise comparisons
234045573ce21282ee7d1c58e57d00a77ede8c732daBruno Cardoso Lopes      TESTP,
235045573ce21282ee7d1c58e57d00a77ede8c732daBruno Cardoso Lopes
2363157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      // Several flavors of instructions with vector shuffle behaviors.
2373157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PALIGN,
2383157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PSHUFD,
2393157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PSHUFHW,
2403157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PSHUFLW,
2413157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PSHUFHW_LD,
2423157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PSHUFLW_LD,
2433157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      SHUFPD,
2443157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      SHUFPS,
2453157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVDDUP,
2463157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSHDUP,
2473157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSLDUP,
2483157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSHDUP_LD,
2493157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSLDUP_LD,
2503157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVLHPS,
2513157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVLHPD,
252f2db5b48d0a4f0800e83d8c3cd6dc5ad6a551bd6Bruno Cardoso Lopes      MOVHLPS,
2533157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVHLPD,
25456098f5d26ed05401bd889960deffa72eb7bbce9Bruno Cardoso Lopes      MOVLPS,
25556098f5d26ed05401bd889960deffa72eb7bbce9Bruno Cardoso Lopes      MOVLPD,
2563157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSD,
2573157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      MOVSS,
2583157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      UNPCKLPS,
2593157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      UNPCKLPD,
260fbf05d32b45478696df16277b5c363ef2b9bb7c9David Greene      VUNPCKLPS,
261fbf05d32b45478696df16277b5c363ef2b9bb7c9David Greene      VUNPCKLPD,
262fbf05d32b45478696df16277b5c363ef2b9bb7c9David Greene      VUNPCKLPSY,
263fbf05d32b45478696df16277b5c363ef2b9bb7c9David Greene      VUNPCKLPDY,
2643157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      UNPCKHPS,
2653157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      UNPCKHPD,
2663157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKLBW,
2673157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKLWD,
2683157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKLDQ,
2693157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKLQDQ,
2703157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKHBW,
2713157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKHWD,
2723157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKHDQ,
2733157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes      PUNPCKHQDQ,
2743157ef1c13376f669a32bc152f2c3000480cedd3Bruno Cardoso Lopes
275d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman      // VASTART_SAVE_XMM_REGS - Save xmm argument registers to the stack,
276d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman      // according to %al. An operator is needed so that this can be expanded
277d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman      // with control flow.
278c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      VASTART_SAVE_XMM_REGS,
279c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman
280e9c253e0bc01fd50bf788efb62093a5fa6ef5849Michael J. Spencer      // WIN_ALLOCA - Windows's _chkstk call to do stack probing.
281e9c253e0bc01fd50bf788efb62093a5fa6ef5849Michael J. Spencer      WIN_ALLOCA,
282043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov
28359d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands      // Memory barrier
28459d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands      MEMBARRIER,
28559d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands      MFENCE,
28659d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands      SFENCE,
28759d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands      LFENCE,
28859d2dad59ebba1d82e5b72f78b7a5b2c873445d7Duncan Sands
2896e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer      // ATOMADD64_DAG, ATOMSUB64_DAG, ATOMOR64_DAG, ATOMAND64_DAG,
2906e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer      // ATOMXOR64_DAG, ATOMNAND64_DAG, ATOMSWAP64_DAG -
291c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      // Atomic 64-bit binary operations.
292c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMADD64_DAG = ISD::FIRST_TARGET_MEMORY_OPCODE,
293c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMSUB64_DAG,
294c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMOR64_DAG,
295c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMXOR64_DAG,
296c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMAND64_DAG,
297c76909abfec876c6b751d693ebd3df07df686aa0Dan Gohman      ATOMNAND64_DAG,
2989a9d275dc7897dfba7f41ce1b3770ca27ac149e8Eric Christopher      ATOMSWAP64_DAG,
2996e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
30093c4a5bef780e43552d3b9d702756d3acb7801d2Chris Lattner      // LCMPXCHG_DAG, LCMPXCHG8_DAG - Compare and swap.
30193c4a5bef780e43552d3b9d702756d3acb7801d2Chris Lattner      LCMPXCHG_DAG,
3028864155a35eb59fbebfd1822aaf224128b5c5d23Chris Lattner      LCMPXCHG8_DAG,
303043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov
3048864155a35eb59fbebfd1822aaf224128b5c5d23Chris Lattner      // VZEXT_LOAD - Load, scalar_to_vector, and zero extend.
3050729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      VZEXT_LOAD,
3066e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
3072156b79c493751f165d445535f8b598b4769b3e8Chris Lattner      // FNSTCW16m - Store FP control world into i16 memory.
3082156b79c493751f165d445535f8b598b4769b3e8Chris Lattner      FNSTCW16m,
3096e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
3100729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      /// FP_TO_INT*_IN_MEM - This instruction implements FP_TO_SINT with the
3110729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      /// integer destination in memory and a FP reg source.  This corresponds
3120729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      /// to the X86::FIST*m instructions and the rounding mode change stuff. It
3130729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      /// has two inputs (token chain and address) and two outputs (int value
3140729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      /// and token chain).
3150729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      FP_TO_INT16_IN_MEM,
3160729093cd7e15ed6469e50b74f0edd7f205b50ffChris Lattner      FP_TO_INT32_IN_MEM,
317492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      FP_TO_INT64_IN_MEM,
3186e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
319492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// FILD, FILD_FLAG - This instruction implements SINT_TO_FP with the
320492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// integer source in memory and FP reg result.  This corresponds to the
321492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// X86::FILD*m instructions. It has three inputs (token chain, address,
322492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// and source type) and two outputs (FP value and token chain). FILD_FLAG
323492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// also produces a flag).
324492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      FILD,
325492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      FILD_FLAG,
3266e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
327492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// FLD - This instruction implements an extending load to FP stack slots.
328492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// This corresponds to the X86::FLD32m / X86::FLD64m. It takes a chain
329492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// operand, ptr to load from, and a ValueType node indicating the type
330492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// to load to.
331492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      FLD,
3326e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
333492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// FST - This instruction implements a truncating store to FP stack
334492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// slots. This corresponds to the X86::FST32m / X86::FST64m. It takes a
335492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// chain operand, value to store, address, and a ValueType to store it
336492a43e6f64997a0ab26ef047dced193931fda85Chris Lattner      /// as.
337320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman      FST,
338320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman
339320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman      /// VAARG_64 - This instruction grabs the address of the next argument
340320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman      /// from a va_list. (reads and modifies the va_list in memory)
341320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman      VAARG_64
3426e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
343043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov      // WARNING: Do not add anything in the end unless you want the node to
344043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov      // have memop! In fact, starting from ATOMADD64_DAG all opcodes will be
345043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov      // thought as target memory ops!
346dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner    };
347dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  }
348dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
3490d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng  /// Define some predicates that are used for node matching.
3500d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng  namespace X86 {
3510d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isPSHUFDMask - Return true if the specified VECTOR_SHUFFLE operand
3520d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to PSHUFD.
3539008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isPSHUFDMask(ShuffleVectorSDNode *N);
3540d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3550d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isPSHUFHWMask - Return true if the specified VECTOR_SHUFFLE operand
3560d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to PSHUFD.
3579008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isPSHUFHWMask(ShuffleVectorSDNode *N);
3580d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3590d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isPSHUFLWMask - Return true if the specified VECTOR_SHUFFLE operand
3600d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to PSHUFD.
3619008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isPSHUFLWMask(ShuffleVectorSDNode *N);
3620d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3630d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isSHUFPMask - Return true if the specified VECTOR_SHUFFLE operand
3640d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to SHUFP*.
3659008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isSHUFPMask(ShuffleVectorSDNode *N);
3660d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3670d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVHLPSMask - Return true if the specified VECTOR_SHUFFLE operand
3680d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to MOVHLPS.
3699008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVHLPSMask(ShuffleVectorSDNode *N);
3700d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3710d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVHLPS_v_undef_Mask - Special case of isMOVHLPSMask for canonical form
3720d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// of vector_shuffle v, v, <2, 3, 2, 3>, i.e. vector_shuffle v, undef,
3730d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// <2, 3, 2, 3>
3749008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVHLPS_v_undef_Mask(ShuffleVectorSDNode *N);
3750d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3760d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVLPMask - Return true if the specified VECTOR_SHUFFLE operand
3779008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    /// specifies a shuffle of elements that is suitable for MOVLP{S|D}.
3789008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVLPMask(ShuffleVectorSDNode *N);
3790d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3800d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVHPMask - Return true if the specified VECTOR_SHUFFLE operand
3819008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    /// specifies a shuffle of elements that is suitable for MOVHP{S|D}.
3820d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// as well as MOVLHPS.
3830b10b91465e69c4ae3649115486e1eb56b8be878Nate Begeman    bool isMOVLHPSMask(ShuffleVectorSDNode *N);
3840d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3850d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isUNPCKLMask - Return true if the specified VECTOR_SHUFFLE operand
3860d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to UNPCKL.
3879008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isUNPCKLMask(ShuffleVectorSDNode *N, bool V2IsSplat = false);
3880d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3890d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isUNPCKHMask - Return true if the specified VECTOR_SHUFFLE operand
3900d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to UNPCKH.
3919008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isUNPCKHMask(ShuffleVectorSDNode *N, bool V2IsSplat = false);
3920d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3930d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isUNPCKL_v_undef_Mask - Special case of isUNPCKLMask for canonical form
3940d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// of vector_shuffle v, v, <0, 4, 1, 5>, i.e. vector_shuffle v, undef,
3950d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// <0, 0, 1, 1>
3969008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isUNPCKL_v_undef_Mask(ShuffleVectorSDNode *N);
3970d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
3980d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isUNPCKH_v_undef_Mask - Special case of isUNPCKHMask for canonical form
3990d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// of vector_shuffle v, v, <2, 6, 3, 7>, i.e. vector_shuffle v, undef,
4000d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// <2, 2, 3, 3>
4019008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isUNPCKH_v_undef_Mask(ShuffleVectorSDNode *N);
4020d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
4030d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVLMask - Return true if the specified VECTOR_SHUFFLE operand
4040d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to MOVSS,
4050d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// MOVSD, and MOVD, i.e. setting the lowest element.
4069008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVLMask(ShuffleVectorSDNode *N);
4070d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
4080d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVSHDUPMask - Return true if the specified VECTOR_SHUFFLE operand
4090d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to MOVSHDUP.
4109008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVSHDUPMask(ShuffleVectorSDNode *N);
4110d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
4120d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// isMOVSLDUPMask - Return true if the specified VECTOR_SHUFFLE operand
4130d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// specifies a shuffle of elements that is suitable for input to MOVSLDUP.
4149008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVSLDUPMask(ShuffleVectorSDNode *N);
4150d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
4160b457f0c3a7e21b1fb9ac8b9f8e404e1312b6a60Evan Cheng    /// isMOVDDUPMask - Return true if the specified VECTOR_SHUFFLE operand
4170b457f0c3a7e21b1fb9ac8b9f8e404e1312b6a60Evan Cheng    /// specifies a shuffle of elements that is suitable for input to MOVDDUP.
4189008ca6b6b4f638cfafccb593cbc5b1d3f5ab877Nate Begeman    bool isMOVDDUPMask(ShuffleVectorSDNode *N);
4190b457f0c3a7e21b1fb9ac8b9f8e404e1312b6a60Evan Cheng
420a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// isPALIGNRMask - Return true if the specified VECTOR_SHUFFLE operand
421a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// specifies a shuffle of elements that is suitable for input to PALIGNR.
422a09008bf6ddb61910212c31db1d714182882681eNate Begeman    bool isPALIGNRMask(ShuffleVectorSDNode *N);
423a09008bf6ddb61910212c31db1d714182882681eNate Begeman
424c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// isVEXTRACTF128Index - Return true if the specified
425c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// EXTRACT_SUBVECTOR operand specifies a vector extract that is
426c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// suitable for input to VEXTRACTF128.
427c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    bool isVEXTRACTF128Index(SDNode *N);
428c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene
429ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// isVINSERTF128Index - Return true if the specified
430ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// INSERT_SUBVECTOR operand specifies a subvector insert that is
431ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// suitable for input to VINSERTF128.
432ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    bool isVINSERTF128Index(SDNode *N);
433ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene
4340d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// getShuffleSHUFImmediate - Return the appropriate immediate to shuffle
4350d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// the specified isShuffleMask VECTOR_SHUFFLE mask with PSHUF* and SHUFP*
4360d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// instructions.
4370d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    unsigned getShuffleSHUFImmediate(SDNode *N);
4380d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
4390d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    /// getShufflePSHUFHWImmediate - Return the appropriate immediate to shuffle
440a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// the specified VECTOR_SHUFFLE mask with PSHUFHW instruction.
4410d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    unsigned getShufflePSHUFHWImmediate(SDNode *N);
4420d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
443a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// getShufflePSHUFLWImmediate - Return the appropriate immediate to shuffle
444a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// the specified VECTOR_SHUFFLE mask with PSHUFLW instruction.
4450d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng    unsigned getShufflePSHUFLWImmediate(SDNode *N);
44637b7387da90ffd42d28ad0f08fca00b684294b2cEvan Cheng
447a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// getShufflePALIGNRImmediate - Return the appropriate immediate to shuffle
448a09008bf6ddb61910212c31db1d714182882681eNate Begeman    /// the specified VECTOR_SHUFFLE mask with the PALIGNR instruction.
449a09008bf6ddb61910212c31db1d714182882681eNate Begeman    unsigned getShufflePALIGNRImmediate(SDNode *N);
450a09008bf6ddb61910212c31db1d714182882681eNate Begeman
451c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// getExtractVEXTRACTF128Immediate - Return the appropriate
452c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// immediate to extract the specified EXTRACT_SUBVECTOR index
453c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    /// with VEXTRACTF128 instructions.
454c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene    unsigned getExtractVEXTRACTF128Immediate(SDNode *N);
455c38a03eeca3a506577b2d5a29629a81a0cefff03David Greene
456ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// getInsertVINSERTF128Immediate - Return the appropriate
457ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// immediate to insert at the specified INSERT_SUBVECTOR index
458ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    /// with VINSERTF128 instructions.
459ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene    unsigned getInsertVINSERTF128Immediate(SDNode *N);
460ccacdc1952d022108d51b1c8270eb85b2b862c9dDavid Greene
46137b7387da90ffd42d28ad0f08fca00b684294b2cEvan Cheng    /// isZeroNode - Returns true if Elt is a constant zero or a floating point
46237b7387da90ffd42d28ad0f08fca00b684294b2cEvan Cheng    /// constant +0.0.
46337b7387da90ffd42d28ad0f08fca00b684294b2cEvan Cheng    bool isZeroNode(SDValue Elt);
464b5e01724057e6eabc45da75df3037af4ad29248cAnton Korobeynikov
465b5e01724057e6eabc45da75df3037af4ad29248cAnton Korobeynikov    /// isOffsetSuitableForCodeModel - Returns true of the given offset can be
466b5e01724057e6eabc45da75df3037af4ad29248cAnton Korobeynikov    /// fit into displacement field of the instruction.
467b5e01724057e6eabc45da75df3037af4ad29248cAnton Korobeynikov    bool isOffsetSuitableForCodeModel(int64_t Offset, CodeModel::Model M,
468b5e01724057e6eabc45da75df3037af4ad29248cAnton Korobeynikov                                      bool hasSymbolicDisplacement = true);
469ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng
470ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng
471ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng    /// isCalleePop - Determines whether the callee is required to pop its
472ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng    /// own arguments. Callee pop is necessary to support tail calls.
473ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng    bool isCalleePop(CallingConv::ID CallingConv,
474ef41ff618f2537539b538e6c7bf471c753391f92Evan Cheng                     bool is64Bit, bool IsVarArg, bool TailCallOpt);
4750d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng  }
4760d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
47791897778690a7d683497ba3f4040ebf09345f08aChris Lattner  //===--------------------------------------------------------------------===//
478dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  //  X86TargetLowering - X86 Implementation of the TargetLowering interface
479dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  class X86TargetLowering : public TargetLowering {
480dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  public:
481c9f5f3f64f896d0a8c8fa35a1dd98bc57b8960f6Dan Gohman    explicit X86TargetLowering(X86TargetMachine &TM);
482dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
483c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner    virtual unsigned getJumpTableEncoding() const;
4845e1df8d1f71f1a8a534b8b5929a7dd670fe010c6Chris Lattner
48595771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson    virtual MVT getShiftAmountTy(EVT LHSTy) const { return MVT::i8; }
48695771afbfd604ad003fa3723cac66c9370fed55dOwen Anderson
487c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner    virtual const MCExpr *
488c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner    LowerCustomJumpTableEntry(const MachineJumpTableInfo *MJTI,
489c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner                              const MachineBasicBlock *MBB, unsigned uid,
490c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner                              MCContext &Ctx) const;
4916e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
492cc41586b9d79532172b37e1f44a9077da4b73fc9Evan Cheng    /// getPICJumpTableRelocaBase - Returns relocation base for the given PIC
493cc41586b9d79532172b37e1f44a9077da4b73fc9Evan Cheng    /// jumptable.
494c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner    virtual SDValue getPICJumpTableRelocBase(SDValue Table,
495c64daabb70a2e0cb115f78b0c1548e65c0d527ffChris Lattner                                             SelectionDAG &DAG) const;
496589c6f620e8dcf3d59af1ae0e15372c934647c82Chris Lattner    virtual const MCExpr *
497589c6f620e8dcf3d59af1ae0e15372c934647c82Chris Lattner    getPICJumpTableRelocBaseExpr(const MachineFunction *MF,
498589c6f620e8dcf3d59af1ae0e15372c934647c82Chris Lattner                                 unsigned JTI, MCContext &Ctx) const;
4996e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
50054e3efde4636dade74f95ede039091bf52ca1585Chris Lattner    /// getStackPtrReg - Return the stack pointer register we are using: either
50154e3efde4636dade74f95ede039091bf52ca1585Chris Lattner    /// ESP or RSP.
50254e3efde4636dade74f95ede039091bf52ca1585Chris Lattner    unsigned getStackPtrReg() const { return X86StackPtr; }
50329286502628867b31872ead2f2527592480f0970Evan Cheng
50429286502628867b31872ead2f2527592480f0970Evan Cheng    /// getByValTypeAlignment - Return the desired alignment for ByVal aggregate
50529286502628867b31872ead2f2527592480f0970Evan Cheng    /// function arguments in the caller parameter area. For X86, aggregates
50629286502628867b31872ead2f2527592480f0970Evan Cheng    /// that contains are placed at 16-byte boundaries while the rest are at
50729286502628867b31872ead2f2527592480f0970Evan Cheng    /// 4-byte boundaries.
50829286502628867b31872ead2f2527592480f0970Evan Cheng    virtual unsigned getByValTypeAlignment(const Type *Ty) const;
509f0df03134e698ea84e9cc1c28a853f83c02560d5Evan Cheng
510f0df03134e698ea84e9cc1c28a853f83c02560d5Evan Cheng    /// getOptimalMemOpType - Returns the target specific optimal type for load
511f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// and store operations as a result of memset, memcpy, and memmove
512f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// lowering. If DstAlign is zero that means it's safe to destination
513f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// alignment can satisfy any constraint. Similarly if SrcAlign is zero it
514f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// means there isn't a need to check it against alignment requirement,
515f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// probably because the source does not need to be loaded. If
516f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// 'NonScalarIntSafe' is true, that means it's safe to return a
517f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    /// non-scalar-integer type, e.g. empty string source, constant, or loaded
518c3b0c341e731b27b550ee9dcded9c17232b296b8Evan Cheng    /// from memory. 'MemcpyStrSrc' indicates whether the memcpy source is
519c3b0c341e731b27b550ee9dcded9c17232b296b8Evan Cheng    /// constant so it does not need to be loaded.
52037f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman    /// It returns EVT::Other if the type should be determined using generic
52137f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman    /// target-independent logic.
522f28f8bc40eedc6304ab25dd8bed486fa08f51f70Evan Cheng    virtual EVT
523c3b0c341e731b27b550ee9dcded9c17232b296b8Evan Cheng    getOptimalMemOpType(uint64_t Size, unsigned DstAlign, unsigned SrcAlign,
524c3b0c341e731b27b550ee9dcded9c17232b296b8Evan Cheng                        bool NonScalarIntSafe, bool MemcpyStrSrc,
52537f32ee7ffe77d7c2bc1b185802e98979612f041Dan Gohman                        MachineFunction &MF) const;
526af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling
527af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling    /// allowsUnalignedMemoryAccesses - Returns true if the target allows
528af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling    /// unaligned memory accesses. of the specified type.
529af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling    virtual bool allowsUnalignedMemoryAccesses(EVT VT) const {
530af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling      return true;
531af5663405834ca7cf4a847f2efa2d624ce99b1d8Bill Wendling    }
53220c568f366be211323eeaf0e45ef053278ec9ddcBill Wendling
533dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner    /// LowerOperation - Provide custom lowering hooks for some operations.
534dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner    ///
535d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    virtual SDValue LowerOperation(SDValue Op, SelectionDAG &DAG) const;
536dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
5371607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    /// ReplaceNodeResults - Replace the results of node with an illegal result
5381607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    /// type with new values built out of custom code.
53927a6c7380fa4dfc8e1837a8dd67967d063b26544Chris Lattner    ///
5401607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    virtual void ReplaceNodeResults(SDNode *N, SmallVectorImpl<SDValue>&Results,
541d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                    SelectionDAG &DAG) const;
54227a6c7380fa4dfc8e1837a8dd67967d063b26544Chris Lattner
5436e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
544475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual SDValue PerformDAGCombine(SDNode *N, DAGCombinerInfo &DCI) const;
545206ee9d86cd4e78176fad6bfa2b016023edf5df7Evan Cheng
546e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// isTypeDesirableForOp - Return true if the target has native support for
547e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// the specified value type and it is 'desirable' to use the type for the
548e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// given node type. e.g. On x86 i16 is legal, but undesirable since i16
549e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// instruction encodings are longer and some i16 instructions are slow.
550e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    virtual bool isTypeDesirableForOp(unsigned Opc, EVT VT) const;
551e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng
552e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// isTypeDesirable - Return true if the target has native support for the
553e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// specified value type and it is 'desirable' to use the type. e.g. On x86
554e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// i16 is legal, but undesirable since i16 instruction encodings are longer
555e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    /// and some i16 instructions are slow.
556e5b51ac7708402473f0a558f4aac74fab63d4f7eEvan Cheng    virtual bool IsDesirableToPromoteOp(SDValue Op, EVT &PVT) const;
55764b7bf71e84094193b40ab81aa7dacad921ecbeaEvan Cheng
558af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman    virtual MachineBasicBlock *
559af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman      EmitInstrWithCustomInserter(MachineInstr *MI,
560af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman                                  MachineBasicBlock *MBB) const;
5614a46080fe0133c71b511805c63abfb158dcd56a5Evan Cheng
5626e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
5637226158d7e3986e55b58214a749aa4eabb3fb6d5Evan Cheng    /// getTargetNodeName - This method returns the name of a target specific
5647226158d7e3986e55b58214a749aa4eabb3fb6d5Evan Cheng    /// DAG node.
5657226158d7e3986e55b58214a749aa4eabb3fb6d5Evan Cheng    virtual const char *getTargetNodeName(unsigned Opcode) const;
5667226158d7e3986e55b58214a749aa4eabb3fb6d5Evan Cheng
5675b8f82e35b51bf007de07a7ca9347d804084ddf8Scott Michel    /// getSetCCResultType - Return the ISD::SETCC ValueType
568825b72b0571821bf2d378749f69d6c4cfb52d2f9Owen Anderson    virtual MVT::SimpleValueType getSetCCResultType(EVT VT) const;
5695b8f82e35b51bf007de07a7ca9347d804084ddf8Scott Michel
5706e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer    /// computeMaskedBitsForTargetNode - Determine which of the bits specified
5716e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer    /// in Mask are known to be either zero or one and return them in the
572368e18d56a87308045d341e85584597bfe7426e9Nate Begeman    /// KnownZero/KnownOne bitsets.
573475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual void computeMaskedBitsForTargetNode(const SDValue Op,
574977a76fbb6ea1b87dfd7fbbe2ae2afb63e982ff3Dan Gohman                                                const APInt &Mask,
5756e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer                                                APInt &KnownZero,
576fd29e0eb060ea8b4d490860329234d2ae5f5952eDan Gohman                                                APInt &KnownOne,
577ea859be53ca13a1547c4675549946b74dc3c6f41Dan Gohman                                                const SelectionDAG &DAG,
578368e18d56a87308045d341e85584597bfe7426e9Nate Begeman                                                unsigned Depth = 0) const;
579ad4196b44ae714a6b95e238d9d96303df74b0429Evan Cheng
580bc146b0a4dcee601459eee943b4133d3cf63f1ddOwen Anderson    // ComputeNumSignBitsForTargetNode - Determine the number of bits in the
581bc146b0a4dcee601459eee943b4133d3cf63f1ddOwen Anderson    // operation that are sign bits.
582bc146b0a4dcee601459eee943b4133d3cf63f1ddOwen Anderson    virtual unsigned ComputeNumSignBitsForTargetNode(SDValue Op,
583bc146b0a4dcee601459eee943b4133d3cf63f1ddOwen Anderson                                                     unsigned Depth) const;
584bc146b0a4dcee601459eee943b4133d3cf63f1ddOwen Anderson
585ad4196b44ae714a6b95e238d9d96303df74b0429Evan Cheng    virtual bool
58646510a73e977273ec67747eb34cbdb43f815e451Dan Gohman    isGAPlusOffset(SDNode *N, const GlobalValue* &GA, int64_t &Offset) const;
5876e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
588d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue getReturnAddressFrameIndex(SelectionDAG &DAG) const;
589dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
590b8105651527670cb456eb46dd4346bacd3905361Chris Lattner    virtual bool ExpandInlineAsm(CallInst *CI) const;
5916e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
5924234f57fa02b1f04a9f52a7b3c2aa22d32ac521cChris Lattner    ConstraintType getConstraintType(const std::string &Constraint) const;
5936e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
59444ab89eb376af838d1123293a79975aede501464John Thompson    /// Examine constraint string and operand type and determine a weight value.
595eac6e1d0c748afc3d1496be0753ffbe5f5a4279bJohn Thompson    /// The operand object must already have been set up with the operand type.
59644ab89eb376af838d1123293a79975aede501464John Thompson    virtual ConstraintWeight getSingleConstraintMatchWeight(
597eac6e1d0c748afc3d1496be0753ffbe5f5a4279bJohn Thompson      AsmOperandInfo &info, const char *constraint) const;
5986e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
5996e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer    std::vector<unsigned>
6001efa40f6a4b561cf8f80fe018684236010645cd0Chris Lattner      getRegClassForInlineAsmConstraint(const std::string &Constraint,
601e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson                                        EVT VT) const;
60248884cd80b52be1528618f2e9b3425ac24e7b5caChris Lattner
603e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    virtual const char *LowerXConstraint(EVT ConstraintVT) const;
604ba2a0b960ea4c73d0f81557f63ae2ea126e08905Dale Johannesen
60548884cd80b52be1528618f2e9b3425ac24e7b5caChris Lattner    /// LowerAsmOperandForConstraint - Lower the specified operand into the Ops
606da43bcf624acb56a3d77bb5ae9a02728af032613Evan Cheng    /// vector.  If it is invalid, don't add anything to Ops. If hasMemory is
607da43bcf624acb56a3d77bb5ae9a02728af032613Evan Cheng    /// true it means one of the asm constraint of the inline asm instruction
608da43bcf624acb56a3d77bb5ae9a02728af032613Evan Cheng    /// being processed is 'm'.
609475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    virtual void LowerAsmOperandForConstraint(SDValue Op,
610100c83341676d8aae8fc34b5452563ed08b14f3eEric Christopher                                              std::string &Constraint,
611475871a144eb604ddaf37503397ba0941442e5fbDan Gohman                                              std::vector<SDValue> &Ops,
6125e764233f398b6929b67701672a5e78fec20ce2eChris Lattner                                              SelectionDAG &DAG) const;
6136e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
61491897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// getRegForInlineAsmConstraint - Given a physical register constraint
61591897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// (e.g. {edx}), return the register number and the register class for the
61691897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// register.  This should only be used for C_Register constraints.  On
61791897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// error, this returns a register number of 0.
6186e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer    std::pair<unsigned, const TargetRegisterClass*>
619f76d180c9595d34641f4b5d2fbba2f2c175197d8Chris Lattner      getRegForInlineAsmConstraint(const std::string &Constraint,
620e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson                                   EVT VT) const;
6216e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
622c9addb74883fef318140272768422656a694341fChris Lattner    /// isLegalAddressingMode - Return true if the addressing mode represented
623c9addb74883fef318140272768422656a694341fChris Lattner    /// by AM is legal for this target, for a load/store of the specified type.
624c9addb74883fef318140272768422656a694341fChris Lattner    virtual bool isLegalAddressingMode(const AddrMode &AM, const Type *Ty)const;
625c9addb74883fef318140272768422656a694341fChris Lattner
6262bd122c4d934a70e031dc0ca5171719bac66c2c9Evan Cheng    /// isTruncateFree - Return true if it's free to truncate a value of
6272bd122c4d934a70e031dc0ca5171719bac66c2c9Evan Cheng    /// type Ty1 to type Ty2. e.g. On x86 it's free to truncate a i32 value in
6282bd122c4d934a70e031dc0ca5171719bac66c2c9Evan Cheng    /// register EAX to i16 by referencing its sub-register AX.
6292bd122c4d934a70e031dc0ca5171719bac66c2c9Evan Cheng    virtual bool isTruncateFree(const Type *Ty1, const Type *Ty2) const;
630e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    virtual bool isTruncateFree(EVT VT1, EVT VT2) const;
63197121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman
63297121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// isZExtFree - Return true if any actual instruction that defines a
63397121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// value of type Ty1 implicit zero-extends the value to Ty2 in the result
63497121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// register. This does not necessarily include registers defined in
63597121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// unknown ways, such as incoming arguments, or copies from unknown
63697121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// virtual registers. Also, if isTruncateFree(Ty2, Ty1) is true, this
63797121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// does not necessarily apply to truncate instructions. e.g. on x86-64,
63897121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// all instructions that define 32-bit values implicit zero-extend the
63997121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    /// result out to 64 bits.
64097121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman    virtual bool isZExtFree(const Type *Ty1, const Type *Ty2) const;
641e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    virtual bool isZExtFree(EVT VT1, EVT VT2) const;
64297121ba2afb8d566ff1bf5c4e8fc5d4077940a7fDan Gohman
6438b944d39b356135676459152385f05c496951f6cEvan Cheng    /// isNarrowingProfitable - Return true if it's profitable to narrow
6448b944d39b356135676459152385f05c496951f6cEvan Cheng    /// operations of type VT1 to VT2. e.g. on x86, it's profitable to narrow
6458b944d39b356135676459152385f05c496951f6cEvan Cheng    /// from i32 to i8 but not from i32 to i16.
646e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    virtual bool isNarrowingProfitable(EVT VT1, EVT VT2) const;
6478b944d39b356135676459152385f05c496951f6cEvan Cheng
648eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// isFPImmLegal - Returns true if the target can instruction select the
649eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// specified FP immediate natively. If false, the legalizer will
650eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// materialize the FP immediate as a load from a constant pool.
651a1eaa3c52b75d4fe2bcd4f7c52e56c405ee91d3cEvan Cheng    virtual bool isFPImmLegal(const APFloat &Imm, EVT VT) const;
652eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng
6530188ecba85c7139f237baa4ce5612fdfc83e1b84Evan Cheng    /// isShuffleMaskLegal - Targets can use this to indicate that they only
6540188ecba85c7139f237baa4ce5612fdfc83e1b84Evan Cheng    /// support *some* VECTOR_SHUFFLE operations, those with specific masks.
65591897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// By default, if a target supports the VECTOR_SHUFFLE node, all mask
65691897778690a7d683497ba3f4040ebf09345f08aChris Lattner    /// values are assumed to be legal.
6575a5ca1519e04310f585197c20e7ae584b7f2d11fNate Begeman    virtual bool isShuffleMaskLegal(const SmallVectorImpl<int> &Mask,
658e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson                                    EVT VT) const;
65939623daef67090025be5cd8af7d172fd1c9e6418Evan Cheng
66039623daef67090025be5cd8af7d172fd1c9e6418Evan Cheng    /// isVectorClearMaskLegal - Similar to isShuffleMaskLegal. This is
66139623daef67090025be5cd8af7d172fd1c9e6418Evan Cheng    /// used by Targets can use this to indicate if there is a suitable
66239623daef67090025be5cd8af7d172fd1c9e6418Evan Cheng    /// VECTOR_SHUFFLE that can be used to replace a VAND with a constant
66339623daef67090025be5cd8af7d172fd1c9e6418Evan Cheng    /// pool entry.
6645a5ca1519e04310f585197c20e7ae584b7f2d11fNate Begeman    virtual bool isVectorClearMaskLegal(const SmallVectorImpl<int> &Mask,
665e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson                                        EVT VT) const;
6666fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng
6676fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng    /// ShouldShrinkFPConstant - If true, then instruction selection should
6686fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng    /// seek to shrink the FP constant of the specified type to a smaller type
6696fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng    /// in order to save space and / or reduce runtime.
670e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    virtual bool ShouldShrinkFPConstant(EVT VT) const {
6716fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng      // Don't shrink FP constpool if SSE2 is available since cvtss2sd is more
6726fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng      // expensive than a straight movsd. On the other hand, it's important to
6736fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng      // shrink long double fp constant since fldt is very slow.
674825b72b0571821bf2d378749f69d6c4cfb52d2f9Owen Anderson      return !X86ScalarSSEf64 || VT == MVT::f80;
6756fd599fa6916bd9438dbea7994cf2437bdf4ab8cEvan Cheng    }
6766e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
677419e4f92635cfaa409282691437aff99062e4e0bDan Gohman    const X86Subtarget* getSubtarget() const {
678707e0184233f27e0e9f9aee0309f2daab8cfe7f8Dan Gohman      return Subtarget;
679f1ba1cad387dc52f3c2c5afc665edf9caad00992Rafael Espindola    }
680f1ba1cad387dc52f3c2c5afc665edf9caad00992Rafael Espindola
6813d66185ff8b276183fa8e9ce3d7ebb1d9ce88f74Chris Lattner    /// isScalarFPTypeInSSEReg - Return true if the specified scalar FP type is
6823d66185ff8b276183fa8e9ce3d7ebb1d9ce88f74Chris Lattner    /// computed in an SSE register, not on the X87 floating point stack.
683e50ed30282bb5b4a9ed952580523f2dda16215acOwen Anderson    bool isScalarFPTypeInSSEReg(EVT VT) const {
684825b72b0571821bf2d378749f69d6c4cfb52d2f9Owen Anderson      return (VT == MVT::f64 && X86ScalarSSEf64) || // f64 is when SSE2
685825b72b0571821bf2d378749f69d6c4cfb52d2f9Owen Anderson      (VT == MVT::f32 && X86ScalarSSEf32);   // f32 is when SSE1
6863d66185ff8b276183fa8e9ce3d7ebb1d9ce88f74Chris Lattner    }
687d9f3c480a7bc0969b08ace68af7dcde40f6caff1Dan Gohman
688d9f3c480a7bc0969b08ace68af7dcde40f6caff1Dan Gohman    /// createFastISel - This method returns a target specific FastISel object,
689d9f3c480a7bc0969b08ace68af7dcde40f6caff1Dan Gohman    /// or null if the target does not support "fast" ISel.
690a4160c3434b08288d1f79f1acbe453d1b9610b22Dan Gohman    virtual FastISel *createFastISel(FunctionLoweringInfo &funcInfo) const;
69120c568f366be211323eeaf0e45ef053278ec9ddcBill Wendling
692f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher    /// getStackCookieLocation - Return true if the target stores stack
693f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher    /// protector cookies at a fixed offset in some non-standard address
694f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher    /// space, and populates the address space and offset as
695f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher    /// appropriate.
696f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher    virtual bool getStackCookieLocation(unsigned &AddressSpace, unsigned &Offset) const;
697f7a0c7bf8bc8318ed28d889c9a56437ab3e91385Eric Christopher
698f99a4b82a4ff0383138ccaf9e22511eb786168fbStuart Hastings    SDValue BuildFILD(SDValue Op, EVT SrcVT, SDValue Chain, SDValue StackSlot,
699f99a4b82a4ff0383138ccaf9e22511eb786168fbStuart Hastings                      SelectionDAG &DAG) const;
700f99a4b82a4ff0383138ccaf9e22511eb786168fbStuart Hastings
701dee81010eb4f932b76dd3f64eacba13b55d2d105Evan Cheng  protected:
702dee81010eb4f932b76dd3f64eacba13b55d2d105Evan Cheng    std::pair<const TargetRegisterClass*, uint8_t>
703dee81010eb4f932b76dd3f64eacba13b55d2d105Evan Cheng    findRepresentativeClass(EVT VT) const;
704dee81010eb4f932b76dd3f64eacba13b55d2d105Evan Cheng
705dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  private:
7060db9fe6775853d62632ad299dd734b6ba6c6b336Evan Cheng    /// Subtarget - Keep a pointer to the X86Subtarget around so that we can
7070db9fe6775853d62632ad299dd734b6ba6c6b336Evan Cheng    /// make the right decision when generating code for different targets.
7080db9fe6775853d62632ad299dd734b6ba6c6b336Evan Cheng    const X86Subtarget *Subtarget;
709c9f5f3f64f896d0a8c8fa35a1dd98bc57b8960f6Dan Gohman    const X86RegisterInfo *RegInfo;
710bff66b0c6c8266a6f9ba6c9bd5d2541a4d4c6ec9Anton Korobeynikov    const TargetData *TD;
7110db9fe6775853d62632ad299dd734b6ba6c6b336Evan Cheng
71225ab690a43cbbb591b76d49e3595b019c32f4b3fEvan Cheng    /// X86StackPtr - X86 physical register used as stack ptr.
71325ab690a43cbbb591b76d49e3595b019c32f4b3fEvan Cheng    unsigned X86StackPtr;
7146e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
7156e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer    /// X86ScalarSSEf32, X86ScalarSSEf64 - Select between SSE or x87
716f1fc3a8fa6d4e81e30c08983d786c640acb2591cDale Johannesen    /// floating point ops.
717f1fc3a8fa6d4e81e30c08983d786c640acb2591cDale Johannesen    /// When SSE is available, use it for f32 operations.
718f1fc3a8fa6d4e81e30c08983d786c640acb2591cDale Johannesen    /// When SSE2 is available, use it for f64 operations.
719f1fc3a8fa6d4e81e30c08983d786c640acb2591cDale Johannesen    bool X86ScalarSSEf32;
720f1fc3a8fa6d4e81e30c08983d786c640acb2591cDale Johannesen    bool X86ScalarSSEf64;
7210d9e976ad2c5479f3d67f8cb09a5908cfc29985cEvan Cheng
722eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// LegalFPImmediates - A list of legal fp immediates.
723eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    std::vector<APFloat> LegalFPImmediates;
724eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng
725eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// addLegalFPImmediate - Indicate that this x86 target can instruction
726eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    /// select the specified FP immediate natively.
727eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    void addLegalFPImmediate(const APFloat& Imm) {
728eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng      LegalFPImmediates.push_back(Imm);
729eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng    }
730eb2f969a4ddfb0bc8fdcb5bce3b52e53abff321dEvan Cheng
73198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue LowerCallResult(SDValue Chain, SDValue InFlag,
73265c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                            CallingConv::ID CallConv, bool isVarArg,
73398ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                            const SmallVectorImpl<ISD::InputArg> &Ins,
73498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                            DebugLoc dl, SelectionDAG &DAG,
735d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                            SmallVectorImpl<SDValue> &InVals) const;
73698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue LowerMemArgument(SDValue Chain,
73765c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                             CallingConv::ID CallConv,
73898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                             const SmallVectorImpl<ISD::InputArg> &ArgInfo,
73998ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                             DebugLoc dl, SelectionDAG &DAG,
74098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                             const CCValAssign &VA,  MachineFrameInfo *MFI,
741d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                              unsigned i) const;
74298ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    SDValue LowerMemOpCallTo(SDValue Chain, SDValue StackPtr, SDValue Arg,
74398ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                             DebugLoc dl, SelectionDAG &DAG,
74498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                             const CCValAssign &VA,
745d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                             ISD::ArgFlagsTy Flags) const;
7461b5dcc34b701639f94008658a2042abc43b9b910Rafael Espindola
74786737665b81550fdb575f7d8cc5decc801a7813dGordon Henriksen    // Call lowering helpers.
7480c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng
7490c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng    /// IsEligibleForTailCallOptimization - Check whether the call is eligible
7500c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng    /// for tail call optimization. Targets which want to do tail call
7510c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng    /// optimization should implement this function.
752022d9e1cef7586a80a96446ae8691a37def9bbf4Evan Cheng    bool IsEligibleForTailCallOptimization(SDValue Callee,
7530c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                           CallingConv::ID CalleeCC,
7540c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                           bool isVarArg,
755a375d471378b1674a9d77d180a0b05ea8c90cb4bEvan Cheng                                           bool isCalleeStructRet,
756a375d471378b1674a9d77d180a0b05ea8c90cb4bEvan Cheng                                           bool isCallerStructRet,
757b17124553d569c6f09347f2cbe072eab445d30c4Evan Cheng                                    const SmallVectorImpl<ISD::OutputArg> &Outs,
758c9403659a98bf6487ab6fbf40b81628b5695c02eDan Gohman                                    const SmallVectorImpl<SDValue> &OutVals,
759b17124553d569c6f09347f2cbe072eab445d30c4Evan Cheng                                    const SmallVectorImpl<ISD::InputArg> &Ins,
7600c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                                           SelectionDAG& DAG) const;
761d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    bool IsCalleePop(bool isVarArg, CallingConv::ID CallConv) const;
762475871a144eb604ddaf37503397ba0941442e5fbDan Gohman    SDValue EmitTailCallLoadRetAddr(SelectionDAG &DAG, SDValue &OutRetAddr,
763475871a144eb604ddaf37503397ba0941442e5fbDan Gohman                                SDValue Chain, bool IsTailCall, bool Is64Bit,
764d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                int FPDiff, DebugLoc dl) const;
7654b5324ad2cbf774c9c6ed02ea0fcc864f2f5f885Arnold Schwaighofer
766d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    unsigned GetAlignedArgumentStackSize(unsigned StackSize,
767d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                         SelectionDAG &DAG) const;
768559806f575297866609c7bef0e5c1084dcdda9a5Evan Cheng
769948e95a381bf6771639703643ef75e0115b35f53Eli Friedman    std::pair<SDValue,SDValue> FP_TO_INTHelper(SDValue Op, SelectionDAG &DAG,
770d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                               bool isSigned) const;
771c363094e04df621d41ca570eb2a7bf8826bb8c1aEvan Cheng
772c363094e04df621d41ca570eb2a7bf8826bb8c1aEvan Cheng    SDValue LowerAsSplatVectorLoad(SDValue SrcOp, EVT VT, DebugLoc dl,
773d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                   SelectionDAG &DAG) const;
774d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerBUILD_VECTOR(SDValue Op, SelectionDAG &DAG) const;
775d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerCONCAT_VECTORS(SDValue Op, SelectionDAG &DAG) const;
776d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVECTOR_SHUFFLE(SDValue Op, SelectionDAG &DAG) const;
777d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerEXTRACT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
778d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerEXTRACT_VECTOR_ELT_SSE4(SDValue Op, SelectionDAG &DAG) const;
779d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerINSERT_VECTOR_ELT(SDValue Op, SelectionDAG &DAG) const;
780d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerINSERT_VECTOR_ELT_SSE4(SDValue Op, SelectionDAG &DAG) const;
781d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSCALAR_TO_VECTOR(SDValue Op, SelectionDAG &DAG) const;
78291585098eff1f0acdefa2667e091742b60dcbf15David Greene    SDValue LowerEXTRACT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const;
783cfe33c46aa50f04adb0431243e7d25f79b719ac6David Greene    SDValue LowerINSERT_SUBVECTOR(SDValue Op, SelectionDAG &DAG) const;
784d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerConstantPool(SDValue Op, SelectionDAG &DAG) const;
785d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerBlockAddress(SDValue Op, SelectionDAG &DAG) const;
78633c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen    SDValue LowerGlobalAddress(const GlobalValue *GV, DebugLoc dl,
78733c960f523f2308482d5b2816af46a7ec90a6d3dDale Johannesen                               int64_t Offset, SelectionDAG &DAG) const;
788d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerGlobalAddress(SDValue Op, SelectionDAG &DAG) const;
789d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerGlobalTLSAddress(SDValue Op, SelectionDAG &DAG) const;
790d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerExternalSymbol(SDValue Op, SelectionDAG &DAG) const;
7914301222525b565028850030835b8db9ce6d153dbNadav Rotem    SDValue LowerShiftParts(SDValue Op, SelectionDAG &DAG) const;
792bf17cfa3f904e488e898ac2e3af706fd1a892f08Wesley Peck    SDValue LowerBITCAST(SDValue op, SelectionDAG &DAG) const;
793d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
794d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerUINT_TO_FP(SDValue Op, SelectionDAG &DAG) const;
795d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerUINT_TO_FP_i64(SDValue Op, SelectionDAG &DAG) const;
796d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerUINT_TO_FP_i32(SDValue Op, SelectionDAG &DAG) const;
797d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFP_TO_SINT(SDValue Op, SelectionDAG &DAG) const;
798d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFP_TO_UINT(SDValue Op, SelectionDAG &DAG) const;
799d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFABS(SDValue Op, SelectionDAG &DAG) const;
800d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFNEG(SDValue Op, SelectionDAG &DAG) const;
801d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFCOPYSIGN(SDValue Op, SelectionDAG &DAG) const;
8024fd0dee3bfe8a35bbb62c9e9dea511cbc06cec2dStuart Hastings    SDValue LowerFGETSIGN(SDValue Op, SelectionDAG &DAG) const;
8035528e7bcb1209094a68bbf6d1efeefc3ca34774fEvan Cheng    SDValue LowerToBT(SDValue And, ISD::CondCode CC,
8045528e7bcb1209094a68bbf6d1efeefc3ca34774fEvan Cheng                      DebugLoc dl, SelectionDAG &DAG) const;
805d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSETCC(SDValue Op, SelectionDAG &DAG) const;
806d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVSETCC(SDValue Op, SelectionDAG &DAG) const;
807d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerSELECT(SDValue Op, SelectionDAG &DAG) const;
808d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerBRCOND(SDValue Op, SelectionDAG &DAG) const;
809d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerMEMSET(SDValue Op, SelectionDAG &DAG) const;
810d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerJumpTable(SDValue Op, SelectionDAG &DAG) const;
811d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerDYNAMIC_STACKALLOC(SDValue Op, SelectionDAG &DAG) const;
812d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVASTART(SDValue Op, SelectionDAG &DAG) const;
813d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVAARG(SDValue Op, SelectionDAG &DAG) const;
814d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerVACOPY(SDValue Op, SelectionDAG &DAG) const;
815d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerINTRINSIC_WO_CHAIN(SDValue Op, SelectionDAG &DAG) const;
816d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerRETURNADDR(SDValue Op, SelectionDAG &DAG) const;
817d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFRAMEADDR(SDValue Op, SelectionDAG &DAG) const;
818d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFRAME_TO_ARGS_OFFSET(SDValue Op, SelectionDAG &DAG) const;
819d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerEH_RETURN(SDValue Op, SelectionDAG &DAG) const;
820d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerTRAMPOLINE(SDValue Op, SelectionDAG &DAG) const;
821d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerFLT_ROUNDS_(SDValue Op, SelectionDAG &DAG) const;
822d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerCTLZ(SDValue Op, SelectionDAG &DAG) const;
823d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerCTTZ(SDValue Op, SelectionDAG &DAG) const;
824d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerMUL_V2I64(SDValue Op, SelectionDAG &DAG) const;
8254301222525b565028850030835b8db9ce6d153dbNadav Rotem    SDValue LowerShift(SDValue Op, SelectionDAG &DAG) const;
826d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerXALUO(SDValue Op, SelectionDAG &DAG) const;
827d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman
828d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerCMP_SWAP(SDValue Op, SelectionDAG &DAG) const;
829d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerLOAD_SUB(SDValue Op, SelectionDAG &DAG) const;
830d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman    SDValue LowerREADCYCLECOUNTER(SDValue Op, SelectionDAG &DAG) const;
8319a9d275dc7897dfba7f41ce1b3770ca27ac149e8Eric Christopher    SDValue LowerMEMBARRIER(SDValue Op, SelectionDAG &DAG) const;
8321607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands
833bf8154a4395bf941f57f6453503a850cb9805a64Bruno Cardoso Lopes    // Utility functions to help LowerVECTOR_SHUFFLE
834bf8154a4395bf941f57f6453503a850cb9805a64Bruno Cardoso Lopes    SDValue LowerVECTOR_SHUFFLEv8i16(SDValue Op, SelectionDAG &DAG) const;
835bf8154a4395bf941f57f6453503a850cb9805a64Bruno Cardoso Lopes
83698ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
83798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman      LowerFormalArguments(SDValue Chain,
83865c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                           CallingConv::ID CallConv, bool isVarArg,
83998ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                           const SmallVectorImpl<ISD::InputArg> &Ins,
84098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                           DebugLoc dl, SelectionDAG &DAG,
841d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                           SmallVectorImpl<SDValue> &InVals) const;
84298ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
843022d9e1cef7586a80a96446ae8691a37def9bbf4Evan Cheng      LowerCall(SDValue Chain, SDValue Callee,
8440c439eb2c8397996cbccaf2798e598052d9982c8Evan Cheng                CallingConv::ID CallConv, bool isVarArg, bool &isTailCall,
84598ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                const SmallVectorImpl<ISD::OutputArg> &Outs,
846c9403659a98bf6487ab6fbf40b81628b5695c02eDan Gohman                const SmallVectorImpl<SDValue> &OutVals,
84798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                const SmallVectorImpl<ISD::InputArg> &Ins,
84898ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                DebugLoc dl, SelectionDAG &DAG,
849d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                SmallVectorImpl<SDValue> &InVals) const;
85098ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
85198ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman    virtual SDValue
85298ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman      LowerReturn(SDValue Chain,
85365c3c8f323198b99b88b109654194540cf9b3fa5Sandeep Patel                  CallingConv::ID CallConv, bool isVarArg,
85498ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman                  const SmallVectorImpl<ISD::OutputArg> &Outs,
855c9403659a98bf6487ab6fbf40b81628b5695c02eDan Gohman                  const SmallVectorImpl<SDValue> &OutVals,
856d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                  DebugLoc dl, SelectionDAG &DAG) const;
85798ca4f2a325f72374a477f9deba7d09e8999c29bDan Gohman
8583d2125c9dbac695c93f42c0f59fd040e413fd711Evan Cheng    virtual bool isUsedByReturnOnly(SDNode *N) const;
8593d2125c9dbac695c93f42c0f59fd040e413fd711Evan Cheng
860485fafc8406db8552ba5e3ff871a6ee32694ad90Evan Cheng    virtual bool mayBeEmittedAsTailCall(CallInst *CI) const;
861485fafc8406db8552ba5e3ff871a6ee32694ad90Evan Cheng
8627bbf0ee97c77f7712154648a44ac6eeb57886462Cameron Zwarich    virtual EVT
8637bbf0ee97c77f7712154648a44ac6eeb57886462Cameron Zwarich    getTypeForExtArgOrReturn(LLVMContext &Context, EVT VT,
8647bbf0ee97c77f7712154648a44ac6eeb57886462Cameron Zwarich                             ISD::NodeType ExtendKind) const;
865ebe8173941238cfbabadb1c63bca7fb7dcf2adbeCameron Zwarich
866b4997aeab74934ffa6fc0409afc4d8704245e372Kenneth Uildriks    virtual bool
867471e4224809f51652c71f319532697a879a75a0dEric Christopher    CanLowerReturn(CallingConv::ID CallConv, MachineFunction &MF,
868471e4224809f51652c71f319532697a879a75a0dEric Christopher		   bool isVarArg,
869471e4224809f51652c71f319532697a879a75a0dEric Christopher		   const SmallVectorImpl<ISD::OutputArg> &Outs,
870471e4224809f51652c71f319532697a879a75a0dEric Christopher		   LLVMContext &Context) const;
871b4997aeab74934ffa6fc0409afc4d8704245e372Kenneth Uildriks
8721607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands    void ReplaceATOMIC_BINARY_64(SDNode *N, SmallVectorImpl<SDValue> &Results,
873d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                                 SelectionDAG &DAG, unsigned NewOp) const;
8741607f05cb7d77d01ce521a30232faa389dbed4e2Duncan Sands
875b120ab4057fc66ce11ee1f108af9dbbeafa3fed9Eric Christopher    /// Utility function to emit string processing sse4.2 instructions
876b120ab4057fc66ce11ee1f108af9dbbeafa3fed9Eric Christopher    /// that return in xmm0.
877431f775bab2c1ca144e3c9c6b1e3c0767bfacc33Evan Cheng    /// This takes the instruction to expand, the associated machine basic
878431f775bab2c1ca144e3c9c6b1e3c0767bfacc33Evan Cheng    /// block, the number of args, and whether or not the second arg is
879431f775bab2c1ca144e3c9c6b1e3c0767bfacc33Evan Cheng    /// in memory or not.
880b120ab4057fc66ce11ee1f108af9dbbeafa3fed9Eric Christopher    MachineBasicBlock *EmitPCMP(MachineInstr *BInstr, MachineBasicBlock *BB,
88120adc9dc4650313f017b27d9818eb2176238113dMon P Wang                                unsigned argNum, bool inMem) const;
882b120ab4057fc66ce11ee1f108af9dbbeafa3fed9Eric Christopher
883228232b2821f8e7f9c0b874ad733414bda183db6Eric Christopher    /// Utility functions to emit monitor and mwait instructions. These
884228232b2821f8e7f9c0b874ad733414bda183db6Eric Christopher    /// need to make sure that the arguments to the intrinsic are in the
885228232b2821f8e7f9c0b874ad733414bda183db6Eric Christopher    /// correct registers.
88682be220092cfb9d432c5a6da1bd5e8c56dc21d4dEric Christopher    MachineBasicBlock *EmitMonitor(MachineInstr *MI,
88782be220092cfb9d432c5a6da1bd5e8c56dc21d4dEric Christopher                                   MachineBasicBlock *BB) const;
888228232b2821f8e7f9c0b874ad733414bda183db6Eric Christopher    MachineBasicBlock *EmitMwait(MachineInstr *MI, MachineBasicBlock *BB) const;
889228232b2821f8e7f9c0b874ad733414bda183db6Eric Christopher
89063307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang    /// Utility function to emit atomic bitwise operations (and, or, xor).
891431f775bab2c1ca144e3c9c6b1e3c0767bfacc33Evan Cheng    /// It takes the bitwise instruction to expand, the associated machine basic
892431f775bab2c1ca144e3c9c6b1e3c0767bfacc33Evan Cheng    /// block, and the associated X86 opcodes for reg/reg and reg/imm.
89363307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang    MachineBasicBlock *EmitAtomicBitwiseWithCustomInserter(
89463307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang                                                    MachineInstr *BInstr,
89563307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang                                                    MachineBasicBlock *BB,
89663307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang                                                    unsigned regOpc,
897507a58ac9b20ddcea2e56a014be26b8f8cc0ecb8Andrew Lenharth                                                    unsigned immOpc,
898140be2dfb76928cb660b7de23f8310d76ca794b5Dale Johannesen                                                    unsigned loadOpc,
899140be2dfb76928cb660b7de23f8310d76ca794b5Dale Johannesen                                                    unsigned cxchgOpc,
900140be2dfb76928cb660b7de23f8310d76ca794b5Dale Johannesen                                                    unsigned notOpc,
901140be2dfb76928cb660b7de23f8310d76ca794b5Dale Johannesen                                                    unsigned EAXreg,
902140be2dfb76928cb660b7de23f8310d76ca794b5Dale Johannesen                                                    TargetRegisterClass *RC,
9031fdbc1dd4e9cb42c79a30e8dc308c322e923cc52Dan Gohman                                                    bool invSrc = false) const;
90448c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen
90548c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen    MachineBasicBlock *EmitAtomicBit6432WithCustomInserter(
90648c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    MachineInstr *BInstr,
90748c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    MachineBasicBlock *BB,
90848c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    unsigned regOpcL,
90948c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    unsigned regOpcH,
91048c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    unsigned immOpcL,
91148c1bc2ace6481d3272ab5c18e1f19352c563be8Dale Johannesen                                                    unsigned immOpcH,
9121fdbc1dd4e9cb42c79a30e8dc308c322e923cc52Dan Gohman                                                    bool invSrc = false) const;
9136e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
91463307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang    /// Utility function to emit atomic min and max.  It takes the min/max
915bddc442a00c2216834499f10c12d023f1751104cBill Wendling    /// instruction to expand, the associated basic block, and the associated
916bddc442a00c2216834499f10c12d023f1751104cBill Wendling    /// cmov opcode for moving the min or max value.
91763307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang    MachineBasicBlock *EmitAtomicMinMaxWithCustomInserter(MachineInstr *BInstr,
91863307c335aa08b0d6a75f81d64d79af7e90eb78bMon P Wang                                                          MachineBasicBlock *BB,
9191fdbc1dd4e9cb42c79a30e8dc308c322e923cc52Dan Gohman                                                        unsigned cmovOpc) const;
920076aee32e86bc4a0c096262b3261923f25220dc6Dan Gohman
921320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman    // Utility function to emit the low-level va_arg code for X86-64.
922320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman    MachineBasicBlock *EmitVAARG64WithCustomInserter(
923320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman                       MachineInstr *MI,
924320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman                       MachineBasicBlock *MBB) const;
925320afb8c818b5cd5b9d4fcd0dba83ba3384ed4b4Dan Gohman
926d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman    /// Utility function to emit the xmm reg save portion of va_start.
927d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman    MachineBasicBlock *EmitVAStartSaveXMMRegsWithCustomInserter(
928d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman                                                   MachineInstr *BInstr,
929d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman                                                   MachineBasicBlock *BB) const;
930d6708eade079c30b0790789a00a8d737d84f52b7Dan Gohman
93152600972832cb4ae8f4c63802f3764cbfbcb203dChris Lattner    MachineBasicBlock *EmitLoweredSelect(MachineInstr *I,
932af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman                                         MachineBasicBlock *BB) const;
933043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov
934e9c253e0bc01fd50bf788efb62093a5fa6ef5849Michael J. Spencer    MachineBasicBlock *EmitLoweredWinAlloca(MachineInstr *MI,
935af1d8ca44a18f304f207e209b3bdb94b590f86ffDan Gohman                                              MachineBasicBlock *BB) const;
9366e56b18e575228a4f7318297155fe6ba2502a39bMichael J. Spencer
93730ef0e5658b0b8b04437f73f74162d5d72923f29Eric Christopher    MachineBasicBlock *EmitLoweredTLSCall(MachineInstr *MI,
93830ef0e5658b0b8b04437f73f74162d5d72923f29Eric Christopher                                          MachineBasicBlock *BB) const;
939043f3c2a0e286dcfd4cc5a16bf006e3c45929516Anton Korobeynikov
9405bf7c534cf057a52f30624743841fadd241c4dbbRafael Espindola    MachineBasicBlock *emitLoweredTLSAddr(MachineInstr *MI,
9415bf7c534cf057a52f30624743841fadd241c4dbbRafael Espindola                                          MachineBasicBlock *BB) const;
9425bf7c534cf057a52f30624743841fadd241c4dbbRafael Espindola
943076aee32e86bc4a0c096262b3261923f25220dc6Dan Gohman    /// Emit nodes that will be selected as "test Op0,Op0", or something
9443112581441cd22ac955b1af2d08effe3bab975daDan Gohman    /// equivalent, for use with the given x86 condition code.
945552f09a0d716a73dc70efd66384146e73ee63a3eEvan Cheng    SDValue EmitTest(SDValue Op0, unsigned X86CC, SelectionDAG &DAG) const;
946076aee32e86bc4a0c096262b3261923f25220dc6Dan Gohman
947076aee32e86bc4a0c096262b3261923f25220dc6Dan Gohman    /// Emit nodes that will be selected as "cmp Op0,Op1", or something
9483112581441cd22ac955b1af2d08effe3bab975daDan Gohman    /// equivalent, for use with the given x86 condition code.
949552f09a0d716a73dc70efd66384146e73ee63a3eEvan Cheng    SDValue EmitCmp(SDValue Op0, SDValue Op1, unsigned X86CC,
950d858e90f039f5fcdc2fa93035e911a5a9505cc50Dan Gohman                    SelectionDAG &DAG) const;
951dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner  };
952c3f44b0d636ff9a6d706ea9ac17ae77c8fa8aeffEvan Cheng
953c3f44b0d636ff9a6d706ea9ac17ae77c8fa8aeffEvan Cheng  namespace X86 {
954a4160c3434b08288d1f79f1acbe453d1b9610b22Dan Gohman    FastISel *createFastISel(FunctionLoweringInfo &funcInfo);
955c3f44b0d636ff9a6d706ea9ac17ae77c8fa8aeffEvan Cheng  }
956dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner}
957dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner
958dbdbf0ce2eef7b6585397121f56d3845e04866d1Chris Lattner#endif    // X86ISELLOWERING_H
959