Bug 15082 - tic6x - incorrect decoding of MPYDP instruction with xpath bit set
Summary: tic6x - incorrect decoding of MPYDP instruction with xpath bit set
Status: RESOLVED FIXED
Alias: None
Product: binutils
Classification: Unclassified
Component: binutils (show other bugs)
Version: 2.23
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-29 19:56 UTC by Alexis Deruelle
Modified: 2013-03-20 16:58 UTC (History)
1 user (show)

See Also:
Host:
Target:
Build:
Last reconfirmed:


Attachments
Patch that fixes mpydp decoding with x-path bit set (1.66 KB, patch)
2013-01-29 19:56 UTC, Alexis Deruelle
Details | Diff
Patch that fixes mpydp decoding with x-path bit set (1.68 KB, patch)
2013-02-14 09:30 UTC, Alexis Deruelle
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexis Deruelle 2013-01-29 19:56:30 UTC
Created attachment 6835 [details]
Patch that fixes mpydp decoding with x-path bit set

MPYDP instruction opcode doesn't seem to have any restriction on the value of the x bit the opcode and it should be valid for the instruction to be able to use the cross-path (see SPRUFE8B.pdf p.318).

Hence instruction of the form 

    mpydp .M2X b1:b0,a1:a0,b1:b0

should also be valid but current implementation forbids the use of cross path for the src2 operand.

Proposed patch :

 - modify gas test-case for mpydp instruction to accept it as a valid instruction
 - rename mpydp's specific operand type from ORREGD1324 to ORXREGD1324
 - and use tic6x_operand_xregpair for ORXREGD1324 operand type so that operand register can use cross-path.
 - remove the FIX 'x' (x-path) opcode field in FIXed fields list
 - remove the TIC6X_FLAG_NO_CROSS

This has been verified by looking at disassembled working code, didn't cross-checked with Ti SDK though...
Comment 1 Alexis Deruelle 2013-01-30 09:33:58 UTC
Ti's dis6x output for the case (compiled with cl6x -mv6740) :

00000000             .text:
00000000   00000000           NOP
00000004   00001702           MPYDP.M2X     B1:B0,A1:A0,B1:B0
Comment 2 Alexis Deruelle 2013-02-14 09:30:09 UTC
Created attachment 6872 [details]
Patch that fixes mpydp decoding with x-path bit set

Add changelog entries for all modified files
Comment 3 Sourceware Commits 2013-03-20 16:56:36 UTC
CVSROOT:	/cvs/src
Module name:	src
Changes by:	nickc@sourceware.org	2013-03-20 16:56:34

Modified files:
	include/opcode : ChangeLog tic6x-opcode-table.h 
	gas/testsuite  : ChangeLog 
	gas/testsuite/gas/tic6x: insns-bad-1.l insns-bad-1.s 
	                         insns-c674x.d insns-c674x.s 

Log message:
	PR gas/15082
	* tic6x-opcode-table.h: Rename mpydp's specific operand type macro
	from ORREGD1324 to ORXREGD1324 and make it cross-path-able through
	tic6x_operand_xregpair operand coding type.
	Make mpydp instruction cross-path-able, ie: remove the FIXed 'x'
	opcode field, usu ORXREGD1324 for the src2 operand and remove the
	TIC6X_FLAG_NO_CROSS.
	
	* gas/tic6x/insns-bad-1.s: Remove test-case for mpydp with
	cross-path.
	* gas/tic6x/insns-bad-1.l: Update expected output.
	* gas/tic6x/insns-c674x.s: Add a test-case for mpydp with
	cross-path.
	* gas/tic6x/insns-c674x.d: Update expected output.

Patches:
http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/opcode/ChangeLog.diff?cvsroot=src&r1=1.488&r2=1.489
http://sourceware.org/cgi-bin/cvsweb.cgi/src/include/opcode/tic6x-opcode-table.h.diff?cvsroot=src&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/ChangeLog.diff?cvsroot=src&r1=1.2205&r2=1.2206
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/tic6x/insns-bad-1.l.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/tic6x/insns-bad-1.s.diff?cvsroot=src&r1=1.2&r2=1.3
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/tic6x/insns-c674x.d.diff?cvsroot=src&r1=1.4&r2=1.5
http://sourceware.org/cgi-bin/cvsweb.cgi/src/gas/testsuite/gas/tic6x/insns-c674x.s.diff?cvsroot=src&r1=1.4&r2=1.5
Comment 4 Nick Clifton 2013-03-20 16:58:11 UTC
Patch applied.