From patchwork Mon Sep 9 17:28:02 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 826619 Delivered-To: patch@linaro.org Received: by 2002:adf:a345:0:b0:367:895a:4699 with SMTP id d5csp2129705wrb; Mon, 9 Sep 2024 10:28:55 -0700 (PDT) X-Forwarded-Encrypted: i=2; AJvYcCXjAMoByf+AH/NMwGcGLFQ7OmO1cln0nGdCu55Kfm1oaqomzQOyF4AkqcX2m70LsrUL8KQfxg==@linaro.org X-Google-Smtp-Source: AGHT+IFVqDgDirt++o6z/6uJ9F7WO2e6INGcSpfwsKFAhLLycsyN3cMber0nt6JACRFA9Y9nXRWh X-Received: by 2002:a05:6214:5544:b0:6c3:62bc:5dd8 with SMTP id 6a1803df08f44-6c528500482mr177305226d6.27.1725902935598; Mon, 09 Sep 2024 10:28:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1725902935; cv=none; d=google.com; s=arc-20240605; b=jPnkqpEfHzox8cqNMzrKKz9+V/lIYXSPiWoZ5Z78xOE8J+OA54UqiiQ/j+TtzLIkuE exm5+smw7grAlYiXB0GzNbHR7sW+u+PKu/OUcCHXt/2hkMrgyr0cTohfmxzit/Wegpdt s0cly7/2T9bfZHaTAPldSqgJq05FkTOGv3b8lih5u8XQW3E42oCUvCVkBoeQjWYcEDe7 9kEAyViBlPi/lE2QgHUUPFRykndSUlqdrqQYwQcscZzSxHCO9s0f+VH1qpT3zQXEn0sf J2UCZO/BHdb2p7TspKkFJ7g1hrd1KFP95+rCmSOLzhjKsfWRY7Ds4G430vseBQSca7ai yODg== 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=0PKG5YPQcXKyDHlspbxmEdeyLcXXv/kd5HUMAwRWwDA=; fh=4bMsMJJHDmTQNFavmZaD/iTPOPK/LdH9YFdHoY+StpE=; b=T3/0mZsclv2/mzZofHNrrUk7MWwyniv/KuKVRNdgfYuXO8TEgcLsVp6u560pi/GPSP RoU/TZJVy6sSrt3hVAJKFYU8oYXs0ZQIc8k6jJLRmeHYegrvDBReWpYyxT1GqMrPy7jG SPm01odTohrZq8eOQGx3omWU1PMSVcWg8C5ox/mbntZWY+WdudyqQvUDtnh4WYFRAXr8 LMGTO02tBuDG8MbdKBpEg3Z/ZurycAG04q2AR/4nJOdnAyNfSe4tvsB3/x/ROJEffSnR kI45EYbJADCm+QET0opw4k/imqs1Vh7ndQcTpps07EIx5z4jt5fB2EiQOikCOV1JsrEh rxRg==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=CyouL0zz; 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-6c53433f130si59621856d6.143.2024.09.09.10.28.55 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 09 Sep 2024 10:28:55 -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=pass header.i=@linaro.org header.s=google header.b=CyouL0zz; 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 1sniBs-0004U9-Pn; Mon, 09 Sep 2024 13:28:40 -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 1sniBm-00044L-2f for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:34 -0400 Received: from mail-pf1-x433.google.com ([2607:f8b0:4864:20::433]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1sniBk-00060p-6R for qemu-devel@nongnu.org; Mon, 09 Sep 2024 13:28:33 -0400 Received: by mail-pf1-x433.google.com with SMTP id d2e1a72fcca58-7179802b91fso2826246b3a.3 for ; Mon, 09 Sep 2024 10:28:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1725902910; x=1726507710; 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=0PKG5YPQcXKyDHlspbxmEdeyLcXXv/kd5HUMAwRWwDA=; b=CyouL0zzfRpyKfcXmByisclRz+f10QcsTS9Oon1wE0OT9tZIQPKHMV7ddNHPmRRrKE RUF7CnX4ep2a9P0CzAU5gttE7Nu/mL74Uqsb4JncByo9ujo/AeT7d1g2iK++aayeMpM8 C6qUKFWIqlX68IQW0AMJn21wG2TOAOclU05BTxWxwvelBw9rmhMBpWI7L5xpTTWAaDY+ IlrtSJji8O3fnART0gpXEnA7Fo44IUluwjCmBNsBGG5UiYay8PaHSOB0paWn/6IKUpAQ Eur4Y7lIRXSz4DElGZcN0C2TtXeHuG8sKX0zqZnRGqRqM8ncuxWPQGsqE9vEe4vgd4ur bgow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1725902910; x=1726507710; 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=0PKG5YPQcXKyDHlspbxmEdeyLcXXv/kd5HUMAwRWwDA=; b=D5tIsh4zGG1k43N3dsTOAXUw7YlEu/Jnl6p5nHVXbPHINzBZrHCfCQ9cZzWJ5UNp1W 15+UaYyN9YepGgtV/TvdAf6XNA3XUgBktEhulFE8eT43nlO+9mHX+5Iep/e63h7A0ZkU tDoaGjHIYlSpXSD2aCK2gxLW95mFavJJobbQ8bG/ceI+v94n0ONaMiK22AZVs/eyKr6S op5/pHe8QSqWRKHzvQRUJZnrJGLG53m6tiJ6vpQWA0iT2gXSt0y3wT/pLaQBMQNTB9Ex aryd5aJko6gzNJFPt09IlsepNNehBvojWR6afttYRy7qSo2gpdOJFdPW+37hw4Hi5TJM m1Gw== X-Gm-Message-State: AOJu0YwFRpzXBo71J/Izb/5R2J1tZwXjQwa/YvGyVBbCUWuD9D/eRIST uTKyDTqC9UI1T1rqdNVIlm1sf5saNb+iIh26n34AXikiwcE162iLaQBSEhje6RfV+wiN1PPcAhT E X-Received: by 2002:a05:6a21:39a:b0:1cf:3c60:b8dc with SMTP id adf61e73a8af0-1cf3c60ba63mr3525604637.34.1725902910095; Mon, 09 Sep 2024 10:28:30 -0700 (PDT) Received: from stoup.. (174-21-81-121.tukw.qwest.net. [174.21.81.121]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-20710e11e02sm36539875ad.14.2024.09.09.10.28.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 09 Sep 2024 10:28:29 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Cc: laurent@vivier.eu, daniel@0x0f.com Subject: [PATCH v3 05/26] target/m68k: Update FPSR.EXC Date: Mon, 9 Sep 2024 10:28:02 -0700 Message-ID: <20240909172823.649837-6-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240909172823.649837-1-richard.henderson@linaro.org> References: <20240909172823.649837-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::433; envelope-from=richard.henderson@linaro.org; helo=mail-pf1-x433.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=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 So far we've only been updating the AEXC byte. Update the EXC byte as well. Signed-off-by: Richard Henderson --- target/m68k/fpu_helper.c | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/target/m68k/fpu_helper.c b/target/m68k/fpu_helper.c index 56694418f2..0c8c14966d 100644 --- a/target/m68k/fpu_helper.c +++ b/target/m68k/fpu_helper.c @@ -170,7 +170,7 @@ void HELPER(update_fpsr)(CPUM68KState *env, FPReg *pval) floatx80 val = pval->d; int soft; - fpsr &= ~FPSR_CC_MASK; + fpsr &= ~(FPSR_CC_MASK | FPSR_EXC_MASK); if (floatx80_is_neg(val)) { fpsr |= FPSR_CC_N; @@ -187,20 +187,22 @@ void HELPER(update_fpsr)(CPUM68KState *env, FPReg *pval) if (soft) { set_float_exception_flags(0, &env->fp_status); - if (soft & float_flag_invalid) { - fpsr |= FPSR_AEXP_IOP; + if (soft & float_flag_invalid_snan) { + fpsr |= FPSR_EXC_SNAN | FPSR_AEXP_IOP; + } else if (soft & float_flag_invalid) { + fpsr |= FPSR_EXC_OPERR | FPSR_AEXP_IOP; } if (soft & float_flag_overflow) { - fpsr |= FPSR_AEXP_OVFL; + fpsr |= FPSR_EXC_OVFL | FPSR_AEXP_OVFL; } if (soft & (float_flag_underflow | float_flag_output_denormal)) { - fpsr |= FPSR_AEXP_UNFL; + fpsr |= FPSR_EXC_UNFL | FPSR_AEXP_UNFL; } if (soft & float_flag_divbyzero) { - fpsr |= FPSR_AEXP_DZ; + fpsr |= FPSR_EXC_DZ | FPSR_AEXP_DZ; } if (soft & float_flag_inexact) { - fpsr |= FPSR_AEXC_INEX; + fpsr |= FPSR_EXC_INEX2 | FPSR_AEXC_INEX; } }