From patchwork Wed Nov 25 04:06:40 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 332359 Delivered-To: patch@linaro.org Received: by 2002:a92:5e16:0:0:0:0:0 with SMTP id s22csp123669ilb; Tue, 24 Nov 2020 20:11:35 -0800 (PST) X-Google-Smtp-Source: ABdhPJyIjQtkGN1iwnU7TFYYGrZU64YUfal+qEI7ZM+UjG80dSmNFevp6K5xbetA1XbwdgUKUQTR X-Received: by 2002:a25:dbcf:: with SMTP id g198mr1689901ybf.110.1606277495186; Tue, 24 Nov 2020 20:11:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606277495; cv=none; d=google.com; s=arc-20160816; b=A6zu5Ln+C8ba3aijGcSY4e/+QeYnOhRtGyBa7TkPLyLyiDky569dpqCbNyEGF5away CDNllZWZsBA531QYRKf4Ll6Jlz7z1CQ5r+pHW1r0mwx8ABnBfQLg2TO5KdbvUUEYwbP6 htFiocqLuA7+ncYhFLFHOQg9NLnhKhl+lGo0wzu81qIsIFhmRtlmM5zMMGXK3A23EZqk btVSqu+UnH0H491za3+zPYVCllTLVG2vzUksVDcm0mMn11IRIASBQhD/HZYI5qSx/o8b 0BHczdyKuJ5SplDngIsPseVZlnKU6WN3UCOoncphQJp+UzFKwN1XYaxoqPzix+QDBNc6 +JMA== 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:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:to:from :dkim-signature; bh=hIrGetngsQpn6DynYHLevrPArG00BLTGCrdQJNoe/Gs=; b=ZNJry+7TvDbRxld5pfOQP1tNnKQ7x3lpX7d73iF3qbvmu6MNGWxWzQ0D0kh0RKWo+9 DX3ksTmUvmf4xgwMVTacfrNodC67U49yYLQtgCJQPlaPc9DZD2DJUueqHqjDl1szsSyz jYRLY1Q298HVX/0+F/f+X2CmbLHx9HOPh857JGmW/nPzDmX090/dHP1jwnTSAmcphtVE ULma6A7C32Uha2LqdrxakM2e0qWTN+k3PdMNjNkuQYKLvbvLwahHx4DMfOKNs1X5GBEh nY6Fo/w/W/9TVMxBkq//AhYIjoq4Av4r9HJNAf5afEUMn+zad76t87pTUFNyb4fQJimL 3DDw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=m64eETgy; 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 Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id e188si1075056yba.40.2020.11.24.20.11.35 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Tue, 24 Nov 2020 20:11:35 -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=m64eETgy; 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 Received: from localhost ([::1]:32932 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1khm9W-0003Mq-Iz for patch@linaro.org; Tue, 24 Nov 2020 23:11:34 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]:36288) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1khm55-00053O-Mw for qemu-devel@nongnu.org; Tue, 24 Nov 2020 23:06:59 -0500 Received: from mail-pl1-x643.google.com ([2607:f8b0:4864:20::643]:38579) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1khm54-00065X-2Q for qemu-devel@nongnu.org; Tue, 24 Nov 2020 23:06:59 -0500 Received: by mail-pl1-x643.google.com with SMTP id l1so456037pld.5 for ; Tue, 24 Nov 2020 20:06:57 -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 :mime-version:content-transfer-encoding; bh=hIrGetngsQpn6DynYHLevrPArG00BLTGCrdQJNoe/Gs=; b=m64eETgyNScp2D+qMQhBNQ4Igs4QupOgTKQo148uBsW3wEN25ZggV4sibRp7O8R5gh prjXaZo9ntMfDLLB0lV9ym8t2zIj0mCRAitnxh/PWZcAPvB8xSwlLiurYWaJrqwnHnVU ELHefi7a4pxXwI1JLHleZMlxFFIxQxxVDlHxPDU7oeve/Brx50+mEOet/sJtwdbsTLH9 ykEIo0v3X5niGp1a5+Hy3xCoTlvYrwwBXYZ8pFlAgwdGdmU3DGtZle9otB0jw9nRPH76 S8D77zT7jdIG+L9zQQnJYK48bR8wi8Wg4zUemm5A8CKcuhv5VAFTl3eHmggLB57sZKkb hMPw== 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=hIrGetngsQpn6DynYHLevrPArG00BLTGCrdQJNoe/Gs=; b=hoZXy5CSMIxnMgXO31QePjxrjd6kOvQ4Eivx9KtOMvR7r/V4tstMegNYaQ+ULx8meR yW1zRf6tdwzFINBwO9HyC5jDHWF9HOYlOEN4DU6VW0DiQJam5gGyjNzUlTPkBBjHYBdn 14teOSNlpGmu1hqQ/NNkNk6d0iiIAfpRwn8B8n4rygmUL202LWOyEJkLZmr/6L1ZLV46 palksns7zrnLXGH9S03Xl74mu8CzVjII9Waqq5RVzr2Xodqj+aWoJjX+mPE2DhT7iQSS Ge22PT08EJDT3A8rnJ0osQb/Y6hNVdggasRBuapNG1grSOSZg4kjqMbd3ABrluDy+CKo 5doQ== X-Gm-Message-State: AOAM531za4wUGEQSSRVfqY0eYGCKSq/vUZPpwn+1RR2WXIY/CQomaDkd gWScEd9x8YAs3zmGlN/HtjRSZG5u9ZIkQw== X-Received: by 2002:a17:902:167:b029:d8:cfe5:bdee with SMTP id 94-20020a1709020167b02900d8cfe5bdeemr1461916plb.11.1606277216434; Tue, 24 Nov 2020 20:06:56 -0800 (PST) Received: from localhost.localdomain ([71.212.141.89]) by smtp.gmail.com with ESMTPSA id f7sm447806pfe.30.2020.11.24.20.06.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Nov 2020 20:06:55 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Subject: [PATCH 09/11] target/arm: Enforce alignment for VLDn/VSTn (multiple) Date: Tue, 24 Nov 2020 20:06:40 -0800 Message-Id: <20201125040642.2339476-10-richard.henderson@linaro.org> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201125040642.2339476-1-richard.henderson@linaro.org> References: <20201125040642.2339476-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::643; envelope-from=richard.henderson@linaro.org; helo=mail-pl1-x643.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.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: qemu-arm@nongnu.org Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- target/arm/translate-neon.c.inc | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) -- 2.25.1 diff --git a/target/arm/translate-neon.c.inc b/target/arm/translate-neon.c.inc index 32e47331a5..c4be019d9c 100644 --- a/target/arm/translate-neon.c.inc +++ b/target/arm/translate-neon.c.inc @@ -427,9 +427,12 @@ static void gen_neon_ldst_base_update(DisasContext *s, int rm, int rn, static bool trans_VLDST_multiple(DisasContext *s, arg_VLDST_multiple *a) { + static const MemOp mop_align[4] = { + 0, MO_ALIGN_8, MO_ALIGN_16, MO_ALIGN_32 + }; /* Neon load/store multiple structures */ int nregs, interleave, spacing, reg, n; - MemOp endian = s->be_data; + MemOp mop, endian = s->be_data; int mmu_idx = get_mem_index(s); int size = a->size; TCGv_i64 tmp64; @@ -487,6 +490,10 @@ static bool trans_VLDST_multiple(DisasContext *s, arg_VLDST_multiple *a) addr = tcg_temp_new_i32(); tmp = tcg_const_i32(1 << size); load_reg_var(s, addr, a->rn); + + /* Enforce the requested alignment for the first memory operation. */ + mop = endian | size | mop_align[a->align]; + for (reg = 0; reg < nregs; reg++) { for (n = 0; n < 8 >> size; n++) { int xs; @@ -494,13 +501,16 @@ static bool trans_VLDST_multiple(DisasContext *s, arg_VLDST_multiple *a) int tt = a->vd + reg + spacing * xs; if (a->l) { - gen_aa32_ld_i64(s, tmp64, addr, mmu_idx, endian | size); + gen_aa32_ld_i64(s, tmp64, addr, mmu_idx, mop); neon_store_element64(tt, n, size, tmp64); } else { neon_load_element64(tmp64, tt, n, size); - gen_aa32_st_i64(s, tmp64, addr, mmu_idx, endian | size); + gen_aa32_st_i64(s, tmp64, addr, mmu_idx, mop); } tcg_gen_add_i32(addr, addr, tmp); + + /* Subsequent memory operations inherit alignment */ + mop &= ~MO_AMASK; } } }