Skip to content

Commit 4db6639

Browse files
committed
opcodes: blackfin: fix decoding of dsp mult insns
When assigning to a register half, the mac0 part of the mult insn was not decoding properly. It would always show a full dreg instead of the dreg low half. Once we fix the disassembler, we have to update a few of the gas tests as their previous expected output was incorrect. Signed-off-by: Mike Frysinger <[email protected]>
1 parent 36f4461 commit 4db6639

File tree

8 files changed

+35
-25
lines changed

8 files changed

+35
-25
lines changed

gas/testsuite/ChangeLog

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,9 @@
1-
2011-02-12 Mike Frysinger <[email protected]>
1+
2011-02-13 Mike Frysinger <[email protected]>
2+
3+
* gas/bfin/arithmetic.d, gas/bfin/parallel.d, gas/bfin/parallel3.d,
4+
gas/bfin/vector.d, gas/bfin/vector2.d: Add ".L" to dsp mult insns.
5+
6+
2011-02-13 Mike Frysinger <[email protected]>
27

38
* gas/bfin/video.d, gas/bfin/video.s, gas/bfin/video2.d,
49
gas/bfin/video2.s: Remove BYTEOP2M insns.

gas/testsuite/gas/bfin/arithmetic.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ Disassembly of section .text:
8282
a8: 2b c4 [0-3][[:xdigit:]] 40 R0.H = \(A0 \+= A1\);
8383

8484
000000ac <multiply16>:
85-
ac: 00 c2 0a 24 R0 = R1.H \* R2.L;
86-
b0: 20 c2 68 26 R1 = R5.H \* R0.H \(S2RND\);
87-
b4: 80 c2 db 23 R7 = R3.L \* R3.H \(FU\);
85+
ac: 00 c2 0a 24 R0.L = R1.H \* R2.L;
86+
b0: 20 c2 68 26 R1.L = R5.H \* R0.H \(S2RND\);
87+
b4: 80 c2 db 23 R7.L = R3.L \* R3.H \(FU\);
8888
b8: 28 c3 15 27 R4 = R2.H \* R5.H \(ISS2\);
8989
bc: 08 c3 0b 20 R0 = R1.L \* R3.L \(IS\);
9090
c0: 08 c2 a8 25 R6 = R5.H \* R0.L;

gas/testsuite/gas/bfin/parallel.d

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,11 +89,11 @@ Disassembly of section .text:
8989
144: 3b 9b 0f 9c
9090
148: 2b cc 00 40 R0.H = \(A0 \+= A1\) \|\| B\[P0\] = R3 \|\| R7 = \[I0\+\+\];
9191
14c: 03 9b 07 9c
92-
150: 00 ca 0a 24 R0 = R1.H \* R2.L \|\| B\[P1\] = R3 \|\| R1 = \[I0\+\+\];
92+
150: 00 ca 0a 24 R0.L = R1.H \* R2.L \|\| B\[P1\] = R3 \|\| R1 = \[I0\+\+\];
9393
154: 0b 9b 01 9c
94-
158: 20 ca 68 26 R1 = R5.H \* R0.H \(S2RND\) \|\| B\[P2\] = R3 \|\| R2 = \[I0\+\+\];
94+
158: 20 ca 68 26 R1.L = R5.H \* R0.H \(S2RND\) \|\| B\[P2\] = R3 \|\| R2 = \[I0\+\+\];
9595
15c: 13 9b 02 9c
96-
160: 80 ca db 23 R7 = R3.L \* R3.H \(FU\) \|\| B\[P3\] = R3 \|\| R3 = \[I0\+\+\];
96+
160: 80 ca db 23 R7.L = R3.L \* R3.H \(FU\) \|\| B\[P3\] = R3 \|\| R3 = \[I0\+\+\];
9797
164: 1b 9b 03 9c
9898
168: 28 cb 15 27 R4 = R2.H \* R5.H \(ISS2\) \|\| B\[P4\] = R3 \|\| R0 = \[I0\+\+\];
9999
16c: 23 9b 00 9c

