Skip to contentSkip to conversation

MIPS queue for February 14th, 2019

GIT PULL Applied Aleksandar Markovic 3 participants 18 messages Feb 14, 2019 – Feb 21, 2019

lore
Share & tools
lore
#0 lore raw

From: Aleksandar Markovic <[email protected]>

The following changes since commit 7e407466b1efbd65225cc72fe09c0c5ec79df75b:

Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2019-02-14 15:22:29 +0000)

are available in the git repository at:

https://github.com/AMarkovic/qemu tags/mips-queue-feb-14-2019

for you to fetch changes up to ba632924450faf6741d299f8feed8150a0c6f884:

tests/tcg: target/mips: Add tests for MSA logic instructions (2019-02-14 17:47:37 +0100)

----------------------------------------------------------------
MIPS queue for February 14th, 2019

- MTTCG support for MIPS
- The first part of MSA ASE tests

There are several checkpatch warnings that should be all ignored.

----------------------------------------------------------------

Aleksandar Markovic (11):
hw/mips_int: hold BQL for all interrupt requests target/mips: introduce MTTCG-enabled builds
tests/tcg: target/mips: Remove an unnecessary file tests/tcg: target/mips: Add a header with test inputs tests/tcg: target/mips: Add a header with test utilities tests/tcg: target/mips: Add wrappers for MSA bit counting instructions tests/tcg: target/mips: Add tests for MSA bit counting instructions tests/tcg: target/mips: Add wrappers for MSA interleave instructions tests/tcg: target/mips: Add tests for MSA interleave instructions tests/tcg: target/mips: Add wrappers for MSA logic instructions tests/tcg: target/mips: Add tests for MSA logic instructions

Goran Ferenc (1):
target/mips: hold BQL in mips_vpe_wake()

Leon Alrae (2):
target/mips: compare virtual addresses in LL/SC sequence target/mips: reimplement SC instruction emulation and use cmpxchg

Miodrag Dinic (1):
hw/mips_cpc: kick a VP when putting it into Run statewq

 configure                                          |   3 +
 hw/mips/mips_int.c                                 |  12 ++
 hw/misc/mips_cpc.c                                 |  17 ++-
 linux-user/mips/cpu_loop.c                         |  73 ----------
 target/mips/cpu.h                                  |   9 +-
 target/mips/helper.c                               |   6 +-
 target/mips/helper.h                               |   2 -
 target/mips/machine.c                              |   7 +-
 target/mips/op_helper.c                            |  76 +++-------
 target/mips/translate.c                            | 127 ++++++-----------
 tests/tcg/mips/include/test_inputs.h               | 122 ++++++++++++++++
 tests/tcg/mips/include/test_utils.h                |  78 +++++++++++
 tests/tcg/mips/include/wrappers_msa.h              | 101 ++++++++++++++
 tests/tcg/mips/mips64-dspr2/.directory             |   2 -
 .../user/ase/msa/bit-counting/test_msa_nloc_b.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_d.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_h.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_w.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_b.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_d.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_h.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_w.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_b.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_d.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_h.c    | 144 +++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_w.c    | 144 +++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_b.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_d.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_h.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_w.c     | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_b.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_d.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_h.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_w.c | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_b.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_d.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_h.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_w.c     | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_b.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_d.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_h.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_w.c | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c  | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c | 153 +++++++++++++++++++++
 46 files changed, 5194 insertions(+), 229 deletions(-)
 create mode 100644 tests/tcg/mips/include/test_inputs.h
 create mode 100644 tests/tcg/mips/include/test_utils.h
 create mode 100644 tests/tcg/mips/include/wrappers_msa.h
 delete mode 100644 tests/tcg/mips/mips64-dspr2/.directory
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c
Signature · 1 line
2.7.4
#1 lore raw

[Qemu-devel] [PULL 03/15] hw/mips_int: hold BQL for all interrupt requests

From: Aleksandar Markovic <[email protected]>

Make sure BQL is held for all interrupt requests.

For MTTCG-enabled configurations, handling soft and hard interrupts between vCPUs must be properly locked. By acquiring BQL, make sure all paths triggering an IRQ are synchronized.

---
 hw/mips/mips_int.c      | 12 ++++++++++++
 target/mips/op_helper.c | 21 +++------------------
 2 files changed, 15 insertions(+), 18 deletions(-)
hw/mips/mips_int.c +12 -0
index 48192d2..5ddeb15 100644
@@ -21,6 +21,7 @@
  */
 
 #include "qemu/osdep.h"
+#include "qemu/main-loop.h"
 #include "hw/hw.h"
 #include "hw/mips/cpudevs.h"
 #include "cpu.h"
@@ -32,10 +33,17 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
     MIPSCPU *cpu = opaque;
     CPUMIPSState *env = &cpu->env;
     CPUState *cs = CPU(cpu);
+    bool locked = false;
 
     if (irq < 0 || irq > 7)
         return;
 
+    /* Make sure locking works even if BQL is already held by the caller */
+    if (!qemu_mutex_iothread_locked()) {
+        locked = true;
+        qemu_mutex_lock_iothread();
+    }
+
     if (level) {
         env->CP0_Cause |= 1 << (irq + CP0Ca_IP);
 
@@ -56,6 +64,10 @@ static void cpu_mips_irq_request(void *opaque, int irq, int level)
     } else {
         cpu_reset_interrupt(cs, CPU_INTERRUPT_HARD);
     }
+
+    if (locked) {
+        qemu_mutex_unlock_iothread();
+    }
 }
 
 void cpu_mips_irq_init_cpu(MIPSCPU *cpu)
target/mips/op_helper.c +3 -18
index 943a7ea..8c53b3b 100644
@@ -17,7 +17,6 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
-#include "qemu/main-loop.h"
 #include "cpu.h"
 #include "internal.h"
 #include "qemu/host-utils.h"
@@ -905,11 +904,7 @@ target_ulong helper_mftc0_tcschefback(CPUMIPSState *env)
 
 target_ulong helper_mfc0_count(CPUMIPSState *env)
 {
-    int32_t count;
-    qemu_mutex_lock_iothread();
-    count = (int32_t) cpu_mips_get_count(env);
-    qemu_mutex_unlock_iothread();
-    return count;
+    return (int32_t)cpu_mips_get_count(env);
 }
 
 target_ulong helper_mfc0_saar(CPUMIPSState *env)
@@ -1594,9 +1589,7 @@ void helper_mtc0_hwrena(CPUMIPSState *env, target_ulong arg1)
 
 void helper_mtc0_count(CPUMIPSState *env, target_ulong arg1)
 {
-    qemu_mutex_lock_iothread();
     cpu_mips_store_count(env, arg1);
-    qemu_mutex_unlock_iothread();
 }
 
 void helper_mtc0_saari(CPUMIPSState *env, target_ulong arg1)
@@ -1685,9 +1678,7 @@ void helper_mttc0_entryhi(CPUMIPSState *env, target_ulong arg1)
 
 void helper_mtc0_compare(CPUMIPSState *env, target_ulong arg1)
 {
-    qemu_mutex_lock_iothread();
     cpu_mips_store_compare(env, arg1);
-    qemu_mutex_unlock_iothread();
 }
 
 void helper_mtc0_status(CPUMIPSState *env, target_ulong arg1)
@@ -1741,9 +1732,7 @@ void helper_mtc0_srsctl(CPUMIPSState *env, target_ulong arg1)
 
 void helper_mtc0_cause(CPUMIPSState *env, target_ulong arg1)
 {
-    qemu_mutex_lock_iothread();
     cpu_mips_store_cause(env, arg1);
-    qemu_mutex_unlock_iothread();
 }
 
 void helper_mttc0_cause(CPUMIPSState *env, target_ulong arg1)
@@ -2587,16 +2576,12 @@ target_ulong helper_rdhwr_synci_step(CPUMIPSState *env)
 
 target_ulong helper_rdhwr_cc(CPUMIPSState *env)
 {
-    int32_t count;
     check_hwrena(env, 2, GETPC());
 #ifdef CONFIG_USER_ONLY
-    count = env->CP0_Count;
+    return env->CP0_Count;
 #else
-    qemu_mutex_lock_iothread();
-    count = (int32_t)cpu_mips_get_count(env);
-    qemu_mutex_unlock_iothread();
+    return (int32_t)cpu_mips_get_count(env);
 #endif
-    return count;
 }
 
 target_ulong helper_rdhwr_ccres(CPUMIPSState *env)
Signature · 1 line
2.7.4
#2 lore raw

[Qemu-devel] [PULL 04/15] target/mips: hold BQL in mips_vpe_wake()

In reply to Aleksandar Markovic

From: Goran Ferenc <[email protected]>

Hold BQL whenever mips_vpe_wake() is invoked.

Without this patch, MIPS MT with MTTCG enabled triggers an abort in tcg_handle_interrupt() due to an unlocked access to cpu_interrupt(). This patch makes sure that the BQL is held in this case.

---
 target/mips/op_helper.c | 3 +++
 1 file changed, 3 insertions(+)
target/mips/op_helper.c +3 -0
index 8c53b3b..0f272a5 100644
@@ -17,6 +17,7 @@
  * License along with this library; if not, see <http://www.gnu.org/licenses/>.
  */
 #include "qemu/osdep.h"
+#include "qemu/main-loop.h"
 #include "cpu.h"
 #include "internal.h"
 #include "qemu/host-utils.h"
@@ -638,7 +639,9 @@ static inline void mips_vpe_wake(MIPSCPU *c)
     /* Don't set ->halted = 0 directly, let it be done via cpu_has_work
        because there might be other conditions that state that c should
        be sleeping.  */
+    qemu_mutex_lock_iothread();
     cpu_interrupt(CPU(c), CPU_INTERRUPT_WAKE);
