Linux IA64 platform development
 help / color / mirror / Atom feed
From: David Mosberger <davidm@napali.hpl.hp.com>
To: linux-ia64@vger.kernel.org
Subject: [PATCH] new ".serialize" gas directive
Date: Thu, 06 May 2004 05:15:56 +0000	[thread overview]
Message-ID: <16537.51724.854691.934006@napali.hpl.hp.com> (raw)

Hi HJ,

I finally got tired of those spurious dependency-violation warnings
which occur when compiling the Linux kernel.  I believe you're
planning to fix some of the DV problems in other ways, but a few of
the spurious warnings are difficult to handle even with a perfect
assembler.  For example, the perfmon code writes to a data-breakpoint
register (without "srlz.d") and then GAS complains about all
subsequent stores.  The complaint is valid _unless_ you know that the
breakpoint isn't actually enabled.  So rather than trying to have all
kinds of complicated logic to handle these special cases, I decided to
add ".serialize.instruction" and ".serialize.data" directives which,
for DV-purposes, behave exactly like:

	;; srlz.i ;;
and

	;; srlz.d ;;

respectively, except that they don't actually insert any stop-bits or
(slow) serialization instructions.

After applying the attached patch to GAS, I had to add about eight
.serialize.data directives to the kernel and now there are no more
spurious warnings except for this one:

{standard input}: Assembler messages:
{standard input}:6117: Warning: Use of 'mov' may violate WAW dependency 'GR%, %
in 1 - 127' (impliedf), specific resource number is 14
{standard input}:6117: Warning: Only the first path encountering the conflict is
 reported
{standard input}:6116: Warning: This is the location of the conflicting usage

This one comes from plain C code (mm/vmscan.c):

	tbit.z p34, p35 = r22, 12	;;
	(p34) cmp4.eq p6, p7 = 2, r15
	(p35) cmp4.eq p6, p7 = 3, r15	;;
	(p6) addl r14 = 1, r0
	(p7) mov r14 = r0

I'm not sure whether GCC ought to be emitting .pred.rel.mutex p6,p7 or
whether GAS is supposed to be smart enough to figure this out on its
own.

In any case, if you think this patch is acceptable, would you mind
checking it into binutils?

Thanks,

	--david

ChangeLog

2004-05-05  David Mosberger-Tang  <davidm@hpl.hp.com>

	* config/tc-ia64.c (dot_serialize): Declare.
	(dot_serialize): New function.
	(md_pseudo_table): Add ".serialize.data" and
	".serialize.instruction" directives.

Index: config/tc-ia64.c
=================================RCS file: /cvs/src/src/gas/config/tc-ia64.c,v
retrieving revision 1.108
diff -u -r1.108 tc-ia64.c
--- config/tc-ia64.c	4 May 2004 14:58:11 -0000	1.108
+++ config/tc-ia64.c	6 May 2004 05:01:49 -0000
@@ -750,6 +750,7 @@
 static void print_prmask PARAMS ((valueT mask));
 static void dot_pred_rel PARAMS ((int));
 static void dot_reg_val PARAMS ((int));
+static void dot_serialize PARAMS ((int));
 static void dot_dv_mode PARAMS ((int));
 static void dot_entry PARAMS ((int));
 static void dot_mem_offset PARAMS ((int));
@@ -4651,6 +4652,23 @@
   demand_empty_rest_of_line ();
 }
 
+/*
+  .serialize.data
+  .serialize.instruction
+ */
+static void
+dot_serialize (type)
+     int type;
+{
+  insn_group_break (0, 0, 0);
+  if (type)
+    instruction_serialization ();
+  else
+    data_serialization ();
+  insn_group_break (0, 0, 0);
+  demand_empty_rest_of_line ();
+}
+
 /* select dv checking mode
    .auto
    .explicit
@@ -5033,6 +5051,8 @@
     { "pred.rel.mutex", dot_pred_rel, 'm' },
     { "pred.safe_across_calls", dot_pred_rel, 's' },
     { "reg.val", dot_reg_val, 0 },
+    { "serialize.data", dot_serialize, 0 },
+    { "serialize.instruction", dot_serialize, 1 },
     { "auto", dot_dv_mode, 'a' },
     { "explicit", dot_dv_mode, 'e' },
     { "default", dot_dv_mode, 'd' },

             reply	other threads:[~2004-05-06  5:15 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-05-06  5:15 David Mosberger [this message]
2004-05-06 23:33 ` [PATCH] new ".serialize" gas directive Jim Wilson
2004-05-06 23:47 ` David Mosberger
2004-05-07  7:48 ` Jim Wilson
2004-05-10 20:16 ` David Mosberger
2004-05-14  8:43 ` Jim Wilson
2004-05-14 18:30 ` David Mosberger
2004-06-16  1:54 ` Chris Wedgwood
2004-06-16 21:57 ` Jim Wilson
2004-06-16 22:04 ` Chris Wedgwood
2004-06-16 22:42 ` Jim Wilson
2004-06-16 22:56 ` Luck, Tony
2004-06-16 23:01 ` David Mosberger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=16537.51724.854691.934006@napali.hpl.hp.com \
    --to=davidm@napali.hpl.hp.com \
    --cc=linux-ia64@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox