From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28927 invoked by alias); 5 Jan 2010 04:17:22 -0000 Received: (qmail 28884 invoked by uid 48); 5 Jan 2010 04:17:05 -0000 Date: Tue, 05 Jan 2010 04:17:00 -0000 Message-ID: <20100105041705.28883.qmail@sourceware.org> X-Bugzilla-Reason: CC References: Subject: [Bug c/42596] Integer/Floating point vector casts generate XMM register moves from and to the same register In-Reply-To: Reply-To: gcc-bugzilla@gcc.gnu.org To: gcc-bugs@gcc.gnu.org From: "adam at consulting dot net dot nz" 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: 2010-01/txt/msg00480.txt.bz2 ------- Comment #4 from adam at consulting dot net dot nz 2010-01-05 04:17 ------- /* Workaround discovered! */ void test_int_vectors_containing_fp_data_using_local_reg_var_overlay() { //create local register variables of the required floating point type //(for the same global register variables) register xmm_2f64_t local_xmm_c __asm__("xmm6"); register xmm_2f64_t local_xmm_d __asm__("xmm7"); //same calculation upon the local register variables. No casts are required. local_xmm_c = local_xmm_c + local_xmm_d; //the local changes above will be optimised away unless the global register //variables are updated. The casts below should be a no-op as the local //register variables are aliased to the global register variables. xmm_c=(xmm_2i64_t) local_xmm_c; xmm_d=(xmm_2i64_t) local_xmm_d; } With this workaround generated code is still optimal when the global register variables have an integer vector type: 0000000000400550 : 400550: 66 0f 58 f7 addpd xmm6,xmm7 400554: c3 ret -- http://gcc.gnu.org/bugzilla/show_bug.cgi?id=42596