From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 3290 invoked by alias); 25 Apr 2011 15:39:53 -0000 Received: (qmail 3281 invoked by uid 22791); 25 Apr 2011 15:39:52 -0000 X-SWARE-Spam-Status: No, hits=1.0 required=5.0 tests=AWL,BAYES_40,FSL_RU_URL,TW_XF,T_RP_MATCHES_RCVD X-Spam-Check-By: sourceware.org Received: from smtp.ispras.ru (HELO smtp.ispras.ru) (83.149.198.202) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Mon, 25 Apr 2011 15:39:36 +0000 Received: from ispserv.ispras.ru (ispserv.ispras.ru [83.149.198.72]) by smtp.ispras.ru (Postfix) with ESMTP id CDFAB5D40A0; Mon, 25 Apr 2011 19:37:50 +0400 (MSD) Received: from [10.10.3.58] (winnie.ispras.ru [83.149.198.236]) by ispserv.ispras.ru (Postfix) with ESMTP id 2E27D3FC48; Mon, 25 Apr 2011 19:39:35 +0400 (MSD) Message-ID: <4DB595B3.3080708@ispras.ru> Date: Mon, 25 Apr 2011 16:45:00 -0000 From: Dmitry Melnik User-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv:1.9.2.14) Gecko/20110223 Thunderbird/3.1.8 MIME-Version: 1.0 To: gcc-patches@gcc.gnu.org CC: Richard Earnshaw , Ramana Radhakrishnan , Andrey Belevantsev Subject: [PATCH, ARM] Reload register class fix for NEON constants Content-Type: multipart/mixed; boundary="------------040305030008000508050609" Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2011-04/txt/msg01972.txt.bz2 This is a multi-part message in MIME format. --------------040305030008000508050609 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1054 Hi All, The attached patch changes the reload class for NEON constant vectors from GENERAL_REGS to NO_REGS. The issue was found on this code from libevas: void _op_blend_p_caa_dp(unsigned *s, unsigned* e, unsigned *d, unsigned c) { while (d < e) { *d = ( (((((*s) >> 8) & 0x00ff00ff) * (c)) & 0xff00ff00) + (((((*s) & 0x00ff00ff) * (c)) >> 8) & 0x00ff00ff) ); //*d = (*s) & 0x00ff00ff; d++; s++; } } Original asm: .L4: adr r8, .L10 ldmia r8, {r8-fp} ... vmov d22, r8, r9 @ v4si vmov d23, sl, fp vand q12, q8, q11 ... bhi .L4 .L10: .word 16711935 @ 0xff00ff .word 16711935 .word 16711935 .word 16711935 Fixed asm: .L4: vmov.i16 q11, #255 @ v4si ... vand q12, q8, q11 bhi .L4 This fix results in +3.7% gain for expedite (reduced) test suite, and up to 15% for affected tests. Ok for trunk? -- Best regards, Dmitry --------------040305030008000508050609 Content-Type: text/x-diff; name="neon-reload-class-fix.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="neon-reload-class-fix.diff" Content-length: 711 2011-04-22 Sergey Grechanik * config/arm/arm.c (coproc_secondary_reload_class): Treat constant vectors the same way as memory locations to prevent loading them through the ARM general registers. --- a/gcc/config/arm/arm.c +++ b/gcc/config/arm/arm.c @@ -9152,7 +9152,7 @@ coproc_secondary_reload_class (enum machine_mode mode, rtx x, bool wb) /* The neon move patterns handle all legitimate vector and struct addresses. */ if (TARGET_NEON - && MEM_P (x) + && (MEM_P (x) || GET_CODE (x) == CONST_VECTOR) && (GET_MODE_CLASS (mode) == MODE_VECTOR_INT || GET_MODE_CLASS (mode) == MODE_VECTOR_FLOAT || VALID_NEON_STRUCT_MODE (mode))) --------------040305030008000508050609--