2011-05-31 Paul Brook <paul@codesourcery.com>
authorPaul Brook <paul@codesourcery.com>
Tue, 31 May 2011 14:12:55 +0000 (14:12 +0000)
committerPaul Brook <paul@codesourcery.com>
Tue, 31 May 2011 14:12:55 +0000 (14:12 +0000)
gas/
* config/tc-arm.c (arm_cpus): Add Cortex-R5.
(arm_extensions): Allow idiv on ARMv7-R.
* doc/c-arm.text: Update idiv extension restrictions.

gas/testsuite/
* gas/arm/arm-idiv-bad.d: New test.
* gas/arm/arm-idiv-bad.s: New test.
* gas/arm/arm-idiv-bad.l: New test.
* gas/arm/arm-idiv.d: New test.
* gas/arm/arm-idiv.s: New test.

include/
* opcode/arm.h (ARM_ARCH_V7R_IDIV): Define.

gas/ChangeLog
gas/config/tc-arm.c
gas/doc/c-arm.texi
gas/testsuite/ChangeLog
gas/testsuite/gas/arm/arm-idiv-bad.d [new file with mode: 0644]
gas/testsuite/gas/arm/arm-idiv-bad.l [new file with mode: 0644]
gas/testsuite/gas/arm/arm-idiv-bad.s [new file with mode: 0644]
gas/testsuite/gas/arm/arm-idiv.d [new file with mode: 0644]
gas/testsuite/gas/arm/arm-idiv.s [new file with mode: 0644]
include/opcode/ChangeLog
include/opcode/arm.h

index b79592709c36f56f27a9a207bd10cb02237685d2..c29604566b942c69f6a1d7b92038522ddd3bcd7f 100644 (file)
@@ -1,3 +1,9 @@
+2011-05-31  Paul Brook  <paul@codesourcery.com>
+
+       * config/tc-arm.c (arm_cpus): Add Cortex-R5.
+       (arm_extensions): Allow idiv on ARMv7-R.
+       * doc/c-arm.text: Update idiv extension restrictions.
+
 2011-05-31  Paul Brook  <paul@codesourcery.com>
 
        * config/tc-arm.c (arm_force_relocation): Resolve all pc-relative
index 6611e02e1f98f79c6914fdcb24d48be3a35e2b90..415663dc5e7d698bfe9a2d750020a9f22b84a258 100644 (file)
@@ -22805,6 +22805,8 @@ static const struct arm_cpu_option_table arm_cpus[] =
   {"cortex-r4",                ARM_ARCH_V7R,    FPU_NONE,        "Cortex-R4"},
   {"cortex-r4f",       ARM_ARCH_V7R,    FPU_ARCH_VFP_V3D16,
                                                          "Cortex-R4F"},
+  {"cortex-r5",                ARM_ARCH_V7R_IDIV,
+                                        FPU_NONE,        "Cortex-R5"},
   {"cortex-m4",                ARM_ARCH_V7EM,   FPU_NONE,        "Cortex-M4"},
   {"cortex-m3",                ARM_ARCH_V7M,    FPU_NONE,        "Cortex-M3"},
   {"cortex-m1",                ARM_ARCH_V6SM,   FPU_NONE,        "Cortex-M1"},
