From patchwork Wed Jan 11 16:31:42 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641255 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3348023pvb; Wed, 11 Jan 2023 08:32:18 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBdFGbV4fJxHUaaCj7NSj94fyZKc9lEMAMQGLOPRKAFoxPGuMKNcXWVRAO74GTgZXfXmwm X-Received: by 2002:a05:6214:5713:b0:4e8:178d:7ec7 with SMTP id lt19-20020a056214571300b004e8178d7ec7mr47121947qvb.26.1673454738467; Wed, 11 Jan 2023 08:32:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454738; cv=none; d=google.com; s=arc-20160816; b=lB2PY9wEEfYgGYrC+RoqbCRqUtVj3P5umnd3RlHOUuObsVDXlE9uByz13r9SivnREg 538dkiE1ApSxtOjyziY+EOX7EMOLJq2ZooZenwuH79ktB3G/Xwb+9P2qWrU+/UTGejma mCrak7BHF9FB3/z9ApI3ZJGnQu0oQngSuhJh3sCU3vGTZxB4UHHDgOfLFNt0S1jt0zF9 qqRiSyA0r6cZjrUW96vTjIBwC2+L0nRglurxfb5ObkCk/GAnp1t6Yylch1HCuWXd+Gwx 6q9B+krIfUuhkASV0o+WcB3bseD7nJCnq5rh9L2GMrYDTOygHyNLcxXZ36ImTgxYljQa IpLw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=mYffee02pGXsDaWEK6vxcHOMS52J5/C+ETdo1/oigCU=; b=HgGOVI6Wa8FG1blhwFtwYbtYibSZ58zzH4QVX4/97kJe9m8u4ya4mTfnMjjIVRNJVZ D4gUHcAUu5vE4swU7nXfeUR2Ije1QlX1Eu2imUCtL1r6ZhjcE87/x8l9nZti1fiWFLBf xPey/lSUjUTs6tfalqBaPFoG9bgsc6Uv3gNguQYqTJPzi+ojkZphoFhBIk+rspFkwgoL AVNuVWWimaTpVye30FcSBd1AdpMjS1i6smvlfRO0iT3UZ+jqeslFns8+ylFF5kxVVySE vlMrFfrDNG2fXHcZUfq46dFNrb7NE4iMrYDODpY4Cz3Z+7siuH3nLRy2eEbtbxDnyCkd ldLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ks2Xu7NC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id 3-20020a0562140d6300b005341e35ead7si3082182qvs.47.2023.01.11.08.32.18 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jan 2023 08:32:18 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Ks2Xu7NC; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1A-0001FU-61; Wed, 11 Jan 2023 11:32:00 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe18-0001F4-DM for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:31:58 -0500 Received: from mail-wm1-x332.google.com ([2a00:1450:4864:20::332]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe16-0006BP-RY for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:31:58 -0500 Received: by mail-wm1-x332.google.com with SMTP id k22-20020a05600c1c9600b003d1ee3a6289so13127007wms.2 for ; Wed, 11 Jan 2023 08:31:56 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=mYffee02pGXsDaWEK6vxcHOMS52J5/C+ETdo1/oigCU=; b=Ks2Xu7NCVAGfIFkzDPbgINU73TtdKiS+26nh4ZR/niaw4OnmjeQgpAm15D+HV4iNTj SG5adEyerflqWOnzefO68YDCWB5AcrAjemROlSXvfchQqLaQqZ/MLppO3nm83g6LBIA2 0h3RzqCCSfQsCi9RTgEnpGTaa+hW5FbEN7EQzcXJqAbDQ7lR5kyKY/7uqxCv6ogVm1gB uYXcpgOJJXq8wGImx0uNJr62HKw8lPJyZLKcmG8KU0fe3olrypd6Etb5EJYWlW2HC4GE laEMFKniML349jUcb3HYIOa7iDpXpn5pZJRVXcuRenV0hu28odU2YtvoQmeZWQhjRIYj acGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=mYffee02pGXsDaWEK6vxcHOMS52J5/C+ETdo1/oigCU=; b=ZaszEbjD8valSMDcAeRu2aUfaEHm7s4KZi6JzTFwif7n6QgItCje3cToS7DTLS9TG5 Px8RgforvH+nA8qTWdjFaJUxAEFQXvqTeLsRW0UzRkwyRqUFlUL1kkXpbp1LXYUNdybr ychC9vy6mCwzI2RG8kkNvaDFqBjCiWRmdUNVOmo8+SQD/5h5HoSTtaLB7Mh+yJ3yvGHE 0dor97DJnkAoRvnBGuIFO9rMFv5QVon7DPbQbQjtXEIWkN4SMFVuL9964ij3G27eAAVw EwhKU6JPp3pRam2TvhGWGyokX+heonENaTvQxLgHwLPSPIZgzrvyG38IDT2F+V8+yrIh A5wA== X-Gm-Message-State: AFqh2kouCIH/Zk0UfqmyJdqV2DxBdqzET3Q7GGhQBaXxJ06AMWFRryjV hYIk8r/9p1i9UWvxYbnU8+XacvOQUNX4tk7T X-Received: by 2002:a05:600c:3b90:b0:3d1:f0f1:ceb4 with SMTP id n16-20020a05600c3b9000b003d1f0f1ceb4mr52762995wms.19.1673454715084; Wed, 11 Jan 2023 08:31:55 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id l14-20020a05600c1d0e00b003da105437besm801426wms.29.2023.01.11.08.31.53 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:31:54 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 1/6] qemu/bswap: Replace bswapXX() by compiler __builtin_bswap() Date: Wed, 11 Jan 2023 17:31:42 +0100 Message-Id: <20230111163147.71761-2-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::332; envelope-from=philmd@linaro.org; helo=mail-wm1-x332.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Use the compiler built-in function to byte swap values, as the compiler is clever and will fold constants. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bswap.h | 31 ++++++------------------------- 1 file changed, 6 insertions(+), 25 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 346d05f2aa..ca2b4c3f15 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -37,31 +37,12 @@ static inline uint64_t bswap64(uint64_t x) #endif #ifdef BSWAP_FROM_FALLBACKS -static inline uint16_t bswap16(uint16_t x) -{ - return (((x & 0x00ff) << 8) | - ((x & 0xff00) >> 8)); -} - -static inline uint32_t bswap32(uint32_t x) -{ - return (((x & 0x000000ffU) << 24) | - ((x & 0x0000ff00U) << 8) | - ((x & 0x00ff0000U) >> 8) | - ((x & 0xff000000U) >> 24)); -} - -static inline uint64_t bswap64(uint64_t x) -{ - return (((x & 0x00000000000000ffULL) << 56) | - ((x & 0x000000000000ff00ULL) << 40) | - ((x & 0x0000000000ff0000ULL) << 24) | - ((x & 0x00000000ff000000ULL) << 8) | - ((x & 0x000000ff00000000ULL) >> 8) | - ((x & 0x0000ff0000000000ULL) >> 24) | - ((x & 0x00ff000000000000ULL) >> 40) | - ((x & 0xff00000000000000ULL) >> 56)); -} +#undef bswap16 +#define bswap16(_x) __builtin_bswap16(_x) +#undef bswap32 +#define bswap32(_x) __builtin_bswap32(_x) +#undef bswap64 +#define bswap64(_x) __builtin_bswap64(_x) #endif #undef BSWAP_FROM_BYTESWAP From patchwork Wed Jan 11 16:31:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641257 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3348536pvb; Wed, 11 Jan 2023 08:33:16 -0800 (PST) X-Google-Smtp-Source: AMrXdXvaSSsTPO4zNRqOFKdLqDInctQntTtjBQf3KzCWci+1ZvRk2pSkOX+yaUz8isBFXOizQ7hP X-Received: by 2002:a05:7500:f83:b0:ef:b331:8cdb with SMTP id km3-20020a0575000f8300b000efb3318cdbmr3929384gab.3.1673454796606; Wed, 11 Jan 2023 08:33:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454796; cv=none; d=google.com; s=arc-20160816; b=VRVsWBfQweyJnjCcWkDiz+LnpGhuSoqLaGSkn2OEl/PdiZkVYhia+ehEnuwVfVKo3l TDPazx4tG5dSvxZOO00kroOyhqcmmQbPXyhhg+qevOU+eS9SPvgJGZIGjc0Bq0nbuHro hBQSENLa3kS/NKUNeNj8zjarbiBQNaq9HXYulfrDdhkvkhQ4BS1st0xcvgnmCrI++7G8 18VTnkMSrCgHsySQYC3OxkFhhkrZGB+nIudqoZOvcGiRz8h6TmLKxaKkA50jLFNYBCGL XdavvA57gVyz5rzmOEYj/bOvdQVxWuWYESWoEDnitzT5sjKXVSJ0Dr+3VKOQdq4qOqkX gZXQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=uVJHo1RDCZd+0bip3XyoLTSOXBE2Nvo0/rlUOGzHDIg=; b=VeK9CLZzpylyIHOxFz5Z8IcIiHdq3k/QNHpg9C1yxvIkrT+qO0XRfZVJggHJ7WMTbN vjCQQOuUPOFNN3nYqnI1CteEOpzpn+vl0Et/G89JNrvECbpuhlcp4emminAkYkELYuWu Njz+d4tMpA/fqoyJyGuHRDg3QzruuzK8xdhkmSvXOBvq6nz+mGVM5spRB0DsyQtk46zu l2xrstcN8FbvgY9ZusjgorSiglcPBcv4xFqQWtOw6wdWvIPm//x2+gYBTSuoMYbED3lY 6ScrpbP9iHFgqY+fhiPIk0vma17+zTRNedo4r9rnzB5x7BBr/DqfJ3g9AqU1zd3DStB8 PuOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pvv21SUV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTP id u13-20020a05620a430d00b006ff0d5b01a0si9006486qko.44.2023.01.11.08.33.16 for ; Wed, 11 Jan 2023 08:33:16 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=Pvv21SUV; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1F-0001Fx-Iv; Wed, 11 Jan 2023 11:32:05 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe1D-0001Fn-BG for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:03 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe1B-0006By-Od for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:03 -0500 Received: by mail-wr1-x42b.google.com with SMTP id w1so15631621wrt.8 for ; Wed, 11 Jan 2023 08:32:01 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uVJHo1RDCZd+0bip3XyoLTSOXBE2Nvo0/rlUOGzHDIg=; b=Pvv21SUVaC83jCf0kh9CsUdXyavqI2tFaJM+ryj2mTV8yicuXA1+wXlwerBFxpyc3x 4IKuKo2/JNsR4DMn/AQYp4L7DDCDpwz82OBmJ6Wap0JV3BAqj5hk93BaTAWRQxrr8uH9 OAO2Qz0lmw58QW+QGvuCyHJUn+paEg+cPXyyyQrOcY9GdgUo+qM2rv6zBFEnz20pAdZ8 WNFsQ4opMJTNLwNoslrxR0VBR77EGcCqmUW7ImyqDQhVMsnbMzD3fqXKmTKZAwN4YaHN 6YW+rG+ShSsych9GzZtK9HKvsKCcoZkWuz7aFEMlYo4iaHMZO2iuIbPPu+76zQKhgAJl RhYQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uVJHo1RDCZd+0bip3XyoLTSOXBE2Nvo0/rlUOGzHDIg=; b=Rn8wvpgJVhv4O3JZnMuPh6GpIy+sxAjglIOUJeB9gliiIFpSMyFvuyExZVaFHQZF2N nCb3K/I/LfYhKULJUC97hgvp9RcFnjqlzAD3gvSgZmQVXnmSFFv06s5y1ieQ5iM5bPUZ gb+pRhq59iV62koG6WA1x0GOUh8aANzuSFo79nikQDUM5/d5iPAIv+dGzq9rGftOKr+e WE9I75Sagd5nRgQfxIk/72HA81/a8fsKQfIOl5CJDHWyAyFRrKOt909NUFARMzoi+AM7 4vqXGUq5HJxkUqMX4MaQgUTOopNunnEKJ6P0AGL1+4zpJHSDcYlhbRBvThm94wyh2wh6 1LiQ== X-Gm-Message-State: AFqh2kpvp2Sx14JLTW+dEMdUuGfTyB3YgfLvYrl90VwvOO2ZLC9CsH6Y XPLjYwAdihM7DrLvG7Ovr4lv9gAOVW4764C6 X-Received: by 2002:a5d:468f:0:b0:2bb:e868:6a45 with SMTP id u15-20020a5d468f000000b002bbe8686a45mr8408715wrq.56.1673454720251; Wed, 11 Jan 2023 08:32:00 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id bo30-20020a056000069e00b0027a57c1a6fbsm14373946wrb.22.2023.01.11.08.31.59 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:31:59 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 2/6] qemu/bswap: Replace bswapXXs() by compiler __builtin_bswap() Date: Wed, 11 Jan 2023 17:31:43 +0100 Message-Id: <20230111163147.71761-3-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bswap.h | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index ca2b4c3f15..d2dafdc54c 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -50,29 +50,31 @@ static inline uint64_t bswap64(uint64_t x) static inline void bswap16s(uint16_t *s) { - *s = bswap16(*s); + *s = __builtin_bswap16(*s); } static inline void bswap32s(uint32_t *s) { - *s = bswap32(*s); + *s = __builtin_bswap32(*s); } static inline void bswap64s(uint64_t *s) { - *s = bswap64(*s); + *s = __builtin_bswap64(*s); } #if HOST_BIG_ENDIAN #define be_bswap(v, size) (v) -#define le_bswap(v, size) glue(bswap, size)(v) +#define le_bswap(v, size) glue(__builtin_bswap, size)(v) #define be_bswaps(v, size) -#define le_bswaps(p, size) do { *p = glue(bswap, size)(*p); } while(0) +#define le_bswaps(p, size) \ + do { *p = glue(__builtin_bswap, size)(*p); } while (0) #else #define le_bswap(v, size) (v) -#define be_bswap(v, size) glue(bswap, size)(v) +#define be_bswap(v, size) glue(__builtin_bswap, size)(v) #define le_bswaps(v, size) -#define be_bswaps(p, size) do { *p = glue(bswap, size)(*p); } while(0) +#define be_bswaps(p, size) \ + do { *p = glue(__builtin_bswap, size)(*p); } while (0) #endif /** From patchwork Wed Jan 11 16:31:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641256 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3348042pvb; Wed, 11 Jan 2023 08:32:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXsPEcZQqIgcJSJ03VLSEXexLI0dMvM6gUBM31l7TdE7adpCMVZtJNuqM9ykW2Lv7JrZPMO+ X-Received: by 2002:a05:6871:4596:b0:151:ab38:1e75 with SMTP id nl22-20020a056871459600b00151ab381e75mr1605237oab.11.1673454740899; Wed, 11 Jan 2023 08:32:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454740; cv=none; d=google.com; s=arc-20160816; b=MY4ccgG7WT1bKCzVeapm8b86xzeo9r5XpqZfXDAzOXSXHeGbT1bwgUG6dbyvh+Dooc gI2t8lApFIrMhn68Vq5s6tY/+8o7jtkPmOpVCFpYyOA2QJAybgIapL//0lCPErJnV1MU S+yoSQJ86py6sBYvanMoOBz8+oZR4Cp2F+v/o36r7629wqPLlwBIj+pMjwdig4RMPoSB 9EODjJuui+mmaIT956vtFL1q/0jDZHZ9wgB9rtxKYpeBP4+bmwtZl7eH6SvgNlyRa9pL KR0r1he1OQt+Hri+jdqf7/mFAPiweZdu9NAM6+LRRbF2HQiJAXMUAzQEsEWJyxo27oKL b1Nw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=3zyYlmMr7+ydHjPpWElbYHyC0T5f+cMjb1tNVSE7zFk=; b=EOPwDVOqpMC0cNH3yj+kbx+V9FSS2jR/7Hmvm892S1WVOa+JUcXyB2qNdfwaR1Ln1A ouwGlmy8x5+ea2ioswVZokEuqzwaJboN6/11Km1xJanc2H9PR0K79pwSBwhU3+Hb1TB9 4qPJzTi2QauAfFwsOBcs8G0ZZmOqHgwEzj5SL0OtG4W4pSfZBkkhPpbth2ObdoPx6SyP TSNQ9wnRK7D4BtOT35ya6nTee3vOsbp3TR4m7hbHWOC81qSRRZ4CK9GBY100Zkp7IGGW 9/VyG/XqW2UsXDoXoWR9FWM5lLj/p8rJtFfICXwAkyWqLOnbW2WBIMuSpldQKDy8XAa2 MLzg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t0mD+0Bo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id u14-20020a05620a454e00b00704cf5d76f7si9165720qkp.511.2023.01.11.08.32.20 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Wed, 11 Jan 2023 08:32:20 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=t0mD+0Bo; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1L-0001Jg-1s; Wed, 11 Jan 2023 11:32:11 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe1I-0001Iu-Ok for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:08 -0500 Received: from mail-wm1-x32f.google.com ([2a00:1450:4864:20::32f]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe1G-0006CN-UO for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:08 -0500 Received: by mail-wm1-x32f.google.com with SMTP id o15so11496185wmr.4 for ; Wed, 11 Jan 2023 08:32:06 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=3zyYlmMr7+ydHjPpWElbYHyC0T5f+cMjb1tNVSE7zFk=; b=t0mD+0BoZzKXROIu3PFe/6wnv+KKrnl3R1XDZFEs38HFWC7iToiS15nsqdijtp5c3b ifJrPQxxnn8hmYvqGriRaPkO2DM6mozi+ZnJnq63u+t0VaCbIPSnTQWJ0NGGSgSwXtBj nM+sk/YrcT+kdNTEOIVybe4pl0/ZC+5KxnmkYwZ+H8QDsoIEjnYaHcZYL7oyObjfGp95 Wq08DK9CnKsQcjHX1Q0SqDbLg4N6VUwzEtVAFNukv1CI3FC3nQw+CJSx1cyyGRe81mj+ wY2lHavsUHgxZiJvTYsV2GiV5eu0LaBo78QzBGr0KzSo8MfY0s6tt8/W5XscoEY38yyl cyOw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=3zyYlmMr7+ydHjPpWElbYHyC0T5f+cMjb1tNVSE7zFk=; b=K82Xq3kzMC0wfdptGuS8EKxEZQPEVI15CInnBIcmF7lE4SLuQKSIGBorkQQeDaMefF ln4toi26HhGa+rsZOgSWsFoCvzU/x6GCViYkIhCo0uSo4y+kIV5MwJQmq+3iv1ArCjpD TzfQqXdJLdPihT1UlTaLutMTloRTrhUqw/LfbZw9vwVBdiPW4FhhWdjYVd0omRfuYq15 pLgqwH2PNrfFwe5zvqDx1Qytd2GjDE0Go1hIKmivvLnMzJ+8UcTNTQoAbGEEP6sw3s/n PPLok0+rDlCotAXK5p5weM7QH5DI1XwzZpJwcqjSzU8KbzVBZNtUr28Zw9CHrbuCv2BF YWMQ== X-Gm-Message-State: AFqh2kq3ffHKIcokfT4zIXOvJ+FRa18PdIRTklnkWef7rB2BbZUgNnYh gBUT67venqGs4PlNAOqXEPMkolsUWJTrPO2s X-Received: by 2002:a05:600c:4496:b0:3d3:47b7:569e with SMTP id e22-20020a05600c449600b003d347b7569emr51862586wmo.2.1673454725347; Wed, 11 Jan 2023 08:32:05 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id t10-20020a5d534a000000b00272c0767b4asm14261687wrv.109.2023.01.11.08.32.04 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:32:05 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Richard Henderson Subject: [PATCH v3 3/6] qemu/bswap: Remove dependency Date: Wed, 11 Jan 2023 17:31:44 +0100 Message-Id: <20230111163147.71761-4-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32f; envelope-from=philmd@linaro.org; helo=mail-wm1-x32f.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since commit efc6c070aca ("configure: Add a test for the minimum compiler version") the minimum compiler version required for GCC is 4.8, which supports __builtin_bswap(). Drop the dependency. Suggested-by: Richard Henderson Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bswap.h | 21 --------------------- meson.build | 2 -- 2 files changed, 23 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index d2dafdc54c..fd5a98125a 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -8,9 +8,6 @@ # include #elif defined(__HAIKU__) # include -#elif defined(CONFIG_BYTESWAP_H) -# include -#define BSWAP_FROM_BYTESWAP # else #define BSWAP_FROM_FALLBACKS #endif /* ! CONFIG_MACHINE_BSWAP_H */ @@ -19,23 +16,6 @@ extern "C" { #endif -#ifdef BSWAP_FROM_BYTESWAP -static inline uint16_t bswap16(uint16_t x) -{ - return bswap_16(x); -} - -static inline uint32_t bswap32(uint32_t x) -{ - return bswap_32(x); -} - -static inline uint64_t bswap64(uint64_t x) -{ - return bswap_64(x); -} -#endif - #ifdef BSWAP_FROM_FALLBACKS #undef bswap16 #define bswap16(_x) __builtin_bswap16(_x) @@ -45,7 +25,6 @@ static inline uint64_t bswap64(uint64_t x) #define bswap64(_x) __builtin_bswap64(_x) #endif -#undef BSWAP_FROM_BYTESWAP #undef BSWAP_FROM_FALLBACKS static inline void bswap16s(uint16_t *s) diff --git a/meson.build b/meson.build index 175517eafd..697059d2c8 100644 --- a/meson.build +++ b/meson.build @@ -2006,8 +2006,6 @@ if rdma.found() endif # has_header_symbol -config_host_data.set('CONFIG_BYTESWAP_H', - cc.has_header_symbol('byteswap.h', 'bswap_32')) config_host_data.set('CONFIG_EPOLL_CREATE1', cc.has_header_symbol('sys/epoll.h', 'epoll_create1')) config_host_data.set('CONFIG_FALLOCATE_PUNCH_HOLE', From patchwork Wed Jan 11 16:31:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641260 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3350470pvb; Wed, 11 Jan 2023 08:37:22 -0800 (PST) X-Google-Smtp-Source: AMrXdXvBbIO2hmH1KO7x6QTI5Bur7NLVsuz4WFfpy8hUn9QjLc9oNOthbDEbTjpI/CCHfAYu182n X-Received: by 2002:a05:622a:206:b0:3a7:eb36:5cb3 with SMTP id b6-20020a05622a020600b003a7eb365cb3mr131532936qtx.41.1673455042720; Wed, 11 Jan 2023 08:37:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673455042; cv=none; d=google.com; s=arc-20160816; b=GXsgpqVtA5Iqt1Q0/IqoPr5avvP/fW9huIrvfvUz1d6TDtkGUs4BaolUGUfujnY69k IqS96EkRW+MdUzYjJeNi1wTmBpoujGTxPwdVUvRm3TIP2EMMiQwUwZyfGXZQvK79+L7w CvN9KA4CBY1pK0U36dLngumAVcC7CbMI7Em+BYX4gh5lAx8YvDUXQABaV7Ogd8ZYO6u8 YKu1A8iF95RWBdCU8DYRQSyr4Ap+nIXG3c3UY9uuvxp+407lCTZ5fMACPKUuD/c88Pi5 POZgMGVVZpnyAQLAfXQT6+NjkI130SGgyJB6HsrzE4lXjyH/R+k3fNryKYNM54fT/3j2 qeug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=YrOBk17TMa2OWZz0SbjtOf4ZOsu6Ap5uvaat2NYfOGU=; b=hV+AafeuAz1RravD13H3hfZWEkWzbwYhMqgTk6mRGmqqIKopFePQb6FOx9UpPvMi6p DEUVMdDfglU/Vdc7BSS6n+gx/obLLxnZYFBN/9AnLASgNAj32KdEZrf8+X0nKGdR4IkJ jokYYeOEqNXFvHVKXFcy1DgSnNHUyN2ykFgX46maiHvFU7zoW7s4WRWRE4WbWuXZ9MpC Niao6MG+vHlMNnE0cQ4jn0yO8KKdFxErPLE2EVp5kfBV7wRJXwA+EVNadmkIbYL4XZge oUZ8QxpRx92oatXEFoDianoOpZG0ozI1jLTqwUdmg4rQold3hWdOfdlVBY4tuu/j2RGk kDkg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j98uTUob; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTP id f20-20020ac84994000000b003ab65b88860si8752046qtq.419.2023.01.11.08.37.22 for ; Wed, 11 Jan 2023 08:37:22 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=j98uTUob; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1P-0001Ko-74; Wed, 11 Jan 2023 11:32:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe1O-0001Kb-Cs for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:14 -0500 Received: from mail-wr1-x42b.google.com ([2a00:1450:4864:20::42b]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe1M-0006DA-5B for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:14 -0500 Received: by mail-wr1-x42b.google.com with SMTP id z5so14571668wrt.6 for ; Wed, 11 Jan 2023 08:32:11 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=YrOBk17TMa2OWZz0SbjtOf4ZOsu6Ap5uvaat2NYfOGU=; b=j98uTUob0WJmHtLZZ15lWN950JCotVwZSfoUbkTpeYNiQP4wEs/qDi6sdabZQbnooE w9AIelEvdKQD3SxTKGPAL3ao4eSJWl3OMdljno8scrgdK8crXrqnJwp7VinGien/m263 A7qOmHGP/wbtrejcX3aykbhc1L0/iC/F5txk3oVM2e4zIjkM3ogIVz2ZD/48CCLPOmSs KTp0uMj99dQ1HOypOKks4Sr7IfrJdFxTdUM+Dyve7bN2MhR7gTKhI/CL6tcaIpbgMWNN nBy/HfqgOtDTxnxr+hmadjAefXRfzDzyd/Akg5shY39vHfNQKxiu5F6mEjOwThIRcUw6 x5Fw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=YrOBk17TMa2OWZz0SbjtOf4ZOsu6Ap5uvaat2NYfOGU=; b=gVFShC59baP7RaCYnQBqCNTJ5G7E2V+pcZOboiI/klEyNy10ynabQowYVDPVYLENSY pBMgVZGo3Mclojf9UKuMpx/jllaBaxuygPM6NKHQWcon+V9QILsKkdxDNMOvZD36GrDK HcxvR+Uk+aSq/3MCFMXlz2IFqIN2rYBwDYuhp1dttLbohkOm8OR1jPpLJOj+YvCxxJhR yPyufFvI0BWZmUjSiIPJmp2bKesiUgZ2qGIzDJHK+sI+oyjUX80Y8UlNzaVv6atmvV5q JYj6yCXiMMPb1kH1Y0DYNhnfWvBguSeZez4WP0oiNRMIqg7o6Xt54/GMvh3aT2+tVPLj 5Jyg== X-Gm-Message-State: AFqh2kquXBeNw6btgJX6O4UrgSrLcgaY4puSdvWiNFDYangLqg1X3aJ6 oD/z+BIaPcRGOlsj/BNsz24byEMYcabwuaRl X-Received: by 2002:a05:6000:1f1b:b0:2b8:27df:d43f with SMTP id bv27-20020a0560001f1b00b002b827dfd43fmr21198814wrb.24.1673454730705; Wed, 11 Jan 2023 08:32:10 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id n13-20020a5d67cd000000b002bdcce37d31sm319808wrw.99.2023.01.11.08.32.09 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:32:10 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , David Carlier , Carlo Arenas Subject: [PATCH v3 4/6] qemu/bswap: Use compiler __builtin_bswap() on Haiku Date: Wed, 11 Jan 2023 17:31:45 +0100 Message-Id: <20230111163147.71761-5-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42b; envelope-from=philmd@linaro.org; helo=mail-wr1-x42b.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since commit efc6c070aca ("configure: Add a test for the minimum compiler version") the minimum compiler version required for GCC is 4.8, which supports __builtin_bswap(). Remove the Haiku specific ifdef'ry. This reverts commit 652a46ebba970017c7a23767dcc983265cdb8eb7 ("bswap.h: Include on Haiku for bswap operations"). Signed-off-by: Philippe Mathieu-Daudé --- Cc: David Carlier Cc: Carlo Arenas --- include/qemu/bswap.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index fd5a98125a..8cd5a2b02e 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -6,8 +6,6 @@ # include #elif defined(__FreeBSD__) # include -#elif defined(__HAIKU__) -# include # else #define BSWAP_FROM_FALLBACKS #endif /* ! CONFIG_MACHINE_BSWAP_H */ From patchwork Wed Jan 11 16:31:46 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641258 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3348663pvb; Wed, 11 Jan 2023 08:33:34 -0800 (PST) X-Google-Smtp-Source: AMrXdXv62aOkVj8bKEPRnqIBucwAblnDLNi+/wze7+C6cItdTtIP0h2N48AUkVhKuN9OaPPGG1dP X-Received: by 2002:a25:b7c3:0:b0:7c5:88f8:ff2 with SMTP id u3-20020a25b7c3000000b007c588f80ff2mr1073940ybj.4.1673454814478; Wed, 11 Jan 2023 08:33:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454814; cv=none; d=google.com; s=arc-20160816; b=YzCiSKh18HUNLqWiSwDBK5AzKLRmgb03RCse4KZXyjnPG6pJeziUWl/Wgzaostlxjh IctfuPWTO5zicZj39pwOCi6oJvGljgEm5VhMMWmWI+FkqjrU1oLLhQpyw+8rVNrlvqky XEEJ6R2GzRGetpn5nK0RfxmWkcu+32mN4fYvD6gcwtmp0ymk+IVe2M8Ca0l5zcA2lWyM xXLZT/UtYkOwRo/2lGEmaG238KNF1g7D+ZU/46m15PXp5tP6cepwgSr2yQz62zNGn9eD JiHzTwbng24GgneTW47CI87whNkXnVtcQidvY80QQrSN/HWNk7G1fc+Tp6o4feFbc2st Fx1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=yTlzIhdQXGUOdGXpzVVk0JZtLKwh1GWYTc0XjOdq0Rw=; b=GsrCzV4nQbn2X7wrg4dkbhDcgh5/Ity5Clh57UdM6krAclLkeOsvS9p4yvYMNbyZaL 3q7lzCY3AzlUjLGjRPczu5lQwcKppg1Raa15FUjp4BKBXibm+PYct+lWAEDm+cADLzD8 kA/CcmApoRL3l8aJ8lb2wZRXzE9Oas85Y55bNajgidUGhL7AWB6VJdv1z5FwSqDMeIpH ifwujG0TMbpWeF3Z0PxXIHNuD4jce0qCB1OaiuP841G0nseowTXVdYco8sHg7QiPUdrb ZUbsnDWc3TY2xFdkofc3hAqZ1OzG1uz+nCmtRZg9K7qA6yeZmAfGoKCn9ksrBOsUU2EP y/vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HhwMvMjZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTP id y188-20020a3796c5000000b006fcabffa6ddsi7843075qkd.725.2023.01.11.08.33.34 for ; Wed, 11 Jan 2023 08:33:34 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=HhwMvMjZ; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1j-0001RG-Bx; Wed, 11 Jan 2023 11:32:39 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe1S-0001NJ-US for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:21 -0500 Received: from mail-wr1-x42d.google.com ([2a00:1450:4864:20::42d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe1R-0006EC-9m for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:18 -0500 Received: by mail-wr1-x42d.google.com with SMTP id h16so15617757wrz.12 for ; Wed, 11 Jan 2023 08:32:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=yTlzIhdQXGUOdGXpzVVk0JZtLKwh1GWYTc0XjOdq0Rw=; b=HhwMvMjZefnlS3XTu7tLa78f6HUUKlfh85uF2QyzmYosgXHYEiaJnUjeAVrgILfPkD 4ian8UBPAUxls+YM+E2RWzgnh6Nn+DotQKmvxVFu5hSGRRrPotRHbMGBk8cYMWcbrsNH TT5yNuCbgbUyXGlp2lkLoolJIXk+h4oIuJG+DNoFEe5oqvPJEiXxK4X3SrF1CYIzs1Z/ 3hJybHdLWlYhuVTt4mJg8j7/s5tAQX9L63r+MJTWxgiuwGJhGpRWhJ5I5fBo++ejcQT6 SYoJRM1RLUQsuWhXW9cCk7yX1Pj6rbHgxLu/9uPM+yp+ZLSrmi3KLfMnWuKCqhrx0jX0 3guw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=yTlzIhdQXGUOdGXpzVVk0JZtLKwh1GWYTc0XjOdq0Rw=; b=eTjmCMDqT3cklpfwIDLaJLOe2bA7uAdhX01zan5P4aJuC7V/x6WTCtv6aU7av0hCCS zKK1pLdDrU/dXHRLo2wW5lH3tHOjKj03a9yrR/fsuoFOlSH8ZGkVUfX90E07U3OBKp6P YpffEnZrqJ4059sc3J6bMNPQgCWmHwcDFQyNZNx8nI14HTypWLAeQb22M7eh9BLwZYLf 9dPyKBHwXcbwI6ceCDT8gFNR3GbhnMt9uaXrSQu2m3Q3o9kKExk8AEHU6x/YdBnRBb/5 +SW28Zg0afFDU7+KMtiWWD33WJUHfM+gidBIMMft0p2BUPPT1orL9D6sUqr6ohTAxd78 vyNQ== X-Gm-Message-State: AFqh2kqATS+w2nG2oOSrypOfVoLSKpGD/BO7exGq5UE61Gg42GChMXUy CohMgxJWBW1Nf/tqCMs3Dej1ai7xGiBlUc7+ X-Received: by 2002:a05:6000:a19:b0:2bd:c477:8d6b with SMTP id co25-20020a0560000a1900b002bdc4778d6bmr2174471wrb.42.1673454735773; Wed, 11 Jan 2023 08:32:15 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id k9-20020adfd229000000b002bdbef07f7csm3151033wrh.50.2023.01.11.08.32.14 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:32:15 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= , Ed Maste Subject: [PATCH v3 5/6] qemu/bswap: Use compiler __builtin_bswap() on FreeBSD Date: Wed, 11 Jan 2023 17:31:46 +0100 Message-Id: <20230111163147.71761-6-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::42d; envelope-from=philmd@linaro.org; helo=mail-wr1-x42d.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since commit efc6c070aca ("configure: Add a test for the minimum compiler version") the minimum compiler version required for GCC is 4.8, which supports __builtin_bswap(). Remove the FreeBSD specific ifdef'ry. This reverts commit de03c3164accc21311c39327601fcdd95da301f3 ("bswap: Fix build on FreeBSD 10.0"). Signed-off-by: Philippe Mathieu-Daudé --- Cc: Ed Maste --- include/qemu/bswap.h | 2 -- 1 file changed, 2 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 8cd5a2b02e..32d5cdec27 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -4,8 +4,6 @@ #ifdef CONFIG_MACHINE_BSWAP_H # include # include -#elif defined(__FreeBSD__) -# include # else #define BSWAP_FROM_FALLBACKS #endif /* ! CONFIG_MACHINE_BSWAP_H */ From patchwork Wed Jan 11 16:31:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 641259 Delivered-To: patch@linaro.org Received: by 2002:a17:522:f3c4:b0:4b4:3859:abed with SMTP id in4csp3349443pvb; Wed, 11 Jan 2023 08:35:10 -0800 (PST) X-Google-Smtp-Source: AMrXdXvxdhR5jWWN7s/I+9jF/IrXXQ5Vjesuz6yx+iOdg5Djzaj03dansI3xfHmteynLlqg4V+vl X-Received: by 2002:a05:622a:2609:b0:3a8:28b2:af69 with SMTP id ci9-20020a05622a260900b003a828b2af69mr106328765qtb.58.1673454910516; Wed, 11 Jan 2023 08:35:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673454910; cv=none; d=google.com; s=arc-20160816; b=hBL0gqEJmWRnrxOzwQU1QRXPKas3q2NR8qrTPM5ebgXGK5CoqM9ieVAisLXGw2pKtn ogJ/wfFWUtCHXBsgc/FwJ8FiaZs6+aaTwuWjxaTVa3HJPuhMpUHBdn0B/+A2ZC6XhqRr 26V6W5IMtach+SdtgailHFmH/ZFq7M2W5hCUKPOG1O3pQK2nilTG2LPK98Nl+f3R343M UhRfx26by+dv7/V7xJKdxZpOnNWz9tH6+k1JB2IpGs6RCKEY4i+/+0ZeuowlMGWiHblt gpDCbB+whJGCBlWrkWnEEL1rHWnzOlUrgCKzDiU8l0MhE3tUsF5nFBZqOYdasLXLrZG2 Lopg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=v80+rMsZqzMpEgzB1XIdOA1qaUJSrJqpOPE+0MZTyas=; b=wLeXl1OYoFRclRp4Z9i6xsShQ8bK1uFkQ558IHgwqZxKtDytrTsdOLuftQb4rHj7M4 aAT83/ktvXOjKmOmXYU32yKHmBgxobLTBJkQ+0podiOEMIh90TwD1dPAfIhiRi+e3UoT k/gpvFlgkOlMEgU88Qx/9NQNpvbZw+RmBTd2mH1CAhGDWbJ2v5eRE9RpVSlQDsKRpKQJ DSGG3ZNxDbveMPWUjyVXLtGuqUssmGuRdyJTBzZ3HJ9IIpe+lSYSML3b7rfEKvvwv5e5 Omw3yxgzDbMwfayBBiNZ9Zh9xsCHcEQlKYLUyyV4+GEmCYUxUtYoXjZC3DeAAX4R5XSD QV0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MyHtzkjy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTP id c11-20020ac853cb000000b003a7f3c46cffsi8335409qtq.716.2023.01.11.08.35.10 for ; Wed, 11 Jan 2023 08:35:10 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=MyHtzkjy; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1pFe1u-0001dY-Qt; Wed, 11 Jan 2023 11:32:48 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1pFe1Y-0001R1-Hf for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:25 -0500 Received: from mail-wm1-x32e.google.com ([2a00:1450:4864:20::32e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1pFe1W-0006FQ-LN for qemu-devel@nongnu.org; Wed, 11 Jan 2023 11:32:24 -0500 Received: by mail-wm1-x32e.google.com with SMTP id p3-20020a05600c1d8300b003d9ee5f125bso8310183wms.4 for ; Wed, 11 Jan 2023 08:32:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=v80+rMsZqzMpEgzB1XIdOA1qaUJSrJqpOPE+0MZTyas=; b=MyHtzkjyygiTCAVcn3ep3+8nAvsBulZumExrDF907CTi2vaY1xO+shI+Yk9K2yVV8c mHeUSPZ/jJt++BFhcl9Q/1tGRC/Xi2D5FLeekf5g/OGMle01D5BwphGfCdM8OgCWwwYE imlGElgWpm+mPOWoEfzDIr2swi3F99CvfLAB1imM5/BcRNnOq3srZq9SseFHIdnig8ow Cx/turtlMNkIMyn3jCK4opXREwctewZpevXJJiNuTOOitXyfrTT2f1dUU6qBt0WEASD7 jTTsKyOReRefshGcXBFT+bpgMmspko5gNAFTMEVEy76wAIvCDwel/QMDRK2gRuUScRmB JUNA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=v80+rMsZqzMpEgzB1XIdOA1qaUJSrJqpOPE+0MZTyas=; b=VI3VwuX4p8NlZhxEgWce6+JMvo4zO3lqQVK6n1NakNCYmmrJM3acpBZ8sUJYdvy9fl HoWXvymE1tjrop3dZ8K+SX/jPuF3AvrkqnTOFos35c98hI1IYFqRIaBTcCIt9dXX774x dj9fcEaO4byfuTpBXaYJTg8+B4dBTcO+U3/XkFWnLjjuDanNY3PKJAUsZP9xyICOtqfX hPqNGfA7wil2/X9nbgxr3yZCWUBGsVydfBtzWM6zdGH4tZXvvSMlWP2MkPzbIswkGjmI FwEf9OUf1QFarEGlt4O29KI7UpF4Zpuk3aF0loVWWm/ePlnzq/yLnLmTzoHaReotCGzn gvQg== X-Gm-Message-State: AFqh2krwUST1ukA/hzXVMI6UKYvVOnbnr/K7McadNbhYlcB4l6S4EqDh H9vHRl9doOjEIxxyMcitNTrRw5pghqb2Ymbw X-Received: by 2002:a05:600c:1e24:b0:3d0:8643:caf1 with SMTP id ay36-20020a05600c1e2400b003d08643caf1mr53781460wmb.16.1673454740806; Wed, 11 Jan 2023 08:32:20 -0800 (PST) Received: from localhost.localdomain ([81.0.6.76]) by smtp.gmail.com with ESMTPSA id z12-20020a05600c0a0c00b003cfa81e2eb4sm18720569wmp.38.2023.01.11.08.32.19 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 11 Jan 2023 08:32:20 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?utf-8?q?Marc-Andr=C3=A9_Lureau?= , Ryo ONODERA , =?utf-8?q?Daniel_P=2E_Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?utf-8?q?Philippe_Mathieu-?= =?utf-8?q?Daud=C3=A9?= Subject: [PATCH v3 6/6] qemu/bswap: Use compiler __builtin_bswap() on NetBSD Date: Wed, 11 Jan 2023 17:31:47 +0100 Message-Id: <20230111163147.71761-7-philmd@linaro.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20230111163147.71761-1-philmd@linaro.org> References: <20230111163147.71761-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32e; envelope-from=philmd@linaro.org; helo=mail-wm1-x32e.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org From: Philippe Mathieu-Daudé Since commit efc6c070aca ("configure: Add a test for the minimum compiler version") the minimum compiler version required for GCC is 4.8, which supports __builtin_bswap(). Remove the NetBSD specific ifdef'ry. This reverts commit 1360677cfe3ca8f945fa1de77823df21a77e4500 ("makes NetBSD use the native bswap functions"). Signed-off-by: Philippe Mathieu-Daudé --- include/qemu/bswap.h | 11 ----------- meson.build | 4 ---- 2 files changed, 15 deletions(-) diff --git a/include/qemu/bswap.h b/include/qemu/bswap.h index 32d5cdec27..3cbe52246b 100644 --- a/include/qemu/bswap.h +++ b/include/qemu/bswap.h @@ -1,27 +1,16 @@ #ifndef BSWAP_H #define BSWAP_H -#ifdef CONFIG_MACHINE_BSWAP_H -# include -# include -# else -#define BSWAP_FROM_FALLBACKS -#endif /* ! CONFIG_MACHINE_BSWAP_H */ - #ifdef __cplusplus extern "C" { #endif -#ifdef BSWAP_FROM_FALLBACKS #undef bswap16 #define bswap16(_x) __builtin_bswap16(_x) #undef bswap32 #define bswap32(_x) __builtin_bswap32(_x) #undef bswap64 #define bswap64(_x) __builtin_bswap64(_x) -#endif - -#undef BSWAP_FROM_FALLBACKS static inline void bswap16s(uint16_t *s) { diff --git a/meson.build b/meson.build index 697059d2c8..f2663cfc32 100644 --- a/meson.build +++ b/meson.build @@ -2023,10 +2023,6 @@ config_host_data.set('CONFIG_INOTIFY', cc.has_header_symbol('sys/inotify.h', 'inotify_init')) config_host_data.set('CONFIG_INOTIFY1', cc.has_header_symbol('sys/inotify.h', 'inotify_init1')) -config_host_data.set('CONFIG_MACHINE_BSWAP_H', - cc.has_header_symbol('machine/bswap.h', 'bswap32', - prefix: '''#include - #include ''')) config_host_data.set('CONFIG_PRCTL_PR_SET_TIMERSLACK', cc.has_header_symbol('sys/prctl.h', 'PR_SET_TIMERSLACK')) config_host_data.set('CONFIG_RTNETLINK',