1
0
mirror of https://github.com/prirun/p50em.git synced 2026-01-11 23:42:56 +00:00

lrs: don't try to shift 32 bits: works on PPC, fails on Intel

This commit is contained in:
Jim 2011-10-20 09:42:33 -04:00
parent ff791c1b9c
commit 7075729d8c
2 changed files with 3 additions and 3 deletions

4
em.c
View File

@ -4032,7 +4032,7 @@ static inline arfa(int n, int val) {
/* inline function to extract shift count from an instruction */
static inline unsigned short shiftcount (inst) {
static inline unsigned short shiftcount (short inst) {
unsigned short scount;
scount = -inst & 077;
if (scount == 0)
@ -4046,7 +4046,7 @@ static inline unsigned int lrs(unsigned int val, unsigned short inst) {
unsigned short scount;
scount = shiftcount(inst);
if (scount <= 32) {
if (scount < 32) {
EXPCL(val & (((unsigned int)0x80000000) >> (32-scount)));
return (*(int *)&val) >> scount;
} else if (val & 0x80000000) {

View File

@ -67,7 +67,7 @@ Very fast test of HSA (High Speed Arithmetic). Use Ctrl-\ to kill the
emulator and the test. Sense switch 14 (value 4) causes the pass to
be displayed as the test executes.
$ ../src/em -boot tmrun/cput3 4n
$ ../src/em -boot tmrun/cput3 4
[Prime Emulator ver 104 Aug 8 2011]