Commit 96c785de authored by Russ Cox's avatar Russ Cox

5a, 5l: add LDREXD, STREXD

R=ken2
CC=golang-dev
https://golang.org/cl/4239041
parent ad8b0d91
...@@ -364,7 +364,9 @@ struct ...@@ -364,7 +364,9 @@ struct
"MOVWF", LTYPE3, AMOVWF, "MOVWF", LTYPE3, AMOVWF,
"LDREX", LTYPE3, ALDREX, "LDREX", LTYPE3, ALDREX,
"LDREXD", LTYPE3, ALDREXD,
"STREX", LTYPE9, ASTREX, "STREX", LTYPE9, ASTREX,
"STREXD", LTYPE9, ASTREXD,
/* /*
"ABSF", LTYPEI, AABSF, "ABSF", LTYPEI, AABSF,
......
...@@ -179,6 +179,9 @@ enum as ...@@ -179,6 +179,9 @@ enum as
ALDREX, ALDREX,
ASTREX, ASTREX,
ALDREXD,
ASTREXD,
ALAST, ALAST,
}; };
......
...@@ -1463,7 +1463,7 @@ if(debug['G']) print("%ux: %s: arm %d %d %d\n", (uint32)(p->pc), p->from.sym->na ...@@ -1463,7 +1463,7 @@ if(debug['G']) print("%ux: %s: arm %d %d %d\n", (uint32)(p->pc), p->from.sym->na
aclass(&p->from); aclass(&p->from);
if(instoffset != 0) if(instoffset != 0)
diag("offset must be zero in STREX"); diag("offset must be zero in STREX");
o1 = (0x3<<23) | (0xf9<<4); o1 = (0x18<<20) | (0xf90);
o1 |= p->from.reg << 16; o1 |= p->from.reg << 16;
o1 |= p->reg << 0; o1 |= p->reg << 0;
o1 |= p->to.reg << 12; o1 |= p->to.reg << 12;
...@@ -1553,6 +1553,25 @@ if(debug['G']) print("%ux: %s: arm %d %d %d\n", (uint32)(p->pc), p->from.sym->na ...@@ -1553,6 +1553,25 @@ if(debug['G']) print("%ux: %s: arm %d %d %d\n", (uint32)(p->pc), p->from.sym->na
o1 = oprrr(ACMP+AEND, p->scond); o1 = oprrr(ACMP+AEND, p->scond);
o1 |= p->from.reg<<16; o1 |= p->from.reg<<16;
break; break;
case 91: /* ldrexd oreg,reg */
aclass(&p->from);
if(instoffset != 0)
diag("offset must be zero in LDREX");
o1 = (0x1b<<20) | (0xf9f);
o1 |= p->from.reg << 16;
o1 |= p->to.reg << 12;
o1 |= (p->scond & C_SCOND) << 28;
break;
case 92: /* strexd reg,oreg,reg */
aclass(&p->from);
if(instoffset != 0)
diag("offset must be zero in STREX");
o1 = (0x1a<<20) | (0xf90);
o1 |= p->from.reg << 16;
o1 |= p->reg << 0;
o1 |= p->to.reg << 12;
o1 |= (p->scond & C_SCOND) << 28;
break;
} }
out[0] = o1; out[0] = o1;
......
...@@ -253,5 +253,8 @@ Optab optab[] = ...@@ -253,5 +253,8 @@ Optab optab[] =
{ ATST, C_REG, C_NONE, C_NONE, 90, 4, 0 }, { ATST, C_REG, C_NONE, C_NONE, 90, 4, 0 },
{ ALDREXD, C_SOREG,C_NONE, C_REG, 91, 4, 0 },
{ ASTREXD, C_SOREG,C_REG, C_REG, 92, 4, 0 },
{ AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0 }, { AXXX, C_NONE, C_NONE, C_NONE, 0, 4, 0 },
}; };
...@@ -1054,6 +1054,8 @@ buildop(void) ...@@ -1054,6 +1054,8 @@ buildop(void)
case ALDREX: case ALDREX:
case ASTREX: case ASTREX:
case ALDREXD:
case ASTREXD:
case ATST: case ATST:
break; break;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment