summaryrefslogtreecommitdiff
path: root/usr/src/uts/sparc
diff options
context:
space:
mode:
Diffstat (limited to 'usr/src/uts/sparc')
-rw-r--r--usr/src/uts/sparc/fpu/fpu_simulator.c135
-rw-r--r--usr/src/uts/sparc/sys/fpu/fpu_simulator.h14
2 files changed, 8 insertions, 141 deletions
diff --git a/usr/src/uts/sparc/fpu/fpu_simulator.c b/usr/src/uts/sparc/fpu/fpu_simulator.c
index 953b0abd65..c65e15402a 100644
--- a/usr/src/uts/sparc/fpu/fpu_simulator.c
+++ b/usr/src/uts/sparc/fpu/fpu_simulator.c
@@ -112,14 +112,6 @@ struct fpuinfo_kstat fpuinfo = {
{ "fpu_sim_fnmaddd", KSTAT_DATA_UINT64},
{ "fpu_sim_fnmsubs", KSTAT_DATA_UINT64},
{ "fpu_sim_fnmsubd", KSTAT_DATA_UINT64},
- { "fpu_sim_fumadds", KSTAT_DATA_UINT64},
- { "fpu_sim_fumaddd", KSTAT_DATA_UINT64},
- { "fpu_sim_fumsubs", KSTAT_DATA_UINT64},
- { "fpu_sim_fumsubd", KSTAT_DATA_UINT64},
- { "fpu_sim_fnumadds", KSTAT_DATA_UINT64},
- { "fpu_sim_fnumaddd", KSTAT_DATA_UINT64},
- { "fpu_sim_fnumsubs", KSTAT_DATA_UINT64},
- { "fpu_sim_fnumsubd", KSTAT_DATA_UINT64},
{ "fpu_sim_invalid", KSTAT_DATA_UINT64},
};
@@ -185,14 +177,12 @@ _fp_fpu_simulator(
enum fcc_type cc;
uint32_t nfcc; /* fcc number field. */
uint64_t lusr;
- uint_t fmau_mul_exceptions;
nrs1 = inst.rs1;
nrs2 = inst.rs2;
nrd = inst.rd;
fsr = *pfsr;
pfpsd->fp_current_exceptions = 0; /* Init current exceptions. */
- fmau_mul_exceptions = 0;
pfpsd->fp_fsrtem = fsr.tem; /* Obtain fsr's tem */
/*
* Obtain rounding direction and precision
@@ -200,7 +190,7 @@ _fp_fpu_simulator(
pfpsd->fp_direction = GSR_IM(gsr) ? GSR_IRND(gsr) : fsr.rnd;
pfpsd->fp_precision = fsr.rnp;
- if (inst.op3 == 0x37) { /* FMA-fused opcode */
+ if (inst.op3 == 0x37) { /* IMPDEP2B FMA-fused opcode */
fp_fma_inst_type *fma_inst;
uint32_t nrs3;
unpacked us3;
@@ -263,121 +253,6 @@ _fp_fpu_simulator(
FPUINFO_KSTAT_PREC(fma_inst->sz, fpu_sim_fnmsubs,
fpu_sim_fnmsubd, fpu_sim_invalid);
}
- } else if (inst.op3 == fmau) { /* FMA-unfused opcode */
- fp_fma_inst_type *fmau_inst;
- uint32_t nrs3;
- unpacked us3;
- unpacked ust;
- /*
- * For FMA-unfused, if either the multiply part or the add
- * part raises an exception whose trap is enabled, we trap
- * with cexc indicating only that exception and aexc un-
- * changed. If neither part raises an exception whose trap
- * is enabled, the instruction completes with cexc indicating
- * just those exceptions that occurred in the add part and
- * aexc accumulating all exceptions that occurred in either
- * part. We use fmau_mul_exceptions to keep track of the
- * exceptions that occurred in the multiply part while we
- * simulate the add part.
- */
- fmau_inst = (fp_fma_inst_type *) &inst;
- nrs2 = fmau_inst->rs2;
- nrs3 = fmau_inst->rs3;
- switch (fmau_inst->var) {
- case fmadd:
- _fp_unpack(pfpsd, &us1, nrs1, fmau_inst->sz);
- _fp_unpack(pfpsd, &us2, nrs2, fmau_inst->sz);
- _fp_mul(pfpsd, &us1, &us2, &ust);
- _fp_pack(pfpsd, &ust, nrd, fmau_inst->sz);
- if ((pfpsd->fp_current_exceptions & fsr.tem) == 0) {
- fmau_mul_exceptions =
- pfpsd->fp_current_exceptions;
- pfpsd->fp_current_exceptions = 0;
- _fp_unpack(pfpsd, &us3, nrs3, fmau_inst->sz);
- _fp_unpack(pfpsd, &ust, nrd, fmau_inst->sz);
- _fp_add(pfpsd, &ust, &us3, &ud);
- /* ensure QSNaN1 has precedence over QNaN3 */
- if ((us3.fpclass == fp_quiet) &&
- ((us1.fpclass == fp_signaling) ||
- (us2.fpclass == fp_signaling)))
- ud = ust;
- _fp_pack(pfpsd, &ud, nrd, fmau_inst->sz);
- }
- FPUINFO_KSTAT_PREC(fmau_inst->sz, fpu_sim_fumadds,
- fpu_sim_fumaddd, fpu_sim_invalid);
- break;
- case fmsub:
- _fp_unpack(pfpsd, &us1, nrs1, fmau_inst->sz);
- _fp_unpack(pfpsd, &us2, nrs2, fmau_inst->sz);
- _fp_mul(pfpsd, &us1, &us2, &ust);
- _fp_pack(pfpsd, &ust, nrd, fmau_inst->sz);
- if ((pfpsd->fp_current_exceptions & fsr.tem) == 0) {
- fmau_mul_exceptions =
- pfpsd->fp_current_exceptions;
- pfpsd->fp_current_exceptions = 0;
- _fp_unpack(pfpsd, &us3, nrs3, fmau_inst->sz);
- _fp_unpack(pfpsd, &ust, nrd, fmau_inst->sz);
- _fp_sub(pfpsd, &ust, &us3, &ud);
- /* ensure QSNaN1 has precedence over QNaN3 */
- if ((us3.fpclass == fp_quiet) &&
- ((us1.fpclass == fp_signaling) ||
- (us2.fpclass == fp_signaling)))
- ud = ust;
- _fp_pack(pfpsd, &ud, nrd, fmau_inst->sz);
- }
- FPUINFO_KSTAT_PREC(fmau_inst->sz, fpu_sim_fumsubs,
- fpu_sim_fumsubd, fpu_sim_invalid);
- break;
- case fnmadd:
- _fp_unpack(pfpsd, &us1, nrs1, fmau_inst->sz);
- _fp_unpack(pfpsd, &us2, nrs2, fmau_inst->sz);
- _fp_mul(pfpsd, &us1, &us2, &ust);
- _fp_pack(pfpsd, &ust, nrd, fmau_inst->sz);
- if ((pfpsd->fp_current_exceptions & fsr.tem) == 0) {
- fmau_mul_exceptions =
- pfpsd->fp_current_exceptions;
- pfpsd->fp_current_exceptions = 0;
- _fp_unpack(pfpsd, &us3, nrs3, fmau_inst->sz);
- _fp_unpack(pfpsd, &ust, nrd, fmau_inst->sz);
- if (ust.fpclass != fp_quiet &&
- ust.fpclass != fp_signaling)
- ust.sign ^= 1;
- _fp_sub(pfpsd, &ust, &us3, &ud);
- /* ensure QSNaN1 has precedence over QNaN3 */
- if ((us3.fpclass == fp_quiet) &&
- ((us1.fpclass == fp_signaling) ||
- (us2.fpclass == fp_signaling)))
- ud = ust;
- _fp_pack(pfpsd, &ud, nrd, fmau_inst->sz);
- }
- FPUINFO_KSTAT_PREC(fmau_inst->sz, fpu_sim_fnumadds,
- fpu_sim_fnumaddd, fpu_sim_invalid);
- break;
- case fnmsub:
- _fp_unpack(pfpsd, &us1, nrs1, fmau_inst->sz);
- _fp_unpack(pfpsd, &us2, nrs2, fmau_inst->sz);
- _fp_mul(pfpsd, &us1, &us2, &ust);
- _fp_pack(pfpsd, &ust, nrd, fmau_inst->sz);
- if ((pfpsd->fp_current_exceptions & fsr.tem) == 0) {
- fmau_mul_exceptions =
- pfpsd->fp_current_exceptions;
- pfpsd->fp_current_exceptions = 0;
- _fp_unpack(pfpsd, &us3, nrs3, fmau_inst->sz);
- _fp_unpack(pfpsd, &ust, nrd, fmau_inst->sz);
- if (ust.fpclass != fp_quiet &&
- ust.fpclass != fp_signaling)
- ust.sign ^= 1;
- _fp_add(pfpsd, &ust, &us3, &ud);
- /* ensure QSNaN1 has precedence over QNaN3 */
- if ((us3.fpclass == fp_quiet) &&
- ((us1.fpclass == fp_signaling) ||
- (us2.fpclass == fp_signaling)))
- ud = ust;
- _fp_pack(pfpsd, &ud, nrd, fmau_inst->sz);
- }
- FPUINFO_KSTAT_PREC(fmau_inst->sz, fpu_sim_fnumsubs,
- fpu_sim_fnumsubd, fpu_sim_invalid);
- }
} else {
nfcc = nrd & 0x3;
if (inst.op3 == 0x35) { /* fpop2 */
@@ -645,7 +520,7 @@ _fp_fpu_simulator(
*pfsr = fsr;
return (ftt_ieee);
} else { /* Just set accrued exception field. */
- fsr.aexc |= pfpsd->fp_current_exceptions | fmau_mul_exceptions;
+ fsr.aexc |= pfpsd->fp_current_exceptions;
}
*pfsr = fsr;
return (ftt_none);
@@ -697,7 +572,7 @@ fpu_vis_sim(
return (ftt);
} else if ((fp.inst.hibits == 2) &&
((fp.inst.op3 == 0x34) || (fp.inst.op3 == 0x35) ||
- (fp.inst.op3 == 0x37) || (fp.inst.op3 == 0x3f))) {
+ (fp.inst.op3 == 0x37))) {
ftt = _fp_fpu_simulator(pfpsd, fp.inst, pfsr, gsr);
if (ftt == ftt_none || ftt == ftt_ieee) {
pregs->r_pc = pregs->r_npc;
@@ -776,7 +651,7 @@ fp_emulator(
if ((fp.inst.hibits == 2) &&
((fp.inst.op3 == 0x34) || (fp.inst.op3 == 0x35) ||
- (fp.inst.op3 == 0x37) || (fp.inst.op3 == 0x3f))) {
+ (fp.inst.op3 == 0x37))) {
ftt = _fp_fpu_simulator(pfpsd, fp.inst, (fsr_type *)&tfsr, gsr);
/* Do not retry emulated instruction. */
pregs->r_pc = pregs->r_npc;
@@ -816,7 +691,7 @@ again:
return (ftt);
if ((fp.inst.hibits == 2) && /* fpops */
((fp.inst.op3 == 0x34) || (fp.inst.op3 == 0x35) ||
- (fp.inst.op3 == 0x37) || (fp.inst.op3 == 0x3f))) {
+ (fp.inst.op3 == 0x37))) {
ftt = _fp_fpu_simulator(pfpsd, fp.inst, (fsr_type *)&tfsr, gsr);
/* Do not retry emulated instruction. */
pfpu->fpu_fsr = tfsr;
diff --git a/usr/src/uts/sparc/sys/fpu/fpu_simulator.h b/usr/src/uts/sparc/sys/fpu/fpu_simulator.h
index 06c1723db5..0a89f34a0b 100644
--- a/usr/src/uts/sparc/sys/fpu/fpu_simulator.h
+++ b/usr/src/uts/sparc/sys/fpu/fpu_simulator.h
@@ -204,7 +204,7 @@ enum fp_opcode { /* FPU op codes, minus precision and leading 0. */
ft_op_38 = 0x38,
fp_op_39 = 0x39, fp_op_3a = 0x3a, fp_op_3b = 0x3b,
fp_op_3c = 0x3c,
- fp_op_3d = 0x3d, fp_op_3e = 0x3e, fmau = 0x3f
+ fp_op_3d = 0x3d, fp_op_3e = 0x3e, fp_op_3f = 0x3f
};
typedef /* FPU instruction. */
@@ -219,14 +219,14 @@ typedef /* FPU instruction. */
uint32_t rs2 : 5; /* Second operand. */
} fp_inst_type;
-enum fp_op_fma_var { /* FMA-fused/unfused instr. variations */
+enum fp_op_fma_var { /* IMPDEP2B FMA-fused instr. variations */
fmadd = 0,
fmsub = 1,
fnmsub = 2,
fnmadd = 3
};
-typedef /* FPU FMA-fused/unfused instructions. */
+typedef /* IMPDEP2B FPU FMA-fused instruction. */
struct {
uint32_t hibits : 2; /* Top two bits. */
uint32_t rd : 5; /* Destination. */
@@ -330,14 +330,6 @@ struct fpuinfo_kstat {
struct kstat_named fpu_sim_fnmaddd;
struct kstat_named fpu_sim_fnmsubs;
struct kstat_named fpu_sim_fnmsubd;
- struct kstat_named fpu_sim_fumadds;
- struct kstat_named fpu_sim_fumaddd;
- struct kstat_named fpu_sim_fumsubs;
- struct kstat_named fpu_sim_fumsubd;
- struct kstat_named fpu_sim_fnumadds;
- struct kstat_named fpu_sim_fnumaddd;
- struct kstat_named fpu_sim_fnumsubs;
- struct kstat_named fpu_sim_fnumsubd;
struct kstat_named fpu_sim_invalid;
};