summary refs log tree commit diff stats
path: root/target/mips/cpu.h
diff options
context:
space:
mode:
authorPhilippe Mathieu-Daudé <f4bug@amsat.org>2020-12-16 12:41:25 +0100
committerPhilippe Mathieu-Daudé <f4bug@amsat.org>2021-01-14 17:13:53 +0100
commitb0586b38cb51dccb25a1957796e34ecd99c8fbf7 (patch)
tree1c1ab2380bf5cd79106b5fe89a96246b99af9a32 /target/mips/cpu.h
parent8b0ea9b638adadcf056f4a18fe53a7c6339beba8 (diff)
downloadfocaccia-qemu-b0586b38cb51dccb25a1957796e34ecd99c8fbf7.tar.gz
focaccia-qemu-b0586b38cb51dccb25a1957796e34ecd99c8fbf7.zip
target/mips/mips-defs: Introduce CPU_MIPS64 and cpu_type_is_64bit()
MIPS 64-bit ISA is introduced with MIPS3.

Introduce the CPU_MIPS64 definition aliased to the MIPS3 ISA,
and the cpu_type_is_64bit() method to check if a CPU supports
this ISA (thus is 64-bit).

Suggested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20210104221154.3127610-5-f4bug@amsat.org>
Diffstat (limited to 'target/mips/cpu.h')
-rw-r--r--target/mips/cpu.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/target/mips/cpu.h b/target/mips/cpu.h
index 0c2d397e4a..9c45744c5c 100644
--- a/target/mips/cpu.h
+++ b/target/mips/cpu.h
@@ -1305,6 +1305,11 @@ static inline bool ase_mt_available(CPUMIPSState *env)
     return env->CP0_Config3 & (1 << CP0C3_MT);
 }
 
+static inline bool cpu_type_is_64bit(const char *cpu_type)
+{
+    return cpu_type_supports_isa(cpu_type, CPU_MIPS64);
+}
+
 void cpu_set_exception_base(int vp_index, target_ulong address);
 
 /* addr.c */