From patchwork Tue Jun 26 16:19:19 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 140024 Delivered-To: patch@linaro.org Received: by 2002:a2e:970d:0:0:0:0:0 with SMTP id r13-v6csp5451554lji; Tue, 26 Jun 2018 09:29:15 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdHbXFEPxI+y3rmGC2F1e+TTYq6FeZkqScEGG0Klqc1oapKjQlwdkFXkUZeh5O6saSWWAkt X-Received: by 2002:a0c:ae63:: with SMTP id z32-v6mr2109911qvc.108.1530030555479; Tue, 26 Jun 2018 09:29:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1530030555; cv=none; d=google.com; s=arc-20160816; b=OZeLMzh39WSd5RQRAR0Q9gwSlxOiXGvB3SxRvc6Q6phHaSRzXTbkx3GKFDBGg3V79Z xLjS3PcRm5ql0d1+PztXM+h5V6kCDV1LiVof9NoZBM+e/eY/5zJpwB1Qb6JxGhxYVFhF Fd7kqLjJm0wWaoqqewrEaM4Bg/zmeZocGq7Xjd/dF90Bd7th2khNQRBJeBCx9Ube7TfX FJtnPg2kE89FXC4hjsakpxWmoiCxjwHVPU8+9XZX42Psk0Ji5L+Cduxmw6ZVHWc+HN4U VdeY1VfDprxvrMxf3fVyiNNw+3p7pa3QZdNLF1AJlPM6NwZA93F41N/HS+0sUwo062qu 4s/g== 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:arc-authentication-results; bh=UzITA4QAGKPzw7tA/BTTJSlBebGKm5+75IeNPY1PlJc=; b=nWWZA0uY0ENViG2KpQxP8gmRO9sNiUTKajGrjTaZReplvyvNV0tQ/eN1FFqcfSLw5z j2JVMNk5sjT6zxpPI96jrEDmyZWvdJ6cuDGf0QDzzr5GebINMqDDhjDUPU8aT9RXjtSU KMtTSSzMz1/pW9S9nWjOqfYVSQ30h0m+1zBP3npp6T7EiR21ru1NiCRu7QwLXIevPCyj nPz+YD+2KlH3sur6XDW+fvT6rSUOeXsAlcuL6DbiauRy9R98DHCtqDKPkLGyQLjusTnn SJ0VpFUYILR1KwQknRxz3jZOyvGWJ6ca/57FuGvAs95sxCwaxVXvrueYt63CwdA/TvGt XKfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=ARimihTQ; 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 r25-v6si2013144qve.174.2018.06.26.09.29.15 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 26 Jun 2018 09:29:15 -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=ARimihTQ; 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]:53807 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXqqA-0000On-Uu for patch@linaro.org; Tue, 26 Jun 2018 12:29:15 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42624) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1fXqgz-00014q-Gp for qemu-devel@nongnu.org; Tue, 26 Jun 2018 12:19:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1fXqgw-000606-LW for qemu-devel@nongnu.org; Tue, 26 Jun 2018 12:19:45 -0400 Received: from mail-pl0-x22f.google.com ([2607:f8b0:400e:c01::22f]:42590) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1fXqgw-0005zr-Am for qemu-devel@nongnu.org; Tue, 26 Jun 2018 12:19:42 -0400 Received: by mail-pl0-x22f.google.com with SMTP id w17-v6so8772374pll.9 for ; Tue, 26 Jun 2018 09:19:42 -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; bh=UzITA4QAGKPzw7tA/BTTJSlBebGKm5+75IeNPY1PlJc=; b=ARimihTQnkmSSbz31KxonO3+9y9YQadlZwRILz62T5p/jkcyh0BGVNCxjnF5VpHPIJ TA0W+YDmYP9n6UCmfv1Mcq6l5iPXJU1R97gmJ+I0bWegso4vmUpAk9ZoHE93VLrSmkCO XtwH6dfAsvPtbjr6xXOxkXeBDfX+D5qSQbZsQ= 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=UzITA4QAGKPzw7tA/BTTJSlBebGKm5+75IeNPY1PlJc=; b=ZxNluWZ7eYEIzw9rcH2w9TyCIlOjxDl/cNNaZtCTVd60N1GlhOqJlxbHniQ6mifCzW xZdkM4Fls87ra/DdVBykClxZhBmdJBX7tPbwIgqhu0n+FWzCIbD/kTzlhiC8BOb2rM9T I+ymNbu9TU2Iax4tiLyHdFmCdHq9bF5hDwZNvbU2QEugrvOVofulq+asz4bTA9HGMAcX PxviEpemCvNpnNy8VK1KO13ADr+QcBZixAFepuNmuilT/ocUIeDV0dRMFpb9nVck/GEf OSVUT/SYbPTtXtDZd2KLIkA8yZ6g3Jpc+/UBm25Mz0feWnnrGjcRP7+jJnMZqJmmp7S8 mGLg== X-Gm-Message-State: APt69E2Rr9sJWTFMzauEE7Esple2XZOC3b1wxEEEf1uClE72KlW78Fq5 aZxGsynV+r7bAbHrNwFstL7ceyqc598= X-Received: by 2002:a17:902:1703:: with SMTP id i3-v6mr2262881pli.263.1530029981208; Tue, 26 Jun 2018 09:19:41 -0700 (PDT) Received: from cloudburst.twiddle.net (97-126-112-211.tukw.qwest.net. [97.126.112.211]) by smtp.gmail.com with ESMTPSA id 67-v6sm5054306pfm.171.2018.06.26.09.19.39 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 26 Jun 2018 09:19:39 -0700 (PDT) From: Richard Henderson To: qemu-devel@nongnu.org Date: Tue, 26 Jun 2018 09:19:19 -0700 Message-Id: <20180626161921.27941-12-richard.henderson@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20180626161921.27941-1-richard.henderson@linaro.org> References: <20180626161921.27941-1-richard.henderson@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2607:f8b0:400e:c01::22f Subject: [Qemu-devel] [PATCH 11/13] target/ppc: Use atomic min/max helpers 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: qemu-ppc@nongnu.org, david@gibson.dropbear.id.au Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" These operations were previously unimplemented for ppc. Signed-off-by: Richard Henderson --- target/ppc/translate.c | 24 ++++++++++++++++++++---- 1 file changed, 20 insertions(+), 4 deletions(-) -- 2.17.1 diff --git a/target/ppc/translate.c b/target/ppc/translate.c index c2a28be6d7..79285b6698 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -3102,13 +3102,21 @@ static void gen_ld_atomic(DisasContext *ctx, TCGMemOp memop) case 3: /* Fetch and 'and' */ tcg_gen_atomic_fetch_and_tl(dst, EA, src, ctx->mem_idx, memop); break; + case 4: /* Fetch and max unsigned */ + tcg_gen_atomic_fetch_umax_tl(dst, EA, src, ctx->mem_idx, memop); + break; + case 5: /* Fetch and max signed */ + tcg_gen_atomic_fetch_smax_tl(dst, EA, src, ctx->mem_idx, memop); + break; + case 6: /* Fetch and min unsigned */ + tcg_gen_atomic_fetch_umin_tl(dst, EA, src, ctx->mem_idx, memop); + break; + case 7: /* Fetch and min signed */ + tcg_gen_atomic_fetch_smin_tl(dst, EA, src, ctx->mem_idx, memop); + break; case 8: /* Swap */ tcg_gen_atomic_xchg_tl(dst, EA, src, ctx->mem_idx, memop); break; - case 4: /* Fetch and max unsigned */ - case 5: /* Fetch and max signed */ - case 6: /* Fetch and min unsigned */ - case 7: /* Fetch and min signed */ case 16: /* compare and swap not equal */ case 24: /* Fetch and increment bounded */ case 25: /* Fetch and increment equal */ @@ -3159,9 +3167,17 @@ static void gen_st_atomic(DisasContext *ctx, TCGMemOp memop) tcg_gen_atomic_and_fetch_tl(discard, EA, src, ctx->mem_idx, memop); break; case 4: /* Store max unsigned */ + tcg_gen_atomic_umax_fetch_tl(discard, EA, src, ctx->mem_idx, memop); + break; case 5: /* Store max signed */ + tcg_gen_atomic_smax_fetch_tl(discard, EA, src, ctx->mem_idx, memop); + break; case 6: /* Store min unsigned */ + tcg_gen_atomic_umin_fetch_tl(discard, EA, src, ctx->mem_idx, memop); + break; case 7: /* Store min signed */ + tcg_gen_atomic_smin_fetch_tl(discard, EA, src, ctx->mem_idx, memop); + break; case 24: /* Store twin */ gen_invalid(ctx); break;