@@ -22888,7 +22890,7 @@ struct arm_option_extension_value_table
 static const struct arm_option_extension_value_table arm_extensions[] =
 {
   {"idiv",     ARM_FEATURE (ARM_EXT_ADIV | ARM_EXT_DIV, 0),
-                                  ARM_FEATURE (ARM_EXT_V7A, 0)},
+                                  ARM_FEATURE (ARM_EXT_V7A | ARM_EXT_V7R, 0)},
   {"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},
index a5a88ba1d62df4861be88aca2bcf6a851636d306..131f6ab5c09c2e518326cb0f487e7f30f0a292e5 100644 (file)
@@ -152,7 +152,7 @@ been added, again in ascending alphabetical order.  For example,
 
 
 The following extensions are currently supported:
-@code{idiv}, (Integer Divide Extensions for v7-A architecture),
+@code{idiv}, (Integer Divide Extensions for v7-A and v7-R architectures),
 @code{iwmmxt},
 @code{iwmmxt2},
 @code{maverick},
index 81fe89b3e2af7adfde63ae0cb442e9ae8ad27e67..1f54cfe02035f268b254070973b7f5dbd90477b4 100644 (file)
@@ -1,3 +1,11 @@
+2011-05-31  Paul Brook  <paul@codesourcery.com>
+
+       * gas/arm/arm-idiv-bad.d: New test.
+       * gas/arm/arm-idiv-bad.s: New test.
+       * gas/arm/arm-idiv-bad.l: New test.
+       * gas/arm/arm-idiv.d: New test.
+       * gas/arm/arm-idiv.s: New test.
+
 2011-05-31  Paul Brook  <paul@codesourcery.com>
 
        * gas/arm/ldr-global.d: New test.
diff --git a/gas/testsuite/gas/arm/arm-idiv-bad.d b/gas/testsuite/gas/arm/arm-idiv-bad.d
new file mode 100644 (file)
index 0000000..c3d7394
--- /dev/null
@@ -0,0 +1,4 @@
+#name: Invalid V7 ARM DIV instructions
+#as: -march=armv7-a
+#error-output: arm-idiv-bad.l
+
diff --git a/gas/testsuite/gas/arm/arm-idiv-bad.l b/gas/testsuite/gas/arm/arm-idiv-bad.l
new file mode 100644 (file)
index 0000000..6662cc7
--- /dev/null
@@ -0,0 +1,2 @@
+[^:]*: Assembler messages:
+[^:]*:4: Error: selected processor does not support ARM mode `sdiv r0,r0,r0'
diff --git a/gas/testsuite/gas/arm/arm-idiv-bad.s b/gas/testsuite/gas/arm/arm-idiv-bad.s
new file mode 100644 (file)
index 0000000..45e846e
--- /dev/null
@@ -0,0 +1,4 @@
+       .text
+       .arm
+label:
+       sdiv    r0, r0, r0
diff --git a/gas/testsuite/gas/arm/arm-idiv.d b/gas/testsuite/gas/arm/arm-idiv.d
new file mode 100644 (file)
index 0000000..a886d02
--- /dev/null
@@ -0,0 +1,9 @@
+#name: ARM Integer division instructions
+#objdump: -dr --prefix-addresses --show-raw-insn
+
+.*: +file format .*arm.*
+
+Disassembly of section .text:
+0+000 <[^>]*> e735f819         udiv    r5, r9, r8
+0+004 <[^>]*> e739f715         udiv    r9, r5, r7
+0+008 <[^>]*> e710f010         sdiv    r0, r0, r0
diff --git a/gas/testsuite/gas/arm/arm-idiv.s b/gas/testsuite/gas/arm/arm-idiv.s
new file mode 100644 (file)
index 0000000..626a67d
--- /dev/null
@@ -0,0 +1,8 @@
+.arch armv7-a
+.arch_extension idiv
+.arm
+udiv r5, r9, r8
+.cpu cortex-a15
+udiv r9, r5, r7
+.cpu cortex-r5
+sdiv r0, r0, r0
index e148e8dd4217c5672eba67e0051c2178fe3517d6..1324467b3eea5710f0e076303f2cc3336d2d7fad 100644 (file)
@@ -1,3 +1,7 @@
+2011-05-31  Paul Brook  <paul@codesourcery.com>
+
+       * opcode/arm.h (ARM_ARCH_V7R_IDIV): Define.
+
 2011-04-18  Julian Brown  <julian@codesourcery.com>
 
        * arm.h (ARM_AEXT_V7_ARM): Remove ARM_EXT_OS from bitmask.
index 297ca63730bf2a0028b17d84875ce840c165cab0..86e3d67db130fd8465df5471cd840d28cc6b7f7f 100644 (file)
                        ARM_FEATURE (ARM_AEXT_V7A | ARM_EXT_MP | ARM_EXT_SEC \
                                     | ARM_EXT_DIV | ARM_EXT_ADIV \
                                     | ARM_EXT_VIRT, 0)
+/* v7-r+idiv.  */
+#define ARM_ARCH_V7R_IDIV      ARM_FEATURE (ARM_AEXT_V7R | ARM_EXT_ADIV, 0)
 /* Features that are present in v6M and v6S-M but not other v6 cores.  */
 #define ARM_ARCH_V6M_ONLY ARM_FEATURE (ARM_AEXT_V6M_ONLY, 0)