+    qemu_mutex_unlock_iothread();
 }
 
 static inline void mips_vpe_sleep(MIPSCPU *cpu)
Signature · 1 line
2.7.4
#3 lore raw

[Qemu-devel] [PULL 09/15] tests/tcg: target/mips: Add a header with test utilities

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add a header that contains test utilities. For now, it contains only a function for checking and printing test results for bit counting and similar MSA instructions.

---
 tests/tcg/mips/include/test_utils.h | 78 +++++++++++++++++++++++++++++++++++++
 1 file changed, 78 insertions(+)
 create mode 100644 tests/tcg/mips/include/test_utils.h
tests/tcg/mips/include/test_utils.h new file +78 -0
new file mode 100644
index 0000000..82f4b5b
@@ -0,0 +1,78 @@
+/*
+ *  Header file for test utilities
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef TEST_UTILS_H
+#define TEST_UTILS_H
+
+#include <stdio.h>
+#include <stdint.h>
+#include <inttypes.h>
+#include <string.h>
+
+#define PRINT_RESULTS 1
+
+
+static inline int32_t check_results(char *instruction_name,
+                                    uint32_t test_count,
+                                    double elapsed_time,
+                                    uint64_t *b128_result,
+                                    uint64_t *b128_expect)
+{
+#if PRINT_RESULTS
+    uint32_t ii;
+    printf("\n");
+    for (ii = 0; ii < test_count; ii++) {
+        uint64_t a, b;
+        memcpy(&a, (b128_result + 2 * ii), 8);
+        memcpy(&b, (b128_result + 2 * ii + 1), 8);
+        if (ii % 8 != 0) {
+            printf("        { 0x%016llxULL, 0x%016llxULL, },\n", a, b);
+        } else {
+            printf("        { 0x%016llxULL, 0x%016llxULL, },    /* %3d  */\n",
+                   a, b, ii);
+        }
+    }
+    printf("\n");
+#endif
+    uint32_t i;
+    uint32_t pass_count = 0;
+    uint32_t fail_count = 0;
+
+    printf("%s:   ", instruction_name);
+    for (i = 0; i < test_count; i++) {
+        if (b128_result[i] == b128_expect[i]) {
+            pass_count++;
+        } else {
+            fail_count++;
+        }
+    }
+
+    printf("PASS: %3d   FAIL: %3d   elapsed time: %5.2f ms\n",
+           pass_count, fail_count, elapsed_time);
+
+    if (fail_count > 0) {
+        return -1;
+    } else {
+        return 0;
+    }
+}
+
+#endif
Signature · 1 line
2.7.4
#4 lore raw

[Qemu-devel] [PULL 01/15] target/mips: compare virtual addresses in LL/SC sequence

In reply to Aleksandar Markovic

From: Leon Alrae <[email protected]>

Do only virtual addresses comaprisons in LL/SC sequence emulations.

Until this patch, physical addresses had been compared in SC part of LL/SC sequence, even though such comparisons could be avoided. Getting rid of them allows throwing away SC helpers and having common SC implementations in user and system mode, avoiding the need for two separate implementations selected by #ifdef CONFIG_USER_ONLY.

Correct guest software should not rely on LL/SC if they accesses the same physical address via different virtual addresses or if page mapping gets changed between LL/SC due to manipulating TLB entries. MIPS Instruction Set Manual clearly says that an RMW sequence must use the same address in the LL and SC (virtual address, physical address, cacheability and coherency attributes must be identical). Otherwise, the result of the SC is not predictable. This patch takes advantage of this fact and removes the virtual->physical address translation from SC helper.

lladdr served as Coprocessor 0 LLAddr register which captures physical address of the most recent LL instruction, and also lladdr was used for comparison with following SC physical address. This patch changes the meaning of lladdr - now it will only keep the virtual address of the most recent LL. Additionally, CP0_LLAddr field is introduced which is the actual Coperocessor 0 LLAddr register that guest can access.

---
 target/mips/cpu.h       |  3 ++-
 target/mips/machine.c   |  7 ++++---
 target/mips/op_helper.c | 29 +++++++++++++++++------------
 target/mips/translate.c |  4 ++--
 4 files changed, 25 insertions(+), 18 deletions(-)
target/mips/cpu.h +2 -1
index 473d26d..f10e016 100644
@@ -867,13 +867,14 @@ struct CPUMIPSState {
 #define CP0C5_NFExists     0
     int32_t CP0_Config6;
     int32_t CP0_Config7;
+    uint64_t CP0_LLAddr;
     uint64_t CP0_MAAR[MIPS_MAAR_MAX];
     int32_t CP0_MAARI;
     /* XXX: Maybe make LLAddr per-TC? */
 /*
  * CP0 Register 17
  */
-    uint64_t lladdr;
+    target_ulong lladdr; /* LL virtual address compared against SC */
     target_ulong llval;
     target_ulong llnewval;
     uint64_t llval_wp;
target/mips/machine.c +4 -3
index 1341ab1..70d277d 100644
@@ -214,8 +214,8 @@ const VMStateDescription vmstate_tlb = {
 
 const VMStateDescription vmstate_mips_cpu = {
     .name = "cpu",
-    .version_id = 17,
-    .minimum_version_id = 17,
+    .version_id = 18,
+    .minimum_version_id = 18,
     .post_load = cpu_post_load,
     .fields = (VMStateField[]) {
         /* Active TC */
@@ -293,9 +293,10 @@ const VMStateDescription vmstate_mips_cpu = {
         VMSTATE_INT32(env.CP0_Config3, MIPSCPU),
         VMSTATE_INT32(env.CP0_Config6, MIPSCPU),
         VMSTATE_INT32(env.CP0_Config7, MIPSCPU),
+        VMSTATE_UINT64(env.CP0_LLAddr, MIPSCPU),
         VMSTATE_UINT64_ARRAY(env.CP0_MAAR, MIPSCPU, MIPS_MAAR_MAX),
         VMSTATE_INT32(env.CP0_MAARI, MIPSCPU),
-        VMSTATE_UINT64(env.lladdr, MIPSCPU),
+        VMSTATE_UINTTL(env.lladdr, MIPSCPU),
         VMSTATE_UINTTL_ARRAY(env.CP0_WatchLo, MIPSCPU, 8),
         VMSTATE_INT32_ARRAY(env.CP0_WatchHi, MIPSCPU, 8),
         VMSTATE_UINTTL(env.CP0_XContext, MIPSCPU),
target/mips/op_helper.c +17 -12
index aebad24..44f2626 100644
@@ -349,15 +349,15 @@ static inline hwaddr do_translate_address(CPUMIPSState *env,
                                                       target_ulong address,
                                                       int rw, uintptr_t retaddr)
 {
-    hwaddr lladdr;
+    hwaddr paddr;
     CPUState *cs = CPU(mips_env_get_cpu(env));
 
-    lladdr = cpu_mips_translate_address(env, address, rw);
+    paddr = cpu_mips_translate_address(env, address, rw);
 
-    if (lladdr == -1LL) {
+    if (paddr == -1LL) {
         cpu_loop_exit_restore(cs, retaddr);
     } else {
-        return lladdr;
+        return paddr;
     }
 }
 
@@ -370,7 +370,8 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong arg, int mem_idx)  \
         }                                                                     \
         do_raise_exception(env, EXCP_AdEL, GETPC());                          \
     }                                                                         \
-    env->lladdr = do_translate_address(env, arg, 0, GETPC());                 \
+    env->CP0_LLAddr = do_translate_address(env, arg, 0, GETPC());             \
+    env->lladdr = arg;                                                        \
     env->llval = do_##insn(env, arg, mem_idx, GETPC());                       \
     return env->llval;                                                        \
 }
@@ -392,7 +393,7 @@ target_ulong helper_##name(CPUMIPSState *env, target_ulong arg1,              \
         }                                                                     \
         do_raise_exception(env, EXCP_AdES, GETPC());                          \
     }                                                                         \
