From: Paolo Bonzini <bonzini@gnu.org>
To: "Stefan Dösinger" <stefan@codeweavers.com>
Cc: gcc@gcc.gnu.org
Subject: Re: MSVC hook function prologue
Date: Fri, 04 Sep 2009 12:23:00 -0000 [thread overview]
Message-ID: <4AA106CB.306@gnu.org> (raw)
In-Reply-To: <200909041417.33085.stefan@codeweavers.com>
>> Yes, you need this:
>>
>> [(set (match_operand:SI 0 "register_operand" "=r")
>> (match_operand:SI 1 "register_operand" "r"))
>> (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)]
> That works, thanks!
>
> I just found the "=r" and "r" stuff myself almost at the same time your mail
> arrived. But what does the "SI" do? I haven't found
It specifies that the register must be 32-bit (SImode, Single-word
Integer mode). It just shuts up the warnings.
> Now the definition looks like this:
> (define_insn "vswapmov"
> [(parallel
> [(set (match_operand:SI 0 "register_operand" "=r")
> (match_operand:SI 1 "register_operand" "r"))
> (unspec_volatile [(const_int 0)] UNSPECV_VSWAPMOV)]
> )]
The parallel is implicit in define_insn, so it is not different. It
does not make any harm I guess, but it looks "weird" to a more familiar
eye. :-)
> ""
> "movl.s\t%1,%0"
> [(set_attr "length" "2")
> (set_attr "length_immediate" "0")
> (set_attr "modrm" "0")])
>
> I am still compiling, so I don't know if it works yet.
>
> I attached the current state of the whole patch. I added the attribute to the
> documentation, and generated the patch with function names this time.
Here:
+#ifdef HAVE_AS_IX86_SWAP
+ { "msvc_prologue", 0, 0, false, true, true, ix86_handle_abi_attribute },
+#endif
it's better to always provide the attribute, and call "sorry" in
ix86_function_msvc_prologue if you don't have the .s suffix.
Another two nits since I've found a more serious one: :-)
1) do not remove spurious lines.
RTX_FRAME_RELATED_P (insn) = 1;
-
insn = emit_move_insn (hard_frame_pointer_rtx, stack_pointer_rtx);
RTX_FRAME_RELATED_P (insn) = 1;
-
if (ix86_cfa_state->reg == stack_pointer_rtx)
2) extra long line, go to new line *before* ? and colon:
+ if (TARGET_64BIT ? is_attribute_p ("msvc_prologue", name) :
!is_attribute_p ("msvc_prologue", name))
Thanks!!
Paolo
next prev parent reply other threads:[~2009-09-04 12:23 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-09-02 20:46 Stefan Dösinger
2009-09-02 22:05 ` Paolo Bonzini
2009-09-02 22:27 ` Kai Tietz
2009-09-02 23:39 ` Paolo Bonzini
2009-09-03 7:50 ` Stefan Dösinger
2009-09-03 7:52 ` Paolo Bonzini
2009-09-04 11:45 ` Stefan Dösinger
2009-09-04 11:47 ` Paolo Bonzini
2009-09-04 12:18 ` Stefan Dösinger
2009-09-04 12:23 ` Paolo Bonzini [this message]
2009-09-04 12:50 ` Stefan Dösinger
2009-09-04 14:35 ` Stefan Dösinger
2009-09-05 12:43 ` Paolo Bonzini
2009-09-05 13:41 ` Stefan Dösinger
2009-09-06 9:36 ` Andreas Schwab
2009-09-08 20:12 ` Stefan Dösinger
2009-09-05 15:08 Ross Ridge
2009-09-06 9:16 ` Stefan Dösinger
2009-09-07 11:11 ` Paolo Bonzini
2009-09-07 14:27 Ross Ridge
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=4AA106CB.306@gnu.org \
--to=bonzini@gnu.org \
--cc=gcc@gcc.gnu.org \
--cc=stefan@codeweavers.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).