From nobody Sun Nov 9 20:19:36 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 155180949598895.60832327955552; Tue, 5 Mar 2019 10:11:35 -0800 (PST) Received: from localhost ([127.0.0.1]:47174 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1EXM-0004lB-VS for importer@patchew.org; Tue, 05 Mar 2019 13:11:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:46989) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1ESj-0001Ac-PH for qemu-devel@nongnu.org; Tue, 05 Mar 2019 13:06:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1ESi-00029N-3X for qemu-devel@nongnu.org; Tue, 05 Mar 2019 13:06:45 -0500 Received: from mx2.rt-rk.com ([89.216.37.149]:51687 helo=mail.rt-rk.com) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1h1ESh-00027Q-Nt for qemu-devel@nongnu.org; Tue, 05 Mar 2019 13:06:43 -0500 Received: from localhost (localhost [127.0.0.1]) by mail.rt-rk.com (Postfix) with ESMTP id BFE4F1A209C; Tue, 5 Mar 2019 19:05:37 +0100 (CET) Received: from rtrkw774-lin.domain.local (rtrkw774-lin.domain.local [10.10.13.43]) by mail.rt-rk.com (Postfix) with ESMTPSA id 71D131A20D2; Tue, 5 Mar 2019 19:05:37 +0100 (CET) X-Virus-Scanned: amavisd-new at rt-rk.com From: Aleksandar Markovic To: qemu-devel@nongnu.org Date: Tue, 5 Mar 2019 19:05:18 +0100 Message-Id: <1551809127-3658-7-git-send-email-aleksandar.markovic@rt-rk.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1551809127-3658-1-git-send-email-aleksandar.markovic@rt-rk.com> References: <1551809127-3658-1-git-send-email-aleksandar.markovic@rt-rk.com> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 89.216.37.149 Subject: [Qemu-devel] [PULL 06/15] tests/tcg: target/mips: Fix test utilities for 128-bit tests X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, amarkovic@wavecomp.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" From: Aleksandar Markovic Add "static" and "const" modifiers where appropriate, and fix other minor issues. Signed-off-by: Aleksandar Markovic Reviewed-by: Aleksandar Rikalo Message-Id: <1551800076-8104-7-git-send-email-aleksandar.markovic@rt-rk.com> --- tests/tcg/mips/include/test_inputs.h | 4 ++-- tests/tcg/mips/include/test_utils.h | 15 ++++++++------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/tests/tcg/mips/include/test_inputs.h b/tests/tcg/mips/include/= test_inputs.h index c173d58..5406e4e 100644 --- a/tests/tcg/mips/include/test_inputs.h +++ b/tests/tcg/mips/include/test_inputs.h @@ -28,7 +28,7 @@ #define PATTERN_INPUTS_COUNT 64 #define PATTERN_INPUTS_SHORT_COUNT 8 =20 -uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] =3D { +static const uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] =3D { { 0xFFFFFFFFFFFFFFFFULL, 0xFFFFFFFFFFFFFFFFULL, }, /* 0 */ { 0x0000000000000000ULL, 0x0000000000000000ULL, }, { 0xAAAAAAAAAAAAAAAAULL, 0xAAAAAAAAAAAAAAAAULL, }, @@ -99,7 +99,7 @@ uint64_t b128_pattern[PATTERN_INPUTS_COUNT][2] =3D { #define RANDOM_INPUTS_COUNT 16 #define RANDOM_INPUTS_SHORT_COUNT 4 =20 -uint64_t b128_random[RANDOM_INPUTS_COUNT][2] =3D { +static const uint64_t b128_random[RANDOM_INPUTS_COUNT][2] =3D { { 0x886AE6CC28625540ULL, 0x4B670B5EFE7BB00CULL, }, /* 0 */ { 0xFBBE00634D93C708ULL, 0x12F7BB1A153F52FCULL, }, { 0xAC5AAEAAB9CF8B80ULL, 0x27D8C6FFAB2B2514ULL, }, diff --git a/tests/tcg/mips/include/test_utils.h b/tests/tcg/mips/include/t= est_utils.h index 82f4b5b..9672903 100644 --- a/tests/tcg/mips/include/test_utils.h +++ b/tests/tcg/mips/include/test_utils.h @@ -27,14 +27,14 @@ #include #include =20 -#define PRINT_RESULTS 1 +#define PRINT_RESULTS 0 =20 =20 -static inline int32_t check_results(char *instruction_name, - uint32_t test_count, - double elapsed_time, - uint64_t *b128_result, - uint64_t *b128_expect) +static inline int32_t check_results(const char *instruction_name, + const uint32_t test_count, + const double elapsed_time, + const uint64_t *b128_result, + const uint64_t *b128_expect) { #if PRINT_RESULTS uint32_t ii; @@ -58,7 +58,8 @@ static inline int32_t check_results(char *instruction_nam= e, =20 printf("%s: ", instruction_name); for (i =3D 0; i < test_count; i++) { - if (b128_result[i] =3D=3D b128_expect[i]) { + if ((b128_result[2 * i] =3D=3D b128_expect[2 * i]) && + (b128_result[2 * i + 1] =3D=3D b128_expect[2 * i + 1])) { pass_count++; } else { fail_count++; --=20 2.7.4