-    if (do_translate_address(env, arg2, 1, GETPC()) == env->lladdr) {         \
+    if (arg2 == env->lladdr) {                                                \
         tmp = do_##ld_insn(env, arg2, mem_idx, GETPC());                      \
         if (tmp == env->llval) {                                              \
             do_##st_insn(env, arg2, arg1, mem_idx, GETPC());                  \
@@ -987,7 +988,7 @@ target_ulong helper_mftc0_status(CPUMIPSState *env)
 
 target_ulong helper_mfc0_lladdr(CPUMIPSState *env)
 {
-    return (int32_t)(env->lladdr >> env->CP0_LLAddr_shift);
+    return (int32_t)(env->CP0_LLAddr >> env->CP0_LLAddr_shift);
 }
 
 target_ulong helper_mfc0_maar(CPUMIPSState *env)
@@ -1063,7 +1064,7 @@ target_ulong helper_dmfc0_tcschefback(CPUMIPSState *env)
 
 target_ulong helper_dmfc0_lladdr(CPUMIPSState *env)
 {
-    return env->lladdr >> env->CP0_LLAddr_shift;
+    return env->CP0_LLAddr >> env->CP0_LLAddr_shift;
 }
 
 target_ulong helper_dmfc0_maar(CPUMIPSState *env)
@@ -1299,7 +1300,8 @@ void helper_mtc0_tcrestart(CPUMIPSState *env, target_ulong arg1)
 {
     env->active_tc.PC = arg1;
     env->active_tc.CP0_TCStatus &= ~(1 << CP0TCSt_TDS);
-    env->lladdr = 0ULL;
+    env->CP0_LLAddr = 0;
+    env->lladdr = 0;
     /* MIPS16 not implemented. */
 }
 
@@ -1311,12 +1313,14 @@ void helper_mttc0_tcrestart(CPUMIPSState *env, target_ulong arg1)
     if (other_tc == other->current_tc) {
         other->active_tc.PC = arg1;
         other->active_tc.CP0_TCStatus &= ~(1 << CP0TCSt_TDS);
-        other->lladdr = 0ULL;
+        other->CP0_LLAddr = 0;
+        other->lladdr = 0;
         /* MIPS16 not implemented. */
     } else {
         other->tcs[other_tc].PC = arg1;
         other->tcs[other_tc].CP0_TCStatus &= ~(1 << CP0TCSt_TDS);
-        other->lladdr = 0ULL;
+        other->CP0_LLAddr = 0;
+        other->lladdr = 0;
         /* MIPS16 not implemented. */
     }
 }
@@ -1868,7 +1872,7 @@ void helper_mtc0_lladdr(CPUMIPSState *env, target_ulong arg1)
 {
     target_long mask = env->CP0_LLAddr_rw_bitmask;
     arg1 = arg1 << env->CP0_LLAddr_shift;
-    env->lladdr = (env->lladdr & ~mask) | (arg1 & mask);
+    env->CP0_LLAddr = (env->CP0_LLAddr & ~mask) | (arg1 & mask);
 }
 
 #define MTC0_MAAR_MASK(env) \
@@ -2566,6 +2570,7 @@ static inline void exception_return(CPUMIPSState *env)
 void helper_eret(CPUMIPSState *env)
 {
     exception_return(env);
+    env->CP0_LLAddr = 1;
     env->lladdr = 1;
 }
 
target/mips/translate.c +2 -2
index e9b5d1d..307d4ea 100644
@@ -6612,7 +6612,7 @@ static void gen_mfhc0(DisasContext *ctx, TCGv arg, int reg, int sel)
     case CP0_REGISTER_17:
         switch (sel) {
         case 0:
-            gen_mfhc0_load64(arg, offsetof(CPUMIPSState, lladdr),
+            gen_mfhc0_load64(arg, offsetof(CPUMIPSState, CP0_LLAddr),
                              ctx->CP0_LLAddr_shift);
             register_name = "LLAddr";
             break;
@@ -29795,7 +29795,7 @@ void mips_cpu_dump_state(CPUState *cs, FILE *f, fprintf_function cpu_fprintf,
                 env->CP0_Status, env->CP0_Cause, env->CP0_EPC);
     cpu_fprintf(f, "    Config0 0x%08x Config1 0x%08x LLAddr 0x%016"
                 PRIx64 "\n",
-                env->CP0_Config0, env->CP0_Config1, env->lladdr);
+                env->CP0_Config0, env->CP0_Config1, env->CP0_LLAddr);
     cpu_fprintf(f, "    Config2 0x%08x Config3 0x%08x\n",
                 env->CP0_Config2, env->CP0_Config3);
     cpu_fprintf(f, "    Config4 0x%08x Config5 0x%08x\n",
Signature · 1 line
2.7.4
#5 lore raw

[Qemu-devel] [PULL 06/15] target/mips: introduce MTTCG-enabled builds

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Introduce MTTCG-enabled QEMU builds for mips32, mipsn32, and mips64.

---
 configure         | 3 +++
 target/mips/cpu.h | 2 ++
 2 files changed, 5 insertions(+)
configure +3 -0
index fbd0825..f0f7518 100755
@@ -7192,11 +7192,13 @@ case "$target_name" in
     target_compiler=$cross_cc_microblaze
   ;;
   mips|mipsel)
+    mttcg="yes"
     TARGET_ARCH=mips
     target_compiler=$cross_cc_mips
     echo "TARGET_ABI_MIPSO32=y" >> $config_target_mak
   ;;
   mipsn32|mipsn32el)
+    mttcg="yes"
     TARGET_ARCH=mips64
     TARGET_BASE_ARCH=mips
     target_compiler=$cross_cc_mipsn32
@@ -7204,6 +7206,7 @@ case "$target_name" in
     echo "TARGET_ABI32=y" >> $config_target_mak
   ;;
   mips64|mips64el)
+    mttcg="yes"
     TARGET_ARCH=mips64
     TARGET_BASE_ARCH=mips
     target_compiler=$cross_cc_mips64
target/mips/cpu.h +2 -0
index eccee37..a10eeb0 100644
@@ -11,6 +11,8 @@
 #include "exec/cpu-defs.h"
 #include "fpu/softfloat.h"
 
+#define TCG_GUEST_DEFAULT_MO (0)
+
 struct CPUMIPSState;
 
 typedef struct CPUMIPSTLBContext CPUMIPSTLBContext;
Signature · 1 line
2.7.4
#6 lore raw

[Qemu-devel] [PULL 07/15] tests/tcg: target/mips: Remove an unnecessary file

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Remove a file that was added long time ago by mistake. The commit that introduced this file was commit d70080c4 (from 2012).

---
 tests/tcg/mips/mips64-dspr2/.directory | 2 --
 1 file changed, 2 deletions(-)
 delete mode 100644 tests/tcg/mips/mips64-dspr2/.directory
tests/tcg/mips/mips64-dspr2/.directory deleted +0 -2
deleted file mode 100644
index c75a914..0000000
@@ -1,2 +0,0 @@
-[Dolphin]
-Timestamp=2012,8,3,16,41,52
Signature · 1 line
2.7.4
#7 lore raw

[Qemu-devel] [PULL 10/15] tests/tcg: target/mips: Add wrappers for MSA bit counting instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add a header that contains wrappers around MSA instructions assembler invocations. For now, only bit counting instructions (NLOC, NLZC, and PCNT; each in four data format flavors) are supported.

---
 tests/tcg/mips/include/wrappers_msa.h | 57 +++++++++++++++++++++++++++++++++++
 1 file changed, 57 insertions(+)
 create mode 100644 tests/tcg/mips/include/wrappers_msa.h
tests/tcg/mips/include/wrappers_msa.h new file +57 -0
new file mode 100644
index 0000000..8f8d00b
@@ -0,0 +1,57 @@
+/*
+ *  Header file for wrappers around MSA instructions assembler invocations
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef WRAPPERS_MSA_H
+#define WRAPPERS_MSA_H
+
+
+#define DO_MSA__WD__WS(suffix, mnemonic)                               \
+static inline void do_msa_##suffix(void *input, void *output)          \
+{                                                                      \
+   __asm__ volatile (                                                  \
+      "move $t0, %0\n\t"                                               \
+      "ld.d $w11, 0($t0)\n\t"                                          \
+      #mnemonic " $w10, $w11\n\t"                                      \
+      "move $t0, %1\n\t"                                               \
+      "st.d $w10, 0($t0)\n\t"                                          \
+      :                                                                \
+      : "r" (input), "r" (output)                                      \
+      : "t0", "memory"                                                 \
+   );                                                                  \
+}
+
+DO_MSA__WD__WS(NLOC_B, nloc.b)
+DO_MSA__WD__WS(NLOC_H, nloc.h)
+DO_MSA__WD__WS(NLOC_W, nloc.w)
+DO_MSA__WD__WS(NLOC_D, nloc.d)
+
+DO_MSA__WD__WS(NLZC_B, nlzc.b)
+DO_MSA__WD__WS(NLZC_H, nlzc.h)
+DO_MSA__WD__WS(NLZC_W, nlzc.w)
+DO_MSA__WD__WS(NLZC_D, nlzc.d)
+
+DO_MSA__WD__WS(PCNT_B, pcnt.b)
+DO_MSA__WD__WS(PCNT_H, pcnt.h)
+DO_MSA__WD__WS(PCNT_W, pcnt.w)
+DO_MSA__WD__WS(PCNT_D, pcnt.d)
+
+
+#endif
Signature · 1 line
2.7.4
#8 lore raw

[Qemu-devel] [PULL 05/15] hw/mips_cpc: kick a VP when putting it into Run statewq

In reply to Aleksandar Markovic

From: Miodrag Dinic <[email protected]>

While testing mttcg VP0 could get stuck in a loop waiting for other VPs to come up (which never actually happens). To fix this, kick VPs while they are being powered up by Cluster Power Controller in an async task which is triggered once the host thread is being spawned.

---
 hw/misc/mips_cpc.c | 17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)
hw/misc/mips_cpc.c +15 -2
index 6d34574..712d842 100644
@@ -30,6 +30,14 @@ static inline uint64_t cpc_vp_run_mask(MIPSCPCState *cpc)
     return (1ULL << cpc->num_vp) - 1;
 }
 
+static void mips_cpu_reset_async_work(CPUState *cs, run_on_cpu_data data)
+{
+    MIPSCPCState *cpc = (MIPSCPCState *) data.host_ptr;
+
+    cpu_reset(cs);
+    cpc->vp_running |= 1ULL << cs->cpu_index;
+}
+
 static void cpc_run_vp(MIPSCPCState *cpc, uint64_t vp_run)
 {
     CPUState *cs = first_cpu;
@@ -37,8 +45,13 @@ static void cpc_run_vp(MIPSCPCState *cpc, uint64_t vp_run)
     CPU_FOREACH(cs) {
         uint64_t i = 1ULL << cs->cpu_index;
         if (i & vp_run & ~cpc->vp_running) {
-            cpu_reset(cs);
-            cpc->vp_running |= i;
+            /*
+             * To avoid racing with a CPU we are just kicking off.
+             * We do the final bit of preparation for the work in
+             * the target CPUs context.
+             */
+            async_safe_run_on_cpu(cs, mips_cpu_reset_async_work,
+                                  RUN_ON_CPU_HOST_PTR(cpc));
         }
     }
 }
Signature · 1 line
2.7.4
#9 lore raw

