mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-09 10:34:58 -06:00
tcg/mips: Fold the ext{8,16,32}[us] cases into {s}extract
Accept AND, ext32u, ext32s extensions with the extract opcodes. This is preparatory to removing the specialized extracts. Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>
This commit is contained in:
parent
0c44a4d3b6
commit
791d03047b
2 changed files with 52 additions and 7 deletions
|
@ -80,8 +80,8 @@ extern bool use_mips32r2_instructions;
|
|||
|
||||
/* optional instructions detected at runtime */
|
||||
#define TCG_TARGET_HAS_deposit_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_extract_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_sextract_i32 0
|
||||
#define TCG_TARGET_HAS_extract_i32 1
|
||||
#define TCG_TARGET_HAS_sextract_i32 1
|
||||
#define TCG_TARGET_HAS_extract2_i32 0
|
||||
#define TCG_TARGET_HAS_ext8s_i32 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ext16s_i32 use_mips32r2_instructions
|
||||
|
@ -96,8 +96,8 @@ extern bool use_mips32r2_instructions;
|
|||
#define TCG_TARGET_HAS_bswap32_i64 1
|
||||
#define TCG_TARGET_HAS_bswap64_i64 1
|
||||
#define TCG_TARGET_HAS_deposit_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_extract_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_sextract_i64 0
|
||||
#define TCG_TARGET_HAS_extract_i64 1
|
||||
#define TCG_TARGET_HAS_sextract_i64 1
|
||||
#define TCG_TARGET_HAS_extract2_i64 0
|
||||
#define TCG_TARGET_HAS_ext8s_i64 use_mips32r2_instructions
|
||||
#define TCG_TARGET_HAS_ext16s_i64 use_mips32r2_instructions
|
||||
|
@ -119,4 +119,22 @@ extern bool use_mips32r2_instructions;
|
|||
#define TCG_TARGET_HAS_qemu_ldst_i128 0
|
||||
#define TCG_TARGET_HAS_tst 0
|
||||
|
||||
#define TCG_TARGET_extract_valid(type, ofs, len) use_mips32r2_instructions
|
||||
|
||||
static inline bool
|
||||
tcg_target_sextract_valid(TCGType type, unsigned ofs, unsigned len)
|
||||
{
|
||||
if (ofs == 0) {
|
||||
switch (len) {
|
||||
case 8:
|
||||
case 16:
|
||||
return use_mips32r2_instructions;
|
||||
case 32:
|
||||
return type == TCG_TYPE_I64;
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
#define TCG_TARGET_sextract_valid tcg_target_sextract_valid
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue