qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v7 15/35] Hexagon (target/hexagon/arch.[ch]) utility function


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH v7 15/35] Hexagon (target/hexagon/arch.[ch]) utility functions
Date: Fri, 22 Jan 2021 19:09:10 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0

Hi Taylor,

On 1/20/21 4:28 AM, Taylor Simpson wrote:
> Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
> ---
>  target/hexagon/arch.h |  35 ++++++
>  target/hexagon/arch.c | 294 
> ++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 329 insertions(+)
>  create mode 100644 target/hexagon/arch.h
>  create mode 100644 target/hexagon/arch.c
> 
> diff --git a/target/hexagon/arch.h b/target/hexagon/arch.h
> new file mode 100644
> index 0000000..a8374a3
> --- /dev/null
> +++ b/target/hexagon/arch.h

Maybe rename "arch_utils.[ch]"?

> @@ -0,0 +1,35 @@
> +/*
> + *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights 
> Reserved.
> + *
> + *  This program is free software; you can redistribute it and/or modify
> + *  it under the terms of the GNU General Public License as published by
> + *  the Free Software Foundation; either version 2 of the License, or
> + *  (at your option) any later version.
> + *
> + *  This program is distributed in the hope that it will be useful,
> + *  but WITHOUT ANY WARRANTY; without even the implied warranty of
> + *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
> + *  GNU General Public License for more details.
> + *
> + *  You should have received a copy of the GNU General Public License
> + *  along with this program; if not, see <http://www.gnu.org/licenses/>.
> + */
> +
> +#ifndef HEXAGON_ARCH_H
> +#define HEXAGON_ARCH_H
> +
> +#include "qemu/osdep.h"
> +#include "qemu/int128.h"
> +
> +extern uint64_t interleave(uint32_t odd, uint32_t even);
> +extern uint64_t deinterleave(uint64_t src);
> +extern uint32_t carry_from_add64(uint64_t a, uint64_t b, uint32_t c);
> +extern int32_t conv_round(int32_t a, int n);
> +extern void arch_fpop_start(CPUHexagonState *env);
> +extern void arch_fpop_end(CPUHexagonState *env);
> +extern int arch_sf_recip_common(float32 *Rs, float32 *Rt, float32 *Rd,
> +                                int *adjust, float_status *fp_status);
> +extern int arch_sf_invsqrt_common(float32 *Rs, float32 *Rd, int *adjust,
> +                                  float_status *fp_status);

(Again, no need for 'extern').

> +
> +#endif
> diff --git a/target/hexagon/arch.c b/target/hexagon/arch.c
> new file mode 100644
> index 0000000..c59cad5
> --- /dev/null
> +++ b/target/hexagon/arch.c
...

> +#define RAISE_FP_EXCEPTION \
> +    do {} while (0)            /* Not modelled in qemu user mode */

I don't understand why... Can you explain please?

> +
> +#define SOFTFLOAT_TEST_FLAG(FLAG, MYF, MYE) \
> +    do { \
> +        if (flags & FLAG) { \
> +            if (GET_USR_FIELD(USR_##MYF) == 0) { \
> +                SET_USR_FIELD(USR_##MYF, 1); \
> +                if (GET_USR_FIELD(USR_##MYE)) { \
> +                    RAISE_FP_EXCEPTION; \
> +                } \
> +            } \
> +        } \
> +    } while (0)
...



reply via email to

[Prev in Thread] Current Thread [Next in Thread]