[PATCH 2/2] S/390: Implement "target" attribute.
authorDominik Vogt <vogt@linux.vnet.ibm.com>
Fri, 4 Dec 2015 14:33:01 +0000 (14:33 +0000)
committerAndreas Krebbel <krebbel@gcc.gnu.org>
Fri, 4 Dec 2015 14:33:01 +0000 (14:33 +0000)
gcc/ChangeLog

* config/s390/s390.c (s390_asm_file_start): Implement hook function to
emit .machine and .machinemode to the top of the assembler file.
(TARGET_ASM_FILE_START): Provide target hook.
(s390_asm_output_machine_for_arch): Protect with
HAVE_AS_MACHINE_MACHINEMODE instead of S390_USE_TARGET_ATTRIBUTE.

gcc/testsuite/ChangeLog

* gcc.target/s390/asm-machine-1.c: Updated.
* gcc.target/s390/asm-machine-2.c: Updated.
* gcc.target/s390/asm-machine-3.c: Updated.
* gcc.target/s390/asm-machine-4.c: Updated.

From-SVN: r231272

gcc/ChangeLog
gcc/config/s390/s390.c
gcc/testsuite/ChangeLog
gcc/testsuite/gcc.target/s390/asm-machine-1.c
gcc/testsuite/gcc.target/s390/asm-machine-2.c
gcc/testsuite/gcc.target/s390/asm-machine-3.c
gcc/testsuite/gcc.target/s390/asm-machine-4.c

index ba4d08c99d3dceb941d893d21001dd09a219aa63..59c50e081157edee2d3d7839a946f8190369b946 100644 (file)
@@ -1,3 +1,11 @@
+2015-12-04  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       * config/s390/s390.c (s390_asm_file_start): Implement hook function to
+       emit .machine and .machinemode to the top of the assembler file.
+       (TARGET_ASM_FILE_START): Provide target hook.
+       (s390_asm_output_machine_for_arch): Protect with
+       HAVE_AS_MACHINE_MACHINEMODE instead of S390_USE_TARGET_ATTRIBUTE.
+
 2015-12-04  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * config/s390/s390.opt (s390_arch_string): Remove.
