You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Since PDP-11 only has signed multiplication instruction, replacing mach/pdp/libem/mlu4.s with something equivalent to the code below will work correctly, but it is large and slow.
uint32_tmlu4(uint32_tx, uint32_ty) {
int16_ta0=x, a1=x >> 16, b0=y, b1=y >> 16;
int16_ta0l=a0&0x7fff, a0m=a0<0;
int16_ta1l=a1&0x7fff, a1m=a1<0;
int16_tb0l=b0&0x7fff, b0m=b0<0;
int16_tb1l=b1&0x7fff, b1m=b1<0;
uint32_tr= (int32_t)a0l*b0l;
if (a0m) r+= (int32_t)b0l << 15;
if (b0m) r+= (int32_t)a0l << 15;
if (a0m&&b0m) r+=0x40000000U;
r+= (int32_t)a1l*b0l << 16;
if (a1m&&b0l&1) r+=0x80000000U;
if (b0m&&a1l&1) r+=0x80000000U;
r+= (int32_t)a0l*b1l << 16;
if (a0m&&b1l&1) r+=0x80000000U;
if (b1m&&a0l&1) r+=0x80000000U;
returnr;
}
Is there a better way?
The text was updated successfully, but these errors were encountered:
When you compile and run the source below, 0xc0000000 is displayed, but the correct value is 0x40000000.
Since PDP-11 only has signed multiplication instruction, replacing mach/pdp/libem/mlu4.s with something equivalent to the code below will work correctly, but it is large and slow.
Is there a better way?
The text was updated successfully, but these errors were encountered: