* gas/config/tc-arm.c (arm_ext_mp): Add.
authorMatthew Gretton-Dann <matthew.gretton-dann@arm.com>
Thu, 23 Sep 2010 15:18:19 +0000 (15:18 +0000)
committerMatthew Gretton-Dann <matthew.gretton-dann@arm.com>
Thu, 23 Sep 2010 15:18:19 +0000 (15:18 +0000)
(do_pld): Update comment.
(insns): Add support for pldw.
(arm_cpus): Update cortex-a5, cortex-a9, and cortex-a15 to support
MP extension.
(arm_extensions): Add 'mp' extension.
(aeabi_set_public_attributes): Emit correct build attribute when
MP extension is enabled.
* gas/doc/c-arm.texi: Update for MP extensions.
* gas/testsuite/gas/arm/arch7a-mp.d: Add.
* gas/testsuite/gas/arm/arch7ar-mp.s: Likewise.
* gas/testsuite/gas/arm/arch7r-mp.d: Likewise.
* gas/testsuite/gas/arm/armv2-mp-bad.d: Likewise.
* gas/testsuite/gas/arm/armv2-mp-bad.l: Likewise.
* gas/testsuite/gas/arm/attr-march-all.d: Update for MP extension.
* gas/testsuite/gas/arm/attr-march-armv7-a+mp.d: Add.
* gas/testsuite/gas/arm/attr-march-armv7-r+mp.d: Likewise.
* include/opcode/arm.h (ARM_EXT_MP): Add.
(ARM_ARCH_V7A_MP): Likewise.
* opcodes/arm-dis.c (arm_opcodes): Add support for pldw.
(thumb32_opcodes): Likewise.

16 files changed:
gas/ChangeLog
gas/config/tc-arm.c
gas/doc/c-arm.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/arch7a-mp.d [new file with mode: 0644]
gas/testsuite/gas/arm/arch7ar-mp.s [new file with mode: 0644]
gas/testsuite/gas/arm/arch7r-mp.d [new file with mode: 0644]
gas/testsuite/gas/arm/armv2-mp-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/armv2-mp-bad.l [new file with mode: 0644]
gas/testsuite/gas/arm/attr-march-all.d
gas/testsuite/gas/arm/attr-march-armv7-a+mp.d [new file with mode: 0644]
gas/testsuite/gas/arm/attr-march-armv7-r+mp.d [new file with mode: 0644]
include/opcode/ChangeLog
include/opcode/arm.h
opcodes/ChangeLog
opcodes/arm-dis.c

index 70015a0a373c02cbf144d4690d370389099c0d13..de459896edd5d61966ae30e57f17fbb5123f6be7 100644 (file)
@@ -1,3 +1,15 @@
+2010-09-23  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+       * config/tc-arm.c (arm_ext_mp): Add.
+       (do_pld): Update comment.
+       (insns): Add support for pldw.
+       (arm_cpus): Update cortex-a5, cortex-a9, and cortex-a15 to support
+       MP extension.
+       (arm_extensions): Add 'mp' extension.
+       (aeabi_set_public_attributes): Emit correct build attribute when
+       MP extension is enabled.
+       * doc/c-arm.texi: Update for MP extensions.
+
 2010-09-23  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
 
        * config/tc-arm.c (md_pseduo_table): Add .arch_extension directive.
index fde0bc47b2a8d13f3c6b92c949ef9614882e6a7f..6101c41fd247a7277fa089b9fa8a6ab1cfc05a4a 100644 (file)
@@ -197,6 +197,7 @@ static const arm_feature_set arm_ext_v7r = ARM_FEATURE (ARM_EXT_V7R, 0);
 static const arm_feature_set arm_ext_v7m = ARM_FEATURE (ARM_EXT_V7M, 0);
 static const arm_feature_set arm_ext_m =
   ARM_FEATURE (ARM_EXT_V6M | ARM_EXT_V7M, 0);
+static const arm_feature_set arm_ext_mp = ARM_FEATURE (ARM_EXT_MP, 0);
 
 static const arm_feature_set arm_arch_any = ARM_ANY;
 static const arm_feature_set arm_arch_full = ARM_FEATURE (-1, -1);
@@ -7955,8 +7956,9 @@ do_pkhtb (void)
 }
 
 /* ARMv5TE: Preload-Cache
+   MP Extensions: Preload for write
 
-    PLD <addr_mode>
+    PLD(W) <addr_mode>
 
   Syntactically, like LDR with B=1, W=0, L=1.  */
 
@@ -17137,6 +17139,13 @@ static const struct asm_opcode insns[] =
  TUF("pli",    450f000, f910f000, 1, (ADDR),     pli,      t_pld),
  TCE("dbg",    320f0f0, f3af80f0, 1, (I15),      dbg,      t_dbg),
 
+#undef ARM_VARIANT
+#define ARM_VARIANT    & arm_ext_mp
+#undef THUMB_VARIANT
+#define THUMB_VARIANT  & arm_ext_mp
+
+ TUF("pldw",   410f000, f830f000, 1, (ADDR),   pld,    t_pld),
+
 #undef  ARM_VARIANT
 #define ARM_VARIANT  & fpu_fpa_ext_v1  /* Core FPA instruction set (V1).  */
 
@@ -22372,14 +22381,14 @@ static const struct arm_cpu_option_table arm_cpus[] =
   {"arm1156t2f-s",     ARM_ARCH_V6T2,   FPU_ARCH_VFP_V2, NULL},
   {"arm1176jz-s",      ARM_ARCH_V6ZK,   FPU_NONE,        NULL},
   {"arm1176jzf-s",     ARM_ARCH_V6ZK,   FPU_ARCH_VFP_V2, NULL},
-  {"cortex-a5",                ARM_ARCH_V7A,    FPU_NONE,        "Cortex-A5"},
+  {"cortex-a5",                ARM_ARCH_V7A_MP, FPU_NONE,        "Cortex-A5"},
   {"cortex-a8",                ARM_ARCH_V7A,    ARM_FEATURE (0, FPU_VFP_V3
                                                         | FPU_NEON_EXT_V1),
                                                           "Cortex-A8"},
