From owner-svn-src-projects@FreeBSD.ORG Sat Nov 29 20:18:09 2014 Return-Path: Delivered-To: svn-src-projects@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B3D60D65; Sat, 29 Nov 2014 20:18:09 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 86C9D73; Sat, 29 Nov 2014 20:18:09 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.9/8.14.9) with ESMTP id sATKI9I1086735; Sat, 29 Nov 2014 20:18:09 GMT (envelope-from dim@FreeBSD.org) Received: (from dim@localhost) by svn.freebsd.org (8.14.9/8.14.9/Submit) id sATKI9DC086734; Sat, 29 Nov 2014 20:18:09 GMT (envelope-from dim@FreeBSD.org) Message-Id: <201411292018.sATKI9DC086734@svn.freebsd.org> X-Authentication-Warning: svn.freebsd.org: dim set sender to dim@FreeBSD.org using -f From: Dimitry Andric Date: Sat, 29 Nov 2014 20:18:09 +0000 (UTC) To: src-committers@freebsd.org, svn-src-projects@freebsd.org Subject: svn commit: r275265 - projects/clang350-import/contrib/llvm/lib/Target/ARM/AsmParser X-SVN-Group: projects MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-projects@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the src " projects" tree" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 29 Nov 2014 20:18:09 -0000 Author: dim Date: Sat Nov 29 20:18:08 2014 New Revision: 275265 URL: https://svnweb.freebsd.org/changeset/base/275265 Log: Pull in r214802 from upstream llvm trunk (by Renato Golin): Allow CP10/CP11 operations on ARMv5/v6 Those registers are VFP/NEON and vector instructions should be used instead, but old cores rely on those co-processors to enable VFP unwinding. This change was prompted by the libc++abi's unwinding routine and is also present in many legacy low-level bare-metal code that we ought to compile/assemble. Fixing bug PR20025 and allowing PR20529 to proceed with a fix in libc++abi. This enables assembling certain ARM instructions used in libgcc. Modified: projects/clang350-import/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Modified: projects/clang350-import/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp ============================================================================== --- projects/clang350-import/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Sat Nov 29 19:31:23 2014 (r275264) +++ projects/clang350-import/contrib/llvm/lib/Target/ARM/AsmParser/ARMAsmParser.cpp Sat Nov 29 20:18:08 2014 (r275265) @@ -3118,9 +3118,10 @@ static int MatchCoprocessorOperandName(S return -1; switch (Name[1]) { default: return -1; - // p10 and p11 are invalid for coproc instructions (reserved for FP/NEON) - case '0': return CoprocOp == 'p'? -1: 10; - case '1': return CoprocOp == 'p'? -1: 11; + // CP10 and CP11 are VFP/NEON and so vector instructions should be used. + // However, old cores (v5/v6) did use them in that way. + case '0': return 10; + case '1': return 11; case '2': return 12; case '3': return 13; case '4': return 14; @@ -3177,6 +3178,9 @@ ARMAsmParser::parseCoprocNumOperand(Oper int Num = MatchCoprocessorOperandName(Tok.getString(), 'p'); if (Num == -1) return MatchOperand_NoMatch; + // ARMv7 and v8 don't allow cp10/cp11 due to VFP/NEON specific instructions + if ((hasV7Ops() || hasV8Ops()) && (Num == 10 || Num == 11)) + return MatchOperand_NoMatch; Parser.Lex(); // Eat identifier token. Operands.push_back(ARMOperand::CreateCoprocNum(Num, S));