[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 1/8] target/ppc: Optimize emulation of lvsl and
From: |
Richard Henderson |
Subject: |
Re: [Qemu-devel] [PATCH 1/8] target/ppc: Optimize emulation of lvsl and lvsr instructions |
Date: |
Wed, 26 Jun 2019 17:28:28 +0200 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.0 |
On 6/19/19 1:03 PM, Stefan Brankovic wrote:
> Adding simple macro that is calling tcg implementation of appropriate
> instruction if altivec support is active.
>
> Optimization of altivec instruction lvsl (Load Vector for Shift Left).
> Place bytes sh:sh+15 of value 0x00 || 0x01 || 0x02 || ... || 0x1E || 0x1F
> in destination register. Sh is calculated by adding 2 source registers and
> getting bits 60-63 of result.
>
> First, the bits [28-31] are placed from EA to variable sh. After that,
> the bytes are created in the following way:
> sh:(sh+7) of X(from description) by multiplying sh with 0x0101010101010101
> followed by addition of the result with 0x0001020304050607. Value obtained
> is placed in higher doubleword element of vD.
> (sh+8):(sh+15) by adding the result of previous multiplication with
> 0x08090a0b0c0d0e0f. Value obtained is placed in lower doubleword element
> of vD.
>
> Optimization of altivec instruction lvsr (Load Vector for Shift Right).
> Place bytes 16-sh:31-sh of value 0x00 || 0x01 || 0x02 || ... || 0x1E ||
> 0x1F in destination register. Sh is calculated by adding 2 source
> registers and getting bits 60-63 of result.
>
> First, the bits [28-31] are placed from EA to variable sh. After that,
> the bytes are created in the following way:
> sh:(sh+7) of X(from description) by multiplying sh with 0x0101010101010101
> followed by substraction of the result from 0x1011121314151617. Value
> obtained is placed in higher doubleword element of vD.
> (sh+8):(sh+15) by substracting the result of previous multiplication from
> 0x18191a1b1c1d1e1f. Value obtained is placed in lower doubleword element
> of vD.
>
> Signed-off-by: Stefan Brankovic <address@hidden>
> ---
> target/ppc/helper.h | 2 -
> target/ppc/int_helper.c | 18 ------
> target/ppc/translate/vmx-impl.inc.c | 120
> ++++++++++++++++++++++++++----------
> 3 files changed, 88 insertions(+), 52 deletions(-)
Reviewed-by: Richard Henderson <address@hidden>
r~
- [Qemu-devel] [PATCH 0/8] target/ppc: Optimize emulation of some Altivec instructions, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 1/8] target/ppc: Optimize emulation of lvsl and lvsr instructions, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 5/8] target/ppc: Optimize emulation of vclzd instruction, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 8/8] target/ppc: Refactor emulation of vmrgew and vmrgow instructions, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 4/8] target/ppc: Optimize emulation of vgbbd instruction, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 2/8] target/ppc: Optimize emulation of vsl and vsr instructions, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 7/8] target/ppc: Optimize emulation of vclzh and vclzb instructions, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 3/8] target/ppc: Optimize emulation of vpkpx instruction, Stefan Brankovic, 2019/06/19
- [Qemu-devel] [PATCH 6/8] target/ppc: Optimize emulation of vclzw instruction, Stefan Brankovic, 2019/06/19