llvm / llvm-project

The LLVM Project is a collection of modular and reusable compiler and toolchain technologies.
http://llvm.org
Other
26.98k stars 11.05k forks source link

ARM assembler refuses to assemble instruction #50639

Open llvmbot opened 2 years ago

llvmbot commented 2 years ago
Bugzilla Link 51297
Version unspecified
OS Linux
Reporter LLVM Bugzilla Contributor
CC @DougGregor,@zygoloid

Extended Description

jacob@rock64:~/lcc/book/test$ cat bug.s
    .text
main:
    ldr x15,=0x401acccccccccccd # assembles and executes correctly
    ldr d15,=0x401acccccccccccd # <<<<<<<<<< BUG <<<<<<<<<<<<<
    ret
    .pool
.L9:
    .size main,.L9-main
    .globl main
jacob@rock64:~/lcc/book/test$ clang bug.s
bug.s:4:10: error: Immediate too large for register
        ldr d15,=0x401acccccccccccd
                ^
jacob@rock64:~/lcc/book/test$ as -c -o bug bug.s
jacob@rock64:~/lcc/book/test$ 

As you can see, "as" (gnu as) assembles correctly the SAME program. Now, at the execution, the instruction DOESN'T WORK at all. Some rubbish is loaded into d15. Is this a bug in clang? Or is this a bug in "as" that assembles an incorrect instruction? Or is this a bug in clang AND as? Or is this a bug in the rockchip processor that doesn't do what is supposed to do? Or is this a bug in the documentation that doesn't warn that d15 shouldn't be used with "ldr"?

PLEEEEEEEZE enlightmen me.

Thanks

llvmbot commented 2 years ago

One month later NOTHING! Is anyone reading this?

llvmbot commented 6 months ago

@llvm/issue-subscribers-backend-arm

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [51297](https://llvm.org/bz51297) | | Version | unspecified | | OS | Linux | | Reporter | LLVM Bugzilla Contributor | | CC | @DougGregor,@zygoloid | ## Extended Description ``` jacob@rock64:~/lcc/book/test$ cat bug.s ``` ```asm .text main: ldr x15,=0x401acccccccccccd # assembles and executes correctly ldr d15,=0x401acccccccccccd # <<<<<<<<<< BUG <<<<<<<<<<<<< ret .pool .L9: .size main,.L9-main .globl main ``` ``` jacob@rock64:~/lcc/book/test$ clang bug.s bug.s:4:10: error: Immediate too large for register ldr d15,=0x401acccccccccccd ^ jacob@rock64:~/lcc/book/test$ as -c -o bug bug.s jacob@rock64:~/lcc/book/test$ ``` As you can see, "as" (gnu as) assembles correctly the SAME program. Now, at the execution, the instruction DOESN'T WORK at all. Some rubbish is loaded into d15. Is this a bug in clang? Or is this a bug in "as" that assembles an incorrect instruction? Or is this a bug in clang AND as? Or is this a bug in the rockchip processor that doesn't do what is supposed to do? Or is this a bug in the documentation that doesn't warn that d15 shouldn't be used with "ldr"? PLEEEEEEEZE enlightmen me. Thanks
llvmbot commented 6 months ago

@llvm/issue-subscribers-backend-aarch64

Author: None (llvmbot)

| | | | --- | --- | | Bugzilla Link | [51297](https://llvm.org/bz51297) | | Version | unspecified | | OS | Linux | | Reporter | LLVM Bugzilla Contributor | | CC | @DougGregor,@zygoloid | ## Extended Description ``` jacob@rock64:~/lcc/book/test$ cat bug.s ``` ```asm .text main: ldr x15,=0x401acccccccccccd # assembles and executes correctly ldr d15,=0x401acccccccccccd # <<<<<<<<<< BUG <<<<<<<<<<<<< ret .pool .L9: .size main,.L9-main .globl main ``` ``` jacob@rock64:~/lcc/book/test$ clang bug.s bug.s:4:10: error: Immediate too large for register ldr d15,=0x401acccccccccccd ^ jacob@rock64:~/lcc/book/test$ as -c -o bug bug.s jacob@rock64:~/lcc/book/test$ ``` As you can see, "as" (gnu as) assembles correctly the SAME program. Now, at the execution, the instruction DOESN'T WORK at all. Some rubbish is loaded into d15. Is this a bug in clang? Or is this a bug in "as" that assembles an incorrect instruction? Or is this a bug in clang AND as? Or is this a bug in the rockchip processor that doesn't do what is supposed to do? Or is this a bug in the documentation that doesn't warn that d15 shouldn't be used with "ldr"? PLEEEEEEEZE enlightmen me. Thanks