Index: mips.igen =================================================================== RCS file: /cvs/src/src/sim/mips/mips.igen,v retrieving revision 1.55 diff -u -p -r1.55 mips.igen --- mips.igen 20 Jan 2004 07:06:14 -0000 1.55 +++ mips.igen 18 Mar 2004 17:54:49 -0000 @@ -242,10 +242,15 @@ // enforced restrictions (2) and (3) for more ISAs and CPU types than // necessary. Unfortunately, at least some MIPS IV and later parts' // documentation describes them as having these hazards (e.g. vr5000), -// so they can't be removed for at leats MIPS IV. MIPS V hasn't been -// checked (since there are no known hardware implementations). -// +// so they can't be removed for at leats MIPS IV. (As of MIPS32 and MIPS64, +// the hazards are definitely architected to not be required.) +// +// To accomodate implementations of particular ISAs which don't have the +// hazards, for some ISAs we have a version of these helper functions which +// calls a function to determine if the particular architecture has +// a hazard. +// // check_mf_cycles: // // Helper used by check_mt_hilo, check_mult_hilo, and check_div_hilo @@ -274,8 +279,6 @@ *mipsI: *mipsII: *mipsIII: -*mipsIV: -*mipsV: *vr4100: *vr5000: { @@ -287,6 +290,18 @@ } :function:::int:check_mt_hilo:hilo_history *history +*mipsIV: +*mipsV: +{ + signed64 time = sim_events_time (SD); + int ok = (MIPS_ARCH_HAS_MT_HILO_HAZARD (SD_) + || check_mf_cycles (SD_, history, time, "MT")); + history->mt.timestamp = time; + history->mt.cia = CIA; + return ok; +} + +:function:::int:check_mt_hilo:hilo_history *history *mips32: *mips64: *r3900: @@ -350,8 +365,6 @@ *mipsI: *mipsII: *mipsIII: -*mipsIV: -*mipsV: *vr4100: *vr5000: { @@ -366,6 +379,21 @@ } :function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo +*mipsIV: +*mipsV: +{ + signed64 time = sim_events_time (SD); + int ok = (! MIPS_ARCH_HAS_MULT_HILO_HAZARD (SD_) + || (check_mf_cycles (SD_, hi, time, "OP") + && check_mf_cycles (SD_, lo, time, "OP"))); + hi->op.timestamp = time; + lo->op.timestamp = time; + hi->op.cia = CIA; + lo->op.cia = CIA; + return ok; +} + +:function:::int:check_mult_hilo:hilo_history *hi, hilo_history *lo *mips32: *mips64: *r3900: @@ -389,8 +417,6 @@ *mipsI: *mipsII: *mipsIII: -*mipsIV: -*mipsV: *vr4100: *vr5000: *r3900: @@ -398,6 +424,21 @@ signed64 time = sim_events_time (SD); int ok = (check_mf_cycles (SD_, hi, time, "OP") && check_mf_cycles (SD_, lo, time, "OP")); + hi->op.timestamp = time; + lo->op.timestamp = time; + hi->op.cia = CIA; + lo->op.cia = CIA; + return ok; +} + +:function:::int:check_div_hilo:hilo_history *hi, hilo_history *lo +*mipsIV: +*mipsV: +{ + signed64 time = sim_events_time (SD); + int ok = (! MIPS_ARCH_HAS_DIV_HILO_HAZARD (SD_) + || (check_mf_cycles (SD_, hi, time, "OP") + && check_mf_cycles (SD_, lo, time, "OP"))); hi->op.timestamp = time; lo->op.timestamp = time; hi->op.cia = CIA;