From patchwork Fri Jul 26 17:50:14 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 169906 Delivered-To: patch@linaro.org Received: by 2002:a92:4782:0:0:0:0:0 with SMTP id e2csp362695ilk; Fri, 26 Jul 2019 11:00:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqzhvPYvlIn5fcieIgqMBuEDrZmkuUFalg9OWeMuEpy+Bq1BI1Q7FFzIWFANUppLsXRq2uZA X-Received: by 2002:a50:90c5:: with SMTP id d5mr85436842eda.28.1564164036146; Fri, 26 Jul 2019 11:00:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1564164036; cv=none; d=google.com; s=arc-20160816; b=zDmJ5mTJzyo3VEAYYK0WE+VN7VjR2qgbfILVDy92FkABTB1vCjCOiOT+dQmJSvLNQc FxWGQvFk+/P1ceBHMGKQvf1npCnocjwQGs8D0Bg9DLrjv1tOl5aSDie7T4Jx8bbnCom7 9AtPvon4oUnsUwfHw3uZKYL4cdcB5/VdnXILJmmlzcu9Tl8eeJDgMpFg8LbhJ8gZry8Z HsHNPijL2fmh9LoYp3xcuAbGfLtrYmn3Vx3O37lYma3TV7gZqpkOwwVLHCxxHk9aGCKX qRqQulofOh1Qix+trxRpAfGF10t31LoRji7GrZ0cBvk/Ytj7TgKNPWINEY+O5eX/Yyvu Rlpw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:cc:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:subject:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=7nWDfS+LdH5ciQPlK6I4CJ7o4VfuIN/4vlkt7Y4d8wE=; b=Ua+DAOWP1gaASW6Ah64BkEs85uK0CA6AzWXf8F27HRTlmPWExjEmwbwsZSrDloti7o o/jL4h4yCMEOK+YQ/GD5gUVABAXZvDFCqOzX/v1zY0s2wdwOYHXdDmOyQ101Tb5ee87Q wiw5+MxZr6y+1+9gSGzAnYQNolgIWvnyyC7LmFcL+Kz0id2XUe2kyA8znHeQTOj13zEX 6IyMuicn4PaLzKAkSkuVny0oE7ySXjciTr4IcwBERUqj/OR0jw4Hkg8VsKZRRj8IBdRI bVQV36lwx6ruLy317vLI+I6gPrVLzE/LmaMhFIT1SKxWFqHTDVA6vC2N6riQ6LweEIqS Q5RA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=KT+IyBJ0; 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 a24si13332567edd.382.2019.07.26.11.00.35 for (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 26 Jul 2019 11:00:36 -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=KT+IyBJ0; 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]:42570 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4WA-0008Bn-Gm for patch@linaro.org; Fri, 26 Jul 2019 14:00:34 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:59160) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hr4Nc-00064d-0h for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:51:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hr4NY-00010n-Cw for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:51:42 -0400 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]:39541) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hr4NV-0000th-SK for qemu-devel@nongnu.org; Fri, 26 Jul 2019 13:51:38 -0400 Received: by mail-pl1-x644.google.com with SMTP id b7so25061451pls.6 for ; Fri, 26 Jul 2019 10:51:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=7nWDfS+LdH5ciQPlK6I4CJ7o4VfuIN/4vlkt7Y4d8wE=; b=KT+IyBJ0sQ4gxsqcoF8Y9qFThtAqsqt8oEfZeIROZyIyzZKUae7CJfu664N7GDnRJR VNus7Haphr8QjZ3VWoiWV3y2OeZc2h/t4Nd592i/embtWuZOMiQ0+BWEi/4Dbd8lXvzK yI9e/vposoNleYJFWqVHuJr97CXVfhIy6Yu0gVwJ0LPgLgqpq/9QBp51adkG0U3TdsH6 oEqfZuZ1C7FDV1Xw86XCdgfp9WbzIORxENAtj7NoUvNdoDkmGunOrJI17d19HiDr7Fu9 QBW4vaqZQoY4cN0L+YjKLuFlBhqfkhM84usqbV/wM4KqFazgP/E0RLv54W2vB5O9yQhI O3/Q== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=7nWDfS+LdH5ciQPlK6I4CJ7o4VfuIN/4vlkt7Y4d8wE=; b=PsyCsJlb00NyPSo6vDpi9kizU/tT/kN7DT/fgPIuV3Q1W5VMl85jOfv1sh0QFQy/QM 0z5XmC1jQP71+r5IK/a5mgoH71jC09L7RXSqSHDfv2VyjZCDW54kbEllWudDPmAjr1sa Ndm5n/x3VZc6ng28jq9vUCa5byPc6bihQX3g/y0T4kJYa9Wni9+8vXVK9uW7II/G/hrN ZkbJ1vGxGGUCVA/LR7prMF1HlOsDd9xUTZe1KR9YJJWq4TBLosKSZGnoGodiK+VvgOhk wD//8NX5FT4HHJL86B/THoy1tzceSXS83QHd16enQSP3aNLzrCa1Cm1uc5FsJcfaUxMj dBag== X-Gm-Message-State: APjAAAWM6nfm8oVnHG6SgKe0pWtBg7zNTwHDpYZwUWixPgMlVOShMcO2 m2R5vipDcXphUO4RYpu5S+ITkB0d/Y0= X-Received: by 2002:a17:902:b48f:: with SMTP id y15mr99334283plr.268.1564163493700; Fri, 26 Jul 2019 10:51:33 -0700 (PDT) Received: from localhost.localdomain (97-126-117-207.tukw.qwest.net. [97.126.117.207]) by smtp.gmail.com with ESMTPSA id o24sm104287919pfp.135.2019.07.26.10.51.32 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Fri, 26 Jul 2019 10:51:33 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 26 Jul 2019 10:50:14 -0700 Message-Id: <20190726175032.6769-50-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190726175032.6769-1-richard.henderson@linaro.org> References: <20190726175032.6769-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:4864:20::644 Subject: [Qemu-devel] [PATCH 49/67] target/arm: Convert T16 add/sub (3 low, 2 low and imm) 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: , Cc: peter.maydell@linaro.org, qemu-arm@nongnu.org, alex.bennee@linaro.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate.c | 26 ++------------------------ target/arm/t16.decode | 16 ++++++++++++++++ 2 files changed, 18 insertions(+), 24 deletions(-) -- 2.17.1 diff --git a/target/arm/translate.c b/target/arm/translate.c index f551fde3db..692891dbe0 100644 --- a/target/arm/translate.c +++ b/target/arm/translate.c @@ -10580,31 +10580,9 @@ static void disas_thumb_insn(DisasContext *s, uint32_t insn) * 0b0001_1xxx_xxxx_xxxx * - Add, subtract (three low registers) * - Add, subtract (two low registers and immediate) + * In decodetree. */ - rn = (insn >> 3) & 7; - tmp = load_reg(s, rn); - if (insn & (1 << 10)) { - /* immediate */ - tmp2 = tcg_temp_new_i32(); - tcg_gen_movi_i32(tmp2, (insn >> 6) & 7); - } else { - /* reg */ - rm = (insn >> 6) & 7; - tmp2 = load_reg(s, rm); - } - if (insn & (1 << 9)) { - if (s->condexec_mask) - tcg_gen_sub_i32(tmp, tmp, tmp2); - else - gen_sub_CC(tmp, tmp, tmp2); - } else { - if (s->condexec_mask) - tcg_gen_add_i32(tmp, tmp, tmp2); - else - gen_add_CC(tmp, tmp, tmp2); - } - tcg_temp_free_i32(tmp2); - store_reg(s, rd, tmp); + goto illegal_op; } else { /* shift immediate */ rm = (insn >> 3) & 7; diff --git a/target/arm/t16.decode b/target/arm/t16.decode index 67476b30dc..965fb1bf6e 100644 --- a/target/arm/t16.decode +++ b/target/arm/t16.decode @@ -117,3 +117,19 @@ ADD_rri 10101 rd:3 ........ \ STM 11000 ... ........ @ldstm LDM_t16 11001 ... ........ @ldstm + +# Add/subtract (three low registers) + +@addsub_3 ....... rm:3 rn:3 rd:3 \ + &s_rrr_shi %s shim=0 shty=0 + +ADD_rrri 0001100 ... ... ... @addsub_3 +SUB_rrri 0001101 ... ... ... @addsub_3 + +# Add/subtract (two low registers and immediate) + +@addsub_2i ....... imm:3 rn:3 rd:3 \ + &s_rri_rot %s rot=0 + +ADD_rri 0001 110 ... ... ... @addsub_2i +SUB_rri 0001 111 ... ... ... @addsub_2i