aboutsummaryrefslogtreecommitdiff
path: root/pk/fp.c
diff options
context:
space:
mode:
authorYunsup Lee <yunsup@cs.berkeley.edu>2011-01-03 19:12:24 -0800
committerYunsup Lee <yunsup@cs.berkeley.edu>2011-01-03 19:13:39 -0800
commitb83d64df0179835678c54401ec88bd37e03e19ba (patch)
tree6b604d5d48df86e6f0d43a92a71d4c0894c1cb56 /pk/fp.c
parent5490b1d62710f5cf485e3ccf711bc462b9a52623 (diff)
downloadpk-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.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/pk/fp.c b/pk/fp.c
index 7e83967..ffe6173 100644
--- a/pk/fp.c
+++ b/pk/fp.c
@@ -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])