From: JonY <10walls@gmail.com>
To: Jakub Jelinek <jakub@redhat.com>
Cc: Uros Bizjak <ubizjak@gmail.com>,
"gcc-patches@gcc.gnu.org" <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH] i386: Make xmm16-xmm31 call used even in ms ABI
Date: Fri, 07 Feb 2020 10:57:00 -0000 [thread overview]
Message-ID: <2dffd53f-f301-256f-5520-6cce5c76b11d@gmail.com> (raw)
In-Reply-To: <20200206060745.GG17695@tucnak>
[-- Attachment #1.1: Type: text/plain, Size: 2421 bytes --]
On 2/6/20 6:07 AM, Jakub Jelinek wrote:
> On Thu, Feb 06, 2020 at 01:00:36AM +0000, JonY wrote:
>> On 2/4/20 11:42 AM, Jakub Jelinek wrote:
>>> Hi!
>>>
>>> On Tue, Feb 04, 2020 at 11:16:06AM +0100, Uros Bizjak wrote:
>>>> I guess that Comment #9 patch form the PR should be trivially correct,
>>>> but althouhg it looks obvious, I don't want to propose the patch since
>>>> I have no means of testing it.
>>>
>>> I don't have means of testing it either.
>>> https://docs.microsoft.com/en-us/cpp/build/x64-calling-convention?view=vs-2019
>>> is quite explicit that [xyz]mm16-31 are call clobbered and only xmm6-15 (low
>>> 128-bits only) are call preserved.
>>>
>>> Jonathan, could you please test this if it is sufficient to just change
>>> CALL_USED_REGISTERS or if e.g. something in the pro/epilogue needs tweaking
>>> too? Thanks.
>>
>> Is this patch testing still required? I just got back from traveling.
>
> Yes, our reading of the MS ABI docs show that xmm16-31 are to be call used
> (not preserved over calls), while in gcc they are currently handled as
> preserved across the calls.
>
> Jakub
>
--- original.s 2020-02-06 09:00:02.014638069 +0000
+++ new.s 2020-02-07 10:28:55.678317667 +0000
@@ -7,23 +7,23 @@
qux:
subq $72, %rsp
.seh_stackalloc 72
- vmovaps %xmm18, 48(%rsp)
- .seh_savexmm %xmm18, 48
+ vmovaps %xmm6, 48(%rsp)
+ .seh_savexmm %xmm6, 48
.seh_endprologue
call bar
vmovapd %xmm0, %xmm1
- vmovapd %xmm1, %xmm18
+ vmovapd %xmm1, %xmm6
call foo
leaq 32(%rsp), %rcx
- vmovapd %xmm18, %xmm0
- vmovaps %xmm0, 32(%rsp)
+ vmovapd %xmm6, %xmm0
+ vmovapd %xmm0, 32(%rsp)
call baz
nop
- vmovaps 48(%rsp), %xmm18
+ vmovaps 48(%rsp), %xmm6
addq $72, %rsp
ret
.seh_endproc
- .ident "GCC: (GNU) 10.0.0 20191024 (experimental)"
+ .ident "GCC: (GNU) 10.0.1 20200206 (experimental)"
.def bar; .scl 2; .type 32; .endef
.def foo; .scl 2; .type 32; .endef
.def baz; .scl 2; .type 32; .endef
GCC with the patch now seems to put the variables in xmm6, unfortunately
I don't know enough of AVX or stack setups to know if that's all that is
needed.
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
next prev parent reply other threads:[~2020-02-07 10:57 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-04 9:39 [PATCH] i386: Omit clobbers from vzeroupper until final [PR92190] Jakub Jelinek
2020-02-04 10:16 ` Uros Bizjak
2020-02-04 11:05 ` Jakub Jelinek
2020-02-04 11:13 ` Uros Bizjak
2020-02-04 11:24 ` Uros Bizjak
2020-02-04 12:06 ` Richard Sandiford
2020-02-04 12:23 ` Uros Bizjak
2020-02-08 1:50 ` Segher Boessenkool
2020-02-04 12:31 ` Jakub Jelinek
2020-02-04 12:39 ` Uros Bizjak
2020-02-04 13:13 ` Jakub Jelinek
2020-02-04 13:15 ` Uros Bizjak
2020-02-05 10:05 ` Jakub Jelinek
2020-02-05 10:12 ` Jakub Jelinek
2020-02-05 10:47 ` Uros Bizjak
2020-02-05 11:03 ` Jakub Jelinek
2020-02-05 11:11 ` Uros Bizjak
2020-02-05 11:24 ` Jakub Jelinek
2020-02-04 11:42 ` [PATCH] i386: Make xmm16-xmm31 call used even in ms ABI Jakub Jelinek
2020-02-06 1:00 ` JonY
2020-02-06 6:07 ` Jakub Jelinek
2020-02-07 10:57 ` JonY [this message]
2020-02-07 11:28 ` Jakub Jelinek
2020-02-08 8:24 ` JonY
2020-02-08 10:05 ` Jakub Jelinek
2020-02-08 10:32 ` Uros Bizjak
2020-02-08 10:34 ` Jakub Jelinek
2020-02-08 10:52 ` Jakub Jelinek
2020-02-08 12:52 ` Uros Bizjak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=2dffd53f-f301-256f-5520-6cce5c76b11d@gmail.com \
--to=10walls@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jakub@redhat.com \
--cc=ubizjak@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).