From nobody Fri Dec 19 14:41:50 2025 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1565962691; cv=none; d=zoho.com; s=zohoarc; b=Qk/JSTi9D/+uVw3GRlMDvY4NDN+QPg3W3nz/veM3ga05m33Kaa+BKRRNT0esNeQIczBZhK+FH5Gr4eMJEzl/mxPmF1Z8w5bMkjF3dlj9tYqPN89DsDU5DZ+3Gcu1l1MuKkTLfrBUL1sT7QjrUOlQe8MvKAWY3UjxsF4cLWx8h60= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1565962691; h=Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To:ARC-Authentication-Results; bh=iOrN1oDy4mtnFyYdncXyASGVOIbsAR/8nt+jgVKFbKw=; b=ff0TgQLhxCPepa4JN5p+YsugsiLbezg/dv4vYn2o/qG0rThHLc082zmZvoHrcWCp6aBRohp2VN/eHIDvJEn3wKaa89WskviHAL//pm8mz/a1LxIfVcM1lwFO0RM+BrWWvYJ+0m6CzhMgLWueNKq5hCXnNhb0MIgbRDMxwDmIZJc= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1565962691925441.29101878589734; Fri, 16 Aug 2019 06:38:11 -0700 (PDT) Received: from localhost ([::1]:56258 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hycQi-0001cn-H4 for importer@patchew.org; Fri, 16 Aug 2019 09:38:08 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:35479) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1hyc77-0003cn-Cc for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hyc76-0005pv-4r for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:53 -0400 Received: from mail-wr1-x441.google.com ([2a00:1450:4864:20::441]:42691) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hyc75-0005p5-VA for qemu-devel@nongnu.org; Fri, 16 Aug 2019 09:17:52 -0400 Received: by mail-wr1-x441.google.com with SMTP id b16so1514273wrq.9 for ; Fri, 16 Aug 2019 06:17:51 -0700 (PDT) Received: from orth.archaic.org.uk (orth.archaic.org.uk. [81.2.115.148]) by smtp.gmail.com with ESMTPSA id 4sm8705796wro.78.2019.08.16.06.17.50 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 16 Aug 2019 06:17:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:subject:date:message-id:in-reply-to:references:mime-version :content-transfer-encoding; bh=iOrN1oDy4mtnFyYdncXyASGVOIbsAR/8nt+jgVKFbKw=; b=Ks9nZFBi4Pzda7C5dxarSAxaW3oQKC9CVh7PMdE05oT94hB58T1gW70bHy0neEq266 rNpcp4IUWEI6j1/66eRjdbm28/I0+LDVpa0FEBBYqd7QT2z/WO4d6CY0ZEO+gWfKLHx2 ZmTIEoiYSGBzu2rdv7ce2rb0v5WDYLpt9PO88dlWm9+uBDpdHxv31v/B8UdwT7K4teAS swq25/B47vp2qSDox/34Knc1JLe2NuQ97bYQ+xzJ7+jICig1wPt/it/N+l/+K9nFjkcK O1LemtFmAW2dgBW4dM2tzYyP9J1gLnKRGDeKsnH5L6TVB28n+hN08pnKNhK1WRYDT9ze p7tg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=iOrN1oDy4mtnFyYdncXyASGVOIbsAR/8nt+jgVKFbKw=; b=ELTN25wcVn4dRCfK2GkCJ6wtgYaRot6cMGjIEqrix8q4sSaj8rDG71c3ZWA3ruh62h v5Nzo2zGeClEE14kSoCjwXM4WfFyXef3XgrY2yOsi/4Am6uY7+F5HgMxpJbizRFCVUeJ 8pT1Y9oBB+ISv+CG91DaCxlUxvuFNFAfmptPIjcN3dMuoNqwWcbZfl1pYRoh6wweKYP4 vqR1lpeSoF/BXzuTFIXk8M+DNKTdyqmoLZN5O1t5QmDDmIvfj2fRJse2qpoG6kN88Koa rIN5RsiaV6kYVo0gaim5jiCdQJ6DXyPtXq54PQDMbLnRJUz78+Z10uskrXsC3dMvb23n Jt0A== X-Gm-Message-State: APjAAAX/EprMv4pDPDeYfb8idA8AMU0gIVj50ntA6r2mqFf2sqouEJYp xM53332BT7pPi82eAB2LeshzrdYO4kP4LQ== X-Google-Smtp-Source: APXvYqwY9fBuYLnm99fyZGBMu0VRwjFhE1BM4/vTV+frtNMtmPaj//glN+ZiP/e7C5iVJW6X1rAGaQ== X-Received: by 2002:adf:f088:: with SMTP id n8mr11033293wro.58.1565961470893; Fri, 16 Aug 2019 06:17:50 -0700 (PDT) From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 16 Aug 2019 14:17:16 +0100 Message-Id: <20190816131719.28244-27-peter.maydell@linaro.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20190816131719.28244-1-peter.maydell@linaro.org> References: <20190816131719.28244-1-peter.maydell@linaro.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::441 Subject: [Qemu-devel] [PULL 26/29] target/arm: Use ror32 instead of open-coding the operation X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" From: Richard Henderson The helper function is more documentary, and also already handles the case of rotate by zero. Signed-off-by: Richard Henderson Message-id: 20190808202616.13782-5-richard.henderson@linaro.org Reviewed-by: Peter Maydell Signed-off-by: Peter Maydell --- target/arm/translate.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/target/arm/translate.c b/target/arm/translate.c index ebc7c67f025..02ce8d44fa1 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -7964,8 +7964,7 @@ static void disas_arm_insn(DisasContext *s, unsigned = int insn) /* CPSR =3D immediate */ val =3D insn & 0xff; shift =3D ((insn >> 8) & 0xf) * 2; - if (shift) - val =3D (val >> shift) | (val << (32 - shift)); + val =3D ror32(val, shift); i =3D ((insn & (1 << 22)) !=3D 0); if (gen_set_psr_im(s, msr_mask(s, (insn >> 16) & 0xf, i), i, val)) { @@ -8228,9 +8227,7 @@ static void disas_arm_insn(DisasContext *s, unsigned = int insn) /* immediate operand */ val =3D insn & 0xff; shift =3D ((insn >> 8) & 0xf) * 2; - if (shift) { - val =3D (val >> shift) | (val << (32 - shift)); - } + val =3D ror32(val, shift); tmp2 =3D tcg_temp_new_i32(); tcg_gen_movi_i32(tmp2, val); if (logic_cc && shift) { --=20 2.20.1