gas/testsuite/gas/bfin/parallel3.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -73,21 +73,21 @@ Disassembly of section .text:
7373
104: 68 92 00 00
7474
108: 06 cc 17 40 R0 = MIN \(R2, R7\) \(V\) \|\| \[P5--\] = P0 \|\| NOP;
7575
10c: e8 92 00 00
76-
110: 04 ca be 66 R2.H = R7.L \* R6.H, R2 = R7.H \* R6.H \|\| \[P5 \+ 0x8\] = P0 \|\| NOP;
76+
110: 04 ca be 66 R2.H = R7.L \* R6.H, R2.L = R7.H \* R6.H \|\| \[P5 \+ 0x8\] = P0 \|\| NOP;
7777
114: a8 bc 00 00
78-
118: 04 ca 08 e1 R4.H = R1.H \* R0.H, R4 = R1.L \* R0.L \|\| \[P5 \+ 0x4\] = P0 \|\| NOP;
78+
118: 04 ca 08 e1 R4.H = R1.H \* R0.H, R4.L = R1.L \* R0.L \|\| \[P5 \+ 0x4\] = P0 \|\| NOP;
7979
11c: 68 bc 00 00
80-
120: 04 ca 1a a0 R0.H = R3.H \* R2.L, R0 = R3.L \* R2.L \|\| \[P5\] = P0 \|\| NOP;
80+
120: 04 ca 1a a0 R0.H = R3.H \* R2.L, R0.L = R3.L \* R2.L \|\| \[P5\] = P0 \|\| NOP;
8181
124: 68 93 00 00
82-
128: 94 ca 5a e1 R5.H = R3.H \* R2.H \(M\), R5 = R3.L \* R2.L \(FU\) \|\| \[SP\] = P0 \|\| NOP;
82+
128: 94 ca 5a e1 R5.H = R3.H \* R2.H \(M\), R5.L = R3.L \* R2.L \(FU\) \|\| \[SP\] = P0 \|\| NOP;
8383
12c: 70 93 00 00
8484
130: 2c ca 27 e0 R1 = R4.H \* R7.H, R0 = R4.L \* R7.L \(S2RND\) \|\| \[SP\+\+\] = P0 \|\| NOP;
8585
134: 70 92 00 00
8686
138: 0c ca 95 27 R7 = R2.L \* R5.L, R6 = R2.H \* R5.H \|\| \[SP--\] = P0 \|\| NOP;
8787
13c: f0 92 00 00
88-
140: 24 cb 3e e0 R0.H = R7.H \* R6.H, R0 = R7.L \* R6.L \(ISS2\) \|\| \[SP \+ 0x3c\] = P0 \|\| NOP;
88+
140: 24 cb 3e e0 R0.H = R7.H \* R6.H, R0.L = R7.L \* R6.L \(ISS2\) \|\| \[SP \+ 0x3c\] = P0 \|\| NOP;
8989
144: f0 bf 00 00
90-
148: 04 cb c1 e0 R3.H = R0.H \* R1.H, R3 = R0.L \* R1.L \(IS\) \|\| \[FP\] = P0 \|\| NOP;
90+
148: 04 cb c1 e0 R3.H = R0.H \* R1.H, R3.L = R0.L \* R1.L \(IS\) \|\| \[FP\] = P0 \|\| NOP;
9191
14c: 78 93 00 00
9292
150: 00 c8 13 46 A1 = R2.L \* R3.H, A0 = R2.H \* R3.H \|\| \[FP\+\+\] = P0 \|\| NOP;
9393
154: 78 92 00 00

gas/testsuite/gas/bfin/vector.d

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,14 @@ Disassembly of section .text:
5555
84: 06 c4 17 40 R0 = MIN \(R2, R7\) \(V\);
5656

5757
00000088 <vector_mul>:
58-
88: 04 c2 be 66 R2.H = R7.L \* R6.H, R2 = R7.H \* R6.H;
59-
8c: 04 c2 08 e1 R4.H = R1.H \* R0.H, R4 = R1.L \* R0.L;
60-
90: 04 c2 1a a0 R0.H = R3.H \* R2.L, R0 = R3.L \* R2.L;
61-
94: 94 c2 5a e1 R5.H = R3.H \* R2.H \(M\), R5 = R3.L \* R2.L \(FU\);
58+
88: 04 c2 be 66 R2.H = R7.L \* R6.H, R2.L = R7.H \* R6.H;
59+
8c: 04 c2 08 e1 R4.H = R1.H \* R0.H, R4.L = R1.L \* R0.L;
60+
90: 04 c2 1a a0 R0.H = R3.H \* R2.L, R0.L = R3.L \* R2.L;
61+
94: 94 c2 5a e1 R5.H = R3.H \* R2.H \(M\), R5.L = R3.L \* R2.L \(FU\);
6262
98: 2c c2 27 e0 R1 = R4.H \* R7.H, R0 = R4.L \* R7.L \(S2RND\);
6363
9c: 0c c2 95 27 R7 = R2.L \* R5.L, R6 = R2.H \* R5.H;
64-
a0: 24 c3 3e e0 R0.H = R7.H \* R6.H, R0 = R7.L \* R6.L \(ISS2\);
65-
a4: 04 c3 c1 e0 R3.H = R0.H \* R1.H, R3 = R0.L \* R1.L \(IS\);
64+
a0: 24 c3 3e e0 R0.H = R7.H \* R6.H, R0.L = R7.L \* R6.L \(ISS2\);
65+
a4: 04 c3 c1 e0 R3.H = R0.H \* R1.H, R3.L = R0.L \* R1.L \(IS\);
6666
a8: 00 c0 13 46 A1 = R2.L \* R3.H, A0 = R2.H \* R3.H;
6767
ac: 01 c0 08 c0 A1 \+= R1.H \* R0.H, A0 = R1.L \* R0.L;
6868
b0: 60 c0 2f c8 A1 = R5.H \* R7.H, A0 \+= R5.L \* R7.L \(W32\);

