Skip to content

Commit

Permalink
more X86 affirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright authored and dlang-bot committed Jun 3, 2024
1 parent 05e70f4 commit 05c8980
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 12 deletions.
9 changes: 2 additions & 7 deletions compiler/src/dmd/target.d
Original file line number Diff line number Diff line change
Expand Up @@ -464,12 +464,10 @@ extern (C++) struct Target
}
}

assert(isX86 != isX86_64);
c.initialize(params, this);
cpp.initialize(params, this);
objc.initialize(params, this);

assert(isX86 != isX86_64);
if (isX86_64)
architectureName = "X86_64";
else
Expand Down Expand Up @@ -577,7 +575,7 @@ extern (C++) struct Target
case TY.Timaginary64:
case TY.Tcomplex64:
if (os & Target.OS.Posix)
return isX86_64 ? 8 : 4;
return isX86 ? 4 : 8;
break;
default:
break;
Expand Down Expand Up @@ -1335,12 +1333,10 @@ extern (C++) struct Target
*/
extern (D) uint stackAlign() @safe
{
assert(isX86_64 != isX86);
uint sz = isXmmSupported() ? 16 :
isX86_64 ? 8 :
isX86 ? 4 : 0;
assert(sz);
assert(sz == (isXmmSupported() ? 16 : (isX86_64 ? 8 : 4)));
return sz;
}
}
Expand Down Expand Up @@ -1494,8 +1490,7 @@ struct TargetCPP
else
assert(0);
// C++ and D ABI incompatible on all (?) x86 32-bit platforms
assert(target.isX86 == !target.isX86_64);
wrapDtorInExternD = !target.isX86_64;
wrapDtorInExternD = target.isX86;
}

/**
Expand Down
8 changes: 4 additions & 4 deletions compiler/src/dmd/tocsym.d
Original file line number Diff line number Diff line change
Expand Up @@ -284,7 +284,7 @@ Symbol *toSymbol(Dsymbol s)
final switch (vd.resolvedLinkage())
{
case LINK.windows:
m = target.isX86_64 ? Mangle.c : Mangle.stdcall;
m = target.isX86 ? Mangle.stdcall : Mangle.c;
break;

case LINK.objc:
Expand Down Expand Up @@ -435,7 +435,7 @@ Symbol *toSymbol(Dsymbol s)
final switch (fd.resolvedLinkage())
{
case LINK.windows:
t.Tmangle = target.isX86_64 ? Mangle.c : Mangle.stdcall;
t.Tmangle = target.isX86 ? Mangle.stdcall : Mangle.c;
break;

case LINK.c:
Expand All @@ -453,7 +453,7 @@ Symbol *toSymbol(Dsymbol s)
s.Sflags |= SFLpublic;
/* Nested functions use the same calling convention as
* member functions, because both can be used as delegates. */
if ((fd.isThis() || fd.isNested()) && !target.isX86_64 && target.os == Target.OS.Windows)
if ((fd.isThis() || fd.isNested()) && target.isX86 && target.os == Target.OS.Windows)
{
if ((cast(TypeFunction)fd.type).parameterList.varargs == VarArg.variadic)
{
Expand Down Expand Up @@ -701,7 +701,7 @@ Symbol *toInitializer(AggregateDeclaration ad)
sd.type.size() <= 128 &&
sd.zeroInit &&
config.objfmt != OBJ_MACH && // same reason as in toobj.d toObjFile()
!(config.objfmt == OBJ_MSCOFF && !target.isX86_64)) // -m32mscoff relocations are wrong
!(config.objfmt == OBJ_MSCOFF && target.isX86)) // -m32mscoff relocations are wrong
{
auto bzsave = bzeroSymbol;
ad.sinit = getBzeroSymbol();
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/toobj.d
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,7 @@ void toObjFile(Dsymbol ds, bool multiobj)
final switch (vd.resolvedLinkage())
{
case LINK.windows:
return target.isX86_64 ? Mangle.c : Mangle.stdcall;
return target.isX86 ? Mangle.stdcall : Mangle.c;

case LINK.objc:
case LINK.c:
Expand Down

0 comments on commit 05c8980

Please sign in to comment.