[Qemu-devel] [PULL 02/15] target/mips: reimplement SC instruction emulation and use cmpxchg

In reply to Aleksandar Markovic

From: Leon Alrae <[email protected]>

Completely rewrite conditional stores handling. Use cmpxchg.

This eliminates need for separate implementations of SC instruction emulation for user and system emulation.

---
 linux-user/mips/cpu_loop.c |  73 ---------------------------
 target/mips/cpu.h          |   4 --
 target/mips/helper.c       |   6 +--
 target/mips/helper.h       |   2 -
 target/mips/op_helper.c    |  27 ----------
 target/mips/translate.c    | 123 ++++++++++++++++-----------------------------
 6 files changed, 44 insertions(+), 191 deletions(-)
linux-user/mips/cpu_loop.c +0 -73
index d0f62ec..61dc90d 100644
@@ -392,70 +392,6 @@ static const uint8_t mips_syscall_args[] = {
 #  undef MIPS_SYS
 # endif /* O32 */
 
-static int do_store_exclusive(CPUMIPSState *env)
-{
-    target_ulong addr;
-    target_ulong page_addr;
-    target_ulong val;
-    uint32_t val_wp = 0;
-    uint32_t llnewval_wp = 0;
-    int flags;
-    int segv = 0;
-    int reg;
-    int d;
-    int wp;
-
-    addr = env->lladdr;
-    page_addr = addr & TARGET_PAGE_MASK;
-    start_exclusive();
-    mmap_lock();
-    flags = page_get_flags(page_addr);
-    if ((flags & PAGE_READ) == 0) {
-        segv = 1;
-    } else {
-        reg = env->llreg & 0x1f;
-        d = (env->llreg & 0x20) != 0;
-        wp = (env->llreg & 0x40) != 0;
-        if (!wp) {
-            if (d) {
-                segv = get_user_s64(val, addr);
-            } else {
-                segv = get_user_s32(val, addr);
-            }
-        } else {
-            segv = get_user_s32(val, addr);
-            segv |= get_user_s32(val_wp, addr);
-            llnewval_wp = env->llnewval_wp;
-        }
-        if (!segv) {
-            if (val != env->llval && val_wp == llnewval_wp) {
-                env->active_tc.gpr[reg] = 0;
-            } else {
-                if (!wp) {
-                    if (d) {
-                        segv = put_user_u64(env->llnewval, addr);
-                    } else {
-                        segv = put_user_u32(env->llnewval, addr);
-                    }
-                } else {
-                    segv = put_user_u32(env->llnewval, addr);
-                    segv |= put_user_u32(env->llnewval_wp, addr + 4);
-                }
-                if (!segv) {
-                    env->active_tc.gpr[reg] = 1;
-                }
-            }
-        }
-    }
-    env->lladdr = -1;
-    if (!segv) {
-        env->active_tc.PC += 4;
-    }
-    mmap_unlock();
-    end_exclusive();
-    return segv;
-}
-
 /* Break codes */
 enum {
     BRK_OVERFLOW = 6,
@@ -597,15 +533,6 @@ done_syscall:
             info.si_code = TARGET_TRAP_BRKPT;
             queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
             break;
-        case EXCP_SC:
-            if (do_store_exclusive(env)) {
-                info.si_signo = TARGET_SIGSEGV;
-                info.si_errno = 0;
-                info.si_code = TARGET_SEGV_MAPERR;
-                info._sifields._sigfault._addr = env->active_tc.PC;
-                queue_signal(env, info.si_signo, QEMU_SI_FAULT, &info);
-            }
-            break;
         case EXCP_DSPDIS:
             info.si_signo = TARGET_SIGILL;
             info.si_errno = 0;
target/mips/cpu.h +0 -4
index f10e016..eccee37 100644
@@ -876,10 +876,8 @@ struct CPUMIPSState {
  */
     target_ulong lladdr; /* LL virtual address compared against SC */
     target_ulong llval;
-    target_ulong llnewval;
     uint64_t llval_wp;
     uint32_t llnewval_wp;
-    target_ulong llreg;
     uint64_t CP0_LLAddr_rw_bitmask;
     int CP0_LLAddr_shift;
 /*
@@ -1156,8 +1154,6 @@ enum {
 
     EXCP_LAST = EXCP_TLBRI,
 };
-/* Dummy exception for conditional stores.  */
-#define EXCP_SC 0x100
 
 /*
  * This is an internally generated WAKE request line.
target/mips/helper.c +2 -4
index 8988452..944f094 100644
@@ -1463,10 +1463,8 @@ void QEMU_NORETURN do_raise_exception_err(CPUMIPSState *env,
 {
     CPUState *cs = CPU(mips_env_get_cpu(env));
 
-    if (exception < EXCP_SC) {
-        qemu_log_mask(CPU_LOG_INT, "%s: %d %d\n",
-                      __func__, exception, error_code);
-    }
+    qemu_log_mask(CPU_LOG_INT, "%s: %d %d\n",
+                  __func__, exception, error_code);
     cs->exception_index = exception;
     env->error_code = error_code;
 
target/mips/helper.h +0 -2
index 8872c46..a6d687e 100644
@@ -13,10 +13,8 @@ DEF_HELPER_4(swr, void, env, tl, tl, int)
 
 #ifndef CONFIG_USER_ONLY
 DEF_HELPER_3(ll, tl, env, tl, int)
-DEF_HELPER_4(sc, tl, env, tl, tl, int)
 #ifdef TARGET_MIPS64
 DEF_HELPER_3(lld, tl, env, tl, int)
-DEF_HELPER_4(scd, tl, env, tl, tl, int)
 #endif
 #endif
 
target/mips/op_helper.c +0 -27
index 44f2626..943a7ea 100644
@@ -380,33 +380,6 @@ HELPER_LD_ATOMIC(ll, lw, 0x3)
 HELPER_LD_ATOMIC(lld, ld, 0x7)
 #endif
 #undef HELPER_LD_ATOMIC
-
-#define HELPER_ST_ATOMIC(name, ld_insn, st_insn, almask)                      \
-target_ulong helper_##name(CPUMIPSState *env, target_ulong arg1,              \
-                           target_ulong arg2, int mem_idx)                    \
-{                                                                             \
-    target_long tmp;                                                          \
-                                                                              \
-    if (arg2 & almask) {                                                      \
-        if (!(env->hflags & MIPS_HFLAG_DM)) {                                 \
-            env->CP0_BadVAddr = arg2;                                         \
-        }                                                                     \
-        do_raise_exception(env, EXCP_AdES, GETPC());                          \
-    }                                                                         \
-    if (arg2 == env->lladdr) {                                                \
-        tmp = do_##ld_insn(env, arg2, mem_idx, GETPC());                      \
-        if (tmp == env->llval) {                                              \
-            do_##st_insn(env, arg2, arg1, mem_idx, GETPC());                  \
-            return 1;                                                         \
-        }                                                                     \
-    }                                                                         \
-    return 0;                                                                 \
-}
-HELPER_ST_ATOMIC(sc, lw, sw, 0x3)
-#ifdef TARGET_MIPS64
-HELPER_ST_ATOMIC(scd, ld, sd, 0x7)
-#endif
-#undef HELPER_ST_ATOMIC
 #endif
 
 #ifdef TARGET_WORDS_BIGENDIAN
target/mips/translate.c +42 -81

212 lines not on this page · raw message

Signature · 1 line
2.7.4
#10 lore raw

[Qemu-devel] [PULL 08/15] tests/tcg: target/mips: Add a header with test inputs

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

The file tests/tcg/mips/include/test_inputs.h is planned to contain various test inputs. For now, it contains 64 128-bit pattern inputs (alternating groups od ones and zeroes) and 16 128-bit random inputs.

---
 tests/tcg/mips/include/test_inputs.h | 122 +++++++++++++++++++++++++++++++++++
 1 file changed, 122 insertions(+)
 create mode 100644 tests/tcg/mips/include/test_inputs.h
tests/tcg/mips/include/test_inputs.h new file +122 -0
new file mode 100644
index 0000000..c173d58
@@ -0,0 +1,122 @@
+/*
+ *  Header file for pattern and random test inputs
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#ifndef TEST_INPUTS_H
+#define TEST_INPUTS_H
+
+#include <stdint.h>
+
+
+#define PATTERN_INPUTS_COUNT          64
+#define PATTERN_INPUTS_SHORT_COUNT     8
+
+uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] = {
+    { 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, },   /*   0 */
+    { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+    { 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, },
+    { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+    { 0xCCCCCCCCCCCCCCCCULL, 0xCCCCCCCCCCCCCCCCULL, },
+    { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+    { 0xE38E38E38E38E38EULL, 0x38E38E38E38E38E3ULL, },
+    { 0x1C71C71C71C71C71ULL, 0xC71C71C71C71C71CULL, },
+    { 0xF0F0F0F0F0F0F0F0ULL, 0xF0F0F0F0F0F0F0F0ULL, },   /*   8 */
+    { 0x0F0F0F0F0F0F0F0FULL, 0x0F0F0F0F0F0F0F0FULL, },
+    { 0xF83E0F83E0F83E0FULL, 0x83E0F83E0F83E0F8ULL, },
+    { 0x07C1F07C1F07C1F0ULL, 0x7C1F07C1F07C1F07ULL, },
+    { 0xFC0FC0FC0FC0FC0FULL, 0xC0FC0FC0FC0FC0FCULL, },
+    { 0x03F03F03F03F03F0ULL, 0x3F03F03F03F03F03ULL, },
+    { 0xFE03F80FE03F80FEULL, 0x03F80FE03F80FE03ULL, },
+    { 0x01FC07F01FC07F01ULL, 0xFC07F01FC07F01FCULL, },
+    { 0xFF00FF00FF00FF00ULL, 0xFF00FF00FF00FF00ULL, },   /*  16 */
+    { 0x00FF00FF00FF00FFULL, 0x00FF00FF00FF00FFULL, },
+    { 0xFF803FE00FF803FEULL, 0x00FF803FE00FF803ULL, },
+    { 0x007FC01FF007FC01ULL, 0xFF007FC01FF007FCULL, },
+    { 0xFFC00FFC00FFC00FULL, 0xFC00FFC00FFC00FFULL, },
+    { 0x003FF003FF003FF0ULL, 0x03FF003FF003FF00ULL, },
+    { 0xFFE003FF800FFE00ULL, 0x3FF800FFE003FF80ULL, },
+    { 0x001FFC007FF001FFULL, 0xC007FF001FFC007FULL, },
+    { 0xFFF000FFF000FFF0ULL, 0x00FFF000FFF000FFULL, },   /*  24 */
+    { 0x000FFF000FFF000FULL, 0xFF000FFF000FFF00ULL, },
+    { 0xFFF8003FFE000FFFULL, 0x8003FFE000FFF800ULL, },
+    { 0x0007FFC001FFF000ULL, 0x7FFC001FFF0007FFULL, },
+    { 0xFFFC000FFFC000FFULL, 0xFC000FFFC000FFFCULL, },
+    { 0x0003FFF0003FFF00ULL, 0x03FFF0003FFF0003ULL, },
+    { 0xFFFE0003FFF8000FULL, 0xFFE0003FFF8000FFULL, },
+    { 0x0001FFFC0007FFF0ULL, 0x001FFFC0007FFF00ULL, },
+    { 0xFFFF0000FFFF0000ULL, 0xFFFF0000FFFF0000ULL, },   /*  32 */
+    { 0x0000FFFF0000FFFFULL, 0x0000FFFF0000FFFFULL, },
+    { 0xFFFF80003FFFE000ULL, 0x0FFFF80003FFFE00ULL, },
+    { 0x00007FFFC0001FFFULL, 0xF00007FFFC0001FFULL, },
+    { 0xFFFFC0000FFFFC00ULL, 0x00FFFFC0000FFFFCULL, },
+    { 0x00003FFFF00003FFULL, 0xFF00003FFFF00003ULL, },
+    { 0xFFFFE00003FFFF80ULL, 0x000FFFFE00003FFFULL, },
+    { 0x00001FFFFC00007FULL, 0xFFF00001FFFFC000ULL, },
+    { 0xFFFFF00000FFFFF0ULL, 0x0000FFFFF00000FFULL, },   /*  40 */
+    { 0x00000FFFFF00000FULL, 0xFFFF00000FFFFF00ULL, },
+    { 0xFFFFF800003FFFFEULL, 0x00000FFFFF800003ULL, },
+    { 0x000007FFFFC00001ULL, 0xFFFFF000007FFFFCULL, },
+    { 0xFFFFFC00000FFFFFULL, 0xC00000FFFFFC0000ULL, },
+    { 0x000003FFFFF00000ULL, 0x3FFFFF000003FFFFULL, },
+    { 0xFFFFFE000003FFFFULL, 0xF800000FFFFFE000ULL, },
+    { 0x000001FFFFFC0000ULL, 0x07FFFFF000001FFFULL, },
+    { 0xFFFFFF000000FFFFULL, 0xFF000000FFFFFF00ULL, },   /*  48 */
+    { 0x000000FFFFFF0000ULL, 0x00FFFFFF000000FFULL, },
+    { 0xFFFFFF8000003FFFULL, 0xFFE000000FFFFFF8ULL, },
+    { 0x0000007FFFFFC000ULL, 0x001FFFFFF0000007ULL, },
+    { 0xFFFFFFC000000FFFULL, 0xFFFC000000FFFFFFULL, },
+    { 0x0000003FFFFFF000ULL, 0x0003FFFFFF000000ULL, },
+    { 0xFFFFFFE0000003FFULL, 0xFFFF8000000FFFFFULL, },
+    { 0x0000001FFFFFFC00ULL, 0x00007FFFFFF00000ULL, },
+    { 0xFFFFFFF0000000FFULL, 0xFFFFF0000000FFFFULL, },   /*  56 */
+    { 0x0000000FFFFFFF00ULL, 0x00000FFFFFFF0000ULL, },
+    { 0xFFFFFFF80000003FULL, 0xFFFFFE0000000FFFULL, },
+    { 0x00000007FFFFFFC0ULL, 0x000001FFFFFFF000ULL, },
+    { 0xFFFFFFFC0000000FULL, 0xFFFFFFC0000000FFULL, },
+    { 0x00000003FFFFFFF0ULL, 0x0000003FFFFFFF00ULL, },
+    { 0xFFFFFFFE00000003ULL, 0xFFFFFFF80000000FULL, },
+    { 0x00000001FFFFFFFCULL, 0x00000007FFFFFFF0ULL, },
+};
+
+
+#define RANDOM_INPUTS_COUNT           16
+#define RANDOM_INPUTS_SHORT_COUNT      4
+
+uint64_t b128_random[RANDOM_INPUTS_COUNT][2] = {
+    { 0x886AE6CC28625540ULL, 0x4B670B5EFE7BB00CULL, },   /*   0 */
+    { 0xFBBE00634D93C708ULL, 0x12F7BB1A153F52FCULL, },
+    { 0xAC5AAEAAB9CF8B80ULL, 0x27D8C6FFAB2B2514ULL, },
+    { 0x704F164D5E31E24EULL, 0x8DF188D8A942E2A0ULL, },
+    { 0xB9926B7C7DAF4258ULL, 0xA1227CADDCCE65B6ULL, },
+    { 0xD027BE89FF0A2EF9ULL, 0x170B5050FEA53078ULL, },
+    { 0xB83B580665CABC4AULL, 0x91230822BFF0BA62ULL, },
+    { 0xFC8F23F09AA6B782ULL, 0x93FD6637124275AEULL, },
+    { 0x201E09CD56AEE649ULL, 0xEF5DE039A6A52758ULL, },   /*   8 */
+    { 0xA57CD91365D9E5D7ULL, 0x9321BC9881ECBA5CULL, },
+    { 0xA2E8F6F5C9CBC61BULL, 0xB2C471545E0D7A12ULL, },
+    { 0xA89CF2F131A864AEULL, 0xD2A3E87A5DB986E7ULL, },
+    { 0xE61438E9A652EA0AULL, 0xA85483D97879D41CULL, },
+    { 0x944A35FD192361A8ULL, 0xF3912DA36A0B2D6BULL, },
+    { 0x4630426322BEF79CULL, 0xEB5686F7CB19304EULL, },
+    { 0x8B5AA7A2F259DEADULL, 0xD278CBCD696417E3ULL, },
+};
+
+
+#endif
Signature · 1 line
2.7.4
#11 lore raw

[Qemu-devel] [PULL 12/15] tests/tcg: target/mips: Add wrappers for MSA interleave instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add wrappers for MSA interleave instructions.

---
 tests/tcg/mips/include/wrappers_msa.h | 39 +++++++++++++++++++++++++++++++++++
 1 file changed, 39 insertions(+)
tests/tcg/mips/include/wrappers_msa.h +39 -0
index 8f8d00b..3017ed5 100644
@@ -54,4 +54,43 @@ DO_MSA__WD__WS(PCNT_W, pcnt.w)
 DO_MSA__WD__WS(PCNT_D, pcnt.d)
 
 
+#define DO_MSA__WD__WS_WT(suffix, mnemonic)                            \
+static inline void do_msa_##suffix(void *input1, void *input2,         \
+                                   void *output)                       \
+{                                                                      \
+   __asm__ volatile (                                                  \
+      "move $t0, %0\n\t"                                               \
+      "ld.d $w11, 0($t0)\n\t"                                          \
+      "move $t0, %1\n\t"                                               \
+      "ld.d $w12, 0($t0)\n\t"                                          \
+      #mnemonic " $w10, $w11, $w12\n\t"                                \
+      "move $t0, %2\n\t"                                               \
+      "st.d $w10, 0($t0)\n\t"                                          \
+      :                                                                \
+      : "r" (input1), "r" (input2), "r" (output)                       \
+      : "t0", "memory"                                                 \
+   );                                                                  \
+}
+
+DO_MSA__WD__WS_WT(ILVEV_B, ilvev.b)
+DO_MSA__WD__WS_WT(ILVEV_H, ilvev.h)
+DO_MSA__WD__WS_WT(ILVEV_W, ilvev.w)
+DO_MSA__WD__WS_WT(ILVEV_D, ilvev.d)
+
+DO_MSA__WD__WS_WT(ILVOD_B, ilvod.b)
+DO_MSA__WD__WS_WT(ILVOD_H, ilvod.h)
+DO_MSA__WD__WS_WT(ILVOD_W, ilvod.w)
+DO_MSA__WD__WS_WT(ILVOD_D, ilvod.d)
+
+DO_MSA__WD__WS_WT(ILVL_B, ilvl.b)
+DO_MSA__WD__WS_WT(ILVL_H, ilvl.h)
+DO_MSA__WD__WS_WT(ILVL_W, ilvl.w)
+DO_MSA__WD__WS_WT(ILVL_D, ilvl.d)
+
+DO_MSA__WD__WS_WT(ILVR_B, ilvr.b)
+DO_MSA__WD__WS_WT(ILVR_H, ilvr.h)
+DO_MSA__WD__WS_WT(ILVR_W, ilvr.w)
+DO_MSA__WD__WS_WT(ILVR_D, ilvr.d)
+
+
 #endif
Signature · 1 line
2.7.4
#12 lore raw

[Qemu-devel] [PULL 14/15] tests/tcg: target/mips: Add wrappers for MSA logic instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add wrappers for MSA logic instructions.

---
 tests/tcg/mips/include/wrappers_msa.h | 5 +++++
 1 file changed, 5 insertions(+)
tests/tcg/mips/include/wrappers_msa.h +5 -0
index 3017ed5..7a77fb9 100644
@@ -92,5 +92,10 @@ DO_MSA__WD__WS_WT(ILVR_H, ilvr.h)
 DO_MSA__WD__WS_WT(ILVR_W, ilvr.w)
 DO_MSA__WD__WS_WT(ILVR_D, ilvr.d)
 
+DO_MSA__WD__WS_WT(AND_V, and.v)
+DO_MSA__WD__WS_WT(NOR_V, nor.v)
+DO_MSA__WD__WS_WT(OR_V, or.v)
+DO_MSA__WD__WS_WT(XOR_V, xor.v)
+
 
 #endif
Signature · 1 line
2.7.4
#13 lore raw

[Qemu-devel] [PULL 11/15] tests/tcg: target/mips: Add tests for MSA bit counting instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add tests for MSA bit counting instructions. This includes following instructions:

* NLOC.B - number of leading ones (bytes)
* NLOC.H - number of leading ones (halfwords)
* NLOC.W - number of leading ones (words)
* NLOC.D - number of leading ones (doublewords)
* NLZC.B - number of leading zeros (bytes)
* NLZC.H - number of leading zeros (halfwords)
* NLZC.W - number of leading zeros (words)
* NLZC.D - number of leading zeros (doublewords)
* PCNT.B - population count / number of ones (bytes)
* PCNT.H - population count / number of ones (halfwords)
* PCNT.W - population count / number of ones (words)
* PCNT.D - population count / number of ones (doublewords)

Each test consists of 80 test cases, so altogether there are 960 test cases.

---
 .../user/ase/msa/bit-counting/test_msa_nloc_b.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_d.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_h.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nloc_w.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_b.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_d.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_h.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_nlzc_w.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_b.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_d.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_h.c    | 144 +++++++++++++++++++++
 .../user/ase/msa/bit-counting/test_msa_pcnt_w.c    | 144 +++++++++++++++++++++
 12 files changed, 1728 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_w.c
tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_b.c new file +144 -0
new file mode 100644
index 0000000..eb46290
@@ -0,0 +1,144 @@
+/*
+ *  Test program for MSA instruction NLOC.B
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../include/wrappers_msa.h"
+#include "../../../include/test_inputs.h"
+#include "../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (PATTERN_INPUTS_COUNT + RANDOM_INPUTS_COUNT)
+
+
+int32_t main(void)
+{
+    char *instruction_name = "NLOC.B";
+    int32_t ret;
+    uint32_t i;
+    struct timeval start, end;
+    double elapsed_time;
+
+    uint64_t b128_result[TEST_COUNT_TOTAL][2];
+    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+        { 0x0808080808080808ULL, 0x0808080808080808ULL, },    /*   0  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0101010101010101ULL, 0x0101010101010101ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0202020202020202ULL, 0x0202020202020202ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0301000301000301ULL, 0x0003010003010003ULL, },
+        { 0x0000020000020000ULL, 0x0200000200000200ULL, },
+        { 0x0404040404040404ULL, 0x0404040404040404ULL, },    /*   8  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0500000103050000ULL, 0x0103050000010305ULL, },
+        { 0x0002040000000204ULL, 0x0000000204000000ULL, },
+        { 0x0600020600020600ULL, 0x0206000206000206ULL, },
+        { 0x0004000004000004ULL, 0x0000040000040000ULL, },
+        { 0x0700050003000107ULL, 0x0005000300010700ULL, },
+        { 0x0006000400020000ULL, 0x0600040002000006ULL, },
+        { 0x0800080008000800ULL, 0x0800080008000800ULL, },    /*  16  */
+        { 0x0008000800080008ULL, 0x0008000800080008ULL, },
+        { 0x0801000300050007ULL, 0x0008010003000500ULL, },
+        { 0x0000020004000600ULL, 0x0800000200040006ULL, },
+        { 0x0802000600080200ULL, 0x0600080200060008ULL, },
+        { 0x0000040008000004ULL, 0x0008000004000800ULL, },
+        { 0x0803000801000700ULL, 0x0005000803000801ULL, },
+        { 0x0000060000040008ULL, 0x0200080000060000ULL, },
+        { 0x0804000804000804ULL, 0x0008040008040008ULL, },    /*  24  */
+        { 0x0000080000080000ULL, 0x0800000800000800ULL, },
+        { 0x0805000007000008ULL, 0x0100080300080500ULL, },
+        { 0x0000080200080400ULL, 0x0006000008000008ULL, },
+        { 0x0806000008020008ULL, 0x0600000802000806ULL, },
+        { 0x0000080400000800ULL, 0x0008040000080000ULL, },
+        { 0x0807000008050000ULL, 0x0803000008010008ULL, },
+        { 0x0000080600000804ULL, 0x0000080200000800ULL, },
+        { 0x0808000008080000ULL, 0x0808000008080000ULL, },    /*  32  */
+        { 0x0000080800000808ULL, 0x0000080800000808ULL, },
+        { 0x0808010000080300ULL, 0x0008050000080700ULL, },
+        { 0x0000000802000008ULL, 0x0400000806000008ULL, },
+        { 0x0808020000080600ULL, 0x0008080200000806ULL, },
+        { 0x0000000804000008ULL, 0x0800000008040000ULL, },
+        { 0x0808030000080801ULL, 0x0000080700000008ULL, },
+        { 0x0000000806000000ULL, 0x0804000008080200ULL, },
+        { 0x0808040000080804ULL, 0x0000080804000008ULL, },    /*  40  */
+        { 0x0000000808000000ULL, 0x0808000000080800ULL, },
+        { 0x0808050000000807ULL, 0x0000000808010000ULL, },
+        { 0x0000000808020000ULL, 0x0808040000000806ULL, },
+        { 0x0808060000000808ULL, 0x0200000808060000ULL, },
+        { 0x0000000808040000ULL, 0x0008080000000808ULL, },
+        { 0x0808070000000808ULL, 0x0500000008080300ULL, },
+        { 0x0000000808060000ULL, 0x0008080400000008ULL, },
+        { 0x0808080000000808ULL, 0x0800000008080800ULL, },    /*  48  */
+        { 0x0000000808080000ULL, 0x0008080800000008ULL, },
+        { 0x0808080100000008ULL, 0x0803000000080805ULL, },
+        { 0x0000000008080200ULL, 0x0000080804000000ULL, },
+        { 0x0808080200000008ULL, 0x0806000000080808ULL, },
+        { 0x0000000008080400ULL, 0x0000080808000000ULL, },
+        { 0x0808080300000008ULL, 0x0808010000000808ULL, },
+        { 0x0000000008080600ULL, 0x0000000808040000ULL, },
+        { 0x0808080400000008ULL, 0x0808040000000808ULL, },    /*  56  */
+        { 0x0000000008080800ULL, 0x0000000808080000ULL, },
+        { 0x0808080500000000ULL, 0x0808070000000008ULL, },
+        { 0x0000000008080802ULL, 0x0000000808080400ULL, },
+        { 0x0808080600000000ULL, 0x0808080200000008ULL, },
+        { 0x0000000008080804ULL, 0x0000000008080800ULL, },
+        { 0x0808080700000000ULL, 0x0808080500000000ULL, },
+        { 0x0000000008080806ULL, 0x0000000008080804ULL, },
+        { 0x0100030200000000ULL, 0x0000000007000100ULL, },    /*  64  */
+        { 0x0501000000010200ULL, 0x0004010000000006ULL, },
+        { 0x0100010101020101ULL, 0x0002020801000000ULL, },
+        { 0x0000000000000300ULL, 0x0104010201000301ULL, },
+        { 0x0101000000010000ULL, 0x0100000102020001ULL, },
+        { 0x0200010108000005ULL, 0x0000000007010000ULL, },
+        { 0x0100000000020100ULL, 0x0100000001040100ULL, },
+        { 0x0601000401010101ULL, 0x0106000000000001ULL, },
+        { 0x0000000200010300ULL, 0x0300030001010000ULL, },    /*  72  */
+        { 0x0100020000020302ULL, 0x0100010101030100ULL, },
+        { 0x0103040402020200ULL, 0x0102000000000000ULL, },
+        { 0x0101040400010001ULL, 0x0201030000010103ULL, },
+        { 0x0300000301000300ULL, 0x0100010200000200ULL, },
+        { 0x0100000600000001ULL, 0x0401000100000000ULL, },
+        { 0x0000000000010401ULL, 0x0300010402000000ULL, },
+        { 0x0100010104000201ULL, 0x0200020200000003ULL, },
+    };
+
+    gettimeofday(&start, NULL);
+
+    for (i = 0; i < TEST_COUNT_TOTAL; i++) {
+        if (i < PATTERN_INPUTS_COUNT) {
+            do_msa_NLOC_B(b128_pattern[i], b128_result[i]);
+        } else {
+            do_msa_NLOC_B(b128_random[i - PATTERN_INPUTS_COUNT],
+                          b128_result[i]);
+        }
+    }
+
+    gettimeofday(&end, NULL);
+
+    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
+                        &b128_result[0][0], &b128_expect[0][0]);
+
+    return ret;
+}
tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_d.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_h.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nloc_w.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_b.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_d.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_h.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_nlzc_w.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_b.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_d.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_h.c new file +144 -0

144 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/bit-counting/test_msa_pcnt_w.c new file +144 -0

144 lines not on this page · raw message

Signature · 1 line
2.7.4
#14 lore raw

[Qemu-devel] [PULL 15/15] tests/tcg: target/mips: Add tests for MSA logic instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add tests for MSA logic instructions. This includes following instructions:

* AND.V - logical AND
* NOR.V - logical NOR
* OR.V - logical OR
* XOR.V - logical XOR

Each test consists of 80 test cases, so altogether there are 320 test cases.

---
 tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c  | 153 +++++++++++++++++++++
 tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c | 153 +++++++++++++++++++++
 4 files changed, 612 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c
 create mode 100644 tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c
tests/tcg/mips/user/ase/msa/logic/test_msa_and_v.c new file +153 -0
new file mode 100644
index 0000000..51b256f
@@ -0,0 +1,153 @@
+/*
+ *  Test program for MSA instruction AND.V
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (                                                \
+            (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+            (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+    char *instruction_name = "AND.V";
+    int32_t ret;
+    uint32_t i, j;
+    struct timeval start, end;
+    double elapsed_time;
+
+    uint64_t b128_result[TEST_COUNT_TOTAL][2];
+    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*   0  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },    /*   8  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },    /*  16  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+        { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+        { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+        { 0x5555555555555555ULL, 0x5555555555555555ULL, },    /*  24  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+        { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+        { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+        { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+        { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },    /*  32  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x8888888888888888ULL, 0x8888888888888888ULL, },
+        { 0x4444444444444444ULL, 0x4444444444444444ULL, },
+        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+        { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+        { 0x3333333333333333ULL, 0x3333333333333333ULL, },    /*  40  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x2222222222222222ULL, 0x2222222222222222ULL, },
+        { 0x1111111111111111ULL, 0x1111111111111111ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+        { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+        { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },    /*  48  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0xa28a28a28a28a28aULL, 0x28a28a28a28a28a2ULL, },
+        { 0x4104104104104104ULL, 0x1041041041041041ULL, },
+        { 0xc08c08c08c08c08cULL, 0x08c08c08c08c08c0ULL, },
+        { 0x2302302302302302ULL, 0x3023023023023023ULL, },
+        { 0xe38e38e38e38e38eULL, 0x38e38e38e38e38e3ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },    /*  56  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x0820820820820820ULL, 0x8208208208208208ULL, },
+        { 0x1451451451451451ULL, 0x4514514514514514ULL, },
+        { 0x0c40c40c40c40c40ULL, 0xc40c40c40c40c40cULL, },
+        { 0x1031031031031031ULL, 0x0310310310310310ULL, },
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x1c71c71c71c71c71ULL, 0xc71c71c71c71c71cULL, },
+        { 0x886ae6cc28625540ULL, 0x4b670b5efe7bb00cULL, },    /*  64  */
+        { 0x882a004008024500ULL, 0x02670b1a143b100cULL, },
+        { 0x884aa68828420100ULL, 0x0340025eaa2b2004ULL, },
+        { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+        { 0x882a004008024500ULL, 0x02670b1a143b100cULL, },
+        { 0xfbbe00634d93c708ULL, 0x12f7bb1a153f52fcULL, },
+        { 0xa81a002209838300ULL, 0x02d0821a012b0014ULL, },
+        { 0x700e00414c11c208ULL, 0x00f18818010242a0ULL, },
+        { 0x884aa68828420100ULL, 0x0340025eaa2b2004ULL, },    /*  72  */
+        { 0xa81a002209838300ULL, 0x02d0821a012b0014ULL, },
+        { 0xac5aaeaab9cf8b80ULL, 0x27d8c6ffab2b2514ULL, },
+        { 0x204a060818018200ULL, 0x05d080d8a9022000ULL, },
+        { 0x004a064c08204040ULL, 0x09610858a842a000ULL, },
+        { 0x700e00414c11c208ULL, 0x00f18818010242a0ULL, },
+        { 0x204a060818018200ULL, 0x05d080d8a9022000ULL, },
+        { 0x704f164d5e31e24eULL, 0x8df188d8a942e2a0ULL, },
+    };
+
+    gettimeofday(&start, NULL);
+
+    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+            do_msa_AND_V(b128_pattern[i], b128_pattern[j],
+                         b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+        }
+    }
+
+    for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+        for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+            do_msa_AND_V(b128_random[i], b128_random[j],
+                         b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+                                      (PATTERN_INPUTS_SHORT_COUNT)) +
+                                     RANDOM_INPUTS_SHORT_COUNT * i + j]);
+        }
+    }
+
+    gettimeofday(&end, NULL);
+
+    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
+                        &b128_result[0][0], &b128_expect[0][0]);
+
+    return ret;
+}
tests/tcg/mips/user/ase/msa/logic/test_msa_nor_v.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/logic/test_msa_or_v.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/logic/test_msa_xor_v.c new file +153 -0

