aboutsummaryrefslogtreecommitdiff
path: root/gas
diff options
context:
space:
mode:
Diffstat (limited to 'gas')
-rw-r--r--gas/ChangeLog6
-rw-r--r--gas/config/tc-i860.c33
-rw-r--r--gas/config/tc-i860.h6
-rw-r--r--gas/testsuite/ChangeLog5
-rw-r--r--gas/testsuite/gas/i860/dir-align01.d17
-rw-r--r--gas/testsuite/gas/i860/dir-align01.s11
-rw-r--r--gas/testsuite/gas/i860/i860.exp1
7 files changed, 79 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog
index 8e1356c..bbb0d78 100644
--- a/gas/ChangeLog
+++ b/gas/ChangeLog
@@ -1,5 +1,11 @@
2003-08-06 Jason Eckhardt <jle@rice.edu>
+ * config/tc-i860.c (i860_handle_align): New function.
+ * config/tc-i860.h (HANDLE_ALIGN): Define macro.
+ (MAX_MEM_FOR_RS_ALIGN_CODE): Define macro.
+
+2003-08-06 Jason Eckhardt <jle@rice.edu>
+
* config/tc-i860.c (i860_process_insn): Check that instructions
with their dual-bit set are 8-byte aligned.
diff --git a/gas/config/tc-i860.c b/gas/config/tc-i860.c
index d170b70..b281d52 100644
--- a/gas/config/tc-i860.c
+++ b/gas/config/tc-i860.c
@@ -1462,3 +1462,36 @@ tc_gen_reloc (asection *section ATTRIBUTE_UNUSED,
}
return reloc;
}
+
+/* This is called from HANDLE_ALIGN in write.c. Fill in the contents
+ of an rs_align_code fragment. */
+
+void
+i860_handle_align (fragS *fragp)
+{
+ /* Instructions are always stored little-endian on the i860. */
+ static const unsigned char le_nop[] = { 0x00, 0x00, 0x00, 0xA0 };
+
+ int bytes;
+ char *p;
+
+ if (fragp->fr_type != rs_align_code)
+ return;
+
+ bytes = fragp->fr_next->fr_address - fragp->fr_address - fragp->fr_fix;
+ p = fragp->fr_literal + fragp->fr_fix;
+
+ /* Make sure we are on a 4-byte boundary, in case someone has been
+ putting data into a text section. */
+ if (bytes & 3)
+ {
+ int fix = bytes & 3;
+ memset (p, 0, fix);
+ p += fix;
+ fragp->fr_fix += fix;
+ }
+
+ memcpy (p, le_nop, 4);
+ fragp->fr_var = 4;
+}
+
diff --git a/gas/config/tc-i860.h b/gas/config/tc-i860.h
index 72a5b6a..c5c39b4 100644
--- a/gas/config/tc-i860.h
+++ b/gas/config/tc-i860.h
@@ -86,4 +86,10 @@ extern int target_big_endian;
visible symbols can be overridden. */
#define EXTERN_FORCE_RELOC 0
+/* Bits for filling in rs_align_code fragments with NOPs. */
+extern void i860_handle_align (struct frag *);
+#define HANDLE_ALIGN(fragp) i860_handle_align (fragp)
+
+#define MAX_MEM_FOR_RS_ALIGN_CODE (3 + 4 + 4)
+
#endif /* TC_I860 */
diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog
index 30591b7..51a1239 100644
--- a/gas/testsuite/ChangeLog
+++ b/gas/testsuite/ChangeLog
@@ -1,5 +1,10 @@
2003-08-06 Jason Eckhardt <jle@rice.edu>
+ * gas/i860/dir-align01.{s,d}: New files.
+ * gas/i860/i860.exp: Execute the new test above.
+
+2003-08-06 Jason Eckhardt <jle@rice.edu>
+
* gas/i860/dual02-err.l: Update expected error message.
* gas/i860/README.i860: Remove dual02-err from known failure list.
diff --git a/gas/testsuite/gas/i860/dir-align01.d b/gas/testsuite/gas/i860/dir-align01.d
new file mode 100644
index 0000000..bc4f677
--- /dev/null
+++ b/gas/testsuite/gas/i860/dir-align01.d
@@ -0,0 +1,17 @@
+#as:
+#objdump: -d
+#name: i860 dir-align01
+
+.*: +file format .*
+
+Disassembly of section \.text:
+
+00000000 <\.text>:
+ 0: 00 20 a6 90 adds %r4,%r5,%r6
+ 4: 00 00 00 a0 shl %r0,%r0,%r0
+ 8: 00 00 00 a0 shl %r0,%r0,%r0
+ c: 00 00 00 a0 shl %r0,%r0,%r0
+ 10: 00 50 6c 91 adds %r10,%r11,%r12
+ 14: a1 b1 1a 4b fmlow.dd %f22,%f24,%f26
+ 18: 30 74 f0 49 pfadd.ss %f14,%f15,%f16
+ 1c: b0 8c 54 4a pfadd.sd %f17,%f18,%f20
diff --git a/gas/testsuite/gas/i860/dir-align01.s b/gas/testsuite/gas/i860/dir-align01.s
new file mode 100644
index 0000000..595eb3f
--- /dev/null
+++ b/gas/testsuite/gas/i860/dir-align01.s
@@ -0,0 +1,11 @@
+# Test that .text section alignments use nops (0xA0000000) to fill
+# rather than 0.
+ .text
+ adds %r4,%r5,%r6
+ .align 16
+ adds %r10,%r11,%r12
+ fmlow.dd %f22,%f24,%f26
+ pfadd.ss %f14,%f15,%f16
+ pfadd.sd %f17,%f18,%f20
+
+
diff --git a/gas/testsuite/gas/i860/i860.exp b/gas/testsuite/gas/i860/i860.exp
index 601995b..3a1ceed 100644
--- a/gas/testsuite/gas/i860/i860.exp
+++ b/gas/testsuite/gas/i860/i860.exp
@@ -17,6 +17,7 @@ if [istarget i860-*-*] {
run_dump_test "bitwise"
run_dump_test "branch"
run_dump_test "bte"
+ run_dump_test "dir-align01"
run_dump_test "dir-intel01"
run_dump_test "dir-intel02"
run_list_test "dir-intel03-err" ""