aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorRichard Henderson <rth@redhat.com>2002-01-01 01:18:17 +0000
committerRichard Henderson <rth@redhat.com>2002-01-01 01:18:17 +0000
commitcb5301b617b2b8c8d3f8c7c0387ad339647f5d95 (patch)
tree1f4e391ea7987266f303598d92586a803de037f4 /gas
parent86cf98f3456b103c93fda54f0970d454c0a2f744 (diff)
downloadgdb-cb5301b617b2b8c8d3f8c7c0387ad339647f5d95.zip
gdb-cb5301b617b2b8c8d3f8c7c0387ad339647f5d95.tar.gz
gdb-cb5301b617b2b8c8d3f8c7c0387ad339647f5d95.tar.bz2
* config/tc-ia64.c (has_suffix_p): New.
(note_register_values): Use it instead of strstr.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog3
-rw-r--r--gas/config/tc-ia64.c30
2 files changed, 24 insertions, 9 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index d3d8e43..b997270 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -3,6 +3,9 @@
* config/tc-ia64.c (errata_nop_necessary_p): Prototype.
(make_unw_section_name): Constify local variables.
+ * config/tc-ia64.c (has_suffix_p): New.
+ (note_register_values): Use it instead of strstr.
+
Mon Dec 31 16:48:07 2001 Jeffrey A Law (law@redhat.com)
* config/tc-hppa.c (pa_ip): Handle new 'c' mode completers,
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index 4056dc2..fa51977 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -733,6 +733,7 @@ static void add_qp_imply PARAMS((int p1, int p2));
static void clear_qp_branch_flag PARAMS((valueT mask));
static void clear_qp_mutex PARAMS((valueT mask));
static void clear_qp_implies PARAMS((valueT p1_mask, valueT p2_mask));
+static int has_suffix_p PARAMS((const char *, const char *));
static void clear_register_values PARAMS ((void));
static void print_dependency PARAMS ((const char *action, int depind));
static void instruction_serialization PARAMS ((void));
@@ -8630,6 +8631,19 @@ add_qp_mutex (mask)
qp_mutexes[qp_mutexeslen++].prmask = mask;
}
+static int
+has_suffix_p (name, suffix)
+ const char *name;
+ const char *suffix;
+{
+ size_t namelen = strlen (name);
+ size_t sufflen = strlen (suffix);
+
+ if (namelen <= sufflen)
+ return 0;
+ return strcmp (name + namelen - sufflen, suffix) == 0;
+}
+
static void
clear_register_values ()
{
@@ -8747,21 +8761,19 @@ note_register_values (idesc)
}
/* In general, clear mutexes and implies which include P1 or P2,
with the following exceptions. */
- else if (strstr (idesc->name, ".or.andcm") != NULL)
+ else if (has_suffix_p (idesc->name, ".or.andcm")
+ || has_suffix_p (idesc->name, ".and.orcm"))
{
add_qp_mutex (p1mask | p2mask);
clear_qp_implies (p2mask, p1mask);
}
- else if (strstr (idesc->name, ".and.orcm") != NULL)
- {
- add_qp_mutex (p1mask | p2mask);
- clear_qp_implies (p1mask, p2mask);
- }
- else if (strstr (idesc->name, ".and") != NULL)
+ else if (has_suffix_p (idesc->name, ".andcm")
+ || has_suffix_p (idesc->name, ".and"))
{
clear_qp_implies (0, p1mask | p2mask);
}
- else if (strstr (idesc->name, ".or") != NULL)
+ else if (has_suffix_p (idesc->name, ".orcm")
+ || has_suffix_p (idesc->name, ".or"))
{
clear_qp_mutex (p1mask | p2mask);
clear_qp_implies (p1mask | p2mask, 0);
@@ -8769,7 +8781,7 @@ note_register_values (idesc)
else
{
clear_qp_implies (p1mask | p2mask, p1mask | p2mask);
- if (strstr (idesc->name, ".unc") != NULL)
+ if (has_suffix_p (idesc->name, ".unc"))
{
add_qp_mutex (p1mask | p2mask);
if (CURR_SLOT.qp_regno != 0)