Message ID | 20250201164012.1660228-23-peter.maydell@linaro.org |
---|---|
State | New |
Headers | show
Delivered-To: patch@linaro.org Received: by 2002:adf:fb05:0:b0:385:e875:8a9e with SMTP id c5csp1262229wrr; Sat, 1 Feb 2025 08:41:18 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWxYK8SChAUZ8sarFZpmA08aPoWg4rOi3ERoXGrZV2/xsvvD0O5mnCOgIycshTrQmWFOcPJrw==@linaro.org X-Google-Smtp-Source: AGHT+IFyi4W8Dpa35bWelkXoNJ/JxZEO0BZf9BiiJEaJiZJ4W+0Bwix+KK5g+/17VbOYWB+OZKCM X-Received: by 2002:a05:6214:d4d:b0:6d8:a967:8387 with SMTP id 6a1803df08f44-6e243b8f736mr198444756d6.1.1738428077905; Sat, 01 Feb 2025 08:41:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1738428077; cv=none; d=google.com; s=arc-20240605; b=FFiAcfDD8z+o1IGacIBpWTE5b3SgJatPmimHm3N1CU3N9NSMisKuTkjc7KL3H8i/Ro lojguItP5dBn00QqlgrPkiPKmfYbQuX7UAUhuHxRt3wFnHZFlAOld6YSfO+S7FG8fm21 X4pqeW8D3HPnPO5yQ68u2/3De5/a434t6fxAExCeafUoNXFf2Dr4grbHHFdIXqYJPmWu zdOGxePZkRd/dP3kU2twyfzMkcH1kNJiLN2nbAO7GLqagNcIlB+shljybNl7pnDljJ+o NoVtAKxWiJbuWtKxgkAgoKQA6Lm9s455Udr0NtP7V+Anob+E3X8AfllEdW4lGY/wfR/R 3gFQ== 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:to:from :dkim-signature; bh=lnrlxlkexAFB0yjw1Az81X/GgE8fg4btWQPlqgMIhKE=; fh=I0lLPEFRZFtkje+DvfcifJ9kKDpMbZxJFDV3FvbYk2Y=; b=MjbXN99E9PL0wM6zTD3PMG53SDIPbqds9uMPhi0j7iHJIwAkuSqqeVqIZ3ImvnvRo8 pCgei1R6LZ/VInOV8OIIKHIV7yGSe2nj8Uj+lbWZz+k3bVgWNfHdlx0QtmoIzmwEVMiL izDkLd92ZupP2VEYsS/sjQhgSLlhMPKdmT0JC4sP5li6Xi3AMPArQOvmtY8C2u8u3h+j FKDURC2lqOVo/jy1V7Ler8GIRzmDPmBTuqRkuREZi3BKA1+XtPpr2n02BdbHSn7xNIhY bO2YildUm1CmwMF2tdMMLVWjmD3HKTAvvS/Br+TXLTj1LhTRP0muspOTkzcqMB/e9RqH ErLw==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=ScBK0usv; 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: <qemu-devel-bounces+patch=linaro.org@nongnu.org> Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 6a1803df08f44-6e25481173bsi60052746d6.92.2025.02.01.08.41.17 for <patch@linaro.org> (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 01 Feb 2025 08:41:17 -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=ScBK0usv; 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 <qemu-devel-bounces@nongnu.org>) id 1teGYB-0006JS-M8; Sat, 01 Feb 2025 11:40:55 -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 <peter.maydell@linaro.org>) id 1teGY4-0006Cq-Rt for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:40:48 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from <peter.maydell@linaro.org>) id 1teGY3-000196-45 for qemu-devel@nongnu.org; Sat, 01 Feb 2025 11:40:48 -0500 Received: by mail-wm1-x32f.google.com with SMTP id 5b1f17b1804b1-4361e89b6daso20784955e9.3 for <qemu-devel@nongnu.org>; Sat, 01 Feb 2025 08:40:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1738428046; x=1739032846; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:from:to:cc:subject:date:message-id :reply-to; bh=lnrlxlkexAFB0yjw1Az81X/GgE8fg4btWQPlqgMIhKE=; b=ScBK0usv0RVGFHDd8Ko2hFGq4Gv3FXW+ZgVo6/MKEeHCNEd739DH6XaOl1YnbMv+Mu oKeukHwDadjPAK0oyYPnqa1BQ1Okfo2Y+h4OeTejWj3Het9NUZ6QlwtZNOZBW0eYudwq BWR1rYdixSLJEghtJHOOMNsve6G6PsowWaE4nM8Ui8laQnqGuK1pp7C38TW3juMXiuWt 2xJsBUaeyidf40eRnMl8SdDsz2BjwzNLPwp4DIwBiDmH10QolT1ht4HlW9joG4Zfvzbr Bb1gFLFeDmJbaACYSmAAMqyh+GukSbWbP7PFL/fQbZLiz/YdTsl/dNiqsY9kr28yrLUu Mv8Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738428046; x=1739032846; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lnrlxlkexAFB0yjw1Az81X/GgE8fg4btWQPlqgMIhKE=; b=JG3JctYLZBCR4sqbuk8uIcY0LmLsAgF36W1tq8Qr3b/0uW/F7WGfFyBzfCBOaxT14h vU9b9drA47SsCbCtDMjuaAh326+U3RXkkNPedW/NS29BBBJkBBidPYA1q8D4QYlpzpGF 5GiJhaGdoOLiVFjoPlBkaWqicjkNkukJvH3tg2ZdpvDFDKchxpkxZ80402hEuTCgqR02 3lTPFM3mQL/se+WySSANm3F6PPKlkA1fTJWWSpybYbwsOmbPbWCD+B/pNsfplMl4XOea S4L+bzv8yEfpgSln0vmBQUIBAyNqISjUQ33+zO7y3ol7fsPdrY18bi69TiNvAnJmP5Z5 /Kcw== X-Forwarded-Encrypted: i=1; AJvYcCXVspP/HQO8Xat+UyfMAxA0U7OSq1bsdGiZPZQ14V5R2CE/4csJivc35oASrtaeZ5eIiBrtgMdz3n+i@nongnu.org X-Gm-Message-State: AOJu0Yz9OsCf/9fRuHTKAQCAShjCJf25mBJFvtUobGHYKmCNREtr9I2P h/7niOsPUXS3Fif+R91JtAebxOtCUE114t8FQxDBrxB0vW56fUsan096tBjCfnc= X-Gm-Gg: ASbGncuRm4h6XInZa7nzN4YIX5G0qXCNW0C+HVlxu4L+KCYLUKAY3jtBQWewzw0zRHz jdVKr8Cqst8aa5DHrqIPaYqvnEp/Auz3rzg2nYWECCGzmizTF43xJbcZrhdrj38I28vbtahuiOi C9vLszceaKR9WoSrk4Ll2NGpI2OVndkDAu7I3Cbws5oCfyqtGYQuezBCjzM+cS2del6aJa+72MV O5shGaP9lLsoAcp7hXxVdiYZJu8GGN9cDGrtlUGt9jieE/eUBSaW4pVH7UY8jjzZLbCEDgEAD33 UaPQKiZzs+bcuwMuKRiN X-Received: by 2002:a05:600c:1c97:b0:434:9c1b:b36a with SMTP id 5b1f17b1804b1-438dc3caac1mr130179635e9.13.1738428045748; Sat, 01 Feb 2025 08:40:45 -0800 (PST) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [2001:8b0:1d0::2]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-438dcc81d74sm127401525e9.37.2025.02.01.08.40.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 01 Feb 2025 08:40:45 -0800 (PST) From: Peter Maydell <peter.maydell@linaro.org> To: qemu-arm@nongnu.org, qemu-devel@nongnu.org Subject: [PATCH v2 22/69] target/arm: Handle FPCR.NEP for FCVTXN (scalar) Date: Sat, 1 Feb 2025 16:39:25 +0000 Message-Id: <20250201164012.1660228-23-peter.maydell@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250201164012.1660228-1-peter.maydell@linaro.org> References: <20250201164012.1660228-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=peter.maydell@linaro.org; helo=mail-wm1-x32f.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: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <https://lists.nongnu.org/archive/html/qemu-devel> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org |
Series |
target/arm: FEAT_AFP and FEAT_RPRES
|
expand
|
diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 35db806d0b7..73054b6137f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -9258,24 +9258,21 @@ static ArithOneOp * const f_scalar_uqxtn[] = { }; TRANS(UQXTN_s, do_2misc_narrow_scalar, a, f_scalar_uqxtn) -static void gen_fcvtxn_sd(TCGv_i64 d, TCGv_i64 n) +static bool trans_FCVTXN_s(DisasContext *s, arg_rr_e *a) { - /* - * 64 bit to 32 bit float conversion - * with von Neumann rounding (round to odd) - */ - TCGv_i32 tmp = tcg_temp_new_i32(); - gen_helper_fcvtx_f64_to_f32(tmp, n, fpstatus_ptr(FPST_A64)); - tcg_gen_extu_i32_i64(d, tmp); + if (fp_access_check(s)) { + /* + * 64 bit to 32 bit float conversion + * with von Neumann rounding (round to odd) + */ + TCGv_i64 src = read_fp_dreg(s, a->rn); + TCGv_i32 dst = tcg_temp_new_i32(); + gen_helper_fcvtx_f64_to_f32(dst, src, fpstatus_ptr(FPST_A64)); + write_fp_sreg_merging(s, a->rd, a->rd, dst); + } + return true; } -static ArithOneOp * const f_scalar_fcvtxn[] = { - NULL, - NULL, - gen_fcvtxn_sd, -}; -TRANS(FCVTXN_s, do_2misc_narrow_scalar, a, f_scalar_fcvtxn) - #undef WRAP_ENV static bool do_gvec_fn2(DisasContext *s, arg_qrr_e *a, GVecGen2Fn *fn) @@ -9377,11 +9374,27 @@ static void gen_fcvtn_sd(TCGv_i64 d, TCGv_i64 n) tcg_gen_extu_i32_i64(d, tmp); } +static void gen_fcvtxn_sd(TCGv_i64 d, TCGv_i64 n) +{ + /* + * 64 bit to 32 bit float conversion + * with von Neumann rounding (round to odd) + */ + TCGv_i32 tmp = tcg_temp_new_i32(); + gen_helper_fcvtx_f64_to_f32(tmp, n, fpstatus_ptr(FPST_A64)); + tcg_gen_extu_i32_i64(d, tmp); +} + static ArithOneOp * const f_vector_fcvtn[] = { NULL, gen_fcvtn_hs, gen_fcvtn_sd, }; +static ArithOneOp * const f_scalar_fcvtxn[] = { + NULL, + NULL, + gen_fcvtxn_sd, +}; TRANS(FCVTN_v, do_2misc_narrow_vector, a, f_vector_fcvtn) TRANS(FCVTXN_v, do_2misc_narrow_vector, a, f_scalar_fcvtxn)