From patchwork Thu Aug 25 19:09:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 74704 Delivered-To: patch@linaro.org Received: by 10.140.29.52 with SMTP id a49csp995790qga; Thu, 25 Aug 2016 12:11:10 -0700 (PDT) X-Received: by 10.237.37.155 with SMTP id x27mr12226724qtc.12.1472152270331; Thu, 25 Aug 2016 12:11:10 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id j7si9320871qkh.221.2016.08.25.12.11.10 for (version=TLS1 cipher=AES128-SHA bits=128/128); Thu, 25 Aug 2016 12:11:10 -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; 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 dis=NONE) header.from=linaro.org Received: from localhost ([::1]:57696 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bd03R-00071Y-Sq for patch@linaro.org; Thu, 25 Aug 2016 15:11:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:40808) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bd023-0006Yy-07 for qemu-devel@nongnu.org; Thu, 25 Aug 2016 15:09:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bd01x-00080b-Sf for qemu-devel@nongnu.org; Thu, 25 Aug 2016 15:09:42 -0400 Received: from mail-wm0-x234.google.com ([2a00:1450:400c:c09::234]:38430) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bd01x-00080K-8j for qemu-devel@nongnu.org; Thu, 25 Aug 2016 15:09:37 -0400 Received: by mail-wm0-x234.google.com with SMTP id o80so86694090wme.1 for ; Thu, 25 Aug 2016 12:09:36 -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=kF1IAzuNsqHamRlScVC/pv/GKVxo2e24kZAPgaw/G5w=; b=gcdEiNmsMvzTuzuV7MPDYcR8o8GAUeDnLgwVJeouHZ8wX0uKnFzDiqTuSHrppDdsde lylhe9e6ymFhcmwr6ZI6mOZlrHMwyD+BSDZ//3SZoWR/dTS6aMuJzAmjjgIg+JesgF5g WSDwkr2Q9xZ1EGrbhnEDSiowh4fKD34I25kHg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=kF1IAzuNsqHamRlScVC/pv/GKVxo2e24kZAPgaw/G5w=; b=ZKvtx4HcMLYZdDz/Zd3hiDyKybMIm2JqRSs0qPnJvM57qgUqsKwt9DRH0ntOnphN7H 6VmXgpWmiU9S1/oOkBQhxDNekUbIZGWsI6rZnzMIOQRKE7bB3nEpni9T9S3AsDI0Zdbe gz+S5r2+9Wn7HxKiwz13Kw7aBG0rctHqtMiamEo3r8Ko395ouClzp1RCYCvj1n5j/RiV eZp8iUpTlf5AJk4cltop6lyoZtrqbaCLNOyWL0lbXxPaDVHBY+wXvR8rhigT+zftfVy0 ANYsX6ep1UbD82bX04HtenOiwQPoJeaPw78/6xYXoF5dB2LMaAwrnTwvvU7E0wIhl/oH mWbw== X-Gm-Message-State: AEkoouuQ2jaZGu43Dk+/gZeP9aWV+Zx3uclyfDOESLCdqANLkcD0CuKMKgcqdh5+Yeuz+VhE X-Received: by 10.28.157.214 with SMTP id g205mr29809335wme.34.1472152176087; Thu, 25 Aug 2016 12:09:36 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id ly9sm16427178wjb.44.2016.08.25.12.09.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 25 Aug 2016 12:09:34 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 167B63E005D; Thu, 25 Aug 2016 20:09:44 +0100 (BST) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: rth@twiddle.net, cota@braap.org Date: Thu, 25 Aug 2016 20:09:30 +0100 Message-Id: <1472152170-18562-1-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1467392693-22715-5-git-send-email-rth@twiddle.net> References: <1467392693-22715-5-git-send-email-rth@twiddle.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::234 Subject: [Qemu-devel] [PATCH] fixup! int128: Use __int128 if available 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: =?UTF-8?q?Alex=20Benn=C3=A9e?= , "open list:All patches CC here" Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: "Qemu-devel" --- ajb: - fixup the test-128 test case --- tests/test-int128.c | 22 +++++++++++----------- 1 file changed, 11 insertions(+), 11 deletions(-) -- 2.7.4 diff --git a/tests/test-int128.c b/tests/test-int128.c index 4390123..b86a3c7 100644 --- a/tests/test-int128.c +++ b/tests/test-int128.c @@ -41,7 +41,7 @@ static Int128 expand(uint32_t x) uint64_t l, h; l = expand16(x & 65535); h = expand16(x >> 16); - return (Int128) {l, h}; + return (Int128) int128_make128(l, h); }; static void test_and(void) @@ -54,8 +54,8 @@ static void test_and(void) Int128 b = expand(tests[j]); Int128 r = expand(tests[i] & tests[j]); Int128 s = int128_and(a, b); - g_assert_cmpuint(r.lo, ==, s.lo); - g_assert_cmpuint(r.hi, ==, s.hi); + g_assert_cmpuint(int128_getlo(r), ==, int128_getlo(s)); + g_assert_cmpuint(int128_gethi(r), ==, int128_gethi(s)); } } } @@ -70,8 +70,8 @@ static void test_add(void) Int128 b = expand(tests[j]); Int128 r = expand(tests[i] + tests[j]); Int128 s = int128_add(a, b); - g_assert_cmpuint(r.lo, ==, s.lo); - g_assert_cmpuint(r.hi, ==, s.hi); + g_assert_cmpuint(int128_getlo(r), ==, int128_getlo(s)); + g_assert_cmpuint(int128_gethi(r), ==, int128_gethi(s)); } } } @@ -86,8 +86,8 @@ static void test_sub(void) Int128 b = expand(tests[j]); Int128 r = expand(tests[i] - tests[j]); Int128 s = int128_sub(a, b); - g_assert_cmpuint(r.lo, ==, s.lo); - g_assert_cmpuint(r.hi, ==, s.hi); + g_assert_cmpuint(int128_getlo(r), ==, int128_getlo(s)); + g_assert_cmpuint(int128_gethi(r), ==, int128_gethi(s)); } } } @@ -100,8 +100,8 @@ static void test_neg(void) Int128 a = expand(tests[i]); Int128 r = expand(-tests[i]); Int128 s = int128_neg(a); - g_assert_cmpuint(r.lo, ==, s.lo); - g_assert_cmpuint(r.hi, ==, s.hi); + g_assert_cmpuint(int128_getlo(r), ==, int128_getlo(s)); + g_assert_cmpuint(int128_gethi(r), ==, int128_gethi(s)); } } @@ -180,8 +180,8 @@ test_rshift_one(uint32_t x, int n, uint64_t h, uint64_t l) { Int128 a = expand(x); Int128 r = int128_rshift(a, n); - g_assert_cmpuint(r.lo, ==, l); - g_assert_cmpuint(r.hi, ==, h); + g_assert_cmpuint(int128_getlo(r), ==, l); + g_assert_cmpuint(int128_gethi(r), ==, h); } static void test_rshift(void)