1
0
mirror of https://github.com/golang/go synced 2024-11-12 07:10:22 -07:00

LDREX and STREX

R=rsc
APPROVED=rsc
DELTA=30  (30 added, 0 deleted, 0 changed)
OCL=35751
CL=35756
This commit is contained in:
Kai Backman 2009-10-14 21:47:08 -07:00
parent c7f837be00
commit f72ea8eb76
5 changed files with 30 additions and 0 deletions

View File

@ -359,6 +359,9 @@ struct
"MOVWD", LTYPE3, AMOVWD,
"MOVWF", LTYPE3, AMOVWF,
"LDREX", LTYPE3, ALDREX,
"STREX", LTYPE9, ASTREX,
/*
"ABSF", LTYPEI, AABSF,
"ABSD", LTYPEI, AABSD,

View File

@ -176,6 +176,9 @@ enum as
ASIGNAME,
ALDREX,
ASTREX,
ALAST,
};

View File

@ -1706,6 +1706,25 @@ if(debug['G']) print("%ulx: %s: arm %d %d %d %d\n", (uint32)(p->pc), p->from.sym
// o1 = olr(instoffset, p->to.reg, REGTMP, p->scond); // mov O(R), Rtmp
o1 = ((p->scond&C_SCOND)<<28) | (0x12fff<<8) | (1<<4) | p->to.reg; // BX R
break;
case 77: /* ldrex oreg,reg */
aclass(&p->from);
if(instoffset != 0)
diag("offset must be zero in LDREX");
o1 = (0x19<<20) | (0xf9f);
o1 |= p->from.reg << 16;
o1 |= p->to.reg << 12;
o1 |= (p->scond & C_SCOND) << 28;
break;
case 78: /* strex reg,oreg,reg */
aclass(&p->from);
if(instoffset != 0)
diag("offset must be zero in STREX");
o1 = (0x3<<23) | (0xf9<<4);
o1 |= p->from.reg << 16;
o1 |= p->reg << 0;
o1 |= p->to.reg << 12;
o1 |= (p->scond & C_SCOND) << 28;
break;
}
v = p->pc;

View File

@ -281,6 +281,8 @@ Optab optab[] =
{ AMOVHU, C_LEXT, C_NONE, C_REG, 73, 8, REGSB, LFROM|V4 },
{ AMOVHU, C_LAUTO,C_NONE, C_REG, 73, 8, REGSP, LFROM|V4 },
{ AMOVHU, C_LOREG,C_NONE, C_REG, 73, 8, 0, LFROM|V4 },
{ ALDREX, C_SOREG,C_NONE, C_REG, 77, 4, 0 },
{ ASTREX, C_SOREG,C_REG, C_REG, 78, 4, 0 },
{ AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0 },
};

View File

@ -1095,6 +1095,9 @@ buildop(void)
oprange[AMULLU] = oprange[r];
oprange[AMULALU] = oprange[r];
break;
case ALDREX:
case ASTREX:
break;
}
}
}