diff mbox series

[v1,05/12] target/arm: Decode aa64 armv8.1 scalar/vector x indexed element

Message ID 20171004184325.24157-6-richard.henderson@linaro.org
State Superseded
Headers show
Series ARM v8.1 simd + v8.3 complex insns | expand

Commit Message

Richard Henderson Oct. 4, 2017, 6:43 p.m. UTC
Signed-off-by: Richard Henderson <richard.henderson@linaro.org>

---
 target/arm/translate-a64.c | 46 ++++++++++++++++++++++++++++++++++++++++------
 1 file changed, 40 insertions(+), 6 deletions(-)

-- 
2.13.6

Comments

Alex Bennée Nov. 13, 2017, 4:44 p.m. UTC | #1
Richard Henderson <richard.henderson@linaro.org> writes:

> Signed-off-by: Richard Henderson <richard.henderson@linaro.org>


Reviewed-by: Alex Bennée <alex.bennee@linaro.org>


> ---

>  target/arm/translate-a64.c | 46 ++++++++++++++++++++++++++++++++++++++++------

>  1 file changed, 40 insertions(+), 6 deletions(-)

>

> diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c

> index 0ea47a9dff..b02aad8cd7 100644

> --- a/target/arm/translate-a64.c

> +++ b/target/arm/translate-a64.c

> @@ -10749,12 +10749,23 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)

>          is_long = true;

>          /* fall through */

>      case 0xc: /* SQDMULH */

> -    case 0xd: /* SQRDMULH */

>          if (u) {

>              unallocated_encoding(s);

>              return;

>          }

>          break;

> +    case 0xd: /* SQRDMULH / SQRDMLAH */

> +        if (u && !arm_dc_feature(s, ARM_FEATURE_V8_1_SIMD)) {

> +            unallocated_encoding(s);

> +            return;

> +        }

> +        break;

> +    case 0xf: /* SQRDMLSH */

> +        if (!u || !arm_dc_feature(s, ARM_FEATURE_V8_1_SIMD)) {

> +            unallocated_encoding(s);

> +            return;

> +        }

> +        break;

>      case 0x8: /* MUL */

>          if (u || is_scalar) {

>              unallocated_encoding(s);

> @@ -10941,13 +10952,36 @@ static void disas_simd_indexed(DisasContext *s, uint32_t insn)

>                                                 tcg_op, tcg_idx);

>                  }

>                  break;

> -            case 0xd: /* SQRDMULH */

> +            case 0xd: /* SQRDMULH / SQRDMLAH */

> +                if (u) { /* SQRDMLAH */

> +                    read_vec_element_i32(s, tcg_res, rd, pass,

> +                                         is_scalar ? size : MO_32);

> +                    if (size == 1) {

> +                        gen_helper_neon_qrdmlah_s16(tcg_res, cpu_env,

> +                                                    tcg_op, tcg_idx, tcg_res);

> +                    } else {

> +                        gen_helper_neon_qrdmlah_s32(tcg_res, cpu_env,

> +                                                    tcg_op, tcg_idx, tcg_res);

> +                    }

> +                } else { /* SQRDMULH */

> +                    if (size == 1) {

> +                        gen_helper_neon_qrdmulh_s16(tcg_res, cpu_env,

> +                                                    tcg_op, tcg_idx);

> +                    } else {

> +                        gen_helper_neon_qrdmulh_s32(tcg_res, cpu_env,

> +                                                    tcg_op, tcg_idx);

> +                    }

> +                }

> +                break;

> +            case 0xf: /* SQRDMLSH */

> +                read_vec_element_i32(s, tcg_res, rd, pass,

> +                                     is_scalar ? size : MO_32);

>                  if (size == 1) {

> -                    gen_helper_neon_qrdmulh_s16(tcg_res, cpu_env,

> -                                                tcg_op, tcg_idx);

> +                    gen_helper_neon_qrdmlsh_s16(tcg_res, cpu_env,

> +                                                tcg_op, tcg_idx, tcg_res);

>                  } else {

> -                    gen_helper_neon_qrdmulh_s32(tcg_res, cpu_env,

> -                                                tcg_op, tcg_idx);

> +                    gen_helper_neon_qrdmlsh_s32(tcg_res, cpu_env,

> +                                                tcg_op, tcg_idx, tcg_res);

>                  }

>                  break;

>              default:



--
Alex Bennée
diff mbox series

Patch

diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c
index 0ea47a9dff..b02aad8cd7 100644
--- a/target/arm/translate-a64.c
+++ b/target/arm/translate-a64.c
@@ -10749,12 +10749,23 @@  static void disas_simd_indexed(DisasContext *s, uint32_t insn)
         is_long = true;
         /* fall through */
     case 0xc: /* SQDMULH */
-    case 0xd: /* SQRDMULH */
         if (u) {
             unallocated_encoding(s);
             return;
         }
         break;
+    case 0xd: /* SQRDMULH / SQRDMLAH */
+        if (u && !arm_dc_feature(s, ARM_FEATURE_V8_1_SIMD)) {
+            unallocated_encoding(s);
+            return;
+        }
+        break;
+    case 0xf: /* SQRDMLSH */
+        if (!u || !arm_dc_feature(s, ARM_FEATURE_V8_1_SIMD)) {
+            unallocated_encoding(s);
+            return;
+        }
+        break;
     case 0x8: /* MUL */
         if (u || is_scalar) {
             unallocated_encoding(s);
@@ -10941,13 +10952,36 @@  static void disas_simd_indexed(DisasContext *s, uint32_t insn)
                                                tcg_op, tcg_idx);
                 }
                 break;
-            case 0xd: /* SQRDMULH */
+            case 0xd: /* SQRDMULH / SQRDMLAH */
+                if (u) { /* SQRDMLAH */
+                    read_vec_element_i32(s, tcg_res, rd, pass,
+                                         is_scalar ? size : MO_32);
+                    if (size == 1) {
+                        gen_helper_neon_qrdmlah_s16(tcg_res, cpu_env,
+                                                    tcg_op, tcg_idx, tcg_res);
+                    } else {
+                        gen_helper_neon_qrdmlah_s32(tcg_res, cpu_env,
+                                                    tcg_op, tcg_idx, tcg_res);
+                    }
+                } else { /* SQRDMULH */
+                    if (size == 1) {
+                        gen_helper_neon_qrdmulh_s16(tcg_res, cpu_env,
+                                                    tcg_op, tcg_idx);
+                    } else {
+                        gen_helper_neon_qrdmulh_s32(tcg_res, cpu_env,
+                                                    tcg_op, tcg_idx);
+                    }
+                }
+                break;
+            case 0xf: /* SQRDMLSH */
+                read_vec_element_i32(s, tcg_res, rd, pass,
+                                     is_scalar ? size : MO_32);
                 if (size == 1) {
-                    gen_helper_neon_qrdmulh_s16(tcg_res, cpu_env,
-                                                tcg_op, tcg_idx);
+                    gen_helper_neon_qrdmlsh_s16(tcg_res, cpu_env,
+                                                tcg_op, tcg_idx, tcg_res);
                 } else {
-                    gen_helper_neon_qrdmulh_s32(tcg_res, cpu_env,
-                                                tcg_op, tcg_idx);
+                    gen_helper_neon_qrdmlsh_s32(tcg_res, cpu_env,
+                                                tcg_op, tcg_idx, tcg_res);
                 }
                 break;
             default: