@@ -1020,6 +1020,37 @@ struct TargetAArch64 : public GenericTarget<TargetAArch64> {
1020
1020
};
1021
1021
} // namespace
1022
1022
1023
+ // ===----------------------------------------------------------------------===//
1024
+ // PPC (AIX 32 bit) target specifics.
1025
+ // ===----------------------------------------------------------------------===//
1026
+ namespace {
1027
+ struct TargetPPC : public GenericTarget <TargetPPC> {
1028
+ using GenericTarget::GenericTarget;
1029
+
1030
+ static constexpr int defaultWidth = 32 ;
1031
+
1032
+ CodeGenSpecifics::Marshalling
1033
+ complexArgumentType (mlir::Location, mlir::Type eleTy) const override {
1034
+ CodeGenSpecifics::Marshalling marshal;
1035
+ // two distinct element type arguments (re, im)
1036
+ marshal.emplace_back (eleTy, AT{});
1037
+ marshal.emplace_back (eleTy, AT{});
1038
+ return marshal;
1039
+ }
1040
+
1041
+ CodeGenSpecifics::Marshalling
1042
+ complexReturnType (mlir::Location, mlir::Type eleTy) const override {
1043
+ CodeGenSpecifics::Marshalling marshal;
1044
+ // Use a type that will be translated into LLVM as:
1045
+ // { t, t } struct of 2 element type
1046
+ marshal.emplace_back (
1047
+ mlir::TupleType::get (eleTy.getContext (), mlir::TypeRange{eleTy, eleTy}),
1048
+ AT{});
1049
+ return marshal;
1050
+ }
1051
+ };
1052
+ } // namespace
1053
+
1023
1054
// ===----------------------------------------------------------------------===//
1024
1055
// PPC64 (AIX 64 bit) target specifics.
1025
1056
// ===----------------------------------------------------------------------===//
@@ -1847,6 +1878,9 @@ fir::CodeGenSpecifics::get(mlir::MLIRContext *ctx, llvm::Triple &&trp,
1847
1878
case llvm::Triple::ArchType::aarch64:
1848
1879
return std::make_unique<TargetAArch64>(
1849
1880
ctx, std::move (trp), std::move (kindMap), targetCPU, targetFeatures, dl);
1881
+ case llvm::Triple::ArchType::ppc:
1882
+ return std::make_unique<TargetPPC>(ctx, std::move (trp), std::move (kindMap),
1883
+ targetCPU, targetFeatures, dl);
1850
1884
case llvm::Triple::ArchType::ppc64:
1851
1885
return std::make_unique<TargetPPC64>(
1852
1886
ctx, std::move (trp), std::move (kindMap), targetCPU, targetFeatures, dl);
0 commit comments