From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 99415 invoked by alias); 1 Dec 2017 14:40:19 -0000 Mailing-List: contact binutils-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: binutils-owner@sourceware.org Received: (qmail 99395 invoked by uid 89); 1 Dec 2017 14:40:18 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-25.5 required=5.0 tests=BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,KAM_LAZY_DOMAIN_SECURITY,KAM_LOTSOFHASH,KB_WAM_FROM_NAME_SINGLEWORD,T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 spammy=hlt X-HELO: foss.arm.com Received: from foss.arm.com (HELO foss.arm.com) (217.140.101.70) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with ESMTP; Fri, 01 Dec 2017 14:40:15 +0000 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.72.51.249]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 65E6880D; Fri, 1 Dec 2017 06:40:14 -0800 (PST) Received: from [10.2.206.52] (usa-sjc-imap-foss1.foss.arm.com [10.72.51.249]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 757183F236; Fri, 1 Dec 2017 06:40:13 -0800 (PST) To: Richard Earnshaw , Nick Clifton , Alan Modra , "binutils@sourceware.org" From: Thomas Preudhomme Subject: [PATCH, GAS] No IT usage deprecation for ARMv8-M Message-ID: Date: Fri, 01 Dec 2017 14:40:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A0ECE27C5EB109363B18CC0F" X-IsSubscribed: yes X-SW-Source: 2017-12/txt/msg00008.txt.bz2 This is a multi-part message in MIME format. --------------A0ECE27C5EB109363B18CC0F Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-length: 1329 Hi, Deprecations related to the use of the IT instruction introduced in Armv8-A do not apply to Armv8-M Baseline and mainline. However the warning logic do not distinguish between the various profiles and warn whenever the architecture version is 8. This patch adds a check to exclude M profile architectures from this warning. This works as expected when -march is specified on the command-line or a .arch/.cpu directive exist. However, in autodetection mode the CPU/architecture targeted is only known once the instructions have been all processed but this code is run when IT instruction is processed. It is therefore not possible to distinguish between Armv8-M and Armv8-A in that mode. The approach chosen here is not to warn in autodetection mode. The udf.d testcase that relied on that behavior to test deprecation warning for Armv8-A is therefore updated to explicitely pass -march=armv8-a. ChangeLog entry is as follows: *** gas/ChangeLog *** 2017-11-13 Thomas Preud'homme * config/tc-arm.c (it_fsm_post_encode): Do not warn if targeting M profile architecture or if in autodetection mode. * testsuite/gas/arm/udf.d: Assemble for Armv8-A explicitely. Testing: Ran testsuite targeting arm-none-eabi which shows no regression. Is this ok for master branch? Best regards, Thomas --------------A0ECE27C5EB109363B18CC0F Content-Type: text/x-patch; name="no_it_deprecation_v8m.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="no_it_deprecation_v8m.patch" Content-length: 17900 diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c index 128ab38db69b81ac75a3a43d103c3bfce8ae82c1..27329dc7c9244115ee1322a18669deb24104af12 100644 --- a/gas/config/tc-arm.c +++ b/gas/config/tc-arm.c @@ -18543,12 +18543,13 @@ it_fsm_post_encode (void) if (now_it.insn_cond && !now_it.warn_deprecated && warn_on_deprecated - && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8)) + && ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_v8) + && !ARM_CPU_HAS_FEATURE (cpu_variant, arm_ext_m)) { if (inst.instruction >= 0x10000) { as_tsktsk (_("IT blocks containing 32-bit Thumb instructions are " - "deprecated in ARMv8")); + "performance deprecated in ARMv8-A and ARMv8-R")); now_it.warn_deprecated = TRUE; } else @@ -18559,9 +18560,10 @@ it_fsm_post_encode (void) { if ((inst.instruction & p->mask) == p->pattern) { - as_tsktsk (_("IT blocks containing 16-bit Thumb instructions " - "of the following class are deprecated in ARMv8: " - "%s"), p->description); + as_tsktsk (_("IT blocks containing 16-bit Thumb " + "instructions of the following class are " + "performance deprecated in ARMv8-A and " + "ARMv8-R: %s"), p->description); now_it.warn_deprecated = TRUE; break; } @@ -18573,7 +18575,8 @@ it_fsm_post_encode (void) if (now_it.block_length > 1) { as_tsktsk (_("IT blocks containing more than one conditional " - "instruction are deprecated in ARMv8")); + "instruction are performance deprecated in ARMv8-A and " + "ARMv8-R")); now_it.warn_deprecated = TRUE; } } diff --git a/gas/testsuite/gas/arm/armv8-ar-bad.l b/gas/testsuite/gas/arm/armv8-ar-bad.l index ae9a3d1add9cb3839fb1202561f11afc0915af73..f70de3588315a54cd612e25fcfe8fcdf0be10dc1 100644 --- a/gas/testsuite/gas/arm/armv8-ar-bad.l +++ b/gas/testsuite/gas/arm/armv8-ar-bad.l @@ -10,7 +10,7 @@ .*:23: Error: immediate value out of range -- `hlt 0x10000' .*:24: Error: instruction cannot be conditional -- `hltne 0x1' .*:28: Error: immediate value out of range -- `hlt 64' -.*:30: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Miscellaneous 16-bit instructions +.*:30: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Miscellaneous 16-bit instructions .*:30: Error: instruction is always unconditional -- `hltne 0' .*:34: Error: r15 not allowed here -- `stlb pc,\[r0\]' .*:35: Error: r15 not allowed here -- `stlb r0,\[pc\]' diff --git a/gas/testsuite/gas/arm/armv8-ar-it-bad.l b/gas/testsuite/gas/arm/armv8-ar-it-bad.l index a69938dfce65f71ec231fd12813a1947f3cdf6c4..de3ed973a247ad148cf6282a8b4b54505fb311d6 100644 --- a/gas/testsuite/gas/arm/armv8-ar-it-bad.l +++ b/gas/testsuite/gas/arm/armv8-ar-it-bad.l @@ -1,18 +1,18 @@ .*: Assembler messages: -.*:6: IT blocks containing 32-bit Thumb instructions are deprecated in ARMv8 -.*:14: IT blocks containing more than one conditional instruction are deprecated in ARMv8 -.*:19: IT blocks containing more than one conditional instruction are deprecated in ARMv8 -.*:29: IT blocks containing 32-bit Thumb instructions are deprecated in ARMv8 -.*:35: IT blocks containing more than one conditional instruction are deprecated in ARMv8 -.*:39: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -.*:42: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Miscellaneous 16-bit instructions -.*:48: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Literal loads -.*:51: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Hi-register ADD, MOV, CMP, BX, BLX using pc -.*:54: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM +.*:6: IT blocks containing 32-bit Thumb instructions are performance deprecated in ARMv8-A and ARMv8-R +.*:14: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R +.*:19: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R +.*:29: IT blocks containing 32-bit Thumb instructions are performance deprecated in ARMv8-A and ARMv8-R +.*:35: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R +.*:39: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +.*:42: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Miscellaneous 16-bit instructions +.*:48: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Literal loads +.*:51: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Hi-register ADD, MOV, CMP, BX, BLX using pc +.*:54: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM .*:54: Error: r15 not allowed here -- `addeq r0,pc,pc' -.*:57: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM +.*:57: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM .*:57: Error: r15 not allowed here -- `addeq pc,r0,r0' -.*:60: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm -.*:64: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm -.*:67: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm -.*:71: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: ADD/SUB sp, sp #imm +.*:60: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: ADD/SUB sp, sp #imm +.*:64: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: ADD/SUB sp, sp #imm +.*:67: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: ADD/SUB sp, sp #imm +.*:71: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: ADD/SUB sp, sp #imm diff --git a/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l b/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l index 0da47017e4b0c75169cb3a3953b8d0b308f129ea..07261005b1262a6db468433e976cc9b8a531fffd 100644 --- a/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l +++ b/gas/testsuite/gas/arm/sp-pc-validations-bad-t-v8a.l @@ -1,48 +1,48 @@ [^:]*: Assembler messages: -[^:]*:27: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:27: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:27: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:27: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:27: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0\]' -[^:]*:28: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:28: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:28: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:28: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:28: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0,#0\]' -[^:]*:29: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:29: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:29: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:29: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:29: Error: branch must be last instruction in IT block -- `ldreq r15,\[sp\]' -[^:]*:30: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:30: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:30: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:30: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:30: Error: branch must be last instruction in IT block -- `ldreq r15,\[sp,#0\]' -[^:]*:31: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:31: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:31: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:31: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:31: Error: branch must be last instruction in IT block -- `ldreq.w r15,\[r0\]' -[^:]*:32: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:32: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:32: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:32: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:32: Error: branch must be last instruction in IT block -- `ldreq.w r15,\[r0,#0\]' -[^:]*:33: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:33: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:33: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:33: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:33: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0,#-4\]' -[^:]*:34: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:34: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:34: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:34: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:34: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0\],#4' -[^:]*:35: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:35: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:35: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:35: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:35: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0,#0\]!' -[^:]*:38: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:38: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:38: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:38: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:38: Error: branch must be last instruction in IT block -- `ldreq r15,label' -[^:]*:39: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:39: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:39: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:39: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:39: Error: branch must be last instruction in IT block -- `ldreq.w r15,label' -[^:]*:40: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:40: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:40: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:40: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:40: Error: branch must be last instruction in IT block -- `ldreq.w r15,\[pc,#-0\]' -[^:]*:43: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:43: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:43: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:43: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:43: Error: branch must be last instruction in IT block -- `ldreq r15,\[r0,r1\]' -[^:]*:44: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:44: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:44: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:44: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:44: Error: branch must be last instruction in IT block -- `ldreq.w r15,\[r0,r1\]' -[^:]*:45: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -[^:]*:45: IT blocks containing more than one conditional instruction are deprecated in ARMv8 +[^:]*:45: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +[^:]*:45: IT blocks containing more than one conditional instruction are performance deprecated in ARMv8-A and ARMv8-R [^:]*:45: Error: branch must be last instruction in IT block -- `ldreq.w r15,\[r0,r1,LSL#2\]' [^:]*:48: Error: r15 not allowed here -- `ldrb pc,\[r0,#4\]' [^:]*:51: Error: r15 not allowed here -- `ldrb.w pc,\[r0,#4\]' diff --git a/gas/testsuite/gas/arm/udf.d b/gas/testsuite/gas/arm/udf.d index db41080f415158d32396782627b10c8473216f9c..04e31451d6c368db220d1576c3042151810ef005 100644 --- a/gas/testsuite/gas/arm/udf.d +++ b/gas/testsuite/gas/arm/udf.d @@ -1,5 +1,6 @@ #objdump: -dr --prefix-addresses --show-raw-insn #name: UDF +#as: -march=armv8-a #error-output: udf.l .*: +file format .*arm.* diff --git a/gas/testsuite/gas/arm/udf.l b/gas/testsuite/gas/arm/udf.l index 2e154b6fc21051117c038c75cc00bc8b5e28aa95..21aff94de5194aaac0b33f07e1920a23f8380670 100644 --- a/gas/testsuite/gas/arm/udf.l +++ b/gas/testsuite/gas/arm/udf.l @@ -1,3 +1,3 @@ ^[^:]*: Assembler messages: -^[^:]*:16: IT blocks containing 16-bit Thumb instructions of the following class are deprecated in ARMv8: Short branches, Undefined, SVC, LDM/STM -^[^:]*:21: IT blocks containing 32-bit Thumb instructions are deprecated in ARMv8 +^[^:]*:16: IT blocks containing 16-bit Thumb instructions of the following class are performance deprecated in ARMv8-A and ARMv8-R: Short branches, Undefined, SVC, LDM/STM +^[^:]*:21: IT blocks containing 32-bit Thumb instructions are performance deprecated in ARMv8-A and ARMv8-R --------------A0ECE27C5EB109363B18CC0F--