Patchwork target-arm: Fix Neon VQ(R)DMULH.S16 instructions

login
register
mail settings
Submitter Peter Maydell
Date Jan. 27, 2011, 7:18 p.m.
Message ID <1296155915-15796-1-git-send-email-peter.maydell@linaro.org>
Download mbox | patch
Permalink /patch/80725/
State New
Headers show

Comments

Peter Maydell - Jan. 27, 2011, 7:18 p.m.
From: Juha Riihimäki <juha.riihimaki@nokia.com>

Correct an error in the implementation of the 16 bit
forms of VQ(R)DMULH, bringing them into line with the
32 bit implementation.

Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
---
 target-arm/neon_helper.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
Aurelien Jarno - Jan. 29, 2011, 2:18 p.m.
On Thu, Jan 27, 2011 at 07:18:35PM +0000, Peter Maydell wrote:
> From: Juha Riihimäki <juha.riihimaki@nokia.com>
> 
> Correct an error in the implementation of the 16 bit
> forms of VQ(R)DMULH, bringing them into line with the
> 32 bit implementation.
> 
> Signed-off-by: Juha Riihimäki <juha.riihimaki@nokia.com>
> Reviewed-by: Peter Maydell <peter.maydell@linaro.org>
> ---
>  target-arm/neon_helper.c |    3 ++-
>  1 files changed, 2 insertions(+), 1 deletions(-)

Thanks, applied.

> diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
> index 20f3c16..fead152 100644
> --- a/target-arm/neon_helper.c
> +++ b/target-arm/neon_helper.c
> @@ -880,8 +880,9 @@ uint32_t HELPER(neon_cnt_u8)(uint32_t x)
>      if ((tmp ^ (tmp << 1)) & SIGNBIT) { \
>          SET_QC(); \
>          tmp = (tmp >> 31) ^ ~SIGNBIT; \
> +    } else { \
> +        tmp <<= 1; \
>      } \
> -    tmp <<= 1; \
>      if (round) { \
>          int32_t old = tmp; \
>          tmp += 1 << 15; \
> -- 
> 1.7.1
> 
> 
>

Patch

diff --git a/target-arm/neon_helper.c b/target-arm/neon_helper.c
index 20f3c16..fead152 100644
--- a/target-arm/neon_helper.c
+++ b/target-arm/neon_helper.c
@@ -880,8 +880,9 @@  uint32_t HELPER(neon_cnt_u8)(uint32_t x)
     if ((tmp ^ (tmp << 1)) & SIGNBIT) { \
         SET_QC(); \
         tmp = (tmp >> 31) ^ ~SIGNBIT; \
+    } else { \
+        tmp <<= 1; \
     } \
-    tmp <<= 1; \
     if (round) { \
         int32_t old = tmp; \
         tmp += 1 << 15; \