Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v1TUU-0092qZ-IM for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Sep 2025 17:41:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1v1TUS-00EtuS-SH for pgsql-hackers@arkaria.postgresql.org; Wed, 24 Sep 2025 17:41:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v1TUS-00EtuJ-J5 for pgsql-hackers@lists.postgresql.org; Wed, 24 Sep 2025 17:41:16 +0000 Received: from mail-il1-x135.google.com ([2607:f8b0:4864:20::135]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1v1TUP-002Dsm-2d for pgsql-hackers@postgresql.org; Wed, 24 Sep 2025 17:41:15 +0000 Received: by mail-il1-x135.google.com with SMTP id e9e14a558f8ab-42575d462cfso310335ab.2 for ; Wed, 24 Sep 2025 10:41:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1758735673; x=1759340473; darn=postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date:from:to :cc:subject:date:message-id:reply-to; bh=n9d2MItajEKnrAHeJXGDYkrlVBf/tdtLji8u9p5Hi5w=; b=B6ZXUkIkJraclwUJm0UgwxzFI1HeJJQ9b3C2Pg+GjrqiE6LABkEVefCw3LES2BUdnT EwB3uUQo2i21YOPKSiGEOgOihc4JQlutQgHs1XSPuRc8358PZOtwQcfWAuUgPHmQkOa0 dFVdH6kU8jQmCVYXTHSIwbwDqO8y7bqP/A5shdPKsa8t5GuNAFmb244g2W0mJ+d9ru9r iB02EgQmBLJ6Pc9yER1ytXreQ+ig4OEKJoUzAqDfMd48pct+R4rMnnRDLlOTliW+Z8pc 4klplmuCH8JAz6fOuQ7yuwGBs3afRcGLxhn/m5WzQFndNOFMCUO1Wnnm1YvEPZzUeI9m QNAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1758735673; x=1759340473; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=n9d2MItajEKnrAHeJXGDYkrlVBf/tdtLji8u9p5Hi5w=; b=RTm+BYSxL9/9Xw48nGoGTt4oJRnSpfHZhv7ZXdHrAo3AAfM5EaNy5L0O6LeEI2GqON mpMQqSxvdPi0Nofj9con/YbSbMCJ3N2oG8pd4NjTkGZcUmkl5NKhgXNMLM0vZU9nZnuc cX7/tXZJ5NnqzUsqeHAPDN2TcsEsmKZwXBm6ObiNAWkZHNVYffULKj/MNkZuWbRAujhi YZntG2pM+0WOfpirTPdoRSfexhPkzwDvpA1109kGZaudnycilYvCX8JLjUGd7SM4yBC6 7EuUgHRHld3UfCn9P0dVnxwRTLk6EiMqjccBBEHAIkxGkpmUomg2RAw23ir34GnybhJl HRag== X-Gm-Message-State: AOJu0Yy8u/0fpHrxnXaShmrAE4VhvbSS6RbElt8WXbI1pv6BofqiVLQP yeah3rORzwc1+ShgCE4x0opvwsXusT3oE2F2BdgqHkJcs8t3HOQEFBRw X-Gm-Gg: ASbGncsEGqwyhxnMbyo4320PL1UUNZ5v8jIwRSIhQtlyeLUM7wQ1HjhanB60PII9AHs EN1RKPp9EdkJ5qN+KU+si7DnFxGSVAje4o/NPlA+ZbBS237BtxyXjqDoLZ9r5pe3eUx0BbNMbju zegJWwfj9l17u4GeeC+wISsBI6IKzP5M80anx4UZHL3erKzJUJuXaTEzzMHesVy12FXnvrGNkDO hmNnAf6SPquNGnUTZ62uqpkTlny9Lcg76bVEoFzBdWXr4XgvPPBNqD+VXyim7rgl5makve7eV58 7WjZP+zEDPKI9AlYseaZNB5iXA7HLy0xnFahw+s8AAlDushf3oSYRiJv1gRHaM9vjMvNc0GLLOL s2BkLh3aLAs6jYI9TYJV/uHj1/kofmI//ODZp063v51RGS8huni11k+5BLprGOzAefdnn23Xfqf e7F1D0q+PReCiV X-Google-Smtp-Source: AGHT+IGPnwKb6wH/J3QXz6sP/GV5NAGx/PwL/O2w8rbQeM807ruwYrCL2tOQmh0AmSNuA4MIeGeDBw== X-Received: by 2002:a05:6e02:1a23:b0:424:89fd:73d6 with SMTP id e9e14a558f8ab-4259560a64cmr8070025ab.14.1758735673054; Wed, 24 Sep 2025 10:41:13 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 8926c6da1cb9f-566d5c05034sm1053018173.47.2025.09.24.10.41.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Sep 2025 10:41:12 -0700 (PDT) Date: Wed, 24 Sep 2025 12:41:11 -0500 From: Nathan Bossart To: John Naylor Cc: pgsql-hackers@postgresql.org Subject: Re: a couple of small patches for simd.h Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Sep 24, 2025 at 08:04:59AM +0700, John Naylor wrote: > On Tue, Sep 23, 2025 at 4:44 AM Nathan Bossart wrote: >> 0001 essentially reverts commit c6a43c2, and instead fixes the problem >> (MSVC dislikes casts to the same type) by omitting the cast in the >> problematic line in pg_lfind32(). While working on optimizing hex_encode() >> and hex_decode() [0], I noticed that implicit conversions sufficed. > > I don't remember why that cast was there, but I suggest testing on gcc > / aarch64 if you haven't already. Ah, I thought CI was testing that, but apparently it is not. After some basic testing in godbolt.org, I see that leaving out the cast makes gcc/arm64 unhappy, and adding the cast makes msvc/x64 unhappy. gcc has a -flax-vector-conversions option that fixes it, but the documentation for that option [0] cautions against using it. So, 0001 is bogus, and I need to figure out how to get the hex_{encode,decode} patches working for gcc/arm64... [0] https://gcc.gnu.org/onlinedocs/gcc/C-Dialect-Options.html#index-flax-vector-conversions -- nathan