}
}
-
-namespace {
- class SystemZTargetInfo : public TargetInfo {
- static const char * const GCCRegNames[];
- public:
- SystemZTargetInfo(const std::string& triple) : TargetInfo(triple) {
- TLSSupported = false;
- IntWidth = IntAlign = 32;
- LongWidth = LongLongWidth = LongAlign = LongLongAlign = 64;
- PointerWidth = PointerAlign = 64;
- DescriptionString = "E-p:64:64:64-i8:8:16-i16:16:16-i32:32:32-"
- "i64:64:64-f32:32:32-f64:64:64-f128:128:128-a0:16:16-n32:64";
- }
- virtual void getTargetDefines(const LangOptions &Opts,
- MacroBuilder &Builder) const {
- Builder.defineMacro("__s390__");
- Builder.defineMacro("__s390x__");
- }
- virtual void getTargetBuiltins(const Builtin::Info *&Records,
- unsigned &NumRecords) const {
- // FIXME: Implement.
- Records = 0;
- NumRecords = 0;
- }
-
- virtual void getGCCRegNames(const char * const *&Names,
- unsigned &NumNames) const;
- virtual void getGCCRegAliases(const GCCRegAlias *&Aliases,
- unsigned &NumAliases) const {
- // No aliases.
- Aliases = 0;
- NumAliases = 0;
- }
- virtual bool validateAsmConstraint(const char *&Name,
- TargetInfo::ConstraintInfo &info) const {
- // FIXME: implement
- return true;
- }
- virtual const char *getClobbers() const {
- // FIXME: Is this really right?
- return "";
- }
- virtual const char *getVAListDeclaration() const {
- // FIXME: implement
- return "typedef char* __builtin_va_list;";
- }
- };
-
- const char * const SystemZTargetInfo::GCCRegNames[] = {
- "r0", "r1", "r2", "r3", "r4", "r5", "r6", "r7",
- "r8", "r9", "r10", "r11", "r12", "r13", "r14", "r15"
- };
-
- void SystemZTargetInfo::getGCCRegNames(const char * const *&Names,
- unsigned &NumNames) const {
- Names = GCCRegNames;
- NumNames = llvm::array_lengthof(GCCRegNames);
- }
-}
-
namespace {
class BlackfinTargetInfo : public TargetInfo {
static const char * const GCCRegNames[];
case llvm::Triple::cellspu:
return new PS3SPUTargetInfo<PPC64TargetInfo>(T);
- case llvm::Triple::systemz:
- return new SystemZTargetInfo(T);
-
case llvm::Triple::tce:
return new TCETargetInfo(T);
}
-//===----------------------------------------------------------------------===//
-// SystemZ ABI Implementation
-//===----------------------------------------------------------------------===//
-
-namespace {
-
-class SystemZABIInfo : public ABIInfo {
-public:
- SystemZABIInfo(CodeGenTypes &CGT) : ABIInfo(CGT) {}
-
- bool isPromotableIntegerType(QualType Ty) const;
-
- ABIArgInfo classifyReturnType(QualType RetTy) const;
- ABIArgInfo classifyArgumentType(QualType RetTy) const;
-
- virtual void computeInfo(CGFunctionInfo &FI) const {
- FI.getReturnInfo() = classifyReturnType(FI.getReturnType());
- for (CGFunctionInfo::arg_iterator it = FI.arg_begin(), ie = FI.arg_end();
- it != ie; ++it)
- it->info = classifyArgumentType(it->type);
- }
-
- virtual llvm::Value *EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
- CodeGenFunction &CGF) const;
-};
-
-class SystemZTargetCodeGenInfo : public TargetCodeGenInfo {
-public:
- SystemZTargetCodeGenInfo(CodeGenTypes &CGT)
- : TargetCodeGenInfo(new SystemZABIInfo(CGT)) {}
-};
-
-}
-
-bool SystemZABIInfo::isPromotableIntegerType(QualType Ty) const {
- // SystemZ ABI requires all 8, 16 and 32 bit quantities to be extended.
- if (const BuiltinType *BT = Ty->getAs<BuiltinType>())
- switch (BT->getKind()) {
- case BuiltinType::Bool:
- case BuiltinType::Char_S:
- case BuiltinType::Char_U:
- case BuiltinType::SChar:
- case BuiltinType::UChar:
- case BuiltinType::Short:
- case BuiltinType::UShort:
- case BuiltinType::Int:
- case BuiltinType::UInt:
- return true;
- default:
- return false;
- }
- return false;
-}
-
-llvm::Value *SystemZABIInfo::EmitVAArg(llvm::Value *VAListAddr, QualType Ty,
- CodeGenFunction &CGF) const {
- // FIXME: Implement
- return 0;
-}
-
-
-ABIArgInfo SystemZABIInfo::classifyReturnType(QualType RetTy) const {
- if (RetTy->isVoidType())
- return ABIArgInfo::getIgnore();
- if (isAggregateTypeForABI(RetTy))
- return ABIArgInfo::getIndirect(0);
-
- return (isPromotableIntegerType(RetTy) ?
- ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
-}
-
-ABIArgInfo SystemZABIInfo::classifyArgumentType(QualType Ty) const {
- if (isAggregateTypeForABI(Ty))
- return ABIArgInfo::getIndirect(0);
-
- return (isPromotableIntegerType(Ty) ?
- ABIArgInfo::getExtend() : ABIArgInfo::getDirect());
-}
-
//===----------------------------------------------------------------------===//
// MBlaze ABI Implementation
//===----------------------------------------------------------------------===//
case llvm::Triple::ptx64:
return *(TheTargetCodeGenInfo = new PTXTargetCodeGenInfo(Types));
- case llvm::Triple::systemz:
- return *(TheTargetCodeGenInfo = new SystemZTargetCodeGenInfo(Types));
-
case llvm::Triple::mblaze:
return *(TheTargetCodeGenInfo = new MBlazeTargetCodeGenInfo(Types));
if (Triple.isOSDarwin())
return true;
return false;
-
- case llvm::Triple::systemz:
- return false;
}
}
'-I%s/lib/Target/PIC16' % root.llvm_src_root,
'-I%s/lib/Target/PowerPC' % root.llvm_src_root,
'-I%s/lib/Target/Sparc' % root.llvm_src_root,
- '-I%s/lib/Target/SystemZ' % root.llvm_src_root,
'-I%s/lib/Target/X86' % root.llvm_src_root,
'-I%s/lib/Target/XCore' % root.llvm_src_root,
'-I%s/lib/Target/Alpha' % target_obj_root,
'-I%s/lib/Target/PIC16' % target_obj_root,
'-I%s/lib/Target/PowerPC' % target_obj_root,
'-I%s/lib/Target/Sparc' % target_obj_root,
- '-I%s/lib/Target/SystemZ' % target_obj_root,
'-I%s/lib/Target/X86' % target_obj_root,
'-I%s/lib/Target/XCore' % target_obj_root];
'-I%s/lib/Target/PIC16' % root.llvm_src_root,
'-I%s/lib/Target/PowerPC' % root.llvm_src_root,
'-I%s/lib/Target/Sparc' % root.llvm_src_root,
- '-I%s/lib/Target/SystemZ' % root.llvm_src_root,
'-I%s/lib/Target/X86' % root.llvm_src_root,
'-I%s/lib/Target/XCore' % root.llvm_src_root,
'-I%s/lib/Target/Alpha' % target_obj_root,
'-I%s/lib/Target/PIC16' % target_obj_root,
'-I%s/lib/Target/PowerPC' % target_obj_root,
'-I%s/lib/Target/Sparc' % target_obj_root,
- '-I%s/lib/Target/SystemZ' % target_obj_root,
'-I%s/lib/Target/X86' % target_obj_root,
'-I%s/lib/Target/XCore' % target_obj_root];
'-I%s/lib/Target/PIC16' % root.llvm_src_root,
'-I%s/lib/Target/PowerPC' % root.llvm_src_root,
'-I%s/lib/Target/Sparc' % root.llvm_src_root,
- '-I%s/lib/Target/SystemZ' % root.llvm_src_root,
'-I%s/lib/Target/X86' % root.llvm_src_root,
'-I%s/lib/Target/XCore' % root.llvm_src_root,
'-I%s/lib/Target/Alpha' % target_obj_root,
'-I%s/lib/Target/PIC16' % target_obj_root,
'-I%s/lib/Target/PowerPC' % target_obj_root,
'-I%s/lib/Target/Sparc' % target_obj_root,
- '-I%s/lib/Target/SystemZ' % target_obj_root,
'-I%s/lib/Target/X86' % target_obj_root,
'-I%s/lib/Target/XCore' % target_obj_root];