From patchwork Fri Dec 7 10:36:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 153117 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp341098ljp; Fri, 7 Dec 2018 02:45:11 -0800 (PST) X-Google-Smtp-Source: AFSGD/VXiZTD8YnRIvr7r0J2on5wPGdP75x58BSt8o5V/bpmxHbRDpdMYcSi3aj8FF0giCHQ9TZW X-Received: by 2002:ac8:2a81:: with SMTP id b1mr1478819qta.110.1544179511568; Fri, 07 Dec 2018 02:45:11 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544179511; cv=none; d=google.com; s=arc-20160816; b=Uy+jWboWmj08leCcGPL8qeDggZcNiyr02FINpDGmn+/vChRJ1cZLJ4N9B0mzFKQzut z/8JXzN6fRLeKZM6KC2m63mhYcYHQBv22voxfQ1o3zuH29URemOq9pL2m8WiqlWxIdBp RM6BqG0hC7rzRK/r8GfcxbnlJagj20BOpfLLuqVdsorFOztXNtYRMq0EqnmyiI06V+mw W6xJwExw6LPhqqokiPq0YNQIn07twUI2EMvaAcGMoEI/Y4tHhXH21Zx8OkQIJfsSlX6v MdCzsk/upozCcgmnxcWgG8vuiV1BmE+wQQ8x7/MBSt3r0Nb0+9HA6NJoUGxgMk+Cv2JX 8oWw== 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=IZN/zm+Sbr0VZp5LeMSCa70GLuCTR8dRmQr/tO3QM7I=; b=ySZqn4QLJZCExgm9XAPNiAS0yqgEROc/X8YmcE6R6oWyu4eNaj3EpBi84S6fCxsi2p uNXaRrYNkaAlnZVaqguKiuW/iEDhgd1fw3SXGvBgwoslNmPpdTvmWiUasHj4781kgcQS WuWFKyErmlKah8MJaZE7ciI7H4r0iP3WAzO9cvHNpqTN55ww/mBodUxIj/fMR8YueFaa 0jDXNkmRKjge6s1fHgcWeH5zfMvFIM5zrViiNsr5SBeQ/taod4C9G9hjWNfRt/LHxyRy UgVOLTtkA8Ub5KlKd3b2kbIvhPJ/I0RM6HEBYYFa2Wj74+RMYFM36J1rhAPX7Cr89uzQ BkRw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Neo3MWAr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id g14si2013546qti.392.2018.12.07.02.45.11 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 07 Dec 2018 02:45:11 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=Neo3MWAr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 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]:45296 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDd8-0002DE-Ub for patch@linaro.org; Fri, 07 Dec 2018 05:45:11 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59066) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gVDV0-00081c-SG for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:49 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gVDV0-0007OP-3p for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:46 -0500 Received: from mail-oi1-x244.google.com ([2607:f8b0:4864:20::244]:38515) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1gVDUz-0007NZ-V5 for qemu-devel@nongnu.org; Fri, 07 Dec 2018 05:36:46 -0500 Received: by mail-oi1-x244.google.com with SMTP id a77so2999998oii.5 for ; Fri, 07 Dec 2018 02:36:45 -0800 (PST) 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=IZN/zm+Sbr0VZp5LeMSCa70GLuCTR8dRmQr/tO3QM7I=; b=Neo3MWArIUBVEwl/WomgFSwjO2fkJZAjK/sos2W34bVy5XTs50x0B5JRWYm2N0BR6n 1jWN/YypIPNgzCvMz6RRPob0hfgd9htIIQpfj5mF2vJHuBlYy074OhkrcDoU+QTkOjS/ sJfy5dM6vC5QoCcSdhO5vt6+TUiv1b/HzhnmU= 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=IZN/zm+Sbr0VZp5LeMSCa70GLuCTR8dRmQr/tO3QM7I=; b=jVlkZlNvOJ0X9P8kea4ZqpTPAonHEN4d6zqQBcSHjeriunjvYRyChe+PtqMt4JnsN4 VlGccM180Frvvaba3USph0wbZXWI6bSvc2Mfgi4BOPp5wd9Bp6VI2YpW03Nz06KB1CyE w6SreJnMQBcHptHJKdSiOy6lLrQ5KWyOLA4I2z/Zq2UtRyXVupO8wZr1rDLYT8Pk5o+B jDpbgHN4OtAw3fFJaodRuQVDInOJhQbttHlX1yGOsl2TCBXfdc9JRzYHxHOoBm5hwRLW NWzjyUTiAu4CG4ZzrgYbgMDk2e0qNCFN9NIs4adSAxGqUj7/tp3zQ6yadPcWInKAQTrO h/sA== X-Gm-Message-State: AA+aEWbRGy7BbU9IgcrQCPwBtOQBEL2emRvZNKm4GbnoxXBCasW3Qbqi XbBJ67vCTo+0VtVWaE52A509qpjw82g= X-Received: by 2002:a54:440d:: with SMTP id k13mr966207oiw.263.1544179004988; Fri, 07 Dec 2018 02:36:44 -0800 (PST) Received: from cloudburst.twiddle.net (172.189-204-159.bestel.com.mx. [189.204.159.172]) by smtp.gmail.com with ESMTPSA id c19sm2037594otl.16.2018.12.07.02.36.43 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Dec 2018 02:36:44 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Fri, 7 Dec 2018 04:36:11 -0600 Message-Id: <20181207103631.28193-7-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20181207103631.28193-1-richard.henderson@linaro.org> References: <20181207103631.28193-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::244 Subject: [Qemu-devel] [PATCH 06/26] target/arm: Rearrange decode in disas_data_proc_1src X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: peter.maydell@linaro.org, ramana.radhakrishnan@arm.com Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Now properly signals unallocated for REV64 with SF=0. Allows for the opcode2 field to be decoded shortly. Signed-off-by: Richard Henderson --- target/arm/translate-a64.c | 31 ++++++++++++++++++++++--------- 1 file changed, 22 insertions(+), 9 deletions(-) -- 2.17.2 Reviewed-by: Peter Maydell diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index 0df344f9e8..c5ec430b42 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -4563,38 +4563,51 @@ static void handle_rev16(DisasContext *s, unsigned int sf, */ static void disas_data_proc_1src(DisasContext *s, uint32_t insn) { - unsigned int sf, opcode, rn, rd; + unsigned int sf, opcode, opcode2, rn, rd; - if (extract32(insn, 29, 1) || extract32(insn, 16, 5)) { + if (extract32(insn, 29, 1)) { unallocated_encoding(s); return; } sf = extract32(insn, 31, 1); opcode = extract32(insn, 10, 6); + opcode2 = extract32(insn, 16, 5); rn = extract32(insn, 5, 5); rd = extract32(insn, 0, 5); - switch (opcode) { - case 0: /* RBIT */ +#define MAP(SF, O2, O1) ((SF) | (O1 << 1) | (O2 << 7)) + + switch (MAP(sf, opcode2, opcode)) { + case MAP(0, 0x00, 0x00): /* RBIT */ + case MAP(1, 0x00, 0x00): handle_rbit(s, sf, rn, rd); break; - case 1: /* REV16 */ + case MAP(0, 0x00, 0x01): /* REV16 */ + case MAP(1, 0x00, 0x01): handle_rev16(s, sf, rn, rd); break; - case 2: /* REV32 */ + case MAP(0, 0x00, 0x02): /* REV/REV32 */ + case MAP(1, 0x00, 0x02): handle_rev32(s, sf, rn, rd); break; - case 3: /* REV64 */ + case MAP(1, 0x00, 0x03): /* REV64 */ handle_rev64(s, sf, rn, rd); break; - case 4: /* CLZ */ + case MAP(0, 0x00, 0x04): /* CLZ */ + case MAP(1, 0x00, 0x04): handle_clz(s, sf, rn, rd); break; - case 5: /* CLS */ + case MAP(0, 0x00, 0x05): /* CLS */ + case MAP(1, 0x00, 0x05): handle_cls(s, sf, rn, rd); break; + default: + unallocated_encoding(s); + break; } + +#undef MAP } static void handle_div(DisasContext *s, bool is_signed, unsigned int sf,