bug-binutils
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug gas/24982] New: m68k tdiv instructions assembled incorrectly


From: miod at online dot fr
Subject: [Bug gas/24982] New: m68k tdiv instructions assembled incorrectly
Date: Mon, 09 Sep 2019 18:35:16 +0000

https://sourceware.org/bugzilla/show_bug.cgi?id=24982

            Bug ID: 24982
           Summary: m68k tdiv instructions assembled incorrectly
           Product: binutils
           Version: 2.33 (HEAD)
            Status: UNCONFIRMED
          Severity: minor
          Priority: P2
         Component: gas
          Assignee: unassigned at sourceware dot org
          Reporter: miod at online dot fr
  Target Milestone: ---

Created attachment 11982
  --> https://sourceware.org/bugzilla/attachment.cgi?id=11982&action=edit
m68k-opc.c patch

Motorola SVR4 as uses "tdiv" as an alias for a 32-bit divide operator (32-bit
operand, 32-bit divider, get 32-bit remainder and quotient). In other words,
"tdivs" is a synonym of "divsll" and "tdivu" of "divull".

However, the current translation in opc-m68k.c translates them to "divsl" and
"divul", which are the 64-bit operand, 32-bit divider, flavour. This
translation has been incorrect since at least 1995 since it is already
incorrect in the sourceware CVS import. Of course, the poor choice of mnemonics
(div{s,u}l being 32/32 and div{s,u} being 64/32) probably led to that error.

This probably went unnoticed because not much code, outside of Motorola's own
code, has been written using the "tdiv" mnemonics; and such code was fed to
Motorola's as which does not suffer from that bug.

Trivial diff attached.

-- 
You are receiving this mail because:
You are on the CC list for the bug.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]