diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c index e762f564622..dbee3657f1a 100644 --- a/src/cmd/5a/lex.c +++ b/src/cmd/5a/lex.c @@ -364,7 +364,9 @@ struct "MOVWF", LTYPE3, AMOVWF, "LDREX", LTYPE3, ALDREX, + "LDREXD", LTYPE3, ALDREXD, "STREX", LTYPE9, ASTREX, + "STREXD", LTYPE9, ASTREXD, /* "ABSF", LTYPEI, AABSF, diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h index a25c0f71d33..002b46d451b 100644 --- a/src/cmd/5l/5.out.h +++ b/src/cmd/5l/5.out.h @@ -179,6 +179,9 @@ enum as ALDREX, ASTREX, + + ALDREXD, + ASTREXD, ALAST, }; diff --git a/src/cmd/5l/asm.c b/src/cmd/5l/asm.c index adc4ae7478c..af6d1dfda06 100644 --- a/src/cmd/5l/asm.c +++ b/src/cmd/5l/asm.c @@ -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); if(instoffset != 0) diag("offset must be zero in STREX"); - o1 = (0x3<<23) | (0xf9<<4); + o1 = (0x18<<20) | (0xf90); o1 |= p->from.reg << 16; o1 |= p->reg << 0; 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 o1 = oprrr(ACMP+AEND, p->scond); o1 |= p->from.reg<<16; 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; diff --git a/src/cmd/5l/optab.c b/src/cmd/5l/optab.c index 8b3135e06ed..625b6681210 100644 --- a/src/cmd/5l/optab.c +++ b/src/cmd/5l/optab.c @@ -253,5 +253,8 @@ Optab optab[] = { 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 }, }; diff --git a/src/cmd/5l/span.c b/src/cmd/5l/span.c index 220140f433b..482d3e90a23 100644 --- a/src/cmd/5l/span.c +++ b/src/cmd/5l/span.c @@ -1054,6 +1054,8 @@ buildop(void) case ALDREX: case ASTREX: + case ALDREXD: + case ASTREXD: case ATST: break; }