Skip to content
This repository was archived by the owner on Sep 2, 2018. It is now read-only.

Expected either Y or Z register #213

Closed
shepmaster opened this issue Jun 15, 2016 · 5 comments
Closed

Expected either Y or Z register #213

shepmaster opened this issue Jun 15, 2016 · 5 comments

Comments

@shepmaster
Copy link

While compiling the Rust libcore, I get the error

Expected either Y or Z register

I will update in the next day or two with actual reproduction steps, but figured I'd open it early just in case you magically can figure it out 🌴

@shepmaster
Copy link
Author

define void @atomic_store(i16) {
entry-block:
  store atomic i16 %0, i16* undef monotonic, align 2
  ret void
}

Compile to object code with llc -march=avr < y-or-z.ll | llvm-mc -triple avr -mattr=avr6 -filetype=obj

@dylanmckay
Copy link
Member

I can't seem to reproduce this. I've ran this on the avr-support branch and the same branch (but with the data layout string changed to the one you gave in #214).

My command line:

./llc -march=avr jake.ll | ./llvm-mc -triple avr -mattr=avr6 -filetype=obj

@shepmaster
Copy link
Author

My command line:

Dumb question, but doesn't ./llc -march=avr jake.ll not have any standard out as the assembly is written to the file jake.s?

Here's the assembly if that helps:

        .text
        .macosx_version_min 10, 11
        .file   "testcases/y-or-z-small.ll"
        .globl  atomic_store
        .p2align        1
        .type   atomic_store,@function
atomic_store:                           ; @atomic_store
; BB#0:                                 ; %entry-block
        in      r0, 63
        cli
        st      X, r24
        std     X+1, r25
        out     63, r0
        ret
.Lfunc_end0:
        .size   atomic_store, .Lfunc_end0-atomic_store

@dylanmckay
Copy link
Member

It looks like the issue is with the std instruction - the instruction only supports the X and Y registers.

GAS has the same error when assembling this code.

@dylanmckay
Copy link
Member

Fixed in 4ba1f0a

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants