Line 482... |
Line 482... |
|
|
lo = cpu_state.sprs[SPR_MACLO];
|
lo = cpu_state.sprs[SPR_MACLO];
|
hi = cpu_state.sprs[SPR_MACHI];
|
hi = cpu_state.sprs[SPR_MACHI];
|
x = PARAM0;
|
x = PARAM0;
|
y = PARAM1;
|
y = PARAM1;
|
PRINTF ("[%"PRIxREG",%"PRIxREG"]\t", x, y);
|
/* PRINTF ("[%"PRIxREG",%"PRIxREG"]\t", x, y); */
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l += (LONGEST) x * (LONGEST) y;
|
l += (LONGEST) x * (LONGEST) y;
|
|
|
/* This implementation is very fast - it needs only one cycle for mac. */
|
/* This implementation is very fast - it needs only one cycle for mac. */
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
hi = ((LONGEST)l) >> 32;
|
hi = ((LONGEST)l) >> 32;
|
cpu_state.sprs[SPR_MACLO] = lo;
|
cpu_state.sprs[SPR_MACLO] = lo;
|
cpu_state.sprs[SPR_MACHI] = hi;
|
cpu_state.sprs[SPR_MACHI] = hi;
|
PRINTF ("(%"PRIxREG",%"PRIxREG"\n", hi, lo);
|
/* PRINTF ("(%"PRIxREG",%"PRIxREG"\n", hi, lo); */
|
}
|
}
|
INSTRUCTION (l_msb) {
|
INSTRUCTION (l_msb) {
|
uorreg_t lo, hi;
|
uorreg_t lo, hi;
|
LONGEST l;
|
LONGEST l;
|
orreg_t x, y;
|
orreg_t x, y;
|
Line 503... |
Line 503... |
lo = cpu_state.sprs[SPR_MACLO];
|
lo = cpu_state.sprs[SPR_MACLO];
|
hi = cpu_state.sprs[SPR_MACHI];
|
hi = cpu_state.sprs[SPR_MACHI];
|
x = PARAM0;
|
x = PARAM0;
|
y = PARAM1;
|
y = PARAM1;
|
|
|
PRINTF ("[%"PRIxREG",%"PRIxREG"]\t", x, y);
|
/* PRINTF ("[%"PRIxREG",%"PRIxREG"]\t", x, y); */
|
|
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l = (ULONGEST)lo | ((LONGEST)hi << 32);
|
l -= x * y;
|
l -= x * y;
|
|
|
/* This implementation is very fast - it needs only one cycle for msb. */
|
/* This implementation is very fast - it needs only one cycle for msb. */
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
lo = ((ULONGEST)l) & 0xFFFFFFFF;
|
hi = ((LONGEST)l) >> 32;
|
hi = ((LONGEST)l) >> 32;
|
cpu_state.sprs[SPR_MACLO] = lo;
|
cpu_state.sprs[SPR_MACLO] = lo;
|
cpu_state.sprs[SPR_MACHI] = hi;
|
cpu_state.sprs[SPR_MACHI] = hi;
|
PRINTF ("(%"PRIxREG",%"PRIxREG")\n", hi, lo);
|
/* PRINTF ("(%"PRIxREG",%"PRIxREG")\n", hi, lo); */
|
}
|
}
|
INSTRUCTION (l_macrc) {
|
INSTRUCTION (l_macrc) {
|
uorreg_t lo, hi;
|
uorreg_t lo, hi;
|
LONGEST l;
|
LONGEST l;
|
/* No need for synchronization here -- all MAC instructions are 1 cycle long. */
|
/* No need for synchronization here -- all MAC instructions are 1 cycle long. */
|