diff options
author | Yunsup Lee <yunsup@cs.berkeley.edu> | 2011-01-03 19:12:24 -0800 |
---|---|---|
committer | Yunsup Lee <yunsup@cs.berkeley.edu> | 2011-01-03 19:13:39 -0800 |
commit | b83d64df0179835678c54401ec88bd37e03e19ba (patch) | |
tree | 6b604d5d48df86e6f0d43a92a71d4c0894c1cb56 /pk/fp.c | |
parent | 5490b1d62710f5cf485e3ccf711bc462b9a52623 (diff) | |
download | pk-b83d64df0179835678c54401ec88bd37e03e19ba.zip pk-b83d64df0179835678c54401ec88bd37e03e19ba.tar.gz pk-b83d64df0179835678c54401ec88bd37e03e19ba.tar.bz2 |
[opcodes,pk,sim,xcc] flip fields to favor little endian
Diffstat (limited to 'pk/fp.c')
-rw-r--r-- | pk/fp.c | 12 |
1 files changed, 6 insertions, 6 deletions
@@ -29,14 +29,14 @@ int emulate_fp(trapframe_t* tf) if(noisy) printk("FPU emulation at pc %lx, insn %x\n",tf->epc,(uint32_t)tf->insn); - #define RRS1 ((tf->insn >> 5) & 0x1F) - #define RRS2 ((tf->insn >> 10) & 0x1F) - #define RRS3 ((tf->insn >> 15) & 0x1F) - #define RRD ( tf->insn & 0x1F) - #define RM ((tf->insn >> 20) & 0x3) + #define RRS1 ((tf->insn >> 22) & 0x1F) + #define RRS2 ((tf->insn >> 17) & 0x1F) + #define RRS3 ((tf->insn >> 12) & 0x1F) + #define RRD ((tf->insn >> 27) & 0x1F) + #define RM ((tf->insn >> 9) & 0x3) int32_t imm = ((int32_t)tf->insn << 10) >> 20; - int32_t bimm = (tf->insn & 0x1f) | (((tf->insn >> 15) & 0x7f) << 5); + int32_t bimm = (((tf->insn >> 27) & 0x1f) << 7) | ((tf->insn >> 10) & 0x7f); bimm = (bimm << 20) >> 20; #define XRS1 (tf->gpr[RRS1]) |