From owner-svn-src-all@FreeBSD.ORG Fri Jul 5 20:22:00 2013 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) by hub.freebsd.org (Postfix) with ESMTP id 85057648; Fri, 5 Jul 2013 20:22:00 +0000 (UTC) (envelope-from andrew@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) by mx1.freebsd.org (Postfix) with ESMTP id 5CFF410FB; Fri, 5 Jul 2013 20:22:00 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.7/8.14.7) with ESMTP id r65KM0Rl066873; Fri, 5 Jul 2013 20:22:00 GMT (envelope-from andrew@svn.freebsd.org) Received: (from andrew@localhost) by svn.freebsd.org (8.14.7/8.14.5/Submit) id r65KM0PH066872; Fri, 5 Jul 2013 20:22:00 GMT (envelope-from andrew@svn.freebsd.org) Message-Id: <201307052022.r65KM0PH066872@svn.freebsd.org> From: Andrew Turner Date: Fri, 5 Jul 2013 20:22:00 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r252837 - head/sys/arm/arm X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2013 20:22:00 -0000 Author: andrew Date: Fri Jul 5 20:21:59 2013 New Revision: 252837 URL: http://svnweb.freebsd.org/changeset/base/252837 Log: Fix the build with gcc. Gcc outputs pre-UAL asm and expects the ldcl instruction with a condition in the form ldcl, where the code produces the instruction in the UAL form ldcl. Work around this by checking if we are using clang or gcc and adjusting the instruction. While here correct the cmp instruction's value to include the # before the immediate value. Modified: head/sys/arm/arm/vfp.c Modified: head/sys/arm/arm/vfp.c ============================================================================== --- head/sys/arm/arm/vfp.c Fri Jul 5 20:13:00 2013 (r252836) +++ head/sys/arm/arm/vfp.c Fri Jul 5 20:21:59 2013 (r252837) @@ -195,10 +195,23 @@ vfp_restore(struct vfp_state *vfpsave) { u_int vfpscr = 0; + /* + * Work around an issue with GCC where the asm it generates is + * not unified syntax and fails to assemble because it expects + * the ldcleq instruction in the form ldcl, not in the UAL + * form ldcl, and similar for stcleq. + */ +#ifdef __clang__ +#define ldcleq "ldcleq" +#define stcleq "stcleq" +#else +#define ldcleq "ldceql" +#define stcleq "stceql" +#endif if (vfpsave) { __asm __volatile("ldc p10, c0, [%0], #128\n" /* d0-d15 */ - "cmp %0, 0\n" /* -D16 or -D32? */ - "ldcleq p11, c0, [%0], #128\n" /* d16-d31 */ + "cmp %0, #0\n" /* -D16 or -D32? */ + ldcleq" p11, c0, [%0], #128\n" /* d16-d31 */ "addne %0, %0, #128\n" /* skip missing regs */ "ldr %1, [%0]\n" /* set old vfpscr */ "mcr p10, 7, %1, cr1, c0, 0\n" @@ -225,13 +238,16 @@ vfp_store(struct vfp_state *vfpsave) tmp = fmrx(VFPEXC); /* Is the vfp enabled? */ if (vfpsave && tmp & VFPEXC_EN) { __asm __volatile("stc p11, c0, [%1], #128\n" /* d0-d15 */ - "cmp %0, 0\n" /* -D16 or -D32? */ - "stcleq p11, c0, [%1], #128\n" /* d16-d31 */ + "cmp %0, #0\n" /* -D16 or -D32? */ + stcleq" p11, c0, [%1], #128\n" /* d16-d31 */ "addne %1, %1, #128\n" /* skip missing regs */ "mrc p10, 7, %0, cr1, c0, 0\n" /* fmxr(VFPSCR) */ "str %0, [%1]\n" /* save vfpscr */ : "=&r" (vfpscr) : "r" (vfpsave), "r" (is_d32) : "cc"); } +#undef ldcleq +#undef stcleq + #ifndef SMP /* eventually we will use this information for UP also */ PCPU_SET(vfpcthread, 0);