New XMega instructions

Go To Last Post
5 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I just tried some of the new XMega instructions in GSS-AS, and although they are not formatted in the IDE like valid instructions, there was no error on compile.

For instance, this "seemed" to work...

lac z,r16

Does this mean that GCC knows these instructions, or is it just ignoring them? Being away from my work, I can't test this on real hardware.

Brad

I Like to Build Stuff : http://www.AtomicZombie.com

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

They seem to be there and do something ;-)

// uint8_t lac_test(uint8_t *, uint8_t);
        
.global lac_test
lac_test:
        movw    ZL,r24
        lac     Z, r22
        ld      r24,Z
        ret
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Did you miss my post in another thread about this? The check in history for binutils shows the latest new instructions were added (by Eric Waddington in fact) seven months ago. So look for binutils major releases since that date and see if the one in AS6 is one. Personally I doubt it though I guess the most recent SP2 may have updated binutils?

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

I used the latest Atmel toolchain (3.4.1) for linux. It's based on binutils 2.22. But in avr-patches.tar.gz there is avr-patches/binutils/305-binutils-new-usb-insns.patch which contins

+AVR_INSN (xch,  "z,r", "1001001rrrrr0100", 1, AVR_ISA_XMEGAU, 0x9204)
+AVR_INSN (las,  "z,r", "1001001rrrrr0101", 1, AVR_ISA_XMEGAU, 0x9205)
+AVR_INSN (lac,  "z,r", "1001001rrrrr0110", 1, AVR_ISA_XMEGAU, 0x9206)
+AVR_INSN (lat,  "z,r", "1001001rrrrr0111", 1, AVR_ISA_XMEGAU, 0x9207)
======================================================================
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

If binutils accept the instructions, you can use them. You can also read a dump, e.g. generated with "avr-objdump -d ..." to see if the instructions are there.

avr-gcc does not know anything about these instructions, it's all Binutils, namely avr-as.

In official Binutils, it went upstream 2012-06-07 for 2.23: http://sourceware.org/ml/binutil...

avrfreaks does not support Opera. Profile inactive.