From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.codeweavers.com (mail.codeweavers.com [4.36.192.163]) by sourceware.org (Postfix) with ESMTPS id DC8213858C62 for ; Fri, 23 Feb 2024 16:10:19 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.2 sourceware.org DC8213858C62 Authentication-Results: sourceware.org; dmarc=pass (p=none dis=none) header.from=codeweavers.com Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=codeweavers.com ARC-Filter: OpenARC Filter v1.0.0 sourceware.org DC8213858C62 Authentication-Results: server2.sourceware.org; arc=none smtp.remote-ip=4.36.192.163 ARC-Seal: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708704625; cv=none; b=nB3lWZKXItHIWXAmfe8M4Y8SYjmlX5iE5Pk6Oz/55EC5sT+d9GQY+C9dEMUe1K+C3vYHsz+IRRvDpRCR6yysC5I+ytc7uOBCL+gRHnHp91Qh00DjrvqXCqbl8inLi0o4hfEoS4xKpOYGB6yRt+c7iY2teSb6qqefmHP5WV57tmY= ARC-Message-Signature: i=1; a=rsa-sha256; d=sourceware.org; s=key; t=1708704625; c=relaxed/simple; bh=LCaocpp/3SUsQqrHfi6NbQm2ctKEW0fs6X9XepRlHQs=; h=DKIM-Signature:Message-ID:Date:MIME-Version:Subject:To:From; b=B7xYZTCMMGXudGDUwlJY+S8L8r4h4fxw16Ip7S87bIUWVE8jBhM+aEFIZt6cVP60zEhLn4JihmbmpmTCOPM85JSJ3vUxq3ld8AUkwtqpjXsoFVTx46P54O2xNrdeZIbZ6+nNYukeGYJZShrH/jjTBG6/quA4NYsB7gzvw9xMA1s= ARC-Authentication-Results: i=1; server2.sourceware.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=codeweavers.com; s=s1; h=From:Cc:To:Subject:Date:Message-ID:Sender; bh=yaLA4op7mEoAZsgSLlNEZCGvoQXsClHp6hNimaekVHM=; b=Og6DqjxbNxjI4TETVxBfMZ5m3M TALIMWZR2c+uZEuOBbxXkaLFZo1D6DT2Qw8pX7MmWsD9VueiusGwrVe3FMEKy39zKnFd4+X2WTQ9K JvcZzn6nxr41KiD2DXrYrQOWvoroj7WqdvuJqHfmPUp19ifNar6uoehqDYmb0Hy585DKV8+lloRDt s8dKJiCHNTeaAumFuFuXTSEaaqRa6cZ1OPL9s3sEFwO4ArKV/cdjCV5O9J4HSslMOkwQAaOfb8kj9 3S4+U4memgz2u+P2lnlRSmmjumqDjTeqycIvP0TsrqFeYXqARVecpAFsfmM7wE8HbXjB+oynUxgmJ 01af67gg==; Received: from cw141ip110.vpn.codeweavers.com ([10.69.141.110]) by mail.codeweavers.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1rdY7q-006Y5W-38; Fri, 23 Feb 2024 10:10:15 -0600 Message-ID: Date: Fri, 23 Feb 2024 17:10:12 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v1 03/13] aarch64: Mark x18 register as a fixed register for MS ABI To: Andrew Pinski , "Richard Earnshaw (lists)" Cc: Evgeny Karpov , "gcc-patches@gcc.gnu.org" , "richard.sandiford@arm.com" , "10walls@gmail.com" <10walls@gmail.com>, Maxim Kuvyrkov , "mark@harmstone.com" , Zac Walker , Ron Riddle , Radek Barton References: Content-Language: en-US From: Jacek Caban In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.0 required=5.0 tests=BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS,TXREP,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org List-Id: On 22.02.2024 18:45, Andrew Pinski wrote: > On Thu, Feb 22, 2024 at 3:56 AM Richard Earnshaw (lists) > wrote: >> On 21/02/2024 18:30, Evgeny Karpov wrote: >> +/* X18 reserved for the TEB on Windows. */ >> +#ifdef TARGET_ARM64_MS_ABI >> +# define FIXED_X18 1 >> +# define CALL_USED_X18 0 >> +#else >> +# define FIXED_X18 0 >> +# define CALL_USED_X18 1 >> +#endif >> >> I'm not overly keen on ifdefs like this (and the one below), it can get quite confusing if we have to support more than a couple of ABIs. Perhaps we could create a couple of new headers, one for the EABI (which all existing targets would then need to include) and one for the MS ABI. Then the mingw port would use that instead of the EABI header. >> >> An alternative is to make all this dynamic, based on the setting of the aarch64_calling_abi enum and to make the adjustments in aarch64_conditional_register_usage. > Dynamically might be needed also if we want to support ms_abi > attribute and/or -mabi=ms to support the wine folks. Wine no longer needs ms_abi, it was needed for PE-in-ELF modules in the past. We use use proper PE files now, so we need a cross compiler, but no special attributes. aarch64-w64-mingw32 is already well supported by Wine when using llvm-mingw, so as soon as GCC properly supports the ABI, Wine should just work with it, in theory. I didn't try it, but I don't see things like vararg support in this patchset nor in the repo, so I assume it won't work yet. Thanks for the work! Jacek