Skip to content

Commit

Permalink
remove unnecessary genmovreg() overloads (dlang#16573)
Browse files Browse the repository at this point in the history
  • Loading branch information
WalterBright authored Jun 9, 2024
1 parent 56a21cb commit d9f04c6
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 14 deletions.
7 changes: 6 additions & 1 deletion compiler/src/dmd/backend/x86/cgcod.d
Original file line number Diff line number Diff line change
Expand Up @@ -2845,7 +2845,12 @@ void scodelem(ref CGstate cg, ref CodeBuilder cdb, elem *e,regm_t *pretregs,regm
if (touse & mj)
{
genmovreg(cdbs1,j,i);
cs2 = cat(genmovreg(i,j),cs2);

CodeBuilder cdbs2; cdbs2.ctor();
genmovreg(cdbs2, i, j);

cs2 = cat(cdbs2.finish(),cs2);

touse &= ~mj;
cg.mfuncreg &= ~mj;
cg.regcon.used |= mj;
Expand Down
14 changes: 1 addition & 13 deletions compiler/src/dmd/backend/x86/cod3.d
Original file line number Diff line number Diff line change
Expand Up @@ -2804,20 +2804,8 @@ void genpop(ref CodeBuilder cdb, reg_t reg)
* register moves.
*/

code *genmovreg(uint to,uint from)
{
CodeBuilder cdb; cdb.ctor();
genmovreg(cdb, to, from);
return cdb.finish();
}

void genmovreg(ref CodeBuilder cdb,uint to,uint from)
{
genmovreg(cdb, to, from, TYMAX);
}

@trusted
void genmovreg(ref CodeBuilder cdb, uint to, uint from, tym_t tym)
void genmovreg(ref CodeBuilder cdb, uint to, uint from, tym_t tym = TYMAX)
{
// register kind. ex: GPR,XMM,SEG
static uint _K(uint reg)
Expand Down

0 comments on commit d9f04c6

Please sign in to comment.