Bug 15043 - [avr] Support new command line options -mdes and -matomics
Summary: [avr] Support new command line options -mdes and -matomics
Status: RESOLVED WORKSFORME
Alias: None
Product: binutils
Classification: Unclassified
Component: gas (show other bugs)
Version: 2.24
: P2 enhancement
Target Milestone: 2.25
Assignee: Not yet assigned to anyone
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2013-01-20 18:57 UTC by Georg-Johann Lay
Modified: 2016-06-22 18:14 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Georg-Johann Lay 2013-01-20 18:57:02 UTC
The avr tools currently support around 200 devices and there are more, unsupported devices.

It makes hardly any sense to add a -mmcu=device switch for each and every target:  For binutils, it's enough to know the instruction set architecture (ISA) to assemble for.

Thus, command line switches like -mdes and -matomic could greatly reduce the time until new devices are supported, because the compiler need not to wait until respective support in binutils is available:

The compiler could just call avr-as with -mmcu=core -mdes if it knows that the device supports the DES instruction and with -mmcu=core -mno-des, otherwise.

The options shall work as follows:

With -mdes, the assembler will accept and assemble the DES instruction.
With -mno-des, the assembler will issue an "unknown instruction" error.

If a device is specified with -mmcu= then the assembler knows the right setting for -m[no-]des and uses it, provided it is not explicitly overridden by -m[no-]des. Alternatively, -m[no-]des could be ignored in that case.

If a core like avr4 definitely does not support DES instruction, the option is ignored and the behavior the same as it would be with -mno-des.

Similar for -m[no-]atomics and the instructions XCH, LAC, LAS, LAT.
Comment 1 Georg-Johann Lay 2016-06-22 18:14:57 UTC
Meanwhile, there is -mrmw to support read-modify-write (LAS, LAC, LAT and XCH) instructions since 2.25:

https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=d24e46e3e247e46eb2f5e7ebb5efd0f9fcc5fcdd