From patchwork Thu Apr 19 13:58:19 2018 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: 901154 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OZnVqa2p"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgbn0FcKz9s37 for ; Fri, 20 Apr 2018 00:00:05 +1000 (AEST) Received: from localhost ([::1]:49802 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A6U-0005zW-Ol for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:00:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42555) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5c-0005vx-8C for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5Z-00024Y-6R for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:08 -0400 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:40520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5Y-000243-VA for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:05 -0400 Received: by mail-wr0-x22f.google.com with SMTP id v60-v6so14336320wrc.7 for ; Thu, 19 Apr 2018 06:59:04 -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 :mime-version:content-transfer-encoding; bh=u29oiq3CC+KvaxAcUAHApC35h6dnscSEFhWDu5R5SEM=; b=OZnVqa2pBXjIUT1OJ3KSblkqKzo/9IcMLIVCZf86pAfCO9exzOyIwAodyuhN2nSvAV h7qc6j3O1IqUuEJi7+/3K7TjvNe1BgOvuFBsdVtQEX6eExP3uRRVJLdWza508secjRV5 9tAbMq+FyHEpEJ+7oDFt+ayVmnxwifBlM0V7A= 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=u29oiq3CC+KvaxAcUAHApC35h6dnscSEFhWDu5R5SEM=; b=TlRzRb5QeRm87u3nivNCdiJQ9HtFg93m1vV5OReytDM3Xpsgvmos0YXSYny88EwQUk LcUJo+Y39ZyzBTN1faHdicclmaXq3reRCLXF6lwrO/8e8iyJtOBb3P0HQg1dmC5Hm/SH dH7ct9k7qxcHentBZGpVoUKzQ1uVktoSfS/DVYyuBm5/jtMroQ1+jSB5VZ3Ec1gxwwx8 WbeiPB7C2GgePZb8cR4AGn07iBPBQbusBP1bJK6qSpGmzC4bhtzy0shsKM6iuSpJT3Nk nHJxh2WXJwOK7fTSc28ek7bl8e02yS5d25Y09S6JGpmr7YA11t3/StWPUIk6eCvC6PxT UZsA== X-Gm-Message-State: ALQs6tBFDkvlztR4bsENm8cyrMBmwKGvQERvaeoykYr8CE2yxrbvDgEj fD42RfiE5uVrEg7c6oDDCJffhA== X-Google-Smtp-Source: AIpwx49NNzuHhVwHKoyrODq7S/LhdrQTpoSpFEnzRrSkmK7iCDNvEI4Juyrkt5F4O6Yb+J+r4mKU2A== X-Received: by 2002:adf:ea01:: with SMTP id q1-v6mr243731wrm.50.1524146343766; Thu, 19 Apr 2018 06:59:03 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 11sm3764188wmd.26.2018.04.19.06.59.01 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 9B69F3E0288; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:19 +0100 Message-Id: <20180419135901.30035-2-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::22f Subject: [Qemu-devel] [PATCH v2 01/43] docker: add "probe" command for configure 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Peter Maydell This is a helper function for the configure script. It replies yes, sudo or no to inform the user if non-interactive docker support is available. We trap the Exception to fail gracefully. Signed-off-by: Alex Bennée Reviewed-by: Fam Zheng --- tests/docker/docker.py | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 1246ba9578..f8267586eb 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -390,6 +390,24 @@ class ImagesCommand(SubCommand): def run(self, args, argv): return Docker().command("images", argv, args.quiet) + +class ProbeCommand(SubCommand): + """Probe if we can run docker automatically""" + name = "probe" + + def run(self, args, argv): + try: + docker = Docker() + if docker._command[0] == "docker": + print "yes" + elif docker._command[0] == "sudo": + print "sudo" + except Exception: + print "no" + + return + + def main(): parser = argparse.ArgumentParser(description="A Docker helper", usage="%s ..." % os.path.basename(sys.argv[0])) From patchwork Thu Apr 19 13:58:20 2018 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: 901151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="h9RCiIO1"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgbh4cZdz9s1l for ; Thu, 19 Apr 2018 23:59:59 +1000 (AEST) Received: from localhost ([::1]:49797 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A6O-0005wT-Me for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 09:59:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42556) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5c-0005vy-8a for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5a-00025a-0Y for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:08 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:43520) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5Z-00024V-P0 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:05 -0400 Received: by mail-wr0-x244.google.com with SMTP id u4-v6so14330285wrg.10 for ; Thu, 19 Apr 2018 06:59:05 -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 :mime-version:content-transfer-encoding; bh=PBBcL7evx4AUc+MVUfWzM5d2rbr035v+hr9e0PLaeTo=; b=h9RCiIO1eKYenMVPiIJ/aZLtkhm/lxEl5t80egGSXxZsNDAcDDq8KeW6h6Wdvwn0E5 Og3rZiKWfi9jHMHFeU7NlbU9NLurzHumcpgWR3UV9RLJvm0sv82V5mABqQBsEhXX+o9/ HsydmIowj9rAvWBuFA/WYbut2FZOAt0VdJZBs= 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=PBBcL7evx4AUc+MVUfWzM5d2rbr035v+hr9e0PLaeTo=; b=DBomgwxrcWkvjeJriBXAl3GzAeMlzz/cuWrgf99OkivAUCm4kMoLg4/5guiiEGt8QZ L+aEJmcKprJj+PKGAoZSHrmuQnn2o4RL1Z9MskSnGr3DIN3YypujHwCLOJrkhevhLgHP 0HOK835jSSDht/zrJQG6uP1+p/VCzoGVMrMDB1l0MyLh+/PX19WozlOXYJE52Z7B+wOo i8Gufjgmrb7OA69L8zIwx5lbecPpkLrjAdxe2gPsria6GVsVLOXm2FubJbeoMPXeqNqM XXITRIffMORnhk0G2iOyUQH1n1hytaypOWyY3tv0ocXnGxsDpBCU00/rJaBL7q9tu+la mKIg== X-Gm-Message-State: ALQs6tCUIaeEG9uN2qQMxpzPkMrfoI8DJ/K5g/XdXvwaAvaeFwjimdly j3CuKvtayDKk0f2xWH+rsBW5WQ== X-Google-Smtp-Source: AIpwx4/CpAeZ15lY3V4zH2R/h+0IBaI1dBebsFqkoKcvrf2Xd9cElJumtlxm4e1j2GqieiuuS10nfg== X-Received: by 10.28.237.11 with SMTP id l11mr4533276wmh.160.1524146344565; Thu, 19 Apr 2018 06:59:04 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id k11sm4600027wmi.35.2018.04.19.06.59.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id AD0FE3E02CB; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:20 +0100 Message-Id: <20180419135901.30035-3-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 02/43] configure: add test for docker availability 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This tests for a working docker installation without sudo and sets up config-host.mak accordingly. This will be useful from cross compiling things in the future. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- configure | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/configure b/configure index 0a19b033bc..b0ae632ee4 100755 --- a/configure +++ b/configure @@ -451,6 +451,7 @@ jemalloc="no" replication="yes" vxhs="" libxml2="" +docker="no" supported_cpu="no" supported_os="no" @@ -5413,6 +5414,17 @@ EOF fi fi +########################################## +# Docker and cross-compiler support +# +# This is specifically for building test +# cases for foreign architectures, not +# cross-compiling QEMU itself. + +if has "docker"; then + docker=$($python $source_path/tests/docker/docker.py probe) +fi + ########################################## # End of CC checks # After here, no more $cc or $ld runs @@ -5874,6 +5886,7 @@ echo "avx2 optimization $avx2_opt" echo "replication support $replication" echo "VxHS block device $vxhs" echo "capstone $capstone" +echo "docker $docker" if test "$sdl_too_old" = "yes"; then echo "-> Your SDL version is too old - please upgrade to have SDL support" @@ -6697,6 +6710,10 @@ if test "$gcov" = "yes" ; then echo "GCOV=$gcov_tool" >> $config_host_mak fi +if test "$docker" != "no"; then + echo "HAVE_USER_DOCKER=y" >> $config_host_mak +fi + # use included Linux headers if test "$linux" = "yes" ; then mkdir -p linux-headers From patchwork Thu Apr 19 13:58:21 2018 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: 901156 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SHvC6Jl+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rggl5y28z9s27 for ; Fri, 20 Apr 2018 00:03:30 +1000 (AEST) Received: from localhost ([::1]:49819 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A9o-0000MY-O6 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:03:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42564) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5c-0005vz-Ig for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5b-00026K-27 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:08 -0400 Received: from mail-wr0-x233.google.com ([2a00:1450:400c:c0c::233]:43743) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5a-00025g-Qq for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:06 -0400 Received: by mail-wr0-x233.google.com with SMTP id u4-v6so14330461wrg.10 for ; Thu, 19 Apr 2018 06:59:06 -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 :mime-version:content-transfer-encoding; bh=57DG2ledkL4kd6fdevGAh9vF1I76amNVFoyAwiMCJcs=; b=SHvC6Jl+6ToQeeadlGScZVRg7JNGAVHiRhVSUD0TrLBfSYHXRmxv5ZrLi7T25XmjXD 0aWQuJX3XUEUqJV7dBDB9Oqe+7PkhOj9/k2IdzLOpIvIJIrxjcrq1ltfg7atTrrkUzCR vEgEjoVRjkERr9WdCs06Nda9106LgExr5OV0w= 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=57DG2ledkL4kd6fdevGAh9vF1I76amNVFoyAwiMCJcs=; b=cn4f/kJih8He9XiatvtcHIQ9eaXHn2w5s6AC0xgNAa6wn5oTFjIL/Q7a2fQtHT6mVQ dVEKNrNYde1FRCKCeIKPtV1WvI1KtyMxAiDyR4Fa2Vf861xkHy9vujz7/V3p5+vz2823 IleNgnXYwgvBCUGQVsumcpHron0v7Sz+1NntcqDVEJnPDuHBoLP6KbxP7Ns8e2pnG3z2 PGx0NTluPCjFDZerUC7cwQYSniudxcR/xBuwVKszWqwbTKHzd25EWrN/ssKVOy1sJ5mW 1MGEE4S+kGUpd3yDssizerr7Pe8qCCtHd0co+HC9KEDCongqt0f0hQvsPcsPdSyegv+E 3zkw== X-Gm-Message-State: ALQs6tA8r3rGAkmcxNbGaM127Tij+oNsI6uO6SLddAtvoFOwxa9M2bjL G3YwZOt6TjK+Iw07Hjow03LIKQ== X-Google-Smtp-Source: AIpwx49/g5AO+RsSTNhJ4XrfDsGPtQMHcSDjFJuMSdXwZY0X6MiiJVcn4bwIWz6onyjyeTaOBThZuw== X-Received: by 2002:adf:db90:: with SMTP id u16-v6mr5069350wri.90.1524146345625; Thu, 19 Apr 2018 06:59:05 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u187sm2632wmu.46.2018.04.19.06.59.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id BED9B3E0308; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:21 +0100 Message-Id: <20180419135901.30035-4-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::233 Subject: [Qemu-devel] [PATCH v2 03/43] configure: add support for --cross-cc-FOO 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This allows us to specify cross compilers for our guests. This is useful for building test images/programs. Currently we re-run the compile test for each target. I couldn't think of a way to cache the value for a given arch without getting messier configure code. The cross compiler for the guest is visible to each target as CROSS_CC_GUEST in config-target.mak. Signed-off-by: Alex Bennée --- configure | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) diff --git a/configure b/configure index b0ae632ee4..0dca341f2a 100755 --- a/configure +++ b/configure @@ -453,6 +453,13 @@ vxhs="" libxml2="" docker="no" +# cross compilers defaults, can be overridden with --cross-cc-ARCH +cross_cc_aarch64="aarch64-linux-gnu-gcc" +cross_cc_arm="arm-linux-gnueabihf-gcc" +cross_cc_powerpc="powerpc-linux-gnu-gcc" + +enabled_cross_compilers="" + supported_cpu="no" supported_os="no" bogus_os="no" @@ -483,6 +490,11 @@ for opt do ;; --disable-debug-info) debug_info="no" ;; + --cross-cc-*[!a-zA-Z0-9_0]=*) error_exit "Passed bad --cross-cc-FOO option" + ;; + --cross-cc-*) cc_arch=${opt#--cross-cc-} + eval "cross_cc_${cc_arch}=\$optarg" + ;; esac done # OS specific @@ -675,10 +687,12 @@ case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" supported_cpu="yes" + cross_cc_i386=gcc ;; x86_64|amd64) cpu="x86_64" supported_cpu="yes" + cross_cc_x86_64=gcc ;; armv*b|armv*l|arm) cpu="arm" @@ -912,6 +926,8 @@ for opt do ;; --disable-debug-info) ;; + --cross-cc-*) + ;; --enable-modules) modules="yes" ;; @@ -6777,6 +6793,8 @@ case "$target" in ;; esac +target_compiler="" + mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -6805,6 +6823,7 @@ case "$target_name" in bflt="yes" mttcg="yes" gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" + target_compiler=$cross_cc_arm ;; aarch64|aarch64_be) TARGET_ARCH=aarch64 @@ -6812,6 +6831,7 @@ case "$target_name" in bflt="yes" mttcg="yes" gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" + target_compiler=$cross_cc_aarch64 ;; cris) ;; @@ -6853,6 +6873,7 @@ case "$target_name" in ;; ppc) gdb_xml_files="power-core.xml power-fpu.xml power-altivec.xml power-spe.xml" + target_compiler=$cross_cc_powerpc ;; ppcemb) TARGET_BASE_ARCH=ppc @@ -6927,6 +6948,25 @@ if [ "$TARGET_BASE_ARCH" = "" ]; then TARGET_BASE_ARCH=$TARGET_ARCH fi +# Do we have a cross compiler for this target? +if has $target_compiler; then + + cat > $TMPC << EOF +#include +int main(void) { + printf("Hello World!\n"); +} +EOF + + if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then + target_compiler="" + else + enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}" + fi +else + target_compiler="" +fi + symlink "$source_path/Makefile.target" "$target_dir/Makefile" upper() { @@ -7000,6 +7040,10 @@ if test "$target_bsd_user" = "yes" ; then echo "CONFIG_BSD_USER=y" >> $config_target_mak fi +if test -n "$target_compiler"; then + echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak +fi + # generate QEMU_CFLAGS/LDFLAGS for targets cflags="" @@ -7122,6 +7166,12 @@ echo "QEMU_CFLAGS+=$cflags" >> $config_target_mak done # for target in $targets +if test -n "$enabled_cross_compilers"; then + echo + echo "NOTE: cross-compilers enabled:" + printf '%s\n' $enabled_cross_compilers | sort -u +fi + if [ "$dtc_internal" = "yes" ]; then echo "config-host.h: subdir-dtc" >> $config_host_mak fi From patchwork Thu Apr 19 13:58:22 2018 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: 901153 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DBkgMq8Z"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgbl6LZQz9s27 for ; Fri, 20 Apr 2018 00:00:03 +1000 (AEST) Received: from localhost ([::1]:49800 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A6R-0005y8-SX for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:00:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42594) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5d-0005wK-La for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:10 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5c-00026h-4i for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:09 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:43519) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5b-00026O-U9 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:08 -0400 Received: by mail-wr0-x241.google.com with SMTP id u4-v6so14330667wrg.10 for ; Thu, 19 Apr 2018 06:59:07 -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 :mime-version:content-transfer-encoding; bh=lUgYhW8e6LyPBKtB7xAbRk2VE1K63xWnhPqjL/790ko=; b=DBkgMq8ZKGIlUp4oztcpBYSV78Qqmy1xg7Q04485ZV/nPLl8rSX6cMtePtBTQ/1xSZ j/cEVcibQPNBNcqd0/TxYLI8WWTTCA6HFE0I/7/+RSJlNveZmXL3TMWEypRrPFlxk0xR G2jhMu+s8JhAAgPj/9R6mAn8zzpY3j3W6KuMk= 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=lUgYhW8e6LyPBKtB7xAbRk2VE1K63xWnhPqjL/790ko=; b=hOu1K0nu3nlIkGC4G+C+IiyyYPpdNTe4FnJli37AsCyeX0EHzYGFE85ro2pe8A43JG DdZczcWI7QDGVJUZ5auOOYLd11sLttxcWNnhGIjUbi+6go3ze7mi7PjZEEKQQuI2AET9 JsfYC5yywJ7A7/S3lyAz97SOR8QKFXtWWPA6TlnLJoyvgd6KHadsRHeCYjIchRQl/aqw 6kP7yZANzCMefmmKuLiN/egJR447tloY8dSMllzlUZInUp33oPEqZimw6aVhCYl9r09i h3WDAEWCXCxx3KkaUd8aIP9Ie2TPFdw0JiAvjb3XgzVClBaKuU8ZajNtLKfhAX9lozxX c8bQ== X-Gm-Message-State: ALQs6tBWKTHZaw2nnWRjLL9oLghKv+5Zxz+fSAIQ8g5CnnJ5RZ4XZZlm M5xujswm04W8fAuSbjT34oLSfQ== X-Google-Smtp-Source: AIpwx49N5F+dGsap+n++kP0Z8E8j02864lsZ0NdeiH5ObzRutZuklDJG/7pZbLBwBKeVO4pgLy++lA== X-Received: by 2002:adf:ba50:: with SMTP id t16-v6mr2567696wrg.237.1524146346731; Thu, 19 Apr 2018 06:59:06 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b18-v6sm166283wrb.55.2018.04.19.06.59.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:02 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id D00A03E031E; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:22 +0100 Message-Id: <20180419135901.30035-5-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 04/43] configure: move i386_cc to cross_cc_i386 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Also dont assume x86_64 compiler can build i386 binaries. Signed-off-by: Alex Bennée Tested-by: Philippe Mathieu-Daudé --- v2 - drop using system x86_64 compiler for i386 compiles --- configure | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/configure b/configure index 0dca341f2a..038fb9db7b 100755 --- a/configure +++ b/configure @@ -284,7 +284,6 @@ libs_softmmu="" libs_tools="" audio_pt_int="" audio_win_int="" -cc_i386=i386-pc-linux-gnu-gcc libs_qga="" debug_info="yes" stack_protector="" @@ -457,6 +456,8 @@ docker="no" cross_cc_aarch64="aarch64-linux-gnu-gcc" cross_cc_arm="arm-linux-gnueabihf-gcc" cross_cc_powerpc="powerpc-linux-gnu-gcc" +cross_cc_i386="i386-pc-linux-gnu-gcc" +cross_cc_cflags_i386="" enabled_cross_compilers="" @@ -687,12 +688,10 @@ case "$cpu" in i386|i486|i586|i686|i86pc|BePC) cpu="i386" supported_cpu="yes" - cross_cc_i386=gcc ;; x86_64|amd64) cpu="x86_64" supported_cpu="yes" - cross_cc_x86_64=gcc ;; armv*b|armv*l|arm) cpu="arm" @@ -1435,7 +1434,6 @@ case "$cpu" in i386) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" - cc_i386='$(CC) -m32' ;; x86_64) # ??? Only extremely old AMD cpus do not have cmpxchg16b. @@ -1443,12 +1441,14 @@ case "$cpu" in # runtime and generate the fallback to serial emulation. CPU_CFLAGS="-m64 -mcx16" LDFLAGS="-m64 $LDFLAGS" - cc_i386='$(CC) -m32' + cross_cc_x86_64=$cc + cross_cc_cflags_x86_64=$CPU_CFLAGS ;; x32) CPU_CFLAGS="-mx32" LDFLAGS="-mx32 $LDFLAGS" - cc_i386='$(CC) -m32' + cross_cc_i386=$cc + cross_cc_cflags_i386="-m32" ;; # No special flags required for other host CPUs esac @@ -6675,7 +6675,6 @@ echo "CC=$cc" >> $config_host_mak if $iasl -h > /dev/null 2>&1; then echo "IASL=$iasl" >> $config_host_mak fi -echo "CC_I386=$cc_i386" >> $config_host_mak echo "HOST_CC=$host_cc" >> $config_host_mak echo "CXX=$cxx" >> $config_host_mak echo "OBJCC=$objcc" >> $config_host_mak @@ -6794,6 +6793,7 @@ case "$target" in esac target_compiler="" +target_compiler_cflags="" mkdir -p $target_dir echo "# Automatically generated by configure - do not modify" > $config_target_mak @@ -6810,10 +6810,13 @@ TARGET_ABI_DIR="" case "$target_name" in i386) gdb_xml_files="i386-32bit.xml i386-32bit-core.xml i386-32bit-sse.xml" + target_compiler=$cross_cc_i386 + target_compiler_cflags=$cross_cc_cflags_i386 ;; x86_64) TARGET_BASE_ARCH=i386 gdb_xml_files="i386-64bit.xml i386-64bit-core.xml i386-64bit-sse.xml" + target_compiler=$cross_cc_x86_64 ;; alpha) mttcg="yes" @@ -6958,7 +6961,7 @@ int main(void) { } EOF - if ! do_compiler $target_compiler -o $TMPE $TMPC -static ; then + if ! do_compiler $target_compiler $target_compiler_cflags -o $TMPE $TMPC -static ; then target_compiler="" else enabled_cross_compilers="${enabled_cross_compilers} ${target_compiler}" @@ -7042,8 +7045,13 @@ fi if test -n "$target_compiler"; then echo "CROSS_CC_GUEST=$target_compiler" >> $config_target_mak + + if test -n "$target_compiler_cflags"; then + echo "CROSS_CC_GUEST_CFLAGS=$target_compiler_cflags" >> $config_target_mak + fi fi + # generate QEMU_CFLAGS/LDFLAGS for targets cflags="" From patchwork Thu Apr 19 13:58:23 2018 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: 901152 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="PSRcCQwb"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgbm2TPPz9s2B for ; Fri, 20 Apr 2018 00:00:03 +1000 (AEST) Received: from localhost ([::1]:49801 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A6T-0005zS-Cy for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:00:01 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42645) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5f-0005xO-J3 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5e-00028x-PH for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:11 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:41554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5e-00028B-Iz for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:10 -0400 Received: by mail-wr0-x242.google.com with SMTP id v24-v6so14330342wra.8 for ; Thu, 19 Apr 2018 06:59:10 -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 :mime-version:content-transfer-encoding; bh=EUerH2jG/RsWhx4ELeJ4/AmVZEOk4gNUNLMWrWMwnYM=; b=PSRcCQwbxYxYYhOxLU0mkFGUQ00lzVxjiXqCuALHhMZ46u3cfRZTXtMkxoPzrjIBWl Y+wnczkQAUkhUA3TXYzdHPWIbQq9Rz4RUfpvFaXYKQ5x6nei2c3ETWULktphpi9lNkKb uTBPyTTvb1rF6hJWuyzRdVkuyhxdsvfi/8AT4= 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=EUerH2jG/RsWhx4ELeJ4/AmVZEOk4gNUNLMWrWMwnYM=; b=HWX20mEoFDI2JZ5pGJYDE5dw3fnih0Qe9nhPXIGDlsvoRHeRpSANX7YKDj4xNts+51 KmanncbXK1rShEt83lutkoiyAOkn8xS5JSo6jNE9TYbOOwW1Pi5agzetXiJZYSahSB92 cDyATaak3KxdggOIeE25z1k1X3J+MWOYqIzPgSQgahzAUEegLViKdnsZ7wrdjPXhA2kX Dv4jq2B82+P296gMX2MsGddCXkuXX8nBICPQ9cELlFlZiuoD1eoWr3zaeFxtmijh4Xig UqYcaBr+BHxBELmbfAnLQGFH1SyuU6fK/+W3v8N6VE5yvTwE/mG+SOuP6K9FrZBuCkjj PbnA== X-Gm-Message-State: ALQs6tC8o5HmPxdsGk7NOvoMo0MGV2LsHgKQAdC4gEN0yrUvdJk9SR0Y kK5DQW5SQRj0vFbMbGZ+8Ljpbg== X-Google-Smtp-Source: AIpwx49m9r3DVLgT5XFi1fgB741xxhzIaLndxrmD7a3LarxZxW/X08nM0xU17JJo4xYkV69LHbY3jQ== X-Received: by 2002:adf:ac64:: with SMTP id v91-v6mr4648060wrc.80.1524146349330; Thu, 19 Apr 2018 06:59:09 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a13-v6sm4073420wrc.19.2018.04.19.06.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id E1A873E031F; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:23 +0100 Message-Id: <20180419135901.30035-6-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 05/43] configure: allow user to specify --cross-cc-cflags-foo= 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" As an individual compiler may be able to support several targets with the appropriate flags we need to expose this to the user as well. Signed-off-by: Alex Bennée --- configure | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/configure b/configure index 038fb9db7b..29af33716d 100755 --- a/configure +++ b/configure @@ -454,7 +454,10 @@ docker="no" # cross compilers defaults, can be overridden with --cross-cc-ARCH cross_cc_aarch64="aarch64-linux-gnu-gcc" +cross_cc_aarch64_be="$cross_cc_aarch64" +cross_cc_cflags_aarch64_be="-mbig-endian" cross_cc_arm="arm-linux-gnueabihf-gcc" +cross_cc_cflags_armeb="-mbig-endian" cross_cc_powerpc="powerpc-linux-gnu-gcc" cross_cc_i386="i386-pc-linux-gnu-gcc" cross_cc_cflags_i386="" @@ -493,6 +496,9 @@ for opt do ;; --cross-cc-*[!a-zA-Z0-9_0]=*) error_exit "Passed bad --cross-cc-FOO option" ;; + --cross-cc-cflags*) cc_arch=${opt#--cross-cc-flags} + eval "cross_cc_cflags_${cc_arch}=\$optarg" + ;; --cross-cc-*) cc_arch=${opt#--cross-cc-} eval "cross_cc_${cc_arch}=\$optarg" ;; @@ -6827,6 +6833,7 @@ case "$target_name" in mttcg="yes" gdb_xml_files="arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" target_compiler=$cross_cc_arm + eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}" ;; aarch64|aarch64_be) TARGET_ARCH=aarch64 @@ -6835,6 +6842,7 @@ case "$target_name" in mttcg="yes" gdb_xml_files="aarch64-core.xml aarch64-fpu.xml arm-core.xml arm-vfp.xml arm-vfp3.xml arm-neon.xml" target_compiler=$cross_cc_aarch64 + eval "target_compiler_cflags=\$cross_cc_cflags_${target_name}" ;; cris) ;; From patchwork Thu Apr 19 13:58:24 2018 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: 901157 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="jZpVScVL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rggn4FQvz9s2M for ; Fri, 20 Apr 2018 00:03:33 +1000 (AEST) Received: from localhost ([::1]:49823 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A9r-0000Qh-H3 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:03:31 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42635) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5f-0005x5-3Z for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5d-00028G-Vw for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:11 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:37484) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5d-00027P-O8 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:09 -0400 Received: by mail-wr0-x242.google.com with SMTP id f14-v6so14349860wre.4 for ; Thu, 19 Apr 2018 06:59:09 -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 :mime-version:content-transfer-encoding; bh=V4loadEfQMPlIQOyz24KJ4T6ib1kKhegaW4NwHGkGiM=; b=jZpVScVLCk/9qmp25ZqblNDn4xxZibzybZGVTYyc84GH2ksbl8cq8Gc8/egOL4ibDB uOr+QZ5JgNoniDjP9QGanvZR9+PjMvQJYNPhoN9fKt1lHOlOgRf7mquxutfQJMI7XhSH b49hGFBHsNZlnnshRu/tt4fSD+FKiY9aokKV0= 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=V4loadEfQMPlIQOyz24KJ4T6ib1kKhegaW4NwHGkGiM=; b=sw+H2dR044GxZljA8csVWzA1DrtTjmL38GMgALu2svLLtyFwamJv5LwXuGOWGFbnKL fPOHd2Q6acVqjiOsxbWgo0p/LCeS3O2J94OKG3X8YKe5LO4IulU2rPInYme3i4hrMeOX JbyM+sTw5aipvT59qWq9MqHnE91e3UULHnpsgOCtMkhpQH3WAUXkpkolU/Jh4k2k7gpn OzX7B2zP+SJWjp9EIv0XN61ysacT3jY42FfLUxb96AotJinP1VeFRTBv3e1QEdBaNVuH WynCwQh7Fc+xsUvNSSJdDexliF0TlbrK635edz/GcZP+mGsW2YNidpa9lTeCFR3AMjN1 Zbiw== X-Gm-Message-State: ALQs6tDao6tkWd87MDYpOhuZXwPI684b4X3J8k1wSG3mSKJ3/IOl12VX TrNkyRVk8ZwpsbEK77DQxbZp4g== X-Google-Smtp-Source: AIpwx49M4EGJ4OOWI5iFaYFrcTO1nr+TvPgKBRknlngT24h8zaRrLiACp/5fM1pYTh9FacrPlxyegw== X-Received: by 2002:adf:9205:: with SMTP id 5-v6mr5042971wrj.282.1524146348556; Thu, 19 Apr 2018 06:59:08 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y42-v6sm7799877wry.21.2018.04.19.06.59.03 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id F31B23E0321; Thu, 19 Apr 2018 14:59:01 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:24 +0100 Message-Id: <20180419135901.30035-7-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 06/43] configure: set cross_cc_FOO for host compiler 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We can build tests for the host system with the compiler that we have selected. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- configure | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/configure b/configure index 29af33716d..44d310a692 100755 --- a/configure +++ b/configure @@ -1416,30 +1416,44 @@ case "$cpu" in ppc) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" + cross_cc_powerpc=$cc + cross_cc_cflags_powerpc=$CPU_CFLAGS ;; ppc64) CPU_CFLAGS="-m64" LDFLAGS="-m64 $LDFLAGS" + cross_cc_ppc64=$cc + cross_cc_cflags_ppc64=$CPU_CFLAGS ;; sparc) CPU_CFLAGS="-m32 -mv8plus -mcpu=ultrasparc" LDFLAGS="-m32 -mv8plus $LDFLAGS" + cross_cc_sparc=$cc + cross_cc_cflags_sparc=$CPU_CFLAGS ;; sparc64) CPU_CFLAGS="-m64 -mcpu=ultrasparc" LDFLAGS="-m64 $LDFLAGS" + cross_cc_sparc64=$cc + cross_cc_cflags_sparc64=$CPU_CFLAGS ;; s390) CPU_CFLAGS="-m31" LDFLAGS="-m31 $LDFLAGS" + cross_cc_s390=$cc + cross_cc_cflags_s390=$CPU_CFLAGS ;; s390x) CPU_CFLAGS="-m64" LDFLAGS="-m64 $LDFLAGS" + cross_cc_s390x=$cc + cross_cc_cflags_s390x=$CPU_CFLAGS ;; i386) CPU_CFLAGS="-m32" LDFLAGS="-m32 $LDFLAGS" + cross_cc_i386=$cc + cross_cc_cflags_i386=$CPU_CFLAGS ;; x86_64) # ??? Only extremely old AMD cpus do not have cmpxchg16b. @@ -1454,7 +1468,7 @@ case "$cpu" in CPU_CFLAGS="-mx32" LDFLAGS="-mx32 $LDFLAGS" cross_cc_i386=$cc - cross_cc_cflags_i386="-m32" + cross_cc_cflags_i386=$CPU_CFLAGS ;; # No special flags required for other host CPUs esac From patchwork Thu Apr 19 13:58:25 2018 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: 901169 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="LDvT1J9+"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgqV0bdfz9s2M for ; Fri, 20 Apr 2018 00:10:14 +1000 (AEST) Received: from localhost ([::1]:50004 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AGJ-00063b-Vi for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:10:12 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42705) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5i-00060N-6a for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5g-0002DY-Uy for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:14 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:38067) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5g-0002Aa-L3 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:12 -0400 Received: by mail-wr0-x244.google.com with SMTP id h3-v6so14359052wrh.5 for ; Thu, 19 Apr 2018 06:59:12 -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 :mime-version:content-transfer-encoding; bh=ioTotYAqkFBKd5KnrtG52D7NPXHT5Pw9gIfB7plDrJM=; b=LDvT1J9+TqD1dBQmem2A8E6TiyG1M+0f1PlCwYLKoydbhu3RWZP/plqTKuztzXHrNg KStCzek/XLFnKnGBVP01agaNs5aDdNQQb1A34UBCTDntZaVdBFEBfqKxslpyHFOQv9lR GT9u8+3yqW2d7ctGrw4jbVIiTeQlCJSWsbaF4= 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=ioTotYAqkFBKd5KnrtG52D7NPXHT5Pw9gIfB7plDrJM=; b=XHKvl/GMeWBkg6H6W0r6YmzFNtW7E1Eua0+VOA43mDFFdoppEGxRFGRV1Vyvg2tevV r/M0S5eR0z6RbBhYm6+nZc12HUZ4fcF/Ec1QCB+jamQZDQg3ThFuUvbJcxcD7cv3ykbr DizL63pxDTm5ynI6Pr0rKPBHBhuOe+s8DJURV2x0rXkibHPmx/ycuSqbXLt+RNWFxp3E 2Jdk2QeEe63i3T2fHTljqkjeGqB5YNKUHuD6JacIHqG0x9GLLYpnwWjoEniuzjdIcynq kyqcg5fyQqMNAbEVcLZvkbdE4pB27irXiPK6WNCheD10oGqCfrytnUvzbzmLvRyoSqCc ipGA== X-Gm-Message-State: ALQs6tDErVJ12NMJuOYtcAzBlO+YkYsdIUdKnOEBwRX8Y9pPuc6/M9jT JTKKPitEKiCqLCf0tQ7s8yqdcA== X-Google-Smtp-Source: AIpwx4/iDnSc2ajcXqGD+6PiRRUjxHLvH84av8rfLyTPk+J2P5gYIxTdb0dcZ4IyCgYGKHXetvfV0Q== X-Received: by 2002:adf:a850:: with SMTP id l74-v6mr4627596wrc.42.1524146351444; Thu, 19 Apr 2018 06:59:11 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v134sm3130872wmv.32.2018.04.19.06.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 13D3B3E0342; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:25 +0100 Message-Id: <20180419135901.30035-8-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 07/43] Makefile: Rename TARGET_DIRS to TARGET_LIST 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-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Fam Zheng To be more accurate on its purpose and make code that looks for a certain target out of this variable more readable. Signed-off-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- Makefile | 20 ++++++++++---------- configure | 2 +- scripts/create_config | 2 +- tests/Makefile.include | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/Makefile b/Makefile index d71dd5bea4..e894431a89 100644 --- a/Makefile +++ b/Makefile @@ -62,8 +62,8 @@ seems to have been used for an in-tree build. You can fix this by running \ endif endif -CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_DIRS)),y) -CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_DIRS)),y) +CONFIG_SOFTMMU := $(if $(filter %-softmmu,$(TARGET_LIST)),y) +CONFIG_USER_ONLY := $(if $(filter %-user,$(TARGET_LIST)),y) CONFIG_XEN := $(CONFIG_XEN_BACKEND) CONFIG_ALL=y -include config-all-devices.mak @@ -362,8 +362,8 @@ DOCS= endif SUBDIR_MAKEFLAGS=$(if $(V),,--no-print-directory --quiet) BUILD_DIR=$(BUILD_DIR) -SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_DIRS)) -SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_DIRS)) +SUBDIR_DEVICES_MAK=$(patsubst %, %/config-devices.mak, $(TARGET_LIST)) +SUBDIR_DEVICES_MAK_DEP=$(patsubst %, %-config-devices.mak.d, $(TARGET_LIST)) ifeq ($(SUBDIR_DEVICES_MAK),) config-all-devices.mak: @@ -466,7 +466,7 @@ config-host.h-timestamp: config-host.mak qemu-options.def: $(SRC_PATH)/qemu-options.hx $(SRC_PATH)/scripts/hxtool $(call quiet-command,sh $(SRC_PATH)/scripts/hxtool -h < $< > $@,"GEN","$@") -SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_DIRS)) +SUBDIR_RULES=$(patsubst %,subdir-%, $(TARGET_LIST)) SOFTMMU_SUBDIR_RULES=$(filter %-softmmu,$(SUBDIR_RULES)) $(SOFTMMU_SUBDIR_RULES): $(block-obj-y) @@ -510,7 +510,7 @@ ROMSUBDIR_RULES=$(patsubst %,romsubdir-%, $(ROMS)) romsubdir-%: $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C pc-bios/$* V="$(V)" TARGET_DIR="$*/" CFLAGS="$(filter -O% -g%,$(CFLAGS))",) -ALL_SUBDIRS=$(TARGET_DIRS) $(patsubst %,pc-bios/%, $(ROMS)) +ALL_SUBDIRS=$(TARGET_LIST) $(patsubst %,pc-bios/%, $(ROMS)) recurse-all: $(SUBDIR_RULES) $(ROMSUBDIR_RULES) @@ -763,7 +763,7 @@ distclean: clean rm -f docs/interop/qemu-qmp-ref.pdf docs/interop/qemu-ga-ref.pdf rm -f docs/interop/qemu-qmp-ref.html docs/interop/qemu-ga-ref.html rm -f docs/qemu-block-drivers.7 - for d in $(TARGET_DIRS); do \ + for d in $(TARGET_LIST); do \ rm -rf $$d || exit 1 ; \ done rm -Rf .sdk @@ -864,7 +864,7 @@ endif $(INSTALL_DATA) $(SRC_PATH)/pc-bios/keymaps/$$x "$(DESTDIR)$(qemu_datadir)/keymaps"; \ done $(INSTALL_DATA) $(BUILD_DIR)/trace-events-all "$(DESTDIR)$(qemu_datadir)/trace-events-all" - for d in $(TARGET_DIRS); do \ + for d in $(TARGET_LIST); do \ $(MAKE) $(SUBDIR_MAKEFLAGS) TARGET_DIR=$$d/ -C $$d $@ || exit 1 ; \ done @@ -1062,9 +1062,9 @@ endif @echo ' ctags/TAGS - Generate tags file for editors' @echo ' cscope - Generate cscope index' @echo '' - @$(if $(TARGET_DIRS), \ + @$(if $(TARGET_LIST), \ echo 'Architecture specific targets:'; \ - $(foreach t, $(TARGET_DIRS), \ + $(foreach t, $(TARGET_LIST), \ printf " %-30s - Build for %s\\n" $(patsubst %,subdir-%,$(t)) $(t);) \ echo '') @echo 'Cleaning targets:' diff --git a/configure b/configure index 44d310a692..0988c88d9f 100755 --- a/configure +++ b/configure @@ -6125,7 +6125,7 @@ qemu_version=$(head $source_path/VERSION) echo "VERSION=$qemu_version" >>$config_host_mak echo "PKGVERSION=$pkgversion" >>$config_host_mak echo "SRC_PATH=$source_path" >> $config_host_mak -echo "TARGET_DIRS=$target_list" >> $config_host_mak +echo "TARGET_LIST=$target_list" >> $config_host_mak if [ "$docs" = "yes" ] ; then echo "BUILD_DOCS=yes" >> $config_host_mak fi diff --git a/scripts/create_config b/scripts/create_config index d727e5e36e..58948a67a4 100755 --- a/scripts/create_config +++ b/scripts/create_config @@ -107,7 +107,7 @@ case $line in target_name=${line#*=} echo "#define TARGET_NAME \"$target_name\"" ;; - TARGET_DIRS=*) + TARGET_LIST=*) # do nothing ;; TARGET_*=y) # configuration diff --git a/tests/Makefile.include b/tests/Makefile.include index 3b9a5e31a2..3d2f0458ab 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -854,7 +854,7 @@ endif # QTest rules -TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_DIRS))) +TARGETS=$(patsubst %-softmmu,%, $(filter %-softmmu,$(TARGET_LIST))) ifeq ($(CONFIG_POSIX),y) QTEST_TARGETS = $(TARGETS) check-qtest-y=$(foreach TARGET,$(TARGETS), $(check-qtest-$(TARGET)-y)) From patchwork Thu Apr 19 13:58:26 2018 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: 901168 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SH5smvtJ"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgqR1r1Rz9s1l for ; Fri, 20 Apr 2018 00:10:11 +1000 (AEST) Received: from localhost ([::1]:50003 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AGH-00063P-56 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:10:09 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42747) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5l-00064M-CS for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5f-00029i-Mh for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:17 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:41554) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5f-000295-GD for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:11 -0400 Received: by mail-wr0-x241.google.com with SMTP id v24-v6so14330517wra.8 for ; Thu, 19 Apr 2018 06:59:11 -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 :mime-version:content-transfer-encoding; bh=2bTmo5Z3bqje3uvfKSKg6BbcjFDioLuevJQVtr4gvdc=; b=SH5smvtJW78Ri/ZHXYoNlfWRCqyuqDDmtv7n/w50Z2oQpWRY3YXI2dWUmHw2ppET5c NXX8/027v2dnFTN4LGAPbRT73XMLyhZIE6Usw4ZfY3ckuTnO2WQaAncNmhfryUbKe79g IkE9v/0vfoz6ZwkkBXI/UcVWFUdVBbohU18iw= 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=2bTmo5Z3bqje3uvfKSKg6BbcjFDioLuevJQVtr4gvdc=; b=guUNAWucsocsq8GYMkAyF2AWwFudaECB5R+Pbd4F3s3CwexPVd1C9Udx6HAUP4Tccb 5nMuKtvQ0ZL0FLKQbdZTHXUWQv3wAfh+FJV2FN2QY54SGpLrFTYvobu3sPTiqje3OXne Oq/pp2audvVWZ0PKQOmsDSw/1QusZ2e3AZAD6fjw2GMXPwGQ4KwXMaKlyYVhfGCo/lHe a0Y3boJveW910sfkYOTIRk4PsEGVpCjKoQcDLSHMyprAY8J3SFbDHzOtHr2Foa0zZTnd zju6KeQt8K4bIb8Tp+Z606PSwx8YEHOGDpXBl6BkadUpA/CL762hY8V32xLMcc3cSPC7 R9zw== X-Gm-Message-State: ALQs6tB7Gb56Suol7YarJIqeMughAUslyOf+6N/x1LuvHr7IBHTHG+EU d6KvlzEWEXRWAPFwPEqL+Al6YioDDdk= X-Google-Smtp-Source: AIpwx48vM1mU0lfSVglcb4uHwcQK9sa8hXNHR1mMQr57xNzH66NpQiWkwy5xUNbNnsL/Ygiwd7SYjQ== X-Received: by 10.28.135.9 with SMTP id j9mr4946542wmd.68.1524146350330; Thu, 19 Apr 2018 06:59:10 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d7-v6sm3515865wrj.26.2018.04.19.06.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:06 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 259883E03B9; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:26 +0100 Message-Id: <20180419135901.30035-9-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 08/43] docker: Add "cc" subcommand 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Fam Zheng [AJB: add if args.paths check] Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- v2 - add if args.paths check to avoid iterating null argument --- tests/docker/docker.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index f8267586eb..bcc3ee2dee 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -408,6 +408,31 @@ class ProbeCommand(SubCommand): return +class CcCommand(SubCommand): + """Compile sources with cc in images""" + name = "cc" + + def args(self, parser): + parser.add_argument("--image", "-i", required=True, + help="The docker image in which to run cc") + parser.add_argument("--source-path", "-s", nargs="*", dest="paths", + help="""Extra paths to (ro) mount into container for + reading sources""") + + def run(self, args, argv): + if argv and argv[0] == "--": + argv = argv[1:] + cwd = os.getcwd() + cmd = ["--rm", "-w", cwd, + "-v", "%s:%s:rw" % (cwd, cwd)] + if args.paths: + for p in args.paths: + cmd += ["-v", "%s:%s:ro,z" % (p, p)] + cmd += [args.image, "cc"] + cmd += argv + return Docker().command("run", cmd, args.quiet) + + def main(): parser = argparse.ArgumentParser(description="A Docker helper", usage="%s ..." % os.path.basename(sys.argv[0])) From patchwork Thu Apr 19 13:58:27 2018 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: 901159 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZzyAar+o"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgjV2ygWz9s1d for ; Fri, 20 Apr 2018 00:05:01 +1000 (AEST) Received: from localhost ([::1]:49831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ABF-0001Uk-Kk for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:04:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42775) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5m-00066B-Tn for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5j-0002Jl-2Y for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:18 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:42089) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5i-0002Hk-SX for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:15 -0400 Received: by mail-wr0-x241.google.com with SMTP id s18-v6so14329581wrg.9 for ; Thu, 19 Apr 2018 06:59:14 -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 :mime-version:content-transfer-encoding; bh=PotZUyOt6b4te5W9l96ZklU65MqBhhmo3ReGmsMNrMA=; b=ZzyAar+oSUcupbceItUU/2ZSPRMo7cl8wTmGAH4oUnpGPy2cKl05IBUdsM1vEQgIK6 hVOPYvQz7nKVwyIasUQNl/6+iz3zzbRxeqmrh5dJG1qnnFqjehIJ7JGU8v1xoireBs+Z W65HLPiufUfWRwhbhPI/xanw/pZ5uV0qxMtT4= 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=PotZUyOt6b4te5W9l96ZklU65MqBhhmo3ReGmsMNrMA=; b=Qpq2qO7RvLTg12gkuy21GwlawjZ3i+ngEwAUUaB/pIsD/PPwZQDdgMUf/yFd2PHvKq WkZcH2QX9H+h5fUMS1oZ1zhn0YMazv2dIp8wf3TVat4jQS2oe3GoczPi4bC4OmIY6+y7 886YLaHOhZodXlhlHGQ2FAFXDO4df91dKtUAQN/foS2+JKSXrRrXX9lrcHyDWkZHTEu9 Qd9oSzO2ZFfm0ATZ//qUZ/hDjkvFXjBYWybTX8Y6VgWFBFGaZ82DnBFl0Wv/kisfW49h /DPaOHV3vpi2IiVO254OVD4ctNdnmJPxy4ydtA1qo3uXDYMjXadm/PjLMb4UW1OZCoj1 afFQ== X-Gm-Message-State: ALQs6tCbEjYS8Z4RbXASqUZ6BTOQ7kS7O4vMfdzF6uEVCnMcedFNr1Yw p99Ixa+s3B8EFrWJRkFIQA0USg== X-Google-Smtp-Source: AIpwx499u/Hhar6b5zgOE30kMEaMEOU51ClMCCw3t3O2RZ7JHgRaBdFNAv5uarhOIsbFHF9Llei/kw== X-Received: by 10.28.232.202 with SMTP id f71mr5067593wmi.136.1524146353716; Thu, 19 Apr 2018 06:59:13 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u14-v6sm3720327wri.31.2018.04.19.06.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 36FDC3E03CC; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:27 +0100 Message-Id: <20180419135901.30035-10-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 09/43] docker: extend "cc" command to accept compiler 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" When calling our cross-compilation images we want to call something other than the default cc. Signed-off-by: Alex Bennée Reviewed-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé --- v2 - use arg.cc default to simplify logic --- tests/docker/docker.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index bcc3ee2dee..59bce9f19a 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -415,6 +415,8 @@ class CcCommand(SubCommand): def args(self, parser): parser.add_argument("--image", "-i", required=True, help="The docker image in which to run cc") + parser.add_argument("--cc", default="cc", + help="The compiler executable to call") parser.add_argument("--source-path", "-s", nargs="*", dest="paths", help="""Extra paths to (ro) mount into container for reading sources""") @@ -428,7 +430,7 @@ class CcCommand(SubCommand): if args.paths: for p in args.paths: cmd += ["-v", "%s:%s:ro,z" % (p, p)] - cmd += [args.image, "cc"] + cmd += [args.image, args.cc] cmd += argv return Docker().command("run", cmd, args.quiet) From patchwork Thu Apr 19 13:58:28 2018 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: 901162 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="BZIPBNkV"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rglr48j9z9s1d for ; Fri, 20 Apr 2018 00:07:04 +1000 (AEST) Received: from localhost ([::1]:49848 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADG-0003Cu-7X for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:07:02 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42750) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5l-00064V-Fr for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5j-0002LY-R2 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:17 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:33467) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5j-0002Jc-Jk for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:15 -0400 Received: by mail-wr0-x241.google.com with SMTP id z73-v6so14374717wrb.0 for ; Thu, 19 Apr 2018 06:59:15 -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 :mime-version:content-transfer-encoding; bh=yx5ucHfklmdWD5NFIiC6j32FmmfKfpWkJIX7Slm13Jo=; b=BZIPBNkVyfndTH+w0QMRpp10hqN/G+WXztabFd+72sY3h1yD15fqEqGI8dd93MXzY0 WJ8hC2w8bUDzIvbRvNhaup9XlHldAa6eeRyQYF1JRdaeXJpChEbQH4SHSivQm/lT7+cA cbjCAaQR0J9HZY0hSO7KvI727py6PfVFlOQZ0= 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=yx5ucHfklmdWD5NFIiC6j32FmmfKfpWkJIX7Slm13Jo=; b=Rx3NFZr2aMuO1BxvWv6+Bd495a736aTR8MFSzp+xUNPdl2cYRrjawdfiFKjA0/t9Af ojqf0bAnFQoDcQnWpshE82RbhB0Bqq4pqy7OaifYtrycPYd4BONCHWipXqQDN28xoJJu HHMKgo8YjeFzhtH9LChwMoBEFV1nfQBrnRQWPtkyMbKMLqLZcks/7fNWsGIurocAdNac TT10pgaPEUMLt6uXph5SptI/j5WaFgNaSsMBk+RSbifNnc3InlKN21I5hxOJM98bHfNM TNQht36vu3QS863JehLnol2jk+ZklbMpLSADWuKXi3Zi3zOFWlrVEbKef8CTFBcBVDS1 1n7g== X-Gm-Message-State: ALQs6tArvgf0FfCReOG/UJEEtYvfb3FwXAr7/jM9SplwzfyY3TPvBwXa EfLDz1sWKeTcwWyDqCh5KEQ6LA== X-Google-Smtp-Source: AIpwx48ZFWvpyWE8uR023uimk9Uj0Bwg4hRCPOz5+jvEpWQII8nRCpSKRzqo6cc0nbIBfjKV7m+l3A== X-Received: by 2002:adf:b08e:: with SMTP id i14-v6mr5247820wra.9.1524146354476; Thu, 19 Apr 2018 06:59:14 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m4-v6sm3282822wrj.47.2018.04.19.06.59.04 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:07 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 48A2D3E0402; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:28 +0100 Message-Id: <20180419135901.30035-11-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 10/43] docker: allow "cc" command to run in user context 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Fam Zheng Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/docker/docker.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/tests/docker/docker.py b/tests/docker/docker.py index 59bce9f19a..37bfa98005 100755 --- a/tests/docker/docker.py +++ b/tests/docker/docker.py @@ -417,6 +417,8 @@ class CcCommand(SubCommand): help="The docker image in which to run cc") parser.add_argument("--cc", default="cc", help="The compiler executable to call") + parser.add_argument("--user", + help="The user-id to run under") parser.add_argument("--source-path", "-s", nargs="*", dest="paths", help="""Extra paths to (ro) mount into container for reading sources""") @@ -430,6 +432,8 @@ class CcCommand(SubCommand): if args.paths: for p in args.paths: cmd += ["-v", "%s:%s:ro,z" % (p, p)] + if args.user: + cmd += ["-u", args.user] cmd += [args.image, args.cc] cmd += argv return Docker().command("run", cmd, args.quiet) From patchwork Thu Apr 19 13:58:29 2018 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: 901224 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DOz3hJ+b"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhCc6QhPz9s27 for ; Fri, 20 Apr 2018 00:27:40 +1000 (AEST) Received: from localhost ([::1]:50750 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AXC-0007Y1-OL for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:27:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47214) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADq-0004TP-Ii for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADn-0004zX-Il for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:38 -0400 Received: from mail-wr0-x22f.google.com ([2a00:1450:400c:c0c::22f]:46197) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADn-0004yt-CU for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:35 -0400 Received: by mail-wr0-x22f.google.com with SMTP id d1-v6so14417992wrj.13 for ; Thu, 19 Apr 2018 07:07:35 -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 :mime-version:content-transfer-encoding; bh=Txa5dWaw6rpku3w/i3TgIXvc5LO3CkoCTj1w4cH/zrg=; b=DOz3hJ+b1MHJtzZvc60fCxjIOfZCbuOflnHLR1ViOqXbYpAATTeAJhc6tGKzui6b0P Z1mjfhUKB5d03mCvYFSN2sezm/9OTg0ZCU4XcuDxNOFkLsWxtukh+q9iXvxDWocBm2OT bHr29yxhqvhTYM0mwxCB38s+I+UjcZ3Ow8Lvo= 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=Txa5dWaw6rpku3w/i3TgIXvc5LO3CkoCTj1w4cH/zrg=; b=uWPll3BjBYrQibi7vECxzHjkMSS240ENK4lPAvEtTO4YKJePe/yOTsOSUWFcuEOs63 EZeJPUVGnJ+w2R+6SbeS2LgkqhYTn7PZBVxYB6p5jpSZUc/6vGCZq1hV3t6XO+PCciWO P55Zyw6gwc7NknUmCVkcG6FcDFKvUodQY0/+KGBiEDlszPIYENLKu7HitK005zIpklLz PlGV+lI1pD4ri5ctXrSJREFh/lhAHjwhPhuDNVJbPRlpEzIKYBjXcqWEkwvCCdZ44eQs RODV16WTGZ2vqslNVr+fgFFAGw2OBBUDNC8Q8rRceKOQR6r9ZaXFjnTnhYTmDVoAz/be 0xdQ== X-Gm-Message-State: ALQs6tCtcv4JpHCN5rvakNo6tE+B6o9oS+dZdZqnODsap2Zls2ckqHYL iHCD+C0DrK7pmhVnbIuL41QmnQ== X-Google-Smtp-Source: AIpwx480nIKMZsah0J0B9kVOulD9TreQqV/4KDJhwzaYeZsT0fUr7HA8fANRnG/g44e/3fZCps3ckw== X-Received: by 2002:adf:91a2:: with SMTP id 31-v6mr5145887wri.124.1524146854283; Thu, 19 Apr 2018 07:07:34 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e185sm4750684wmg.5.2018.04.19.07.07.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5A5393E0410; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:29 +0100 Message-Id: <20180419135901.30035-12-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::22f Subject: [Qemu-devel] [PATCH v2 11/43] docker: Makefile.include introduce DOCKER_SCRIPT 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Define this in one place to make it easy to re-use. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/docker/Makefile.include | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include index de87341528..6a5aa9ec71 100644 --- a/tests/docker/Makefile.include +++ b/tests/docker/Makefile.include @@ -14,6 +14,8 @@ DOCKER_TESTS := $(notdir $(shell \ DOCKER_TOOLS := travis +DOCKER_SCRIPT=$(SRC_PATH)/tests/docker/docker.py + TESTS ?= % IMAGES ?= % @@ -37,7 +39,7 @@ docker-image-%: $(DOCKER_FILES_DIR)/%.docker echo WARNING: EXECUTABLE is not set, debootstrap may fail. 2>&1 ; \ fi $(call quiet-command,\ - $(SRC_PATH)/tests/docker/docker.py build qemu:$* $< \ + $(DOCKER_SCRIPT) build qemu:$* $< \ $(if $V,,--quiet) $(if $(NOCACHE),--no-cache) \ $(if $(NOUSER),,--add-current-user) \ $(if $(EXTRA_FILES),--extra-files $(EXTRA_FILES))\ @@ -129,11 +131,11 @@ docker-run: docker-qemu-src fi $(if $(EXECUTABLE), \ $(call quiet-command, \ - $(SRC_PATH)/tests/docker/docker.py update \ + $(DOCKER_SCRIPT) update \ $(IMAGE) $(EXECUTABLE), \ " COPYING $(EXECUTABLE) to $(IMAGE)")) $(call quiet-command, \ - $(SRC_PATH)/tests/docker/docker.py run \ + $(DOCKER_SCRIPT) run \ $(if $(NOUSER),,-u $(shell id -u)) \ --security-opt seccomp=unconfined \ $(if $V,,--rm) \ @@ -163,4 +165,4 @@ docker-run-%: @$(MAKE) docker-run TEST=$(CMD) IMAGE=qemu:$(IMAGE) docker-clean: - $(call quiet-command, $(SRC_PATH)/tests/docker/docker.py clean) + $(call quiet-command, $(DOCKER_SCRIPT) clean) From patchwork Thu Apr 19 13:58:30 2018 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: 901216 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="KZ2Yc1QE"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhBb6vzFz9s1w for ; Fri, 20 Apr 2018 00:26:46 +1000 (AEST) Received: from localhost ([::1]:50746 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AWK-0006oE-Ei for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:26:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52701) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANO-0004eV-9m for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANM-00063v-9d for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:30 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:40171) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANL-00063Z-VW for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:28 -0400 Received: by mail-wr0-x241.google.com with SMTP id v60-v6so14510343wrc.7 for ; Thu, 19 Apr 2018 07:17:27 -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 :mime-version:content-transfer-encoding; bh=vUO1+oC4MRsaR4YCV5AlhtkzJ+Q5g7rrTuNL8mCWqY8=; b=KZ2Yc1QEO3hGL+Kaz1sUnz7ZHzyR0UWfCDGWx3mMrD0XPqbl6n32v9IkI9Bvlv2y0L rZXqJxpaGZ5ZV47IlmR2/811KHLGdPHI0WM1irutptV4Rc8XXQJIr8JkZmw5NfwceSpC b+SB8BGoQQPs+9lGwEJWWHCUEF8OjnEIFqj+w= 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=vUO1+oC4MRsaR4YCV5AlhtkzJ+Q5g7rrTuNL8mCWqY8=; b=SqgiLtaELPekZNjSZT42R6q2wEsk6jCme7kXTJZS1pv8Ah6d6K4lSRrOcyNdYY16j/ URv+HADD3XGtEWvacGcdH+uBPLEDaF8l+Nh05LN7Eaigu+T0PSBNdlglIhGGVYnpkjl9 AXMe2/DKESghAWiqtZ/fOemO4Hwye9hL366T3E7kqg+sjEhpd0Cy+Mx4kACLqU1FqSvo 4c79fm1c2IgCvpWiYH3PbK3Srb1xijNXY+Iksv9F3t2zNHZpG+9IqO443qrTUBzn2+TQ SiurCbcI71CIWOlOzknrHeZRXO9hRZewZD6hlp4ENf3LTMaMzB4yADkx0Re/4/bMvmsl vbrg== X-Gm-Message-State: ALQs6tB82OHtQ999wxt6x/lzJACoFgxoKPQh/4sfXAsCdmxUi0tkvUId i97t4PD2llIWzDb51HH8bw2nNA== X-Google-Smtp-Source: AIpwx4/yBFjNiIDiaFy++YBZwD/pjQEpT9RPy3D7U11fnk9kL7vJYRhmQtLJvcMn3PrJhbXLjDzYyw== X-Received: by 10.28.217.67 with SMTP id q64mr4893156wmg.12.1524147446679; Thu, 19 Apr 2018 07:17:26 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e50-v6sm5259151wre.4.2018.04.19.07.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 707633E041B; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:30 +0100 Message-Id: <20180419135901.30035-13-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 12/43] tests/tcg: move architecture independent tests into subdir 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We will want to build these for all supported guest architectures so lets move them all into one place. We also drop test_path at this point because it needs qemu utils and glib bits which is hard to support for cross compiling. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- v2 - move VPATH and TESTs setup into multiarch/Makefile.target - remove moved bits from tests/tcg/Makefile --- tests/tcg/Makefile | 31 ----- tests/tcg/README | 10 +- tests/tcg/multiarch/Makefile.target | 30 +++++ tests/tcg/multiarch/README | 1 + tests/tcg/{ => multiarch}/linux-test.c | 0 tests/tcg/{ => multiarch}/sha1.c | 0 tests/tcg/{ => multiarch}/test-mmap.c | 0 tests/tcg/{ => multiarch}/testthread.c | 0 tests/tcg/test_path.c | 157 ------------------------- 9 files changed, 35 insertions(+), 194 deletions(-) create mode 100644 tests/tcg/multiarch/Makefile.target create mode 100644 tests/tcg/multiarch/README rename tests/tcg/{ => multiarch}/linux-test.c (100%) rename tests/tcg/{ => multiarch}/sha1.c (100%) rename tests/tcg/{ => multiarch}/test-mmap.c (100%) rename tests/tcg/{ => multiarch}/testthread.c (100%) delete mode 100644 tests/tcg/test_path.c diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index 89e3342f3d..e12395117a 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -18,12 +18,9 @@ LDFLAGS= # also, pi_10.com runs indefinitely I386_TESTS=hello-i386 \ - linux-test \ - testthread \ sha1-i386 \ test-i386 \ test-i386-fprem \ - test-mmap \ # runcom # native i386 compilers sometimes are not biarch. assume cross-compilers are @@ -47,8 +44,6 @@ run-%: % -$(QEMU) ./$* run-hello-i386: hello-i386 -run-linux-test: linux-test -run-testthread: testthread run-sha1-i386: sha1-i386 run-test-i386: test-i386 @@ -66,11 +61,6 @@ run-test-x86_64: test-x86_64 -$(QEMU_X86_64) test-x86_64 > test-x86_64.out @if diff -u test-x86_64.ref test-x86_64.out ; then echo "Auto Test OK"; fi -run-test-mmap: test-mmap - -$(QEMU) ./test-mmap - -$(QEMU) -p 8192 ./test-mmap 8192 - -$(QEMU) -p 16384 ./test-mmap 16384 - -$(QEMU) -p 32768 ./test-mmap 32768 run-runcom: runcom -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com @@ -80,17 +70,10 @@ run-test_path: test_path # rules to compile tests -test_path: test_path.o - -test_path.o: test_path.c - hello-i386: hello-i386.c $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< strip $@ -testthread: testthread.c - $(CC_I386) $(CFLAGS) $(LDFLAGS) -o $@ $< -lpthread - # i386/x86_64 emulation test (test various opcodes) */ test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ test-i386.h test-i386-shift.h test-i386-muldiv.h @@ -104,28 +87,14 @@ test-x86_64: test-i386.c \ test-i386.h test-i386-shift.h test-i386-muldiv.h $(CC_X86_64) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ $( -#include -#include - -void qemu_log(const char *fmt, ...); - -/* Any log message kills the test. */ -void qemu_log(const char *fmt, ...) -{ - va_list ap; - - fprintf(stderr, "FATAL: "); - va_start(ap, fmt); - vfprintf(stderr, fmt, ap); - va_end(ap); - exit(1); -} - -#define NO_CHANGE(_path) \ - do { \ - if (strcmp(path(_path), _path) != 0) return __LINE__; \ - } while(0) - -#define CHANGE_TO(_path, _newpath) \ - do { \ - if (strcmp(path(_path), _newpath) != 0) return __LINE__; \ - } while(0) - -static void cleanup(void) -{ - unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE"); - unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE2"); - unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE3"); - unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE4"); - unlink("/tmp/qemu-test_path/DIR1/DIR2/FILE5"); - rmdir("/tmp/qemu-test_path/DIR1/DIR2"); - rmdir("/tmp/qemu-test_path/DIR1/DIR3"); - rmdir("/tmp/qemu-test_path/DIR1"); - rmdir("/tmp/qemu-test_path"); -} - -static unsigned int do_test(void) -{ - if (mkdir("/tmp/qemu-test_path", 0700) != 0) - return __LINE__; - - if (mkdir("/tmp/qemu-test_path/DIR1", 0700) != 0) - return __LINE__; - - if (mkdir("/tmp/qemu-test_path/DIR1/DIR2", 0700) != 0) - return __LINE__; - - if (mkdir("/tmp/qemu-test_path/DIR1/DIR3", 0700) != 0) - return __LINE__; - - if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE", 0600)) != 0) - return __LINE__; - - if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE2", 0600)) != 0) - return __LINE__; - - if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE3", 0600)) != 0) - return __LINE__; - - if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE4", 0600)) != 0) - return __LINE__; - - if (close(creat("/tmp/qemu-test_path/DIR1/DIR2/FILE5", 0600)) != 0) - return __LINE__; - - init_paths("/tmp/qemu-test_path"); - - NO_CHANGE("/tmp"); - NO_CHANGE("/tmp/"); - NO_CHANGE("/tmp/qemu-test_path"); - NO_CHANGE("/tmp/qemu-test_path/"); - NO_CHANGE("/tmp/qemu-test_path/D"); - NO_CHANGE("/tmp/qemu-test_path/DI"); - NO_CHANGE("/tmp/qemu-test_path/DIR"); - NO_CHANGE("/tmp/qemu-test_path/DIR1"); - NO_CHANGE("/tmp/qemu-test_path/DIR1/"); - - NO_CHANGE("/D"); - NO_CHANGE("/DI"); - NO_CHANGE("/DIR"); - NO_CHANGE("/DIR2"); - NO_CHANGE("/DIR1."); - - CHANGE_TO("/DIR1", "/tmp/qemu-test_path/DIR1"); - CHANGE_TO("/DIR1/", "/tmp/qemu-test_path/DIR1"); - - NO_CHANGE("/DIR1/D"); - NO_CHANGE("/DIR1/DI"); - NO_CHANGE("/DIR1/DIR"); - NO_CHANGE("/DIR1/DIR1"); - - CHANGE_TO("/DIR1/DIR2", "/tmp/qemu-test_path/DIR1/DIR2"); - CHANGE_TO("/DIR1/DIR2/", "/tmp/qemu-test_path/DIR1/DIR2"); - - CHANGE_TO("/DIR1/DIR3", "/tmp/qemu-test_path/DIR1/DIR3"); - CHANGE_TO("/DIR1/DIR3/", "/tmp/qemu-test_path/DIR1/DIR3"); - - NO_CHANGE("/DIR1/DIR2/F"); - NO_CHANGE("/DIR1/DIR2/FI"); - NO_CHANGE("/DIR1/DIR2/FIL"); - NO_CHANGE("/DIR1/DIR2/FIL."); - - CHANGE_TO("/DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/DIR2/FILE2", "/tmp/qemu-test_path/DIR1/DIR2/FILE2"); - CHANGE_TO("/DIR1/DIR2/FILE3", "/tmp/qemu-test_path/DIR1/DIR2/FILE3"); - CHANGE_TO("/DIR1/DIR2/FILE4", "/tmp/qemu-test_path/DIR1/DIR2/FILE4"); - CHANGE_TO("/DIR1/DIR2/FILE5", "/tmp/qemu-test_path/DIR1/DIR2/FILE5"); - - NO_CHANGE("/DIR1/DIR2/FILE6"); - NO_CHANGE("/DIR1/DIR2/FILE/X"); - - CHANGE_TO("/DIR1/../DIR1", "/tmp/qemu-test_path/DIR1"); - CHANGE_TO("/DIR1/../DIR1/", "/tmp/qemu-test_path/DIR1"); - CHANGE_TO("/../DIR1", "/tmp/qemu-test_path/DIR1"); - CHANGE_TO("/../DIR1/", "/tmp/qemu-test_path/DIR1"); - CHANGE_TO("/DIR1/DIR2/../DIR2", "/tmp/qemu-test_path/DIR1/DIR2"); - CHANGE_TO("/DIR1/DIR2/../DIR2/../../DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/DIR2/../DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - - NO_CHANGE("/DIR1/DIR2/../DIR1"); - NO_CHANGE("/DIR1/DIR2/../FILE"); - - CHANGE_TO("/./DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/././DIR1/DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/./DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/././DIR2/FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/DIR2/./FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/DIR1/DIR2/././FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - CHANGE_TO("/./DIR1/./DIR2/./FILE", "/tmp/qemu-test_path/DIR1/DIR2/FILE"); - - return 0; -} - -int main(int argc, char *argv[]) -{ - int ret; - - ret = do_test(); - cleanup(); - if (ret) { - fprintf(stderr, "test_path: failed on line %i\n", ret); - return 1; - } - return 0; -} From patchwork Thu Apr 19 13:58:31 2018 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: 901183 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cbXuFJ9Z"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgyv6vdMz9s27 for ; Fri, 20 Apr 2018 00:16:39 +1000 (AEST) Received: from localhost ([::1]:50195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AMX-0003D6-Iv for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:16:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5s-0006BP-1a for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5m-0002T1-2r for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:24 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:34143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5l-0002PK-Qd for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:18 -0400 Received: by mail-wr0-x243.google.com with SMTP id d19-v6so14369031wre.1 for ; Thu, 19 Apr 2018 06:59:17 -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 :mime-version:content-transfer-encoding; bh=EiFcVfhMjf9AXXl4rTHN8NJQbIPZJGrxc0yc25niYXM=; b=cbXuFJ9ZOyK+we+rbOzdxsMUp72Sc0GDKVb4RTNhvokdSTlAibAx/6z2HWW37SVzAG inatG2CmYcNsG/Ni1SStaaPxMox7y3CuIikVcXdElVWbtfKAIuk1XQLZKLnCA64e+KWH 8Ay0Gl6hr56p9QDYby/EJQUs+WD7Lk2Iu3aa0= 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=EiFcVfhMjf9AXXl4rTHN8NJQbIPZJGrxc0yc25niYXM=; b=amaeQD3cc1AkAXBeWnBmD9pC6RUxSZhIsfOXdv0eOHsy6ReGmIJFZxaAS0wrEywAui XTK58E6qWUZzPs6Cu9qxSyGtSihY2GWIrCEJTbFMiHCRKG4LehLyUWWB/AaX/3SxQ1Jg loxdGEd1c6z13k+DMgyUEQMayOEfv1Ai0mamHP53N/nn7zmARJz2ZkTgg1lzp4NoVO47 E94yqNtDo6kVfEgOH93PCtftpwkntViIK3qosV0SKNCZbMrgnF2oEtvZPxts3YiRtOt8 mD4FU32N/IrUTT74bFj4eNR/J2Rpi3EJBQ3Vbal355XSwM3HZpfh6W2oxSCnacQ14hX8 WfJw== X-Gm-Message-State: ALQs6tDaafzZj5y1LoSL93HQ6yN1s5kYOPG25Jys6EF/0Hdmbc/UIBXv YZEjpkwlhbcGNq0bedlv3PEYxg== X-Google-Smtp-Source: AIpwx49XWr3TvxvGYPon7dbMwgXROA25QSJuAz+b73saMG5USwSCdwOgQOS7I/bpeeWKBegxbJUvWg== X-Received: by 10.28.109.27 with SMTP id i27mr4776510wmc.109.1524146356518; Thu, 19 Apr 2018 06:59:16 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c21-v6sm3489858wre.43.2018.04.19.06.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 823D73E0430; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:31 +0100 Message-Id: <20180419135901.30035-14-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 13/43] tests/tcg/multiarch: Build fix for linux-test 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Fam Zheng To keep the compiler happy, and to fit in our buildsys flags: - Make local functions "static" - #ifdef out unused functions - drop cutils/osdep dependencies Signed-off-by: Fam Zheng [AJB: drop cutils/osdep dependencies] Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- tests/tcg/multiarch/linux-test.c | 68 ++++++++++---------------------- 1 file changed, 21 insertions(+), 47 deletions(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index 5070d31446..4457bd04ba 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -16,7 +16,6 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ -#define _GNU_SOURCE #include #include #include @@ -31,6 +30,7 @@ #include #include #include +#include #include #include #include @@ -39,13 +39,12 @@ #include #include #include -#include "qemu/cutils.h" #define TESTPATH "/tmp/linux-test.tmp" #define TESTPORT 7654 #define STACK_SIZE 16384 -void error1(const char *filename, int line, const char *fmt, ...) +static void error1(const char *filename, int line, const char *fmt, ...) { va_list ap; va_start(ap, fmt); @@ -56,7 +55,7 @@ void error1(const char *filename, int line, const char *fmt, ...) exit(1); } -int __chk_error(const char *filename, int line, int ret) +static int __chk_error(const char *filename, int line, int ret) { if (ret < 0) { error1(filename, line, "%m (ret=%d, errno=%d)", @@ -73,7 +72,7 @@ int __chk_error(const char *filename, int line, int ret) #define FILE_BUF_SIZE 300 -void test_file(void) +static void test_file(void) { int fd, i, len, ret; uint8_t buf[FILE_BUF_SIZE]; @@ -210,7 +209,7 @@ void test_file(void) chk_error(rmdir(TESTPATH)); } -void test_fork(void) +static void test_fork(void) { int pid, status; @@ -224,7 +223,7 @@ void test_fork(void) error("waitpid status=0x%x", status); } -void test_time(void) +static void test_time(void) { struct timeval tv, tv2; struct timespec ts, rem; @@ -251,34 +250,7 @@ void test_time(void) error("getrusage"); } -void pstrcpy(char *buf, int buf_size, const char *str) -{ - int c; - char *q = buf; - - if (buf_size <= 0) - return; - - for(;;) { - c = *str++; - if (c == 0 || q >= buf + buf_size - 1) - break; - *q++ = c; - } - *q = '\0'; -} - -/* strcat and truncate. */ -char *pstrcat(char *buf, int buf_size, const char *s) -{ - int len; - len = strlen(buf); - if (len < buf_size) - pstrcpy(buf + len, buf_size - len, s); - return buf; -} - -int server_socket(void) +static int server_socket(void) { int val, fd; struct sockaddr_in sockaddr; @@ -298,7 +270,7 @@ int server_socket(void) } -int client_socket(void) +static int client_socket(void) { int fd; struct sockaddr_in sockaddr; @@ -312,9 +284,9 @@ int client_socket(void) return fd; } -const char socket_msg[] = "hello socket\n"; +static const char socket_msg[] = "hello socket\n"; -void test_socket(void) +static void test_socket(void) { int server_fd, client_fd, fd, pid, ret, val; struct sockaddr_in sockaddr; @@ -348,9 +320,10 @@ void test_socket(void) chk_error(close(server_fd)); } +#if 0 #define WCOUNT_MAX 512 -void test_pipe(void) +static void test_pipe(void) { fd_set rfds, wfds; int fds[2], fd_max, ret; @@ -391,10 +364,10 @@ void test_pipe(void) chk_error(close(fds[1])); } -int thread1_res; -int thread2_res; +static int thread1_res; +static int thread2_res; -int thread1_func(void *arg) +static int thread1_func(void *arg) { int i; for(i=0;i<5;i++) { @@ -404,7 +377,7 @@ int thread1_func(void *arg) return 0; } -int thread2_func(void *arg) +static int thread2_func(void *arg) { int i; for(i=0;i<6;i++) { @@ -435,27 +408,28 @@ void test_clone(void) thread2_res != 6) error("clone"); } +#endif /***********************************/ volatile int alarm_count; jmp_buf jmp_env; -void sig_alarm(int sig) +static void sig_alarm(int sig) { if (sig != SIGALRM) error("signal"); alarm_count++; } -void sig_segv(int sig, siginfo_t *info, void *puc) +static void sig_segv(int sig, siginfo_t *info, void *puc) { if (sig != SIGSEGV) error("signal"); longjmp(jmp_env, 1); } -void test_signal(void) +static void test_signal(void) { struct sigaction act; struct itimerval it, oit; @@ -510,7 +484,7 @@ void test_signal(void) #define SHM_SIZE 32768 -void test_shm(void) +static void test_shm(void) { void *ptr; int shmid; From patchwork Thu Apr 19 13:58:32 2018 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: 901163 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cy3AfY2I"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgls0qMQz9s1l for ; Fri, 20 Apr 2018 00:07:05 +1000 (AEST) Received: from localhost ([::1]:49852 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADH-0003FU-58 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:07:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42764) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5m-00065B-0Z for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:19 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5k-0002Od-SB for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:18 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:45433) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5k-0002MM-LV for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:16 -0400 Received: by mail-wr0-x242.google.com with SMTP id u11-v6so14326933wri.12 for ; Thu, 19 Apr 2018 06:59:16 -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 :mime-version:content-transfer-encoding; bh=GLwVMwJJxQKYPCdpmP8VCCwUe/OSKjPOWcKfs+oHnq0=; b=cy3AfY2IeG27WUSLeGTWb9bf7xutDtrZzVnkoDjMuZLVZmMfkPoq1h0EbbLhYG8Ltc aJ91nwrghzCoj3+mRHEPOhTHzGfIFqGv9anJLZITkA+IsR9uZKMb4eQvkFDPr9/Y2yfV wti6ro0xQeaV17/lb4P+ZJ39VC5JaQWckvi1E= 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=GLwVMwJJxQKYPCdpmP8VCCwUe/OSKjPOWcKfs+oHnq0=; b=jZdlHksKxdAkmG2wCUyZMxt6I3JROxM452koWCq7VmCrbZfABDJEaMGWqzEpmlsEzm Ni0NdFIAYT8GdHb1l182XgOyEa97WL9pe8JO8DVQosxu6UPEIxhpLPeHCUrx+lgm5xq0 ViCcVjHIQ4BeaHhelpJvlM9BD1VXC30YgHtEaK9oJhTWIUpXPvf5fsq81RnKVeJvIT5V yxOn0MsJCLPRmTFJGJqiXfIUSucgZu90nuXkhX1VA7UYAbWKADe4ddrO4JoeuRA9DLFZ SCnZsASE/No05pH++r/tARAtDQpLO9Wf7bLkYjbH4een1BYGtfgGTnxDxUH4A3i7fJVX XPUg== X-Gm-Message-State: ALQs6tCTOpuAI+nGUGZCkdpGzep7cIdsg5AGiS2N+QX4bO1E5YozR7d7 u0/IoIb1q0Vu6obmrd+wfJoPXg== X-Google-Smtp-Source: AIpwx4+DBKT8hMzAFQCkrBFiRooQ4LTBKxX/t1A8YVEUakfWJIZ/d7eoTvyF2sdiFIwXk0wdG3FLfg== X-Received: by 2002:adf:a0a2:: with SMTP id m31-v6mr4895969wrm.278.1524146355454; Thu, 19 Apr 2018 06:59:15 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 33-v6sm3129810wrs.74.2018.04.19.06.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 93EB83E0481; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:32 +0100 Message-Id: <20180419135901.30035-15-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 14/43] tests/tcg/multiarch: enable additional linux-test tests 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Un-comment the remaining tests. I removed the itimer value tests because I'm fairly sure a re-arming timer will always have a different value in it when you grab it. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/multiarch/linux-test.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/tests/tcg/multiarch/linux-test.c b/tests/tcg/multiarch/linux-test.c index 4457bd04ba..519b0ac653 100644 --- a/tests/tcg/multiarch/linux-test.c +++ b/tests/tcg/multiarch/linux-test.c @@ -16,6 +16,7 @@ * You should have received a copy of the GNU General Public License * along with this program; if not, see . */ +#define _GNU_SOURCE #include #include #include @@ -39,6 +40,7 @@ #include #include #include +#include #define TESTPATH "/tmp/linux-test.tmp" #define TESTPORT 7654 @@ -58,8 +60,8 @@ static void error1(const char *filename, int line, const char *fmt, ...) static int __chk_error(const char *filename, int line, int ret) { if (ret < 0) { - error1(filename, line, "%m (ret=%d, errno=%d)", - ret, errno); + error1(filename, line, "%m (ret=%d, errno=%d/%s)", + ret, errno, strerror(errno)); } return ret; } @@ -320,7 +322,6 @@ static void test_socket(void) chk_error(close(server_fd)); } -#if 0 #define WCOUNT_MAX 512 static void test_pipe(void) @@ -355,7 +356,7 @@ static void test_pipe(void) } if (FD_ISSET(fds[1], &wfds)) { ch = 'a'; - chk_error(write(fds[0], &ch, 1)); + chk_error(write(fds[1], &ch, 1)); wcount++; } } @@ -408,7 +409,6 @@ void test_clone(void) thread2_res != 6) error("clone"); } -#endif /***********************************/ @@ -449,12 +449,10 @@ static void test_signal(void) it.it_value.tv_usec = 10 * 1000; chk_error(setitimer(ITIMER_REAL, &it, NULL)); chk_error(getitimer(ITIMER_REAL, &oit)); - if (oit.it_value.tv_sec != it.it_value.tv_sec || - oit.it_value.tv_usec != it.it_value.tv_usec) - error("itimer"); while (alarm_count < 5) { usleep(10 * 1000); + getitimer(ITIMER_REAL, &oit); } it.it_interval.tv_sec = 0; @@ -463,9 +461,6 @@ static void test_signal(void) it.it_value.tv_usec = 0; memset(&oit, 0xff, sizeof(oit)); chk_error(setitimer(ITIMER_REAL, &it, &oit)); - if (oit.it_value.tv_sec != 0 || - oit.it_value.tv_usec != 10 * 1000) - error("setitimer"); /* SIGSEGV test */ act.sa_sigaction = sig_segv; @@ -503,10 +498,11 @@ static void test_shm(void) int main(int argc, char **argv) { test_file(); + test_pipe(); test_fork(); test_time(); test_socket(); - // test_clone(); + test_clone(); test_signal(); test_shm(); return 0; From patchwork Thu Apr 19 13:58:33 2018 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: 901194 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="dfjILpeg"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh1C3mH3z9s1l for ; Fri, 20 Apr 2018 00:18:39 +1000 (AEST) Received: from localhost ([::1]:50348 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AOT-0004ka-G7 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:18:37 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47262) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADs-0004W7-Mo for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADi-0004lA-Ex for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:40 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:36559) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADi-0004jC-6M for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:30 -0400 Received: by mail-wr0-x243.google.com with SMTP id q13-v6so14449180wre.3 for ; Thu, 19 Apr 2018 07:07:30 -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 :mime-version:content-transfer-encoding; bh=flypIEKkCYHfJd0HmJGs/yHA6xC+HQqzKclPb3K9yGo=; b=dfjILpegRqqMG6c7PIHMxXTKgZ8Kj3vS7QFqS5jEuGCxq/iIYRrhezHx0j7vy5WYKp iLhxzqzvBpmJhdjP4IetkZPV9O2pCiPiwiXWHqkOAB7sJJmBCyTuO6T7g6DtGP0iNINo 0Cbpdg3l0cx1YtPWBycpgHnhG4/sc6aYQ4yUM= 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=flypIEKkCYHfJd0HmJGs/yHA6xC+HQqzKclPb3K9yGo=; b=cuul4x9xX0p0NsKL/Up8EQk+gCU95uxUbb/x9KCGPVJsgGd4E1UxvX60jNvHkm1H7g chbkIkkGvN83iAdXxc0oOG/i/JmDRAwN+72Uy/v68nCQI6udr616KkFYvVHHiiOSabxn UXw5p6vvTHjWQ45LTVHxBnU6lx2dMkqaP4hXQROixw06sxQwuUnUfozxdFQZtev59HQ/ FTTppeJN/KTLo1AL74Qumza50078PHDMGjmTmGjURbM4QAiOwHOG+PPnWSBUY2WlqYRO hY8sUcGzNbsYMVRMte4BgFyla1BHUolA0pwo5klsVfGksVkIJ906J8CfpVigHcwu2/2n nvUw== X-Gm-Message-State: ALQs6tCVelNNslMKLulPtp1ndrsWCUihW9uNY+qdn721QoQpFv8hmyGs 4BtZx8PfqgbJEnMoCFzllJkI/g== X-Google-Smtp-Source: AIpwx4/ymjRbZLv576PZdgtX7+ilF5TVvDRh/ztbK84Tfe1gdPc/UNqNmWLXBxLJNoVVOD74qBxzJg== X-Received: by 2002:adf:c105:: with SMTP id r5-v6mr4697994wre.274.1524146849122; Thu, 19 Apr 2018 07:07:29 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id n23-v6sm290948wra.39.2018.04.19.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:26 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A7DBD3E0486; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:33 +0100 Message-Id: <20180419135901.30035-16-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 15/43] tests/tcg: move i386 specific tests into subdir 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" These only need to be built for i386 guests. This includes a stub tests/tcg/i386/Makfile.target which absorbs some of what was in tests/tcg/Makefile. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- v2 - move VPATH and TESTs setup into i386/Makefile.target - set CFLAGS+=-m32 for cross building --- tests/tcg/README | 39 ------------------------ tests/tcg/i386/Makefile.target | 30 ++++++++++++++++++ tests/tcg/i386/README | 38 +++++++++++++++++++++++ tests/tcg/{ => i386}/hello-i386.c | 0 tests/tcg/{ => i386}/pi_10.com | Bin tests/tcg/{ => i386}/runcom.c | 0 tests/tcg/{ => i386}/test-i386-code16.S | 0 tests/tcg/{ => i386}/test-i386-fprem.c | 0 tests/tcg/{ => i386}/test-i386-muldiv.h | 0 tests/tcg/{ => i386}/test-i386-shift.h | 0 tests/tcg/{ => i386}/test-i386-ssse3.c | 0 tests/tcg/{ => i386}/test-i386-vm86.S | 0 tests/tcg/{ => i386}/test-i386.c | 0 tests/tcg/{ => i386}/test-i386.h | 0 14 files changed, 68 insertions(+), 39 deletions(-) create mode 100644 tests/tcg/i386/Makefile.target create mode 100644 tests/tcg/i386/README rename tests/tcg/{ => i386}/hello-i386.c (100%) rename tests/tcg/{ => i386}/pi_10.com (100%) rename tests/tcg/{ => i386}/runcom.c (100%) rename tests/tcg/{ => i386}/test-i386-code16.S (100%) rename tests/tcg/{ => i386}/test-i386-fprem.c (100%) rename tests/tcg/{ => i386}/test-i386-muldiv.h (100%) rename tests/tcg/{ => i386}/test-i386-shift.h (100%) rename tests/tcg/{ => i386}/test-i386-ssse3.c (100%) rename tests/tcg/{ => i386}/test-i386-vm86.S (100%) rename tests/tcg/{ => i386}/test-i386.c (100%) rename tests/tcg/{ => i386}/test-i386.h (100%) diff --git a/tests/tcg/README b/tests/tcg/README index 0890044cf0..469504c4cb 100644 --- a/tests/tcg/README +++ b/tests/tcg/README @@ -3,45 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be built for all guest architectures that support linux-user executable, or they are architecture specific. -i386 -==== - -test-i386 ---------- - -This program executes most of the 16 bit and 32 bit x86 instructions and -generates a text output, for comparison with the output obtained with -a real CPU or another emulator. - -The Linux system call modify_ldt() is used to create x86 selectors -to test some 16 bit addressing and 32 bit with segmentation cases. - -The Linux system call vm86() is used to test vm86 emulation. - -Various exceptions are raised to test most of the x86 user space -exception reporting. - -linux-test ----------- - -This program tests various Linux system calls. It is used to verify -that the system call parameters are correctly converted between target -and host CPUs. - -test-i386-fprem ---------------- - -runcom ------- - -test-mmap ---------- - -sha1 ----- - -hello-i386 ----------- ARM diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target new file mode 100644 index 0000000000..2f27b65e2d --- /dev/null +++ b/tests/tcg/i386/Makefile.target @@ -0,0 +1,30 @@ +# i386 cross compile notes + +I386_SRC=$(SRC_PATH)/tests/tcg/i386 + +# Set search path for all sources +VPATH += $(I386_SRC) + +I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c)) +I386_TESTS=$(I386_SRCS:.c=) + +# Update TESTS +TESTS+=$(I386_TESTS) + +ifneq ($(TARGET_NAME),x86_64) +CFLAGS+=-m32 +endif + +# +# hello-i386 is a barebones app +# +hello-i386: CFLAGS+=-ffreestanding +hello-i386: LDFLAGS+=-nostdlib + +# +# test-386 includes a couple of additional objects that need to be linked together +# + +test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S test-i386.h test-i386-shift.h test-i386-muldiv.h + $(CC) $(CFLAGS) $(LDFLAGS) -o $@ \ + $( X-Patchwork-Id: 901200 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Hrbd3jQi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh3C2qZpz9s27 for ; Fri, 20 Apr 2018 00:20:23 +1000 (AEST) Received: from localhost ([::1]:50355 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AQ7-0006h9-7k for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:20:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42859) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5v-0006F6-2l for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:28 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5r-0002j4-6C for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:27 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34143) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5q-0002hD-W2 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:23 -0400 Received: by mail-wr0-x241.google.com with SMTP id d19-v6so14369925wre.1 for ; Thu, 19 Apr 2018 06:59:22 -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 :mime-version:content-transfer-encoding; bh=Sp/nWR42wqBHZeJmZ4fe68++pwWrJ8UU+fs/ZWk84p4=; b=Hrbd3jQiMMQ7feVCHCKHj59AO9KG3DAXESFRl0N4Wgz23+ZV3Y58rLZABNrpY/M8Q9 8iypKNlLCJRaIsMrvy4BppDeiZOPbdKjbzO/t07dFW1aCDr9vmVpaUt9vWbLkV8QSWhF NZSTBo3vCL0c6viXN2XnSslB3KnZ/KkfHTE7g= 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=Sp/nWR42wqBHZeJmZ4fe68++pwWrJ8UU+fs/ZWk84p4=; b=jTmaiVvsyRljKq60woIiaiRWI/n96nzn+GEaAlnR9U2pg1KT2vhqgrS4BAyYi684Sq M1hU4tvuzOFTOLeEOKbOWzC0BPXmaF4blQ5b3ywWjYBLpD0p/4M3xCYhdTrP7P5muam/ pADZ1tiAbn0qaq8wF6b17gv7tDRTpi+13LCdMvtRa3X4Hv9xzL2cKZNheQHb6kCpGENb bafjqcx0n6JsvSv/yqYyADsFSYF5utWuIUet5Yu5DgAQs7hUMqY9loEZ95ywuHL7MN5r Aza93KuShhoDpIsn5byyBSF22hsMhts/If0gEWrPysq9ttiFxjysrJx94xFlx/1lszO4 E5EA== X-Gm-Message-State: ALQs6tCl4Ybc00zWbudrY0ty2fkG0y3OQUosX7IKmmwYXpY1YclrDVn9 ZxgYVXzsF2C4mn9u/y7vUvhV/A== X-Google-Smtp-Source: AIpwx49H2sP4tg5nifFwivr5rdfHNTVL404k4sGzeylPGJl/0VusKpbEKBQaRlUcftSLkwcbGAGExw== X-Received: by 2002:adf:a558:: with SMTP id j24-v6mr3877854wrb.261.1524146361868; Thu, 19 Apr 2018 06:59:21 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u8sm4555839wmf.3.2018.04.19.06.59.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:17 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B8E063E048B; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:34 +0100 Message-Id: <20180419135901.30035-17-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 16/43] docker: Add fedora-i386-cross image 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Fam Zheng It has some basic *-devel.i686 packages to be used with "gcc -m32" as a 32 bit cross build environment. Signed-off-by: Fam Zheng [AJB: add glibc-static] Signed-off-by: Alex Bennée --- v2 - include static glibc package as well --- tests/docker/dockerfiles/fedora-i386-cross.docker | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 tests/docker/dockerfiles/fedora-i386-cross.docker diff --git a/tests/docker/dockerfiles/fedora-i386-cross.docker b/tests/docker/dockerfiles/fedora-i386-cross.docker new file mode 100644 index 0000000000..8fbef2fa53 --- /dev/null +++ b/tests/docker/dockerfiles/fedora-i386-cross.docker @@ -0,0 +1,14 @@ +FROM fedora:latest +ENV PACKAGES \ + gcc \ + glibc-static.i686 \ + glibc-devel.i686 \ + glib2-devel.i686 \ + zlib-devel.i686 \ + glib2-devel.i686 \ + nettle-devel.i686 \ + pixman-devel.i686 \ + gnutls-devel.i686 + +RUN dnf install -y $PACKAGES +RUN rpm -q $PACKAGES | sort > /packages.txt From patchwork Thu Apr 19 13:58:35 2018 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: 901176 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hg3AepyH"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgv94fQ8z9s1l for ; Fri, 20 Apr 2018 00:13:25 +1000 (AEST) Received: from localhost ([::1]:50074 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AJP-0000PL-EA for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:13:23 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42790) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5n-00067O-US for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5n-0002XI-4g for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:20 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34142) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5m-0002T7-ME for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:19 -0400 Received: by mail-wr0-x241.google.com with SMTP id d19-v6so14369181wre.1 for ; Thu, 19 Apr 2018 06:59:18 -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 :mime-version:content-transfer-encoding; bh=xGMWVwBGlvDN7ujlWYQ+MdT0fxtsB9XscGnzXOZT/ts=; b=hg3AepyHGbIPADu2vx5EWFdqyaCSqE4d30muEUk67+46eoqMBeokWl9WRctwWyHMXO mK7LfdLrZMheIOKsAVu+4MiVOFuzmAGyPM42peoQpYQAs6bOuqeRTYZAwtKWA0Ns+9Hs sGF1M9aocbKN9svRlgbYE+E5cXOp2vqQlHex0= 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=xGMWVwBGlvDN7ujlWYQ+MdT0fxtsB9XscGnzXOZT/ts=; b=o80hXNMklw6Tp+xn7tOhbn+lruD4gN4pKcoPHmHMTTo5iCScdpwrglnpncbWSOqJUp YiEnqi6cmZ9RKDi3rnj9v42ODVwq3dIc8gyFwhHskHtMuzpOqSL0QHz7irVE/2QsT+g7 n8i02uM4zy5eUZJRyMv8+bfUYiT8jdoEvVZeuwP/TL9Y0QpwEffYknGtzNfU7rS7XaAP liTxzrKrgfCZngfq6SjLxaBpe4PZddPuLnYqNflkn1J0qgUlFsxkQmPkD8xxV3+F705e +5+bYaRwvn3fxuKKDX5iBlFhacIwlsS8j8ZV7rZ9DfxlGT9xaNalJKkRPmchlM6N43zM ahvg== X-Gm-Message-State: ALQs6tAQz12KgKYOcfDw3NXeyP6iwPddahMFvCr1cDhRFeXrFc83iUCa T+jiR3nDVfK/i0emcoQVidlNgA== X-Google-Smtp-Source: AIpwx4/SymU2Gmy5ZC9KMNM8lK6iwXKk7WUoiGSK8UYdwnoVMr8BEyiXLpLtdAoG4EyaZ0W0dutYYw== X-Received: by 2002:adf:8667:: with SMTP id 36-v6mr5102195wrw.23.1524146357536; Thu, 19 Apr 2018 06:59:17 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q138sm5095197wmd.1.2018.04.19.06.59.06 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:11 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id CA64C3E0493; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:35 +0100 Message-Id: <20180419135901.30035-18-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 17/43] tests/tcg: enable building for i386 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" While you can construct a compile command that does work using the x86_64 host compiler that most people use this is flakey. Different distros handle this is different ways so we default to using a known good i386 compiler via docker. Signed-off-by: Alex Bennée --- tests/tcg/i386/Makefile.include | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 tests/tcg/i386/Makefile.include diff --git a/tests/tcg/i386/Makefile.include b/tests/tcg/i386/Makefile.include new file mode 100644 index 0000000000..be1c3008dd --- /dev/null +++ b/tests/tcg/i386/Makefile.include @@ -0,0 +1,9 @@ +# +# Makefile.include for all i386 +# +# There is enough brokeness in x86_64 compilers that we don't default +# to using the x86_64 system compiler for i386 binaries. +# + +DOCKER_IMAGE=fedora-i386-cross +DOCKER_CROSS_COMPILER=gcc From patchwork Thu Apr 19 13:58:36 2018 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: 901161 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="gFJIciaf"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rglk1w7Rz9s27 for ; Fri, 20 Apr 2018 00:06:58 +1000 (AEST) Received: from localhost ([::1]:49843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADA-00037B-4l for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:06:56 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42811) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5p-00068u-1J for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5o-0002bE-6l for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:21 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:46504) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5o-0002YO-0y for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:20 -0400 Received: by mail-wr0-x244.google.com with SMTP id d1-v6so14338106wrj.13 for ; Thu, 19 Apr 2018 06:59:19 -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=M4knfNziydg8xz3w7OTWFo2qsq6zaTW6DQN1Zbl0wio=; b=gFJIciafU2DiY0eZGfZQkyhsDHBE/hYGii2DYnGEW8eTlxQqi40F/lsiEAV/AjQz19 LQ0xr9hKaB9NJT5P9sMwbeY4hm//kEB/XE2YQ94F5INwSpbRGmegP2Vgc7wnicfSD3Fp mL03sJl9iUPnpAxzx27Tad9mcYs+4c4Xi8sVo= 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=M4knfNziydg8xz3w7OTWFo2qsq6zaTW6DQN1Zbl0wio=; b=LnoybqMY24p6Dp46053yNGvnyzwvdqOOSMDldnfHULJRbAJZ5GtVK8+wEdQRswSkC8 J2Nh7ZVUEsVbSMCaO1j3pnrTp2hzYm+VG26rmLQUfl9vX6YJ4lEDM4O3cMmAA3T/uTIw P4AAhljjpUSUqhgMB1ycrQz3zeCYGAlTdHLl4WATSKsYuD2PED/xJqdOLYrYi4gORkMt e7ZL0d347ccZqvYRShcRLRAe+ERYGa0xc7jfg2CqCQSvLs3T7nVwDsrAw2W4Fn1rP4Sl mxKbImTO/7vtBQj0p7REybSy+O/PpyefXpZ9Xp1B/yIgx93YeBYvRALa2zsXGP9RBe02 bsXA== X-Gm-Message-State: ALQs6tAKY+G9MnIdhlV2EkPNR7VnnebAP4+ANVsvpG2N5TIg4vAJNghb +12109KELGkrHQzedfabEXSWEQ== X-Google-Smtp-Source: AIpwx49do+MnOOZTp6xj+poUZ9W9w7V8IsKOzC0cBwf5s/CgkRNLSi+BsTIsOlhSQv9w+DM1RVNI3w== X-Received: by 2002:adf:a925:: with SMTP id u34-v6mr5145986wrc.248.1524146358886; Thu, 19 Apr 2018 06:59:18 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u196sm3467520wmf.30.2018.04.19.06.59.07 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:17 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id DBBF53E0260; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:36 +0100 Message-Id: <20180419135901.30035-19-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 18/43] tests/tcg/i386: Build fix for hello-i386 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-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: Fam Zheng We have -Werror=missing-prototype, add a dummy prototype to avoid that warning. Signed-off-by: Fam Zheng Reviewed-by: Thomas Huth Reviewed-by: Richard Henderson --- tests/tcg/i386/hello-i386.c | 1 + 1 file changed, 1 insertion(+) diff --git a/tests/tcg/i386/hello-i386.c b/tests/tcg/i386/hello-i386.c index fa00380de2..cfeb24b2f5 100644 --- a/tests/tcg/i386/hello-i386.c +++ b/tests/tcg/i386/hello-i386.c @@ -20,6 +20,7 @@ static inline int write(int fd, const char * buf, int len) return status; } +void _start(void); void _start(void) { write(1, "Hello World\n", 12); From patchwork Thu Apr 19 13:58:37 2018 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: 901233 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Bg5DqEtL"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhLL6D7pz9s3D for ; Fri, 20 Apr 2018 00:33:30 +1000 (AEST) Received: from localhost ([::1]:50917 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Acq-0003mB-RL for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:33:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52828) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANY-0004n2-3W for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANT-00068L-Dc for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:40 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:44260) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANT-00067y-5j for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:35 -0400 Received: by mail-wr0-x243.google.com with SMTP id o15-v6so14510341wro.11 for ; Thu, 19 Apr 2018 07:17:35 -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 :mime-version:content-transfer-encoding; bh=mjpOLjaoGzyWGd8JfUynyR0nlaimjKnGDmOdOWejvfU=; b=Bg5DqEtLaMojtxn5xH/z2clPxp9JYxEZ/giHOYG5XKcmqm1HqG6w85TlqhscGjRtXr 385X9SOeVhnZ3EbTY3UHybZZNNQ9Izay3ROsJHgkZ6iEMjhNnh4HMzkIlLF0+d1GAF9h 7yNYot43+8dXONYEVr2q6mHPePER7FQlX6odU= 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=mjpOLjaoGzyWGd8JfUynyR0nlaimjKnGDmOdOWejvfU=; b=QI7f2dvhAWJGMxUPGLX/J13RPW8SXdFQSwhSwC752koq4aFMihnxF4gO0e9gRr6rze 0VzBEZFjzK7Uf3n2QXu0vATt0ZFve7vIG6yV8Gnbo/ERpTFOIrhHdKttVFD1FpGAo5gU 1chO+ab+UeYBaSQ4JLndr4MJAl7PuDJSNk/GAuOp/LaUmfE5h0Lwi6IPygsg6PKSpgVV K1Lbfz6ZuY6pR59tzqi5zJ+pOk8HFUCeSg3p5R0L1T6S9YJk/u2lNoBJ2/9DuPHoOsca pa33prNv0ChRUxMUrCT85IcQHTyzXHJ1jOWEEJfMrMATeBNT6O27kae82RVOiGAFjNcJ p8fA== X-Gm-Message-State: ALQs6tBItBa5QSsk+vuSk3/EpRx17s7jGdmykYbxpTG9OlfJVCz0JUKC 5CZeAaulLuLRpOenZqJ6ibXaDw== X-Google-Smtp-Source: AIpwx4/lONkx71Dzpxa3mh4DgCPKW3Xkd3C28uCqXua2pwY0LloBDBhF75Pp8b68Ehg20rnJf6Jcag== X-Received: by 2002:adf:c104:: with SMTP id r4-v6mr5200592wre.84.1524147454134; Thu, 19 Apr 2018 07:17:34 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e131sm198090wmg.1.2018.04.19.07.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EDA4F3E049E; Thu, 19 Apr 2018 14:59:02 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:37 +0100 Message-Id: <20180419135901.30035-20-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 19/43] tests/tcg/i386: fix test-i386 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The test-i386 test case is a little special as it includes assembler files. Add the additional compile magic to assemble these bits and link them to the final binary. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- tests/tcg/i386/test-i386.c | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index 9599204895..cae6a7773a 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -17,7 +17,6 @@ * along with this program; if not, see . */ #define _GNU_SOURCE -#include "qemu/compiler.h" #include #include #include From patchwork Thu Apr 19 13:58:38 2018 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: 901172 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="cURhxcCs"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgsN1KNwz9s1d for ; Fri, 20 Apr 2018 00:11:52 +1000 (AEST) Received: from localhost ([::1]:50015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AHu-0007bG-57 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:11:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47142) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADm-0004Od-UI for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADh-0004iU-1Y for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:34 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:39029) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADg-0004hN-QW for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:28 -0400 Received: by mail-wr0-x243.google.com with SMTP id q3-v6so4396080wrj.6 for ; Thu, 19 Apr 2018 07:07:28 -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 :mime-version:content-transfer-encoding; bh=vUipRvnkSMD8n2jt4YPtcr9YXU+GoIKvf8EYreRHLGQ=; b=cURhxcCsBinMEy8iz9VfpekDYF87Xv9ChqEBOY22zZkhHa/gjsylk+Z1xuY0eeIGD2 wRxnE6+ensMu+A5fyqRLuQGZZDhidfkoT7XUEWLSj0/OLUx8xMDlNjqt7OdVSlawqb49 kRHf7W8EdNaBJOQOOVUa8twzEeUa/CQwJdwfI= 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=vUipRvnkSMD8n2jt4YPtcr9YXU+GoIKvf8EYreRHLGQ=; b=Hhn1CISEykpjeaJhdtA/BVkFYg0D1EtbOiFOS+tiYsRCHOdPi0HX9KuqVnhPm0J0rH qPCiQ0rivV/G/UiSRl8EEH23YgtHYbukWnN1UDTrZtwrfEZ3/r8rhyt5y+0hQhUz0lfz ZK6D8gXZuC5qqqFXehiwx45bl2JZV1bmi2DlLKNDAoI7Hp/xxDejM/fcgFojx/9NV23O ix0yu+O1rG9bPomtK4vae12if+oKmFLSa7eJjveeIbyEk8FN/kUbtNoTs3Uz2fPBWyf9 39lPs8fuUU6jPTC6NshNZxjF8cTLJR+pHMura9jHgLJbIX+vo3ANdVMh1f09OXcu4JK3 VehQ== X-Gm-Message-State: ALQs6tApnnveyeYWEwm057LgL4hwdX+qjnCU0LGC/2sO9KfRNCg+aNSq iOWVsT/QhErYkvOpE2pvEIntLA== X-Google-Smtp-Source: AIpwx498GEu6N0ZguMq9P/ZvXlFkrquDIWOVKn8f7yihmjboPGJgY4MemTKQqis50yd/AARblstiPg== X-Received: by 2002:adf:874c:: with SMTP id 12-v6mr4936561wrz.275.1524146847824; Thu, 19 Apr 2018 07:07:27 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id l53-v6sm3404wrc.80.2018.04.19.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:26 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 0AB863E04A6; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:38 +0100 Message-Id: <20180419135901.30035-21-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 20/43] tests/tcg/i386: fix test-i386-fprem 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Remove dependencies on QEMU's source tree and build directly. Signed-off-by: Alex Bennée --- tests/tcg/i386/test-i386-fprem.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/tests/tcg/i386/test-i386-fprem.c b/tests/tcg/i386/test-i386-fprem.c index 1a71623204..66f5a9657d 100644 --- a/tests/tcg/i386/test-i386-fprem.c +++ b/tests/tcg/i386/test-i386-fprem.c @@ -23,7 +23,10 @@ * along with this program; if not, see . */ -#include "qemu/osdep.h" +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) /* * Inspired by 's union ieee854_long_double, but with single @@ -39,7 +42,7 @@ union float80u { unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; - } QEMU_PACKED ieee; + } __attribute__((packed)) ieee; /* This is for NaNs in the IEEE 854 double-extended-precision format. */ struct { @@ -49,7 +52,7 @@ union float80u { unsigned int exponent:15; unsigned int negative:1; unsigned int empty:16; - } QEMU_PACKED ieee_nan; + } __attribute__((packed)) ieee_nan; }; #define IEEE854_LONG_DOUBLE_BIAS 0x3fff @@ -229,6 +232,7 @@ static void test_fprem_cases(void) do_fprem_stack_underflow(); printf("= invalid operation =\n"); + do_fprem(q_nan.d, 1.0); do_fprem(s_nan.d, 1.0); do_fprem(1.0, 0.0); do_fprem(pos_inf.d, 1.0); @@ -238,6 +242,8 @@ static void test_fprem_cases(void) do_fprem(pos_denorm.d, 1.0); do_fprem(1.0, pos_denorm.d); + do_fprem(smallest_positive_norm.d, smallest_positive_norm.d); + /* printf("= underflow =\n"); */ /* TODO: Is there a case where FPREM raises underflow? */ } From patchwork Thu Apr 19 13:58:39 2018 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: 901202 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="M83LGe6Q"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh435S5gz9s2M for ; Fri, 20 Apr 2018 00:21:06 +1000 (AEST) Received: from localhost ([::1]:50359 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AQq-0001RR-8V for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:21:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47251) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADs-0004Ve-BF for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:46 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADq-0005Ch-Qn for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:40 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:45631) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADq-00057T-GV for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:38 -0400 Received: by mail-wr0-x243.google.com with SMTP id u11-v6so14407848wri.12 for ; Thu, 19 Apr 2018 07:07:38 -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 :mime-version:content-transfer-encoding; bh=Gdosn+sLwYDfNgBiyIEGRlmLYr7oX4ZvVfB9k5F+VgY=; b=M83LGe6QA6RfymU/FPiVnjzxnPgLradUc94Za1Mf2xc0/mn4HLb0y+P7GC4inMW9yl zjq8gJn/JJN44useAyEZ2vr9IuSRgUMwyzoc5LuqBlNYLNCV81+9ygTazSt5XiG8i+87 cEla7Ybe4b1UyUhnQSaBMpVZUEl4hzKpHGwTM= 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=Gdosn+sLwYDfNgBiyIEGRlmLYr7oX4ZvVfB9k5F+VgY=; b=VKEy1lKM/Chsz1v9ScBBGyLcn+gE/oSmHWE3XKByRLKfMaIdQjqCBInA7clUoHWZ9j teGnl8CLOWy+LO7nS/g8V9A4B6OZQfQHhhRUfRLElEccUGlMUF5cUzgQMLN5HRWT3jHh B7HPQAHT+0pPO7xhczg4EV+w5kh7pZC3Xr8LYCpbY3G8Xl63grZVQZcrREtIgiqiSgW+ 7If0stjMuNCJkGtu9iD38xLXYA0qll1vqn/fRO7OAv1RTxH3W7ZfxHqdqNVNEvV0ChkY 9zjmvG3GK2va4WLUVO1yhwTJy9Cg8uZhHrOnim9sd/5ohYMT3nUbZ/hXrriF/OgqhLtL A4Ug== X-Gm-Message-State: ALQs6tCEh9kYZhaVROj5FqeMzScBzC2iCdSRZTJYbmMQQ/VJ7mplfV4Q gvaZ5IB769cjSUko8I49A/65iQ== X-Google-Smtp-Source: AIpwx4+Pxj1z27YXDc9K5NBstYYi7rx2kArWgSik6+LXT7X1nnCk1yDrIy/tO8QMudo2nJvMiF1PEQ== X-Received: by 2002:adf:a453:: with SMTP id e19-v6mr5048230wra.121.1524146857447; Thu, 19 Apr 2018 07:07:37 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id b105-v6sm6613784wrd.64.2018.04.19.07.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1C59C3E04BB; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:39 +0100 Message-Id: <20180419135901.30035-22-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 21/43] tests/tcg/i386: disable i386 version of test-i386-ssse 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" It doesn't build for i386 easily and we probably need a better more methodical test for SSE et all in QEMU. Signed-off-by: Alex Bennée --- tests/tcg/i386/Makefile.target | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index 2f27b65e2d..a6cc76664c 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -9,7 +9,7 @@ I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c)) I386_TESTS=$(I386_SRCS:.c=) # Update TESTS -TESTS+=$(I386_TESTS) +TESTS+=$(I386_ONLY_TESTS) ifneq ($(TARGET_NAME),x86_64) CFLAGS+=-m32 From patchwork Thu Apr 19 13:58:40 2018 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: 901175 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="N5bPXqPd"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgv43rb5z9s1l for ; Fri, 20 Apr 2018 00:13:20 +1000 (AEST) Received: from localhost ([::1]:50046 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AJK-0000JK-Cv for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:13:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42838) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5r-0006Ab-BZ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5q-0002h2-CD for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:23 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:34856) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5q-0002er-52 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:22 -0400 Received: by mail-wr0-x241.google.com with SMTP id w3-v6so14354563wrg.2 for ; Thu, 19 Apr 2018 06:59:21 -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 :mime-version:content-transfer-encoding; bh=6cCILsw7Ds0t9cXFsW29dGcUt526P7FLE3AZ1xhalc8=; b=N5bPXqPdxVfQ1kV6ZV5NW+fclEcOVgiElwXBWDIXVE61zIUW9FCsljhbc34XNIDr17 2Y2MZIIXakx2IZEnhacwIBIkiKrgcYNTU/w6nvrMeb9MZrprVAF+ElrcyxOqDSa/pnlP 8LrcLE9RYzf6kj3Pu/TMueIG7RmWJqt6eMzKk= 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=6cCILsw7Ds0t9cXFsW29dGcUt526P7FLE3AZ1xhalc8=; b=KmRM+Jgypb2DA/maLpQRxbyKjVbZfIxmzp+ZrYojxjBqX0uGV+73CY9epNOtOMIlg9 PA6K5RBtj4GLxZPqyUfJx911pAOCol56IMFlvNNaALsNmMRm+qE+ZaVP49hB++CSR/iW ZJ1dlLzOQAJthhyM5JAG9poBECphJ+tSPHGaSwjdoYAEo7++EhR+EKSok8Fk8/rl9m4H U8nZ4y43spWIpzOTVHKIbxT4wjVc9SZPHgTV88kAf9CzK27siFaYwuu2tWz3ashIplF7 GYZjABM4jq4TSjKSuOo1uu979uTQ2P5e3T4sn21fkmmznQCN4UgEi7kBrYnKcrkETlDQ IWzw== X-Gm-Message-State: ALQs6tB9OQfTeIjbqJASaDzY4V98QDS25YDOAUnq8A68ZmvKYOGglAkD JUA3XA6qCOuCJHGCFLNC+kSPsA== X-Google-Smtp-Source: AIpwx4/kAv4OvPdlPGZGdk3wuKg/bOzD3ihJ6GiPXatGFB9Tq6ng0n4KFspOmrC+Qn9WvFfEddKcMg== X-Received: by 2002:adf:a144:: with SMTP id r4-v6mr4698229wrr.217.1524146360972; Thu, 19 Apr 2018 06:59:20 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r19-v6sm3627203wrg.8.2018.04.19.06.59.08 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:17 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 2EE4B3E04D2; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:40 +0100 Message-Id: <20180419135901.30035-23-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 22/43] tests/tcg/x86_64: add Makefile.target 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The sources for x86_64 are shared in the i386 directory which will be included thanks to TARGET_BASE_ARCH. However not all sources build so we need to filter out the ones we can't build in the 64 bit world. Signed-off-by: Alex Bennée --- tests/tcg/i386/Makefile.target | 2 +- tests/tcg/x86_64/Makefile.target | 15 +++++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/x86_64/Makefile.target diff --git a/tests/tcg/i386/Makefile.target b/tests/tcg/i386/Makefile.target index a6cc76664c..3a2736616c 100644 --- a/tests/tcg/i386/Makefile.target +++ b/tests/tcg/i386/Makefile.target @@ -7,7 +7,7 @@ VPATH += $(I386_SRC) I386_SRCS=$(notdir $(wildcard $(I386_SRC)/*.c)) I386_TESTS=$(I386_SRCS:.c=) - +I386_ONLY_TESTS=$(filter-out test-i386-ssse3, $(I386_TESTS)) # Update TESTS TESTS+=$(I386_ONLY_TESTS) diff --git a/tests/tcg/x86_64/Makefile.target b/tests/tcg/x86_64/Makefile.target new file mode 100644 index 0000000000..74f170b9ed --- /dev/null +++ b/tests/tcg/x86_64/Makefile.target @@ -0,0 +1,15 @@ +# -*- Mode: makefile -*- +# +# x86_64 tests - included from tests/tcg/Makefile.target +# +# Currently we only build test-x86_64 and test-i386-ssse3 from +# $(SRC)/tests/tcg/i386/ +# + +X86_64_TESTS=$(filter-out $(I386_ONLY_TESTS), $(TESTS)) +X86_64_TESTS+=test-x86_64 +TESTS:=$(X86_64_TESTS) + +test-x86_64: LDFLAGS+=-lm -lc +test-x86_64: test-i386.c test-i386.h test-i386-shift.h test-i386-muldiv.h + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) From patchwork Thu Apr 19 13:58:41 2018 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: 901227 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="S7tp0aCx"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhHB756rz9s27 for ; Fri, 20 Apr 2018 00:30:46 +1000 (AEST) Received: from localhost ([::1]:50849 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AaC-0001jB-Op for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:30:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47383) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADw-0004bU-Bk for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADv-0005Pq-EU for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:44 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:35071) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADv-0005PP-82 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: by mail-wr0-x244.google.com with SMTP id w3-v6so14436652wrg.2 for ; Thu, 19 Apr 2018 07:07:43 -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 :mime-version:content-transfer-encoding; bh=TBVWT2Jr7xSs5Jn182OBbwMa7+l8UTJ/4IciEatXAQQ=; b=S7tp0aCxIUqvw4Es9cEWRQdo7elQXyGvrY6uMxbMBsKIBaj9Clxx89tHp3QXRyEY9p zdJhsebJdlAbYwtb4fOYzpMtiQLiFbxCW7iWZ+goWfVesvFOenGtbhV7ukp2eaRKXrnO NBGuWNAVLQ0Kh4HNgX7Q6taPEXK8J42bTS7pM= 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=TBVWT2Jr7xSs5Jn182OBbwMa7+l8UTJ/4IciEatXAQQ=; b=EfFA8yxmWEpjWmaAaixCjXVGfL0/8EVei9xj/ubMBY03AO1A4tFnH0ZRfmjlrxF54o lFm0SQ+xq7xxG+d0R0UPrsIn388d0LyT5Pm7fi4FM6F+q7UDm/+DPx0jGlDn05uRKmpj GSejnNRs95aBXOXlzOrOa1oW+uixh+6WOsOKmWz9tBisGVqnRv4ro7sybAESKE4mc6uT hajraVkbDoCqjoOeaQO1CUmD7P7/R4MTpTadqweWBQYv2sWIo5CjxIt/N/WKG0UYUR8B yyoLEZF3W4XaX7HcKHFaGgdunsu1WuARyupSYt+GLwkOsZlRDnI+NP10RejYLOm9CiSm EPoQ== X-Gm-Message-State: ALQs6tBbrC7kMCb06Rg6fDb9A8ARkix1GdRvx2bS/FW9P2LS+KzASxiJ FDgGDMI9rMKbEZl+olDyEKzQRQ== X-Google-Smtp-Source: AIpwx49hGlZlS1Q0TAgkua+S0mr+WjafCEU94Lx8H5/UznI9Vsp0i9iWTd/BtRBj6U0BsRBhAlGlcg== X-Received: by 10.28.0.4 with SMTP id 4mr4471224wma.118.1524146862249; Thu, 19 Apr 2018 07:07:42 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o17-v6sm5855865wrc.71.2018.04.19.07.07.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:37 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 408213E04E4; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:41 +0100 Message-Id: <20180419135901.30035-24-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 23/43] tests/tcg/i386/test-i386: use modern vector_size attributes 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The compiler complains about the old __mode__ style attributes. Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/i386/test-i386.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index cae6a7773a..caef4da176 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -2106,8 +2106,8 @@ static void test_enter(void) #ifdef TEST_SSE -typedef int __m64 __attribute__ ((__mode__ (__V2SI__))); -typedef float __m128 __attribute__ ((__mode__(__V4SF__))); +typedef int __m64 __attribute__ ((vector_size(8))); +typedef float __m128 __attribute__ ((vector_size(16))); typedef union { double d[2]; From patchwork Thu Apr 19 13:58:42 2018 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: 901187 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="b+3u6K4n"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgzj5LVmz9s27 for ; Fri, 20 Apr 2018 00:17:21 +1000 (AEST) Received: from localhost ([::1]:50344 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AND-0003qm-M0 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:17:19 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47237) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADr-0004Ux-QZ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADl-0004tL-Bf for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:39 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:45026) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADl-0004p9-47 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:33 -0400 Received: by mail-wr0-x243.google.com with SMTP id o15-v6so14414128wro.11 for ; Thu, 19 Apr 2018 07:07:33 -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 :mime-version:content-transfer-encoding; bh=ekjhqvnR95X+jHr1V+i4OxaQLzEJ58BKrFKB0zdZII8=; b=b+3u6K4nK2B2ZRAJjrt2pGFZ5vbHfas8stiFvcXfKlB1+U3LrFsM8SdF3hops9+5Go aafLICMJXZGmT0BZ2rTIGCC3+9fqJl5HHBXTP5pe3YbDy9bBz0QgZJQoddE+S/jxIpQc ToRUXQInYB9lOTkEx+vyrQUt7hfjvYmjMmVmE= 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=ekjhqvnR95X+jHr1V+i4OxaQLzEJ58BKrFKB0zdZII8=; b=dIkzdEDaW/03gqRG1C05ssfGynzVtz76UjCXz8e2eEIdzry54mejRdU2lPUN54IWMU 1pYiL9r9A/CFwDfypKnQE/KQqRyX01aLV7eYGq40/q5nXqQmBPsz2scfuEwfC1rE0FgL 3gtFARY+S1oa+qBqQ0Lb7vRe2Wuq/WUnxg+/WNtRNlHsJkA/NFzepIyN8tzyD+jYHn9V D3pqdF1GEWDut+pLJcwPUnDaBy5mUawBMmT/uTGOxRjq3RshWxhIFhvkv2g90FS5Qbma eoJGp/Y87Escg2OaYT8Rsu1vmOdrUMvBHkGEp1x6es2tcgvgFKRWBK2TuE3bvcI44q6i dImw== X-Gm-Message-State: ALQs6tAWfCv+KUGoYYfDrQ4/jnZwPgGLKWToFs/K4guhWYJMYWGCN+ir 9UoRalN7zN+QdTdPbjWklRLjEbSBrpc= X-Google-Smtp-Source: AIpwx4/qZzu4HbQ1ZhIGkfm6KiQiBTsH/4SkehR1xJSkPW1JY6oDqL+gc/1uF4yAaZntPS0CllCxqQ== X-Received: by 2002:adf:9654:: with SMTP id c20-v6mr5154997wra.89.1524146852185; Thu, 19 Apr 2018 07:07:32 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id r200sm8242822wmb.39.2018.04.19.07.07.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 5209F3E050A; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:42 +0100 Message-Id: <20180419135901.30035-25-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 24/43] tests/tcg/i386/test-i386: fix printf format 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée Reviewed-by: Richard Henderson --- tests/tcg/i386/test-i386.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tests/tcg/i386/test-i386.c b/tests/tcg/i386/test-i386.c index caef4da176..a29b41e764 100644 --- a/tests/tcg/i386/test-i386.c +++ b/tests/tcg/i386/test-i386.c @@ -2258,7 +2258,7 @@ SSE_OP(a ## sd); "pop %0\n"\ : "=rm" (eflags)\ : "x" (a.dq), "x" (b.dq));\ - printf("%-9s: a=%f b=%f cc=%04x\n",\ + printf("%-9s: a=%f b=%f cc=%04lx\n",\ #op, a1, b1,\ eflags & (CC_C | CC_P | CC_Z | CC_S | CC_O | CC_A));\ } From patchwork Thu Apr 19 13:58:43 2018 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: 901284 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="NmCDbXYr"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhcQ0hZgz9s3D for ; Fri, 20 Apr 2018 00:45:41 +1000 (AEST) Received: from localhost ([::1]:52181 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Aod-0005Ce-NE for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:45:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52805) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANX-0004mU-FQ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANR-00067W-Vd for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:38 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42545) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANR-00066e-PA for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:33 -0400 Received: by mail-wr0-x244.google.com with SMTP id s18-v6so14504737wrg.9 for ; Thu, 19 Apr 2018 07:17:33 -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 :mime-version:content-transfer-encoding; bh=0OulYNr93ZEqOVNUubph9dlHQ42n7JguuGfru1NCCMU=; b=NmCDbXYrNIso0DXKuTgpt3sjGIdx+kzZAyWkF0xjRWbYwuQrj1XvEiyEjSuJjKhVSv Nei/kQqyKs9emvtvCZBQw0AYRcxEk9cxUgnT4JmOLI7CnwAEhfGlF/1sNn2LYwaNGaVM m+Y8bkgQgnFNXykbg2J8aAtOrc2E7em/U7yxE= 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=0OulYNr93ZEqOVNUubph9dlHQ42n7JguuGfru1NCCMU=; b=G7PbWdLFhR64R5BilcbeNg0Ww7c0V+mpSTzr2hkQoDRy93qGia/y5nS1HoY1ldj3v1 o/k71cVmmvgiERJl+gOyAClh+j8Km8WZ4R+iECFJc4ZXRE1BCsuBDjjUw1G1Wahoa//r wVdaemZKtwnPXD19/3VyiYDVnK6vZdANb3KE8wvTTYykI4mOqQL70SWDMnbOfaKBDooO kDWhKNO2CaLZInuzeNLa5A3y2OWeIqhQ6nYdRcpGJfT/Q55J/SlzaGIcBfQyLMrAT+CQ V7wKOcZMBoQrj4UcX5XeWC82eTvDBXCKNrgPU800aRnGJELpWVUDNdI5Ot9pS0rgtBoy uCig== X-Gm-Message-State: ALQs6tAIiHZds6WB4hqFQ3q3ok7+TrjxDCbST4Cul6Cz57w3myeHQWmf flZQEQVDKT22vLMCYaInw8HDOg== X-Google-Smtp-Source: AIpwx4+jrCqhUmJCLk1lXyxgsgRy+Siw9FT19lMCXxmfIwRBKxi3H/B82wj47h6mvgZZmwQC3ekhYQ== X-Received: by 2002:adf:d1d1:: with SMTP id m17-v6mr784399wri.96.1524147452772; Thu, 19 Apr 2018 07:17:32 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id u36-v6sm7137042wrf.87.2018.04.19.07.17.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 66BED3E054C; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:43 +0100 Message-Id: <20180419135901.30035-26-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 25/43] tests/tcg: move ARM specific tests into subdir 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" These only need to be built for ARM guests. Signed-off-by: Alex Bennée Reviewed-by: Thomas Huth Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson --- v2 - do VPATH manipulation in tests/tcg/arm/Makefile.target - merge with fix hello-arm test --- tests/tcg/README | 9 --------- tests/tcg/arm/Makefile.target | 13 +++++++++++++ tests/tcg/arm/README | 11 +++++++++++ tests/tcg/{ => arm}/hello-arm.c | 0 tests/tcg/{ => arm}/test-arm-iwmmxt.s | 0 5 files changed, 24 insertions(+), 9 deletions(-) create mode 100644 tests/tcg/arm/Makefile.target create mode 100644 tests/tcg/arm/README rename tests/tcg/{ => arm}/hello-arm.c (100%) rename tests/tcg/{ => arm}/test-arm-iwmmxt.s (100%) diff --git a/tests/tcg/README b/tests/tcg/README index 469504c4cb..625f2326e6 100644 --- a/tests/tcg/README +++ b/tests/tcg/README @@ -5,15 +5,6 @@ or they are architecture specific. -ARM -=== - -hello-arm ---------- - -test-arm-iwmmxt ---------------- - MIPS ==== diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target new file mode 100644 index 0000000000..bc6962ecc6 --- /dev/null +++ b/tests/tcg/arm/Makefile.target @@ -0,0 +1,13 @@ +# -*- Mode: makefile -*- +# +# ARM - included from tests/tcg/Makefile.target +# + +ARM_SRC=$(SRC_PATH)/tests/tcg/arm + +# Set search path for all sources +VPATH += $(ARM_SRC) + + +hello-arm: CFLAGS+=-marm -ffreestanding +hello-arm: LDFLAGS+=-nostdlib diff --git a/tests/tcg/arm/README b/tests/tcg/arm/README new file mode 100644 index 0000000000..e6307116e2 --- /dev/null +++ b/tests/tcg/arm/README @@ -0,0 +1,11 @@ +These are ARM specific guest programs + +hello-arm +--------- + +A very simple inline assembly, write syscall based hello world + +test-arm-iwmmxt +--------------- + +A simple test case for older iwmmxt extended ARMs diff --git a/tests/tcg/hello-arm.c b/tests/tcg/arm/hello-arm.c similarity index 100% rename from tests/tcg/hello-arm.c rename to tests/tcg/arm/hello-arm.c diff --git a/tests/tcg/test-arm-iwmmxt.s b/tests/tcg/arm/test-arm-iwmmxt.s similarity index 100% rename from tests/tcg/test-arm-iwmmxt.s rename to tests/tcg/arm/test-arm-iwmmxt.s From patchwork Thu Apr 19 13:58:44 2018 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: 901225 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="E4K6K9QG"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhF84M2vz9s1l for ; Fri, 20 Apr 2018 00:29:00 +1000 (AEST) Received: from localhost ([::1]:50838 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AYU-0000HE-Ea for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:28:58 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52740) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANQ-0004go-F6 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANP-00065m-LJ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:32 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:43970) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANP-00065P-F9 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:31 -0400 Received: by mail-wr0-x244.google.com with SMTP id u4-v6so14504772wrg.10 for ; Thu, 19 Apr 2018 07:17:31 -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 :mime-version:content-transfer-encoding; bh=pj18XZhZR/Qc6G0FNDx9yQSp1u3QyGzeTNKFrokJOwc=; b=E4K6K9QG5CcWiAmTzWjZ8xAPDGCzRpErQdWRTkZl/kEW3VThCHpKz9j0rUwHshveFR C+WwYmlPphqJ//x9OHUQzDxOvctsqO2sbe/0ehU9F8B/Envd7ftZOqrAX0FO1YjUDczW 0z7mx9uvw8vqiZToXjr2Ex5Zq39ij+1ywIfJs= 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=pj18XZhZR/Qc6G0FNDx9yQSp1u3QyGzeTNKFrokJOwc=; b=pbP2m3k8o7u3n3bUChxA9C/K3XoYNt5DFsTipYs6kNwHGh3nQ3DHsTIHtyu9HnRZwL IO9jynr+krPcEeOTnLZ9jQVZoE7p2Da/h1Zk3yfCGLCyxnJ55X8QP1jXPpzFaA0dzpBr d5Dthth5YjiaGvEhfcTotSa76kz4NbyWA0zjExTCEbZw6MPnUmCwaPYD9+cHedA2HT7W +fqnl8g2yVgOAUUSYlwQq3pViBC9BThK94W7MDye/uKaC4q++F448EPfEqPjqcmG0xT+ K7iSPRtKkXp4WhxrlsZ4IezLjKLACWgu9G4cOBP5aAiw29YTY3wNhMqlaKj3ng7xaz76 6Otw== X-Gm-Message-State: ALQs6tC1heD6T/5WMWoia8XP8Lm7THq0jjB51n2rg31zIBnx6V6Ez+EF 0ah49tfF8QipzBN8HT4jh/hk8A== X-Google-Smtp-Source: AIpwx4+W99bAXNoARmt13oXDItRRaxH9+bJWN6QdQue0vwQREODvVk0J3PxgBq6L8Qut++J5YHB16A== X-Received: by 10.28.114.9 with SMTP id n9mr4477686wmc.147.1524147450336; Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id o12-v6sm1662633wri.78.2018.04.19.07.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 781853E055F; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:44 +0100 Message-Id: <20180419135901.30035-27-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 26/43] tests/tcg/arm: fix up test-arm-iwmmxt test 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" We need to rename the source file to a .S so we can do a single-line assemble and link invocation. We also specify the additional CFLAGS for the compile as it's a non-standard ARM binary. Signed-off-by: Alex Bennée --- tests/tcg/arm/Makefile.target | 5 +++++ tests/tcg/arm/{test-arm-iwmmxt.s => test-arm-iwmmxt.S} | 0 2 files changed, 5 insertions(+) rename tests/tcg/arm/{test-arm-iwmmxt.s => test-arm-iwmmxt.S} (100%) diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index bc6962ecc6..be9d3fb4a1 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -8,6 +8,11 @@ ARM_SRC=$(SRC_PATH)/tests/tcg/arm # Set search path for all sources VPATH += $(ARM_SRC) +TESTS += hello-arm test-arm-iwmmxt hello-arm: CFLAGS+=-marm -ffreestanding hello-arm: LDFLAGS+=-nostdlib + +test-arm-iwmmxt: CFLAGS+=-marm -march=iwmmxt -mabi=aapcs +test-arm-iwmmxt: test-arm-iwmmxt.S + $(CC) $(CFLAGS) $< -o $@ $(LDFLAGS) diff --git a/tests/tcg/arm/test-arm-iwmmxt.s b/tests/tcg/arm/test-arm-iwmmxt.S similarity index 100% rename from tests/tcg/arm/test-arm-iwmmxt.s rename to tests/tcg/arm/test-arm-iwmmxt.S From patchwork Thu Apr 19 13:58:45 2018 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: 901182 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ddzqzfGe"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgyK5X2sz9s1l for ; Fri, 20 Apr 2018 00:16:09 +1000 (AEST) Received: from localhost ([::1]:50189 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AM3-0002nV-Il for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:16:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47107) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADm-0004NM-0O for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADk-0004rB-T4 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:33 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:42305) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADk-0004nC-If for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:32 -0400 Received: by mail-wr0-x242.google.com with SMTP id s18-v6so14410189wrg.9 for ; Thu, 19 Apr 2018 07:07:32 -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 :mime-version:content-transfer-encoding; bh=gNLVzucu4VwedbANj/UcP6keX1N6ceHAqN5yFr0ldfs=; b=ddzqzfGeTBp1jNo462DUg5FlJM2tNBM7bprbEvfcIyM+A50DXeG/d584H1aBDteUFC 6P+8boVPYSPiAlDvATgBemGyhI2ChMeZOO+uCKB/UBdL3Z/NXrwqLaho0BWEVGUz58F9 yGA7M2120tEVOaxSxNA2UNEGRiJEt+Id80zQY= 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=gNLVzucu4VwedbANj/UcP6keX1N6ceHAqN5yFr0ldfs=; b=GJ5G8XNqVdBplV03qd9n8rqDyE7eruqFjkJiXTrxhrn82cgOENfU83kAxxQtdaPMYI IGvnsbCDZj9qx08M3+Xs7MRiRNthlWhSepAWQPbEH7bZjTIfHJI55/RFQzaqoGXGejEl QwDYr42xNAL8JGLn7WORArPkImLTzpqZqju1tKkL3mK2g5dgLHAvLEzGQZh7pOlaGoZW W1/O8KWWJ4+wTWFLY1DKPY4e0JYf9fihT+d/I4Ie35n+I7aILHIbKj+Af+aDtqpIdz1D zvsQHgJWxsqkoYmIXWyNyRtDE5RUaoq1+MjmRoJRNTmiHgXGRtj+NzojO2Zy+Ur5cpTy vF4w== X-Gm-Message-State: ALQs6tChz1PG0bH7QK+eIcdbLbLeL2cHpWNeiOD/PK18Ye5IQGygO4Sx EPBcjccd/cEbamgaExmmhpX5XA== X-Google-Smtp-Source: AIpwx4+j9trzoCfjc0dYocEggippfTPfr34N9SlPb5sCQFyEh8OZwiaGyMwhdYVr9GMD95cVCUTfuA== X-Received: by 10.28.173.4 with SMTP id w4mr4899494wme.54.1524146851486; Thu, 19 Apr 2018 07:07:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id j21-v6sm5281206wrb.49.2018.04.19.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 88AB83E05CE; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:45 +0100 Message-Id: <20180419135901.30035-28-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 27/43] tests/tcg/aarch64: add Makefile.target 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Nothing much here yet. Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 tests/tcg/aarch64/Makefile.target diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target new file mode 100644 index 0000000000..4ac8fbe73f --- /dev/null +++ b/tests/tcg/aarch64/Makefile.target @@ -0,0 +1,5 @@ +# -*- Mode: makefile -*- +# +# AArch64 specific tweaks + +fcvt: LDFLAGS+=-lm From patchwork Thu Apr 19 13:58:46 2018 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: 901228 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="eJU+HGjR"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhHG10thz9s27 for ; Fri, 20 Apr 2018 00:30:50 +1000 (AEST) Received: from localhost ([::1]:50847 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AaF-0001hS-RC for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:30:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AE0-0004jG-Ql for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:58 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADl-0004sm-6F for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:48 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:37701) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADk-0004nF-Ib for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:33 -0400 Received: by mail-wr0-x243.google.com with SMTP id f14-v6so14431610wre.4 for ; Thu, 19 Apr 2018 07:07:32 -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 :mime-version:content-transfer-encoding; bh=wDa+1OvPqvIGn3OtE5JrsRTXBLfWbyx5z+QlV4Vb/rM=; b=eJU+HGjRO0oy6chN6SS35pRkuhy2wdb2azHaLpy5cdiaHdIqSyF214tSx3Ht3BeWTX ntxKZU9zgX7PNzVDm1YVf71daFg0/z00GWucIfcvFtr15B6hmnnJtYFB9oC74LyjXdMw p/TKLJTCq38lDKMR5Umz4J92hqcbZDSwRn25o= 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=wDa+1OvPqvIGn3OtE5JrsRTXBLfWbyx5z+QlV4Vb/rM=; b=ik/YDEau9p+UdZ8r04hW1ueYwbN+D+e6nNYdPORUTp+gB+Oi4S34WRGwaqzNQ5JMMX Y36XwsixpxDoY4myPteyWWVN2WkVB31OOyW9F2VVRA4Mga4zcdP1y/w5OPlLs/L/MtSz NrGJj6QKgE1rDCurgZC0SJtQJfd15Beft4Zwmppys1ZuQnQ0ITjKZ27o2JUrPpWgLlxs C0qdUpVMcuaezBCEVoHVM5sOUSbSIgIKXyzhtOjdFxUxrT+kHPRl+diyar7nsPvO1vQE gKKg5jKpnS8NKyM/XOdKt9kYa+9gB3eS0IrU7vf2HX19V7kr9/cSpgwiH85LdK4n1kmo b9RA== X-Gm-Message-State: ALQs6tBMxAz0yU7aiUCBCa8K6xZ0nv0XfBrQ4bQN2WW8RgaTQpIBE55o tItN6imqVqY8yuTLlK8Ezjhy7g== X-Google-Smtp-Source: AIpwx4+ULP5X4hpmB+h7Q7bXFR05SfLEmUBJq4KS3GT2bm6qsFBlsKoC3Yx+o5ECbePTUFv2lz1uxQ== X-Received: by 2002:adf:c908:: with SMTP id m8-v6mr3949660wrh.6.1524146850255; Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id m83sm4676364wma.17.2018.04.19.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:26 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A12393E0618; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:46 +0100 Message-Id: <20180419135901.30035-29-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 28/43] tests/tcg/aarch64: add fcvt test cases for AArch64 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This runs through the usual float to float conversions and crucially also runs with ARM Alternative Half Precision Format. Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 8 + tests/tcg/aarch64/fcvt.c | 260 ++++++ tests/tcg/aarch64/fcvt.out | 1305 +++++++++++++++++++++++++++++ tests/tcg/arm/Makefile.target | 4 +- 4 files changed, 1576 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/aarch64/fcvt.c create mode 100644 tests/tcg/aarch64/fcvt.out diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 4ac8fbe73f..26be1c58ef 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -2,4 +2,12 @@ # # AArch64 specific tweaks +AARCH64_SRC=$(SRC_PATH)/tests/tcg/aarch64 +VPATH += $(AARCH64_SRC) + +# we don't build any of the ARM tests +AARCH64_TESTS=$(filter-out $(ARM_TESTS), $(TESTS)) +AARCH64_TESTS+=fcvt +TESTS:=$(AARCH64_TESTS) + fcvt: LDFLAGS+=-lm diff --git a/tests/tcg/aarch64/fcvt.c b/tests/tcg/aarch64/fcvt.c new file mode 100644 index 0000000000..e8d322e0bd --- /dev/null +++ b/tests/tcg/aarch64/fcvt.c @@ -0,0 +1,260 @@ +/* + * Test Floating Point Conversion + */ + +#include +#include +#include +#include +#include + +#define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) + +static char flag_str[256]; + +static char *get_flag_state(int flags) +{ + if (flags) { + snprintf(flag_str, sizeof(flag_str), "%s %s %s %s %s", + flags & FE_OVERFLOW ? "OVERFLOW" : "", + flags & FE_UNDERFLOW ? "UNDERFLOW" : "", + flags & FE_DIVBYZERO ? "DIV0" : "", + flags & FE_INEXACT ? "INEXACT" : "", + flags & FE_INVALID ? "INVALID" : ""); + } else { + snprintf(flag_str, sizeof(flag_str), "OK"); + } + + return flag_str; +} + +static void print_double_number(int i, double num) +{ + uint64_t double_as_hex = *(uint64_t *) # + int flags = fetestexcept(FE_ALL_EXCEPT); + char *fstr = get_flag_state(flags); + + printf("%02d DOUBLE: %02.20e / %#020lx (%#x => %s)\n", + i, num, double_as_hex, flags, fstr); +} + +static void print_single_number(int i, float num) +{ + uint32_t single_as_hex = *(uint32_t *) # + int flags = fetestexcept(FE_ALL_EXCEPT); + char *fstr = get_flag_state(flags); + + printf("%02d SINGLE: %02.20e / %#010x (%#x => %s)\n", + i, num, single_as_hex, flags, fstr); +} + +static void print_half_number(int i, uint16_t num) +{ + int flags = fetestexcept(FE_ALL_EXCEPT); + char *fstr = get_flag_state(flags); + + printf("%02d HALF: %#04x (%#x => %s)\n", + i, num, flags, fstr); +} + +float single_numbers[] = { -FLT_MAX, -FLT_MIN, + 0.0, + FLT_MIN, + 1.0, 2.0, + M_E, M_PI, + 0x9EA82A22, + 0xAB98FBA8, + FLT_MAX }; + +static void convert_single_to_half(void) +{ + int i; + + printf("Converting single-precision to half-precision\n"); + + for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) { + float input = single_numbers[i]; + uint16_t output; + + feclearexcept(FE_ALL_EXCEPT); + + print_single_number(i, input); + asm("fcvt %h0, %d1" : "=w" (output) : "x" (input)); + print_half_number(i, output); + } +} + +static void convert_single_to_double(void) +{ + int i; + + printf("Converting single-precision to double-precision\n"); + + for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) { + float input = single_numbers[i]; + uint64_t output; + + feclearexcept(FE_ALL_EXCEPT); + + print_single_number(i, input); + asm("fcvt %h0, %d1" : "=w" (output) : "x" (input)); + print_double_number(i, output); + } +} + +double double_numbers[] = { -DBL_MAX, + -2.0, -1.0, + -DBL_MIN, + 0.0, + DBL_MIN, + 1.0, 2.0, + M_E, M_PI, + 0x9EA82A2287680UL, + 0xAB98FBA843210UL, + DBL_MAX }; + +static void convert_double_to_half(void) +{ + int i; + + printf("Converting double-precision to half-precision\n"); + + for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) { + double input = double_numbers[i]; + uint16_t output; + + feclearexcept(FE_ALL_EXCEPT); + + print_double_number(i, input); + + /* as we don't have _Float16 support */ + asm("fcvt %h0, %d1" : "=w" (output) : "x" (input)); + print_half_number(i, output); + } +} + +static void convert_double_to_single(void) +{ + int i; + + printf("Converting double-precision to single-precision\n"); + + for (i = 0; i < ARRAY_SIZE(single_numbers); ++i) { + double input = double_numbers[i]; + uint32_t output; + + feclearexcept(FE_ALL_EXCEPT); + + print_double_number(i, input); + + asm("fcvt %s0, %d1" : "=w" (output) : "x" (input)); + + print_single_number(i, output); + } +} + +/* no handy defines for these numbers */ +uint16_t half_numbers[] = { + 0xffff, /* -NaN / AHP -Max */ + 0xfcff, /* -NaN / AHP */ + 0xfc01, /* -NaN / AHP */ + 0xfc00, /* -Inf */ + 0xfbff, /* -Max */ + 0xc000, /* -2 */ + 0xbc00, /* -1 */ + 0x8001, /* -MIN subnormal */ + 0x8000, /* -0 */ + 0x0000, /* +0 */ + 0x0001, /* MIN subnormal */ + 0x3c00, /* 1 */ + 0x7bff, /* Max */ + 0x7c00, /* Inf */ + 0x7c01, /* NaN / AHP */ + 0x7cff, /* NaN / AHP */ + 0x7fff, /* NaN / AHP +Max*/ +}; + +static void convert_half_to_double(void) +{ + int i; + + printf("Converting half-precision to double-precision\n"); + + for (i = 0; i < ARRAY_SIZE(half_numbers); ++i) { + uint16_t input = half_numbers[i]; + double output; + + feclearexcept(FE_ALL_EXCEPT); + + print_half_number(i, input); + asm("fcvt %d0, %h1" : "=w" (output) : "x" (input)); + print_double_number(i, output); + } +} + +static void convert_half_to_single(void) +{ + int i; + + printf("Converting half-precision to single-precision\n"); + + for (i = 0; i < ARRAY_SIZE(half_numbers); ++i) { + uint16_t input = half_numbers[i]; + float output; + + feclearexcept(FE_ALL_EXCEPT); + + print_half_number(i, input); + asm("fcvt %s0, %h1" : "=w" (output) : "x" (input)); + print_single_number(i, output); + } +} + +typedef struct { + int flag; + char *desc; +} float_mapping; + +float_mapping round_flags[] = { + { FE_TONEAREST, "to nearest" }, + { FE_UPWARD, "upwards" }, + { FE_DOWNWARD, "downwards" }, + { FE_TOWARDZERO, "to zero" } +}; + +int main(int argc, char *argv[argc]) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(round_flags); ++i) { + fesetround(round_flags[i].flag); + printf("### Rounding %s\n", round_flags[i].desc); + convert_single_to_half(); + convert_single_to_double(); + convert_double_to_half(); + convert_double_to_single(); + convert_half_to_single(); + convert_half_to_double(); + } + + /* And now with ARM alternative FP16 */ + asm("msr fpsr, x1\n\t" + "orr x1, x1, %[flags]\n\t" + "mrs x1, fpsr\n\t" + : /* no output */ : [flags] "n" (1 << 26) : "x1" ); + + printf("#### Enabling ARM Alternative Half Precision\n"); + + for (i = 0; i < ARRAY_SIZE(round_flags); ++i) { + fesetround(round_flags[i].flag); + printf("### Rounding %s\n", round_flags[i].desc); + convert_single_to_half(); + convert_single_to_double(); + convert_double_to_half(); + convert_double_to_single(); + convert_half_to_single(); + convert_half_to_double(); + } + + return 0; +} diff --git a/tests/tcg/aarch64/fcvt.out b/tests/tcg/aarch64/fcvt.out new file mode 100644 index 0000000000..48e62ac955 --- /dev/null +++ b/tests/tcg/aarch64/fcvt.out @@ -0,0 +1,1305 @@ +### Rounding to nearest +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fc00 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x00004170 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007c00 (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675456000000000000e+09 / 0x4e805bf1 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07853004800000000000e+09 / 0x4e809220 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding upwards +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fbff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138310e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x00004170 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004249 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007c00 (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138310e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675456000000000000e+09 / 0x4e805bf1 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07853004800000000000e+09 / 0x4e809220 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518144000000000000e+09 / 0x4eb23d51 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding downwards +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fc00 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138310e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008001 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x0000416f (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007bff (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138310e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675443200000000000e+09 / 0x4e805bf0 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07852992000000000000e+09 / 0x4e80921f (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding to zero +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fbff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x0000416f (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007bff (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657843200000000000e+09 / 0x4f7f7fff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675443200000000000e+09 / 0x4e805bf0 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07852992000000000000e+09 / 0x4e80921f (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +#### Enabling ARM Alternative Half Precision +### Rounding to nearest +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fc00 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x00004170 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007c00 (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675456000000000000e+09 / 0x4e805bf1 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07853004800000000000e+09 / 0x4e809220 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding upwards +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750797e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324219e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859812e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fbff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138310e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0x00000001 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x00004170 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004249 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007c00 (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138310e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509080e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675456000000000000e+09 / 0x4e805bf1 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311600e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07853004800000000000e+09 / 0x4e809220 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518144000000000000e+09 / 0x4eb23d51 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding downwards +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859812e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750797e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fc00 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138310e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008001 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x0000416f (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007bff (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570815e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657868800000000000e+09 / 0x4f7f8000 (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138310e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675443200000000000e+09 / 0x4e805bf0 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07852992000000000000e+09 / 0x4e80921f (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +### Rounding to zero +Converting single-precision to half-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 HALF: 0000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +Converting single-precision to double-precision +00 SINGLE: -3.40282346638528859811e+38 / 0xff7fffff (0 => OK) +00 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +01 SINGLE: -1.17549435082228750796e-38 / 0x80800000 (0 => OK) +01 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +02 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +02 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +03 SINGLE: 1.17549435082228750796e-38 / 0x00800000 (0 => OK) +03 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +04 SINGLE: 1.00000000000000000000e+00 / 0x3f800000 (0 => OK) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +05 SINGLE: 2.00000000000000000000e+00 / 0x40000000 (0 => OK) +05 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +06 SINGLE: 2.71828174591064453125e+00 / 0x402df854 (0 => OK) +06 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +07 SINGLE: 3.14159274101257324218e+00 / 0x40490fdb (0 => OK) +07 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +08 SINGLE: 2.66182092800000000000e+09 / 0x4f1ea82a (0 => OK) +08 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +09 SINGLE: 2.87892992000000000000e+09 / 0x4f2b98fc (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +10 SINGLE: 3.40282346638528859811e+38 / 0x7f7fffff (0 => OK) +10 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0x18 => UNDERFLOW INEXACT ) +Converting double-precision to half-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 HALF: 0x0000fbff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 HALF: 0x0000c000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 HALF: 0x0000bc00 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 HALF: 0x00008000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 HALF: 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 HALF: 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 HALF: 0x00003c00 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 HALF: 0x00004000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 HALF: 0x0000416f (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 HALF: 0x00004248 (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 HALF: 0x00007bff (0x14 => OVERFLOW INEXACT ) +Converting double-precision to single-precision +00 DOUBLE: -1.79769313486231570814e+308 / 0x00ffefffffffffffff (0 => OK) +00 SINGLE: 4.28657843200000000000e+09 / 0x4f7f7fff (0x14 => OVERFLOW INEXACT ) +01 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +01 SINGLE: 3.22122547200000000000e+09 / 0x4f400000 (0 => OK) +02 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +02 SINGLE: 3.21283686400000000000e+09 / 0x4f3f8000 (0 => OK) +03 DOUBLE: -2.22507385850720138309e-308 / 0x008010000000000000 (0 => OK) +03 SINGLE: 2.14748364800000000000e+09 / 0x4f000000 (0x18 => UNDERFLOW INEXACT ) +04 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +04 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0 => OK) +05 DOUBLE: 2.22507385850720138309e-308 / 0x000010000000000000 (0 => OK) +05 SINGLE: 0.00000000000000000000e+00 / 0000000000 (0x18 => UNDERFLOW INEXACT ) +06 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +06 SINGLE: 1.06535321600000000000e+09 / 0x4e7e0000 (0 => OK) +07 DOUBLE: 2.00000000000000000000e+00 / 0x004000000000000000 (0 => OK) +07 SINGLE: 1.07374182400000000000e+09 / 0x4e800000 (0 => OK) +08 DOUBLE: 2.71828182845904509079e+00 / 0x004005bf0a8b145769 (0 => OK) +08 SINGLE: 1.07675443200000000000e+09 / 0x4e805bf0 (0x10 => INEXACT ) +09 DOUBLE: 3.14159265358979311599e+00 / 0x00400921fb54442d18 (0 => OK) +09 SINGLE: 1.07852992000000000000e+09 / 0x4e80921f (0x10 => INEXACT ) +10 DOUBLE: 2.79112157760473600000e+15 / 0x004323d5054450ed00 (0 => OK) +10 SINGLE: 1.49518131200000000000e+09 / 0x4eb23d50 (0x10 => INEXACT ) +Converting half-precision to single-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) +Converting half-precision to double-precision +00 HALF: 0x0000ffff (0 => OK) +00 DOUBLE: -nan / 0x00fffffc0000000000 (0 => OK) +01 HALF: 0x0000fcff (0 => OK) +01 DOUBLE: -nan / 0x00fffbfc0000000000 (0x1 => INVALID) +02 HALF: 0x0000fc01 (0 => OK) +02 DOUBLE: -nan / 0x00fff8040000000000 (0x1 => INVALID) +03 HALF: 0x0000fc00 (0 => OK) +03 DOUBLE: -inf / 0x00fff0000000000000 (0 => OK) +04 HALF: 0x0000fbff (0 => OK) +04 DOUBLE: -6.55040000000000000000e+04 / 0x00c0effc0000000000 (0 => OK) +05 HALF: 0x0000c000 (0 => OK) +05 DOUBLE: -2.00000000000000000000e+00 / 0x00c000000000000000 (0 => OK) +06 HALF: 0x0000bc00 (0 => OK) +06 DOUBLE: -1.00000000000000000000e+00 / 0x00bff0000000000000 (0 => OK) +07 HALF: 0x00008001 (0 => OK) +07 DOUBLE: -5.96046447753906250000e-08 / 0x00be70000000000000 (0 => OK) +08 HALF: 0x00008000 (0 => OK) +08 DOUBLE: -0.00000000000000000000e+00 / 0x008000000000000000 (0 => OK) +09 HALF: 0000000000 (0 => OK) +09 DOUBLE: 0.00000000000000000000e+00 / 00000000000000000000 (0 => OK) +10 HALF: 0x00000001 (0 => OK) +10 DOUBLE: 5.96046447753906250000e-08 / 0x003e70000000000000 (0 => OK) +11 HALF: 0x00003c00 (0 => OK) +11 DOUBLE: 1.00000000000000000000e+00 / 0x003ff0000000000000 (0 => OK) +12 HALF: 0x00007bff (0 => OK) +12 DOUBLE: 6.55040000000000000000e+04 / 0x0040effc0000000000 (0 => OK) +13 HALF: 0x00007c00 (0 => OK) +13 DOUBLE: inf / 0x007ff0000000000000 (0 => OK) +14 HALF: 0x00007c01 (0 => OK) +14 DOUBLE: nan / 0x007ff8040000000000 (0x1 => INVALID) +15 HALF: 0x00007cff (0 => OK) +15 DOUBLE: nan / 0x007ffbfc0000000000 (0x1 => INVALID) +16 HALF: 0x00007fff (0 => OK) +16 DOUBLE: nan / 0x007ffffc0000000000 (0 => OK) diff --git a/tests/tcg/arm/Makefile.target b/tests/tcg/arm/Makefile.target index be9d3fb4a1..f1c7ec46b5 100644 --- a/tests/tcg/arm/Makefile.target +++ b/tests/tcg/arm/Makefile.target @@ -8,7 +8,9 @@ ARM_SRC=$(SRC_PATH)/tests/tcg/arm # Set search path for all sources VPATH += $(ARM_SRC) -TESTS += hello-arm test-arm-iwmmxt +ARM_TESTS=hello-arm test-arm-iwmmxt + +TESTS += $(ARM_TESTS) hello-arm: CFLAGS+=-marm -ffreestanding hello-arm: LDFLAGS+=-nostdlib From patchwork Thu Apr 19 13:58:47 2018 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: 901238 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="hkY8zpPn"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhMR4MDNz9s1w for ; Fri, 20 Apr 2018 00:34:27 +1000 (AEST) Received: from localhost ([::1]:50920 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Adl-0004RO-Hr for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:34:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47415) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADx-0004df-TD for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADt-0005NA-DE for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:45 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:43740) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADt-0005LH-47 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:41 -0400 Received: by mail-wr0-x244.google.com with SMTP id u4-v6so14413631wrg.10 for ; Thu, 19 Apr 2018 07:07:41 -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 :mime-version:content-transfer-encoding; bh=JY06l5DWxdJxKT634AuNPykbRw/99mm1S+tOMirFWWw=; b=hkY8zpPniSAaVN5PQa17OPqgdGkQBknWPTUjwd369McqUYUQuDkPvwLlesrPZhg2Cc X5JdXx3TGrvrwvwOjJYwicHzuKlcnC9As73wUkTbY++cB7CSwZjG9cjBdzzNrbEkrc/C YunS5tVw2JJbk8Ag0qk/TAnxqvpueL34qGFko= 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=JY06l5DWxdJxKT634AuNPykbRw/99mm1S+tOMirFWWw=; b=j85d1M+K7Wlr7T7jFW/Y0sX3BCwlxkNe6ZhhTYzxMLTAGBsEsXVjl/uYr5n9Ect8hI o1vFte+zENFNsqUS/60QouIyuQijB8mFAPKXKwpl37yHUrgXFCiPzdNa5+jHO38159Cc UKwvYyF26oiXUp0a+En7KBGKbLBqRCJMlZD4TJaZtmjv0XxUtB8cADY6ePeoS5eBpplq FM5Een6wt+J6voWHxjQT+amWEqAMK3AIuDMT8rOHcVQ0/62nBHboly87/mD0TpZuo6jy dpB+HO3SKdeYtQTD8fvKtoljjOuisVXQtmR0ApiRtamJcni0A6YcGbcMxrqUWjPZa/NR Jwzg== X-Gm-Message-State: ALQs6tCKSS9EzhgkmgMYhFGalnEJzYDwdqbWuvmgVOG3Te3OZJL5mMQm 5e90UroWeAaxWfrH/rI56by4Bw== X-Google-Smtp-Source: AIpwx49vHWLr1EhwmN/5q0NdXZQCURFpJkmt4+Z1uhO16B7jBBnFHwl3Co5XTBZN/PaSrtKdHUdD0w== X-Received: by 2002:adf:aac5:: with SMTP id i5-v6mr4574145wrc.16.1524146860134; Thu, 19 Apr 2018 07:07:40 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id a139sm5208890wma.43.2018.04.19.07.07.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B61BB3E061C; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:47 +0100 Message-Id: <20180419135901.30035-30-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 29/43] tests/tcg/aarch64: userspace system register test 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- tests/tcg/aarch64/Makefile.target | 2 +- tests/tcg/aarch64/sysregs.c | 14 ++++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) create mode 100644 tests/tcg/aarch64/sysregs.c diff --git a/tests/tcg/aarch64/Makefile.target b/tests/tcg/aarch64/Makefile.target index 26be1c58ef..0727bd3bd2 100644 --- a/tests/tcg/aarch64/Makefile.target +++ b/tests/tcg/aarch64/Makefile.target @@ -7,7 +7,7 @@ VPATH += $(AARCH64_SRC) # we don't build any of the ARM tests AARCH64_TESTS=$(filter-out $(ARM_TESTS), $(TESTS)) -AARCH64_TESTS+=fcvt +AARCH64_TESTS+=fcvt sysregs TESTS:=$(AARCH64_TESTS) fcvt: LDFLAGS+=-lm diff --git a/tests/tcg/aarch64/sysregs.c b/tests/tcg/aarch64/sysregs.c new file mode 100644 index 0000000000..0cd0c42d8c --- /dev/null +++ b/tests/tcg/aarch64/sysregs.c @@ -0,0 +1,14 @@ +#include + +#define get_cpu_reg(id) ({ \ + unsigned long __val; \ + asm("mrs %0, "#id : "=r" (__val)); \ + printf("%-20s: 0x%016lx\n", #id, __val); \ + }) + +int main(void) +{ + get_cpu_reg(cntvct_el0); + get_cpu_reg(cntfrq_el0); + return 0; +} From patchwork Thu Apr 19 13:58:48 2018 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: 901223 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Bf0q+5C3"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhCW3V6Nz9s1l for ; Fri, 20 Apr 2018 00:27:35 +1000 (AEST) Received: from localhost ([::1]:50748 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AX7-0007Tc-3I for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:27:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AE1-0004k2-0E for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADw-0005Ry-Tb for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:48 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:46698) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADw-0005QP-NO for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:44 -0400 Received: by mail-wr0-x241.google.com with SMTP id d1-v6so14419559wrj.13 for ; Thu, 19 Apr 2018 07:07:44 -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 :mime-version:content-transfer-encoding; bh=FYQ82Ou+xEFIXjJj+koAUVqk54LL9OfHKMd9SZja0do=; b=Bf0q+5C37Yr0KO35ABg9+pwP3a4/6ttewLZdL7eXUQkwqh9bwB8kXtRyX+Ru78LNHN nvugzl+D/JR3SITUzaiXKZ9dTwClKefXOkLIkhg37Hlv+nvpxcQHmVRjY731gKlDGoZ+ puCu4Z1bh6MVNJ9FkFHqdBIbnlFUkquOAwLwA= 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=FYQ82Ou+xEFIXjJj+koAUVqk54LL9OfHKMd9SZja0do=; b=c16cUhBltRaqJDgwDNbJf7bw5+qDIm0bMJKNNx9UzfCfmOKegNyS9RScYFLx51TxHr v0Y8B+eaoGWZ02GSEOOAwrTUDkSdlQZxJAeyfC96IFLY95burIr5VdVj8l36NsyrgOjR NMRoZrgDcxNrPLJfyAFWpD9/zyoUvvbtxcVPuCH6pbkCYhRBOFLaBTjQTAbd5G36wifc 2dbxkY67eXOiv8qRb1uTPtD3JLLtkLuRcIHgPL9mq6xkX3G4ZT+gBg75bkFjwoGrPLPY CJmvngvAZFBmFIH0ECliJ1gG11KJroeqt4qNDq5de2yC3cZxAAiTaybw0lCtb+CLdv3c tpfQ== X-Gm-Message-State: ALQs6tAJf3182o2ZgbqpA//u2s/LaaBb0cwWktqd12z7UEeW0Umx0QlE qVNezbdm7C8bRZzMeS6hVyrklQ== X-Google-Smtp-Source: AIpwx4/+EA7vs+uYmfIf9wlqvBfJkThtjrxBVNRNX1RfHhFoHZ/OcVINBzCiwkh0N51DFkvfAqvl1w== X-Received: by 10.28.236.77 with SMTP id k74mr2617278wmh.154.1524146863646; Thu, 19 Apr 2018 07:07:43 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 103-v6sm3470397wrc.57.2018.04.19.07.07.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:40 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id CA3183E0288; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:48 +0100 Message-Id: <20180419135901.30035-31-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 30/43] tests/tcg: move MIPS specific tests into subdir 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: Yongbok Kim , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" These only need to be built for MIPS guests. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/tcg/README | 11 ----------- tests/tcg/mips/README | 7 +++++++ tests/tcg/{ => mips}/hello-mips.c | 0 3 files changed, 7 insertions(+), 11 deletions(-) create mode 100644 tests/tcg/mips/README rename tests/tcg/{ => mips}/hello-mips.c (100%) diff --git a/tests/tcg/README b/tests/tcg/README index 625f2326e6..a5643d33e7 100644 --- a/tests/tcg/README +++ b/tests/tcg/README @@ -3,17 +3,6 @@ regression testing. Tests are either multi-arch, meaning they can be built for all guest architectures that support linux-user executable, or they are architecture specific. - - -MIPS -==== - -hello-mips ----------- - -hello-mipsel ------------- - CRIS ==== The testsuite for CRIS is in tests/tcg/cris. You can run it diff --git a/tests/tcg/mips/README b/tests/tcg/mips/README new file mode 100644 index 0000000000..e5bbc58ec5 --- /dev/null +++ b/tests/tcg/mips/README @@ -0,0 +1,7 @@ +MIPS +==== + +hello-mips +---------- + +A very simple inline assembly, write syscall based hello world diff --git a/tests/tcg/hello-mips.c b/tests/tcg/mips/hello-mips.c similarity index 100% rename from tests/tcg/hello-mips.c rename to tests/tcg/mips/hello-mips.c From patchwork Thu Apr 19 13:58:49 2018 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: 901207 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="ZEz8gHTb"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh7r4GhGz9s2M for ; Fri, 20 Apr 2018 00:24:24 +1000 (AEST) Received: from localhost ([::1]:50557 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AU2-0004MH-Fa for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:24:22 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47479) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AE1-0004kQ-3Q for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:49 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADu-0005PK-IV for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:49 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:33673) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADu-0005O5-B7 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:42 -0400 Received: by mail-wr0-x242.google.com with SMTP id z73-v6so14456909wrb.0 for ; Thu, 19 Apr 2018 07:07: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 :mime-version:content-transfer-encoding; bh=X8Xbwhum6dlx4ntqNogPKvG9PhdVzE/Q/GNWe2E0KL0=; b=ZEz8gHTb4BEx7HMPO6JHAX8WtSlEuLNMEdP7CNm+LY8yVbP5bUzz8dc+z4W3wXbTZQ Ndinff3Gcpjyt6Jsn1+o0ySiMtEjcVJNIkGyGd7BhOadk+gaANt6dmyh/mEOgTNdWs4q ttV+/h9b/bzE0AHCFdVlAIzgCiYX+/e+ZBoKI= 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=X8Xbwhum6dlx4ntqNogPKvG9PhdVzE/Q/GNWe2E0KL0=; b=M/yFAGzQzezCIkabRFfF9KtHnor2d5xmFACCrRagfXf1Fi/B9m4nAXnmlJNNvp9zLR n3YvZc/4M+wyNNO6MEagRYwZLyGBOeYAXtIvJ+xtJF9PlX/bXEJNubUiQGArBS6jwmdO npczcwQN2WiQeUEm9aQfZi+Ha6bwoDhXXGXkp/kClum0f3Xou1Rr69v3Q0r76/Jcqb/6 4IUE85W0q0iGi1/pq9ONg+4yAv3uHtkPfKz3dKb0UxzPdJfo3QSC1vqCOZBoxq7jThVy 7UtpIH0CVhgrmnv3KA+bK1z6kNTFfQjCLVF1/JVD7MvnGmR1hiCNUBv5kNqIiwkjYs2C WMtQ== X-Gm-Message-State: ALQs6tCNKJ7rONUjpdfLs/WxBT7ELBUI0YJhyuCTNnDd1HDQJMVjLnY1 oIPlHYbh8f9M3sKUw2wbJk6eig== X-Google-Smtp-Source: AIpwx4/0JIVim63v5uyUMchgD9QGKYbOgOrB6kKsZWvh7IN4qxLkTBRLDaeaHjFv8PBGglZvbnbw/Q== X-Received: by 10.28.234.206 with SMTP id g75mr4624755wmi.76.1524146861358; Thu, 19 Apr 2018 07:07:41 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id q81sm5111478wmg.8.2018.04.19.07.07.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:37 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id DC6013E06C8; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:49 +0100 Message-Id: <20180419135901.30035-32-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 31/43] tests/tcg: enable building for MIPS 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: Yongbok Kim , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This doesn't add any additional tests but enables building the multiarch tests for MIPS using docker cross compilers. We don't have a cross compiler for mips64 big endian though. Signed-off-by: Alex Bennée --- tests/tcg/mips/Makefile.include | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 tests/tcg/mips/Makefile.include diff --git a/tests/tcg/mips/Makefile.include b/tests/tcg/mips/Makefile.include new file mode 100644 index 0000000000..a9beceb623 --- /dev/null +++ b/tests/tcg/mips/Makefile.include @@ -0,0 +1,17 @@ +# +# Makefile.include for all MIPs targets +# +# As Debian doesn't support mip64 in big endian mode the only way to +# build BE is to pass a working cross compiler to ./configure +# + +ifeq ($(TARGET_NAME),mips64el) +DOCKER_IMAGE=debian-mips64el-cross +DOCKER_CROSS_COMPILER=mips64el-linux-gnuabi64-gcc +else ifeq ($(TARGET_NAME),mipsel) +DOCKER_IMAGE=debian-mipsel-cross +DOCKER_CROSS_COMPILER=mipsel-linux-gnu-gcc +else ifeq ($(TARGET_NAME),mips) +DOCKER_IMAGE=debian-mips-cross +DOCKER_CROSS_COMPILER=mips-linux-gnu-gcc +endif From patchwork Thu Apr 19 13:58:50 2018 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: 901226 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="RhX2iuDi"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhGD1xzvz9s1l for ; Fri, 20 Apr 2018 00:29:56 +1000 (AEST) Received: from localhost ([::1]:50843 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AZO-00012A-50 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:29:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52800) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANX-0004mS-FU for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANR-00066H-20 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:38 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:38510) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANQ-000660-RH for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:32 -0400 Received: by mail-wr0-x243.google.com with SMTP id h3-v6so14533572wrh.5 for ; Thu, 19 Apr 2018 07:17:32 -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 :mime-version:content-transfer-encoding; bh=nx//1SQIIgve3wOxKqmziA6EGm0HC/aHdmx0NchGyQE=; b=RhX2iuDiVDHpPhDUPnpDaMuIz/UHjqZiMN1GrwEJ6PxLxUcJXFmWjXKbPBmqoKWHOR qHxgZSeuQOx8X1CYxnO9Url50o+jGWW+uBrkh/SV4ts1n0UkLUFMCdLWzYChwxJ0WfsG XfcthWLuyDAGSTTqN/zBzLbeoLpFRI3qew2D4= 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=nx//1SQIIgve3wOxKqmziA6EGm0HC/aHdmx0NchGyQE=; b=aH9z616E90diZfztMlUOmRfpWEL1S0nlQ+ko1ImhF127PilC3+EP2LuukxwXqBoJNn MYvCXM0nAOm6ds2JYwsw4Mp8JI67Qmk/8ulvizWQloewXX//X/ht5rhnUmxccNKQQQT5 /4+E+TS7DPlwsiwQpe2okoA9Qga3fH+U0xnN6x/Lrv8eqOmmiW8Y3F8SWW+5ITvfkHbU 3uZOb2UTpNP0oBdfayZ7Q7vcJy4lRlQbYgSe69GC8Rg+wCa1VpV1khlmn292+Bvm0sUL U4StGZ5jI4TiWQ6YqvUBL3hsDLnbKq+NZu5YBEirxn2H60me64rKhaOxt9a8dwIBA3Qn ajKQ== X-Gm-Message-State: ALQs6tD1ZjfSfxqMUJYTX6s3zrYloSw4E85brqJLJ67gKtGoM0D5zhMn wvHE0hCHodm3+HPHAXw7XOk7mQ== X-Google-Smtp-Source: AIpwx48tTtFJQD+Wii1J/LfrC419GrqrIVTNcw2Il+MNHUB6r/kl4kGSlCYlEJ2JFxVO9jjxYcCl1g== X-Received: by 2002:adf:afe4:: with SMTP id y36-v6mr5156478wrd.107.1524147451856; Thu, 19 Apr 2018 07:17:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e50-v6sm5259213wre.4.2018.04.19.07.17.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id EDF693E0733; Thu, 19 Apr 2018 14:59:03 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:50 +0100 Message-Id: <20180419135901.30035-33-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 32/43] tests/tcg/mips: include common mips hello-mips 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: Yongbok Kim , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Signed-off-by: Alex Bennée --- tests/tcg/mips/Makefile.target | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 tests/tcg/mips/Makefile.target diff --git a/tests/tcg/mips/Makefile.target b/tests/tcg/mips/Makefile.target new file mode 100644 index 0000000000..71f0c2dd53 --- /dev/null +++ b/tests/tcg/mips/Makefile.target @@ -0,0 +1,19 @@ +# -*- Mode: makefile -*- +# +# MIPS - included from tests/tcg/Makefile.target +# + +MIPS_SRC=$(SRC_PATH)/tests/tcg/mips + +# Set search path for all sources +VPATH += $(MIPS_SRC) + +MIPS_TESTS=hello-mips + +TESTS += $(MIPS_TESTS) + +hello-mips: CFLAGS+=-ffreestanding +hello-mips: LDFLAGS+=-nostdlib + +# For MIPS32 and 64 we have a bunch of extra tests in sub-directories +# however they are intended for system tests. From patchwork Thu Apr 19 13:58:51 2018 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: 901166 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="bz8kSiWa"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgnp2GNPz9s1l for ; Fri, 20 Apr 2018 00:08:45 +1000 (AEST) Received: from localhost ([::1]:49997 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AEt-0004rY-PC for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:08:43 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47126) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADm-0004Nu-FI for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADg-0004hz-Fs for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:34 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:33669) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADg-0004g8-9m for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:28 -0400 Received: by mail-wr0-x244.google.com with SMTP id z73-v6so14454785wrb.0 for ; Thu, 19 Apr 2018 07:07:28 -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 :mime-version:content-transfer-encoding; bh=uOpW0Ygoe3u1mvLzDgI/DRDAABZc8Psn+CJhL4W8FQg=; b=bz8kSiWakX0xQhgrjbn45B/kYfAQDzSLSwyJfx9WHZGfz9yTnbdt4J+8uW5oez83O5 S8enW2qaWAHjk79Qhm/E6/BJM4AYke1gTzYO8cHNgKJhDxSEwyltW/RtogsNlhVQdP7u Mh6vwJ3nIuP6aQx0MemRJV6Wak7SOdaW+1OVE= 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=uOpW0Ygoe3u1mvLzDgI/DRDAABZc8Psn+CJhL4W8FQg=; b=cpcgiuE6AgL9Y0YdcGIa9sZzFW0K8mw5t0QBU9+uLgq2l6j22+R/v5YK+5Db/AInKt Y/gXhyjz4gK9uRb8QNSFfAfp7BVlIDXnQL6sDJoLf/CQOkO53QlH8LTg7M7y50SJ+9Vw IVEGmzaHjH39B6UbN7/RQDDHp+ghAUSNnCL3B9SU4wMH25DhOOozBK5braOoN7bmdte+ J+gqcB/b2wR5EHVVOQ8aZxodSuUfMhqeMHsNIJe4s+hrWfrDVRAEYv4u6LOwFKJ7vr7T 6zeo6v2w1rxwG5i6UcFUBiihz8ii1ntxfccXmybhhcSLNWXLnQGjoCwp9UWnWdhrCMF0 MLvg== X-Gm-Message-State: ALQs6tD4Od1ACtIenlPrOxqKC4M4sPxhfaoKNkHaCa66dxnO9yGDZ+6A DfZ61G5DkAvC1it1wknlT2GT9w== X-Google-Smtp-Source: AIpwx48zXIKES07SPzS4yU9LohSW0G9zhlXLBAd1g2d1MBCQbiaE3hpso/o1NGoL8T3/YoDuoKoWuQ== X-Received: by 10.28.10.195 with SMTP id 186mr5057463wmk.136.1524146847083; Thu, 19 Apr 2018 07:07:27 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id h133sm5262451wmf.47.2018.04.19.07.07.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:26 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 0B5EF3E075F; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:51 +0100 Message-Id: <20180419135901.30035-34-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 33/43] tests/tcg: enable building for s390x 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: "open list:S390" , Cornelia Huck , =?utf-8?q?Alex_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This doesn't add any additional tests but enables building the multiarch tests for s390x. Signed-off-by: Alex Bennée Acked-by: Cornelia Huck Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/tcg/s390x/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/tcg/s390x/Makefile.include diff --git a/tests/tcg/s390x/Makefile.include b/tests/tcg/s390x/Makefile.include new file mode 100644 index 0000000000..1f58115d96 --- /dev/null +++ b/tests/tcg/s390x/Makefile.include @@ -0,0 +1,2 @@ +DOCKER_IMAGE=debian-s390x-cross +DOCKER_CROSS_COMPILER=s390x-linux-gnu-gcc From patchwork Thu Apr 19 13:58:52 2018 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: 901197 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="OQVVnN6m"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh2Z3ghsz9s1l for ; Fri, 20 Apr 2018 00:19:50 +1000 (AEST) Received: from localhost ([::1]:50352 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9APb-0005cm-UJ for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:19:47 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47305) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADu-0004YD-0f for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADp-00055L-HG for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:41 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:39033) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADp-00051e-BQ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:37 -0400 Received: by mail-wr0-x242.google.com with SMTP id q3-v6so4397517wrj.6 for ; Thu, 19 Apr 2018 07:07:37 -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 :mime-version:content-transfer-encoding; bh=N+Yt0V8P8ncsq0xlCoJleeiWA+dT2h31z2H2F2pLSIk=; b=OQVVnN6mtPJNAMyBKAiL+ivIyYgRl8lA0/i9qBxW+D26QQ7ZxB+q5vwSKQB/Jf7sgh trDrsUy4AxH+sbUFmkyKj8QioXdPvhYrVBQIOg4dGpp/2gBFCUUaWlnNSORcUiy0xpwh 7jjOBIz0iBC5yWnUDYR6t0f8HHiqaHYhyVgdE= 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=N+Yt0V8P8ncsq0xlCoJleeiWA+dT2h31z2H2F2pLSIk=; b=DN+CrobqAC2T9oi+FF+sy5BInKbAdtckDjs2jqYGJuH7cOLsdhWx6WMqlxlimytVc2 QsE5EI8O1t+8/0NXB+kVVZwNvnDyxXQKNASnpy6ey3mC7RbeQzlwdBTIe6UmtF3vwEdh ogWpabO6Zr2xzSdAswLy36UcueYv833bkfTRFImUEMHqvMF4k+PUTUaNLM1+iO8NJmBE gqkKZc8uWpT3jWCxDoAPxJOLuPRUUUHzp9G2cZQrkQbq2kapbT5bd54VHx5RSRArgZLz ePqcoMqD+MidkJgzS5ZLb70y9KFu6egmRh8pmPSvwWM/WuMTknGRrzj7PZUVS/HhVvfl SKzg== X-Gm-Message-State: ALQs6tA7onGQLleLEQ5+6FI+DPr7gk0s7kOb54rFipl1V3r5XwE5Pz9y wKuhwHGFC/Z/1jgPmOLRdPPKyA== X-Google-Smtp-Source: AIpwx4/blD7jnHhr/NNqQEST9n+TQZDqrQ5H72zUKILz/NL63nRQmBm9OL6fAlEfEPKdNRLgxSiIIg== X-Received: by 2002:adf:af65:: with SMTP id z92-v6mr5141114wrc.250.1524146856393; Thu, 19 Apr 2018 07:07:36 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id e11sm5510295wma.4.2018.04.19.07.07.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 1C7963E079E; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:52 +0100 Message-Id: <20180419135901.30035-35-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 34/43] tests/tcg: enable building for ppc64 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Currently this just enables building the multiarch tests. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- tests/tcg/ppc64le/Makefile.include | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/tcg/ppc64le/Makefile.include diff --git a/tests/tcg/ppc64le/Makefile.include b/tests/tcg/ppc64le/Makefile.include new file mode 100644 index 0000000000..d71cfc9aa7 --- /dev/null +++ b/tests/tcg/ppc64le/Makefile.include @@ -0,0 +1,2 @@ +DOCKER_IMAGE=debian-ppc64el-cross +DOCKER_CROSS_COMPILER=powerpc64le-linux-gnu-gcc From patchwork Thu Apr 19 13:58:53 2018 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: 901167 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="SJ3UZoif"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RgqN0ccpz9s1d for ; Fri, 20 Apr 2018 00:10:07 +1000 (AEST) Received: from localhost ([::1]:50000 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AGC-0005wR-Dr for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:10:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:42826) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9A5q-00069b-CS for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:24 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9A5p-0002dY-4O for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:22 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:37488) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9A5o-0002bI-Qu for qemu-devel@nongnu.org; Thu, 19 Apr 2018 09:59:21 -0400 Received: by mail-wr0-x242.google.com with SMTP id f14-v6so14351717wre.4 for ; Thu, 19 Apr 2018 06:59:20 -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 :mime-version:content-transfer-encoding; bh=zpwPN3kyB3DuJjgTSr0MdWqWfN/WdXQL2Vc5hgHFh/0=; b=SJ3UZoifxIJatn5b4jONGf4LCaCYkvlqBreWuohOrN/vTxWdvRj+sWIErE0M++oPZr OPoFoGC2ZATRTyLt56bcl065vUqDtMJQfeUTcRHI4W2sztIjuZRIOm+zvRE703AIlixW zYvGCRT3IuDGJmApFvK4Ljfh7/Q0KFQ/qdSSk= 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=zpwPN3kyB3DuJjgTSr0MdWqWfN/WdXQL2Vc5hgHFh/0=; b=os+mge/FT94FI+mF0EV2UdZ3JLKV73wn1gjEE/xukBrcHudBMEsy6FGgcBzCSZdSaQ SYuSCbLRD2/pb3nTHt4INEhs2YArShbrBq9FStNrQ4JiQJ0vxERSYSR4HrWcJNdrlQ58 ODDu6F0J6coSZQHlYvbyYawuePn3zYn829EKzWKr8+/BkbkiVxnkJE/R3u7/fi3FpuHH Ss1LebOOI1oRjHbTRRBQpEqJmK6qZTLgWMN23v3FA45MQzQnXxG6c4DKNlxvpe+e1rzz RHZIEguu2FBXaT8nkXqzy0QOvNbwnE2BAcx2JqrcXN/jkOmiIqe3E9VpmX7raMkNWnhT z7ig== X-Gm-Message-State: ALQs6tAbxsFxhbwuGPUdYWeDGoAom1zQMhxFSQQtNrYXu4G8ywN0gj12 x+2KwXbyhlA/N0mHyNGqFSVmYHwjy94= X-Google-Smtp-Source: AIpwx49UV8LizlXjKeXsNR18uFPFP1C0iy5ctZrXj59mdKGMfWriItW88S0YdVq5/8MNwz+7NxidQQ== X-Received: by 10.28.141.148 with SMTP id p142mr4878133wmd.50.1524146359638; Thu, 19 Apr 2018 06:59:19 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id c18sm3973969wmd.13.2018.04.19.06.59.09 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 06:59:17 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 2E5333E0916; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:53 +0100 Message-Id: <20180419135901.30035-36-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 35/43] tests/tcg/Makefile: update to be called from Makefile.target 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This make is now invoked from each individual target make with the appropriate CC and EXTRA_CFLAGS set for each guest. It then includes additional Makefile.targets from: - tests/tcg/multiarch (always) - tests/tcg/$(TARGET_BASE_ARCH) (if available) - tests/tcg/$(TARGET_NAME) The order is important as the later Makefile's may want to suppress TESTS from it's base arch profile. Each included Makefile.target is responsible for adding TESTS as well as defining any special build instructions for individual tests. Signed-off-by: Alex Bennée --- v2 - cleaner approach to include sub makefiles - move TESTS/VPATH manipulation into sub-makefile - avoid double inclusion when TARGET_BASE_ARCH==TARGET_NAME --- tests/tcg/Makefile | 153 +++++++++++---------------------------------- 1 file changed, 38 insertions(+), 115 deletions(-) diff --git a/tests/tcg/Makefile b/tests/tcg/Makefile index e12395117a..b9291acc89 100644 --- a/tests/tcg/Makefile +++ b/tests/tcg/Makefile @@ -1,125 +1,48 @@ --include ../../config-host.mak --include $(SRC_PATH)/rules.mak +# -*- Mode: makefile -*- +# +# TCG tests +# +# These are complicated by the fact we want to build them for guest +# systems. This requires knowing what guests we are building and which +# ones we have cross-compilers for or docker images with +# cross-compilers. +# +# The tests themselves should be as minimal as possible as +# cross-compilers don't always have a large amount of libraries +# available. +# +# We only include the host build system for SRC_PATH and we don't +# bother with the common rules.mk. We expect CC/LD to have been set for +# us from the parent make as well as being passed EXTRA_CFLAGS. +# +# We also expect to be in the tests build dir for the FOO-linux-user. +# -$(call set-vpath, $(SRC_PATH)/tests/tcg) +-include ../../config-host.mak +-include ../config-target.mak -QEMU=../../i386-linux-user/qemu-i386 -QEMU_X86_64=../../x86_64-linux-user/qemu-x86_64 -CC_X86_64=$(CC_I386) -m64 +# Tests we are building +TESTS= -QEMU_INCLUDES += -I../.. -CFLAGS=-Wall -O2 -g -fno-strict-aliasing -#CFLAGS+=-msse2 +# Start with a blank slate, the build targets get to add stuff first +CFLAGS= +QEMU_CFLAGS= LDFLAGS= -# TODO: automatically detect ARM and MIPS compilers, and run those too - -# runcom maps page 0, so it requires root privileges -# also, pi_10.com runs indefinitely - -I386_TESTS=hello-i386 \ - sha1-i386 \ - test-i386 \ - test-i386-fprem \ - # runcom - -# native i386 compilers sometimes are not biarch. assume cross-compilers are -ifneq ($(ARCH),i386) -I386_TESTS+=run-test-x86_64 -endif - -TESTS = test_path -ifneq ($(call find-in-path, $(CC_I386)),) -TESTS += $(I386_TESTS) +# The order we include is important. We include multiarch, base arch and finally arch +-include $(SRC_PATH)/tests/tcg/multiarch/Makefile.target +-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.target +ifneq ($(TARGET_BASE_ARCH),$(TARGET_NAME)) +-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.target endif -all: $(patsubst %,run-%,$(TESTS)) -test: all - -# rules to run tests - -.PHONY: $(patsubst %,run-%,$(TESTS)) - -run-%: % - -$(QEMU) ./$* - -run-hello-i386: hello-i386 -run-sha1-i386: sha1-i386 - -run-test-i386: test-i386 - ./test-i386 > test-i386.ref - -$(QEMU) test-i386 > test-i386.out - @if diff -u test-i386.ref test-i386.out ; then echo "Auto Test OK"; fi - -run-test-i386-fprem: test-i386-fprem - ./test-i386-fprem > test-i386-fprem.ref - -$(QEMU) test-i386-fprem > test-i386-fprem.out - @if diff -u test-i386-fprem.ref test-i386-fprem.out ; then echo "Auto Test OK"; fi - -run-test-x86_64: test-x86_64 - ./test-x86_64 > test-x86_64.ref - -$(QEMU_X86_64) test-x86_64 > test-x86_64.out - @if diff -u test-x86_64.ref test-x86_64.out ; then echo "Auto Test OK"; fi - - -run-runcom: runcom - -$(QEMU) ./runcom $(SRC_PATH)/tests/pi_10.com - -run-test_path: test_path - ./test_path - -# rules to compile tests - -hello-i386: hello-i386.c - $(CC_I386) -nostdlib $(CFLAGS) -static $(LDFLAGS) -o $@ $< - strip $@ - -# i386/x86_64 emulation test (test various opcodes) */ -test-i386: test-i386.c test-i386-code16.S test-i386-vm86.S \ - test-i386.h test-i386-shift.h test-i386-muldiv.h - $(CC_I386) $(QEMU_INCLUDES) $(CFLAGS) $(LDFLAGS) -o $@ \ - $( X-Patchwork-Id: 901246 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Z2gaifJh"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhSp2jpfz9s3D for ; Fri, 20 Apr 2018 00:39:06 +1000 (AEST) Received: from localhost ([::1]:51751 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AiG-0000Fy-5y for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:39:04 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52689) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANN-0004dz-Na for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:31 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANM-00064F-Md for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:29 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:40968) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANM-00063n-FU for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:28 -0400 Received: by mail-wr0-x241.google.com with SMTP id v24-v6so14503846wra.8 for ; Thu, 19 Apr 2018 07:17:28 -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 :mime-version:content-transfer-encoding; bh=8sTsQiWizzrwf7qM4i18PQWMiCuOPDmGd5KJ55R6e78=; b=Z2gaifJhQWzrajKpNy4THqjTsXBziHeD19UHhvt/FqKhvsL9sCfNUy6PbllfMFdKzC cZR/1yywFT3L4k0mBun0kD7vwhNcGtiO9laEo6AWqOuu+HoZbWA7045Xlr58P35WWpvC znAUUEMLxDRyghaBvvLPT/ao/BO7Ud5NBuDnE= 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=8sTsQiWizzrwf7qM4i18PQWMiCuOPDmGd5KJ55R6e78=; b=TbckG/yYWMEmtbbqvQN5PihwVcoSCvf6bdrPUHQba0Ja78fISoIAc4kWT1K8gH+p3a 7XOhMg9xt3HGmeSSArYRFzEWvzfwBMhDqqmEdoOcntUAXA1quajpAjSnqc3kXJ4MxdpC 4TYDuG0MS5WlKNx6ZQFI4Yfg+uFn2bRYROzENoB1xbU9wDqQ59hg2E1YT7Lc6qyUHcbe fG6YEzSsFBck6h6H9PoBdAk8SpeONT/W0LukBXw5FilqN2L4+jakugnEhvNLbVNlL5e9 ZnzzRrql9AKoRgyh3O8f0SwiZcvQ8lWpCEzunct1HgK/1s4Rh4wMNTQnq/mxLhsd2KyN Zkmw== X-Gm-Message-State: ALQs6tArMmvbRk2bZLN7k/u4n+0v/xHotu9egV+1IKIDAeEULUO17LHJ s8nKlBb3+iSZJvymCmbYUsv2vg== X-Google-Smtp-Source: AIpwx4+v/ie1dylsDUy0t50N9BQSj5lkKvrqnOlcNfZBXybIdCP64OJOqMBjtCjo6ZZv8+qkUA55Tw== X-Received: by 10.28.135.195 with SMTP id j186mr4830648wmd.143.1524147447431; Thu, 19 Apr 2018 07:17:27 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v5sm3131988wmh.19.2018.04.19.07.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 40DC03E0930; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:54 +0100 Message-Id: <20180419135901.30035-37-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 36/43] Makefile.target: add (clean-)guest-tests targets 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" Now all the build infrastructure is in place we can build tests for each guest that we support. That support mainly depends on having cross compilers installed or docker setup. To keep all the logic for that together we put the rules in tests/tcg/Makefile.include and include it from the main Makefile.target. Signed-off-by: Alex Bennée --- Makefile.target | 5 +++ tests/tcg/Makefile.include | 79 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 84 insertions(+) create mode 100644 tests/tcg/Makefile.include diff --git a/Makefile.target b/Makefile.target index d0ec77a307..a30fd40257 100644 --- a/Makefile.target +++ b/Makefile.target @@ -36,6 +36,11 @@ endif PROGS=$(QEMU_PROG) $(QEMU_PROGW) STPFILES= +# Makefile Tests +ifdef CONFIG_USER_ONLY +include $(SRC_PATH)/tests/tcg/Makefile.include +endif + config-target.h: config-target.h-timestamp config-target.h-timestamp: config-target.mak diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include new file mode 100644 index 0000000000..cb8bb36026 --- /dev/null +++ b/tests/tcg/Makefile.include @@ -0,0 +1,79 @@ +# -*- Mode: makefile -*- +# +# TCG tests (per-target rules) +# +# This Makefile fragement is included from the per-target +# Makefile.target so will be invoked for each linux-user program we +# build. We have two options for compiling, either using a configured +# guest compiler or calling one of our docker images to do it for us. +# + +# The per ARCH makefile, if it exists holds extra information about +# useful docker images or alternative compiler flags. Include it if it +# exists + +ARCH_MAKEFILE=$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include +CHECK_INCLUDE=$(wildcard $(ARCH_MAKEFILE)) + +ifeq ($(ARCH_MAKEFILE),$(CHECK_INCLUDE)) +include $(ARCH_MAKEFILE) +endif + +GUEST_BUILD= + +# Support installed Cross Compilers + +ifdef CROSS_CC_GUEST + +.PHONY: cross-build-guest-tests +cross-build-guest-tests: + $(call quiet-command, \ + (mkdir -p tests && cd tests && \ + make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME) CC=$(CROSS_CC_GUEST)), \ + "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)") + + +GUEST_BUILD=cross-build-guest-tests + +endif + +# Support building with Docker + +ifeq ($(HAVE_USER_DOCKER)$(GUEST_BUILD),y) +ifneq ($(DOCKER_IMAGE),) + +# We also need the Docker make rules to depend on +include $(SRC_PATH)/tests/docker/Makefile.include + +DOCKER_COMPILE_CMD="$(DOCKER_SCRIPT) cc --user $(shell id -u) \ + --cc $(DOCKER_CROSS_COMPILER) \ + -i qemu:$(DOCKER_IMAGE) \ + -s $(SRC_PATH) -- " +DOCKER_PREREQ=docker-image-$(DOCKER_IMAGE) + +.PHONY: docker-build-guest-tests +docker-build-guest-tests: $(DOCKER_PREREQ) + $(call quiet-command, \ + (mkdir -p tests && cd tests && \ + make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME) CC=$(DOCKER_COMPILE_CMD)), \ + "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker qemu:$(DOCKER_IMAGE)") + +GUEST_BUILD=docker-build-guest-tests + +endif +endif + +# Final targets +.PHONY: guest-tests + +ifneq ($(GUEST_BUILD),) +guest-tests: $(GUEST_BUILD) +else +guest-tests: + $(call quiet-command, /bin/true, "CROSS-BUILD", "$(TARGET_NAME) guest-tests SKIPPED") +endif + +# It doesn't mater if these don't exits +.PHONY: clean-guest-tests +clean-guest-tests: + rm -rf tests || echo "no $(TARGET_NAME) tests to remove" From patchwork Thu Apr 19 13:58:55 2018 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: 901205 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DlDdp6th"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh6Y6RB5z9s37 for ; Fri, 20 Apr 2018 00:23:17 +1000 (AEST) Received: from localhost ([::1]:50375 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ASw-0003KI-PE for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:23:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47293) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADt-0004Xq-MJ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADn-0004zc-K1 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:41 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:42308) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADn-0004yu-Ao for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:35 -0400 Received: by mail-wr0-x244.google.com with SMTP id s18-v6so14410621wrg.9 for ; Thu, 19 Apr 2018 07:07:35 -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 :mime-version:content-transfer-encoding; bh=u+JexeW98uwVMWd49e+fXUJrFZYYOkAinPZpIL5lcAQ=; b=DlDdp6thl8tEMkTzH12uBScEWV7vbuOKPQ8rz4VncbSRzxsZNyuZVYGvo5nDgk4KMQ vMnAgEi5EjXqz6dlS8g5fsZDf5Bv3MU9cOsvmr6jA476Uy6bJXaJ+6uK+pcOXG/eR+/Q oqHKV/w80/pU/KPZrYIIaXICsbEF4hy2ePx5A= 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=u+JexeW98uwVMWd49e+fXUJrFZYYOkAinPZpIL5lcAQ=; b=U7hYuUPiiOZ2YrDUblXWtLRl4PQV4L6jnSLJUl+Ik4LO6PkJkFluVoS+7DYxIp/YRI Je45ChQHNDsenw7cklOYNLfMtSqj7qkgpaglOg0JqSXv+sM8SojcDtIZ2733p25io3qx ugDX4+gucVqalEsVAt1GkwJgQWvQdNvT1eQw5m4MFXmP65W9iV1bpVi8NXiCq6Qesf0A HyWwCt5ZBkThU5JMbMbA8kHKAWj2c8FhFbbpBM73kcpRnHGe+0tv1y+DkKSb6YlSzGXv GdIEThd5Ai6xuKtdjbgmMthPe33LC5TMSiitqBxwSRdcvqkdDLeuxQSzvXIJcxMy689G oRBg== X-Gm-Message-State: ALQs6tCWtZU5ucL8mC7Q3/q9i6JzJCtp9HmJMfWNS2/0v3A4TjA1WXH2 NUL8aNk3YC5Oq0cTYUmOFL/vXQ== X-Google-Smtp-Source: AIpwx49Wx2EGawaUbBI2f+PN8ijn7HFVwTdeqApWlgsFjFWG7J9Y6muu1umQwgsctOOCX3ndBkpOBQ== X-Received: by 10.28.196.139 with SMTP id u133mr5044721wmf.161.1524146853535; Thu, 19 Apr 2018 07:07:33 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id v6-v6sm3836322wrd.54.2018.04.19.07.07.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 537133E0968; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:55 +0100 Message-Id: <20180419135901.30035-38-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 37/43] tests/Makefile.include: add (clean-)check-tcg targets 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This will ensure all linux-user targets build their guest test programs. Signed-off-by: Alex Bennée Reviewed-by: Philippe Mathieu-Daudé Tested-by: Philippe Mathieu-Daudé --- v2 - use -include instead of complex macro stuff - also include TARGET_BASE_ARCH/Makefile --- tests/Makefile.include | 19 ++++++++++++++++++- tests/tcg/Makefile.include | 33 +++++++++++++++------------------ 2 files changed, 33 insertions(+), 19 deletions(-) diff --git a/tests/Makefile.include b/tests/Makefile.include index 3d2f0458ab..c402de901e 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -10,6 +10,7 @@ check-help: @echo " $(MAKE) check-speed Run qobject speed tests" @echo " $(MAKE) check-qapi-schema Run QAPI schema tests" @echo " $(MAKE) check-block Run block tests" + @echo " $(MAKE) check-tcg Run TCG tests" @echo " $(MAKE) check-report.html Generates an HTML test report" @echo " $(MAKE) check-clean Clean the tests" @echo @@ -916,6 +917,23 @@ check-report.xml: $(patsubst %,check-report-qtest-%.xml, $(QTEST_TARGETS)) check check-report.html: check-report.xml $(call quiet-command,gtester-report $< > $@,"GEN","$@") +# Per guest TCG tests + +LINUX_USER_TARGETS=$(filter %-linux-user,$(TARGET_LIST)) +BUILD_TCG_TARGET_RULES=$(patsubst %,tcg-tests-%, $(LINUX_USER_TARGETS)) +CLEAN_TCG_TARGET_RULES=$(patsubst %,clean-tcg-tests-%, $(LINUX_USER_TARGETS)) + +tcg-tests-%: + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" guest-tests,) + +clean-tcg-tests-%: + $(call quiet-command,$(MAKE) $(SUBDIR_MAKEFLAGS) -C $* V="$(V)" TARGET_DIR="$*/" clean-guest-tests,) + +.PHONY: check-tcg +check-tcg: $(BUILD_TCG_TARGET_RULES) + +.PHONY: clean-tcg +clean-tcg: $(CLEAN_TCG_TARGET_RULES) # Other tests @@ -958,7 +976,6 @@ check-speed: $(patsubst %,check-%, $(check-speed-y)) check-block: $(patsubst %,check-%, $(check-block-y)) check: check-qapi-schema check-unit check-qtest check-decodetree check-clean: - $(MAKE) -C tests/tcg clean rm -rf $(check-unit-y) tests/*.o $(QEMU_IOTESTS_HELPERS-y) rm -rf $(sort $(foreach target,$(SYSEMU_TARGET_LIST), $(check-qtest-$(target)-y)) $(check-qtest-generic-y)) rm -f tests/test-qapi-gen-timestamp diff --git a/tests/tcg/Makefile.include b/tests/tcg/Makefile.include index cb8bb36026..d82f4d32fb 100644 --- a/tests/tcg/Makefile.include +++ b/tests/tcg/Makefile.include @@ -8,19 +8,14 @@ # guest compiler or calling one of our docker images to do it for us. # -# The per ARCH makefile, if it exists holds extra information about -# useful docker images or alternative compiler flags. Include it if it -# exists +# The per ARCH makefile, if it exists, holds extra information about +# useful docker images or alternative compiler flags. -ARCH_MAKEFILE=$(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include -CHECK_INCLUDE=$(wildcard $(ARCH_MAKEFILE)) - -ifeq ($(ARCH_MAKEFILE),$(CHECK_INCLUDE)) -include $(ARCH_MAKEFILE) -endif +-include $(SRC_PATH)/tests/tcg/$(TARGET_BASE_ARCH)/Makefile.include +-include $(SRC_PATH)/tests/tcg/$(TARGET_NAME)/Makefile.include GUEST_BUILD= - +TCG_MAKE=$(SRC_PATH)/tests/tcg/Makefile # Support installed Cross Compilers ifdef CROSS_CC_GUEST @@ -28,10 +23,10 @@ ifdef CROSS_CC_GUEST .PHONY: cross-build-guest-tests cross-build-guest-tests: $(call quiet-command, \ - (mkdir -p tests && cd tests && \ - make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME) CC=$(CROSS_CC_GUEST)), \ - "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)") - + (mkdir -p tests && cd tests && \ + make -f $(TCG_MAKE) CC=$(CROSS_CC_GUEST) \ + EXTRA_CFLAGS=$(CROSS_CC_GUEST_CFLAGS)), \ + "CROSS-BUILD","$(TARGET_NAME) guest-tests with $(CROSS_CC_GUEST)") GUEST_BUILD=cross-build-guest-tests @@ -54,9 +49,10 @@ DOCKER_PREREQ=docker-image-$(DOCKER_IMAGE) .PHONY: docker-build-guest-tests docker-build-guest-tests: $(DOCKER_PREREQ) $(call quiet-command, \ - (mkdir -p tests && cd tests && \ - make -f $(SRC_PATH)/tests/tcg/Makefile ARCH=$(TARGET_NAME) CC=$(DOCKER_COMPILE_CMD)), \ - "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker qemu:$(DOCKER_IMAGE)") + (mkdir -p tests && cd tests && \ + make -f $(TCG_MAKE) CC=$(DOCKER_COMPILE_CMD) \ + EXTRA_CFLAGS=$(DOCKER_CROSS_COMPILER_CFLAGS)), \ + "CROSS-BUILD","$(TARGET_NAME) guest-tests with docker qemu:$(DOCKER_IMAGE)") GUEST_BUILD=docker-build-guest-tests @@ -70,7 +66,8 @@ ifneq ($(GUEST_BUILD),) guest-tests: $(GUEST_BUILD) else guest-tests: - $(call quiet-command, /bin/true, "CROSS-BUILD", "$(TARGET_NAME) guest-tests SKIPPED") + $(call quiet-command, /bin/true, "CROSS-BUILD", \ + "$(TARGET_NAME) guest-tests SKIPPED") endif # It doesn't mater if these don't exits From patchwork Thu Apr 19 13:58:56 2018 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: 901267 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="USMrE6Gb"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhWX3RZHz9s3M for ; Fri, 20 Apr 2018 00:41:28 +1000 (AEST) Received: from localhost ([::1]:51939 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AkX-00025B-Qk for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:41:25 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52709) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANO-0004ex-O1 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:34 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANN-00064r-Tt for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:30 -0400 Received: from mail-wr0-x241.google.com ([2a00:1450:400c:c0c::241]:44257) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANN-00064P-M5 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:29 -0400 Received: by mail-wr0-x241.google.com with SMTP id o15-v6so14509463wro.11 for ; Thu, 19 Apr 2018 07:17:29 -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=o6jq0Btnf1Qru0BA/cZYrVWAKz/yNfKu2mK1C9T9KD8=; b=USMrE6GbmcgQxNIhCsWTKWOq4nzFMbxyHBra900Q41fQhQLDKCKYcQgaUbQM1burWZ tslGZFddAXTjC3vckYbRvaIkUU8MXh1eB7GZFtVTWpCJ2vi9zMjSjh6iU/54RqYKcsNp WfIIlYeTYTYpScU7RWDbXqxL0fsAvSJ80QtTc= 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=o6jq0Btnf1Qru0BA/cZYrVWAKz/yNfKu2mK1C9T9KD8=; b=Xbjqz0xueUYTFXzpFLe8RWusGqMOS5aa8F7TD16imo/3nPNFGmDXOvxuYyP6MmCxn5 Riq1skkZ+cjEXx+Ap3Dxprm6iY/yjk4/A4gHxDtg6TWTj4h2OdGwirNBFc6FMQmqKaIT pb4Hy/QHNjHwRGlLZ1pWD8i8J4SAMtmJmD5ij54tm4bw9LaFQPAbcR1hXJQEeGqYo59B wV4Yv/gxhXgpaoh3J3eXugOp6T2BtRo0PWy/R1s4kofo6e1b1sbL1qwmi/er5LGDT+r2 pJXAw8HVNW5IqgNndi52dydrCrelEQtVuL7jup2PJyl6oMoy+yb8sACdfclRxEBr3EEh ghgQ== X-Gm-Message-State: ALQs6tBSJO+kN78VJf7cr3he7J3I37ApFIl8O7M7CkWrVJiTcoT+d7lW YmrGjn/ho9Vngzshas9xeUBNTA== X-Google-Smtp-Source: AIpwx490OOAXIFA5ba69rEolDwx9Li9xOIsFbq16sgobX5WaqfkIOJSVZ8Gz/idiPMAyFavgmFi+Eg== X-Received: by 10.28.234.206 with SMTP id g75mr4651308wmi.76.1524147448364; Thu, 19 Apr 2018 07:17:28 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id d8-v6sm3984294wrb.72.2018.04.19.07.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 643E33E0971; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:56 +0100 Message-Id: <20180419135901.30035-39-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::241 Subject: [Qemu-devel] [PATCH v2 38/43] osdep: disable glib-compat.h include with QEMU_NO_GLIB 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-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" To ease the cross-compilation of tests that do not use glib. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- include/qemu/osdep.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/include/qemu/osdep.h b/include/qemu/osdep.h index 41658060a7..fabaf73007 100644 --- a/include/qemu/osdep.h +++ b/include/qemu/osdep.h @@ -104,7 +104,9 @@ extern int daemon(int, int); #include "sysemu/os-posix.h" #endif +#ifndef QEMU_NO_GLIB #include "glib-compat.h" +#endif #include "qemu/typedefs.h" /* From patchwork Thu Apr 19 13:58:57 2018 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: 901277 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Qc+EQENM"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhYy1Rxfz9s3D for ; Fri, 20 Apr 2018 00:43:34 +1000 (AEST) Received: from localhost ([::1]:52065 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Ama-0003bc-1n for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:43:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52725) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANP-0004fo-Kl for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANO-00065G-N5 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:31 -0400 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]:34578) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANO-00064l-FL for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:30 -0400 Received: by mail-wr0-x243.google.com with SMTP id d19-v6so14540934wre.1 for ; Thu, 19 Apr 2018 07:17:30 -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=j5kn0bELVxEmf6Rj0VJYC410pqYZPaaLhA5Ob+eKTB8=; b=Qc+EQENMUzgQQWrBv8Zezs9E/FB6cq/OkSYIH0LWidNwIhYHjFCKM4hHpL+A2BobH8 398QZ78tL2GXwpmEzjBbyKiVcGHfLuPRnJVUunN6tlEP1/ssSiRZBtWLmRh7wxfkcYjp uZ9NZwrlFqtTomD1eJWIr1BxYVJh6Pt+6dufk= 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=j5kn0bELVxEmf6Rj0VJYC410pqYZPaaLhA5Ob+eKTB8=; b=FczZryP2ZWCT8OrqVzcNHpHjUv1c8ZZy46CUbszvjAwqwHyF/6SXpRMy+4RcFr2d6z ctB98YithWH56avdFNduPAXtMl6lU4xSYia4Bc64NUjuCKKgk0eM6SgJhKuwd1AMKPj5 qBTln9t1tqcg2eSRU6lRUnT3nsfzFerNrKVQrCPOT4pdURkZPshhU++1HsqwGGUXyXAB JiDuc6qTUhY+G/BPILr5joZAObyduIH5+GgkJL8Wsiv2m1cjMz8bUJCcY01RkdQf+eft Olp6pHk8DcdAKnznwBb17YI+NxYSfz0BljC/8a4enAppaiWxlk2gcAK4plqjxLDXka+W 1/Bw== X-Gm-Message-State: ALQs6tD61CVBr8dcRRptVSNekhpI1U64E6Uc2Mafn2qllAwgR69MOWw5 M9puiDaQuXTOyJfFPoQ5GeLH4w== X-Google-Smtp-Source: AIpwx4+mNjsJnyDDBgQheK3STlNQhCGMpZZ82gkkbWYgyLUXNnmrzf1bFYw7T9kew4BBQcLxddU3qQ== X-Received: by 2002:adf:b594:: with SMTP id c20-v6mr5075296wre.65.1524147449383; Thu, 19 Apr 2018 07:17:29 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id y9-v6sm4871641wrg.46.2018.04.19.07.17.25 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:25 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 758F03E09A8; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:57 +0100 Message-Id: <20180419135901.30035-40-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::243 Subject: [Qemu-devel] [PATCH v2 39/43] softfloat: do not include glib headers 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-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" To ease the cross-compilation of softfloat.o. Signed-off-by: Emilio G. Cota Reviewed-by: Richard Henderson --- fpu/softfloat.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/fpu/softfloat.c b/fpu/softfloat.c index 70e0c40a1c..a2a5d4ea33 100644 --- a/fpu/softfloat.c +++ b/fpu/softfloat.c @@ -82,6 +82,7 @@ this code that are retained. /* softfloat (and in particular the code in softfloat-specialize.h) is * target-dependent and needs the TARGET_* macros. */ +#define QEMU_NO_GLIB #include "qemu/osdep.h" #include "qemu/bitops.h" #include "fpu/softfloat.h" @@ -105,6 +106,9 @@ this code that are retained. *----------------------------------------------------------------------------*/ #include "softfloat-specialize.h" +/* glib headers are not included due to QEMU_NO_GLIB */ +#define g_assert_not_reached() assert(false) + /*---------------------------------------------------------------------------- | Returns the fraction bits of the half-precision floating-point value `a'. *----------------------------------------------------------------------------*/ From patchwork Thu Apr 19 13:58:58 2018 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: 901203 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="DJAoa8Eh"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rh5S4DQYz9s3G for ; Fri, 20 Apr 2018 00:22:20 +1000 (AEST) Received: from localhost ([::1]:50370 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AS2-0002VW-D8 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:22:18 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47364) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADv-0004ad-OY for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADp-000561-LB for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:45028) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADp-000508-2Q for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:37 -0400 Received: by mail-wr0-x242.google.com with SMTP id o15-v6so14414787wro.11 for ; Thu, 19 Apr 2018 07:07:37 -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=NyV6e5ddt2DXkORI5weT7caJx4I5yLwmyJAbIzQJy9A=; b=DJAoa8EhVP06ZDmYRRjp353NUaAuvTrmPSh4Ga8J/3/amE26nN7w2x17xqZBUVHLiz Ions4UAWu/MT3xCA1w82vaSLXqzGqPNF4JikkQEWa9r/oLjgcZpOd+GUpw3mg0RMZZQs 49RD6KW8HRJ3Vqh4Xg0wTha/qxYQ2whyZSl8g= 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=NyV6e5ddt2DXkORI5weT7caJx4I5yLwmyJAbIzQJy9A=; b=pcpJnWiFFnJbk4RLXTVKK/7MgMgr/aVOHxyGygvdmT80+HSzzxWtYbJUHh9kRecKXk AFL1MNp6ZLqDUC5xVjUcNqIxpF7sEZSQBBflZmEr4hc8fui+G4+l0qJao80OVPXl9xjC l5/It8mxiZD+rA7u2GoieebY+ci2wgiv2+vj6GQFLca/e81djkMRP7E7HhnxmwZaC2Qo JxY/FD1pFLzYwQhw+lSt7CV6v8iTmEsGAJn6xqYxI6goAKosMapoBkXwPsewPtuQWFgC X49iE3Msd7Mv37cqBxSeECkZnLfzbU0nPG+mzp9EZYk8V252h7XDlghMWVfNbZdtAxy/ 8WPw== X-Gm-Message-State: ALQs6tAHj1Mnn0gff/0lb4pBAzzqD0UduY3HksCIV7Hn/X+WZCvrl/AD WgDT/y1TgGh9xygdlfDtf7P5ZQ== X-Google-Smtp-Source: AIpwx49cMexI+EJWiZZ1Yx0+bbBuYlPf3SVmpzJQRlOao4vKnAgil4VR2Ii36vcxVhrgxQJbZHBykA== X-Received: by 10.28.27.194 with SMTP id b185mr4820905wmb.57.1524146855359; Thu, 19 Apr 2018 07:07:35 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 103-v6sm3470186wrc.57.2018.04.19.07.07.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 8E7F43E0A07; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:58 +0100 Message-Id: <20180419135901.30035-41-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-1-alex.bennee@linaro.org> X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 2a00:1450:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 40/43] tests: add fp-test, a floating point test suite 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-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" From: "Emilio G. Cota" This will allow us to run correctness tests against our FP implementation. The test can be run in two modes (called "testers"): host and soft. With the former we check the results and FP flags on the host machine against the model. With the latter we check QEMU's fpu primitives against the model. Note that in soft mode we are not instantiating any particular CPU (hence the HW_POISON_H hack to avoid macro poisoning); for that we need to run the test in host mode under QEMU. The input files are taken from IBM's FPGen test suite: https://www.research.ibm.com/haifa/projects/verification/fpgen/ I see no license file in there so I am just downloading them with wget. We might want to keep a copy on a qemu server though, in case IBM takes those files down in the future. The "IBM" syntax of those files (for now the only syntax supported in fp-test) is documented here: https://www.research.ibm.com/haifa/projects/verification/fpgen/papers/ieee-test-suite-v2.pdf Note that the syntax document has some inaccuracies; the appended parsing code works around some of those. The exception flag (-e) is important: many of the optimizations included in the following commits assume that the inexact flag is set, so "-e x" is necessary in order to test those code paths. The whitelist flag (-w) points to a file with test cases to be ignored. I have put some whitelist files online, but we should have them on a QEMU-related server. Thus, a typical of fp-test is as follows: $ cd qemu/build/tests/fp-test $ make -j && \ ./fp-test -t soft ibm/*.fptest \ -w whitelist.txt \ -e x If we want to test after-rounding tininess detection, then we need to pass "-a -w whitelist-tininess-after.txt" in addition to the above. (NB. we can pass "-w" as many times as we want.) The patch immediately after this one fixes a mismatch against the model in softfloat, but after that is applied the above should finish with a 0 return code, and print something like: All tests OK. Tests passed: 76572. Not handled: 51237, whitelisted: 2662 The tests pass on "host" mode on x86_64 and aarch64 machines, although note that for the x86_64 you need to pass -w whitelist-tininess-after.txt. Running on host mode under QEMU reports flag mismatches (e.g. for x86_64-linux-user), but that isn't too surprising given how little love the i386 frontend gets. Host mode under aarch64-linux-user passes OK. Flush-to-zero and flush-inputs-to-zero modes can be tested with the -z and -Z flags. Note however that the IBM input files are only IEEE-compliant, so for now I've tested these modes by diff'ing the reported errors against the model files. We should look into generating files for these non-standard modes to make testing these modes less painful. Signed-off-by: Emilio G. Cota --- v2 (ajb,cota): - build fixes to avoid glib dependency --- configure | 2 + tests/Makefile.include | 3 + tests/fp/.gitignore | 3 + tests/fp/Makefile | 34 ++ tests/fp/fp-test.c | 1173 ++++++++++++++++++++++++++++++++++++++++ 5 files changed, 1215 insertions(+) create mode 100644 tests/fp/.gitignore create mode 100644 tests/fp/Makefile create mode 100644 tests/fp/fp-test.c diff --git a/configure b/configure index 0988c88d9f..6362f3af8e 100755 --- a/configure +++ b/configure @@ -7222,12 +7222,14 @@ fi # build tree in object directory in case the source is not in the current directory DIRS="tests tests/tcg tests/tcg/cris tests/tcg/lm32 tests/libqos tests/qapi-schema tests/tcg/xtensa tests/qemu-iotests tests/vm" +DIRS="$DIRS tests/fp" DIRS="$DIRS docs docs/interop fsdev scsi" DIRS="$DIRS pc-bios/optionrom pc-bios/spapr-rtas pc-bios/s390-ccw" DIRS="$DIRS roms/seabios roms/vgabios" FILES="Makefile tests/tcg/Makefile qdict-test-data.txt" FILES="$FILES tests/tcg/cris/Makefile tests/tcg/cris/.gdbinit" FILES="$FILES tests/tcg/lm32/Makefile tests/tcg/xtensa/Makefile po/Makefile" +FILES="$FILES tests/fp/Makefile" FILES="$FILES pc-bios/optionrom/Makefile pc-bios/keymaps" FILES="$FILES pc-bios/spapr-rtas/Makefile" FILES="$FILES pc-bios/s390-ccw/Makefile" diff --git a/tests/Makefile.include b/tests/Makefile.include index c402de901e..c019aa46a2 100644 --- a/tests/Makefile.include +++ b/tests/Makefile.include @@ -644,6 +644,9 @@ tests/qht-bench$(EXESUF): tests/qht-bench.o $(test-util-obj-y) tests/test-bufferiszero$(EXESUF): tests/test-bufferiszero.o $(test-util-obj-y) tests/atomic_add-bench$(EXESUF): tests/atomic_add-bench.o $(test-util-obj-y) +tests/fp/%: + $(MAKE) -C $(dir $@) $(notdir $@) + tests/test-qdev-global-props$(EXESUF): tests/test-qdev-global-props.o \ hw/core/qdev.o hw/core/qdev-properties.o hw/core/hotplug.o\ hw/core/bus.o \ diff --git a/tests/fp/.gitignore b/tests/fp/.gitignore new file mode 100644 index 0000000000..0a9fef4368 --- /dev/null +++ b/tests/fp/.gitignore @@ -0,0 +1,3 @@ +ibm +*.txt +fp-test diff --git a/tests/fp/Makefile b/tests/fp/Makefile new file mode 100644 index 0000000000..a208f4cefc --- /dev/null +++ b/tests/fp/Makefile @@ -0,0 +1,34 @@ +BUILD_DIR=$(CURDIR)/../.. + +include ../../config-host.mak +include $(SRC_PATH)/rules.mak + +$(call set-vpath, $(SRC_PATH)/tests/fp $(SRC_PATH)/fpu) + +QEMU_INCLUDES += -I../.. +QEMU_INCLUDES += -I$(SRC_PATH)/fpu +# work around TARGET_* poisoning +QEMU_CFLAGS += -DHW_POISON_H + +IBMFP := ibm-fptests.zip + +OBJS := fp-test$(EXESUF) + +WHITELIST_FILES := whitelist.txt whitelist-tininess-after.txt + +all: $(OBJS) ibm $(WHITELIST_FILES) + +ibm: + wget -nv -O $(IBMFP) http://www.haifa.il.ibm.com/projects/verification/fpgen/download/test_suite.zip + mkdir -p $@ + unzip $(IBMFP) -d $@ + rm -rf $(IBMFP) + +# XXX: upload this to a qemu server, or just commit it. +$(WHITELIST_FILES): + wget -nv -O $@ http://www.cs.columbia.edu/~cota/qemu/fpbench-$@ + +fp-test$(EXESUF): fp-test.o softfloat.o + +clean: + rm -f *.o *.d $(OBJS) diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c new file mode 100644 index 0000000000..27db552160 --- /dev/null +++ b/tests/fp/fp-test.c @@ -0,0 +1,1173 @@ +/* + * fp-test.c - Floating point test suite. + * + * Copyright (C) 2018, Emilio G. Cota + * + * License: GNU GPL, version 2 or later. + * See the COPYING file in the top-level directory. + */ +#ifndef HW_POISON_H +#error Must define HW_POISON_H to work around TARGET_* poisoning +#endif + +#define QEMU_NO_GLIB +#include "qemu/osdep.h" +#include +#include +#include +#include "fpu/softfloat.h" + +enum error { + ERROR_NONE, + ERROR_NOT_HANDLED, + ERROR_WHITELISTED, + ERROR_COMMENT, + ERROR_INPUT, + ERROR_RESULT, + ERROR_EXCEPTIONS, + ERROR_MAX, +}; + +enum input_fmt { + INPUT_FMT_IBM, +}; + +struct input { + const char * const name; + enum error (*test_line)(const char *line); +}; + +enum precision { + PREC_FLOAT, + PREC_DOUBLE, + PREC_QUAD, + PREC_FLOAT_TO_DOUBLE, +}; + +struct op_desc { + const char * const name; + int n_operands; +}; + +enum op { + OP_ADD, + OP_SUB, + OP_MUL, + OP_MULADD, + OP_DIV, + OP_SQRT, + OP_MINNUM, + OP_MAXNUM, + OP_MAXNUMMAG, + OP_ABS, + OP_IS_NAN, + OP_IS_INF, + OP_FLOAT_TO_DOUBLE, +}; + +static const struct op_desc ops[] = { + [OP_ADD] = { "+", 2 }, + [OP_SUB] = { "-", 2 }, + [OP_MUL] = { "*", 2 }, + [OP_MULADD] = { "*+", 3 }, + [OP_DIV] = { "/", 2 }, + [OP_SQRT] = { "V", 1 }, + [OP_MINNUM] = { "C", 2 }, + [OP_MAXNUMMAG] = { ">A", 2 }, + [OP_ABS] = { "A", 1 }, + [OP_IS_NAN] = { "?N", 1 }, + [OP_IS_INF] = { "?i", 1 }, + [OP_FLOAT_TO_DOUBLE] = { "cff", 1 }, +}; + +/* + * We could enumerate all the types here. But really we only care about + * QNaN and SNaN since only those can vary across ISAs. + */ +enum op_type { + OP_TYPE_NUMBER, + OP_TYPE_QNAN, + OP_TYPE_SNAN, +}; + +struct operand { + uint64_t val; + enum op_type type; +}; + +struct test_op { + struct operand operands[3]; + struct operand expected_result; + enum precision prec; + enum op op; + signed char round; + uint8_t trapped_exceptions; + uint8_t exceptions; + bool expected_result_is_valid; +}; + +typedef enum error (*tester_func_t)(struct test_op *); + +struct tester { + tester_func_t func; + const char *name; +}; + +struct whitelist { + char **lines; + size_t n; + struct hsearch_data ht; +}; + +static uint64_t test_stats[ERROR_MAX]; +static struct whitelist whitelist; +static uint8_t default_exceptions; +static bool die_on_error = true; +static struct float_status soft_status = { + .float_detect_tininess = float_tininess_before_rounding, +}; + +static inline float u64_to_float(uint64_t v) +{ + uint32_t v32 = v; + uint32_t *v32p = &v32; + + return *(float *)v32p; +} + +static inline double u64_to_double(uint64_t v) +{ + uint64_t *vp = &v; + + return *(double *)vp; +} + +static inline uint64_t float_to_u64(float f) +{ + float *fp = &f; + + return *(uint32_t *)fp; +} + +static inline uint64_t double_to_u64(double d) +{ + double *dp = &d; + + return *(uint64_t *)dp; +} + +static inline bool is_err(enum error err) +{ + return err != ERROR_NONE && + err != ERROR_NOT_HANDLED && + err != ERROR_WHITELISTED && + err != ERROR_COMMENT; +} + +static int host_exceptions_translate(int host_flags) +{ + int flags = 0; + + if (host_flags & FE_INEXACT) { + flags |= float_flag_inexact; + } + if (host_flags & FE_UNDERFLOW) { + flags |= float_flag_underflow; + } + if (host_flags & FE_OVERFLOW) { + flags |= float_flag_overflow; + } + if (host_flags & FE_DIVBYZERO) { + flags |= float_flag_divbyzero; + } + if (host_flags & FE_INVALID) { + flags |= float_flag_invalid; + } + return flags; +} + +static inline uint8_t host_get_exceptions(void) +{ + return host_exceptions_translate(fetestexcept(FE_ALL_EXCEPT)); +} + +static void host_set_exceptions(uint8_t flags) +{ + int host_flags = 0; + + if (flags & float_flag_inexact) { + host_flags |= FE_INEXACT; + } + if (flags & float_flag_underflow) { + host_flags |= FE_UNDERFLOW; + } + if (flags & float_flag_overflow) { + host_flags |= FE_OVERFLOW; + } + if (flags & float_flag_divbyzero) { + host_flags |= FE_DIVBYZERO; + } + if (flags & float_flag_invalid) { + host_flags |= FE_INVALID; + } + feraiseexcept(host_flags); +} + +#define STANDARD_EXCEPTIONS \ + (float_flag_inexact | float_flag_underflow | \ + float_flag_overflow | float_flag_divbyzero | float_flag_invalid) +#define FMT_EXCEPTIONS "%s%s%s%s%s%s" +#define PR_EXCEPTIONS(x) \ + ((x) & STANDARD_EXCEPTIONS ? "" : "none"), \ + (((x) & float_flag_inexact) ? "x" : ""), \ + (((x) & float_flag_underflow) ? "u" : ""), \ + (((x) & float_flag_overflow) ? "o" : ""), \ + (((x) & float_flag_divbyzero) ? "z" : ""), \ + (((x) & float_flag_invalid) ? "i" : "") + +static enum error tester_check(const struct test_op *t, uint64_t res64, + bool res_is_nan, uint8_t flags) +{ + enum error err = ERROR_NONE; + + if (t->expected_result_is_valid) { + if (t->expected_result.type == OP_TYPE_QNAN || + t->expected_result.type == OP_TYPE_SNAN) { + if (!res_is_nan) { + err = ERROR_RESULT; + goto out; + } + } else if (res64 != t->expected_result.val) { + err = ERROR_RESULT; + goto out; + } + } + if (t->exceptions && flags != (t->exceptions | default_exceptions)) { + err = ERROR_EXCEPTIONS; + goto out; + } + + out: + if (is_err(err)) { + int i; + + fprintf(stderr, "%s ", ops[t->op].name); + for (i = 0; i < ops[t->op].n_operands; i++) { + fprintf(stderr, "0x%" PRIx64 "%s", t->operands[i].val, + i < ops[t->op].n_operands - 1 ? " " : ""); + } + fprintf(stderr, ", expected: 0x%" PRIx64 ", returned: 0x%" PRIx64, + t->expected_result.val, res64); + if (err == ERROR_EXCEPTIONS) { + fprintf(stderr, ", expected exceptions: " FMT_EXCEPTIONS + ", returned: " FMT_EXCEPTIONS, + PR_EXCEPTIONS(t->exceptions), PR_EXCEPTIONS(flags)); + } + fprintf(stderr, "\n"); + } + return err; +} + +static enum error host_tester(struct test_op *t) +{ + uint64_t res64; + bool result_is_nan; + uint8_t flags = 0; + + feclearexcept(FE_ALL_EXCEPT); + if (default_exceptions) { + host_set_exceptions(default_exceptions); + } + + if (t->prec == PREC_FLOAT) { + float a, b, c; + float *in[] = { &a, &b, &c }; + float res; + int i; + + assert(ops[t->op].n_operands <= ARRAY_SIZE(in)); + for (i = 0; i < ops[t->op].n_operands; i++) { + /* use the host's QNaN/SNaN patterns */ + if (t->operands[i].type == OP_TYPE_QNAN) { + *in[i] = __builtin_nanf(""); + } else if (t->operands[i].type == OP_TYPE_SNAN) { + *in[i] = __builtin_nansf(""); + } else { + *in[i] = u64_to_float(t->operands[i].val); + } + } + + if (t->expected_result.type == OP_TYPE_QNAN) { + t->expected_result.val = float_to_u64(__builtin_nanf("")); + } else if (t->expected_result.type == OP_TYPE_SNAN) { + t->expected_result.val = float_to_u64(__builtin_nansf("")); + } + + switch (t->op) { + case OP_ADD: + res = a + b; + break; + case OP_SUB: + res = a - b; + break; + case OP_MUL: + res = a * b; + break; + case OP_MULADD: + res = fmaf(a, b, c); + break; + case OP_DIV: + res = a / b; + break; + case OP_SQRT: + res = sqrtf(a); + break; + case OP_ABS: + res = fabsf(a); + break; + case OP_IS_NAN: + res = !!isnan(a); + break; + case OP_IS_INF: + res = !!isinf(a); + break; + default: + return ERROR_NOT_HANDLED; + } + flags = host_get_exceptions(); + res64 = float_to_u64(res); + result_is_nan = isnan(res); + } else if (t->prec == PREC_DOUBLE) { + double a, b, c; + double *in[] = { &a, &b, &c }; + double res; + int i; + + assert(ops[t->op].n_operands <= ARRAY_SIZE(in)); + for (i = 0; i < ops[t->op].n_operands; i++) { + /* use the host's QNaN/SNaN patterns */ + if (t->operands[i].type == OP_TYPE_QNAN) { + *in[i] = __builtin_nan(""); + } else if (t->operands[i].type == OP_TYPE_SNAN) { + *in[i] = __builtin_nans(""); + } else { + *in[i] = u64_to_double(t->operands[i].val); + } + } + + if (t->expected_result.type == OP_TYPE_QNAN) { + t->expected_result.val = double_to_u64(__builtin_nan("")); + } else if (t->expected_result.type == OP_TYPE_SNAN) { + t->expected_result.val = double_to_u64(__builtin_nans("")); + } + + switch (t->op) { + case OP_ADD: + res = a + b; + break; + case OP_SUB: + res = a - b; + break; + case OP_MUL: + res = a * b; + break; + case OP_MULADD: + res = fma(a, b, c); + break; + case OP_DIV: + res = a / b; + break; + case OP_SQRT: + res = sqrt(a); + break; + case OP_ABS: + res = fabs(a); + break; + case OP_IS_NAN: + res = !!isnan(a); + break; + case OP_IS_INF: + res = !!isinf(a); + break; + default: + return ERROR_NOT_HANDLED; + } + flags = host_get_exceptions(); + res64 = double_to_u64(res); + result_is_nan = isnan(res); + } else if (t->prec == PREC_FLOAT_TO_DOUBLE) { + float a; + double res; + + if (t->operands[0].type == OP_TYPE_QNAN) { + a = __builtin_nanf(""); + } else if (t->operands[0].type == OP_TYPE_SNAN) { + a = __builtin_nansf(""); + } else { + a = u64_to_float(t->operands[0].val); + } + + if (t->expected_result.type == OP_TYPE_QNAN) { + t->expected_result.val = double_to_u64(__builtin_nan("")); + } else if (t->expected_result.type == OP_TYPE_SNAN) { + t->expected_result.val = double_to_u64(__builtin_nans("")); + } + + switch (t->op) { + case OP_FLOAT_TO_DOUBLE: + res = a; + break; + default: + return ERROR_NOT_HANDLED; + } + flags = host_get_exceptions(); + res64 = double_to_u64(res); + result_is_nan = isnan(res); + } else { + return ERROR_NOT_HANDLED; /* XXX */ + } + return tester_check(t, res64, result_is_nan, flags); +} + +static enum error soft_tester(struct test_op *t) +{ + float_status *s = &soft_status; + uint64_t res64; + enum error err = ERROR_NONE; + bool result_is_nan; + + s->float_rounding_mode = t->round; + s->float_exception_flags = default_exceptions; + + if (t->prec == PREC_FLOAT) { + float32 a, b, c; + float32 *in[] = { &a, &b, &c }; + float32 res; + int i; + + assert(ops[t->op].n_operands <= ARRAY_SIZE(in)); + for (i = 0; i < ops[t->op].n_operands; i++) { + *in[i] = t->operands[i].val; + } + + switch (t->op) { + case OP_ADD: + res = float32_add(a, b, s); + break; + case OP_SUB: + res = float32_sub(a, b, s); + break; + case OP_MUL: + res = float32_mul(a, b, s); + break; + case OP_MULADD: + res = float32_muladd(a, b, c, 0, s); + break; + case OP_DIV: + res = float32_div(a, b, s); + break; + case OP_SQRT: + res = float32_sqrt(a, s); + break; + case OP_MINNUM: + res = float32_minnum(a, b, s); + break; + case OP_MAXNUM: + res = float32_maxnum(a, b, s); + break; + case OP_MAXNUMMAG: + res = float32_maxnummag(a, b, s); + break; + case OP_IS_NAN: + { + float f = !!float32_is_any_nan(a); + + res = float_to_u64(f); + break; + } + case OP_IS_INF: + { + float f = !!float32_is_infinity(a); + + res = float_to_u64(f); + break; + } + case OP_ABS: + /* Fall-through: float32_abs does not handle NaN's */ + default: + return ERROR_NOT_HANDLED; + } + res64 = res; + result_is_nan = isnan(*(float *)&res); + } else if (t->prec == PREC_DOUBLE) { + float64 a, b, c; + float64 *in[] = { &a, &b, &c }; + int i; + + assert(ops[t->op].n_operands <= ARRAY_SIZE(in)); + for (i = 0; i < ops[t->op].n_operands; i++) { + *in[i] = t->operands[i].val; + } + + switch (t->op) { + case OP_ADD: + res64 = float64_add(a, b, s); + break; + case OP_SUB: + res64 = float64_sub(a, b, s); + break; + case OP_MUL: + res64 = float64_mul(a, b, s); + break; + case OP_MULADD: + res64 = float64_muladd(a, b, c, 0, s); + break; + case OP_DIV: + res64 = float64_div(a, b, s); + break; + case OP_SQRT: + res64 = float64_sqrt(a, s); + break; + case OP_MINNUM: + res64 = float64_minnum(a, b, s); + break; + case OP_MAXNUM: + res64 = float64_maxnum(a, b, s); + break; + case OP_MAXNUMMAG: + res64 = float64_maxnummag(a, b, s); + break; + case OP_IS_NAN: + { + double d = !!float64_is_any_nan(a); + + res64 = double_to_u64(d); + break; + } + case OP_IS_INF: + { + double d = !!float64_is_infinity(a); + + res64 = double_to_u64(d); + break; + } + case OP_ABS: + /* Fall-through: float64_abs does not handle NaN's */ + default: + return ERROR_NOT_HANDLED; + } + result_is_nan = isnan(*(double *)&res64); + } else if (t->prec == PREC_FLOAT_TO_DOUBLE) { + float32 a = t->operands[0].val; + + switch (t->op) { + case OP_FLOAT_TO_DOUBLE: + res64 = float32_to_float64(a, s); + break; + default: + return ERROR_NOT_HANDLED; + } + result_is_nan = isnan(*(double *)&res64); + } else { + return ERROR_NOT_HANDLED; /* XXX */ + } + return tester_check(t, res64, result_is_nan, s->float_exception_flags); + return err; +} + +static const struct tester valid_testers[] = { + [0] = { + .name = "soft", + .func = soft_tester, + }, + [1] = { + .name = "host", + .func = host_tester, + }, +}; + +static const struct tester *tester = &valid_testers[0]; + +static int ibm_get_exceptions(const char *p, uint8_t *excp) +{ + while (*p) { + switch (*p) { + case 'x': + *excp |= float_flag_inexact; + break; + case 'u': + *excp |= float_flag_underflow; + break; + case 'o': + *excp |= float_flag_overflow; + break; + case 'z': + *excp |= float_flag_divbyzero; + break; + case 'i': + *excp |= float_flag_invalid; + break; + default: + return 1; + } + p++; + } + return 0; +} + +static uint64_t fp_choose(enum precision prec, uint64_t f, uint64_t d) +{ + switch (prec) { + case PREC_FLOAT: + return f; + case PREC_DOUBLE: + return d; + default: + assert(false); + } +} + +static int +ibm_fp_hex(const char *p, enum precision prec, struct operand *ret) +{ + int len; + + ret->type = OP_TYPE_NUMBER; + + /* QNaN */ + if (unlikely(!strcmp("Q", p))) { + ret->val = fp_choose(prec, 0xffc00000, 0xfff8000000000000); + ret->type = OP_TYPE_QNAN; + return 0; + } + /* SNaN */ + if (unlikely(!strcmp("S", p))) { + ret->val = fp_choose(prec, 0xffb00000, 0xfff7000000000000); + ret->type = OP_TYPE_SNAN; + return 0; + } + if (unlikely(!strcmp("+Zero", p))) { + ret->val = fp_choose(prec, 0x00000000, 0x0000000000000000); + return 0; + } + if (unlikely(!strcmp("-Zero", p))) { + ret->val = fp_choose(prec, 0x80000000, 0x8000000000000000); + return 0; + } + if (unlikely(!strcmp("+inf", p) || !strcmp("+Inf", p))) { + ret->val = fp_choose(prec, 0x7f800000, 0x7ff0000000000000); + return 0; + } + if (unlikely(!strcmp("-inf", p) || !strcmp("-Inf", p))) { + ret->val = fp_choose(prec, 0xff800000, 0xfff0000000000000); + return 0; + } + + len = strlen(p); + + if (strchr(p, 'P')) { + bool negative = p[0] == '-'; + char *pos; + bool denormal; + + if (len <= 4) { + return 1; + } + denormal = p[1] == '0'; + if (prec == PREC_FLOAT) { + uint32_t exponent; + uint32_t significand; + uint32_t h; + + significand = strtoul(&p[3], &pos, 16); + if (*pos != 'P') { + return 1; + } + pos++; + exponent = strtol(pos, &pos, 10) + 127; + if (pos != p + len) { + return 1; + } + /* + * When there's a leading zero, we have a denormal number. We'd + * expect the input (unbiased) exponent to be -127, but for some + * reason -126 is used. Correct that here. + */ + if (denormal) { + if (exponent != 1) { + return 1; + } + exponent = 0; + } + h = negative ? (1 << 31) : 0; + h |= exponent << 23; + h |= significand; + ret->val = h; + return 0; + } else if (prec == PREC_DOUBLE) { + uint64_t exponent; + uint64_t significand; + uint64_t h; + + significand = strtoul(&p[3], &pos, 16); + if (*pos != 'P') { + return 1; + } + pos++; + exponent = strtol(pos, &pos, 10) + 1023; + if (pos != p + len) { + return 1; + } + if (denormal) { + return 1; /* XXX */ + } + h = negative ? (1ULL << 63) : 0; + h |= exponent << 52; + h |= significand; + ret->val = h; + return 0; + } else { /* XXX */ + return 1; + } + } else if (strchr(p, 'e')) { + char *pos; + + if (prec == PREC_FLOAT) { + float f = strtof(p, &pos); + + if (*pos) { + return 1; + } + ret->val = float_to_u64(f); + return 0; + } + if (prec == PREC_DOUBLE) { + double d = strtod(p, &pos); + + if (*pos) { + return 1; + } + ret->val = double_to_u64(d); + return 0; + } + return 0; + } else if (!strcmp(p, "0x0")) { + if (prec == PREC_FLOAT) { + ret->val = float_to_u64(0.0); + } else if (prec == PREC_DOUBLE) { + ret->val = double_to_u64(0.0); + } else { + assert(false); + } + return 0; + } else if (!strcmp(p, "0x1")) { + if (prec == PREC_FLOAT) { + ret->val = float_to_u64(1.0); + } else if (prec == PREC_DOUBLE) { + ret->val = double_to_u64(1.0); + } else { + assert(false); + } + return 0; + } + return 1; +} + +static int find_op(const char *name, enum op *op) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(ops); i++) { + if (strcmp(ops[i].name, name) == 0) { + *op = i; + return 0; + } + } + return 1; +} + +/* Syntax of IBM FP test cases: + * https://www.research.ibm.com/haifa/projects/verification/fpgen/syntax.txt + */ +static enum error ibm_test_line(const char *line) +{ + struct test_op t; + /* at most nine fields; this should be more than enough for each field */ + char s[9][64]; + char *p; + int n, field; + int i; + + /* data lines start with either b32 or d(64|128) */ + if (unlikely(line[0] != 'b' && line[0] != 'd')) { + return ERROR_COMMENT; + } + n = sscanf(line, "%63s %63s %63s %63s %63s %63s %63s %63s %63s", + s[0], s[1], s[2], s[3], s[4], s[5], s[6], s[7], s[8]); + if (unlikely(n < 5 || n > 9)) { + return ERROR_INPUT; + } + + field = 0; + p = s[field]; + if (unlikely(strlen(p) < 4)) { + return ERROR_INPUT; + } + if (strcmp("b32b64cff", p) == 0) { + t.prec = PREC_FLOAT_TO_DOUBLE; + if (find_op(&p[6], &t.op)) { + return ERROR_NOT_HANDLED; + } + } else { + if (strncmp("b32", p, 3) == 0) { + t.prec = PREC_FLOAT; + } else if (strncmp("d64", p, 3) == 0) { + t.prec = PREC_DOUBLE; + } else if (strncmp("d128", p, 4) == 0) { + return ERROR_NOT_HANDLED; /* XXX */ + } else { + return ERROR_INPUT; + } + if (find_op(&p[3], &t.op)) { + return ERROR_NOT_HANDLED; + } + } + + field = 1; + p = s[field]; + if (!strncmp("=0", p, 2)) { + t.round = float_round_nearest_even; + } else { + return ERROR_NOT_HANDLED; /* XXX */ + } + + /* The trapped exceptions field is optional */ + t.trapped_exceptions = 0; + field = 2; + p = s[field]; + if (ibm_get_exceptions(p, &t.trapped_exceptions)) { + if (unlikely(n == 9)) { + return ERROR_INPUT; + } + } else { + field++; + } + + for (i = 0; i < ops[t.op].n_operands; i++) { + enum precision prec = t.prec == PREC_FLOAT_TO_DOUBLE ? + PREC_FLOAT : t.prec; + + p = s[field++]; + if (ibm_fp_hex(p, prec, &t.operands[i])) { + return ERROR_INPUT; + } + } + + p = s[field++]; + if (strcmp("->", p)) { + return ERROR_INPUT; + } + + p = s[field++]; + if (unlikely(strcmp("#", p) == 0)) { + t.expected_result_is_valid = false; + } else { + enum precision prec = t.prec == PREC_FLOAT_TO_DOUBLE ? + PREC_DOUBLE : t.prec; + + if (ibm_fp_hex(p, prec, &t.expected_result)) { + return ERROR_INPUT; + } + t.expected_result_is_valid = true; + } + + /* + * A 0 here means "do not check the exceptions", i.e. it does NOT mean + * "there should be no exceptions raised". + */ + t.exceptions = 0; + /* the expected exceptions field is optional */ + if (field == n - 1) { + p = s[field++]; + if (ibm_get_exceptions(p, &t.exceptions)) { + return ERROR_INPUT; + } + } + + /* + * We ignore "trapped exceptions" because we're not testing the trapping + * mechanism of the host CPU. + * We test though that the exception bits are correctly set. + */ + if (t.trapped_exceptions) { + return ERROR_NOT_HANDLED; + } + return tester->func(&t); +} + +static const struct input valid_input_types[] = { + [INPUT_FMT_IBM] = { + .name = "ibm", + .test_line = ibm_test_line, + }, +}; + +static const struct input *input_type = &valid_input_types[INPUT_FMT_IBM]; + +static bool line_is_whitelisted(char *line) +{ + ENTRY e, *ep; + + if (whitelist.ht.size == 0) { + return false; + } + e.key = line; + return hsearch_r(e, FIND, &ep, &whitelist.ht); +} + +static void test_file(const char *filename) +{ + static char line[256]; + unsigned int i; + FILE *fp; + + fp = fopen(filename, "r"); + if (fp == NULL) { + fprintf(stderr, "cannot open file '%s': %s\n", + filename, strerror(errno)); + exit(EXIT_FAILURE); + } + i = 0; + while (fgets(line, sizeof(line), fp)) { + enum error err; + + i++; + if (unlikely(line_is_whitelisted(line))) { + test_stats[ERROR_WHITELISTED]++; + continue; + } + err = input_type->test_line(line); + if (unlikely(is_err(err))) { + switch (err) { + case ERROR_INPUT: + fprintf(stderr, "error: malformed input @ %s:%d:\n", + filename, i); + break; + case ERROR_RESULT: + fprintf(stderr, "error: result mismatch for input @ %s:%d:\n", + filename, i); + break; + case ERROR_EXCEPTIONS: + fprintf(stderr, "error: flags mismatch for input @ %s:%d:\n", + filename, i); + break; + default: + assert(false); + } + fprintf(stderr, "%s", line); + if (die_on_error) { + exit(EXIT_FAILURE); + } + } + test_stats[err]++; + } + if (fclose(fp)) { + fprintf(stderr, "warning: cannot close file '%s': %s\n", + filename, strerror(errno)); + } +} + +static void set_input_fmt(const char *optarg) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(valid_input_types); i++) { + const struct input *type = &valid_input_types[i]; + + if (strcmp(optarg, type->name) == 0) { + input_type = type; + return; + } + } + fprintf(stderr, "Unknown input format '%s'", optarg); + exit(EXIT_FAILURE); +} + +static void set_tester(const char *optarg) +{ + int i; + + for (i = 0; i < ARRAY_SIZE(valid_testers); i++) { + const struct tester *t = &valid_testers[i]; + + if (strcmp(optarg, t->name) == 0) { + tester = t; + return; + } + } + fprintf(stderr, "Unknown tester '%s'", optarg); + exit(EXIT_FAILURE); +} + +static void whitelist_add_line(const char *orig_line) +{ + char *line = strdup(orig_line); + bool inserted; + ENTRY e, *ep; + int r; + + if (whitelist.ht.size == 0) { + if (!hcreate_r(4096, &whitelist.ht)) { + fprintf(stderr, "%s: error creating hash table\n", __func__); + } + } + + int hsearch_r(ENTRY item, ACTION action, ENTRY **retval, + struct hsearch_data *htab); + + e.key = line; + r = hsearch_r(e, FIND, &ep, &whitelist.ht); + if (unlikely(r)) { + free(line); + return; + } + whitelist.n++; + whitelist.lines = realloc(whitelist.lines, (whitelist.n * sizeof(line))); + whitelist.lines[whitelist.n - 1] = line; + e.data = line; + inserted = hsearch_r(e, ENTER, &ep, &whitelist.ht); + assert(inserted); +} + +static void set_whitelist(const char *filename) +{ + FILE *fp; + static char line[256]; + + fp = fopen(filename, "r"); + if (fp == NULL) { + fprintf(stderr, "warning: cannot open white list file '%s': %s\n", + filename, strerror(errno)); + return; + } + while (fgets(line, sizeof(line), fp)) { + if (isspace(line[0]) || line[0] == '#') { + continue; + } + whitelist_add_line(line); + } + if (fclose(fp)) { + fprintf(stderr, "warning: cannot close file '%s': %s\n", + filename, strerror(errno)); + } +} + +static void set_default_exceptions(const char *str) +{ + if (ibm_get_exceptions(str, &default_exceptions)) { + fprintf(stderr, "Invalid exception '%s'\n", str); + exit(EXIT_FAILURE); + } +} + +static void usage_complete(int argc, char *argv[]) +{ + fprintf(stderr, "Usage: %s [options] file1 [file2 ...]\n", argv[0]); + fprintf(stderr, "options:\n"); + fprintf(stderr, " -n = do not die on error. Default: dies on error\n"); + fprintf(stderr, " -e = default exception flags (xiozu). Default: none\n"); + fprintf(stderr, " -f = format of the input file(s). Default: %s\n", + valid_input_types[0].name); + fprintf(stderr, " -t = tester. Default: %s\n", valid_testers[0].name); + fprintf(stderr, " -w = path to file with test cases to be whitelisted\n"); + fprintf(stderr, " -a = Perform tininess detection after rounding " + "(soft tester only). Default: before\n"); + fprintf(stderr, " -z = flush inputs to zero (soft tester only). " + "Default: disabled\n"); + fprintf(stderr, " -Z = flush output to zero (soft tester only). " + "Default: disabled\n"); +} + +static void parse_opts(int argc, char *argv[]) +{ + int c; + + for (;;) { + c = getopt(argc, argv, "ae:f:hnt:w:zZ"); + if (c < 0) { + return; + } + switch (c) { + case 'e': + set_default_exceptions(optarg); + break; + case 'f': + set_input_fmt(optarg); + break; + case 'h': + usage_complete(argc, argv); + exit(EXIT_SUCCESS); + case 'n': + die_on_error = false; + break; + case 't': + set_tester(optarg); + break; + case 'w': + set_whitelist(optarg); + break; + case 'a': + soft_status.float_detect_tininess = float_tininess_after_rounding; + break; + case 'z': + soft_status.flush_inputs_to_zero = 1; + break; + case 'Z': + soft_status.flush_to_zero = 1; + break; + } + } + assert(false); +} + +static uint64_t count_errors(void) +{ + uint64_t ret = 0; + int i; + + for (i = ERROR_INPUT; i < ERROR_MAX; i++) { + ret += test_stats[i]; + } + return ret; +} + +int main(int argc, char *argv[]) +{ + uint64_t n_errors; + int i; + + if (argc == 1) { + usage_complete(argc, argv); + exit(EXIT_FAILURE); + } + parse_opts(argc, argv); + for (i = optind; i < argc; i++) { + test_file(argv[i]); + } + + n_errors = count_errors(); + if (n_errors) { + printf("Tests failed: %"PRIu64". Parsing: %"PRIu64 + ", result:%"PRIu64", flags:%"PRIu64"\n", + n_errors, test_stats[ERROR_INPUT], test_stats[ERROR_RESULT], + test_stats[ERROR_EXCEPTIONS]); + } else { + printf("All tests OK.\n"); + } + printf("Tests passed: %" PRIu64 ". Not handled: %" PRIu64 + ", whitelisted: %"PRIu64 "\n", + test_stats[ERROR_NONE], test_stats[ERROR_NOT_HANDLED], + test_stats[ERROR_WHITELISTED]); + return !!n_errors; +} From patchwork Thu Apr 19 13:58:59 2018 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: 901239 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="Yu5hCit9"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhNw0MqNz9s1w for ; Fri, 20 Apr 2018 00:35:44 +1000 (AEST) Received: from localhost ([::1]:51058 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Aez-0005RZ-P1 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:35:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52801) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANX-0004mT-Fm for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANU-00068x-5L for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:38 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:38511) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANT-00068H-Uf for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:36 -0400 Received: by mail-wr0-x242.google.com with SMTP id h3-v6so14534057wrh.5 for ; Thu, 19 Apr 2018 07:17:35 -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 :mime-version:content-transfer-encoding; bh=o4H2aEHrCUWjd65LdAgAbF6cZHgmMOMeakm1BTDNz9M=; b=Yu5hCit9RuckPO96XD6kGc9Gn6z7vlkWXDwLdKCye3YCCGIXKQRG0Fg5aKExDrIL6s tIdJ80SM+Q9dy37EZmrwVfyEmEVhTu6RX+p0dVnUOYvdIi7gixJBI2PDzjaJamP1igDs ibJIRYpqtx7mv/gdig7fUF2HpfD6Fh3usCV5g= 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=o4H2aEHrCUWjd65LdAgAbF6cZHgmMOMeakm1BTDNz9M=; b=WMJtNYYHqII6dlpc9iWjQRzyaroh0/EipGoauxtvTnTsGnup9LxTAvd4Mhb5ldj0jN yeajThBf+lXJA4TxvMjMSvHcTPY/SdnRGFJQKpOPWHUUSlDvTp4t8PTsOTjs/r8m2foq aKbqze38/6g+idrt9CLX+I1lNDAKicz61DRu5gzXQwML0d1W1wqibSolwVtinAtuL+zW H9qSOWpYF2swhATdfGgFXeQ+w+Rrj3IwYLZUZ1m35OCejXwkQj/5HXktP4LY1pS2NDKt 2B2BgyE+tjfMUs3qckHF8nz62VCRi7kJHGXLV0o3WSDkAW1Cdg3sNp75qHF2Y6ayRWkX W8Dw== X-Gm-Message-State: ALQs6tAYC1XzmRgIuaPuNP/DBlKQU8gef5b/jzfssAUuAiheuIcT/CKn Ui73Hrgy4edd+frPH5G1xLJsasizKSw= X-Google-Smtp-Source: AIpwx48MSDMiWL/aiSJZe5jcOVYW1JaPWQUGPJ2t4MiRgG1CmI/pTQgLmt7UlQMzDEh8ZVW3d9PiQA== X-Received: by 10.28.112.3 with SMTP id l3mr5048869wmc.90.1524147454874; Thu, 19 Apr 2018 07:17:34 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 11sm5011550wmr.16.2018.04.19.07.17.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 9F4673E02CB; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:58:59 +0100 Message-Id: <20180419135901.30035-42-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 41/43] tests/tcg/multiarch: add fp-test into multiarch set 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" The compile for fp-test is a little funky as we need to include a build of QEMU's softfloat as well. There is still a problem caused by the inclusion of config-host.h by osdep.h as it will trigger problems like: In file included from /home/alex/lsrc/qemu/qemu.git/include/qemu/bitops.h:16:0, from /home/alex/lsrc/qemu/qemu.git/fpu/softfloat.c:87: /home/alex/lsrc/qemu/qemu.git/include/qemu/host-utils.h: In function ‘mulu64’: /home/alex/lsrc/qemu/qemu.git/include/qemu/host-utils.h:35:5: error: unknown type name ‘__uint128_t’ __uint128_t r = (__uint128_t)a * b; ^ When trying to cross build i386 on an x86_64 host. Signed-off-by: Alex Bennée --- tests/tcg/multiarch/Makefile.target | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index a691fd59d3..52adc18625 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -28,3 +28,21 @@ run-test-mmap: test-mmap -$(QEMU) -p 16384 ./test-mmap 16384 -$(QEMU) -p 32768 ./test-mmap 32768 +# +# Include the fp-test from the main test suite +# + +VPATH+=$(SRC_PATH)/tests/fp +VPATH+=$(SRC_PATH)/fpu +TESTS+=fp-test + +FP_CFLAGS := $(CFLAGS) -Wall -O0 -g -fno-strict-aliasing +FP_CFLAGS += $(QEMU_INCLUDES) +FP_CFLAGS += -D_GNU_SOURCE -DHW_POISON_H + +fp-test.o softfloat.o: %.o: %.c + $(CC) $(FP_CFLAGS) -c $< -o $@ + +fp-test: fp-test.o softfloat.o + $(CC) $^ -o $@ -lm -static + From patchwork Thu Apr 19 13:59:00 2018 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: 901179 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="B3X0ECM0"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40Rgx14jylz9s2M for ; Fri, 20 Apr 2018 00:15:01 +1000 (AEST) Received: from localhost ([::1]:50136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9AKx-0001ph-L1 for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:14:59 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47297) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ADt-0004Xs-OP for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:43 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ADs-0005LT-KS for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:41 -0400 Received: from mail-wr0-x244.google.com ([2a00:1450:400c:c0c::244]:45632) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ADs-0005HQ-9X for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:07:40 -0400 Received: by mail-wr0-x244.google.com with SMTP id u11-v6so14408163wri.12 for ; Thu, 19 Apr 2018 07:07: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:in-reply-to:references :mime-version:content-transfer-encoding; bh=mY3PXU5krKzSB4MJ2lZkE+sRdzZgSATMBkdhuzagHLY=; b=B3X0ECM0/r57krWZifBLO/f5T8jYFEaLobtZRjZFi9AoA2zGc3ugiZM3sL08OsQ773 k/5Y+/Dzr3+/W1DoSVwxG4wUndSIATkhnFqFRamxmFugDNjIRKTY193/Nj7ftLCgvFkj 4apR4z7/L4xFoUWZIN+00DvdW4hOJjxuvloUI= 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=mY3PXU5krKzSB4MJ2lZkE+sRdzZgSATMBkdhuzagHLY=; b=aX1fHN8Bhh7Xp600y6IY/BSfGPafRRnpcBZbnBgyie+uDtJbBWTM4ZbOYfw6lbtcfz qqFQbzOszb2UhWwVGo8+0aAHUcRRESbDxXr81Tz8AZchZ17AmogxBLHpNDkQUbgjZOaW HuajjTaTl+sGHCXHdL0bv71df47UBzwqlz0t+cJjTjAmkrANmJW9mwrOIS3r8jpAvqHE wVkQHn8/sUGk1VDdLVDjrV7DEK0KYepqPkL4rMmSV8IRGunxfFUU7N3abJ9/tUqll1uW +yPp8RDZsM++SapGOYsqiy/uiYJcVp9s13aea2bhD9sEs7wnIKECabE8CImVvkdAmAjn 7t1Q== X-Gm-Message-State: ALQs6tATLRjoR/RaDEab7/BE4bEd5GvaklulsbZf/bwBPFk4qSHVdBH5 JzXXi8kb1QiLg7sPPfT6xao15g== X-Google-Smtp-Source: AIpwx49iZIY5DrWcyOiYxs0sCWeGX8c3zskWpopM4T6OIv6aFk2UDN3hBcHJnp11y5JA1CbqZE/Wtg== X-Received: by 2002:adf:e64b:: with SMTP id b11-v6mr1057397wrn.51.1524146859349; Thu, 19 Apr 2018 07:07:39 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 2-v6sm6974056wrb.22.2018.04.19.07.07.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:07:35 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id B0FCA3E0A5F; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:59:00 +0100 Message-Id: <20180419135901.30035-43-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::244 Subject: [Qemu-devel] [PATCH v2 42/43] tests/tcg: disable fp-test for 32 bit (HACK!) 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This prevents us trying to build fp-test for 32 bit guests as they would fail due to pollution from config-host.h when including osdep.h. As keeping softfloat.o would be useful maybe we can conditionally disabled it? Signed-off-by: Alex Bennée --- tests/tcg/multiarch/Makefile.target | 2 ++ 1 file changed, 2 insertions(+) diff --git a/tests/tcg/multiarch/Makefile.target b/tests/tcg/multiarch/Makefile.target index 52adc18625..8bf6f3f8dc 100644 --- a/tests/tcg/multiarch/Makefile.target +++ b/tests/tcg/multiarch/Makefile.target @@ -31,6 +31,7 @@ run-test-mmap: test-mmap # # Include the fp-test from the main test suite # +ifneq (,$(findstring 64,$(TARGET_NAME))) VPATH+=$(SRC_PATH)/tests/fp VPATH+=$(SRC_PATH)/fpu @@ -46,3 +47,4 @@ fp-test.o softfloat.o: %.o: %.c fp-test: fp-test.o softfloat.o $(CC) $^ -o $@ -lm -static +endif From patchwork Thu Apr 19 13:59:01 2018 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: 901242 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (mailfrom) smtp.mailfrom=nongnu.org (client-ip=2001:4830:134:3::11; helo=lists.gnu.org; envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org; receiver=) Authentication-Results: ozlabs.org; dmarc=fail (p=none dis=none) header.from=linaro.org Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b="fIJLtgYd"; dkim-atps=neutral Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 40RhSF4JJQz9s2M for ; Fri, 20 Apr 2018 00:38:37 +1000 (AEST) Received: from localhost ([::1]:51576 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9Ahn-0008DW-IV for incoming@patchwork.ozlabs.org; Thu, 19 Apr 2018 10:38:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52860) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1f9ANb-0004qA-P3 for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:50 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1f9ANV-0006AR-RJ for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:43 -0400 Received: from mail-wr0-x242.google.com ([2a00:1450:400c:c0c::242]:39272) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1f9ANV-00069c-Gf for qemu-devel@nongnu.org; Thu, 19 Apr 2018 10:17:37 -0400 Received: by mail-wr0-x242.google.com with SMTP id q3-v6so4491709wrj.6 for ; Thu, 19 Apr 2018 07:17:37 -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 :mime-version:content-transfer-encoding; bh=P3asiZvmEFcfZLk1LuNlofp3lbV5s5ec5DQZs8UIfRQ=; b=fIJLtgYdor5Q5yjQLQ5JLAxWy+U9M5HBxJcy0539lMWqRfWJez3nc82gk2vI7mqYwx dkaxNVq1uUAinkL/eTVDITfyVRuJo0O6qDIgCEOiMsDWXiQ44/kQGJihljKlmsPCx5ti 0m7RL2fQVcdQJ0pDVbd4T/ompuykl6wLyuUGc= 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=P3asiZvmEFcfZLk1LuNlofp3lbV5s5ec5DQZs8UIfRQ=; b=eh2tVct3sl7Qvgil8wTpJG1qVe3YGxGaepdbKizTHf09fThrXYObTQgOvloGeEO7Nf 9aEE8YPgoPMcGdxwIth+rBqY/+jgEcpd63SgmEk9xUGaAT5Gn1nkiV3rTvkKPi5WMbEh YJ2Kbp2DSbUcHMrkTRwBcdkYilfLg1QPuJlfdwyTau9oJXDamBJZrjzGPlj0+gbJXJ+i rVfw8D6N7ygm4VmsAaM54CxtWVAegPSFuuue2H584a39S17FsFjJ/M4Fxi+1+qtwlM34 9N6Oh4YUlRUsSZ6xkeC90VqmdDm1IwD1hP1F84hU3XqI1UTlGunsFGqRNMIFDoG7f5By RExw== X-Gm-Message-State: ALQs6tAXvizphg8zRPrSP5z+RLXieJV9tOVb5up/Ak4JNCYDf0KvibD2 i6ppkGocSwtlw8/hMWsXot7ugw== X-Google-Smtp-Source: AIpwx4+BnwZUNBDVVmwXGWV6jmAhz+SmWrV0pfQmc3SOdfNjCe7NxAC5DH8ZQa5vPiGoROnyy/ZNnw== X-Received: by 2002:adf:8e44:: with SMTP id n62-v6mr5205315wrb.159.1524147456271; Thu, 19 Apr 2018 07:17:36 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id 14sm5294543wmo.27.2018.04.19.07.17.28 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 19 Apr 2018 07:17:30 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id C52D83E0AC0; Thu, 19 Apr 2018 14:59:04 +0100 (BST) From: =?utf-8?q?Alex_Benn=C3=A9e?= To: peter.maydell@linaro.org, cota@braap.org, famz@redhat.com, berrange@redhat.com, f4bug@amsat.org, richard.henderson@linaro.org, balrogg@gmail.com, aurelien@aurel32.net, agraf@suse.de Date: Thu, 19 Apr 2018 14:59:01 +0100 Message-Id: <20180419135901.30035-44-alex.bennee@linaro.org> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180419135901.30035-1-alex.bennee@linaro.org> References: <20180419135901.30035-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:400c:c0c::242 Subject: [Qemu-devel] [PATCH v2 43/43] tests: fp-test add fcvt support (!INCOMPLETE WIP) 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_Benn=C3=A9e?= , qemu-devel@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Sender: "Qemu-devel" This adds support for the various FOO-to-BAR conversions to fp-test. It also defines PREC_HALF although currently that is not used and will need compile time detection for _Float16 support. I've added a small test file for testing against regressions. Signed-off-by: Alex Bennée --- tests/fp/fp-test.c | 535 +++++++++++++++++++++++--- tests/fp/qemu/regression-tests.fptest | 7 + 2 files changed, 479 insertions(+), 63 deletions(-) create mode 100644 tests/fp/qemu/regression-tests.fptest diff --git a/tests/fp/fp-test.c b/tests/fp/fp-test.c index 27db552160..320da2398a 100644 --- a/tests/fp/fp-test.c +++ b/tests/fp/fp-test.c @@ -38,15 +38,167 @@ struct input { }; enum precision { + PREC_HALF, PREC_FLOAT, PREC_DOUBLE, PREC_QUAD, + /* Integers */ + PREC_INT16, + PREC_INT32, + PREC_INT64, + PREC_UINT16, + PREC_UINT32, + PREC_UINT64, + /* Float to Float conversions */ + PREC_HALF_TO_FLOAT, + PREC_HALF_TO_DOUBLE, + PREC_FLOAT_TO_HALF, PREC_FLOAT_TO_DOUBLE, + PREC_DOUBLE_TO_HALF, + PREC_DOUBLE_TO_FLOAT, + /* Float to Int conversions */ + PREC_HALF_TO_INT16, + PREC_HALF_TO_INT32, + PREC_HALF_TO_INT64, + PREC_FLOAT_TO_INT16, + PREC_FLOAT_TO_INT32, + PREC_FLOAT_TO_INT64, + PREC_DOUBLE_TO_INT16, + PREC_DOUBLE_TO_INT32, + PREC_DOUBLE_TO_INT64, + /* Float to unsigned int conversions */ + PREC_HALF_TO_UINT16, + PREC_HALF_TO_UINT32, + PREC_HALF_TO_UINT64, + PREC_FLOAT_TO_UINT16, + PREC_FLOAT_TO_UINT32, + PREC_FLOAT_TO_UINT64, + PREC_DOUBLE_TO_UINT16, + PREC_DOUBLE_TO_UINT32, + PREC_DOUBLE_TO_UINT64, + /* Int to float conversions */ + PREC_INT16_TO_HALF, + PREC_INT16_TO_FLOAT, + PREC_INT16_TO_DOUBLE, + PREC_INT32_TO_HALF, + PREC_INT32_TO_FLOAT, + PREC_INT32_TO_DOUBLE, + PREC_INT64_TO_HALF, + PREC_INT64_TO_FLOAT, + PREC_INT64_TO_DOUBLE, + /* Unsigned int to float conversions */ + PREC_UINT16_TO_HALF, + PREC_UINT16_TO_FLOAT, + PREC_UINT16_TO_DOUBLE, + PREC_UINT32_TO_HALF, + PREC_UINT32_TO_FLOAT, + PREC_UINT32_TO_DOUBLE, + PREC_UINT64_TO_HALF, + PREC_UINT64_TO_FLOAT, + PREC_UINT64_TO_DOUBLE, }; +static enum precision get_input_prec(enum precision prec) +{ + /* Map conversions to input precision */ + if (prec >= PREC_HALF_TO_FLOAT) { + switch (prec) { + case PREC_HALF_TO_FLOAT: + case PREC_HALF_TO_DOUBLE: + case PREC_HALF_TO_INT16: + case PREC_HALF_TO_INT32: + case PREC_HALF_TO_INT64: + case PREC_HALF_TO_UINT16: + case PREC_HALF_TO_UINT32: + case PREC_HALF_TO_UINT64: + return PREC_HALF; + case PREC_FLOAT_TO_HALF: + case PREC_FLOAT_TO_DOUBLE: + case PREC_FLOAT_TO_INT16: + case PREC_FLOAT_TO_INT32: + case PREC_FLOAT_TO_INT64: + case PREC_FLOAT_TO_UINT16: + case PREC_FLOAT_TO_UINT32: + case PREC_FLOAT_TO_UINT64: + return PREC_FLOAT; + case PREC_DOUBLE_TO_HALF: + case PREC_DOUBLE_TO_FLOAT: + case PREC_DOUBLE_TO_INT16: + case PREC_DOUBLE_TO_INT32: + case PREC_DOUBLE_TO_INT64: + case PREC_DOUBLE_TO_UINT16: + case PREC_DOUBLE_TO_UINT32: + case PREC_DOUBLE_TO_UINT64: + return PREC_DOUBLE; + default: + assert(false); + } + } + + return prec; +} + +static enum precision get_output_prec(enum precision prec) +{ + /* Map conversions to input precision */ + if (prec >= PREC_HALF_TO_FLOAT) { + switch (prec) { + case PREC_FLOAT_TO_HALF: + case PREC_DOUBLE_TO_HALF: + case PREC_INT16_TO_HALF: + case PREC_INT32_TO_HALF: + case PREC_INT64_TO_HALF: + case PREC_UINT16_TO_HALF: + case PREC_UINT32_TO_HALF: + case PREC_UINT64_TO_HALF: + return PREC_HALF; + case PREC_HALF_TO_FLOAT: + case PREC_DOUBLE_TO_FLOAT: + return PREC_FLOAT; + case PREC_HALF_TO_DOUBLE: + case PREC_FLOAT_TO_DOUBLE: + return PREC_DOUBLE; + case PREC_HALF_TO_INT16: + case PREC_FLOAT_TO_INT16: + case PREC_DOUBLE_TO_INT16: + return PREC_INT16; + case PREC_HALF_TO_INT32: + case PREC_FLOAT_TO_INT32: + case PREC_DOUBLE_TO_INT32: + return PREC_INT32; + case PREC_HALF_TO_INT64: + case PREC_FLOAT_TO_INT64: + case PREC_DOUBLE_TO_INT64: + return PREC_INT64; + case PREC_HALF_TO_UINT16: + case PREC_FLOAT_TO_UINT16: + case PREC_DOUBLE_TO_UINT16: + return PREC_UINT16; + case PREC_HALF_TO_UINT32: + case PREC_FLOAT_TO_UINT32: + case PREC_DOUBLE_TO_UINT32: + return PREC_UINT32; + case PREC_HALF_TO_UINT64: + case PREC_FLOAT_TO_UINT64: + case PREC_DOUBLE_TO_UINT64: + return PREC_UINT64; + default: + assert(false); + } + } + + return prec; +} + +typedef struct { + char *opstr; + enum precision prec; +} map_to_prec; + struct op_desc { const char * const name; int n_operands; + map_to_prec *decode_tbl; }; enum op { @@ -62,9 +214,46 @@ enum op { OP_ABS, OP_IS_NAN, OP_IS_INF, - OP_FLOAT_TO_DOUBLE, + /* All above are conversions */ + OP_FLOAT_TO_FLOAT, + OP_FLOAT_TO_INT, + OP_FLOAT_TO_UINT, + OP_INT_TO_FLOAT, + OP_UINT_TO_FLOAT }; +map_to_prec float_to_float[] = { {"b16b32", PREC_HALF_TO_FLOAT}, + {"b16b64", PREC_HALF_TO_DOUBLE}, + {"b32b16", PREC_FLOAT_TO_HALF}, + {"b32b64", PREC_FLOAT_TO_DOUBLE}, + {"b64b16", PREC_DOUBLE_TO_HALF}, + {"b64b32", PREC_DOUBLE_TO_FLOAT}, + { NULL, 0} }; + +map_to_prec float_to_int[] = { {"b16b16", PREC_HALF_TO_INT16}, + {"b16b32", PREC_HALF_TO_INT16}, + {"b16b64", PREC_HALF_TO_INT16}, + {"b32b16", PREC_FLOAT_TO_INT16}, + {"b32b32", PREC_FLOAT_TO_INT32}, + {"b32b64", PREC_FLOAT_TO_INT64}, + {"b64b16", PREC_DOUBLE_TO_INT16}, + {"b64b32", PREC_DOUBLE_TO_INT32}, + {"b64b64", PREC_DOUBLE_TO_INT64}, + { NULL, 0} }; + +static enum precision decode_map_table(map_to_prec *tbl, char *opstr) +{ + while (tbl->opstr) { + if (strncmp(tbl->opstr, opstr, strlen(tbl->opstr)) == 0) { + return tbl->prec; + } + tbl++; + } + + /* lookup failed */ + assert(false); +} + static const struct op_desc ops[] = { [OP_ADD] = { "+", 2 }, [OP_SUB] = { "-", 2 }, @@ -78,7 +267,11 @@ static const struct op_desc ops[] = { [OP_ABS] = { "A", 1 }, [OP_IS_NAN] = { "?N", 1 }, [OP_IS_INF] = { "?i", 1 }, - [OP_FLOAT_TO_DOUBLE] = { "cff", 1 }, + [OP_FLOAT_TO_FLOAT] = { "cff", 1, float_to_float }, + [OP_FLOAT_TO_INT] = { "cfi", 1, float_to_int }, + [OP_FLOAT_TO_UINT] = { "cfu", 1 }, + [OP_INT_TO_FLOAT] = { "cif", 1 }, + [OP_UINT_TO_FLOAT] = { "cuf", 1 }, }; /* @@ -269,6 +462,159 @@ static enum error tester_check(const struct test_op *t, uint64_t res64, return err; } +static float get_float(struct operand op) +{ + switch (op.type) { + case OP_TYPE_QNAN: + return __builtin_nanf(""); + case OP_TYPE_SNAN: + return __builtin_nansf(""); + default: + return u64_to_float(op.val); + } +} + +static double get_double(struct operand op) +{ + switch (op.type) { + case OP_TYPE_QNAN: + return __builtin_nanf(""); + case OP_TYPE_SNAN: + return __builtin_nansf(""); + default: + return u64_to_double(op.val); + } +} + +static enum error host_tester_cff(struct test_op *t) +{ + float in32, res32; + double in64, res64; + bool result_is_nan; + uint8_t flags = 0; + + assert(t->op == OP_FLOAT_TO_FLOAT); + + switch (t->prec) { + case PREC_HALF_TO_FLOAT: + case PREC_HALF_TO_DOUBLE: + return ERROR_NOT_HANDLED; + case PREC_FLOAT_TO_HALF: + return ERROR_NOT_HANDLED; + case PREC_FLOAT_TO_DOUBLE: + { + in32 = get_float(t->operands[0]); + t->expected_result.val = double_to_u64(get_double(t->expected_result)); + res64 = (double) in32; + break; + } + case PREC_DOUBLE_TO_HALF: + return ERROR_NOT_HANDLED; + case PREC_DOUBLE_TO_FLOAT: + in64 = get_double(t->operands[0]); + t->expected_result.val = float_to_u64(get_float(t->expected_result)); + res32 = (float) in64; + break; + default: + return ERROR_NOT_HANDLED; + } + + flags = host_get_exceptions(); + + switch (t->prec) { + case PREC_HALF_TO_DOUBLE: + case PREC_FLOAT_TO_DOUBLE: + result_is_nan = isnan(res64); + return tester_check(t, res64, result_is_nan, flags); + case PREC_HALF_TO_FLOAT: + case PREC_DOUBLE_TO_FLOAT: + result_is_nan = isnan(res32); + return tester_check(t, res32, result_is_nan, flags); + default: + assert(false); + } + + return ERROR_NOT_HANDLED; +} + +static enum error host_tester_cfi(struct test_op *t) +{ + uint8_t flags = 0; + float in32; + double in64; + uint64_t res; + + assert(t->op == OP_FLOAT_TO_INT || t->op == OP_FLOAT_TO_UINT); + + switch (get_input_prec(t->prec)) { + case PREC_HALF: + return ERROR_NOT_HANDLED; + case PREC_FLOAT: + in32 = get_float(t->operands[0]); + break; + case PREC_DOUBLE: + in64 = get_double(t->operands[0]); + break; + default: + assert(false); + } + + + switch (t->prec) { + case PREC_HALF_TO_INT16: + case PREC_HALF_TO_INT32: + case PREC_HALF_TO_INT64: + return ERROR_NOT_HANDLED; + case PREC_FLOAT_TO_INT16: + { + int16_t oi16 = (int16_t) in32; + res = (uint64_t) oi16; + break; + } + case PREC_FLOAT_TO_INT32: + { + int32_t oi32 = (int32_t) in32; + res = (uint64_t) oi32; + break; + } + case PREC_FLOAT_TO_INT64: + { + int64_t oi64 = (int64_t) in32; + res = (uint64_t) oi64; + break; + } + case PREC_DOUBLE_TO_INT16: + { + int16_t oi16 = (int16_t) in64; + res = (uint64_t) oi16; + break; + } + case PREC_DOUBLE_TO_INT32: + { + int32_t oi32 = (int32_t) in64; + res = (uint64_t) oi32; + break; + } + case PREC_DOUBLE_TO_INT64: + { + int64_t oi64 = (int64_t) in64; + res = (uint64_t) oi64; + break; + } + default: + assert(false); + } + + flags = host_get_exceptions(); + + return tester_check(t, res, false, flags); +} + +static enum error host_tester_cif(struct test_op *t) +{ + return ERROR_NOT_HANDLED; +} + static enum error host_tester(struct test_op *t) { uint64_t res64; @@ -280,6 +626,20 @@ static enum error host_tester(struct test_op *t) host_set_exceptions(default_exceptions); } + /* Handle conversions first */ + switch (t->op) { + case OP_FLOAT_TO_FLOAT: + return host_tester_cff(t); + case OP_FLOAT_TO_INT: + case OP_FLOAT_TO_UINT: + return host_tester_cfi(t); + case OP_INT_TO_FLOAT: + case OP_UINT_TO_FLOAT: + return host_tester_cif(t); + default: + break; + } + if (t->prec == PREC_FLOAT) { float a, b, c; float *in[] = { &a, &b, &c }; @@ -396,40 +756,68 @@ static enum error host_tester(struct test_op *t) flags = host_get_exceptions(); res64 = double_to_u64(res); result_is_nan = isnan(res); - } else if (t->prec == PREC_FLOAT_TO_DOUBLE) { - float a; - double res; - - if (t->operands[0].type == OP_TYPE_QNAN) { - a = __builtin_nanf(""); - } else if (t->operands[0].type == OP_TYPE_SNAN) { - a = __builtin_nansf(""); - } else { - a = u64_to_float(t->operands[0].val); - } - - if (t->expected_result.type == OP_TYPE_QNAN) { - t->expected_result.val = double_to_u64(__builtin_nan("")); - } else if (t->expected_result.type == OP_TYPE_SNAN) { - t->expected_result.val = double_to_u64(__builtin_nans("")); - } - - switch (t->op) { - case OP_FLOAT_TO_DOUBLE: - res = a; - break; - default: - return ERROR_NOT_HANDLED; - } - flags = host_get_exceptions(); - res64 = double_to_u64(res); - result_is_nan = isnan(res); } else { return ERROR_NOT_HANDLED; /* XXX */ } return tester_check(t, res64, result_is_nan, flags); } +static enum error soft_tester_cff(struct test_op *t, float_status *s) +{ + float in32, res32; + double in64, res64; + bool result_is_nan; + + assert(t->op == OP_FLOAT_TO_FLOAT); + + switch (t->prec) { + case PREC_HALF_TO_FLOAT: + case PREC_HALF_TO_DOUBLE: + return ERROR_NOT_HANDLED; + case PREC_FLOAT_TO_HALF: + return ERROR_NOT_HANDLED; + case PREC_FLOAT_TO_DOUBLE: + { + in32 = get_float(t->operands[0]); + t->expected_result.val = double_to_u64(get_double(t->expected_result)); + res64 = float32_to_float64(in32, s); + break; + } + case PREC_DOUBLE_TO_HALF: + return ERROR_NOT_HANDLED; + case PREC_DOUBLE_TO_FLOAT: + in64 = get_double(t->operands[0]); + t->expected_result.val = float_to_u64(get_float(t->expected_result)); + res32 = float64_to_float32(in64, s); + break; + default: + return ERROR_NOT_HANDLED; + } + + switch (t->prec) { + case PREC_HALF_TO_DOUBLE: + case PREC_FLOAT_TO_DOUBLE: + result_is_nan = isnan(res64); + return tester_check(t, res64, result_is_nan, s->float_exception_flags); + case PREC_HALF_TO_FLOAT: + case PREC_DOUBLE_TO_FLOAT: + result_is_nan = isnan(res32); + return tester_check(t, res32, result_is_nan, s->float_exception_flags); + default: + assert(false); + } +} + +static enum error soft_tester_cfi(struct test_op *t, float_status *s) +{ + return ERROR_NOT_HANDLED; +} + +static enum error soft_tester_cif(struct test_op *t, float_status *s) +{ + return ERROR_NOT_HANDLED; +} + static enum error soft_tester(struct test_op *t) { float_status *s = &soft_status; @@ -440,6 +828,20 @@ static enum error soft_tester(struct test_op *t) s->float_rounding_mode = t->round; s->float_exception_flags = default_exceptions; + /* Handle conversions first */ + switch (t->op) { + case OP_FLOAT_TO_FLOAT: + return soft_tester_cff(t, s); + case OP_FLOAT_TO_INT: + case OP_FLOAT_TO_UINT: + return soft_tester_cfi(t, s); + case OP_INT_TO_FLOAT: + case OP_UINT_TO_FLOAT: + return soft_tester_cif(t, s); + default: + break; + } + if (t->prec == PREC_FLOAT) { float32 a, b, c; float32 *in[] = { &a, &b, &c }; @@ -558,17 +960,6 @@ static enum error soft_tester(struct test_op *t) return ERROR_NOT_HANDLED; } result_is_nan = isnan(*(double *)&res64); - } else if (t->prec == PREC_FLOAT_TO_DOUBLE) { - float32 a = t->operands[0].val; - - switch (t->op) { - case OP_FLOAT_TO_DOUBLE: - res64 = float32_to_float64(a, s); - break; - default: - return ERROR_NOT_HANDLED; - } - result_is_nan = isnan(*(double *)&res64); } else { return ERROR_NOT_HANDLED; /* XXX */ } @@ -752,23 +1143,41 @@ ibm_fp_hex(const char *p, enum precision prec, struct operand *ret) return 0; } return 0; - } else if (!strcmp(p, "0x0")) { - if (prec == PREC_FLOAT) { - ret->val = float_to_u64(0.0); - } else if (prec == PREC_DOUBLE) { - ret->val = double_to_u64(0.0); - } else { - assert(false); + } else if (strncmp("0x", p, 2) == 0) { + unsigned long long result; + char *end; + + result = strtoull(p, &end, 16); + if (result == 0 && end == p) { + /* not a number */ + return 1; + } else if (result == ULLONG_MAX && errno) { + /* value does not fit in unsigned long long */ + return 1; + } else if (*end) { + /* began with a number but has junk left over at the end */ + return 1; } - return 0; - } else if (!strcmp(p, "0x1")) { - if (prec == PREC_FLOAT) { - ret->val = float_to_u64(1.0); - } else if (prec == PREC_DOUBLE) { - ret->val = double_to_u64(1.0); - } else { + + switch (prec) { + case PREC_FLOAT: + ret->val = float_to_u64(result); + break; + case PREC_DOUBLE: + ret->val = double_to_u64(result); + break; + case PREC_INT16: + case PREC_INT32: + case PREC_INT64: + case PREC_UINT16: + case PREC_UINT32: + case PREC_UINT64: + ret->val = result; + break; + default: assert(false); } + return 0; } return 1; @@ -814,11 +1223,14 @@ static enum error ibm_test_line(const char *line) if (unlikely(strlen(p) < 4)) { return ERROR_INPUT; } - if (strcmp("b32b64cff", p) == 0) { - t.prec = PREC_FLOAT_TO_DOUBLE; + /* Conversions are of the form bXXbYYcZZ */ + if (p[0] == 'b' && p[3] == 'b' && p[6] == 'c') { if (find_op(&p[6], &t.op)) { + fprintf(stderr, "%s: unhandled conversion %s\n", __func__, p); return ERROR_NOT_HANDLED; } + assert(ops[t.op].decode_tbl); + t.prec = decode_map_table(ops[t.op].decode_tbl, p); } else { if (strncmp("b32", p, 3) == 0) { t.prec = PREC_FLOAT; @@ -855,9 +1267,7 @@ static enum error ibm_test_line(const char *line) } for (i = 0; i < ops[t.op].n_operands; i++) { - enum precision prec = t.prec == PREC_FLOAT_TO_DOUBLE ? - PREC_FLOAT : t.prec; - + enum precision prec = get_input_prec(t.prec); p = s[field++]; if (ibm_fp_hex(p, prec, &t.operands[i])) { return ERROR_INPUT; @@ -873,8 +1283,7 @@ static enum error ibm_test_line(const char *line) if (unlikely(strcmp("#", p) == 0)) { t.expected_result_is_valid = false; } else { - enum precision prec = t.prec == PREC_FLOAT_TO_DOUBLE ? - PREC_DOUBLE : t.prec; + enum precision prec = get_output_prec(t.prec); if (ibm_fp_hex(p, prec, &t.expected_result)) { return ERROR_INPUT; @@ -943,7 +1352,7 @@ static void test_file(const char *filename) enum error err; i++; - if (unlikely(line_is_whitelisted(line))) { + if (whitelist.n > 0 && unlikely(line_is_whitelisted(line))) { test_stats[ERROR_WHITELISTED]++; continue; } diff --git a/tests/fp/qemu/regression-tests.fptest b/tests/fp/qemu/regression-tests.fptest new file mode 100644 index 0000000000..a105d3aa44 --- /dev/null +++ b/tests/fp/qemu/regression-tests.fptest @@ -0,0 +1,7 @@ +QEMU Floating point regression tests +------------------------------------ + +b32b32cfi =0 -Inf -> 0xffffffff80000000 i +b32b32cfi =0 +Inf -> 0xffffffff80000000 i +b32b64cfi =0 -Inf -> 0x8000000000000000 i +b32b64cfi =0 +Inf -> 0x8000000000000000 i