diff options
author | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-09-11 17:07:37 -0700 |
---|---|---|
committer | Andrew Waterman <waterman@cs.berkeley.edu> | 2015-09-11 17:07:37 -0700 |
commit | e81b125dc425f9f19e25140ea4f29783705fe52e (patch) | |
tree | 6c2315e1feb830c88f203d86609eff3a48f9bb46 | |
parent | d2d16a63e273de44889cfa94106ab9bf2b64e604 (diff) | |
download | pk-e81b125dc425f9f19e25140ea4f29783705fe52e.zip pk-e81b125dc425f9f19e25140ea4f29783705fe52e.tar.gz pk-e81b125dc425f9f19e25140ea4f29783705fe52e.tar.bz2 |
Fix single-precision FP emulation
-rw-r--r-- | pk/mtrap.h | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -135,7 +135,7 @@ typedef uintptr_t (*emulation_func)(uintptr_t, uintptr_t*, insn_t, uintptr_t, ui #else # define GET_F64_REG(insn, pos, regs) (((int64_t*)(&(regs)[32]))[((insn) >> (pos)) & 0x1f]) # define SET_F64_REG(insn, pos, regs, val) (GET_F64_REG(insn, pos, regs) = (val)) -# define GET_F32_REG(insn, pos, regs) (*(int32_t*)GET_F64_REG(insn, pos, regs)) +# define GET_F32_REG(insn, pos, regs) (*(int32_t*)&GET_F64_REG(insn, pos, regs)) # define SET_F32_REG(insn, pos, regs, val) (GET_F32_REG(insn, pos, regs) = (val)) # define GET_FCSR() ({ register int tp asm("tp"); tp & 0xFF; }) # define SET_FCSR(value) ({ asm volatile("add tp, x0, %0" :: "rI"((value) & 0xFF)); }) |