diff --git a/dmd/mtype.c b/dmd/mtype.c index f8a96163..4f38a0fd 100644 --- a/dmd/mtype.c +++ b/dmd/mtype.c @@ -1136,6 +1136,14 @@ unsigned TypeBasic::alignsize() } +#if IN_LLVM +unsigned TypeBasic::memalign(unsigned salign) +{ + if (global.params.cpu == ARCHx86_64 && (ty == Tfloat80 || ty == Timaginary80)) + return 16; + return Type::memalign(salign); +} +#endif Expression *TypeBasic::getProperty(Loc loc, Identifier *ident) { diff --git a/dmd/mtype.h b/dmd/mtype.h index 083861e4..61ecd3d0 100644 --- a/dmd/mtype.h +++ b/dmd/mtype.h @@ -337,6 +337,9 @@ struct TypeBasic : Type Type *syntaxCopy(); d_uns64 size(Loc loc); unsigned alignsize(); +#if IN_LLVM + unsigned memalign(unsigned salign); +#endif Expression *getProperty(Loc loc, Identifier *ident); Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); char *toChars(); diff --git a/dmd2/mtype.c b/dmd2/mtype.c index bf39167a..92781758 100644 --- a/dmd2/mtype.c +++ b/dmd2/mtype.c @@ -2580,6 +2580,14 @@ unsigned TypeBasic::alignsize() #endif } +#if IN_LLVM +unsigned TypeBasic::memalign(unsigned salign) +{ + if (global.params.cpu == ARCHx86_64 && (ty == Tfloat80 || ty == Timaginary80)) + return 16; + return Type::memalign(salign); +} +#endif Expression *TypeBasic::getProperty(Loc loc, Identifier *ident) { diff --git a/dmd2/mtype.h b/dmd2/mtype.h index 488d59af..4a6846d1 100644 --- a/dmd2/mtype.h +++ b/dmd2/mtype.h @@ -400,6 +400,9 @@ struct TypeBasic : Type Type *syntaxCopy(); d_uns64 size(Loc loc); unsigned alignsize(); +#if IN_LLVM + unsigned memalign(unsigned salign); +#endif Expression *getProperty(Loc loc, Identifier *ident); Expression *dotExp(Scope *sc, Expression *e, Identifier *ident); char *toChars();