aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
authorJan Beulich <jbeulich@novell.com>2005-02-15 07:54:03 +0000
committerJan Beulich <jbeulich@novell.com>2005-02-15 07:54:03 +0000
commita66d2bb7bd680ef111a431892a5d69fa1147f6b4 (patch)
treed2b2bc4c7c6061b457ef79844c2076f4859c30d1 /gas
parent4b09e82862bd1cdc6a6d89f19c556bfd2307bd9a (diff)
downloadgdb-a66d2bb7bd680ef111a431892a5d69fa1147f6b4.zip
gdb-a66d2bb7bd680ef111a431892a5d69fa1147f6b4.tar.gz
gdb-a66d2bb7bd680ef111a431892a5d69fa1147f6b4.tar.bz2
gas/
2005-02-15 Jan Beulich <jbeulich@novell.com> * config/tc-ia64.c: Include limits.h (if available). (gr_values[0]): Set path to INT_MAX. (dot_reg_val): Don't allow changing value of r0. Limit range of general registers at r127. (specify_resource): Default resource index is -1. Don't set resource index (in case IA64_RS_RSE) without setting the specific flag. (note_register_values): Check operand is O_constant before tracking input value of moves. Add tracking for dep.z with constant inputs. (print_dependency): Resource index of specific resource may be zero. (check_dependencies): Likewise. gas/testsuite/ 2005-02-15 Jan Beulich <jbeulich@novell.com> * gas/ia64/dv-raw-err.l: Expect specific resource for RAW violation on b0. * gas/ia64/regval.[ls]: New. * gas/ia64/ia64.exp: Run new test.
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog13
-rw-r--r--gas/config/tc-ia64.c52
-rw-r--r--gas/testsuite/ChangeLog6
-rw-r--r--gas/testsuite/gas/ia64/dv-raw-err.l2
-rw-r--r--gas/testsuite/gas/ia64/ia64.exp1
-rw-r--r--gas/testsuite/gas/ia64/regval.l17
-rw-r--r--gas/testsuite/gas/ia64/regval.s48
7 files changed, 131 insertions, 8 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index a75b7e8..d8f54c6 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,18 @@
2005-02-15 Jan Beulich <jbeulich@novell.com>
+ * config/tc-ia64.c: Include limits.h (if available).
+ (gr_values[0]): Set path to INT_MAX.
+ (dot_reg_val): Don't allow changing value of r0. Limit range of
+ general registers at r127.
+ (specify_resource): Default resource index is -1. Don't set resource
+ index (in case IA64_RS_RSE) without setting the specific flag.
+ (note_register_values): Check operand is O_constant before tracking
+ input value of moves. Add tracking for dep.z with constant inputs.
+ (print_dependency): Resource index of specific resource may be zero.
+ (check_dependencies): Likewise.
+
+2005-02-15 Jan Beulich <jbeulich@novell.com>
+
* config/tc-ia64.c (parse_operands): New local variables reg1, reg2,
reg_class. Check operands and emit diagnostics for illegal use of
registers.
diff --git a/gas/config/tc-ia64.c b/gas/config/tc-ia64.c
index c7a6b07..4520d0b 100644
--- a/gas/config/tc-ia64.c
+++ b/gas/config/tc-ia64.c
@@ -51,6 +51,10 @@
#include "elf/ia64.h"
+#ifdef HAVE_LIMITS_H
+#include <limits.h>
+#endif
+
#define NELEMS(a) ((int) (sizeof (a)/sizeof ((a)[0])))
#define MIN(a,b) ((a) < (b) ? (a) : (b))
@@ -627,7 +631,17 @@ static struct gr {
unsigned known:1;
int path;
valueT value;
-} gr_values[128] = {{ 1, 0, 0 }};
+} gr_values[128] = {
+ {
+ 1,
+#ifdef INT_MAX
+ INT_MAX,
+#else
+ (((1 << (8 * sizeof(gr_values->path) - 2)) - 1) << 1) + 1,
+#endif
+ 0
+ }
+};
/* Remember the alignment frag. */
static fragS *align_frag;
@@ -4913,7 +4927,7 @@ dot_reg_val (dummy)
{
valueT value = get_absolute_expression ();
int regno = reg.X_add_number;
- if (regno < REG_GR || regno > REG_GR + 128)
+ if (regno <= REG_GR || regno > REG_GR + 127)
as_warn (_("Register value annotation ignored"));
else
{
@@ -8060,7 +8074,7 @@ specify_resource (dep, idesc, type, specs, note, path)
tmpl.link_to_qp_branch = 1;
tmpl.mem_offset.hint = 0;
tmpl.specific = 1;
- tmpl.index = 0;
+ tmpl.index = -1;
tmpl.cmp_type = CMP_NONE;
#define UNHANDLED \
@@ -9303,8 +9317,7 @@ dep->name, idesc->name, (rsrc_write?"write":"read"), note)
if (idesc->operands[0] == IA64_OPND_AR3
&& CURR_SLOT.opnd[0].X_add_number - REG_AR == AR_BSPSTORE)
{
- specs[count] = tmpl;
- specs[count++].index = 0; /* IA64_RSE_BSPLOAD/RNATBITINDEX */
+ specs[count++] = tmpl;
}
}
else
@@ -9758,6 +9771,7 @@ note_register_values (idesc)
else if (idesc->operands[0] == IA64_OPND_R1
&& (idesc->operands[1] == IA64_OPND_IMM22
|| idesc->operands[1] == IA64_OPND_IMMU64)
+ && CURR_SLOT.opnd[1].X_op == O_constant
&& (strcmp (idesc->name, "mov") == 0
|| strcmp (idesc->name, "movl") == 0))
{
@@ -9775,6 +9789,30 @@ note_register_values (idesc)
}
}
}
+ /* Look for dep.z imm insns. */
+ else if (idesc->operands[0] == IA64_OPND_R1
+ && idesc->operands[1] == IA64_OPND_IMM8
+ && strcmp (idesc->name, "dep.z") == 0)
+ {
+ int regno = CURR_SLOT.opnd[0].X_add_number - REG_GR;
+ if (regno > 0 && regno < NELEMS (gr_values))
+ {
+ valueT value = CURR_SLOT.opnd[1].X_add_number;
+
+ if (CURR_SLOT.opnd[3].X_add_number < 64)
+ value &= ((valueT)1 << CURR_SLOT.opnd[3].X_add_number) - 1;
+ value <<= CURR_SLOT.opnd[2].X_add_number;
+ gr_values[regno].known = 1;
+ gr_values[regno].value = value;
+ gr_values[regno].path = md.path;
+ if (md.debug_dv)
+ {
+ fprintf (stderr, " Know gr%d = ", regno);
+ fprintf_vma (stderr, gr_values[regno].value);
+ fputs ("\n", stderr);
+ }
+ }
+ }
else
{
clear_qp_mutex (qp_changemask);
@@ -9995,7 +10033,7 @@ print_dependency (action, depind)
fprintf (stderr, " %s %s '%s'",
action, dv_mode[(regdeps[depind].dependency)->mode],
(regdeps[depind].dependency)->name);
- if (regdeps[depind].specific && regdeps[depind].index != 0)
+ if (regdeps[depind].specific && regdeps[depind].index >= 0)
fprintf (stderr, " (%d)", regdeps[depind].index);
if (regdeps[depind].mem_offset.hint)
{
@@ -10193,7 +10231,7 @@ check_dependencies (idesc)
if (path != 0)
sprintf (pathmsg, " when entry is at label '%s'",
md.entry_labels[path - 1]);
- if (rs->specific && rs->index != 0)
+ if (matchtype == 1 && rs->index >= 0)
sprintf (indexmsg, ", specific resource number is %d",
rs->index);
sprintf (msg, "Use of '%s' %s %s dependency '%s' (%s)%s%s",
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 73e2c5d..849b28f 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,11 @@
2005-02-15 Jan Beulich <jbeulich@novell.com>
+ * gas/ia64/dv-raw-err.l: Expect specific resource for RAW violation on b0.
+ * gas/ia64/regval.[ls]: New.
+ * gas/ia64/ia64.exp: Run new test.
+
+2005-02-15 Jan Beulich <jbeulich@novell.com>
+
* gas/ia64/dv-raw-err.s: Don't use r0 or f0 as output operand.
* gas/ia64/dv-waw-err.s: Likewise.
* gas/ia64/reg-err.[ls]: New.
diff --git a/gas/testsuite/gas/ia64/dv-raw-err.l b/gas/testsuite/gas/ia64/dv-raw-err.l
index 7dc21f1..3ddb095 100644
--- a/gas/testsuite/gas/ia64/dv-raw-err.l
+++ b/gas/testsuite/gas/ia64/dv-raw-err.l
@@ -51,7 +51,7 @@
.*:98: Warning: This is the location of the conflicting usage
.*:104: Warning: Use of 'ld8\.fill' .* RAW dependency 'AR\[UNAT\]{%}, % in 0 - 63' \(impliedf\)
.*:103: Warning: This is the location of the conflicting usage
-.*:111: Warning: Use of 'mov' .* RAW dependency 'BR%, % in 0 - 7' \(impliedf\)
+.*:111: Warning: Use of 'mov' .* RAW dependency 'BR%, % in 0 - 7' \(impliedf\), specific resource number is 0
.*:110: Warning: This is the location of the conflicting usage
.*:116: Warning: Use of 'fadd' .* RAW dependency 'CFM' \(impliedf\)
.*:115: Warning: This is the location of the conflicting usage
diff --git a/gas/testsuite/gas/ia64/ia64.exp b/gas/testsuite/gas/ia64/ia64.exp
index c908063..3a94865 100644
--- a/gas/testsuite/gas/ia64/ia64.exp
+++ b/gas/testsuite/gas/ia64/ia64.exp
@@ -41,6 +41,7 @@ if [istarget "ia64-*"] then {
gas_test "pred-rel.s" "" "" ".pred.rel alternative forms"
run_dump_test "dv-safe"
run_dump_test "dv-srlz"
+ run_list_test "regval" ""
run_dump_test "tls"
run_dump_test "ldxmov-1"
run_list_test "ldxmov-2" ""
diff --git a/gas/testsuite/gas/ia64/regval.l b/gas/testsuite/gas/ia64/regval.l
new file mode 100644
index 0000000..b12a266
--- /dev/null
+++ b/gas/testsuite/gas/ia64/regval.l
@@ -0,0 +1,17 @@
+.*: Assembler messages:
+.*:11: Warning: Use of 'mov' .* WAW dependency 'RR#' \(impliedf\), specific resource number is 0
+.*:11: Warning: Only the first path encountering the conflict is reported
+.*:10: Warning: This is the location of the conflicting usage
+#...
+.*:25: Warning: Use of 'mov' .* WAW dependency 'RR#' \(impliedf\), specific resource number is 0
+.*:25: Warning: Only the first path encountering the conflict is reported
+.*:24: Warning: This is the location of the conflicting usage
+#...
+.*:32: Warning: Use of 'mov' .* WAW dependency 'RR#' \(impliedf\)
+.*:32: Warning: Only the first path encountering the conflict is reported
+.*:31: Warning: This is the location of the conflicting usage
+#...
+.*:46: Warning: Use of 'mov' .* WAW dependency 'RR#' \(impliedf\), specific resource number is 0
+.*:46: Warning: Only the first path encountering the conflict is reported
+.*:45: Warning: This is the location of the conflicting usage
+#pass
diff --git a/gas/testsuite/gas/ia64/regval.s b/gas/testsuite/gas/ia64/regval.s
new file mode 100644
index 0000000..3fb0330
--- /dev/null
+++ b/gas/testsuite/gas/ia64/regval.s
@@ -0,0 +1,48 @@
+.explicit
+rr1:
+ .reg.val r1, 0xE000000000000000
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr2:
+ .reg.val r1, 0
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr3:
+ movl r1 = 0xE000000000000000
+ ;;
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr4:
+ mov r1 = 0
+ ;;
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr5:
+ movl r1 = xyz+0xE000000000000000
+ ;;
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr6:
+ dep.z r1 = 1, 61, 3
+ ;;
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;
+rr7:
+ dep.z r1 = -1, 0, 61
+ ;;
+ mov rr[r0] = r0
+ mov rr[r1] = r0
+ br.ret.sptk rp
+ ;;