Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIRr1-0003SU-EM for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 10:09:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pIRr0-00081I-70 for pgsql-hackers@arkaria.postgresql.org; Thu, 19 Jan 2023 10:09:06 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pIRqz-000819-TA for pgsql-hackers@lists.postgresql.org; Thu, 19 Jan 2023 10:09:05 +0000 Received: from mail-wr1-x432.google.com ([2a00:1450:4864:20::432]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1pIRqy-0007rb-9x for pgsql-hackers@lists.postgresql.org; Thu, 19 Jan 2023 10:09:05 +0000 Received: by mail-wr1-x432.google.com with SMTP id r9so1331560wrw.4 for ; Thu, 19 Jan 2023 02:09:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=227aWKHri25ACpBT0Q23NRufYygSe8tS2cvlruywhRw=; b=VUBm/XqjydRLVf5Hl53Iov6T+s6H2Y6ReT9eKwL6MH3yA8b7RWU7AtRl+ebv5QD9DL MO5W2Syqs7Lcxj3UrnbO+gSO4JXd5uks/twwFh34jWa0asZzSjhRKSPthyLmKu/FMMVR Qm5odugDG2nPnWqGsGjFJDiFFBQ4d+TINJ26APNYffSa1XHGFz6EpjSMbS9zcbKr4KnM ffhuQkwjrhRMcoCL7Zu7PECzOuJraG8iN98w0QdbOmfE+w+TFrxlYWNhpaq30NwppcLx RZ51vsJylXpWpUcg2Fyq+DB1IQnx2p5gT/6CpF9nR4nltBKMKFZssWz4YeYc3/GDDOTF oHHw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=227aWKHri25ACpBT0Q23NRufYygSe8tS2cvlruywhRw=; b=IhHBHi16t8rB8MH22ZFdER3Dy64TosESeS8xeGao+jQMFcAAaw/sL7Qv+U/CQIZw6n kaaVHkIgbGVpAqAkTU/IvTd9aRh/U4PVUTXX4OnaG/ftoswVJltkVPAJRPWTrPkIXwrj 3xH5rBtv4hbOFjj2KsScFPh3o+umuHJfRpLhvKjXhUW0KQO1mgZbsh3k62p9QvoNdLml S9k7ZsuMOidDdif6H4Ot/DCOA/fc+nNxJM6Vb3lfhEDJzLNardw2nM2asVIy7o6XpsHl lxyskjh/3tOQs1KCf48s+3YwjTkCgIRasWIfOLW7zPiu295fPtVCi5GFE2L3oBhzmjQn 8T6g== X-Gm-Message-State: AFqh2kosB2E08WuaAbI9LdCTXMOdfGvKWn921MKawutYhHvd30gavY/O gaDcXiycWUXo5wHYKy44RtkRuA== X-Google-Smtp-Source: AMrXdXuad+pABJ3M6y8oA5ZBZXejcLGVWnUUDrr3w6eWXMYvAEYXxzVRuSRzryQ+16sG22Y8OVVBHQ== X-Received: by 2002:adf:f64a:0:b0:297:dd4a:9207 with SMTP id x10-20020adff64a000000b00297dd4a9207mr8676720wrp.10.1674122942908; Thu, 19 Jan 2023 02:09:02 -0800 (PST) Received: from [192.168.1.166] ([84.71.142.209]) by smtp.gmail.com with ESMTPSA id o7-20020a5d62c7000000b002bbeda3809csm27455303wrv.11.2023.01.19.02.09.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 19 Jan 2023 02:09:02 -0800 (PST) Message-ID: <44f6c1b6-d712-b69b-82f2-8c525f59aeff@linaro.org> Date: Thu, 19 Jan 2023 10:09:01 +0000 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.6.0 Subject: Re: [PATCH] Add native windows on arm64 support Content-Language: en-US To: Andres Freund Cc: Michael Paquier , Ian Lawrence Barwick , Tom Lane , Thomas Munro , Julien Rouhaud , PostgreSQL Hackers References: <20221105183136.hfxyl5dclxdcoyih@awork3.anarazel.de> <7ff7c416-fdfe-517f-a65c-9e5bd8ff8cec@linaro.org> <8d46c46d-66d3-758b-b686-de371e0ba8ca@linaro.org> <20221205181449.47mhosidtmotemdl@awork3.anarazel.de> <6cfaaf3c-7fb5-51c8-92cf-ceac6303ef66@linaro.org> <20230117225131.jeptl4axjlbk5glz@awork3.anarazel.de> From: Niyas Sait In-Reply-To: <20230117225131.jeptl4axjlbk5glz@awork3.anarazel.de> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 17/01/2023 22:51, Andres Freund wrote: > Hi, > > On 2022-12-16 10:52:23 +0000, Niyas Sait wrote: >> Subject: [PATCH v7] Enable postgres native build for windows-arm64 platform > >> elif host_cpu == 'arm' or host_cpu == 'aarch64' >> >> - prog = ''' >> + if cc.get_id() == 'msvc' >> + cdata.set('USE_ARMV8_CRC32C', false) >> + cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 1) >> + have_optimized_crc = true > > I dimly recall that windows might actually require the relevant extension on > arm? Do you mean we don't need the runtime checks for CRC ? CRC is an optional extension for ARMv8 base architecture. I am not sure if windows make it mandatory to have this implementation. > >> + else >> + prog = ''' >> #include > > I'd just make this include #ifdef _MSV_VER (or whatever it is). The code snippet is not used for MSVC part. I am not sure why we need to add the #ifdef _MSC_VER. >> int main(void) >> @@ -1960,18 +1966,19 @@ int main(void) >> } >> ''' >> >> - if cc.links(prog, name: '__crc32cb, __crc32ch, __crc32cw, and __crc32cd without -march=armv8-a+crc', >> - args: test_c_args) >> - # Use ARM CRC Extension unconditionally >> - cdata.set('USE_ARMV8_CRC32C', 1) >> - have_optimized_crc = true >> - elif cc.links(prog, name: '__crc32cb, __crc32ch, __crc32cw, and __crc32cd with -march=armv8-a+crc', >> - args: test_c_args + ['-march=armv8-a+crc']) >> - # Use ARM CRC Extension, with runtime check >> - cflags_crc += '-march=armv8-a+crc' >> - cdata.set('USE_ARMV8_CRC32C', false) >> - cdata.set('USE_ARMV8_CRC32C_WITH_RUNTIME_CHECK', 1) >> - have_optimized_crc = true >> + if cc.links(prog, name: '__crc32cb, __crc32ch, __crc32cw, and __crc32cd without -march=armv8-a+crc', >> + args: test_c_args) > > Seems like it'd be easier to read if you don't re-indent this, but just have > the cc.get_id() == 'msvc' part of this if/else-if. > Yes that looks better. will do it in next patch. Thanks Andres for the review. -- Niyas