From 636b4f11428788ef1395da14da31df818afe289d Mon Sep 17 00:00:00 2001 From: Mike Frysinger Date: Fri, 15 Oct 2010 20:53:28 +0000 Subject: [PATCH] gas: blackfin: add tests for recent loop label fixes Signed-off-by: David Gibson Signed-off-by: Mike Frysinger --- gas/testsuite/ChangeLog | 7 + gas/testsuite/gas/bfin/bfin.exp | 3 + gas/testsuite/gas/bfin/loop_label.d | 14 ++ gas/testsuite/gas/bfin/loop_label.s | 8 + gas/testsuite/gas/bfin/loop_label2.d | 14 ++ gas/testsuite/gas/bfin/loop_label2.s | 8 + gas/testsuite/gas/bfin/loop_temps.d | 10 + gas/testsuite/gas/bfin/loop_temps.s | 312 +++++++++++++++++++++++++++ 8 files changed, 376 insertions(+) create mode 100644 gas/testsuite/gas/bfin/loop_label.d create mode 100644 gas/testsuite/gas/bfin/loop_label.s create mode 100644 gas/testsuite/gas/bfin/loop_label2.d create mode 100644 gas/testsuite/gas/bfin/loop_label2.s create mode 100644 gas/testsuite/gas/bfin/loop_temps.d create mode 100644 gas/testsuite/gas/bfin/loop_temps.s diff --git a/gas/testsuite/ChangeLog b/gas/testsuite/ChangeLog index ee3b43ed622..69f6fc0f57c 100644 --- a/gas/testsuite/ChangeLog +++ b/gas/testsuite/ChangeLog @@ -1,3 +1,10 @@ +2010-10-15 David Gibson + + * gas/bfin/loop_label.s, gas/bfin/loop_label.d, + gas/bfin/loop_label2.s, gas/bfin/loop_label2.d, + gas/bfin/loop_temps.s, gas/bfin/loop_temps.d: New tests. + * gas/bfin/bfin.exp: Add loop_label, loop_label2, and loop_temps. + 2010-10-15 Robin Getz * gas/bfin/16bit_illegals.s, gas/bfin/16bit_illegals.d, diff --git a/gas/testsuite/gas/bfin/bfin.exp b/gas/testsuite/gas/bfin/bfin.exp index 4fb43720b36..0ee7bb0dfa5 100644 --- a/gas/testsuite/gas/bfin/bfin.exp +++ b/gas/testsuite/gas/bfin/bfin.exp @@ -25,6 +25,9 @@ if [istarget bfin*-*-*] { run_dump_test "loop" run_dump_test "loop2" run_dump_test "loop3" + run_dump_test "loop_label" + run_dump_test "loop_label2" + run_dump_test "loop_temps" run_dump_test "misc" run_dump_test "move" run_dump_test "move2" diff --git a/gas/testsuite/gas/bfin/loop_label.d b/gas/testsuite/gas/bfin/loop_label.d new file mode 100644 index 00000000000..b1592aa2817 --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_label.d @@ -0,0 +1,14 @@ +#objdump: -d +#name: loop_label +.*: +file format .* + +Disassembly of section .text: + +00000000 <.text>: + 0: 08 4f R0 <<= 0x1; + 2: 78 68 P0 = 0xf \(X\);.* + 4: 48 42 DIVS \(R0, R1\); + 6: a2 e0 02 00 LSETUP\(0x0xa, 0x0xa\) LC0 = P0; + a: 08 42 DIVQ \(R0, R1\); + c: 80 42 R0 = R0.L \(X\); + ... diff --git a/gas/testsuite/gas/bfin/loop_label.s b/gas/testsuite/gas/bfin/loop_label.s new file mode 100644 index 00000000000..3fbd56d4f4c --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_label.s @@ -0,0 +1,8 @@ + r0 <<= 1; + p0 = 15; + divs (r0, r1); + loop 1f lc0=p0; +loop_begin 1; + divq (r0, r1); +loop_end 1; + r0 = r0.l (x); diff --git a/gas/testsuite/gas/bfin/loop_label2.d b/gas/testsuite/gas/bfin/loop_label2.d new file mode 100644 index 00000000000..b7fc01b6538 --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_label2.d @@ -0,0 +1,14 @@ +#objdump: -d +#name: loop_label2 +.*: +file format .* + +Disassembly of section .text: + +00000000 <.text>: + 0: 08 4f R0 <<= 0x1; + 2: 78 68 P0 = 0xf \(X\);.* + 4: 48 42 DIVS \(R0, R1\); + 6: a2 e0 02 00 LSETUP\(0x0xa, 0x0xa\) LC0 = P0; + a: 08 42 DIVQ \(R0, R1\); + c: 80 42 R0 = R0.L \(X\); + ... diff --git a/gas/testsuite/gas/bfin/loop_label2.s b/gas/testsuite/gas/bfin/loop_label2.s new file mode 100644 index 00000000000..2f09f13f939 --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_label2.s @@ -0,0 +1,8 @@ + r0 <<= 1; + p0 = 15; + divs (r0, r1); + loop .Lfoo lc0=p0; +loop_begin .Lfoo; + divq (r0, r1); +loop_end .Lfoo; + r0 = r0.l (x); diff --git a/gas/testsuite/gas/bfin/loop_temps.d b/gas/testsuite/gas/bfin/loop_temps.d new file mode 100644 index 00000000000..ab1152c8e12 --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_temps.d @@ -0,0 +1,10 @@ +#readelf:-s +#name: loop_temps + +Symbol table '.symtab' contains 5 entries: + Num: Value Size Type Bind Vis Ndx Name + 0: 00000000 0 NOTYPE LOCAL DEFAULT UND + 1: 00000000 0 SECTION LOCAL DEFAULT 1 + 2: 00000000 0 SECTION LOCAL DEFAULT 2 + 3: 00000000 0 SECTION LOCAL DEFAULT 3 + 4: 00000000 726 FUNC GLOBAL DEFAULT 1 _filter_mem16 diff --git a/gas/testsuite/gas/bfin/loop_temps.s b/gas/testsuite/gas/bfin/loop_temps.s new file mode 100644 index 00000000000..973e347e1d4 --- /dev/null +++ b/gas/testsuite/gas/bfin/loop_temps.s @@ -0,0 +1,312 @@ + .align 4 +.global _filter_mem16; +.type _filter_mem16, STT_FUNC; +_filter_mem16: + [--sp] = ( r7:7 ); + + [--SP] = R4; + [--SP] = R5; + [--SP] = P3; + [--SP] = P4; + LINK 68; + [FP+28] = R0; + [FP+32] = R1; + [FP+36] = R2; + [FP+-68] = SP; + R0 = SP; + [FP+-24] = R0; + R0 = [FP+44]; + R3 = R0; + R3 += 1; + R2 = R3; + R0 = R2; + R1 = 0 (X); + R2 = -1 (X); + R0 = R0 & R2; + R2 = 15 (X); + R1 = R1 & R2; + R2 = R0 >> 27; + R7 = R1 << 5; + [FP+-60] = R7; + R7 = [FP+-60]; + R7 = R2 | R7; + [FP+-60] = R7; + R2 = R0 << 5; + [FP+-64] = R2; + R0 = [FP+-64]; + R1 = [FP+-60]; + [FP+-64] = R0; + [FP+-60] = R1; + R0 = -1 (X); + R1 = [FP+-64]; + R1 = R1 & R0; + [FP+-64] = R1; + R0 = 15 (X); + R2 = [FP+-60]; + R2 = R2 & R0; + R2 = R3; + R0 = R2; + R1 = 0 (X); + R2 = -1 (X); + R0 = R0 & R2; + R2 = 15 (X); + R1 = R1 & R2; + R2 = R0 >> 27; + R7 = R1 << 5; + [FP+-52] = R7; + R7 = [FP+-52]; + R7 = R2 | R7; + [FP+-52] = R7; + R2 = R0 << 5; + [FP+-56] = R2; + R0 = [FP+-56]; + R1 = [FP+-52]; + [FP+-56] = R0; + [FP+-52] = R1; + R0 = -1 (X); + R1 = [FP+-56]; + R1 = R1 & R0; + [FP+-56] = R1; + R0 = 15 (X); + R2 = [FP+-52]; + R2 = R2 & R0; + R0 = R3; + R0 <<= 2; + R0 += 3; + R0 += 3; + R0 >>= 2; + P1 = R0; + P2 = P1 << 2; + SP -= P2; + [FP+-48] = SP; + R0 = [FP+-48]; + R0 += 3; + R0 >>= 2; + R0 <<= 2; + [FP+-48] = R0; + R0 = [FP+-48]; + [FP+-12] = R0; + R0 = [FP+48]; + R0 += 1; + R3 = R0 << 1; + R2 = R3; + R0 = R2; + R1 = 0 (X); + R2 = -1 (X); + R0 = R0 & R2; + R2 = 15 (X); + R1 = R1 & R2; + R2 = R0 >> 27; + R7 = R1 << 5; + [FP+-40] = R7; + R7 = [FP+-40]; + R7 = R2 | R7; + [FP+-40] = R7; + R2 = R0 << 5; + [FP+-44] = R2; + R0 = [FP+-44]; + R1 = [FP+-40]; + [FP+-44] = R0; + [FP+-40] = R1; + R0 = -1 (X); + R1 = [FP+-44]; + R1 = R1 & R0; + [FP+-44] = R1; + R0 = 15 (X); + R2 = [FP+-40]; + R2 = R2 & R0; + R2 = R3; + R0 = R2; + R1 = 0 (X); + R2 = -1 (X); + R0 = R0 & R2; + R2 = 15 (X); + R1 = R1 & R2; + R2 = R0 >> 27; + R7 = R1 << 5; + [FP+-32] = R7; + R7 = [FP+-32]; + R7 = R2 | R7; + [FP+-32] = R7; + R2 = R0 << 5; + [FP+-36] = R2; + R0 = [FP+-36]; + R1 = [FP+-32]; + [FP+-36] = R0; + [FP+-32] = R1; + R0 = -1 (X); + R1 = [FP+-36]; + R1 = R1 & R0; + [FP+-36] = R1; + R0 = 15 (X); + R2 = [FP+-32]; + R2 = R2 & R0; + R0 = R3; + R0 <<= 2; + R0 += 3; + R0 += 3; + R0 >>= 2; + P1 = R0; + P2 = P1 << 2; + SP -= P2; + [FP+-28] = SP; + R0 = [FP+-28]; + R0 += 3; + R0 >>= 2; + R0 <<= 2; + [FP+-28] = R0; + R0 = [FP+-28]; + [FP+-8] = R0; + R0 = [FP+-12]; + R0 += 4; + [FP+-16] = R0; + R0 = [FP+-8]; + [FP+-20] = R0; + R0 = 0 (X); + [FP+-4] = R0; + jump.s .L6; +.L7: + R1 = [FP+-20]; + R0 = [FP+-4]; + R0 <<= 2; + R1 = R1 + R0; + P1 = R1; + R0 = [FP+-4]; + R1 = R0 << 1; + R0 = [FP+32]; + R0 = R0 + R1; + P2 = R0; + R0 = W [P2] (Z); + W [P1] = R0; + R1 = [FP+-20]; + R0 = [FP+-4]; + R0 <<= 1; + R0 += 1; + R0 <<= 1; + R1 = R1 + R0; + P1 = R1; + R0 = [FP+-4]; + R1 = R0 << 1; + R0 = [FP+36]; + R0 = R0 + R1; + P2 = R0; + R0 = W [P2] (Z); + W [P1] = R0; + R0 = [FP+-4]; + R0 += 1; + [FP+-4] = R0; +.L6: + R1 = [FP+48]; + R0 = [FP+-4]; + cc =R0