From patchwork Fri Jun 22 14:11:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 139658 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp935220lji; Fri, 22 Jun 2018 07:23:31 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIpGXF0wt+iq/e4dE5OMeEyV4RDSbjesj5x64tLaHTXYJmMlsm/Nvkac/hcSTmF/wMBNi// X-Received: by 2002:ac8:3318:: with SMTP id t24-v6mr1583224qta.119.1529677411281; Fri, 22 Jun 2018 07:23:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529677411; cv=none; d=google.com; s=arc-20160816; b=K72JGlYrClM981CPEZvOUulhXGipXaA6mYYjZBLvc/EpKSiAhPxpFQLdstHCaYJSoB 1etFcBhw43rKyQUiP5mx7AaUafS4azDNMHXR4BsDRA8LSUOaqQoFniXBZWy9bhbdP1Ft ZVG0nSth88zKqx+W2/P+/NzPAICTilwNC204BI/5hQ221W/thkZLjVMutDhNMaUfvULr EakUnLrISLfM+ESllfwq4jkjCg/7B7VjQT+hq/NJ0fWlPTkH7nJcELf5EEC8bgkUBpeb BYNnnktRiccDy8QR9AjizAZ8uCAFxOeEqrCLejZp04SI8Bl9YRnGTB864f3uB5O/7Phc oFUw== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:arc-authentication-results; bh=0Xm+ER24biXy+jhU0foOUmeppdyuMIuvTildhLQkYKo=; b=hymXHCN+g+i7nBg5vGsZj7aHtISgMnEyCDr22WJo3T9GF4wwBUEF8ZPC5GANtDcI6p iOYJpttQJJLYw89LV1+9OlMXOIpJ4WklukN8jhql0gwWecPqVjnp68s7Nc9tLb0TIjVc HGonphX1zxX1deLZnTjABguIu+fpxL2TbQzEfPCH9p3Wxw3RqxrrSPOJyJYRBNPjT0SY JiMz+eQZ7ecRpQA2HZeO4R3C0vE5wfe3QkiuMwYmCUUEeVcPfK13EmMp4WPUgwNHIIMZ E6ZffMcJ3zl//4eNrDTL6L9jY3v4KLVrh6yIL+XW0Vhsc7dwH0B0P7IQnENC1ECzcd4Y brKQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b="FoE/K8YW"; 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 22-v6si1396715qvl.182.2018.06.22.07.23.31 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 22 Jun 2018 07:23:31 -0700 (PDT) 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="FoE/K8YW"; 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]:34352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWMyI-0006iB-I2 for patch@linaro.org; Fri, 22 Jun 2018 10:23:30 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38574) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fWMnQ-00068P-Aj for qemu-devel@nongnu.org; Fri, 22 Jun 2018 10:12:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fWMnP-0006AB-4g for qemu-devel@nongnu.org; Fri, 22 Jun 2018 10:12:16 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:42763) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fWMnO-00069H-SZ for qemu-devel@nongnu.org; Fri, 22 Jun 2018 10:12:15 -0400 Received: by mail-wr0-x243.google.com with SMTP id w10-v6so6859436wrk.9 for ; Fri, 22 Jun 2018 07:12:14 -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 :mime-version:content-transfer-encoding; bh=0Xm+ER24biXy+jhU0foOUmeppdyuMIuvTildhLQkYKo=; b=FoE/K8YWRKqT5cqXeTJn8yae9CPTm5FIwnAOjIq7OqDEIa5GGn9bSRxZWj/QmlyKGa F4XlEPhpkK1memhtcw/W3VRjW6GLz2ouR3kCqct2x7Xo0KL7H92uPBWjR9zien4+T0DJ lqt5dM8mfdb1t7lyL5ZhMMJmfCbNGXNvkFY8s= 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:mime-version:content-transfer-encoding; bh=0Xm+ER24biXy+jhU0foOUmeppdyuMIuvTildhLQkYKo=; b=Is+CnETnoZag1YaEzJVQBtqKG55dLMgYs0WuEFSi16GKCtu9j+oQoNeuGChmVmMJay 22qHW6iJVyJhzFqxW/XD427LXntiZSwUrj8AngbMcNhs29hxzuXmpPAvMZsr2NG3GUrO bdYKrGuCXvw1Ej7amJ/CjLUqN6bQ738Jy0zumSxtmF+oCg/c4RMNv8OFTIm4XGx1hF0e fqQpm6bLperxhhNN+1z6kDqIC0orHD67+73kVhxQ5O0R6zRAOpcSddK0AmkpeqO9P0yG dh3Ul4BYGagzuWJtzQTqzNTWs0/iWayWUoU+G7a/iVmZJulhhdlHNe0TYxmVhJgUl1Fl JDsA== X-Gm-Message-State: APt69E20BX7eo0AC5XJiCC2PlCo2ZK/j0fKF9Kv+kEpoGkUTF+Y5KWTu Ejv03QV64PryjzbMzi+1XnH9Tw== X-Received: by 2002:adf:f98a:: with SMTP id f10-v6mr1759365wrr.105.1529676733766; Fri, 22 Jun 2018 07:12:13 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id g129-v6sm2088364wmf.5.2018.06.22.07.12.07 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 22 Jun 2018 07:12:10 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B463B3E0A25; Fri, 22 Jun 2018 15:12:05 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org Date: Fri, 22 Jun 2018 15:11:51 +0100 Message-Id: <20180622141205.16306-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180622141205.16306-1-alex.bennee@linaro.org> References: <20180622141205.16306-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [RISU PATCH v4 08/22] risugen: Initialize sve predicates with random data 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: =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-arm@nongnu.org, richard.henderson@linaro.org, qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: Richard Henderson Using ptrue makes most of the uses of predicates trivial. Therefore, initialize them to something interesting. Signed-off-by: Richard Henderson Signed-off-by: Alex Bennée --- risugen_arm.pm | 48 ++++++++++++++++++++++++++++++++++-------------- 1 file changed, 34 insertions(+), 14 deletions(-) -- 2.17.1 diff --git a/risugen_arm.pm b/risugen_arm.pm index bb3ee90..83e521d 100644 --- a/risugen_arm.pm +++ b/risugen_arm.pm @@ -174,6 +174,24 @@ sub write_sxt32($$) insn32(0x93407c00 | $rn << 5 | $rd); } +sub write_add_rri($$$) +{ + my ($rd, $rn, $i) = @_; + my $sh; + + die "write_add_rri: invalid operation for this arch.\n" if (!$is_aarch64); + + if ($i >= 0 && $i < 0x1000) { + $sh = 0; + } elsif (($i & 0xfff) || $i >= 0x1000000) { + die "invalid immediate for this arch,\n"; + } else { + $sh = 1; + $i >>= 12; + } + insn32(0x91000000 | ($rd << 0) | ($rn << 5) | ($i << 10) | ($sh << 22)); +} + sub write_sub_rrr($$$) { my ($rd, $rn, $rm) = @_; @@ -477,33 +495,35 @@ sub write_random_aarch64_svedata() # Load SVE registers my $align = 16; my $vq = 16; # quadwords per vector - my $datalen = (32 * $vq * 16) + $align; - - write_pc_adr(0, (3 * 4) + ($align - 1)); # insn 1 - write_align_reg(0, $align); # insn 2 - write_jump_fwd($datalen); # insn 3 + my $veclen = 32 * $vq * 16; + my $predlen = 16 * $vq * 2; + my $datalen = $veclen + $predlen; - # align safety - for (my $i = 0; $i < ($align / 4); $i++) { - # align with nops - insn32(0xd503201f); - }; + write_pc_adr(0, 2 * 4); # insn 1 + write_jump_fwd($datalen); # insn 2 for (my $rt = 0; $rt <= 31; $rt++) { for (my $q = 0; $q < $vq; $q++) { write_random_fpreg_var(4); # quad } } - - # Reset all the predicate registers to all true - for (my $p = 0; $p < 16; $p++) { - insn32(0x2518e3e0 | $p); + for (my $rt = 0; $rt <= 15; $rt++) { + for (my $q = 0; $q < $vq; $q++) { + insn16(rand(0xffff)); + } } for (my $rt = 0; $rt <= 31; $rt++) { # ldr z$rt, [x0, #$rt, mul vl] insn32(0x85804000 + $rt + (($rt & 7) << 10) + (($rt & 0x18) << 13)); } + + write_add_rri(0, 0, $veclen); + + for (my $rt = 0; $rt <= 15; $rt++) { + # ldr p$rt, [x0, #$pt, mul vl] + insn32(0x85800000 + $rt + (($rt & 7) << 10) + (($rt & 0x18) << 13)); + } } sub write_random_aarch64_regdata($$)