-  {"cortex-a9",                ARM_ARCH_V7A,    ARM_FEATURE (0, FPU_VFP_V3
+  {"cortex-a9",                ARM_ARCH_V7A_MP, ARM_FEATURE (0, FPU_VFP_V3
                                                         | FPU_NEON_EXT_V1),
                                                           "Cortex-A9"},
-  {"cortex-a15",       ARM_ARCH_V7A,    FPU_ARCH_NEON_VFP_V4,
+  {"cortex-a15",       ARM_ARCH_V7A_MP, FPU_ARCH_NEON_VFP_V4,
                                                           "Cortex-A15"},
   {"cortex-r4",                ARM_ARCH_V7R,    FPU_NONE,        "Cortex-R4"},
   {"cortex-r4f",       ARM_ARCH_V7R,    FPU_ARCH_VFP_V3D16,
@@ -22468,8 +22477,10 @@ static const struct arm_option_extension_value_table arm_extensions[] =
   {"iwmmxt",   ARM_FEATURE (0, ARM_CEXT_IWMMXT),       ARM_ANY},
   {"iwmmxt2",  ARM_FEATURE (0, ARM_CEXT_IWMMXT2),      ARM_ANY},
   {"maverick", ARM_FEATURE (0, ARM_CEXT_MAVERICK),     ARM_ANY},
+  {"mp",       ARM_FEATURE (ARM_EXT_MP, 0),
+                    ARM_FEATURE (ARM_EXT_V7A | ARM_EXT_V7R, 0)},
   {"xscale",   ARM_FEATURE (0, ARM_CEXT_XSCALE),       ARM_ANY},
-  {NULL,       ARM_ARCH_NONE,                          ARM_ARCH_NONE}
+  {NULL,       ARM_ARCH_NONE,                    ARM_ARCH_NONE}
 };
 
 /* ISA floating-point and Advanced SIMD extensions.  */
@@ -23146,6 +23157,10 @@ aeabi_set_public_attributes (void)
       aeabi_set_attribute_int (Tag_DIV_use, 2);  */
   else
     aeabi_set_attribute_int (Tag_DIV_use, 1);
+
+  /* Tag_MP_extension_use.  */
+  if (ARM_CPU_HAS_FEATURE (flags, arm_ext_mp))
+    aeabi_set_attribute_int (Tag_MPextension_use, 1);
 }
 
 /* Add the default contents for the .ARM.attributes section.  */
index 479d6fa93aca5ac3cb53278892e5da6eef6d6b81..693d6ba7bbc87cd5ddfe2a0f5154cc8eed677374 100644 (file)
@@ -138,6 +138,9 @@ is equivalent to specifying @code{-mcpu=ep9312}.
 Multiple extensions may be specified, separated by a @code{+}.  The 
 extensions should be specified in ascending alphabetical order.
 
+Some extensions may be restricted to particular architectures; this is 
+documented in the list of extensions below.
+
 Extension mnemonics may also be removed from those the assembler accepts.  
 This is done be prepending @code{no} to the option that adds the extension.  
 Extensions that are removed should be listed after all extensions which have 
@@ -149,6 +152,7 @@ The following extensions are currently supported:
 @code{iwmmxt},
 @code{iwmmxt2},
 @code{maverick},
+@code{mp} (Multiprocessing Extensions for v7-A and v7-R architectures),
 and
 @code{xscale}.
 
index 8ee3ca77bb23e8bba4f2efbe269da4ed36a3b71f..bc2eb52b13fe60cf29e4466be670b0e61d76b3d5 100644 (file)
@@ -1,3 +1,14 @@
+2010-09-23  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+       * gas/arm/arch7a-mp.d: Add.
+       * gas/arm/arch7ar-mp.s: Likewise.
+       * gas/arm/arch7r-mp.d: Likewise.
+       * gas/arm/armv2-mp-bad.d: Likewise.
+       * gas/arm/armv2-mp-bad.l: Likewise.
+       * gas/arm/attr-march-all.d: Update for MP extension.
+       * gas/arm/attr-march-armv7-a+mp.d: Add.
+       * gas/arm/attr-march-armv7-r+mp.d: Likewise.
+
 2010-09-23  Alan Modra  <amodra@gmail.com>
 
        * gas/all/gas.exp: Update "forward" and "redef3" xfails.
diff --git a/gas/testsuite/gas/arm/arch7a-mp.d b/gas/testsuite/gas/arm/arch7a-mp.d
new file mode 100644 (file)
index 0000000..9513f89
--- /dev/null
@@ -0,0 +1,30 @@
+#name: ARM V7-A+MP instructions
+#as: -march=armv7-a+mp
+#objdump: -dr --prefix-addresses --show-raw-insn
+#source: arch7ar-mp.s
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> f590f000    pldw    \[r0\]
+0[0-9a-f]+ <[^>]+> f59ef000    pldw    \[lr\]
+0[0-9a-f]+ <[^>]+> f591f000    pldw    \[r1\]
+0[0-9a-f]+ <[^>]+> f590ffff    pldw    \[r0, #4095\]   ; 0xfff
+0[0-9a-f]+ <[^>]+> f510ffff    pldw    \[r0, #-4095\]  ; 0xfff
+0[0-9a-f]+ <[^>]+> f790f000    pldw    \[r0, r0\]
+0[0-9a-f]+ <[^>]+> f791f000    pldw    \[r1, r0\]
+0[0-9a-f]+ <[^>]+> f79ef000    pldw    \[lr, r0\]
+0[0-9a-f]+ <[^>]+> f790f001    pldw    \[r0, r1\]
+0[0-9a-f]+ <[^>]+> f790f00e    pldw    \[r0, lr\]
+0[0-9a-f]+ <[^>]+> f790f100    pldw    \[r0, r0, lsl #2\]
+0[0-9a-f]+ <[^>]+> f8b0 f000   pldw    \[r0\]
+0[0-9a-f]+ <[^>]+> f8be f000   pldw    \[lr\]
+0[0-9a-f]+ <[^>]+> f8b1 f000   pldw    \[r1\]
+0[0-9a-f]+ <[^>]+> f8b0 ffff   pldw    \[r0, #4095\]   ; 0xfff
+0[0-9a-f]+ <[^>]+> f830 fcff   pldw    \[r0, #-255\]
+0[0-9a-f]+ <[^>]+> f830 f000   pldw    \[r0, r0\]
+0[0-9a-f]+ <[^>]+> f831 f000   pldw    \[r1, r0\]
+0[0-9a-f]+ <[^>]+> f83e f000   pldw    \[lr, r0\]
+0[0-9a-f]+ <[^>]+> f830 f001   pldw    \[r0, r1\]
+0[0-9a-f]+ <[^>]+> f830 f00e   pldw    \[r0, lr\]
+0[0-9a-f]+ <[^>]+> f830 f030   pldw    \[r0, r0, lsl #3\]
diff --git a/gas/testsuite/gas/arm/arch7ar-mp.s b/gas/testsuite/gas/arm/arch7ar-mp.s
new file mode 100644 (file)
index 0000000..34f7278
--- /dev/null
@@ -0,0 +1,33 @@
+       @ Test MP Extension instructions
+       .text
+
+label1:
+       pldw [r0, #0]
+       pldw [r14, #0]
+       pldw [r1, #0]
+       pldw [r0, #4095]
+       pldw [r0, #-4095]
+
+       pldw [r0, r0]
+       pldw [r1, r0]
+       pldw [r14, r0]
+       pldw [r0, r1]
+       pldw [r0, r14]
+       pldw [r0, r0, lsl #2]
+
+       .thumb
+       .thumb_func
+label2:
+       pldw [r0, #0]
+       pldw [r14, #0]
+       pldw [r1, #0]
+       pldw [r0, #4095]
+       pldw [r0, #-255]
+
+       pldw [r0, r0]
+       pldw [r1, r0]
+       pldw [r14, r0]
+       pldw [r0, r1]
+       pldw [r0, r14]
+       pldw [r0, r0, lsl #3]
+
diff --git a/gas/testsuite/gas/arm/arch7r-mp.d b/gas/testsuite/gas/arm/arch7r-mp.d
new file mode 100644 (file)
index 0000000..8908c98
--- /dev/null
@@ -0,0 +1,30 @@
+#name: ARM V7-R+MP instructions
+#as: -march=armv7-r+mp
+#objdump: -dr --prefix-addresses --show-raw-insn
+#source: arch7ar-mp.s
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0[0-9a-f]+ <[^>]+> f590f000    pldw    \[r0\]
+0[0-9a-f]+ <[^>]+> f59ef000    pldw    \[lr\]
+0[0-9a-f]+ <[^>]+> f591f000    pldw    \[r1\]
+0[0-9a-f]+ <[^>]+> f590ffff    pldw    \[r0, #4095\]   ; 0xfff
+0[0-9a-f]+ <[^>]+> f510ffff    pldw    \[r0, #-4095\]  ; 0xfff
+0[0-9a-f]+ <[^>]+> f790f000    pldw    \[r0, r0\]
+0[0-9a-f]+ <[^>]+> f791f000    pldw    \[r1, r0\]
+0[0-9a-f]+ <[^>]+> f79ef000    pldw    \[lr, r0\]
+0[0-9a-f]+ <[^>]+> f790f001    pldw    \[r0, r1\]
+0[0-9a-f]+ <[^>]+> f790f00e    pldw    \[r0, lr\]
+0[0-9a-f]+ <[^>]+> f790f100    pldw    \[r0, r0, lsl #2\]
+0[0-9a-f]+ <[^>]+> f8b0 f000   pldw    \[r0\]
+0[0-9a-f]+ <[^>]+> f8be f000   pldw    \[lr\]
+0[0-9a-f]+ <[^>]+> f8b1 f000   pldw    \[r1\]
+0[0-9a-f]+ <[^>]+> f8b0 ffff   pldw    \[r0, #4095\]   ; 0xfff
+0[0-9a-f]+ <[^>]+> f830 fcff   pldw    \[r0, #-255\]
+0[0-9a-f]+ <[^>]+> f830 f000   pldw    \[r0, r0\]
+0[0-9a-f]+ <[^>]+> f831 f000   pldw    \[r1, r0\]
+0[0-9a-f]+ <[^>]+> f83e f000   pldw    \[lr, r0\]
+0[0-9a-f]+ <[^>]+> f830 f001   pldw    \[r0, r1\]
+0[0-9a-f]+ <[^>]+> f830 f00e   pldw    \[r0, lr\]
+0[0-9a-f]+ <[^>]+> f830 f030   pldw    \[r0, r0, lsl #3\]
diff --git a/gas/testsuite/gas/arm/armv2-mp-bad.d b/gas/testsuite/gas/arm/armv2-mp-bad.d
new file mode 100644 (file)
index 0000000..c43ba96
--- /dev/null
@@ -0,0 +1,4 @@
+#name: ARM MP Extension errors
+#source: blank.s
+#as: -march=armv2+mp
+#error-output: armv2-mp-bad.l
diff --git a/gas/testsuite/gas/arm/armv2-mp-bad.l b/gas/testsuite/gas/arm/armv2-mp-bad.l
new file mode 100644 (file)
index 0000000..eb97135
--- /dev/null
@@ -0,0 +1,3 @@
+Assembler messages:
+[^:]*: extension does not apply to the base architecture
+[^:]*: unrecognized option -march=armv2\+mp
index ba446c33769efb5db5bc02fcac2b3b6a8e208578..0b888a287ba053b1ba364b20ff8cddf72ef59f51 100644 (file)
@@ -12,3 +12,4 @@ File Attributes
   Tag_CPU_arch_profile: Application
   Tag_ARM_ISA_use: Yes
   Tag_THUMB_ISA_use: Thumb-2
+  Tag_MPextension_use: Allowed
diff --git a/gas/testsuite/gas/arm/attr-march-armv7-a+mp.d b/gas/testsuite/gas/arm/attr-march-armv7-a+mp.d
new file mode 100644 (file)
index 0000000..663a889
--- /dev/null
@@ -0,0 +1,16 @@
+# name: attributes for -march=armv7-a+mp
+# source: blank.s
+# as: -march=armv7-a+mp
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "7-A"
+  Tag_CPU_arch: v7
+  Tag_CPU_arch_profile: Application
+  Tag_ARM_ISA_use: Yes
+  Tag_THUMB_ISA_use: Thumb-2
+  Tag_MPextension_use: Allowed
+  Tag_DIV_use: Not allowed
diff --git a/gas/testsuite/gas/arm/attr-march-armv7-r+mp.d b/gas/testsuite/gas/arm/attr-march-armv7-r+mp.d
new file mode 100644 (file)
index 0000000..a7fa3c6
--- /dev/null
@@ -0,0 +1,15 @@
+# name: attributes for -march=armv7-r+mp
+# source: blank.s
+# as: -march=armv7-r+mp
+# readelf: -A
+# This test is only valid on EABI based ports.
+# target: *-*-*eabi
+
+Attribute Section: aeabi
+File Attributes
+  Tag_CPU_name: "7-R"
+  Tag_CPU_arch: v7
+  Tag_CPU_arch_profile: Realtime
+  Tag_ARM_ISA_use: Yes
+  Tag_THUMB_ISA_use: Thumb-2
+  Tag_MPextension_use: Allowed
index e467f5a4694065849c499c485d2477691b8189e3..2fe02e4d6ca2d1b43e4d100f36cd5c489eb773ff 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-23  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+       * arm.h (ARM_EXT_MP): Add.
+       (ARM_ARCH_V7A_MP): Likewise.
+
 2010-09-22  Mike Frysinger  <vapier@gentoo.org>
 
        * bfin.h: Declare pseudoChr structs/defines.
index c1b80d61ac6c1a5acd4d5c849bcacc899ad890f2..64f92f8811d0b952b1311223582d53d830094a77 100644 (file)
@@ -49,6 +49,7 @@
 #define ARM_EXT_THUMB_MSR 0x02000000   /* Thumb MSR/MRS.           */
 #define ARM_EXT_V6_DSP 0x04000000      /* ARM v6 (DSP-related),
                                           not in v7-M.  */
+#define ARM_EXT_MP       0x08000000     /* Multiprocessing Extensions.  */
 
 /* Co-processor space extensions.  */
 #define ARM_CEXT_XSCALE   0x00000001   /* Allow MIA etc.          */
 #define ARM_ANY                ARM_FEATURE (-1, 0)     /* Any basic core.  */
 #define FPU_ANY_HARD   ARM_FEATURE (0, FPU_FPA | FPU_VFP_HARD | FPU_MAVERICK)
 #define ARM_ARCH_THUMB2 ARM_FEATURE (ARM_EXT_V6T2 | ARM_EXT_V7 | ARM_EXT_V7A | ARM_EXT_V7R | ARM_EXT_V7M | ARM_EXT_DIV, 0)
+#define ARM_ARCH_V7A_MP ARM_FEATURE (ARM_AEXT_V7A | ARM_EXT_MP, 0)
 
 /* There are too many feature bits to fit in a single word, so use a
    structure.  For simplicity we put all core features in one word and
index 449954ef855a208b036bb7f3931d96115e543ae1..fbc85402cba32da8b2f30a94e7b3db482f51b9cc 100644 (file)
@@ -1,3 +1,8 @@
+2010-09-23  Matthew Gretton-Dann  <matthew.gretton-dann@arm.com>
+
+       * arm-dis.c (arm_opcodes): Add support for pldw.
+       (thumb32_opcodes): Likewise.
+
 2010-09-22  Robin Getz  <robin.getz@analog.com>
 
        * bfin-dis.c (fmtconst): Cast address to 32bits.
index 831b26c909da04c261c6b416422fb331e67595bf..306023d9711d84df4d4f48fe29191bbce69d4a3e 100644 (file)
@@ -829,6 +829,9 @@ static const struct opcode32 arm_opcodes[] =
   {ARM_EXT_V3M, 0x00800090, 0x0fa000f0, "%22?sumull%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
   {ARM_EXT_V3M, 0x00a00090, 0x0fa000f0, "%22?sumlal%20's%c\t%12-15Ru, %16-19Ru, %0-3R, %8-11R"},
 
+  /* MP Extension instructions.  */
+  {ARM_EXT_MP, 0xf410f000, 0xfc70f000, "pldw\t%a"},
+
   /* V7 instructions.  */
   {ARM_EXT_V7, 0xf450f000, 0xfd70f000, "pli\t%P"},
   {ARM_EXT_V7, 0x0320f0f0, 0x0ffffff0, "dbg%c\t#%0-3d"},
@@ -1353,6 +1356,9 @@ static const struct opcode32 thumb32_opcodes[] =
   {ARM_EXT_DIV, 0xfb90f0f0, 0xfff0f0f0, "sdiv%c\t%8-11r, %16-19r, %0-3r"},
   {ARM_EXT_DIV, 0xfbb0f0f0, 0xfff0f0f0, "udiv%c\t%8-11r, %16-19r, %0-3r"},
 
+  /* MP Extension instructions.  */
+  {ARM_EXT_MP,   0xf830f000, 0xff70f000, "pldw%c\t%a"},
+
   /* Instructions defined in the basic V6T2 set.  */
   {ARM_EXT_V6T2, 0xf3af8000, 0xffffffff, "nop%c.w"},
   {ARM_EXT_V6T2, 0xf3af8001, 0xffffffff, "yield%c.w"},