Device specific ISA support in AVR

S, Pitchumani Pitchumani.S@atmel.com
Tue Feb 25 12:05:00 GMT 2014


Hi,

Few AVR Xmega devices have specific instruction support than the architecture
it belongs to. For example atxmega128b1 device has RMW instructions (XCH,LAC,
LAS and LAT) support, but not all avrxmega6 devices have.

Now, avr-gcc passes architecture name to assembler instead of device name. So,
RMW instructions are not recognized (illegal opcode error) by assembler.

To address this issue, we could add device specific ISA to device details 
in GCC. Driver can pass additional option based on specific ISA that a device
has. Assembler can add device specific ISA to architecture ISA based on the
option it receives.

I have attached patches for avr-gcc and avr-as to address this issue.

device-specific-isa-avr-gcc.patch:
* Device specific ISA information is added to device details. 
* avr-gcc passes -mrmw option to assembler if the selected device
has RMW instruction support.

device-specific-isa-avr-as.patch:
* Add option -mrmw.
* Add AVR_ISA_RMW to current architecture ISA if -mrmw option specified.

Please review the patches and comment.

Thanks,
Pitchumani

gcc/ChangeLog
2014-02-25  Pitchumani Sivanupandi  <pitchumani.s@atmel.com>

    * config/avr/avr-arch.h: Add avr_additional_isa enum to have device
    specific ISA information.
    (avr_mcu_t): Add additional_isa field for device specific ISA.
    * config/avr/avr-devices.c (avr_mcu_types): Update AVR_MCU macro to
    include additional isa field.
    * config/avr/avr-mcus.def: Update device details with corresponding
    additional isa info.
    * config/avr/driver-avr.c (avr_device_to_as): Pass -mrmw option to
    assembler if RMW isa supported by current device.
    * config/avr/genmultilib.awk: Update as device info structure changed.

gcc/testsuite/ChangeLog
2014-02-25 Pitchumani Sivanupandi  <pitchumani.s@atmel.com>

    * gcc.target/avr/additional-isa.c: New test.

gas/ChangeLog
2014-02-25 Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * config/tc-avr.c: Add specified_mcu variable for selected mcu.
    (enum options): add OPTION_RMW_ISA for -mrmw option.
    (struct option md_longopts): Add mrmw option.
    (md_show_usage): add -mrmw option description.
    (md_parse_option): Update isa details if -mrmw option specified.
    * doc/c-avr.texi: Add doc for new option -mrmw.

gas/testsuite/ChangeLog
2014-02-25 Pitchumani Sivanupandi <pitchumani.s@atmel.com>

    * gas/avr/avr.exp: Run new tests.
    * gas/avr/rmw.d: Add test for additional ISA support.
    * gas/avr/rmw.s: Ditto.

-------------- next part --------------
A non-text attachment was scrubbed...
Name: device-specific-isa-avr-gcc.patch
Type: application/octet-stream
Size: 57257 bytes
Desc: device-specific-isa-avr-gcc.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20140225/284a84cb/attachment.obj>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: device-specific-isa-avr-as.patch
Type: application/octet-stream
Size: 5248 bytes
Desc: device-specific-isa-avr-as.patch
URL: <https://sourceware.org/pipermail/binutils/attachments/20140225/284a84cb/attachment-0001.obj>


More information about the Binutils mailing list