From patchwork Fri Sep 27 11:59:41 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Aleksandar Rakic X-Patchwork-Id: 13814301 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6DEE5CDD1AE for ; Fri, 27 Sep 2024 13:27:35 +0000 (UTC) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1suAz5-00050o-Gg; Fri, 27 Sep 2024 09:26:11 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su9dT-0001EY-MS for qemu-devel@nongnu.org; Fri, 27 Sep 2024 07:59:47 -0400 Received: from mail-am6eur05on20723.outbound.protection.outlook.com ([2a01:111:f403:2612::723] helo=EUR05-AM6-obe.outbound.protection.outlook.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1su9dR-0007XA-K4 for qemu-devel@nongnu.org; Fri, 27 Sep 2024 07:59:47 -0400 ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=X61IzleMkYObWWNDsO7a6ECi9wsC1ECunfi7kGMtNHmNUzYvFfayWS6GUmyL8AeaWDKFGN2Ej8PwZ9GnAJEvwnABd5c6KJGegBLoeBv5lgfMFC/91aO7vO9NhN/rDAmRWuF7pBXfeLV9ZtwBwH9FGD4p73RqgFfDUbVMNjrYYz+6kDe+pnYen3rCMf/nmANRfr2UpLfU/R/8LBhq63uYmBIRRtKQjZWckLzEdYK5cnEW3NrJHGyfq5FjUkYQ0kBtfSrON8Tw2/Kx2oZBDv5tRqNZ5ZPKuvC5BmYUQq/VA3kqkcQgy7LkgL6wWffxE1tHMvv0lN53LGSxQnMtAqesGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=1Unt3jiBSp6zmou9tYNFC9JLAgT0afKjmcwM9wMXElI=; b=pDTCBaLLz6+Z4UhyRfmRhbI5wiAy9gfMnl0HAbLpmGaw3jFm3nUlFfFzjQJF9iVpyibL8kTc1ozRMQ6eKKC5ooU+0HJkOeZ388+r2a8wFmIKFvCh0xBzKlLW3h6uRoIdzCqkLhjVb8p+6pr5evnPl5kfBaVdgZSSWX0Yeq+ngmyj3ys3p81bLdTCDcY10hV4kjHSAoj2BTVonoaIgE9Bug65mGAwKlUcb5uymsfCC/7fxJhHCfV8w+4kmQh176+oMIs2DswCmJZ7qxRfnduTv0m/4NN4h6Vg2QsdYzQ8p01VmcCrjqFKPU24q6lSJSKXbwi6foUxQ51itSZ7RlOeaA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=htecgroup.com; dmarc=pass action=none header.from=htecgroup.com; dkim=pass header.d=htecgroup.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=htecgroup.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=1Unt3jiBSp6zmou9tYNFC9JLAgT0afKjmcwM9wMXElI=; b=nFale9nupcSsf5hhftZ6AeAFg5Gnv6xAjNVcAEY38FMdn8Z3btWDoSwYV8+ydolYU7VNkt/UZ92AVmLpNthTG7aZuGK613jPhojLbmGrZl0nrlB4UPO1nanOzpkxgxVm2fEdwk66aSD2GiDXsWRQ/e2yGtn4AjsdnN8seR48yqD9UJByEKHhKpG1CTg/wu2x72uD0dMR3qYe6trPno8ohSa+8edHc4raId2Zdxh2liRDnF3W6FgUKlVGnqeBQ1xYAS1K5SQEkeuMQnkOlsGjW4hblM0tg6mAHC68GwRh7ilcaUhkU+PHcsvNa/Axnh9BybwcUaekdvMWHcp9mA+qLg== Received: from PA4PR09MB4864.eurprd09.prod.outlook.com (2603:10a6:102:ed::17) by GVXPR09MB7199.eurprd09.prod.outlook.com (2603:10a6:150:1b8::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8005.22; Fri, 27 Sep 2024 11:59:42 +0000 Received: from PA4PR09MB4864.eurprd09.prod.outlook.com ([fe80::a02b:9d5c:eca5:e024]) by PA4PR09MB4864.eurprd09.prod.outlook.com ([fe80::a02b:9d5c:eca5:e024%7]) with mapi id 15.20.8005.021; Fri, 27 Sep 2024 11:59:42 +0000 From: Aleksandar Rakic To: "qemu-devel@nongnu.org" CC: Djordje Todorovic , "cfu@mips.com" Subject: [PATCH 2/8] Add support for emulation of CRC32 instructions Thread-Topic: [PATCH 2/8] Add support for emulation of CRC32 instructions Thread-Index: AQHbENO8SiRZltEFZkyzEoUZw7ShBQ== Date: Fri, 27 Sep 2024 11:59:41 +0000 Message-ID: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: msip_labels: authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=htecgroup.com; x-ms-publictraffictype: Email x-ms-traffictypediagnostic: PA4PR09MB4864:EE_|GVXPR09MB7199:EE_ x-ms-office365-filtering-correlation-id: a8c1d4f0-a61a-4838-54f3-08dcdeebdf01 x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; ARA:13230040|376014|1800799024|366016|38070700018; x-microsoft-antispam-message-info: =?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2ae4ktYQPwqX?= =?iso-8859-1?q?14ZmSfU7jzk9oZnPn5jnkggQs07Sf2LoC4M9j8alKnERaky9u/ysWLOgKBVP?= =?iso-8859-1?q?OPMtH7hGCqIqHH0+/EO7x+/tN/Qad5U8jO4UqwMOiidrpIfZeCDjJ7dG3VDl?= =?iso-8859-1?q?vxN7jlB60gLS0V+3+QcmDPCizaOJIRXNXf6Davhh5h3/BNX7gwbSCZycTRx9?= =?iso-8859-1?q?c0yCUet1UNBjDYKf7CJOaJ+4ZFbZAWCUF0no5RX63RYdFNobW0wm/vtkaBwu?= =?iso-8859-1?q?F+SIgrGbJ6D69xyPPpGVvN8mrDBO/vnxOToZRwqKK7uKv7qO8fuj03cT+LtU?= =?iso-8859-1?q?WOviX8oIv12R7alD17rj8bKyc0vLT1fAv+4mOALTDI4qGXKQrdkstyemdlRR?= =?iso-8859-1?q?YVG6du+GPlEo98oQhkhSflj/SZCAa0ze0CVQshp+RN/2y6DqOwv1YfTuQtX9?= =?iso-8859-1?q?5FrgVMfKsfnDX+QsNQjX+8xgcG0+KRp8p367elNXLWFdHSQIWI+5JfcV8C8Q?= =?iso-8859-1?q?0ROl5DxxLOpANOVBXk/v6UXmuKxZVWD8c9Hipa1d7y8JxyVjoTr2p4Yo65RW?= =?iso-8859-1?q?+C33jCjD7FRecBcAVasnt7nA=3D=3D?= x-forefront-antispam-report: CIP:255.255.255.255; CTRY:; LANG:en; SCL:1; SRV:; IPV:NLI; SFV:NSPM; H:PA4PR09MB4864.eurprd09.prod.outlook.com; PTR:; CAT:NONE; SFS:(13230040)(376014)(1800799024)(366016)(38070700018); DIR:OUT; SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?iso-8859-1?q?paBkFnoi+XyzdhrZ/4o2p0J?= =?iso-8859-1?q?bamxJLMX+prYsTtdWp6eDnhZHaStJKCa5Pqn/jSkJsewqCFjQIlb+T626Hao?= =?iso-8859-1?q?FMrCAKJ+oltX7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r5VkMtuPST2Qza1UPxyvBrKl3y?= =?iso-8859-1?q?J/mTNdhL7tjurn0faxpEDOi11X5DF9u1aNEsdYx6KliCkps8hmFjh2VVG/He?= =?iso-8859-1?q?Y2aj0NigsiyYscJbdcBGUj0QjJAkIEdOE3giKVr6X5BBQblMB7eq1Y3epGBz?= =?iso-8859-1?q?p4wJw+48+cGX0+/ZLK5CElAKdCdassfcBPPMIGqbEewBV+JXpe+s/UV1KfnJ?= =?iso-8859-1?q?7eQQqsxB/Bl3SFWNT7rzpDZoZMc63EfFg9csCyMgh7v1CiKvGeIsBaal6igs?= =?iso-8859-1?q?LPzofOG15fm6DnXqDbAgzu9Su4pfF3w0QDMgMI5z9KgtEPfPWVNxDPkzrSiU?= =?iso-8859-1?q?10HKg+G7aHXLXXm/Z9X7dqZ0V/bKDK7yXhQF6QacowrxmbWWt2zHh2iQixG7?= =?iso-8859-1?q?ArQzgVhBuAcxZqrErTxXGevz1rkOBBr/jN2JMjoTL/deIFOD+DUB4X9fsndT?= =?iso-8859-1?q?n63flX7Sn9dkXwrgmfH2DvO8Ws6g667FjkjnC/rmW6+XzhTK4sC/CphlWdxK?= =?iso-8859-1?q?5RdOfsZBR1OY+m3cz5BihL1jemzCdMqZu8Ov0gqQ7mgHGHZ1r6zpB6ekXOLF?= =?iso-8859-1?q?3LEBsYuj7zXPnm0uNwJlnIP3/icmnoyfKE5lHCZ8qyt4+LN+GfmrV/cnAJ4x?= =?iso-8859-1?q?/qczJIkcSORMZcx4qQc58mEVGyaNEY4AK4EsVfA=3D=3D?= MIME-Version: 1.0 X-OriginatorOrg: htecgroup.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: PA4PR09MB4864.eurprd09.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: a8c1d4f0-a61a-4838-54f3-08dcdeebdf01 X-MS-Exchange-CrossTenant-originalarrivaltime: 27 Sep 2024 11:59:41.9592 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 9f85665b-7efd-4776-9dfe-b6bfda2565ee X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: 9uBFCLEZhygZJCIXAIIkTipyTIGsFaYtrtr1EF8z8ThYBZG8Yc6R4L68XUJrKUbRgc2Y1Fbdj7qRsqxWWuJ62aECyvKKGpAWwGwLinhwGG0= X-MS-Exchange-Transport-CrossTenantHeadersStamped: GVXPR09MB7199 Received-SPF: pass client-ip=2a01:111:f403:2612::723; envelope-from=aleksandar.rakic@htecgroup.com; helo=EUR05-AM6-obe.outbound.protection.outlook.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, SPF_HELO_PASS=-0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Fri, 27 Sep 2024 09:25:47 -0400 X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Add emulation of MIPS' CRC32 (Cyclic Redundancy Check) instructions. Reuse zlib crc32() and Linux crc32c(). Cherry-picked 4cc974938aee1588f852590509004e340c072940 from https://github.com/MIPS/gnutools-qemu Signed-off-by: Yongbok Kim Signed-off-by: Aleksandar Markovic Signed-off-by: Aleksandar Rakic --- target/mips/helper.h | 2 ++ target/mips/meson.build | 1 + target/mips/tcg/op_helper.c | 26 ++++++++++++++++++++++++++ target/mips/tcg/translate.c | 37 +++++++++++++++++++++++++++++++++++++ target/mips/tcg/translate.h | 1 + 5 files changed, 67 insertions(+) diff --git a/target/mips/helper.h b/target/mips/helper.h index 0f8462febb..752748d5e6 100644 --- a/target/mips/helper.h +++ b/target/mips/helper.h @@ -21,6 +21,8 @@ DEF_HELPER_FLAGS_1(bitswap, TCG_CALL_NO_RWG_SE, tl, tl) DEF_HELPER_FLAGS_1(dbitswap, TCG_CALL_NO_RWG_SE, tl, tl) #endif +DEF_HELPER_3(crc32, tl, tl, tl, i32) +DEF_HELPER_3(crc32c, tl, tl, tl, i32) DEF_HELPER_FLAGS_4(rotx, TCG_CALL_NO_RWG_SE, tl, tl, i32, i32, i32) /* microMIPS functions */ diff --git a/target/mips/meson.build b/target/mips/meson.build index a26d1e1f79..d2d686fc0c 100644 --- a/target/mips/meson.build +++ b/target/mips/meson.build @@ -7,6 +7,7 @@ mips_ss.add(files( 'gdbstub.c', 'msa.c', )) +mips_ss.add(zlib) if have_system subdir('sysemu') diff --git a/target/mips/tcg/op_helper.c b/target/mips/tcg/op_helper.c index 65403f1a87..22600697f0 100644 --- a/target/mips/tcg/op_helper.c +++ b/target/mips/tcg/op_helper.c @@ -25,6 +25,8 @@ #include "exec/exec-all.h" #include "exec/memop.h" #include "fpu_helper.h" +#include "qemu/crc32c.h" +#include static inline target_ulong bitswap(target_ulong v) { @@ -143,6 +145,30 @@ target_ulong helper_rotx(target_ulong rs, uint32_t shift, uint32_t shiftx, return (int64_t)(int32_t)(uint32_t)tmp5; } +/* these crc32 functions are based on target/arm/helper-a64.c */ +target_ulong helper_crc32(target_ulong val, target_ulong m, uint32_t sz) +{ + uint8_t buf[8]; + target_ulong mask = ((sz * 8) == 64) ? + (target_ulong) -1ULL : + ((1ULL << (sz * 8)) - 1); + + m &= mask; + stq_le_p(buf, m); + return (int32_t) (crc32(val ^ 0xffffffff, buf, sz) ^ 0xffffffff); +} + +target_ulong helper_crc32c(target_ulong val, target_ulong m, uint32_t sz) +{ + uint8_t buf[8]; + target_ulong mask = ((sz * 8) == 64) ? + (target_ulong) -1ULL : + ((1ULL << (sz * 8)) - 1); + m &= mask; + stq_le_p(buf, m); + return (int32_t) (crc32c(val, buf, sz) ^ 0xffffffff); +} + void helper_fork(target_ulong arg1, target_ulong arg2) { /* diff --git a/target/mips/tcg/translate.c b/target/mips/tcg/translate.c index 333469b268..256fa0893e 100644 --- a/target/mips/tcg/translate.c +++ b/target/mips/tcg/translate.c @@ -430,6 +430,7 @@ enum { OPC_LWE = 0x2F | OPC_SPECIAL3, /* R6 */ + OPC_CRC32 = 0x0F | OPC_SPECIAL3, R6_OPC_PREF = 0x35 | OPC_SPECIAL3, R6_OPC_CACHE = 0x25 | OPC_SPECIAL3, R6_OPC_LL = 0x36 | OPC_SPECIAL3, @@ -13691,6 +13692,30 @@ static void decode_opc_special2_legacy(CPUMIPSState *env, DisasContext *ctx) } } +static void gen_crc32(DisasContext *ctx, int rd, int rs, int rt, int sz, + int crc32c) +{ + TCGv t0; + TCGv t1; + TCGv_i32 tsz = tcg_constant_i32(1 << sz); + if (rd == 0) { + /* Treat as NOP. */ + return; + } + t0 = tcg_temp_new(); + t1 = tcg_temp_new(); + + gen_load_gpr(t0, rt); + gen_load_gpr(t1, rs); + + if (crc32c) { + gen_helper_crc32c(cpu_gpr[rd], t0, t1, tsz); + } else { + gen_helper_crc32(cpu_gpr[rd], t0, t1, tsz); + } + +} + static void decode_opc_special3_r6(CPUMIPSState *env, DisasContext *ctx) { int rs, rt, rd, sa; @@ -13705,6 +13730,17 @@ static void decode_opc_special3_r6(CPUMIPSState *env, DisasContext *ctx) op1 = MASK_SPECIAL3(ctx->opcode); switch (op1) { + case OPC_CRC32: + if (unlikely(!ctx->crcp) || + unlikely((extract32(ctx->opcode, 6, 2) == 3) && + (!(ctx->hflags & MIPS_HFLAG_64))) || + unlikely((extract32(ctx->opcode, 8, 3) >= 2))) { + gen_reserved_instruction(ctx); + } + gen_crc32(ctx, rt, rs, rt, + extract32(ctx->opcode, 6, 2), + extract32(ctx->opcode, 8, 3)); + break; case R6_OPC_PREF: if (rt >= 24) { /* hint codes 24-31 are reserved and signal RI */ @@ -15346,6 +15382,7 @@ static void mips_tr_init_disas_context(DisasContextBase *dcbase, CPUState *cs) ctx->abs2008 = (env->active_fpu.fcr31 >> FCR31_ABS2008) & 1; ctx->mi = (env->CP0_Config5 >> CP0C5_MI) & 1; ctx->gi = (env->CP0_Config5 >> CP0C5_GI) & 3; + ctx->crcp = (env->CP0_Config5 >> CP0C5_CRCP) & 1; restore_cpu_state(env, ctx); #ifdef CONFIG_USER_ONLY ctx->mem_idx = MIPS_HFLAG_UM; diff --git a/target/mips/tcg/translate.h b/target/mips/tcg/translate.h index 2b6646b339..ce2c1da6f4 100644 --- a/target/mips/tcg/translate.h +++ b/target/mips/tcg/translate.h @@ -51,6 +51,7 @@ typedef struct DisasContext { bool abs2008; bool mi; int gi; + bool crcp; } DisasContext; #define DISAS_STOP DISAS_TARGET_0