From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673454739; cv=none; d=zohomail.com; s=zohoarc; b=XlXBwDnIdgyR+udIx4iayJP7HfNf2gfnd4BGRP1NSXH7oYSly1Ik/2lMxHBLr4R0ZCm7EZHA7Q/buV3TZRuDALa63BHPE4DU3qXf8eZSfAfvi2laJq/T19tVfx6D+kmamJ42nOo4vfEpho1mN0MXDv7bjbMGUK9itF4T+wc4GBw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673454739; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=mYffee02pGXsDaWEK6vxcHOMS52J5/C+ETdo1/oigCU=; b=fWsyHdR1gJGJCNYRdIcXyeYazX4khpFz3L6mqWomTUptaNY8Rxs5yc3QRdSHty+RVRFaBbOcgejx6dapfTz1Lk/qkoYhNGBsPFR7C98UO3jaWe/KzIekwT8kuN+dw3ICSQUbdUQF6E9NHRFGczDdiiUbMC6/8aAnIDV6ZlKuw/U= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673454739073888.1462409698464; Wed, 11 Jan 2023 08:32:19 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXvDcMYJ7YqMd8jkETn++un/h+TCUuRk87eI5N75q5wAu0Om76nQXC00Zb6iQj8ILYzsLX7RXg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673454739902100001 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 --- 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 =20 #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 =20 #undef BSWAP_FROM_BYTESWAP --=20 2.38.1 From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673454774; cv=none; d=zohomail.com; s=zohoarc; b=mr2WnknPouNDvPC1ThPjR04aYdx2FNDX61QHKcjdn3Bw6+rqdH99gek/aI8Oorm5J4Tbk7zmYeQWKMb3P7iIZGGxJlQVgrqetTYbxt1iJ4AaNrBRJ/gzvjYQIKI2cBCoPKBCEQboioGjxnMmjNH392BpHd1KYHKG3GXD5JTvcB8= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673454774; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=uVJHo1RDCZd+0bip3XyoLTSOXBE2Nvo0/rlUOGzHDIg=; b=c9R7aMyRc24Be2AzVPppJcsE70te1wVn5+Tn4NoT5YtjkaAjB7OF0jrdhl1ky9HS2182kZWnkyX0Ihul6I/eDemge/Y+BZqrCGFnhKwbJQt3UZowowoptyqquH2XVHTDieZgan/4jaNN05BMc25sVau0qqLPkaQ3Hsf4w2fdowY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673454774989427.68313583684926; Wed, 11 Jan 2023 08:32:54 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXvan/pzK9oYRt+r+g+7dqvl8XS8FAtZ3Aim81HeM8GuiewSN0YGmSUy4Qew5pHJGumor8hy5w== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673454776168100001 From: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Richard Henderson Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- 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) =20 static inline void bswap16s(uint16_t *s) { - *s =3D bswap16(*s); + *s =3D __builtin_bswap16(*s); } =20 static inline void bswap32s(uint32_t *s) { - *s =3D bswap32(*s); + *s =3D __builtin_bswap32(*s); } =20 static inline void bswap64s(uint64_t *s) { - *s =3D bswap64(*s); + *s =3D __builtin_bswap64(*s); } =20 #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 =3D glue(bswap, size)(*p); } while(0) +#define le_bswaps(p, size) \ + do { *p =3D 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 =3D glue(bswap, size)(*p); } while(0) +#define be_bswaps(p, size) \ + do { *p =3D glue(__builtin_bswap, size)(*p); } while (0) #endif =20 /** --=20 2.38.1 From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673454741; cv=none; d=zohomail.com; s=zohoarc; b=Io0DgxlPhdepeeIad8xOFMO38r/APHoF/Y9iSnY3dRjpAGK86nNMQ+sj3F+YbUEF0xwLa+WDmIh39dvvmvoPMn4ORJpZ/Q0Kp5M7hELzwIy/ToZO0ivFtP+z5ggpGVO70xqCrs75Gy1+vcYT5BhsX46SxXPBCsiRBcRMA/JySb4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673454741; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=3zyYlmMr7+ydHjPpWElbYHyC0T5f+cMjb1tNVSE7zFk=; b=W08gNoX8mqdwrIjAwGZkJ5X8oOzL1MnJ1a1k5k2P3EhPmRjZi1Enqd5HPfWHsvOS6bRsILwKrt4Hz8dYhIzRG1zu2vBUXyFkbC8n/WKLqdBb6jYP3CMQGGSx1klpHeC9k82LtTK9AqztyWgbgxvOqJooXnln4FnLRqlsjJxvFGM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673454741991502.881191342124; Wed, 11 Jan 2023 08:32:21 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXu+jkdPCbqmx0ptX/EklXkoKw22LC/oOrQkTQ9onj8jO5XceSzmfceSpip1zKCkPGdV3LVxWg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673454743915100007 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 --- 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 =20 -#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 =20 -#undef BSWAP_FROM_BYTESWAP #undef BSWAP_FROM_FALLBACKS =20 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 =20 # 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', --=20 2.38.1 From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673455026; cv=none; d=zohomail.com; s=zohoarc; b=BNDYl4bQgE6h14LvUinWqPKF3w2t7pIHg+gcxVhgGVGR3Uu0b8DbQd0JmkjflD5YYogHScdypoCvYZzqPYssLY8AeX+RVO67/hJ3Qe0OHxnPnf7LtfeVBlVqv8tksoImjKOwfQE7qXDhvcHkl4tvsJtOWx/J0MR99uevPQoDE3s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673455026; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=YrOBk17TMa2OWZz0SbjtOf4ZOsu6Ap5uvaat2NYfOGU=; b=CfbAJSpSt6eyogMA77E78IHYHpemNWsX7msdWFtwcazWDrGVbYrca26pwrt7CWsNrv8Oren7N9W0KoUBsLedhVpRUkfC1B9gH0sRW40HmdIgkWuS2qQtRWWq+FQsyofGUS4ckN+QkDyiIMe4oezZQbxO4UYERFDeLrPmLP5eeLI= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673455026849643.8047586452591; Wed, 11 Jan 2023 08:37:06 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXv68f3ENSiVKIEZN5HCP9jH5Fn+3cw4plSd00jXPANBFa2eZJjHBgWHY5nYz45PjvgOFUWCyg== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673455028790100001 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 Reviewed-by: Richard Henderson --- 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 */ --=20 2.38.1 From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673454789; cv=none; d=zohomail.com; s=zohoarc; b=nA1ANyK22JI4wWD4MyflP5z/R0wYG8cS53Do+fri/pXFz02/Q4+2Q8a8YWuEx2X2S9sazfvi5VVSgBQFJszWhcTY6alWF0pfN6C0xCsi//ZWc7XUncl68f9QOLY9E1Mz/afEqPEcUk19RypE26WV9igQyei/2yYzQKXaWM23tnE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673454789; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=yTlzIhdQXGUOdGXpzVVk0JZtLKwh1GWYTc0XjOdq0Rw=; b=awY3VX1WJ/0FAdM8KYsI1JWH3a9ZCgWcmyts1Zlkh44MwMfcewDmUdFX9JAKOiKK6/5baTeTvBhoequpFaCpz7uUELxVR9uUTSg/70YmkYNt00o+lge0k3vuI5r3lTmt1RoAENPp3TOxzNG/tvhrhqonu+HclExgcFqn5DMUyS0= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673454789002677.0614775015978; Wed, 11 Jan 2023 08:33:09 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXsRaRUCxxEmGHD8ecag6bc3ujcRPq/FUURFTYdsATcZqRNOZSOxWhzAYL49mIPpr4RIi0yASQ== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673454790173100001 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 Reviewed-by: Richard Henderson --- 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 */ --=20 2.38.1 From nobody Sun Dec 22 06:13:12 2024 Delivered-To: importer2@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1673454882; cv=none; d=zohomail.com; s=zohoarc; b=FRRaO0j3Yh5WnFtiMxxQjTNqB6xqotqB1R35ornxpEbplQJReiqIvjSPPUzFrkjFNQ9XKWfoyV0Zh49NmauYjbAJT1gL+S2lFCLBXNudvOlXxiXG09UuUoPjjeLXYXcTW1bS1AW+JSbudK5X1sHdhj6Xf+wzyYbtvhJWOJ8GztA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1673454882; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=v80+rMsZqzMpEgzB1XIdOA1qaUJSrJqpOPE+0MZTyas=; b=dat8gUTrOa1Ml7COANKCDaw0e520EkMwoOrw36JWjQdsocHfNcLbiGaX5UNuCkTI9uNPqlg7IbfKslmRItEiu7AOUIQrXtk8XWbh9/9YFgoRkifgl7BLTN7BM5+esqR5yP02WwquE97eIC8VC+0FCJB2d/mtHkuQqrAAzFKmXyY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer2=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1673454882857768.5224330810582; Wed, 11 Jan 2023 08:34:42 -0800 (PST) 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) 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) 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-Google-Smtp-Source: AMrXdXtr3VJCW/uvsr3K4TWxbo/nIhjr9HDiab2xmU2BFfc9Yn9mf3sa+D2FEbF81Px1WmXSNVhH+g== 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) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , Ryo ONODERA , =?UTF-8?q?Daniel=20P=2E=20Berrang=C3=A9?= , Thomas Huth , Ira Weiny , Paolo Bonzini , Kamil Rytarowski , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Reinoud Zandijk , Jonathan Cameron , =?UTF-8?q?Philippe=20Mathieu-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 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer2=patchew.org@nongnu.org; helo=lists.gnu.org; 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+importer2=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer2=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1673454884490100003 From: Philippe Mathieu-Daud=C3=A9 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=C3=A9 Reviewed-by: Richard Henderson --- 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 =20 -#ifdef CONFIG_MACHINE_BSWAP_H -# include -# include -# else -#define BSWAP_FROM_FALLBACKS -#endif /* ! CONFIG_MACHINE_BSWAP_H */ - #ifdef __cplusplus extern "C" { #endif =20 -#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 =20 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_TIMERSLAC= K')) config_host_data.set('CONFIG_RTNETLINK', --=20 2.38.1