From patchwork Mon May 27 00:49:36 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 799185 Delivered-To: patch@linaro.org Received: by 2002:a5d:6a47:0:b0:354:fb4b:99cd with SMTP id t7csp1657764wrw; Sun, 26 May 2024 17:51:09 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCUx3XLPaKpY9JNVQYaJb93jW9y8fT1Xr773xPjGyvD13CyJyK0nYpWvpeEr1MulplR9/MAWbvTZVJNN+qMDSHoA X-Google-Smtp-Source: AGHT+IEuztDz4DM5hbbcp5BbzYtPZ/2q7hpt9xi1ZQLjh7lvGeesyQLLIKwOhORXejb6GdrBRjzL X-Received: by 2002:a05:6214:4b04:b0:6a9:b253:58d5 with SMTP id 6a1803df08f44-6abbbcc0783mr95559866d6.17.1716771069296; Sun, 26 May 2024 17:51:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1716771069; cv=none; d=google.com; s=arc-20160816; b=ysAQSNdukaOfwCFDWth1+ZJ8KWZU+HWW2OYKxwlWCN7v3xjmxQT5OKdYvvZ80bUwrn gVynoumaoR3yGQnH3kwVFascT9rkTyfkNlfazD3Tx/ye0LRQFP+DSBpOfqHeE0QvmVIk MyIij3j90haNyyBbdPSa6VWhO5qA6kjxHYfOT+IqH0Sfuw4/pt2Ey8Y4aJPD+q7c0ijx 5SzDzvwwWlC19OVT5HvW82L1GN9+7t7ixHyAccWatoDwnHgDkWwe396FrD4rNoSbj+8l WqiVwVKZ66TxkgXsAJmxzsrOt6lme3/dwyyUrTK10bdgO+0Til7UpfoHK/rraIRAIrW2 4Mbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; 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=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; fh=OTkfrEnbNDInppsfj4HB8z6V33zCj7LOct256XBfW6M=; b=jrx6wn5jem8/w+bEdaY2pKSjPFBX9QYZMGW0o6fKfH4Y3HqRpQ0koQhWwcJGddTr6Y XMRvBb+ipd6Uiy4ACON9qxcRsMzoRN/M69yUPsHybXRYO2goH9/gA1DAEEM4oamKwkhw hyhTokZdcEw2Hfm+zPvy1E556w5UCPqPlZ8GnOQeRKFJdlTMI8aED2NsQk7RyC3mt9G4 dbLkKpKW/DdgZ10s1LCeHVMXNhQkZu1EKE5tDFV4YzHZCAtcnrxl2GOMSMaRV5iE4EVr sr0UCw+NaALgQqiXDQXaM0WaigSMrenLqpSOyhM8zgNPjLTf5nxR28EzGoJQusOok2GG qesg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=X0BMB9D1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6ac10d75bd3si69569336d6.331.2024.05.26.17.51.09 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sun, 26 May 2024 17:51:09 -0700 (PDT) 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=fail header.i=@linaro.org header.s=google header.b=X0BMB9D1; 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=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1sBOZI-0007AR-Je; Sun, 26 May 2024 20:50:29 -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 1sBOZ0-00072Y-RL for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:12 -0400 Received: from mail-oa1-x2d.google.com ([2001:4860:4864:20::2d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sBOYw-0003Zm-7J for qemu-devel@nongnu.org; Sun, 26 May 2024 20:50:07 -0400 Received: by mail-oa1-x2d.google.com with SMTP id 586e51a60fabf-24ca21014ccso1196415fac.1 for ; Sun, 26 May 2024 17:50:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1716771005; x=1717375805; 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=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; b=X0BMB9D1sPZEruKCW9zHr6aE4QBObc7JhVwqIk5JeuQy33QQ7lhThjgSenfmGb52ll yqQLSL8LB116aoduKIsynKNd1szYIs0NHSKtlIJfIy3hcWBZF2+GRlbh6Ch+X3MUJYt7 yRUsqui3DLIgZKGb9fx7P/OyA6ev2THQQaJvsX3dIklf8VGYTiPfiUK6rzQQFCl4QZhX 2t5P8Tec9FL/yVqojFYYa+owqOKh/k6BzFkYP+YMr6dW19pj8gsdbSD77QcJzshUb7S9 XOXrjr3uxWmqaftXrQF9yyu2A0PfMXHNT+lJ3rAoZITpuwFE9rc4eI3+kIWxXrftr9gr oFgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1716771005; x=1717375805; 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=65Gkdr7ftr6lyKPmfr51rDrQ5Maa9PeaHdOx7rkPnQ4=; b=taPrVXSsq0xUrx4nVvVzMzl72DWkX7xao2p2WaPyClzJ0KUnhankRtWaCyEecNWQgw VAEHsUJjTnp19RbFeRlU76hxyiyJA2fe7dUpRBnXZrrQwQGTpOjD1cYvE5QBR301eDt+ hkpt2oJ0T6+/JRQnGVxaEFOu1RA0ZWeR5nL8rjDZxIO2TDKpxOsfCRVHeJSLZzN+RBhx 0VUo0FBJK+O/czp5iSEsYD//aADu9SDyc5Y3PgD5tKc6o5KRKz7JPxIL5FXVvfFhOqVY icfdHwUAOCxPc/R3z2mIBZw1txhGctnkKUO8mHdZm0dZnPf6dc1bdfhKO7KAA2TikbGK xqJA== X-Gm-Message-State: AOJu0YypHHJ8q3Gb7yJNRQfs1a2DCRaA1eud9BJlNmxagAPudJf7NVHm 2yp6WZGUBeANxe5iEKl4xEfnPCRcOObiMm2KE0yauSeuHZewkVktfNFcDbWizOPyK7Shq5Y0OD8 z X-Received: by 2002:a05:6871:5222:b0:24f:ea59:4e3d with SMTP id 586e51a60fabf-24fea596470mr2981296fac.43.1716771004822; Sun, 26 May 2024 17:50:04 -0700 (PDT) Received: from stoup.. (174-21-72-5.tukw.qwest.net. [174.21.72.5]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-6f8fd6d7598sm3942958b3a.220.2024.05.26.17.50.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 26 May 2024 17:50:04 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: Paolo Bonzini Subject: [PULL 03/28] target/i386: Convert helper_{fbld, fbst}_ST0 to X86Access Date: Sun, 26 May 2024 17:49:36 -0700 Message-Id: <20240527005001.642825-4-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20240527005001.642825-1-richard.henderson@linaro.org> References: <20240527005001.642825-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2001:4860:4864:20::2d; envelope-from=richard.henderson@linaro.org; helo=mail-oa1-x2d.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, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham 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 Reviewed-by: Paolo Bonzini Signed-off-by: Richard Henderson --- target/i386/tcg/fpu_helper.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/target/i386/tcg/fpu_helper.c b/target/i386/tcg/fpu_helper.c index 1662643a8f..6237cd8383 100644 --- a/target/i386/tcg/fpu_helper.c +++ b/target/i386/tcg/fpu_helper.c @@ -773,18 +773,21 @@ void helper_fninit(CPUX86State *env) void helper_fbld_ST0(CPUX86State *env, target_ulong ptr) { + X86Access ac; floatx80 tmp; uint64_t val; unsigned int v; int i; + access_prepare(&ac, env, ptr, 10, MMU_DATA_LOAD, GETPC()); + val = 0; for (i = 8; i >= 0; i--) { - v = cpu_ldub_data_ra(env, ptr + i, GETPC()); + v = access_ldb(&ac, ptr + i); val = (val * 100) + ((v >> 4) * 10) + (v & 0xf); } tmp = int64_to_floatx80(val, &env->fp_status); - if (cpu_ldub_data_ra(env, ptr + 9, GETPC()) & 0x80) { + if (access_ldb(&ac, ptr + 9) & 0x80) { tmp = floatx80_chs(tmp); } fpush(env); @@ -798,7 +801,9 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) target_ulong mem_ref, mem_end; int64_t val; CPU_LDoubleU temp; + X86Access ac; + access_prepare(&ac, env, ptr, 10, MMU_DATA_STORE, GETPC()); temp.d = ST0; val = floatx80_to_int64(ST0, &env->fp_status); @@ -806,20 +811,20 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) if (val >= 1000000000000000000LL || val <= -1000000000000000000LL) { set_float_exception_flags(float_flag_invalid, &env->fp_status); while (mem_ref < ptr + 7) { - cpu_stb_data_ra(env, mem_ref++, 0, GETPC()); + access_stb(&ac, mem_ref++, 0); } - cpu_stb_data_ra(env, mem_ref++, 0xc0, GETPC()); - cpu_stb_data_ra(env, mem_ref++, 0xff, GETPC()); - cpu_stb_data_ra(env, mem_ref++, 0xff, GETPC()); + access_stb(&ac, mem_ref++, 0xc0); + access_stb(&ac, mem_ref++, 0xff); + access_stb(&ac, mem_ref++, 0xff); merge_exception_flags(env, old_flags); return; } mem_end = mem_ref + 9; if (SIGND(temp)) { - cpu_stb_data_ra(env, mem_end, 0x80, GETPC()); + access_stb(&ac, mem_end, 0x80); val = -val; } else { - cpu_stb_data_ra(env, mem_end, 0x00, GETPC()); + access_stb(&ac, mem_end, 0x00); } while (mem_ref < mem_end) { if (val == 0) { @@ -828,10 +833,10 @@ void helper_fbst_ST0(CPUX86State *env, target_ulong ptr) v = val % 100; val = val / 100; v = ((v / 10) << 4) | (v % 10); - cpu_stb_data_ra(env, mem_ref++, v, GETPC()); + access_stb(&ac, mem_ref++, v); } while (mem_ref < mem_end) { - cpu_stb_data_ra(env, mem_ref++, 0, GETPC()); + access_stb(&ac, mem_ref++, 0); } merge_exception_flags(env, old_flags); }