From patchwork Fri Dec 6 03:12:23 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 847825 Delivered-To: patch@linaro.org Received: by 2002:a5d:50c2:0:b0:385:e875:8a9e with SMTP id f2csp570154wrt; Thu, 5 Dec 2024 19:14:52 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVOf7sgpNvM+asQiOw3WDCwOVbm3lKw1rRsY0QVbZzVlyZFtZXUODEfklQ6C21/ndZycga0+Q==@linaro.org X-Google-Smtp-Source: AGHT+IE07G0jk2IWyEj2yiiNKKjpwj+HPn4WuiAthYIp4UBYC0nnmINeGOKUwcZvKoXS/+EfeaIL X-Received: by 2002:a05:6214:400b:b0:6d8:95c9:af2b with SMTP id 6a1803df08f44-6d8e71e8818mr23647996d6.35.1733454892449; Thu, 05 Dec 2024 19:14:52 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733454892; cv=none; d=google.com; s=arc-20240605; b=burx79bav9F/smhH+uaacJwooTK8uj9iXg6OsdAFNB2phS2aj1qFGd3TC1C/beMD/g zc7cwA1lArqGJWn3K9d129c4vCSxKVuWNGFMWGA/uoWAbOJpFSGnJJda02Xj8kNU4aqB JcO2GjJfYroSUvyl+C1TSGqCMGBjrp/c+jMygoX4DNlkcXB+/7Urg2NL9J5juo+6isto uTyV0m9DtSPTsvfj9Xy/bFmJ1UQM4A9IBkI+Nrl/ShAt8Op89XLx7m1xxptmRDANM4db 40ARgGw7QmRs2c3+n5X/EtHSJf6xBDJaXXYHZ3Mikc76MzdhU/oIMpbrrhwMtOMoxjHA 1JlQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=62EszHINza2JM6HaVWD1VL/L58D3HMklvqS2u19Wl5w=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=ffeTKJdoPm3TShqQWL6x19/nbXnscFKv6xNFQN1MjEBUP7j2cR809n2rRUnpwbwAfa pRa/qRwMMEw1nqdhlPHZ/kDmeZYdYnNGJgW6MB2SDIz4zc2DKvjBVESSxBcMGfQgPVL8 ThUZgV7rhyJChSSNC/rFJTu8oJP0Xj8ir/vlAv6YizYgeIgrzgUEW3F1nFRCOMdnApUH DLVjq2dTOxnZc06VWkEeAJlxu8P9GBlMQaVFwsDUy/v0WgvzqGFNYnCPLm/5zXJ1r42Q YcJNxsM2yy5mh3cN2zd48ikXROvK6Mselb/NjdkZp5bf95Vvl7WWq9pyD9oxRvyb0bSZ GIBQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S3flFjo+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6d8daa0851dsi32884726d6.237.2024.12.05.19.14.52 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 05 Dec 2024 19:14:52 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=S3flFjo+; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tJOlq-0006sH-3j; Thu, 05 Dec 2024 22:12:46 -0500 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 1tJOln-0006q3-BV for qemu-devel@nongnu.org; Thu, 05 Dec 2024 22:12:43 -0500 Received: from mail-oa1-x2f.google.com ([2001:4860:4864:20::2f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tJOll-0004Sv-Fq for qemu-devel@nongnu.org; Thu, 05 Dec 2024 22:12:43 -0500 Received: by mail-oa1-x2f.google.com with SMTP id 586e51a60fabf-2967af48248so926552fac.2 for ; Thu, 05 Dec 2024 19:12:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733454760; x=1734059560; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=62EszHINza2JM6HaVWD1VL/L58D3HMklvqS2u19Wl5w=; b=S3flFjo+6J7igjAM8dFhfiXkV3+9Y58KyZrEY06gski+AbBvcUKiw6tPYPtysyuNyT 50+D0M/QEcILDBuQeE8qCI8FxK13B6Po1MIt+3svg+c+m78uSkuT8y7w3WD5Q5khN1Fo CS2gna0Kk5qFECoLStcIXumheAN0AUg1kC+Q+LEGvLtZHlFa5Dzj5+S92m6p4eUTjlrn ejXUzkD2W+Y8aUActQ5qbBt0PHj82jVWq3E2pnSpkXLQWerFQYLpfBRI0eZln5tv1IDU OBwOKTxmVb6T5j9lTTlrRrM1p8+gxpeIWPxAY62SychNTm10rpzOTWXcX85yT3nenmrh VwEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733454760; x=1734059560; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=62EszHINza2JM6HaVWD1VL/L58D3HMklvqS2u19Wl5w=; b=B37LqxBh0U0o1b+nDPGawuupKBp0/uxHlhsiKKx4WFPHIrMr7eglhMU2kssLaCQ15a wRPHwR1VLF7U4ZjMrWd4DOJLlzdhQf3+QEyTik/1TbGCO0w3K9CsBKz9D/FNU6uLxap/ np/HbDm9KQSNFDnhABVJiN2s21/YKCgP0m0UmJnPGMQtB1LITRdoPCHtOh6ljqci8u1r Zao+6n4aU9hmX1XqmNWuKPt01N1ArN35Hv5s8o+0Y46q4cmvcff2dzGcJFCl8u3rVeew s9qChnF2FtM30K0wsRbJiVKHAbYxuEYec6AFWjxAVYHhX3H7xacWW0DIYqu9Re+yrNnP 6qKQ== X-Gm-Message-State: AOJu0YxfTbUyqtFOON+lTcQjqymUefsGlBXGNPG5HMYeEtWY9TqW/6zL O8nFJjho7d4wsp4Y5Qj5niyBHQR7prXJU6C9OUrvMGRefGaT4yO0LHleyIHPgDxKk8OmpfvK4gq ZmnmK4v19 X-Gm-Gg: ASbGncvYL0jc79kxRpvN9Xt35JeM74Of2rCnSp63iuC/SWLYuUxAOx17XGmCpTqz946 ZdQvXi7k6LU16oUCar+aj7v7VDCnwkrSunIs670lkIG9XSbhCl7tMBQoZAISctGa93GfVkXwRsM sDg9WWtXvkTsK3hbj0nSgcrTok4Y9flFKM+knBcaEBhzpA+RS7O5pWjbZG2Nrskns5X+EFoNOdi jWOWy5Z/bN+9tFKrCGMWM1gB4WEPAFtOkf+yqxuvEjv6hIInEDOk0MBILWyuIpz61Gv0o+vHj+3 SdgXkklge8UnqYPItt+CMTdemSW17M+aS34C X-Received: by 2002:a05:6871:9187:b0:296:dee4:771c with SMTP id 586e51a60fabf-29f738826eemr768935fac.33.1733454760134; Thu, 05 Dec 2024 19:12:40 -0800 (PST) Received: from localhost.localdomain (fixed-187-189-51-143.totalplay.net. [187.189.51.143]) by smtp.gmail.com with ESMTPSA id 46e09a7af769-71dc493b2dfsm596442a34.9.2024.12.05.19.12.39 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 05 Dec 2024 19:12:39 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH 8/9] target/arm: Convert vec_helper.c to use env alias Date: Thu, 5 Dec 2024 21:12:23 -0600 Message-ID: <20241206031224.78525-9-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241206031224.78525-1-richard.henderson@linaro.org> References: <20241206031224.78525-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2f; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2f.google.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, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Allow the helpers to receive CPUARMState* directly instead of via void*. Signed-off-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daudé --- target/arm/helper.h | 12 ++++++------ target/arm/tcg/helper-a64.h | 2 +- target/arm/tcg/vec_helper.c | 21 +++++++-------------- 3 files changed, 14 insertions(+), 21 deletions(-) diff --git a/target/arm/helper.h b/target/arm/helper.h index db8b8dc748..61b135a707 100644 --- a/target/arm/helper.h +++ b/target/arm/helper.h @@ -863,13 +863,13 @@ DEF_HELPER_FLAGS_5(gvec_suqadd_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_5(gvec_fmlal_a32, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_5(gvec_fmlal_a64, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_5(gvec_fmlal_idx_a32, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_5(gvec_fmlal_idx_a64, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_2(frint32_s, TCG_CALL_NO_RWG, f32, f32, fpst) DEF_HELPER_FLAGS_2(frint64_s, TCG_CALL_NO_RWG, f32, f32, fpst) @@ -1040,9 +1040,9 @@ DEF_HELPER_FLAGS_4(sve2_sqrdmulh_idx_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) DEF_HELPER_FLAGS_6(sve2_fmlal_zzzw_s, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_6(sve2_fmlal_zzxw_s, TCG_CALL_NO_RWG, - void, ptr, ptr, ptr, ptr, ptr, i32) + void, ptr, ptr, ptr, ptr, env, i32) DEF_HELPER_FLAGS_4(gvec_xar_d, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) diff --git a/target/arm/tcg/helper-a64.h b/target/arm/tcg/helper-a64.h index 4d70493914..26e327af3a 100644 --- a/target/arm/tcg/helper-a64.h +++ b/target/arm/tcg/helper-a64.h @@ -29,7 +29,7 @@ DEF_HELPER_3(vfp_cmps_a64, i64, f32, f32, fpst) DEF_HELPER_3(vfp_cmpes_a64, i64, f32, f32, fpst) DEF_HELPER_3(vfp_cmpd_a64, i64, f64, f64, fpst) DEF_HELPER_3(vfp_cmped_a64, i64, f64, f64, fpst) -DEF_HELPER_FLAGS_4(simd_tblx, TCG_CALL_NO_RWG, void, ptr, ptr, ptr, i32) +DEF_HELPER_FLAGS_4(simd_tblx, TCG_CALL_NO_RWG, void, ptr, ptr, env, i32) DEF_HELPER_FLAGS_3(vfp_mulxs, TCG_CALL_NO_RWG, f32, f32, f32, fpst) DEF_HELPER_FLAGS_3(vfp_mulxd, TCG_CALL_NO_RWG, f64, f64, f64, fpst) DEF_HELPER_FLAGS_3(neon_ceq_f64, TCG_CALL_NO_RWG, i64, i64, i64, fpst) diff --git a/target/arm/tcg/vec_helper.c b/target/arm/tcg/vec_helper.c index d2d9d5e829..e3083c6e84 100644 --- a/target/arm/tcg/vec_helper.c +++ b/target/arm/tcg/vec_helper.c @@ -2057,28 +2057,25 @@ static void do_fmlal(float32 *d, void *vn, void *vm, float_status *fpst, } void HELPER(gvec_fmlal_a32)(void *vd, void *vn, void *vm, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { - CPUARMState *env = venv; do_fmlal(vd, vn, vm, &env->vfp.standard_fp_status, desc, get_flush_inputs_to_zero(&env->vfp.fp_status_f16)); } void HELPER(gvec_fmlal_a64)(void *vd, void *vn, void *vm, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { - CPUARMState *env = venv; do_fmlal(vd, vn, vm, &env->vfp.fp_status, desc, get_flush_inputs_to_zero(&env->vfp.fp_status_f16)); } void HELPER(sve2_fmlal_zzzw_s)(void *vd, void *vn, void *vm, void *va, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { intptr_t i, oprsz = simd_oprsz(desc); uint16_t negn = extract32(desc, SIMD_DATA_SHIFT, 1) << 15; intptr_t sel = extract32(desc, SIMD_DATA_SHIFT + 1, 1) * sizeof(float16); - CPUARMState *env = venv; float_status *status = &env->vfp.fp_status; bool fz16 = get_flush_inputs_to_zero(&env->vfp.fp_status_f16); @@ -2122,29 +2119,26 @@ static void do_fmlal_idx(float32 *d, void *vn, void *vm, float_status *fpst, } void HELPER(gvec_fmlal_idx_a32)(void *vd, void *vn, void *vm, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { - CPUARMState *env = venv; do_fmlal_idx(vd, vn, vm, &env->vfp.standard_fp_status, desc, get_flush_inputs_to_zero(&env->vfp.fp_status_f16)); } void HELPER(gvec_fmlal_idx_a64)(void *vd, void *vn, void *vm, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { - CPUARMState *env = venv; do_fmlal_idx(vd, vn, vm, &env->vfp.fp_status, desc, get_flush_inputs_to_zero(&env->vfp.fp_status_f16)); } void HELPER(sve2_fmlal_zzxw_s)(void *vd, void *vn, void *vm, void *va, - void *venv, uint32_t desc) + CPUARMState *env, uint32_t desc) { intptr_t i, j, oprsz = simd_oprsz(desc); uint16_t negn = extract32(desc, SIMD_DATA_SHIFT, 1) << 15; intptr_t sel = extract32(desc, SIMD_DATA_SHIFT + 1, 1) * sizeof(float16); intptr_t idx = extract32(desc, SIMD_DATA_SHIFT + 2, 3) * sizeof(float16); - CPUARMState *env = venv; float_status *status = &env->vfp.fp_status; bool fz16 = get_flush_inputs_to_zero(&env->vfp.fp_status_f16); @@ -2562,10 +2556,9 @@ DO_VRINT_RMODE(gvec_vrint_rm_s, helper_rints, uint32_t) #undef DO_VRINT_RMODE #ifdef TARGET_AARCH64 -void HELPER(simd_tblx)(void *vd, void *vm, void *venv, uint32_t desc) +void HELPER(simd_tblx)(void *vd, void *vm, CPUARMState *env, uint32_t desc) { const uint8_t *indices = vm; - CPUARMState *env = venv; size_t oprsz = simd_oprsz(desc); uint32_t rn = extract32(desc, SIMD_DATA_SHIFT, 5); bool is_tbx = extract32(desc, SIMD_DATA_SHIFT + 5, 1);