153 lines not on this page · raw message

Signature · 1 line
2.7.4
#15 lore raw

[Qemu-devel] [PULL 13/15] tests/tcg: target/mips: Add tests for MSA interleave instructions

In reply to Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

Add tests for MSA interleave instructions. This includes following instructions:

* ILVEV.B - interleave even (bytes)
* ILVEV.H - interleave even (halfwords)
* ILVEV.W - interleave even (words)
* ILVEV.D - interleave even (doublewords)
* ILVOD.B - interleave odd (bytes)
* ILVOD.H - interleave odd (halfwords)
* ILVOD.W - interleave odd (words)
* ILVOD.D - interleave odd (doublewords)
* ILVL.B - interleave left (bytes)
* ILVL.H - interleave left (halfwords)
* ILVL.W - interleave left (words)
* ILVL.D - interleave left (doublewords)
* ILVR.B - interleave right (bytes)
* ILVR.H - interleave right (halfwords)
* ILVR.W - interleave right (words)
* ILVR.D - interleave right (doublewords)

Each test consists of 80 test cases, so altogether there are 1280 test cases.

---
 .../user/ase/msa/interleave/test_msa_ilvev_b.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_d.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_h.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvev_w.c     | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_b.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_d.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_h.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvl_w.c | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_b.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_d.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_h.c     | 153 +++++++++++++++++++++
 .../user/ase/msa/interleave/test_msa_ilvod_w.c     | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_b.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_d.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_h.c | 153 +++++++++++++++++++++
 .../mips/user/ase/msa/interleave/test_msa_ilvr_w.c | 153 +++++++++++++++++++++
 16 files changed, 2448 insertions(+)
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c
 create mode 100644 tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c
tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_b.c new file +153 -0
new file mode 100644
index 0000000..5cf8627
@@ -0,0 +1,153 @@
+/*
+ *  Test program for MSA instruction ILVEV.B
+ *
+ *  Copyright (C) 2018  Wave Computing, Inc.
+ *  Copyright (C) 2018  Aleksandar Markovic <[email protected]>
+ *
+ *  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
+ *  the Free Software Foundation, either version 2 of the License, or
+ *  (at your option) any later version.
+ *
+ *  This program is distributed in the hope that it will be useful,
+ *  but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *  GNU General Public License for more details.
+ *
+ *  You should have received a copy of the GNU General Public License
+ *  along with this program.  If not, see <https://www.gnu.org/licenses/>.
+ *
+ */
+
+#include <sys/time.h>
+#include <stdint.h>
+
+#include "../../../../include/wrappers_msa.h"
+#include "../../../../include/test_inputs.h"
+#include "../../../../include/test_utils.h"
+
+#define TEST_COUNT_TOTAL (                                                \
+            (PATTERN_INPUTS_SHORT_COUNT) * (PATTERN_INPUTS_SHORT_COUNT) + \
+            (RANDOM_INPUTS_SHORT_COUNT) * (RANDOM_INPUTS_SHORT_COUNT))
+
+
+int32_t main(void)
+{
+    char *instruction_name = "*ILVEV.B";
+    int32_t ret;
+    uint32_t i, j;
+    struct timeval start, end;
+    double elapsed_time;
+
+    uint64_t b128_result[TEST_COUNT_TOTAL][2];
+    uint64_t b128_expect[TEST_COUNT_TOTAL][2] = {
+        { 0xffffffffffffffffULL, 0xffffffffffffffffULL, },    /*   0  */
+        { 0xff00ff00ff00ff00ULL, 0xff00ff00ff00ff00ULL, },
+        { 0xffaaffaaffaaffaaULL, 0xffaaffaaffaaffaaULL, },
+        { 0xff55ff55ff55ff55ULL, 0xff55ff55ff55ff55ULL, },
+        { 0xffccffccffccffccULL, 0xffccffccffccffccULL, },
+        { 0xff33ff33ff33ff33ULL, 0xff33ff33ff33ff33ULL, },
+        { 0xff8effe3ff38ff8eULL, 0xffe3ff38ff8effe3ULL, },
+        { 0xff71ff1cffc7ff71ULL, 0xff1cffc7ff71ff1cULL, },
+        { 0x00ff00ff00ff00ffULL, 0x00ff00ff00ff00ffULL, },    /*   8  */
+        { 0x0000000000000000ULL, 0x0000000000000000ULL, },
+        { 0x00aa00aa00aa00aaULL, 0x00aa00aa00aa00aaULL, },
+        { 0x0055005500550055ULL, 0x0055005500550055ULL, },
+        { 0x00cc00cc00cc00ccULL, 0x00cc00cc00cc00ccULL, },
+        { 0x0033003300330033ULL, 0x0033003300330033ULL, },
+        { 0x008e00e30038008eULL, 0x00e30038008e00e3ULL, },
+        { 0x0071001c00c70071ULL, 0x001c00c70071001cULL, },
+        { 0xaaffaaffaaffaaffULL, 0xaaffaaffaaffaaffULL, },    /*  16  */
+        { 0xaa00aa00aa00aa00ULL, 0xaa00aa00aa00aa00ULL, },
+        { 0xaaaaaaaaaaaaaaaaULL, 0xaaaaaaaaaaaaaaaaULL, },
+        { 0xaa55aa55aa55aa55ULL, 0xaa55aa55aa55aa55ULL, },
+        { 0xaaccaaccaaccaaccULL, 0xaaccaaccaaccaaccULL, },
+        { 0xaa33aa33aa33aa33ULL, 0xaa33aa33aa33aa33ULL, },
+        { 0xaa8eaae3aa38aa8eULL, 0xaae3aa38aa8eaae3ULL, },
+        { 0xaa71aa1caac7aa71ULL, 0xaa1caac7aa71aa1cULL, },
+        { 0x55ff55ff55ff55ffULL, 0x55ff55ff55ff55ffULL, },    /*  24  */
+        { 0x5500550055005500ULL, 0x5500550055005500ULL, },
+        { 0x55aa55aa55aa55aaULL, 0x55aa55aa55aa55aaULL, },
+        { 0x5555555555555555ULL, 0x5555555555555555ULL, },
+        { 0x55cc55cc55cc55ccULL, 0x55cc55cc55cc55ccULL, },
+        { 0x5533553355335533ULL, 0x5533553355335533ULL, },
+        { 0x558e55e35538558eULL, 0x55e35538558e55e3ULL, },
+        { 0x5571551c55c75571ULL, 0x551c55c75571551cULL, },
+        { 0xccffccffccffccffULL, 0xccffccffccffccffULL, },    /*  32  */
+        { 0xcc00cc00cc00cc00ULL, 0xcc00cc00cc00cc00ULL, },
+        { 0xccaaccaaccaaccaaULL, 0xccaaccaaccaaccaaULL, },
+        { 0xcc55cc55cc55cc55ULL, 0xcc55cc55cc55cc55ULL, },
+        { 0xccccccccccccccccULL, 0xccccccccccccccccULL, },
+        { 0xcc33cc33cc33cc33ULL, 0xcc33cc33cc33cc33ULL, },
+        { 0xcc8ecce3cc38cc8eULL, 0xcce3cc38cc8ecce3ULL, },
+        { 0xcc71cc1cccc7cc71ULL, 0xcc1cccc7cc71cc1cULL, },
+        { 0x33ff33ff33ff33ffULL, 0x33ff33ff33ff33ffULL, },    /*  40  */
+        { 0x3300330033003300ULL, 0x3300330033003300ULL, },
+        { 0x33aa33aa33aa33aaULL, 0x33aa33aa33aa33aaULL, },
+        { 0x3355335533553355ULL, 0x3355335533553355ULL, },
+        { 0x33cc33cc33cc33ccULL, 0x33cc33cc33cc33ccULL, },
+        { 0x3333333333333333ULL, 0x3333333333333333ULL, },
+        { 0x338e33e33338338eULL, 0x33e33338338e33e3ULL, },
+        { 0x3371331c33c73371ULL, 0x331c33c73371331cULL, },
+        { 0x8effe3ff38ff8effULL, 0xe3ff38ff8effe3ffULL, },    /*  48  */
+        { 0x8e00e30038008e00ULL, 0xe30038008e00e300ULL, },
+        { 0x8eaae3aa38aa8eaaULL, 0xe3aa38aa8eaae3aaULL, },
+        { 0x8e55e35538558e55ULL, 0xe35538558e55e355ULL, },
+        { 0x8ecce3cc38cc8eccULL, 0xe3cc38cc8ecce3ccULL, },
+        { 0x8e33e33338338e33ULL, 0xe33338338e33e333ULL, },
+        { 0x8e8ee3e338388e8eULL, 0xe3e338388e8ee3e3ULL, },
+        { 0x8e71e31c38c78e71ULL, 0xe31c38c78e71e31cULL, },
+        { 0x71ff1cffc7ff71ffULL, 0x1cffc7ff71ff1cffULL, },    /*  56  */
+        { 0x71001c00c7007100ULL, 0x1c00c70071001c00ULL, },
+        { 0x71aa1caac7aa71aaULL, 0x1caac7aa71aa1caaULL, },
+        { 0x71551c55c7557155ULL, 0x1c55c75571551c55ULL, },
+        { 0x71cc1cccc7cc71ccULL, 0x1cccc7cc71cc1cccULL, },
+        { 0x71331c33c7337133ULL, 0x1c33c73371331c33ULL, },
+        { 0x718e1ce3c738718eULL, 0x1ce3c738718e1ce3ULL, },
+        { 0x71711c1cc7c77171ULL, 0x1c1cc7c771711c1cULL, },
+        { 0x6a6acccc62624040ULL, 0x67675e5e7b7b0c0cULL, },    /*  64  */
+        { 0x6abecc6362934008ULL, 0x67f75e1a7b3f0cfcULL, },
+        { 0x6a5accaa62cf4080ULL, 0x67d85eff7b2b0c14ULL, },
+        { 0x6a4fcc4d6231404eULL, 0x67f15ed87b420ca0ULL, },
+        { 0xbe6a63cc93620840ULL, 0xf7671a5e3f7bfc0cULL, },
+        { 0xbebe636393930808ULL, 0xf7f71a1a3f3ffcfcULL, },
+        { 0xbe5a63aa93cf0880ULL, 0xf7d81aff3f2bfc14ULL, },
+        { 0xbe4f634d9331084eULL, 0xf7f11ad83f42fca0ULL, },
+        { 0x5a6aaacccf628040ULL, 0xd867ff5e2b7b140cULL, },    /*  72  */
+        { 0x5abeaa63cf938008ULL, 0xd8f7ff1a2b3f14fcULL, },
+        { 0x5a5aaaaacfcf8080ULL, 0xd8d8ffff2b2b1414ULL, },
+        { 0x5a4faa4dcf31804eULL, 0xd8f1ffd82b4214a0ULL, },
+        { 0x4f6a4dcc31624e40ULL, 0xf167d85e427ba00cULL, },
+        { 0x4fbe4d6331934e08ULL, 0xf1f7d81a423fa0fcULL, },
+        { 0x4f5a4daa31cf4e80ULL, 0xf1d8d8ff422ba014ULL, },
+        { 0x4f4f4d4d31314e4eULL, 0xf1f1d8d84242a0a0ULL, },
+    };
+
+    gettimeofday(&start, NULL);
+
+    for (i = 0; i < PATTERN_INPUTS_SHORT_COUNT; i++) {
+        for (j = 0; j < PATTERN_INPUTS_SHORT_COUNT; j++) {
+            do_msa_ILVEV_B(b128_pattern[i], b128_pattern[j],
+                           b128_result[PATTERN_INPUTS_SHORT_COUNT * i + j]);
+        }
+    }
+
+    for (i = 0; i < RANDOM_INPUTS_SHORT_COUNT; i++) {
+        for (j = 0; j < RANDOM_INPUTS_SHORT_COUNT; j++) {
+            do_msa_ILVEV_B(b128_random[i], b128_random[j],
+                           b128_result[((PATTERN_INPUTS_SHORT_COUNT) *
+                                        (PATTERN_INPUTS_SHORT_COUNT)) +
+                                       RANDOM_INPUTS_SHORT_COUNT * i + j]);
+        }
+    }
+
+    gettimeofday(&end, NULL);
+
+    elapsed_time = (end.tv_sec - start.tv_sec) * 1000.0;
+    elapsed_time += (end.tv_usec - start.tv_usec) / 1000.0;
+
+    ret = check_results(instruction_name, TEST_COUNT_TOTAL, elapsed_time,
+                        &b128_result[0][0], &b128_expect[0][0]);
+
+    return ret;
+}
tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_d.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_h.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvev_w.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_b.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_d.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_h.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvl_w.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_b.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_d.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_h.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvod_w.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_b.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_d.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_h.c new file +153 -0

