This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
[Patch][gas][arm] Set context table for '.arch_extension'
- From: Vladimir Murzin <vladimir dot murzin at arm dot com>
- To: binutils at sourceware dot org
- Cc: Richard Earnshaw <Richard dot Earnshaw at arm dot com>, nickc at redhat dot com
- Date: Wed, 27 Nov 2019 17:52:11 +0000
- Subject: [Patch][gas][arm] Set context table for '.arch_extension'
This patch fixes .arch_extension behaviour.
Currently, context table for '.arch_extension' is only set while
"-march" processing, but it is not set while .arch processing,
so following code is rejected
.syntax unified
.thumb
.arch armv8.1-m.main
.arch_extension mve.fp
unless -march=armv8.1-m.main is given.
gas/ChangeLog:
2019-11-27 Vladimir Murzin <vladimir.murzin@arm.com>
* config/tc-arm.c (s_arm_arch): Set selected_ctx_ext_table.
* gas/testsuite/gas/arm/mve-arch-ext.s: New.
* gas/testsuite/gas/arm/mve-arch-ext.d: New.
Build and regression tests all pass on arm-none-elf and arm-wince-pe
Ok for trunk?
>From e74ee9e66cd7e0291708d0ab3ea5903de221cf72 Mon Sep 17 00:00:00 2001
From: Vladimir Murzin <vladimir.murzin@arm.com>
Date: Fri, 22 Nov 2019 14:14:06 +0000
Subject: [Patch][gas][arm] Set context table for '.arch_extension'
This patch fixes .arch_extension behaviour.
Currently, context table for '.arch_extension' is only set while
"-march" processing, but it is not set while .arch processing,
so following code is rejected
.syntax unified
.thumb
.arch armv8.1-m.main
.arch_extension mve.fp
unless -march=armv8.1-m.main is given.
gas/ChangeLog:
2019-11-27 Vladimir Murzin <vladimir.murzin@arm.com>
* config/tc-arm.c (s_arm_arch): Set selected_ctx_ext_table.
* gas/testsuite/gas/arm/mve-arch-ext.s: New.
* gas/testsuite/gas/arm/mve-arch-ext.d: New.
---
gas/config/tc-arm.c | 1 +
gas/testsuite/gas/arm/mve-arch-ext.d | 7 +++++++
gas/testsuite/gas/arm/mve-arch-ext.s | 6 ++++++
3 files changed, 14 insertions(+)
create mode 100644 gas/testsuite/gas/arm/mve-arch-ext.d
create mode 100644 gas/testsuite/gas/arm/mve-arch-ext.s
diff --git a/gas/config/tc-arm.c b/gas/config/tc-arm.c
index 28dc624..c4ffeee 100644
--- a/gas/config/tc-arm.c
+++ b/gas/config/tc-arm.c
@@ -32633,6 +32633,7 @@ s_arm_arch (int ignored ATTRIBUTE_UNUSED)
if (streq (opt->name, name))
{
selected_arch = opt->value;
+ selected_ctx_ext_table = opt->ext_table;
selected_ext = arm_arch_none;
selected_cpu = selected_arch;
strcpy (selected_cpu_name, opt->name);
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.d b/gas/testsuite/gas/arm/mve-arch-ext.d
new file mode 100644
index 0000000..0c55b38
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.d
@@ -0,0 +1,7 @@
+# name: MVE context sensitive .arch_extension under no -march
+# objdump: -dr --prefix-addresses --show-raw-insn -marmv8.1-m.main
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> ea52 136f asrl r2, r3, #5
diff --git a/gas/testsuite/gas/arm/mve-arch-ext.s b/gas/testsuite/gas/arm/mve-arch-ext.s
new file mode 100644
index 0000000..bbbb9ee
--- /dev/null
+++ b/gas/testsuite/gas/arm/mve-arch-ext.s
@@ -0,0 +1,6 @@
+.syntax unified
+.thumb
+.arch armv8.1-m.main
+.arch_extension mve
+
+asrl r2, r3, #5
--
2.7.4