Skip to content

Commit

Permalink
MIPS: Make definitions of MIPSInst_FMA_{FUNC,FMTM} consistent with MI…
Browse files Browse the repository at this point in the history
…PS64 manual

The kernel definitions of MIPSInst_FMA_FUNC and MIPSInst_FMA_FFMT are not
consistent with MADD.fmt, NMADD.fmt and NMSUB.fmt in the MIPS64 manual [1],
the field func is bit 5..3 and fmt is bit 2..0, fix them. Otherwise there
exists error when add new instruction simulation.

[1] https://www.mips.com/?do-download=the-mips64-instruction-set-v6-06

Reported-by: Ming Wang <wangming01@loongson.cn>
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Signed-off-by: Thomas Bogendoerfer <tsbogend@alpha.franken.de>
  • Loading branch information
Tiezhu Yang authored and Thomas Bogendoerfer committed Jan 22, 2021
1 parent baec970 commit 919af8b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions arch/mips/include/asm/inst.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,11 +65,11 @@
#define I_FR_SFT 21
#define MIPSInst_FR(x) ((MIPSInst(x) & 0x03e00000) >> I_FR_SFT)

#define I_FMA_FUNC_SFT 2
#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x0000003c) >> I_FMA_FUNC_SFT)
#define I_FMA_FUNC_SFT 3
#define MIPSInst_FMA_FUNC(x) ((MIPSInst(x) & 0x00000038) >> I_FMA_FUNC_SFT)

#define I_FMA_FFMT_SFT 0
#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000003)
#define MIPSInst_FMA_FFMT(x) (MIPSInst(x) & 0x00000007)

typedef unsigned int mips_instruction;

Expand Down

0 comments on commit 919af8b

Please sign in to comment.