From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 23390 invoked by alias); 4 Sep 2009 12:23:51 -0000 Received: (qmail 23381 invoked by uid 22791); 4 Sep 2009 12:23:50 -0000 X-SWARE-Spam-Status: No, hits=-2.5 required=5.0 tests=AWL,BAYES_00,SPF_PASS X-Spam-Check-By: sourceware.org Received: from fg-out-1718.google.com (HELO fg-out-1718.google.com) (72.14.220.157) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Fri, 04 Sep 2009 12:23:44 +0000 Received: by fg-out-1718.google.com with SMTP id 16so99247fgg.8 for ; Fri, 04 Sep 2009 05:23:42 -0700 (PDT) Received: by 10.86.12.2 with SMTP id 2mr4960507fgl.12.1252067021893; Fri, 04 Sep 2009 05:23:41 -0700 (PDT) Received: from yakj.usersys.redhat.com (nat-pool-brq.redhat.com [62.40.79.66]) by mx.google.com with ESMTPS id 12sm1950564fgg.27.2009.09.04.05.23.40 (version=TLSv1/SSLv3 cipher=RC4-MD5); Fri, 04 Sep 2009 05:23:41 -0700 (PDT) Message-ID: <4AA106CB.306@gnu.org> Date: Fri, 04 Sep 2009 12:23:00 -0000 From: Paolo Bonzini User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.1.1) Gecko/20090814 Fedora/3.0-2.6.b3.fc11 Lightning/1.0pre Thunderbird/3.0b3 MIME-Version: 1.0 To: =?ISO-8859-1?Q?Stefan_D=F6singer?= CC: gcc@gcc.gnu.org Subject: Re: MSVC hook function prologue References: <200909022245.51969.stefan@codeweavers.com> <200909041345.22952.stefan@codeweavers.com> <4AA0FE48.1040303@gnu.org> <200909041417.33085.stefan@codeweavers.com> In-Reply-To: <200909041417.33085.stefan@codeweavers.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Mailing-List: contact gcc-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-owner@gcc.gnu.org X-SW-Source: 2009-09/txt/msg00101.txt.bz2 >> 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