Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cod4.d cgcod.d: remove static compilation #11958

Merged
merged 1 commit into from Nov 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
21 changes: 12 additions & 9 deletions src/dmd/backend/cgcod.d
Expand Up @@ -225,9 +225,10 @@ tryagain:
calledFinally = false;
usednteh = 0;

static if (MARS && TARGET_WINDOS)
static if (MARS)
{
if (sfunc.Sfunc.Fflags3 & Fjmonitor)
if (sfunc.Sfunc.Fflags3 & Fjmonitor &&
config.exe & EX_windos)
usednteh |= NTEHjmonitor;
}
else version (SCPP)
Expand Down Expand Up @@ -635,7 +636,7 @@ tryagain:
if (retoffset < sfunc.Ssize)
objmod.linnum(sfunc.Sfunc.Fendline,sfunc.Sseg,funcoffset + retoffset);

static if (TARGET_WINDOS && MARS)
static if (MARS)
{
if (config.exe == EX_WIN64)
win64_pdata(sfunc);
Expand Down Expand Up @@ -850,7 +851,7 @@ Lagain:
Fast.size -= nteh_contextsym_size();
version (MARS)
{
static if (TARGET_WINDOS)
if (config.exe & EX_windos)
{
if (funcsym_p.Sfunc.Fflags3 & Ffakeeh && nteh_contextsym_size() == 0)
Fast.size -= 5 * 4;
Expand Down Expand Up @@ -2739,12 +2740,14 @@ reload: /* reload result from memory */
cdrelconst(cdb,e,pretregs);
break;

static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
{
case OPgot:
cdgot(cdb,e,pretregs);
break;
}
if (config.exe & EX_posix)
{
cdgot(cdb,e,pretregs);
break;
}
goto default;

default:
if (*pretregs == mPSW &&
config.fpxmmregs &&
Expand Down
21 changes: 10 additions & 11 deletions src/dmd/backend/cod4.d
Expand Up @@ -139,16 +139,15 @@ void modEA(ref CodeBuilder cdb,code *c)
}
}

static if (TARGET_WINDOS)
{
// This code is for CPUs that do not support the 8087

/****************************
* Gen code for op= for doubles.
*/

private void opassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs,OPER op)
{
assert(config.exe & EX_windos); // for targets that may not have an 8087

static immutable uint[OPdivass - OPpostinc + 1] clibtab =
/* OPpostinc,OPpostdec,OPeq,OPaddass,OPminass,OPmulass,OPdivass */
[ CLIB.dadd, CLIB.dsub, cast(uint)-1, CLIB.dadd,CLIB.dsub,CLIB.dmul,CLIB.ddiv ];
Expand Down Expand Up @@ -247,6 +246,8 @@ private void opassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs,OPER op)

private void opnegassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
{
assert(config.exe & EX_windos); // for targets that may not have an 8087

if (config.inline8087)
{
cdnegass87(cdb,e,pretregs);
Expand Down Expand Up @@ -346,7 +347,6 @@ private void opnegassdbl(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
freenode(e1);
fixresult(cdb,e,retregs,pretregs);
}
}



Expand Down Expand Up @@ -864,7 +864,7 @@ void cdaddass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)

if (tyfloating(tyml))
{
static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
if (config.exe & EX_posix)
{
if (op == OPnegass)
cdnegass87(cdb,e,pretregs);
Expand Down Expand Up @@ -1416,7 +1416,7 @@ void cdmulass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)

if (tyfloating(tyml))
{
static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
if (config.exe & EX_posix)
{
opass87(cdb,e,pretregs);
}
Expand Down Expand Up @@ -1698,7 +1698,7 @@ void cddivass(ref CodeBuilder cdb,elem *e,regm_t *pretregs)

if (tyfloating(tyml))
{
static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD || TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
if (config.exe & EX_posix)
{
opass87(cdb,e,pretregs);
}
Expand Down Expand Up @@ -2565,7 +2565,7 @@ void cdcmp(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
}
else
{
static if (TARGET_WINDOS)
if (config.exe & EX_windos)
{
int clib;

Expand Down Expand Up @@ -3033,7 +3033,7 @@ void cdcmp(ref CodeBuilder cdb,elem *e,regm_t *pretregs)
goto L5;

case OPvar:
static if (TARGET_OSX)
if (config.exe & (EX_OSX | EX_OSX64))
{
if (movOnly(e2))
goto L2;
Expand Down Expand Up @@ -3503,8 +3503,7 @@ void cdcnvt(ref CodeBuilder cdb,elem *e, regm_t *pretregs)
cdd_u32(cdb,e,pretregs);
return;
}
static if (TARGET_LINUX || TARGET_OSX || TARGET_FREEBSD || TARGET_OPENBSD ||
TARGET_DRAGONFLYBSD || TARGET_SOLARIS)
if (config.exe & EX_posix)
{
retregs = mST0;
}
Expand Down
3 changes: 3 additions & 0 deletions src/dmd/backend/pdata.d
Expand Up @@ -290,4 +290,7 @@ static if (1)
}

}
else
void win64_pdata(Symbol *sf) { }

}