aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDominik Vogt <vogt@linux.vnet.ibm.com>2015-12-04 14:33:01 +0000
committerAndreas Krebbel <krebbel@gcc.gnu.org>2015-12-04 14:33:01 +0000
commit7763d9729422ddc5dda9a3fe71a024c4ca7e0435 (patch)
tree7654d0a26e192edcaabf33543737706b1692596d
parentec47b0863aca86b7edd03ec9906d14556317d585 (diff)
downloadgcc-7763d9729422ddc5dda9a3fe71a024c4ca7e0435.zip
gcc-7763d9729422ddc5dda9a3fe71a024c4ca7e0435.tar.gz
gcc-7763d9729422ddc5dda9a3fe71a024c4ca7e0435.tar.bz2
[PATCH 2/2] S/390: Implement "target" attribute.
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
-rw-r--r--gcc/ChangeLog8
-rw-r--r--gcc/config/s390/s390.c16
-rw-r--r--gcc/testsuite/ChangeLog7
-rw-r--r--gcc/testsuite/gcc.target/s390/asm-machine-1.c7
-rw-r--r--gcc/testsuite/gcc.target/s390/asm-machine-2.c9
-rw-r--r--gcc/testsuite/gcc.target/s390/asm-machine-3.c9
-rw-r--r--gcc/testsuite/gcc.target/s390/asm-machine-4.c9
7 files changed, 53 insertions, 12 deletions
diff --git a/gcc/ChangeLog b/gcc/ChangeLog
index ba4d08c..59c50e0 100644
--- a/gcc/ChangeLog
+++ b/gcc/ChangeLog
@@ -1,5 +1,13 @@
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.
(s390_tune_string): Likewise.
(s390_cost_pointer): Add Variable.
diff --git a/gcc/config/s390/s390.c b/gcc/config/s390/s390.c
index e0851e5..f8928b9 100644
--- a/gcc/config/s390/s390.c
+++ b/gcc/config/s390/s390.c
@@ -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
diff --git a/gcc/testsuite/ChangeLog b/gcc/testsuite/ChangeLog
index 7ee9f40..d0bd101 100644
--- a/gcc/testsuite/ChangeLog
+++ b/gcc/testsuite/ChangeLog
@@ -1,5 +1,12 @@
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.
* gcc.target/s390/asm-machine-2.c: New test.
* gcc.target/s390/asm-machine-3.c: New test.
diff --git a/gcc/testsuite/gcc.target/s390/asm-machine-1.c b/gcc/testsuite/gcc.target/s390/asm-machine-1.c
index a5326e1..430d923 100644
--- a/gcc/testsuite/gcc.target/s390/asm-machine-1.c
+++ b/gcc/testsuite/gcc.target/s390/asm-machine-1.c
@@ -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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/asm-machine-2.c b/gcc/testsuite/gcc.target/s390/asm-machine-2.c
index 910438e..6817e2a 100644
--- a/gcc/testsuite/gcc.target/s390/asm-machine-2.c
+++ b/gcc/testsuite/gcc.target/s390/asm-machine-2.c
@@ -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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/asm-machine-3.c b/gcc/testsuite/gcc.target/s390/asm-machine-3.c
index b056b19..3ae57a8 100644
--- a/gcc/testsuite/gcc.target/s390/asm-machine-3.c
+++ b/gcc/testsuite/gcc.target/s390/asm-machine-3.c
@@ -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 } } */
diff --git a/gcc/testsuite/gcc.target/s390/asm-machine-4.c b/gcc/testsuite/gcc.target/s390/asm-machine-4.c
index af9ab1c..932bfe6 100644
--- a/gcc/testsuite/gcc.target/s390/asm-machine-4.c
+++ b/gcc/testsuite/gcc.target/s390/asm-machine-4.c
@@ -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 } } */