[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH] target-sparc64: implement Short Floating-Point
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH] target-sparc64: implement Short Floating-Point Store Instructions |
Date: |
Tue, 12 Aug 2014 07:40:06 -1000 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.7.0 |
On 08/08/2014 10:48 AM, Artyom Tarasenko wrote:
> Implement Short Floating-Point Store Instructions as described
> in the chapter 13.5.2 of UltraSPARC-IIi User's Manual.
>
> Particularly this instructions are used by NetBSD 4.0.1+ /sparc64
>
> Signed-off-by: Artyom Tarasenko <address@hidden>
> ---
>
> With this patch applied on top of cmd646 patches it's possible to install
> and boot NetBSD 6.1.4 /sparc64.
>
> target-sparc/ldst_helper.c | 15 ++++++++++++++-
> 1 file changed, 14 insertions(+), 1 deletion(-)
>
> diff --git a/target-sparc/ldst_helper.c b/target-sparc/ldst_helper.c
> index 03bd9f9..ca65e8d 100644
> --- a/target-sparc/ldst_helper.c
> +++ b/target-sparc/ldst_helper.c
> @@ -2154,7 +2154,6 @@ void helper_stf_asi(CPUSPARCState *env, target_ulong
> addr, int asi, int size,
> unsigned int i;
> target_ulong val;
>
> - helper_check_align(env, addr, 3);
> addr = asi_address_mask(env, asi, addr);
>
> switch (asi) {
> @@ -2192,7 +2191,21 @@ void helper_stf_asi(CPUSPARCState *env, target_ulong
> addr, int asi, int size,
> }
>
> return;
> + case 0xd2: /* 16-bit floating point load primary */
> + case 0xd3: /* 16-bit floating point load secondary */
> + case 0xda: /* 16-bit floating point load primary, LE */
> + case 0xdb: /* 16-bit floating point load secondary, LE */
> + helper_check_align(env, addr, 1);
> + /* Fall through */
> + case 0xd0: /* 8-bit floating point load primary */
> + case 0xd1: /* 8-bit floating point load secondary */
> + case 0xd8: /* 8-bit floating point load primary, LE */
> + case 0xd9: /* 8-bit floating point load secondary, LE */
> + val = env->fpr[rd/2].l.lower;
> + helper_st_asi(env, addr, val, asi & 0x8d, ((asi & 2) >> 1) + 1);
> + return;
> default:
> + helper_check_align(env, addr, 3);
Good, as far as it goes. The comments should say "store" not "load".
You might as well implement the corresponding load-short-f asis as well.
r~