diff options
author | Joseph Myers <joseph@codesourcery.com> | 2010-06-18 22:44:20 +0000 |
---|---|---|
committer | Joseph Myers <joseph@codesourcery.com> | 2010-06-18 22:44:20 +0000 |
commit | 38bd8d09ffe9e298c29172609b358c34cfd7e11b (patch) | |
tree | e039928ad43fe500786d05e483c762399922b626 | |
parent | 6aed2dbcba548376cdc0b98231fb9b174f9ca978 (diff) | |
download | gdb-38bd8d09ffe9e298c29172609b358c34cfd7e11b.zip gdb-38bd8d09ffe9e298c29172609b358c34cfd7e11b.tar.gz gdb-38bd8d09ffe9e298c29172609b358c34cfd7e11b.tar.bz2 |
gas:
* config/tc-tic6x.h (tic6x_segment_info_type): Add field
func_units_used.
* config/tc-tic6x.c (tic6x_cons_align: Clear func_units_used.
(md_assemble): Clear func_units_used for new execute packet.
Check for duplicate functional units and update func_units_used
for instructions using a functional unit.
gas/testsuite:
* gas/tic6x/resource-func-unit-1.d,
gas/tic6x/resource-func-unit-1.l,
gas/tic6x/resource-func-unit-1.s,
gas/tic6x/resource-func-unit-2.d,
gas/tic6x/resource-func-unit-2.l,
gas/tic6x/resource-func-unit-2.s: New.
-rw-r--r-- | gas/ChangeLog | 9 | ||||
-rw-r--r-- | gas/config/tc-tic6x.c | 14 | ||||
-rw-r--r-- | gas/config/tc-tic6x.h | 5 | ||||
-rw-r--r-- | gas/testsuite/ChangeLog | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-1.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-1.l | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-1.s | 9 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-2.d | 2 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-2.l | 3 | ||||
-rw-r--r-- | gas/testsuite/gas/tic6x/resource-func-unit-2.s | 19 |
10 files changed, 74 insertions, 0 deletions
diff --git a/gas/ChangeLog b/gas/ChangeLog index 1bce7a4..83ed094 100644 --- a/gas/ChangeLog +++ b/gas/ChangeLog @@ -1,3 +1,12 @@ +2010-06-18 Joseph Myers <joseph@codesourcery.com> + + * config/tc-tic6x.h (tic6x_segment_info_type): Add field + func_units_used. + * config/tc-tic6x.c (tic6x_cons_align: Clear func_units_used. + (md_assemble): Clear func_units_used for new execute packet. + Check for duplicate functional units and update func_units_used + for instructions using a functional unit. + 2010-06-15 Joseph Myers <joseph@codesourcery.com> * config/tc-tic6x.c: Include elf/tic6x.h. diff --git a/gas/config/tc-tic6x.c b/gas/config/tc-tic6x.c index 9c40c15..ea750ba 100644 --- a/gas/config/tc-tic6x.c +++ b/gas/config/tc-tic6x.c @@ -633,6 +633,7 @@ tic6x_cons_align (int n ATTRIBUTE_UNUSED) seginfo->tc_segment_info_data.execute_packet_frag = NULL; seginfo->tc_segment_info_data.last_insn_lsb = NULL; seginfo->tc_segment_info_data.spmask_addr = NULL; + seginfo->tc_segment_info_data.func_units_used = 0; } /* Handle an alignment directive. Return TRUE if the @@ -3155,6 +3156,7 @@ md_assemble (char *str) tic6x_label_list *l; seginfo->tc_segment_info_data.spmask_addr = NULL; + seginfo->tc_segment_info_data.func_units_used = 0; /* Start a new frag for this execute packet. */ if (frag_now_fix () != 0) @@ -3184,6 +3186,18 @@ md_assemble (char *str) = tic6x_can_cross_fp_boundary; } + if (func_unit_base != tic6x_func_unit_nfu) + { + unsigned int func_unit_enc; + + func_unit_enc = tic6x_encode_spmask (func_unit_base, func_unit_side); + + if (seginfo->tc_segment_info_data.func_units_used & func_unit_enc) + as_bad (_("functional unit already used in this execute packet")); + + seginfo->tc_segment_info_data.func_units_used |= func_unit_enc; + } + if (opct->flags & TIC6X_FLAG_SPLOOP) { if (seginfo->tc_segment_info_data.sploop_ii) diff --git a/gas/config/tc-tic6x.h b/gas/config/tc-tic6x.h index c9df520..d4a3795 100644 --- a/gas/config/tc-tic6x.h +++ b/gas/config/tc-tic6x.h @@ -67,6 +67,11 @@ typedef struct ||^); otherwise NULL. */ char *spmask_addr; + /* The functional units used in the current execute packet, recorded + by setting the same bits as would be set in the 32-bit SPMASK + instruction. */ + unsigned int func_units_used; + /* If an SPLOOP-family instruction has been seen, and a following SPKERNEL-family instruction has not yet been seen, the ii value from the SPLOOP instruction (in the range 1 to 14); otherwise diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index 04fb098..008475b 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,12 @@ +2010-06-18 Joseph Myers <joseph@codesourcery.com> + + * gas/tic6x/resource-func-unit-1.d, + gas/tic6x/resource-func-unit-1.l, + gas/tic6x/resource-func-unit-1.s, + gas/tic6x/resource-func-unit-2.d, + gas/tic6x/resource-func-unit-2.l, + gas/tic6x/resource-func-unit-2.s: New. + 2010-06-16 Vincent Rivière <vincent.riviere@freesbee.fr> PR gas/11673 diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-1.d b/gas/testsuite/gas/tic6x/resource-func-unit-1.d new file mode 100644 index 0000000..1543233 --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-1.d @@ -0,0 +1,2 @@ +#name: C6X parallel instructions on same functional unit +#error-output: resource-func-unit-1.l diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-1.l b/gas/testsuite/gas/tic6x/resource-func-unit-1.l new file mode 100644 index 0000000..54d7bce --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-1.l @@ -0,0 +1,2 @@ +[^:]*: Assembler messages: +[^:]*:9: Error: functional unit already used in this execute packet diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-1.s b/gas/testsuite/gas/tic6x/resource-func-unit-1.s new file mode 100644 index 0000000..fac20e7 --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-1.s @@ -0,0 +1,9 @@ +# Test parallel instructions on same functional unit. +.text +.globl f +f: + add .L1 a1,a2,a3 + nop + || [b1] add .L1 a1,a2,a3 + || nop + || [!b1] add .L1 a4,a5,a6 diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-2.d b/gas/testsuite/gas/tic6x/resource-func-unit-2.d new file mode 100644 index 0000000..38929f7 --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-2.d @@ -0,0 +1,2 @@ +#name: C6X parallel instructions on same functional unit, multiple sections +#error-output: resource-func-unit-2.l diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-2.l b/gas/testsuite/gas/tic6x/resource-func-unit-2.l new file mode 100644 index 0000000..b576bee --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-2.l @@ -0,0 +1,3 @@ +[^:]*: Assembler messages: +[^:]*:17: Error: functional unit already used in this execute packet +[^:]*:19: Error: functional unit already used in this execute packet diff --git a/gas/testsuite/gas/tic6x/resource-func-unit-2.s b/gas/testsuite/gas/tic6x/resource-func-unit-2.s new file mode 100644 index 0000000..7406199 --- /dev/null +++ b/gas/testsuite/gas/tic6x/resource-func-unit-2.s @@ -0,0 +1,19 @@ +# Test parallel instructions on same functional unit, with section switching. +.section .text.f1,"ax",%progbits +.globl f1 +f1: + add .L1 a1,a2,a3 + nop + || [b1] add .L1 a1,a2,a3 +.section .text.f2,"ax",%progbits +.globl f2 +f2: + add .L2 b1,b2,b3 + nop + || [b1] add .L2 b1,b2,b3 + || nop +.section .text.f1,"ax",%progbits + || nop + || [!b1] add .L1 a4,a5,a6 +.section .text.f2,"ax",%progbits + || [!b1] add .L2 b4,b5,b6 |