From 9bd1c58531611e26a446abe31b6cece7e8ed5e16 Mon Sep 17 00:00:00 2001 From: Andrew Waterman Date: Fri, 10 Sep 2010 21:13:55 -0700 Subject: [PATCH] [sim, xcc] Added mffh.d/mtflh.d; fixed FP ABI for 32-bit --- riscv/execute.h | 8 ++++---- riscv/insns/mffh_d.h | 2 ++ riscv/insns/mtf_s.h | 2 +- riscv/insns/mtflh_d.h | 2 ++ 4 files changed, 9 insertions(+), 5 deletions(-) create mode 100644 riscv/insns/mtflh_d.h diff --git a/riscv/execute.h b/riscv/execute.h index 554962d..9a50b99 100644 --- a/riscv/execute.h +++ b/riscv/execute.h @@ -336,14 +336,14 @@ switch((insn.bits >> 0x19) & 0x7f) #include "insns/mff_d.h" break; } - if((insn.bits & 0xfe0fffe0) == 0xd4006c00) + if((insn.bits & 0xfe0fffe0) == 0xd4006400) { - #include "insns/mtfh_d.h" + #include "insns/mffh_d.h" break; } - if((insn.bits & 0xfe0fffe0) == 0xd4006400) + if((insn.bits & 0xfe007fe0) == 0xd4006c00) { - #include "insns/mffh_d.h" + #include "insns/mtflh_d.h" break; } if((insn.bits & 0xfe0fffe0) == 0xd4006800) diff --git a/riscv/insns/mffh_d.h b/riscv/insns/mffh_d.h index e69de29..b466f60 100644 --- a/riscv/insns/mffh_d.h +++ b/riscv/insns/mffh_d.h @@ -0,0 +1,2 @@ +require_fp; +RC = sext32(FRA >> 32); diff --git a/riscv/insns/mtf_s.h b/riscv/insns/mtf_s.h index 239df16..723a2f7 100644 --- a/riscv/insns/mtf_s.h +++ b/riscv/insns/mtf_s.h @@ -1,2 +1,2 @@ require_fp; -FRC = sext32(RA); +FRC = RA; diff --git a/riscv/insns/mtflh_d.h b/riscv/insns/mtflh_d.h new file mode 100644 index 0000000..4e33f39 --- /dev/null +++ b/riscv/insns/mtflh_d.h @@ -0,0 +1,2 @@ +require_fp; +FRC = (RA & 0x00000000FFFFFFFF) | (RB << 32); -- 2.30.2