From patchwork Thu Mar 7 17:04:30 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 159895 Delivered-To: patch@linaro.org Received: by 2002:a02:5cc1:0:0:0:0:0 with SMTP id w62csp7676179jad; Thu, 7 Mar 2019 09:11:39 -0800 (PST) X-Google-Smtp-Source: APXvYqyxUwSMIahQ4Hh2L3dMiImOIF0xcOhgDlwuhF2Jq3mBXyC7tlrtDMy4LdqSjTELSkJSYNZA X-Received: by 2002:a25:938f:: with SMTP id a15mr11720379ybm.19.1551978699354; Thu, 07 Mar 2019 09:11:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1551978699; cv=none; d=google.com; s=arc-20160816; b=i5MpjLVDjTGHski3rRoZ8pjqYt9qNuudSt1zVqQ8X+pDopMyZ0ERYgIU+AYVpubhGV VPuykEbh+ulclFGtY19RVQas3dv0meKwav9Xe3KiCAS7u9J1DUqu6MGOCGtr/xsBNYPC 0q5ARX+SQ6zQiBGNycqdPESv1aQK2BJdDtQm4uEorma2Uqd+Ahva7kUTW+ewYFmjvLES y3AEHWKzfHYwnDQDz4BB2RLr38QETy41ItSZeEYaUW2sl1NQxrLru+RHFIegVYpt8dEh MSemyjNkft/qOZWyRkXFD06szjpLLx9geC3EDxn37kK/fgr9AihlPdljg/T5VXH0W6JG IrMQ== 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=SQzBd/+rauVuVn4vSTwpbvrFn7QyTWJKQ5Mcurr3Qrw=; b=0nAqBGa15FOHPze2ErdoTxVRnPm8twC1sFQYI38RLUW5m3RJY80NFCSkOhmfv8INIZ H4/1Kw6kCRHDgXvxXlkycILMhXFdPYRM0ppj/e/bp5sGcHz2bO9oQ57uexvSHjmIXbQA Mou6LRbbDHdgYSsqaFY0GCkXx9CZ9Fzmu73MyGll5ZrBzfQbycvgXm2Y0yw92x85kicE rmIxjer2Wcjw17e2/xbROQIeazjoeHfUjYNN85uywPxzkr66y2I0+5CNQzqTFPet9SCm N1BfLOVoLtXV+TyZ/QCn7vgPGtKwVUc5AYOkOlvrsospO03bQ5BkyBIP2zeTUDd8FCAW EU+g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=edTqpWac; 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 h27si3331197ywk.48.2019.03.07.09.11.39 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 07 Mar 2019 09:11:39 -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=fail header.i=@linaro.org header.s=google header.b=edTqpWac; 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 ([127.0.0.1]:55691 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wYU-0003FW-PJ for patch@linaro.org; Thu, 07 Mar 2019 12:11:38 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59233) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1h1wTV-0007U8-Tv for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1h1wTU-0006Yl-OX for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:29 -0500 Received: from mail-pg1-x543.google.com ([2607:f8b0:4864:20::543]:33217) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1h1wTT-0004Vy-DE for qemu-devel@nongnu.org; Thu, 07 Mar 2019 12:06:28 -0500 Received: by mail-pg1-x543.google.com with SMTP id h11so11749714pgl.0 for ; Thu, 07 Mar 2019 09:04:58 -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=SQzBd/+rauVuVn4vSTwpbvrFn7QyTWJKQ5Mcurr3Qrw=; b=edTqpWacJ4VEo27k/f8ZaxQQj1BL64TwYidWOXpSAxrsvRj3N+Sdi4xfYEtHLVtYpc civNqbQwTkPnTgtr5hbOIrAdB/vxxJdTFNrs9U/DSGYSUn48Nxvj7U9ydtnur5S0wirk irBRuIp4S4oxJ5QrbjNfbjLdacr0QLOMj5oK0kW9nHnh0vOw7+ZnXekk9JJ2n5WTGf69 pKrKYVUwMCfLszEmMSxFxF1yVR6gFkRIRPlcUYz28aH95vQinO25ACMhBvdsl4jnBkHw 6G04pav0pdKAyOLxr6CoTWPvCJJxj+ROp8SLW6b4PV02ndZvMpFLWTbK1QJuWFj0axRi dxgA== 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=SQzBd/+rauVuVn4vSTwpbvrFn7QyTWJKQ5Mcurr3Qrw=; b=RuPso9VfusBl0274vUAs4Cs/yMdvqowxElUa72wehC8Z9YKCj3nK20jc01YPaGBtKM EIIFHXztnCCANMge/a1gaZhnWag5Je+lNENV/w9F0Q8r0ESh5y0vb8JutlwIDFxNs7S4 UalZjmEEyrnCZJ9WkVUGTC2vJQ1aAGYAIND6kPb6mWv4LIWYwxRj+m1V+e4PQAvFvRGg eQDEj7XfrtbK+vHddfpABR1qfnnJ10qjL4kdOGKQUJm0vWXPoZoRJ3HprkkgOB1OyuM9 kifCUKM3Wz6lXX7xUgnmaIOkGiwy5UJoBJ76+TAgDJY835t2+oJz5jKkhT5TmitQH92H hQVA== X-Gm-Message-State: APjAAAVpdhFlbgRq1QRiKK+i+S+msUoJ+MqaWpNFZFhWVfPlQ3/Bj0vI 3vSMD+M5VUpGJv8SANyvs+DLP0pmKmI= X-Received: by 2002:a63:ce4a:: with SMTP id r10mr11707538pgi.336.1551978297504; Thu, 07 Mar 2019 09:04:57 -0800 (PST) Received: from cloudburst.twiddle.net (97-113-188-82.tukw.qwest.net. [97.113.188.82]) by smtp.gmail.com with ESMTPSA id r82sm10040562pfa.161.2019.03.07.09.04.56 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 07 Mar 2019 09:04:56 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Date: Thu, 7 Mar 2019 09:04:30 -0800 Message-Id: <20190307170440.3113-13-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.2 In-Reply-To: <20190307170440.3113-1-richard.henderson@linaro.org> References: <20190307170440.3113-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::543 Subject: [Qemu-devel] [PATCH v4 12/22] target/arm: Implement the STGP instruction 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 Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Richard Henderson --- v3: Handle atomicity, require pre-cleaned address. --- target/arm/translate-a64.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) -- 2.17.2 diff --git a/target/arm/translate-a64.c b/target/arm/translate-a64.c index b94a5571e0..b7175897e4 100644 --- a/target/arm/translate-a64.c +++ b/target/arm/translate-a64.c @@ -2787,7 +2787,7 @@ static void disas_ld_lit(DisasContext *s, uint32_t insn) * +-----+-------+---+---+-------+---+-------+-------+------+------+ * * opc: LDP/STP/LDNP/STNP 00 -> 32 bit, 10 -> 64 bit - * LDPSW 01 + * LDPSW/STGP 01 * LDP/STP/LDNP/STNP (SIMD) 00 -> 32 bit, 01 -> 64 bit, 10 -> 128 bit * V: 0 -> GPR, 1 -> Vector * idx: 00 -> signed offset with non-temporal hint, 01 -> post-index, @@ -2812,6 +2812,7 @@ static void disas_ldst_pair(DisasContext *s, uint32_t insn) bool is_signed = false; bool postindex = false; bool wback = false; + bool set_tag = false; TCGv_i64 clean_addr, dirty_addr; @@ -2824,6 +2825,14 @@ static void disas_ldst_pair(DisasContext *s, uint32_t insn) if (is_vector) { size = 2 + opc; + } else if (opc == 1 && !is_load) { + /* STGP */ + if (!dc_isar_feature(aa64_mte_insn_reg, s) || index == 0) { + unallocated_encoding(s); + return; + } + size = 3; + set_tag = true; } else { size = 2 + extract32(opc, 1, 1); is_signed = extract32(opc, 0, 1); @@ -2876,6 +2885,15 @@ static void disas_ldst_pair(DisasContext *s, uint32_t insn) } clean_addr = clean_data_tbi(s, dirty_addr, wback || rn != 31); + if (set_tag) { + TCGv_i64 tcg_rn = cpu_reg_sp(s, rn); + if (tb_cflags(s->base.tb) & CF_PARALLEL) { + gen_helper_stg_parallel(cpu_env, clean_addr, tcg_rn); + } else { + gen_helper_stg(cpu_env, clean_addr, tcg_rn); + } + } + if (is_vector) { if (is_load) { do_fp_ld(s, rt, clean_addr, size);