index e0851e5cae8e9eab219c9e6b423406f56d7fac21..f8928b9ac3eb3e982c4680f39adb6bf2faa40aba 100644 (file)
@@ -6738,7 +6738,7 @@ s390_function_num_hotpatch_hw (tree decl,
 /* Write the current .machine and .machinemode specification to the assembler
    file.  */
 
-#if S390_USE_TARGET_ATTRIBUTE
+#ifdef HAVE_AS_MACHINE_MACHINEMODE
 static void
 s390_asm_output_machine_for_arch (FILE *asm_out_file)
 {
@@ -14346,6 +14346,15 @@ s390_vector_alignment (const_tree type)
   return MIN (64, tree_to_shwi (TYPE_SIZE (type)));
 }
 
+#ifdef HAVE_AS_MACHINE_MACHINEMODE
+/* Implement TARGET_ASM_FILE_START.  */
+static void
+s390_asm_file_start (void)
+{
+  s390_asm_output_machine_for_arch (asm_out_file);
+}
+#endif
+
 /* Implement TARGET_ASM_FILE_END.  */
 static void
 s390_asm_file_end (void)
@@ -14645,6 +14654,11 @@ s390_invalid_binary_op (int op ATTRIBUTE_UNUSED, const_tree type1, const_tree ty
 #undef TARGET_INVALID_BINARY_OP
 #define TARGET_INVALID_BINARY_OP s390_invalid_binary_op
 
+#ifdef HAVE_AS_MACHINE_MACHINEMODE
+#undef TARGET_ASM_FILE_START
+#define TARGET_ASM_FILE_START s390_asm_file_start
+#endif
+
 #undef TARGET_ASM_FILE_END
 #define TARGET_ASM_FILE_END s390_asm_file_end
 
index 7ee9f40eafb6d3fde52fdcf423c4dab77a03f334..d0bd101608f26ac41ac883ea9a7e01e16a0bd20f 100644 (file)
@@ -1,3 +1,10 @@
+2015-12-04  Dominik Vogt  <vogt@linux.vnet.ibm.com>
+
+       * gcc.target/s390/asm-machine-1.c: Updated.
+       * gcc.target/s390/asm-machine-2.c: Updated.
+       * gcc.target/s390/asm-machine-3.c: Updated.
+       * gcc.target/s390/asm-machine-4.c: Updated.
+
 2015-12-04  Dominik Vogt  <vogt@linux.vnet.ibm.com>
 
        * gcc.target/s390/asm-machine-1.c: New test.
index a5326e192898a41aa0805bf53f9007b589372ae0..430d9234a89e7a4fd377825509a4af783adc4dc4 100644 (file)
@@ -3,7 +3,10 @@
 /* { dg-require-effective-target target_attribute } */
 /* { dg-options "-march=z13 -mzarch" } */
 
+/* { dg-final { scan-assembler-times "\t\.machine \"z13\"" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 1 } } */
+
 void foo(void) { }
 
-/* { dg-final { scan-assembler-not "\t\.machine " } } */
-/* { dg-final { scan-assembler-not "\t\.machinemode " } } */
+/* { dg-final { scan-assembler-times "\t\.machine " 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode " 1 } } */
index 910438eb73e5bc51c0156ebfb6a5b0eeb5f4f0ad..6817e2af38dc32e064f611f82e0347a1f0593d95 100644 (file)
@@ -3,6 +3,9 @@
 /* { dg-require-effective-target target_attribute } */
 /* { dg-options "-march=z13 -mzarch" } */
 
+/* { dg-final { scan-assembler-times "\t\.machine \"z13\"" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
+
 void foo(void) { }
 
 __attribute__ ((target("arch=z10")))
@@ -12,8 +15,8 @@ void bar(void) { }
 /* { dg-final { scan-assembler-times "\t\.machine pop" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machine \"z10\"" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode push" 1 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode pop" 1 } } */
 
-/* { dg-final { scan-assembler-times "\t\.machine " 3 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode " 3 } } */
+/* { dg-final { scan-assembler-times "\t\.machine " 4 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode " 4 } } */
index b056b1933d1dac0ef780846efdc3036c69bac244..3ae57a8a35715c5e35f27665c4429f3e32b11ac5 100644 (file)
@@ -3,6 +3,9 @@
 /* { dg-require-effective-target target_attribute } */
 /* { dg-options "-march=z13 -mzarch" } */
 
+/* { dg-final { scan-assembler-times "\t\.machine \"z13\"" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
+
 void foo(void) { }
 
 #pragma GCC target("arch=z10")
@@ -12,8 +15,8 @@ void bar(void) { }
 /* { dg-final { scan-assembler-times "\t\.machine pop" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machine \"z10\"" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode push" 1 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode pop" 1 } } */
 
-/* { dg-final { scan-assembler-times "\t\.machine " 3 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode " 3 } } */
+/* { dg-final { scan-assembler-times "\t\.machine " 4 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode " 4 } } */
index af9ab1ccd4f5891bde8b8e7bca8c04a65fffd425..932bfe68a94d1a929389756e2192d929ca7d0538 100644 (file)
@@ -3,6 +3,9 @@
 /* { dg-require-effective-target target_attribute } */
 /* { dg-options "-march=z13 -mzarch" } */
 
+/* { dg-final { scan-assembler-times "\t\.machine \"z13\"" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
+
 void foo(void) { }
 
 #pragma GCC target("arch=z196")
@@ -13,8 +16,8 @@ void bar(void) { }
 /* { dg-final { scan-assembler-times "\t\.machine pop" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machine \"z10\"" 1 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode push" 1 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 1 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode zarch" 2 } } */
 /* { dg-final { scan-assembler-times "\t\.machinemode pop" 1 } } */
 
-/* { dg-final { scan-assembler-times "\t\.machine " 3 } } */
-/* { dg-final { scan-assembler-times "\t\.machinemode " 3 } } */
+/* { dg-final { scan-assembler-times "\t\.machine " 4 } } */
+/* { dg-final { scan-assembler-times "\t\.machinemode " 4 } } */