From patchwork Tue May 8 15:14:27 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 135176 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp4510519lji; Tue, 8 May 2018 08:15:12 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoIY3DUEqYVFCXCwhF99zdyiBFAJK6Vmjh5o/Rr0fxTXZdfOde21zfONwTczZOdzQFUTxC1 X-Received: by 10.233.221.65 with SMTP id r62mr25888201qkf.332.1525792512530; Tue, 08 May 2018 08:15:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525792512; cv=none; d=google.com; s=arc-20160816; b=h5H5WNAhQNDcWn9fmGOOPag5M7FgjhnHPkkqxULbmo3QwfrGZJzDj53qH+Pi4lgEVh MJXbamJ6F70xKBL9XmTo2BTPUipQbwyczXhimJuwbFZNlL9yNlmq/XbT7ghswrLtHTrE 19gX4cmaHiuXsmsKk85RmvhekR/cWYnup5an2oAs/bsJJu09RubClrDIgQXAfFDuJETh sJeWuQg3s+BL1mvr59hRJwCQN8fSVTodo8g5pxokOPdAxOFw1Csqykvg/3l5t3+CBl3w Wwf5KMpgaljxv3sT719P5Q4lM5V68vvRJrxyRv3WTdKuH8MYuc8tYC95MABEr3wbgobp 8M8A== 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:message-id:date:to:from :dkim-signature:arc-authentication-results; bh=iYu63v5b60V67oGEvF5sC8JEfqTDRAlABTDTebTkLe0=; b=M4yt2cd9rEd2fLoagQN+DsxbBdtc1sL6LG5J3IUcv9WdQLpY2r/ToakyVxp5W3Td5x DGZMIzAMDfLvaPtFI1NtaPHlwnzvN/UJACqDARsNR8EQznSlfs3fhUAn9P6PI7DvhPyP MGJ0wQw3SS8X87PafEkfOvpxyPg1ca7gHERUqy2WhmAhIc2ewWbJnSgg4H4HFsKxFm+j qWoP2iYJlv3qFgtL/trMsy6VqxoX+4cUJm8dfN+OyujWCyZICBauqTfvTm26VaG1bUs2 OOyfNbXcJAk9e6sX3WvqpipZPCM57rhIKwXcAi4mWfSjsWWWCtHhtEKXEMOQjzq7TMWx Vazw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=SHRnyl0S; 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 e3si3516849qkm.59.2018.05.08.08.15.12 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 May 2018 08:15:12 -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=SHRnyl0S; 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]:51792 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG4Ke-0006bj-0n for patch@linaro.org; Tue, 08 May 2018 11:15:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59474) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fG4KC-0006Xd-UY for qemu-devel@nongnu.org; Tue, 08 May 2018 11:14:45 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fG4K8-00084W-Vd for qemu-devel@nongnu.org; Tue, 08 May 2018 11:14:44 -0400 Received: from mail-pg0-x22c.google.com ([2607:f8b0:400e:c05::22c]:43440) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fG4K8-00083l-OP for qemu-devel@nongnu.org; Tue, 08 May 2018 11:14:40 -0400 Received: by mail-pg0-x22c.google.com with SMTP id k11-v6so20197544pgo.10 for ; Tue, 08 May 2018 08:14:40 -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; bh=iYu63v5b60V67oGEvF5sC8JEfqTDRAlABTDTebTkLe0=; b=SHRnyl0Syyjx8sdWCQXpB/cGF9k1AFGQpGlFGZICQStVMRhqnUd4y9/RHl5PbIEkYm dTXCoc2eiRa3fURqQ39++xl8rL/LzTIen8D8H0H5o3Zy7Fmi/H75Vm1c0MevzWhVr9Gf qozibAULfB5yBjJ2UCudv5pjbZYXkKrZ/RlSo= 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; bh=iYu63v5b60V67oGEvF5sC8JEfqTDRAlABTDTebTkLe0=; b=bjEOg0vHo+X923pDTSvTyITPeCb0RhYcKiQG9Bvuh81Wjon6yoRhKULK8THfInhg+M e97Px8lqdmPYjwzDimTvd1YGDdkACDk8oSdG/dK/ZGhI/dr31yCFrH9CpbvYaVqRJcPe BOdBm8s07gqB/JAjkqd5a6tdMoPT6IDt3IM+TzzK/cJfRvyk7oRgzNQIVHve/gyHhRq9 zB3vMYrYThBGrH9glug/lEThyj3pQgwxOABXMOEbdDfJ6qhyx2PCvOghbwwSQqTQrv8/ ST2rkPbyg9tmLphl0rqbkDB2kNQvrMT8PSS4r5nBJF7GDBHZjaG4BcOiucqX6Yoo8sLV WwIA== X-Gm-Message-State: ALQs6tC6OvTmoVv/V96H7+T0umyIAua7d6hSwLyQXL6WjZG5c8c6Svlg F8hBe0anyHpthxy+wEyEN5BR1Et/KVA= X-Received: by 10.98.91.2 with SMTP id p2mr32166691pfb.96.1525792479490; Tue, 08 May 2018 08:14:39 -0700 (PDT) Received: from cloudburst.twiddle.net (97-113-2-170.tukw.qwest.net. [97.113.2.170]) by smtp.gmail.com with ESMTPSA id n10sm55598896pfj.68.2018.05.08.08.14.38 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 May 2018 08:14:38 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 8 May 2018 08:14:27 -0700 Message-Id: <20180508151437.4232-1-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c05::22c Subject: [Qemu-devel] [PATCH v3 00/10] target/arm: Implement v8.1-Atomics 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" This implements the Atomics extension, which is mandatory for v8.1. While testing the v8.2-SVE extension, I've run into issues with the GCC testsuite expecting this to exist. Missing is the wiring up of the system registers to indicate that the extension exists, but we have no system CPU model that would exercise such a setting. Changes since v3: * Patch 8: Do not zero-extend X[s] via the third parameter to read_cpu_reg. Changes since v2: * New patch to use a helper macro for opposite-endian atomic_fetch_add and atomic_add_fetch, as suggested by pm215. * Introduce ARM_FEATURE_V8_1 and define ARM_FEATURE_V8_ATOMICS in terms of that, reinforcing the mandatory nature of the extension. * Typo fix in patch 8. r~ Richard Henderson (10): tcg: Introduce helpers for integer min/max target/arm: Use new min/max expanders target/xtensa: Use new min/max expanders tcg: Introduce atomic helpers for integer min/max tcg: Use GEN_ATOMIC_HELPER_FN for opposite endian atomic add target/riscv: Use new atomic min/max expanders target/arm: Introduce ARM_FEATURE_V8_ATOMICS and initial decode target/arm: Fill in disas_ldst_atomic target/arm: Implement CAS and CASP target/arm: Enable ARM_FEATURE_V8_ATOMICS for user-only accel/tcg/atomic_template.h | 112 +++++++---- accel/tcg/tcg-runtime.h | 8 + target/arm/cpu.h | 2 + target/arm/helper-a64.h | 2 + tcg/tcg-op.h | 50 +++++ tcg/tcg.h | 8 + linux-user/elfload.c | 1 + target/arm/cpu64.c | 1 + target/arm/helper-a64.c | 43 +++++ target/arm/translate-a64.c | 375 ++++++++++++++++++++++++++++-------- target/riscv/translate.c | 72 ++----- target/xtensa/translate.c | 50 +++-- tcg/tcg-op.c | 48 +++++ 13 files changed, 587 insertions(+), 185 deletions(-) -- 2.17.0