Bug 27191 - m68k: incorrect assembly of fmovem.l #data,%fpsr/%fpcr
Summary: m68k: incorrect assembly of fmovem.l #data,%fpsr/%fpcr
Status: UNCONFIRMED
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: unspecified
: P2 normal
Target Milestone: ---
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-01-16 10:21 UTC by Thorsten Otto
Modified: 2021-01-16 11:06 UTC (History)
0 users

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Thorsten Otto 2021-01-16 10:21:26 UTC
When using immediate data for a fmovem.l to control register, and more than one register ist specified, only a single constant is written:

 	fmovem.l	#0xffffffff00000000,%fpsr/%fpcr
	nop

result:

   0:   f23c 9800 0000  fmoveml #0,%fpsr/%fpcr
   6:   0000 
   8:   4e71            nop

Only the low 32-bit value was written. Specifying for example

 	fmovem.l	#0xffffffffffffffffffffffff,%fpsr/%fpcr/%fpiar
	nop

does not work at all, because the constant overflows.
Comment 1 Andreas Schwab 2021-01-16 10:28:37 UTC
The IMM form only allows a single destination register.  Both insns should be rejected.
Comment 2 Thorsten Otto 2021-01-16 11:06:31 UTC
Are you sure about this? I can't find any indication for that in the manual. Only register-direct are flagged as being allowed only for a single register.

And actually, that is instruction is emulated, and also tested, by the FPSP060 support package:

https://github.com/torvalds/linux/blob/1d94330a437a573cfdf848f6743b1ed169242c8a/arch/m68k/ifpsp060/src/ftest.S#L647