From patchwork Tue Jan 8 16:21:49 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 154984 Delivered-To: patch@linaro.org Received: by 2002:a02:48:0:0:0:0:0 with SMTP id 69csp5065141jaa; Tue, 8 Jan 2019 08:25:02 -0800 (PST) X-Google-Smtp-Source: ALg8bN4+dY9lFFgzuVTGnguIKC2mOnJf74n/XdJlB57TCIqvCqbf+gHh/glRPYO0LeSw37DTdxok X-Received: by 2002:a05:6000:120a:: with SMTP id e10mr1968539wrx.85.1546964702068; Tue, 08 Jan 2019 08:25:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1546964702; cv=none; d=google.com; s=arc-20160816; b=FZrUtQ8o05sN1cDiNeiToAIWXPiAjAdDSGuiMHzfaKE5NOO9svpGBn2+6Q017Xn5aL zvQPr2sxNnFLVywar45G9Z4svPvGd3B1lQkK9PCkVUCS2jWg6jqpD9Q35aAfJUGxgIJN DY2Vm4fJS995tiSXlxx+wH6xYg43pHj+MysN4y7w0us9SGTKCbHoCiOupLm55tPaHFD0 jNSEifx9mG9YIWybi9wM2ZMPjhFwTOzEhfiaIm2MxYvol1GVnuiPjSx8ay4UQy9UYxjv zPlynUxf3xdS08OYqEXkZkzkR6/+o8CVg9pneXE8xuFSAnuCeSDDUIdm7OOZhiHzgTOa QFOQ== 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 :content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature; bh=zxMd6GPDwM6BPndhdG+Twn4eiN8aaFHmKKsZ7ct7NIQ=; b=XX3xt7m4couA9/Xa3GOuZs2R4wqxfCFkxhf8FNZpr4ukNOzSOWBRoaCblvvPRufq9w 5Q9g6HIO1x32ktuhau4LGwPC6xuvU9kTCGW62KDRZuk9fnN2AQe1aJoU2Z2dnlSTipN1 +ZyRlWIGueSwe6yfNJ3nxHJPsPrUcFo9RbFrT7Ucp0MObMjJoFlQ/Ts/OVV/HbWpN4Y2 IwoyWMnmzbG5mc+BQF7QRGcZ8PhTJzAD0LXvKeM88yDXlgD81LovVeXLmaoVetzZMgot S44iJ0BsyyITGOoMhNZWFKt643xC79Xd3Y19WdRQnnXyPJKrgSBBfC/OoPW+0DQIvQJG YIyg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@linaro.org header.s=google header.b=gZNK2V+c; 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 i8si37960173wrm.449.2019.01.08.08.25.01 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 08 Jan 2019 08:25:02 -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=gZNK2V+c; 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]:53976 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gguBW-0006IV-1w for patch@linaro.org; Tue, 08 Jan 2019 11:24:58 -0500 Received: from eggs.gnu.org ([209.51.188.92]:47962) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ggu8g-0004EL-Sv for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:03 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ggu8f-0000fC-Ni for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:02 -0500 Received: from mail-wm1-x343.google.com ([2a00:1450:4864:20::343]:50895) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ggu8f-0000LY-ET for qemu-devel@nongnu.org; Tue, 08 Jan 2019 11:22:01 -0500 Received: by mail-wm1-x343.google.com with SMTP id n190so4729054wmd.0 for ; Tue, 08 Jan 2019 08:21: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=zxMd6GPDwM6BPndhdG+Twn4eiN8aaFHmKKsZ7ct7NIQ=; b=gZNK2V+ciswNZDvZCL6Jrt76KxiJpSVGTJckc/LLHzvS8csUr5UKh/MqZ9jM0UqFZA oG+WnTLX+4VBT7U0qLr4YJ24B4OEWH0HSxypi8egL9gxDidKdo1lkJMqO+r+bgeLybpr UYljv5m3CN+Hqvk8yjLiyUKlfD1bfKYRAwuzA= 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=zxMd6GPDwM6BPndhdG+Twn4eiN8aaFHmKKsZ7ct7NIQ=; b=Xf+T5wBDUlnXJEFZcGGieWAZm5hDam14iMKKy19biu4/yXRvnv/HU7apelpq8S5lKT RCNSErRv0jcfyzzLVEov67Rux7SiBxKjWqNUQSGpcZD9oiWxA0XPZjHbJKm+FcbDef/H eNTqcr3TZDzk2BqLjMdZPAIKxVK7oitvZUG5Si9TNlGUPzHdtRFY8A4L9EzXja3/oYnG /SYg+7JM+J4C7jWav1YJmnt/m5qsHoKLKHI1aqypMm3JDpPMJtnzSQjYJ90M53jmx9Xc MBgp6Y278Z4l+SoMO+TEA1Ioj8dDEj7HREOb5H/hKMMiqLLblt8o2Me1BzCTXWv4JnBe 12XA== X-Gm-Message-State: AJcUukdi8VQ9YwDpZhy2gcibRjqSAZVS7t43UYnWVkeAmjw5Nki3KJ7s JlWW7FLOItkeNpE00y1HBPCPDw== X-Received: by 2002:a7b:c315:: with SMTP id k21mr2182318wmj.145.1546964515698; Tue, 08 Jan 2019 08:21:55 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c10sm50030616wrw.49.2019.01.08.08.21.54 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 08 Jan 2019 08:21:54 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 7B5ED3E0D4E; Tue, 8 Jan 2019 16:21:54 +0000 (GMT) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 8 Jan 2019 16:21:49 +0000 Message-Id: <20190108162154.22259-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190108162154.22259-1-alex.bennee@linaro.org> References: <20190108162154.22259-1-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:4864:20::343 Subject: [Qemu-devel] [PATCH v1 1/6] fp-bench: fix update_random_ops 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 , cota@braap.org, =?utf-8?q?Al?= =?utf-8?q?ex_Benn=C3=A9e?= , Aurelien Jarno Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" The second test in the branches is wrong; fix while converting to a switch statement, which is easier to get right. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson Signed-off-by: Alex Bennée --- tests/fp/fp-bench.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) -- 2.17.1 diff --git a/tests/fp/fp-bench.c b/tests/fp/fp-bench.c index f5bc5edebf..546bac9c9c 100644 --- a/tests/fp/fp-bench.c +++ b/tests/fp/fp-bench.c @@ -143,15 +143,20 @@ static void update_random_ops(int n_ops, enum precision prec) for (i = 0; i < n_ops; i++) { uint64_t r = random_ops[i]; - if (prec == PREC_SINGLE || PREC_FLOAT32) { + switch (prec) { + case PREC_SINGLE: + case PREC_FLOAT32: do { r = xorshift64star(r); } while (!float32_is_normal(r)); - } else if (prec == PREC_DOUBLE || PREC_FLOAT64) { + break; + case PREC_DOUBLE: + case PREC_FLOAT64: do { r = xorshift64star(r); } while (!float64_is_normal(r)); - } else { + break; + default: g_assert_not_reached(); } random_ops[i] = r;