From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 9973 invoked by alias); 3 Dec 2004 17:42:02 -0000 Mailing-List: contact gcc-help-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Archive: List-Post: List-Help: Sender: gcc-help-owner@gcc.gnu.org Received: (qmail 9897 invoked from network); 3 Dec 2004 17:41:53 -0000 Received: from unknown (HELO postin.uv.es) (147.156.1.90) by sourceware.org with SMTP; 3 Dec 2004 17:41:53 -0000 Received: from morse.uv.es (morse.ci.uv.es [147.156.1.101]) by postin.uv.es (8.12.11/8.12.11) with ESMTP id iB3HfpcT029884; Fri, 3 Dec 2004 18:41:52 +0100 Received: from corral2.fisteo.uv.es (corral2.fisteo.uv.es [147.156.26.145]) (authenticated bits=0) by morse.uv.es (8.12.6/8.12.6) with ESMTP id iB3Hfl8H004804 (version=TLSv1/SSLv3 cipher=RC4-MD5 bits=128 verify=NO); Fri, 3 Dec 2004 18:41:48 +0100 From: David Palao Organization: Universidad de Valencia To: Thorsten Reinecke Subject: Re: problems with gcc inline assembly using xmm registers Date: Fri, 03 Dec 2004 17:42:00 -0000 User-Agent: KMail/1.5.3 References: <200412031628.53453.david.palao@uv.es> In-Reply-To: Cc: gcc-help@gcc.gnu.org MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200412031841.20752.david.palao@uv.es> X-SW-Source: 2004-12/txt/msg00045.txt.bz2 Thank you for the answer! > > I had some trouble using mmx and xmm registers, too. But my code works > now. See the attached code snippet. You can get an idea of how to use the > input list, output list and clobber list and also how to share xmm > registers between different asm inline blocks. > I will read it, but it looks hardcore to me (as I'm new in assembly) > You use only memory operands, so this shouldn't be a problem. But you > haven't declared any output. You're clobbering xmm registers, but you > don't tell the compiler that you do so. Maybe that's the problem. What's the problem if I don't need output operands? Concerning to clobbering part; well, I have tried clobbering xmm registers as well (I hope I did it right). For instance: __asm__ __volatile__ ("movsd %0, %%xmm3 \n\t" \ "movsd %1, %%xmm6 \n\t" \ "movsd %2, %%xmm4 \n\t" \ "movsd %3, %%xmm7 \n\t" \ "movsd %4, %%xmm5 \n\t" \ "unpcklpd %%xmm3, %%xmm3 \n\t" \ "unpcklpd %%xmm6, %%xmm6 \n\t" \ "unpcklpd %%xmm4, %%xmm4 \n\t" \ "mulpd %%xmm0, %%xmm3 \n\t" \ "unpcklpd %%xmm7, %%xmm7 \n\t" \ "mulpd %%xmm1, %%xmm6 \n\t" \ "unpcklpd %%xmm5, %%xmm5 \n\t" \ "mulpd %%xmm0, %%xmm4 \n\t" \ "addpd %%xmm6, %%xmm3 \n\t" \ "mulpd %%xmm2, %%xmm7 \n\t" \ "mulpd %%xmm0, %%xmm5 \n\t" \ "addpd %%xmm7, %%xmm4 \n\t" \ "movsd %5, %%xmm6 \n\t" \ "movsd %6, %%xmm7 \n\t" \ "unpcklpd %%xmm6, %%xmm6 \n\t" \ "unpcklpd %%xmm7, %%xmm7 \n\t" \ "mulpd %%xmm1, %%xmm6 \n\t" \ "mulpd %%xmm2, %%xmm7 \n\t" \ "addpd %%xmm6, %%xmm5 \n\t" \ "addpd %%xmm7, %%xmm3 \n\t" \ "movsd %7, %%xmm6 \n\t" \ "movsd %8, %%xmm7 \n\t" \ "unpcklpd %%xmm6, %%xmm6 \n\t" \ "unpcklpd %%xmm7, %%xmm7 \n\t" \ "mulpd %%xmm1, %%xmm6 \n\t" \ "mulpd %%xmm2, %%xmm7 \n\t" \ "addpd %%xmm6, %%xmm4 \n\t" \ "addpd %%xmm7, %%xmm5" \ : \ : \ "m" ((u).c11.real()), \ "m" ((u).c12.real()), \ "m" ((u).c21.real()), \ "m" ((u).c23.real()), \ "m" ((u).c31.real()), \ "m" ((u).c32.real()), \ "m" ((u).c13.real()), \ "m" ((u).c22.real()), \ "m" ((u).c33.real()) \ : \ "%xmm0", \ "%xmm1", \ "%xmm2", \ "%xmm3", \ "%xmm4", \ "%xmm5", \ "%xmm6", \ "%xmm7" ); BUT it doesn't work either way (with/without clobbering list). Any idea??? Regards David