From patchwork Tue Dec 10 16:16:53 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 848829 Delivered-To: patch@linaro.org Received: by 2002:adf:ec08:0:b0:385:e875:8a9e with SMTP id x8csp417291wrn; Tue, 10 Dec 2024 08:21:48 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVbMXvajKEy2fCPuutgtlZH2uwqBMeJIh/BJ0fHc5DCr78JmDjOKRDvi7eFm/UrjqjCm/SM9g==@linaro.org X-Google-Smtp-Source: AGHT+IHPnWLzLWRX6loOa2b1RljnE4SDeszn6PnoZFdsFcu235VZQ6W5o3pvUBEbNf5RmQE2I248 X-Received: by 2002:a05:6214:23c6:b0:6d8:8466:d205 with SMTP id 6a1803df08f44-6d91e300ba4mr83000966d6.6.1733847708753; Tue, 10 Dec 2024 08:21:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1733847708; cv=none; d=google.com; s=arc-20240605; b=Rx3O/zw0HVNd1YlCjrDqlbYOp9lbD4pX8V63JscLz54u65OpeHCj/Ve9XKOkVpU9vG g1+NcgB0DSwTiSSSm9vgrzQ16z2R5hHPVSpmo5p3DcEHACX+v+0OpxMoRCopMp9ikaXa SUKInMH6rN76FyOfF/JTx34KlXyfVOovfS+IhfFsPx06mTkyb+3Fba6NTACGd2c/nMIB wklYEFLTe5wUod6vJd/JbuwzjfLqU7qurtbnXN5oC4iOGdiOKIOPl+ZFWIBMxjRk3q7o n0P8ndF9Nkxe7pUhj4pKOA9sSoZFT2CXIn/1ztzLCE71BoVSf1Pu+3LlXI8wojB3YXi1 /ihA== 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=AzRacBoTVvTyHmOFDiNorsk3TiwuSPdvbsL1tVp2ix0=; fh=9Ev+QBUhk6P6vR3LT1wYeDLexozsz44nqjfoyPajZCc=; b=PrOWJrQt9cvDQTbKaivgOU8inV/EXVMlbCep4D7EPRS3OTNkVpF5cT8kP3kbKpnH/S HPw1mfRwBRBbypq7m29uhb1QSifKhlP8G3UmE7RPeiE8pshGnkipfehsrRC/L9LgsrCg xbSYq7wE9UBPtyEheoFnIhXfiAHNhRPuBAwOeHt5DxbMizzjlGU0pzd6lVA0E9Redw9A T0j+Ane0jWoUOFOMOtrZ95Zh4UFDouGT4SDIm8mJDy/s1uxR7ThMUJIvkXcEXQm5/WAO SMbw1C5FlqRb7W4PJCYUey4kARZ6kk5ILvaeMNoflw8iHKN0mIA+qEfEA3dZgK9l3qrt AQsA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=EwIBKe8O; 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-6d910a403c3si65272616d6.306.2024.12.10.08.21.48 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 10 Dec 2024 08:21:48 -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=EwIBKe8O; 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 1tL2xq-0005mZ-KI; Tue, 10 Dec 2024 11:19:58 -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 1tL2xe-0004r0-RW for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:19:48 -0500 Received: from mail-lf1-x12a.google.com ([2a00:1450:4864:20::12a]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tL2xa-0006Xw-Lf for qemu-devel@nongnu.org; Tue, 10 Dec 2024 11:19:45 -0500 Received: by mail-lf1-x12a.google.com with SMTP id 2adb3069b0e04-5401ab97206so2429153e87.3 for ; Tue, 10 Dec 2024 08:19:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1733847579; x=1734452379; 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=AzRacBoTVvTyHmOFDiNorsk3TiwuSPdvbsL1tVp2ix0=; b=EwIBKe8OTmHBoevqWX7QGPIIqw1509twavTluizUJNxdBcLSpyZiFujuV45jmBpuiy WwOk9QoUClLKXm7Hme0VTZLw1E9IeUUmWSW9NbH2n+iBOzq0au+85M3Ijx/sR3PpqvLG RcOl+wzuX3O/4+XWhlqqkxJWoGyEm/0TgP5stGiEmfVhgvRILs6bxH/alUmO/cwmf+qr XZiG4bZptFn5SraE/iwVI8hZu1+aOdnetXig8lTnCISxQwAbtkETE0rw+REs13NVsI+u jX8unK2FcIvqEcimMDC5ldRdwTNifHnc6BKPNk9rSAZ0GYomQFT2F0z1Mv4ZadQpKkS2 Musg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733847579; x=1734452379; 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=AzRacBoTVvTyHmOFDiNorsk3TiwuSPdvbsL1tVp2ix0=; b=gvG7ZyDrdFz05CVSq74z1zulRX4yxAFwvIPXT4DRe5pJc5vO4e4nBl55pO5AasMzLb vF0SqfaUMCrUppoP+Efhj6j0afeKs8pUz1DnIb26cQ+A+Md73kz7yGZKi3YGykT0mv5p Hab6ZAli3PuaP8UcKV+psgCdv7dVJ/F+Fxgl9aTRP14dKqti/tduosAE8Z6w+0kT9uM7 T7aoLEPqIMFbpo3PyZX2tKDNabNUgbBwu0bQfAhDXhoTNp2byAtQpnOnMTywlk+TeY8a MWsh1xwlu31o9RmQSkoE1szquIw4tP3Pt3ROCNHVTmgxZT7nrWjiFYwsjnp+yhB6yaeV 6biQ== X-Gm-Message-State: AOJu0Yz34Cn5U44TVH+tTpB/cQi8DfqntWkuCLUh4Cc45QGdd9tUzIoE gg5YJFvFEkrjQ/2RabiiHRl6MsFqwUGuMo6KWTHYC4kAAypW6FvFcUJQ+wh3Tv4kR+ReEuVqLQe nOm6S+68t X-Gm-Gg: ASbGncvbyJtgCOQwKpy2K/suoTkyEJw7G7S7MVwUehTiORcOI5rHo6JhvIkPDXFK+UN TSYphEEsWbzWuzLi2Ny2H3or8nU7+AFKFLyPcfhbMt+Pzv3RIdgID+100bF2qS6fIHCMDT7gx2E hAffPearq1je+GMMrqwurTaX4e/4W8mrXMHdB6hQdneGVmQuey2OAWnZjUdUPY25P6X9y9YY7c6 gHlX97Za3Y7MXrTiyd7fZOev/8+5s5rQn1vi/i3Se4WMT4Uj54JisMaXAM= X-Received: by 2002:a05:6512:b96:b0:540:2339:375b with SMTP id 2adb3069b0e04-540240e65e3mr1984600e87.32.1733847579395; Tue, 10 Dec 2024 08:19:39 -0800 (PST) Received: from stoup.. ([91.209.212.80]) by smtp.gmail.com with ESMTPSA id 2adb3069b0e04-53f93377eefsm1026343e87.67.2024.12.10.08.19.36 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Dec 2024 08:19:38 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: qemu-arm@nongnu.org Subject: [PATCH v2 29/69] target/arm: Convert BFCVT to decodetree Date: Tue, 10 Dec 2024 10:16:53 -0600 Message-ID: <20241210161733.1830573-30-richard.henderson@linaro.org> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20241210161733.1830573-1-richard.henderson@linaro.org> References: <20241210161733.1830573-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::12a; envelope-from=richard.henderson@linaro.org; helo=mail-lf1-x12a.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 Signed-off-by: Richard Henderson Reviewed-by: Peter Maydell --- target/arm/tcg/translate-a64.c | 26 +++++++------------------- target/arm/tcg/a64.decode | 3 +++ 2 files changed, 10 insertions(+), 19 deletions(-) diff --git a/target/arm/tcg/translate-a64.c b/target/arm/tcg/translate-a64.c index 45321cdca7..ef0379d17f 100644 --- a/target/arm/tcg/translate-a64.c +++ b/target/arm/tcg/translate-a64.c @@ -8420,6 +8420,11 @@ static const FPScalar1 f_scalar_frintx = { }; TRANS(FRINTX_s, do_fp1_scalar, a, &f_scalar_frintx, -1) +static const FPScalar1 f_scalar_bfcvt = { + .gen_s = gen_helper_bfcvt, +}; +TRANS_FEAT(BFCVT_s, aa64_bf16, do_fp1_scalar, a, &f_scalar_bfcvt, -1) + /* Floating-point data-processing (1 source) - single precision */ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) { @@ -8432,9 +8437,6 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) tcg_res = tcg_temp_new_i32(); switch (opcode) { - case 0x6: /* BFCVT */ - gen_fpst = gen_helper_bfcvt; - break; case 0x10: /* FRINT32Z */ rmode = FPROUNDING_ZERO; gen_fpst = gen_helper_frint32_s; @@ -8454,6 +8456,7 @@ static void handle_fp_1src_single(DisasContext *s, int opcode, int rd, int rn) case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x6: /* BFCVT */ case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ @@ -8652,28 +8655,13 @@ static void disas_fp_1src(DisasContext *s, uint32_t insn) } break; - case 0x6: - switch (type) { - case 1: /* BFCVT */ - if (!dc_isar_feature(aa64_bf16, s)) { - goto do_unallocated; - } - if (!fp_access_check(s)) { - return; - } - handle_fp_1src_single(s, opcode, rd, rn); - break; - default: - goto do_unallocated; - } - break; - default: do_unallocated: case 0x0: /* FMOV */ case 0x1: /* FABS */ case 0x2: /* FNEG */ case 0x3: /* FSQRT */ + case 0x6: /* BFCVT */ case 0x8: /* FRINTN */ case 0x9: /* FRINTP */ case 0xa: /* FRINTM */ diff --git a/target/arm/tcg/a64.decode b/target/arm/tcg/a64.decode index 9d2f099c9c..4a48fcff1d 100644 --- a/target/arm/tcg/a64.decode +++ b/target/arm/tcg/a64.decode @@ -45,6 +45,7 @@ &qrrrr_e q rd rn rm ra esz @rr_h ........ ... ..... ...... rn:5 rd:5 &rr_e esz=1 +@rr_s ........ ... ..... ...... rn:5 rd:5 &rr_e esz=2 @rr_d ........ ... ..... ...... rn:5 rd:5 &rr_e esz=3 @rr_sd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_sd @rr_hsd ........ ... ..... ...... rn:5 rd:5 &rr_e esz=%esz_hsd @@ -1337,6 +1338,8 @@ FRINTA_s 00011110 .. 1 001100 10000 ..... ..... @rr_hsd FRINTX_s 00011110 .. 1 001110 10000 ..... ..... @rr_hsd FRINTI_s 00011110 .. 1 001111 10000 ..... ..... @rr_hsd +BFCVT_s 00011110 01 1 000110 10000 ..... ..... @rr_s + # Floating-point Immediate FMOVI_s 0001 1110 .. 1 imm:8 100 00000 rd:5 esz=%esz_hsd