diff --git a/src/cmd/5a/lex.c b/src/cmd/5a/lex.c index 19e5982bfc..cc02879b76 100644 --- a/src/cmd/5a/lex.c +++ b/src/cmd/5a/lex.c @@ -329,8 +329,6 @@ struct "STREXD", LTYPE9, ASTREXD, /* - "ABSF", LTYPEI, AABSF, - "ABSD", LTYPEI, AABSD, "NEGF", LTYPEI, ANEGF, "NEGD", LTYPEI, ANEGD, "SQTF", LTYPEI, ASQTF, @@ -343,6 +341,8 @@ struct "NRMD", LTYPEI, ANRMD, */ + "ABSF", LTYPEI, AABSF, + "ABSD", LTYPEI, AABSD, "SQRTF", LTYPEI, ASQRTF, "SQRTD", LTYPEI, ASQRTD, "CMPF", LTYPEL, ACMPF, diff --git a/src/cmd/5l/5.out.h b/src/cmd/5l/5.out.h index ff13c64a6e..1dea18c49e 100644 --- a/src/cmd/5l/5.out.h +++ b/src/cmd/5l/5.out.h @@ -126,6 +126,8 @@ enum as ADIVD, ASQRTF, ASQRTD, + AABSF, + AABSD, ASRL, ASRA, diff --git a/src/cmd/5l/asm.c b/src/cmd/5l/asm.c index 911b6892cf..9a74c2a35d 100644 --- a/src/cmd/5l/asm.c +++ b/src/cmd/5l/asm.c @@ -1493,7 +1493,7 @@ if(debug['G']) print("%ux: %s: arm %d\n", (uint32)(p->pc), p->from.sym->name, p- r = p->reg; if(r == NREG) { r = rt; - if(p->as == AMOVF || p->as == AMOVD || p->as == ASQRTF || p->as == ASQRTD) + if(p->as == AMOVF || p->as == AMOVD || p->as == ASQRTF || p->as == ASQRTD || p->as == AABSF || p->as == AABSD) r = 0; } o1 |= rf | (r<<16) | (rt<<12); @@ -1948,6 +1948,8 @@ oprrr(int a, int sc) case ADIVF: return o | (0xe<<24) | (0x8<<20) | (0xa<<8) | (0<<4); case ASQRTD: return o | (0xe<<24) | (0xb<<20) | (1<<16) | (0xb<<8) | (0xc<<4); case ASQRTF: return o | (0xe<<24) | (0xb<<20) | (1<<16) | (0xa<<8) | (0xc<<4); + case AABSD: return o | (0xe<<24) | (0xb<<20) | (0<<16) | (0xb<<8) | (0xc<<4); + case AABSF: return o | (0xe<<24) | (0xb<<20) | (0<<16) | (0xa<<8) | (0xc<<4); case ACMPD: return o | (0xe<<24) | (0xb<<20) | (4<<16) | (0xb<<8) | (0xc<<4); case ACMPF: return o | (0xe<<24) | (0xb<<20) | (4<<16) | (0xa<<8) | (0xc<<4); diff --git a/src/cmd/5l/softfloat.c b/src/cmd/5l/softfloat.c index 4011071780..8be5b7585c 100644 --- a/src/cmd/5l/softfloat.c +++ b/src/cmd/5l/softfloat.c @@ -55,6 +55,8 @@ softfloat(void) case ADIVD: case ASQRTF: case ASQRTD: + case AABSF: + case AABSD: goto soft; default: diff --git a/src/cmd/5l/span.c b/src/cmd/5l/span.c index 93991ba49c..3787740e28 100644 --- a/src/cmd/5l/span.c +++ b/src/cmd/5l/span.c @@ -819,6 +819,8 @@ buildop(void) oprange[ASQRTD] = oprange[r]; oprange[AMOVFD] = oprange[r]; oprange[AMOVDF] = oprange[r]; + oprange[AABSF] = oprange[r]; + oprange[AABSD] = oprange[r]; break; case ACMPF: diff --git a/src/pkg/runtime/softfloat_arm.c b/src/pkg/runtime/softfloat_arm.c index bd73cb15b5..9a54406302 100644 --- a/src/pkg/runtime/softfloat_arm.c +++ b/src/pkg/runtime/softfloat_arm.c @@ -420,6 +420,23 @@ stage3: // regd, regm are 4bit variables regd, regm, m->freghi[regd], m->freglo[regd]); break; + case 0xeeb00bc0: // D[regd] = abs D[regm] + m->freglo[regd] = m->freglo[regm]; + m->freghi[regd] = m->freghi[regm] & ((1<<31)-1); + + if(trace) + runtime·printf("*** D[%d] = abs D[%d] %x-%x\n", + regd, regm, m->freghi[regd], m->freglo[regd]); + break; + + case 0xeeb00ac0: // F[regd] = abs F[regm] + m->freglo[regd] = m->freglo[regm] & ((1<<31)-1); + + if(trace) + runtime·printf("*** F[%d] = abs F[%d] %x\n", + regd, regm, m->freglo[regd]); + break; + case 0xeeb40bc0: // D[regd] :: D[regm] (CMPD) runtime·fcmp64c(getd(regd), getd(regm), &cmp, &nan); m->fflag = fstatus(nan, cmp);