14 #ifndef LLVM_TARGET_TARGETCALLINGCONV_H
15 #define LLVM_TARGET_TARGETCALLINGCONV_H
18 #include "llvm/Support/DataTypes.h"
28 static const uint64_t NoFlagSet = 0ULL;
29 static const uint64_t ZExt = 1ULL<<0;
30 static const uint64_t ZExtOffs = 0;
31 static const uint64_t SExt = 1ULL<<1;
32 static const uint64_t SExtOffs = 1;
33 static const uint64_t InReg = 1ULL<<2;
34 static const uint64_t InRegOffs = 2;
35 static const uint64_t SRet = 1ULL<<3;
36 static const uint64_t SRetOffs = 3;
37 static const uint64_t ByVal = 1ULL<<4;
38 static const uint64_t ByValOffs = 4;
39 static const uint64_t Nest = 1ULL<<5;
40 static const uint64_t NestOffs = 5;
41 static const uint64_t Returned = 1ULL<<6;
42 static const uint64_t ReturnedOffs = 6;
43 static const uint64_t ByValAlign = 0xFULL<<7;
44 static const uint64_t ByValAlignOffs = 7;
45 static const uint64_t Split = 1ULL<<11;
46 static const uint64_t SplitOffs = 11;
47 static const uint64_t InAlloca = 1ULL<<12;
48 static const uint64_t InAllocaOffs = 12;
49 static const uint64_t OrigAlign = 0x1FULL<<27;
50 static const uint64_t OrigAlignOffs = 27;
51 static const uint64_t ByValSize = 0x3fffffffULL<<32;
52 static const uint64_t ByValSizeOffs = 32;
53 static const uint64_t InConsecutiveRegsLast = 0x1ULL<<62;
54 static const uint64_t InConsecutiveRegsLastOffs = 62;
55 static const uint64_t InConsecutiveRegs = 0x1ULL<<63;
56 static const uint64_t InConsecutiveRegsOffs = 63;
58 static const uint64_t One = 1ULL;
64 bool isZExt()
const {
return Flags & ZExt; }
65 void setZExt() { Flags |= One << ZExtOffs; }
67 bool isSExt()
const {
return Flags & SExt; }
68 void setSExt() { Flags |= One << SExtOffs; }
70 bool isInReg()
const {
return Flags & InReg; }
73 bool isSRet()
const {
return Flags & SRet; }
74 void setSRet() { Flags |= One << SRetOffs; }
76 bool isByVal()
const {
return Flags & ByVal; }
82 bool isNest()
const {
return Flags & Nest; }
83 void setNest() { Flags |= One << NestOffs; }
96 ((One << ((Flags & ByValAlign) >> ByValAlignOffs)) / 2);
99 Flags = (Flags & ~ByValAlign) |
100 (uint64_t(
Log2_32(A) + 1) << ByValAlignOffs);
103 bool isSplit()
const {
return Flags & Split; }
108 ((One << ((Flags & OrigAlign) >> OrigAlignOffs)) / 2);
111 Flags = (Flags & ~OrigAlign) |
112 (uint64_t(
Log2_32(A) + 1) << OrigAlignOffs);
116 return (
unsigned)((Flags & ByValSize) >> ByValSizeOffs);
119 Flags = (Flags & ~ByValSize) | (uint64_t(S) << ByValSizeOffs);
148 unsigned origIdx,
unsigned partOffs)
186 unsigned origIdx,
unsigned partOffs)
void setByValAlign(unsigned A)
unsigned getByValSize() const
void setInConsecutiveRegs()
void setInConsecutiveRegsLast()
void setByValSize(unsigned S)
OutputArg - This struct carries flags and a value for a single outgoing (actual) argument or outgoing...
bool isInConsecutiveRegs() const
bool isInConsecutiveRegsLast() const
void setOrigAlign(unsigned A)
bool IsFixed
IsFixed - Is this a "fixed" value, ie not passed through a vararg "...".
MVT - Machine Value Type.
OutputArg(ArgFlagsTy flags, EVT vt, EVT argvt, bool isfixed, unsigned origIdx, unsigned partOffs)
EVT - Extended Value Type.
unsigned getByValAlign() const
unsigned Log2_32(uint32_t Value)
Log2_32 - This function returns the floor log base 2 of the specified value, -1 if the value is zero...
unsigned OrigArgIndex
Index original Function's argument.
uint64_t getRawBits() const
getRawBits - Represent the flags as a bunch of bits.
unsigned PartOffset
Offset in bytes of current output value relative to the beginning of original argument.
unsigned getOrigAlign() const
MVT getSimpleVT() const
getSimpleVT - Return the SimpleValueType held in the specified simple EVT.