gas/testsuite/gas/bfin/vector2.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -411,9 +411,9 @@ Disassembly of section .text:
411411
64c: 06 c4 01 4e R7 = MIN \(R0, R1\) \(V\);
412412
650: 06 c4 1c 44 R2 = MIN \(R3, R4\) \(V\);
413413
654: 06 c4 37 4a R5 = MIN \(R6, R7\) \(V\);
414-
658: 04 c2 be 66 R2.H = R7.L \* R6.H, R2 = R7.H \* R6.H;
415-
65c: 04 c2 08 e1 R4.H = R1.H \* R0.H, R4 = R1.L \* R0.L;
416-
660: 14 c2 1a a0 R0.H = R3.H \* R2.L \(M\), R0 = R3.L \* R2.L;
414+
658: 04 c2 be 66 R2.H = R7.L \* R6.H, R2.L = R7.H \* R6.H;
415+
65c: 04 c2 08 e1 R4.H = R1.H \* R0.H, R4.L = R1.L \* R0.L;
416+
660: 14 c2 1a a0 R0.H = R3.H \* R2.L \(M\), R0.L = R3.L \* R2.L;
417417
664: 00 c0 13 46 A1 = R2.L \* R3.H, A0 = R2.H \* R3.H;
418418
668: 01 c0 08 c0 A1 \+= R1.H \* R0.H, A0 = R1.L \* R0.L;
419419
66c: 01 c0 1b 96 A1 \+= R3.H \* R3.L, A0 -= R3.H \* R3.H;
@@ -469,7 +469,7 @@ Disassembly of section .text:
469469
734: 00 9e 32 9c
470470
738: 8b c8 9a 2f R6 = \(A0 \+= R3.H \* R2.H\) \(FU\) \|\| I2 -= M0 \|\| NOP;
471471
73c: 72 9e 00 00
472-
740: 14 c2 1a a0 R0.H = R3.H \* R2.L \(M\), R0 = R3.L \* R2.L;
472+
740: 14 c2 1a a0 R0.H = R3.H \* R2.L \(M\), R0.L = R3.L \* R2.L;
473473
744: 1c c2 b8 60 R3 = R7.L \* R0.H \(M\), R2 = R7.L \* R0.L;
474474
748: 1c c0 b8 60 R3 = \(A1 = R7.L \* R0.H\) \(M\), R2 = \(A0 = R7.L \* R0.L\);
475475
74c: 44 c0 23 04 R0.H = \(A1 = R4.L \* R3.L\), A0 = R4.H \* R3.L \(T\);

opcodes/ChangeLog

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
1+
2011-02-13 Mike Frysinger <[email protected]>
2+
3+
* bfin-dis.c (decode_dsp32mult_0): Add 1 to dst for mac1. Output
4+
dregs only when P is set, and dregs_lo otherwise.
5+
16
2011-02-13 Mike Frysinger <[email protected]>
27

38
* bfin-dis.c (decode_dsp32alu_0): Delete BYTEOP2M code.

opcodes/bfin-dis.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3084,7 +3084,7 @@ decode_dsp32mult_0 (TIword iw0, TIword iw1, disassemble_info *outf)
30843084

30853085
if (w1)
30863086
{
3087-
OUTS (outf, P ? dregs (dst | 1) : dregs_hi (dst));
3087+
OUTS (outf, P ? dregs (dst + 1) : dregs_hi (dst));
30883088
OUTS (outf, " = ");
30893089
decode_multfunc (h01, h11, src0, src1, outf);
30903090

@@ -3099,7 +3099,7 @@ decode_dsp32mult_0 (TIword iw0, TIword iw1, disassemble_info *outf)
30993099

31003100
if (w0)
31013101
{
3102-
OUTS (outf, dregs (dst));
3102+
OUTS (outf, P ? dregs (dst) : dregs_lo (dst));
31033103
OUTS (outf, " = ");
31043104
decode_multfunc (h00, h10, src0, src1, outf);
31053105
}

0 commit comments

Comments
 (0)