From patchwork Sat Feb 4 16:32:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Richard Henderson X-Patchwork-Id: 650649 Delivered-To: patch@linaro.org Received: by 2002:a17:522:d8c:b0:4be:c3dc:14d8 with SMTP id d12csp1446617pva; Sat, 4 Feb 2023 08:35:58 -0800 (PST) X-Google-Smtp-Source: AK7set9ceUgMDOxRND8s6CVsY6dyoRSAsW0exdlTAUuqtIHbO1E4Fo5/+8uwWxanKb5JEhEOD2Zs X-Received: by 2002:a05:6214:d0d:b0:56a:620:a0f5 with SMTP id 13-20020a0562140d0d00b0056a0620a0f5mr10139317qvh.33.1675528558637; Sat, 04 Feb 2023 08:35:58 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675528558; cv=none; d=google.com; s=arc-20160816; b=CiRlDtV2HZ9kFgE/SwyWeIlN76K/i6ebEmnXgWN276e7MvR+upAKVh2BnvX2Juij/H IIZXYyImPWaP7yTWiOPSiNdle8paFEx10b+fMfSW6epcXrx2Q5Aa/7Qa8ahS2EIV03PL XC3Poj+PheZliq7VQz6YjyJeQkGOSf/1+sv0ELoBmcXv7ZG4sFfZIvbsop3e2v4aBI+n 8G3Qh6g4Bblfyk9AQg/TyGnwYByQm5Jt5o0i3Qbt49QyiX8G8vaQvYBUnzIh+mxXYwNm 0dKdgc9PuQUDK5aRAO/TpAouYVB6aF+ujBIkCwXM0S2/Y7e2mt2blenc1MaAWzTfol+M oKMA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to: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:cc:to :from:dkim-signature; bh=lE4xtEA+pGCE8llxbq4kNT+2kFoTqQa5IGjt6U1bFuE=; b=BrE1FZTPdazF2Ng3VdnOWBJzk2v3bYDOnpFO8eA6f3CCVIwjbdqeoZ2htI27U2n505 fAV/gkJY/AoGJ9J6cDNIYHf6Uk2279aAJsasceBomZDnW9u+sVPN0XJV90TMndE8JwSA hbP/O17dy2A0fh9oidQjKjoFNSWrBP851eVlLRGlcxY7Sxw03Ala0MeGoEvPwp3wx3+M 9y5ZIZ74OFl8tDWPI/otxy0DN5tAddH/Uko+63jSM0JEM0FSva79dsSSdpNGNYtwl4ay QzbmJ9+0avIPsFA78m1EFRMk9aY8NYT71MJVVqTH1+6hwrbXzLw/bApfRxjdmpoOuyf6 NJJQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WRKse3cn; 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 j188-20020a3787c5000000b00724b65caeedsi4000089qkd.194.2023.02.04.08.35.58 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Sat, 04 Feb 2023 08:35:58 -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=WRKse3cn; 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] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pOLUA-0005Bz-18; Sat, 04 Feb 2023 11:33:54 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pOLU7-0005BX-Uo for qemu-devel@nongnu.org; Sat, 04 Feb 2023 11:33:51 -0500 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pOLU6-0002Tr-BH for qemu-devel@nongnu.org; Sat, 04 Feb 2023 11:33:51 -0500 Received: by mail-pj1-x1032.google.com with SMTP id e10-20020a17090a630a00b0022bedd66e6dso11535525pjj.1 for ; Sat, 04 Feb 2023 08:33:49 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=lE4xtEA+pGCE8llxbq4kNT+2kFoTqQa5IGjt6U1bFuE=; b=WRKse3cnNmGf1HtdJbbxjiurAlv6wV+C40wlV43Jl2JveiAAhelgwSoG/LegdI/b0V BoCKbu44ZhLbdmNZpBiaEdfYhimFSxP5CysVWLP/0lqdUvaQ6FqAzRXQqP87FZXukj0Z r+mfhpR5ClBXeWvhGKvkiCNNddI3YU9o9FghETE9xL1FNzL+gq90NFhA520kGFlcSwg3 haKCMW+XK/gnUr1ZEOu02Eu4IrUx8NMhH8NoA5/HV1e9vK4iyHBhmX5cy28tEyQMNb6q wQbrU2qGRgCo93O13qVPOWAjvUuh9wiVU2WWLDXvJpPf66fGj0MoinGI6yZqvESX1tIk qY/w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=lE4xtEA+pGCE8llxbq4kNT+2kFoTqQa5IGjt6U1bFuE=; b=vaDbs2TvIvno7660RdyTqU1iIhaUqYPSHgg+sUWEmzi7l22Gn5Y4uoisdT/DUKwvqE UYIOmSVp3EAI9doVTt5mCrRpRL52F2kQBbXjm64yGoTDZ5XhgyKfk9/nFoPs4eNKJRYw bDVX9BuD4iMXQxr9/pLXC/mEiTK2TmwFXu3BuHuL/+bVZAcZOo6E8GBN/FXIZEmY9s7u 5YccgFtSIQUVQOVKn20K/2jQuV7v5kpPJlk4JS20Vi9uGXlZYLOcDwnLlhTGxNLtPysu 6IGRaOdqW9IOuZrTvyjary0emamH5VTQ/O6SVA6Qd69yBwhE2dCJ6pQfbU8NFCqqZAS+ uhdw== X-Gm-Message-State: AO0yUKUSffz/k4K8RoVbYpVVAfbeYaBITaPhNtGxtzYzVGdmPf5Hm+F5 dTUpWGy77gN2f0GE76IwOsoQxDQKvhfx9SaA X-Received: by 2002:a17:902:f24a:b0:198:f027:5925 with SMTP id j10-20020a170902f24a00b00198f0275925mr2376231plc.64.1675528429516; Sat, 04 Feb 2023 08:33:49 -0800 (PST) Received: from stoup.. (rrcs-173-197-98-118.west.biz.rr.com. [173.197.98.118]) by smtp.gmail.com with ESMTPSA id w19-20020a1709029a9300b00186b69157ecsm3660859plp.202.2023.02.04.08.33.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 04 Feb 2023 08:33:49 -0800 (PST) From: Richard Henderson To: qemu-devel@nongnu.org Cc: peter.maydell@linaro.org, Ilya Leoshkevich Subject: [PULL 23/40] tests/tcg/s390x: Add div.c Date: Sat, 4 Feb 2023 06:32:53 -1000 Message-Id: <20230204163310.815536-24-richard.henderson@linaro.org> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230204163310.815536-1-richard.henderson@linaro.org> References: <20230204163310.815536-1-richard.henderson@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2607:f8b0:4864:20::1032; envelope-from=richard.henderson@linaro.org; helo=mail-pj1-x1032.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=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Ilya Leoshkevich Add a basic test to prevent regressions. Signed-off-by: Ilya Leoshkevich Message-Id: <20221101111300.2539919-1-iii@linux.ibm.com> Signed-off-by: Richard Henderson --- tests/tcg/s390x/div.c | 40 +++++++++++++++++++++++++++++++++ tests/tcg/s390x/Makefile.target | 1 + 2 files changed, 41 insertions(+) create mode 100644 tests/tcg/s390x/div.c diff --git a/tests/tcg/s390x/div.c b/tests/tcg/s390x/div.c new file mode 100644 index 0000000000..5807295614 --- /dev/null +++ b/tests/tcg/s390x/div.c @@ -0,0 +1,40 @@ +#include +#include + +static void test_dr(void) +{ + register int32_t r0 asm("r0") = -1; + register int32_t r1 asm("r1") = -4241; + int32_t b = 101, q, r; + + asm("dr %[r0],%[b]" + : [r0] "+r" (r0), [r1] "+r" (r1) + : [b] "r" (b) + : "cc"); + q = r1; + r = r0; + assert(q == -41); + assert(r == -100); +} + +static void test_dlr(void) +{ + register uint32_t r0 asm("r0") = 0; + register uint32_t r1 asm("r1") = 4243; + uint32_t b = 101, q, r; + + asm("dlr %[r0],%[b]" + : [r0] "+r" (r0), [r1] "+r" (r1) + : [b] "r" (b) + : "cc"); + q = r1; + r = r0; + assert(q == 42); + assert(r == 1); +} + +int main(void) +{ + test_dr(); + test_dlr(); +} diff --git a/tests/tcg/s390x/Makefile.target b/tests/tcg/s390x/Makefile.target index 07fcc6d0ce..ab7a3bcfb2 100644 --- a/tests/tcg/s390x/Makefile.target +++ b/tests/tcg/s390x/Makefile.target @@ -24,6 +24,7 @@ TESTS+=trap TESTS+=signals-s390x TESTS+=branch-relative-long TESTS+=noexec +TESTS+=div Z13_TESTS=vistr $(Z13_TESTS): CFLAGS+=-march=z13 -O2