From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 12655 invoked by alias); 4 Jun 2007 07:51:01 -0000 Received: (qmail 12608 invoked by uid 48); 4 Jun 2007 07:50:53 -0000 Date: Mon, 04 Jun 2007 07:51:00 -0000 Message-ID: <20070604075053.12607.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug target/32201] Can not allocate %xmm0 register for variable blend insn In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "pinskia at gcc dot gnu dot org" Mailing-List: contact gcc-bugs-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-bugs-owner@gcc.gnu.org X-SW-Source: 2007-06/txt/msg00177.txt.bz2 ------- Comment #3 from pinskia at gcc dot gnu dot org 2007-06-04 07:50 ------- > > Also it seems like you could use register asm("xmm0") to get the correct > > register to be used. > But please note that "c" argument is passed to the function via xmm2. So this is why GCC has register asm() extension is to get the correct register to be used. The code would look like: typedef float V4SFmode __attribute__((vector_size(16))); V4SFmode t (V4SFmode a, V4SFmode b, V4SFmode c) { V4SFmode ret; register V4SFmode c1 asm("xmm0"); c1 = c; asm ("blenvdps %0, %2, %3" : "=x" (ret) : "0" (a), "x" (b), "x" (c1)); return ret; } Since c1 is already in xmm0, the register allocator knows it cannot use a as xmm0 so there is still a move before the other move and after the asm. -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=32201