mirror of
https://github.com/izzy2lost/xemu.git
synced 2026-07-06 00:20:22 -07:00
Merge remote-tracking branch 'remotes/pmaydell/tags/pull-target-arm-20180515' into staging
target-arm queue: * Fix coverity nit in int_to_float code * Don't set Invalid for float-to-int(MAXINT) * Fix fp_status_f16 tininess before rounding * Add various missing insns from the v8.2-FP16 extension * Fix sqrt_f16 exception raising * sdcard: Correct CRC16 offset in sd_function_switch() * tcg: Optionally log FPU state in TCG -d cpu logging # gpg: Signature made Tue 15 May 2018 15:06:09 BST # gpg: using RSA key 3C2525ED14360CDE # gpg: Good signature from "Peter Maydell <peter.maydell@linaro.org>" # gpg: aka "Peter Maydell <pmaydell@gmail.com>" # gpg: aka "Peter Maydell <pmaydell@chiark.greenend.org.uk>" # Primary key fingerprint: E1A5 C593 CD41 9DE2 8E83 15CF 3C25 25ED 1436 0CDE * remotes/pmaydell/tags/pull-target-arm-20180515: tcg: Optionally log FPU state in TCG -d cpu logging sdcard: Correct CRC16 offset in sd_function_switch() target/arm: Fix sqrt_f16 exception raising target/arm: Implement FMOV (immediate) for fp16 target/arm: Implement FCSEL for fp16 target/arm: Implement FCMP for fp16 target/arm: Implement FP data-processing (3 source) for fp16 target/arm: Implement FP data-processing (2 source) for fp16 target/arm: Introduce and use read_fp_hreg target/arm: Implement FCVT (scalar, fixed-point) for fp16 target/arm: Implement FCVT (scalar, integer) for fp16 target/arm: Early exit after unallocated_encoding in disas_fp_int_conv target/arm: Implement FMOV (general) for fp16 target/arm: Fix fp_status_f16 tininess before rounding fpu/softfloat: Don't set Invalid for float-to-int(MAXINT) fpu/softfloat: int_to_float ensure r fully initialised Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
This commit is contained in:
@@ -156,11 +156,14 @@ static inline tcg_target_ulong cpu_tb_exec(CPUState *cpu, TranslationBlock *itb)
|
||||
if (qemu_loglevel_mask(CPU_LOG_TB_CPU)
|
||||
&& qemu_log_in_addr_range(itb->pc)) {
|
||||
qemu_log_lock();
|
||||
int flags = 0;
|
||||
if (qemu_loglevel_mask(CPU_LOG_TB_FPU)) {
|
||||
flags |= CPU_DUMP_FPU;
|
||||
}
|
||||
#if defined(TARGET_I386)
|
||||
log_cpu_state(cpu, CPU_DUMP_CCOP);
|
||||
#else
|
||||
log_cpu_state(cpu, 0);
|
||||
flags |= CPU_DUMP_CCOP;
|
||||
#endif
|
||||
log_cpu_state(cpu, flags);
|
||||
qemu_log_unlock();
|
||||
}
|
||||
#endif /* DEBUG_DISAS */
|
||||
|
||||
+3
-3
@@ -1368,14 +1368,14 @@ static int64_t round_to_int_and_pack(FloatParts in, int rmode,
|
||||
r = UINT64_MAX;
|
||||
}
|
||||
if (p.sign) {
|
||||
if (r < -(uint64_t) min) {
|
||||
if (r <= -(uint64_t) min) {
|
||||
return -r;
|
||||
} else {
|
||||
s->float_exception_flags = orig_flags | float_flag_invalid;
|
||||
return min;
|
||||
}
|
||||
} else {
|
||||
if (r < max) {
|
||||
if (r <= max) {
|
||||
return r;
|
||||
} else {
|
||||
s->float_exception_flags = orig_flags | float_flag_invalid;
|
||||
@@ -1525,7 +1525,7 @@ FLOAT_TO_UINT(64, 64)
|
||||
|
||||
static FloatParts int_to_float(int64_t a, float_status *status)
|
||||
{
|
||||
FloatParts r;
|
||||
FloatParts r = {};
|
||||
if (a == 0) {
|
||||
r.cls = float_class_zero;
|
||||
r.sign = false;
|
||||
|
||||
+1
-1
@@ -787,7 +787,7 @@ static void sd_function_switch(SDState *sd, uint32_t arg)
|
||||
sd->data[14 + (i >> 1)] = new_func << ((i * 4) & 4);
|
||||
}
|
||||
memset(&sd->data[17], 0, 47);
|
||||
stw_be_p(sd->data + 65, sd_crc16(sd->data, 64));
|
||||
stw_be_p(sd->data + 64, sd_crc16(sd->data, 64));
|
||||
}
|
||||
|
||||
static inline bool sd_wp_addr(SDState *sd, uint64_t addr)
|
||||
|
||||
@@ -44,6 +44,7 @@ static inline bool qemu_log_separate(void)
|
||||
#define CPU_LOG_PAGE (1 << 14)
|
||||
/* LOG_TRACE (1 << 15) is defined in log-for-trace.h */
|
||||
#define CPU_LOG_TB_OP_IND (1 << 16)
|
||||
#define CPU_LOG_TB_FPU (1 << 17)
|
||||
|
||||
/* Lock output for a series of related logs. Since this is not needed
|
||||
* for a single qemu_log / qemu_log_mask / qemu_log_mask_and_addr, we
|
||||
|
||||
@@ -324,6 +324,8 @@ static void arm_cpu_reset(CPUState *s)
|
||||
&env->vfp.fp_status);
|
||||
set_float_detect_tininess(float_tininess_before_rounding,
|
||||
&env->vfp.standard_fp_status);
|
||||
set_float_detect_tininess(float_tininess_before_rounding,
|
||||
&env->vfp.fp_status_f16);
|
||||
#ifndef CONFIG_USER_ONLY
|
||||
if (kvm_enabled()) {
|
||||
kvm_arm_reset_vcpu(cpu);
|
||||
|
||||
@@ -85,6 +85,16 @@ static inline uint32_t float_rel_to_flags(int res)
|
||||
return flags;
|
||||
}
|
||||
|
||||
uint64_t HELPER(vfp_cmph_a64)(float16 x, float16 y, void *fp_status)
|
||||
{
|
||||
return float_rel_to_flags(float16_compare_quiet(x, y, fp_status));
|
||||
}
|
||||
|
||||
uint64_t HELPER(vfp_cmpeh_a64)(float16 x, float16 y, void *fp_status)
|
||||
{
|
||||
return float_rel_to_flags(float16_compare(x, y, fp_status));
|
||||
}
|
||||
|
||||
uint64_t HELPER(vfp_cmps_a64)(float32 x, float32 y, void *fp_status)
|
||||
{
|
||||
return float_rel_to_flags(float32_compare_quiet(x, y, fp_status));
|
||||
|
||||
@@ -19,6 +19,8 @@
|
||||
DEF_HELPER_FLAGS_2(udiv64, TCG_CALL_NO_RWG_SE, i64, i64, i64)
|
||||
DEF_HELPER_FLAGS_2(sdiv64, TCG_CALL_NO_RWG_SE, s64, s64, s64)
|
||||
DEF_HELPER_FLAGS_1(rbit64, TCG_CALL_NO_RWG_SE, i64, i64)
|
||||
DEF_HELPER_3(vfp_cmph_a64, i64, f16, f16, ptr)
|
||||
DEF_HELPER_3(vfp_cmpeh_a64, i64, f16, f16, ptr)
|
||||
DEF_HELPER_3(vfp_cmps_a64, i64, f32, f32, ptr)
|
||||
DEF_HELPER_3(vfp_cmpes_a64, i64, f32, f32, ptr)
|
||||
DEF_HELPER_3(vfp_cmpd_a64, i64, f64, f64, ptr)
|
||||
|
||||
+36
-2
@@ -11427,8 +11427,12 @@ VFP_CONV_FIX_A64(uq, s, 32, 64, uint64)
|
||||
#undef VFP_CONV_FIX_A64
|
||||
|
||||
/* Conversion to/from f16 can overflow to infinity before/after scaling.
|
||||
* Therefore we convert to f64 (which does not round), scale,
|
||||
* and then convert f64 to f16 (which may round).
|
||||
* Therefore we convert to f64, scale, and then convert f64 to f16; or
|
||||
* vice versa for conversion to integer.
|
||||
*
|
||||
* For 16- and 32-bit integers, the conversion to f64 never rounds.
|
||||
* For 64-bit integers, any integer that would cause rounding will also
|
||||
* overflow to f16 infinity, so there is no double rounding problem.
|
||||
*/
|
||||
|
||||
static float16 do_postscale_fp16(float64 f, int shift, float_status *fpst)
|
||||
@@ -11446,6 +11450,16 @@ float16 HELPER(vfp_ultoh)(uint32_t x, uint32_t shift, void *fpst)
|
||||
return do_postscale_fp16(uint32_to_float64(x, fpst), shift, fpst);
|
||||
}
|
||||
|
||||
float16 HELPER(vfp_sqtoh)(uint64_t x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return do_postscale_fp16(int64_to_float64(x, fpst), shift, fpst);
|
||||
}
|
||||
|
||||
float16 HELPER(vfp_uqtoh)(uint64_t x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return do_postscale_fp16(uint64_to_float64(x, fpst), shift, fpst);
|
||||
}
|
||||
|
||||
static float64 do_prescale_fp16(float16 f, int shift, float_status *fpst)
|
||||
{
|
||||
if (unlikely(float16_is_any_nan(f))) {
|
||||
@@ -11475,6 +11489,26 @@ uint32_t HELPER(vfp_touhh)(float16 x, uint32_t shift, void *fpst)
|
||||
return float64_to_uint16(do_prescale_fp16(x, shift, fpst), fpst);
|
||||
}
|
||||
|
||||
uint32_t HELPER(vfp_toslh)(float16 x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return float64_to_int32(do_prescale_fp16(x, shift, fpst), fpst);
|
||||
}
|
||||
|
||||
uint32_t HELPER(vfp_toulh)(float16 x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return float64_to_uint32(do_prescale_fp16(x, shift, fpst), fpst);
|
||||
}
|
||||
|
||||
uint64_t HELPER(vfp_tosqh)(float16 x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return float64_to_int64(do_prescale_fp16(x, shift, fpst), fpst);
|
||||
}
|
||||
|
||||
uint64_t HELPER(vfp_touqh)(float16 x, uint32_t shift, void *fpst)
|
||||
{
|
||||
return float64_to_uint64(do_prescale_fp16(x, shift, fpst), fpst);
|
||||
}
|
||||
|
||||
/* Set the current fp rounding mode and return the old one.
|
||||
* The argument is a softfloat float_round_ value.
|
||||
*/
|
||||
|
||||
@@ -151,6 +151,10 @@ DEF_HELPER_3(vfp_touhd_round_to_zero, i64, f64, i32, ptr)
|
||||
DEF_HELPER_3(vfp_tould_round_to_zero, i64, f64, i32, ptr)
|
||||
DEF_HELPER_3(vfp_touhh, i32, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_toshh, i32, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_toulh, i32, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_toslh, i32, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_touqh, i64, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_tosqh, i64, f16, i32, ptr)
|
||||
DEF_HELPER_3(vfp_toshs, i32, f32, i32, ptr)
|
||||
DEF_HELPER_3(vfp_tosls, i32, f32, i32, ptr)
|
||||
DEF_HELPER_3(vfp_tosqs, i64, f32, i32, ptr)
|
||||
@@ -177,6 +181,8 @@ DEF_HELPER_3(vfp_ultod, f64, i64, i32, ptr)
|
||||
DEF_HELPER_3(vfp_uqtod, f64, i64, i32, ptr)
|
||||
DEF_HELPER_3(vfp_sltoh, f16, i32, i32, ptr)
|
||||
DEF_HELPER_3(vfp_ultoh, f16, i32, i32, ptr)
|
||||
DEF_HELPER_3(vfp_sqtoh, f16, i64, i32, ptr)
|
||||
DEF_HELPER_3(vfp_uqtoh, f16, i64, i32, ptr)
|
||||
|
||||
DEF_HELPER_FLAGS_2(set_rmode, TCG_CALL_NO_RWG, i32, i32, ptr)
|
||||
DEF_HELPER_FLAGS_2(set_neon_rmode, TCG_CALL_NO_RWG, i32, i32, env)
|
||||
|
||||
+359
-62
File diff suppressed because it is too large
Load Diff
@@ -256,6 +256,8 @@ const QEMULogItem qemu_log_items[] = {
|
||||
"show trace before each executed TB (lots of logs)" },
|
||||
{ CPU_LOG_TB_CPU, "cpu",
|
||||
"show CPU registers before entering a TB (lots of logs)" },
|
||||
{ CPU_LOG_TB_FPU, "fpu",
|
||||
"include FPU registers in the 'cpu' logging" },
|
||||
{ CPU_LOG_MMU, "mmu",
|
||||
"log MMU-related activities" },
|
||||
{ CPU_LOG_PCALL, "pcall",
|
||||
|
||||
Reference in New Issue
Block a user