LLVM: lib/Target/SystemZ/SystemZCallingConv.h Source File (original) (raw)

1

2

3

4

5

6

7

8

9#ifndef LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCALLINGCONV_H

10#define LLVM_LIB_TARGET_SYSTEMZ_SYSTEMZCALLINGCONV_H

11

16

17namespace llvm {

21

24

27

30}

31

32

33

34

35

36

38 MVT &LocVT,

43

44

45

46 if (!ArgFlags.isSplit() && PendingMembers.empty())

47 return false;

48

49

50 LocVT = MVT::i64;

53 LocVT, LocInfo));

55 return true;

56

57

58

59

60 unsigned Reg;

67 else

69

71 ? 0

72 : State.AllocateStack(8, Align(8));

73

74

75 for (auto &It : PendingMembers) {

77 It.convertToReg(Reg);

78 else

79 It.convertToMem(Offset);

80 State.addLoc(It);

81 }

82

83 PendingMembers.clear();

84

85 return true;

86}

87

88

92 if (LocVT != MVT::i64) {

93 LocVT = MVT::i64;

95 }

96 return false;

97}

98

102 if (LocVT == MVT::f32 || LocVT == MVT::f64) {

104 }

106

109

110

111

112 if (LocVT == MVT::f128) {

116 }

117 }

118 return false;

119}

120

122 MVT &LocVT,

126

127

128

129

130

131

132 State.AllocateReg(SystemZ::R1D);

133

134 bool AllocGPR2 = State.AllocateReg(SystemZ::R2D);

135 bool AllocGPR3 = State.AllocateReg(SystemZ::R3D);

136

137

138

139

140

141 if (AllocGPR3) {

142

143

144 LocVT = MVT::i128;

146 auto Offset = State.AllocateStack(16, Align(8));

147 if (AllocGPR2)

148 State.addLoc(

150 else

151 State.addLoc(

153 return true;

154 }

155

156 return false;

157}

158

162 llvm_unreachable("Return value calling convention currently unsupported.");

163}

164

167 llvm_unreachable("Argument calling convention currently unsupported.");

168}

169

176

177}

178

179#endif

This file defines the SmallVector class.

CCState - This class holds information needed while lowering arguments and return values.

static CCValAssign getPending(unsigned ValNo, MVT ValVT, MVT LocVT, LocInfo HTP, unsigned ExtraInfo=0)

static CCValAssign getReg(unsigned ValNo, MVT ValVT, MCRegister Reg, MVT LocVT, LocInfo HTP, bool IsCustom=false)

static CCValAssign getCustomMem(unsigned ValNo, MVT ValVT, int64_t Offset, MVT LocVT, LocInfo HTP)

bool is128BitVector() const

Return true if this is a 128-bit vector type.

This class consists of common code factored out of the SmallVector class to reduce code duplication b...

void push_back(const T &Elt)

bool isTargetXPLINK64() const

#define llvm_unreachable(msg)

Marks that the current location is not supposed to be reachable.

const MCPhysReg XPLINK64ArgFPRs[XPLINK64NumArgFPRs]

const MCPhysReg ELFArgFPRs[ELFNumArgFPRs]

const unsigned XPLINK64NumArgFPRs

Definition SystemZCallingConv.h:28

const unsigned XPLINK64NumArgGPRs

Definition SystemZCallingConv.h:25

const MCPhysReg ELFArgGPRs[ELFNumArgGPRs]

const unsigned ELFNumArgGPRs

Definition SystemZCallingConv.h:19

const unsigned ELFNumArgFPRs

Definition SystemZCallingConv.h:22

const MCPhysReg XPLINK64ArgGPRs[XPLINK64NumArgGPRs]

This is an optimization pass for GlobalISel generic memory operations.

bool CC_SystemZ_I128Indirect(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)

Definition SystemZCallingConv.h:37

bool CC_XPLINK64_Pointer(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)

Definition SystemZCallingConv.h:89

bool CC_XPLINK64_Allocate128BitVararg(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)

Definition SystemZCallingConv.h:121

bool CC_SystemZ_GHC_Error(unsigned &, MVT &, MVT &, CCValAssign::LocInfo &, ISD::ArgFlagsTy &, CCState &)

Definition SystemZCallingConv.h:170

LLVM_ABI void report_fatal_error(Error Err, bool gen_crash_diag=true)

bool RetCC_SystemZ_Error(unsigned &, MVT &, MVT &, CCValAssign::LocInfo &, ISD::ArgFlagsTy &, CCState &)

Definition SystemZCallingConv.h:159

bool CC_SystemZ_Error(unsigned &, MVT &, MVT &, CCValAssign::LocInfo &, ISD::ArgFlagsTy &, CCState &)

Definition SystemZCallingConv.h:165

uint16_t MCPhysReg

An unsigned integer type large enough to represent all physical registers, but not necessarily virtua...

bool CC_XPLINK64_Shadow_Reg(unsigned &ValNo, MVT &ValVT, MVT &LocVT, CCValAssign::LocInfo &LocInfo, ISD::ArgFlagsTy &ArgFlags, CCState &State)

Definition SystemZCallingConv.h:99

This struct is a compact representation of a valid (non-zero power of two) alignment.