153 lines not on this page · raw message

tests/tcg/mips/user/ase/msa/interleave/test_msa_ilvr_w.c new file +153 -0

153 lines not on this page · raw message

Signature · 1 line
2.7.4
#16 lore raw
In reply to Aleksandar Markovic
Quoted 18 lines · Aleksandar Markovic

From: Aleksandar Markovic <[email protected]>

The following changes since commit 7e407466b1efbd65225cc72fe09c0c5ec79df75b:

Merge remote-tracking branch 'remotes/thibault/tags/samuel-thibault' into staging (2019-02-14 15:22:29 +0000)

are available in the git repository at:

https://github.com/AMarkovic/qemu tags/mips-queue-feb-14-2019

for you to fetch changes up to ba632924450faf6741d299f8feed8150a0c6f884:

tests/tcg: target/mips: Add tests for MSA logic instructions (2019-02-14 17:47:37 +0100)

----------------------------------------------------------------
MIPS queue for February 14th, 2019

Quoted 6 lines

- MTTCG support for MIPS
- The first part of MSA ASE tests

There are several checkpatch warnings that should be all ignored.

----------------------------------------------------------------

Applied, thanks.

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes. (I note that the "MIPS" section is currently quite empty-looking.)

-- PMM

#17 lore raw
Quoted 3 lines

Please update the changelog at https://wiki.qemu.org/ChangeLog/4.0
for any user-visible changes. (I note that the "MIPS" section is currently quite empty-looking.)

You are right, some items (that had already been integrated) were missing. I made the section more verbose, and hopefully there will be more items there by March 12th.

Just want to tell you that some of the MIPS changes since 3.1 are not visible to the end user (cleanups, tests, and some features that will be enabled/activated at some point in the future, but not before 4.0), so it looks more appropriate to me that they are not mentioned in the 4.0 release notes.

Regards,
Aleksandar