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.

gas/testsuite:
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.
This commit is contained in:
Jason Eckhardt 2003-08-06 23:59:36 +00:00
parent 0acc96e1c8
commit e15f6d3074
7 changed files with 79 additions and 0 deletions

View File

@ -1,3 +1,9 @@
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

View File

@ -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;
}

View File

@ -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 */

View File

@ -1,3 +1,8 @@
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.

View File

@ -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

View File

@ -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

View File

@ -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" ""