qemu-devel
[Top][All Lists]
Advanced

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

Re: [PATCH 1/9] Hexagon (target/hexagon) Add support for v68/v69/v71/v73


From: Anton Johansson
Subject: Re: [PATCH 1/9] Hexagon (target/hexagon) Add support for v68/v69/v71/v73
Date: Wed, 26 Apr 2023 20:06:15 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.7.0


On 4/26/23 04:30, Taylor Simpson wrote:
Add support for the ELF flags
Move target/hexagon/cpu.[ch] to be v73
Change the compiler flag used by "make check-tcg"

The decbin instruction is removed in Hexagon v73, so check the
version before trying to compile the instruction.

Signed-off-by: Taylor Simpson <tsimpson@quicinc.com>
---
  configure                         |  2 +-
  linux-user/hexagon/target_elf.h   | 13 +++++++++----
  target/hexagon/cpu.h              |  4 ++++
  target/hexagon/cpu.c              | 20 ++++++++++++++++++++
  tests/tcg/hexagon/misc.c          | 12 ++++++++++++
  tests/tcg/hexagon/Makefile.target |  3 +++
  6 files changed, 49 insertions(+), 5 deletions(-)

diff --git a/configure b/configure
index 77c03315f8..01fa77f6c7 100755
--- a/configure
+++ b/configure
@@ -1857,7 +1857,7 @@ fi
  : ${cross_cc_armeb="$cross_cc_arm"}
  : ${cross_cc_cflags_armeb="-mbig-endian"}
  : ${cross_cc_hexagon="hexagon-unknown-linux-musl-clang"}
-: ${cross_cc_cflags_hexagon="-mv67 -O2 -static"}
+: ${cross_cc_cflags_hexagon="-mv73 -O2 -static"}
  : ${cross_cc_cflags_i386="-m32"}
  : ${cross_cc_cflags_ppc="-m32 -mbig-endian"}
  : ${cross_cc_cflags_ppc64="-m64 -mbig-endian"}
diff --git a/linux-user/hexagon/target_elf.h b/linux-user/hexagon/target_elf.h
index b4e9f40527..a0271a0a2a 100644
--- a/linux-user/hexagon/target_elf.h
+++ b/linux-user/hexagon/target_elf.h
@@ -1,5 +1,5 @@
  /*
- *  Copyright(c) 2019-2021 Qualcomm Innovation Center, Inc. All Rights 
Reserved.
+ *  Copyright(c) 2019-2023 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
@@ -20,7 +20,7 @@
static inline const char *cpu_get_model(uint32_t eflags)
  {
-    /* For now, treat anything newer than v5 as a v67 */
+    /* For now, treat anything newer than v5 as a v73 */
      /* FIXME - Disable instructions that are newer than the specified arch */
      if (eflags == 0x04 ||    /* v5  */
          eflags == 0x05 ||    /* v55 */
@@ -30,9 +30,14 @@ static inline const char *cpu_get_model(uint32_t eflags)
          eflags == 0x65 ||    /* v65 */
          eflags == 0x66 ||    /* v66 */
          eflags == 0x67 ||    /* v67 */
-        eflags == 0x8067     /* v67t */
+        eflags == 0x8067 ||  /* v67t */
+        eflags == 0x68 ||    /* v68 */
+        eflags == 0x69 ||    /* v69 */
+        eflags == 0x71 ||    /* v71 */
+        eflags == 0x8071 ||  /* v71t */
+        eflags == 0x73       /* v73 */
         ) {
-        return "v67";
+        return "v73";
      }
      return "unknown";
  }
diff --git a/target/hexagon/cpu.h b/target/hexagon/cpu.h
index 81b663ecfb..4d8981d862 100644
--- a/target/hexagon/cpu.h
+++ b/target/hexagon/cpu.h
@@ -43,6 +43,10 @@
  #define CPU_RESOLVING_TYPE TYPE_HEXAGON_CPU
#define TYPE_HEXAGON_CPU_V67 HEXAGON_CPU_TYPE_NAME("v67")
+#define TYPE_HEXAGON_CPU_V68 HEXAGON_CPU_TYPE_NAME("v68")
+#define TYPE_HEXAGON_CPU_V69 HEXAGON_CPU_TYPE_NAME("v69")
+#define TYPE_HEXAGON_CPU_V71 HEXAGON_CPU_TYPE_NAME("v71")
+#define TYPE_HEXAGON_CPU_V73 HEXAGON_CPU_TYPE_NAME("v73")
#define MMU_USER_IDX 0 diff --git a/target/hexagon/cpu.c b/target/hexagon/cpu.c
index ab40cfc283..8699db8c24 100644
--- a/target/hexagon/cpu.c
+++ b/target/hexagon/cpu.c
@@ -29,6 +29,22 @@ static void hexagon_v67_cpu_init(Object *obj)
  {
  }
+static void hexagon_v68_cpu_init(Object *obj)
+{
+}
+
+static void hexagon_v69_cpu_init(Object *obj)
+{
+}
+
+static void hexagon_v71_cpu_init(Object *obj)
+{
+}
+
+static void hexagon_v73_cpu_init(Object *obj)
+{
+}
+
  static ObjectClass *hexagon_cpu_class_by_name(const char *cpu_model)
  {
      ObjectClass *oc;
@@ -382,6 +398,10 @@ static const TypeInfo hexagon_cpu_type_infos[] = {
          .class_init = hexagon_cpu_class_init,
      },
      DEFINE_CPU(TYPE_HEXAGON_CPU_V67,              hexagon_v67_cpu_init),
+    DEFINE_CPU(TYPE_HEXAGON_CPU_V68,              hexagon_v68_cpu_init),
+    DEFINE_CPU(TYPE_HEXAGON_CPU_V69,              hexagon_v69_cpu_init),
+    DEFINE_CPU(TYPE_HEXAGON_CPU_V71,              hexagon_v71_cpu_init),
+    DEFINE_CPU(TYPE_HEXAGON_CPU_V73,              hexagon_v73_cpu_init),

The large spacing to hexagon_v*_cpu_init looks a bit odd.

Also, do we need to provide a *_cpu_init() stub for each version? Seems from qom/object.c like we should be able to
just default initialize it

Otherwise,

Reviewed-by: Anton Johansson <anjo@rev.ng>




reply via email to

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