[llvm] r307730 - Fully fix the movw/movt addend.

Martin Storsjö via llvm-commits llvm-commits at lists.llvm.org
Wed Jul 12 03:09:18 PDT 2017


On Tue, 11 Jul 2017, Rafael Espindola via llvm-commits wrote:

> Author: rafael
> Date: Tue Jul 11 16:18:25 2017
> New Revision: 307730
>
> URL: http://llvm.org/viewvc/llvm-project?rev=307730&view=rev
> Log:
> Fully fix the movw/movt addend.
>
> The issue is not if the value is pcrel. It is whether we have a
> relocation or not.
>
> If we have a relocation, the static linker will select the upper
> bits. If we don't have a relocation, we have to do it.
>

> Modified: llvm/trunk/test/MC/ARM/elf-movt.s
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/test/MC/ARM/elf-movt.s?rev=307730&r1=307729&r2=307730&view=diff
> ==============================================================================
> --- llvm/trunk/test/MC/ARM/elf-movt.s (original)
> +++ llvm/trunk/test/MC/ARM/elf-movt.s Tue Jul 11 16:18:25 2017
> @@ -16,10 +16,17 @@ barf:
> .LPC0_2:
> 	movw	r0, :lower16:extern_symbol+1234
> 	movt	r0, :upper16:extern_symbol+1234
> +
> +	movw	r0, :lower16:(foo - bar + 1234)
> +	movt	r0, :upper16:(foo - bar + 1234)
> +foo:
> +bar:
> +
> @ ASM:          movw    r0, :lower16:(GOT-(.LPC0_2+8))
> @ ASM-NEXT:     movt    r0, :upper16:(GOT-(.LPC0_2+8))
> @ ASM:          movw    r0, :lower16:(extern_symbol+1234)
> -@ ASM-NEXT:     movt    r0, :upper16:(extern_symbol+1234)
> +@ ASM:          movw    r0, :lower16:((foo-bar)+1234)
> +@ ASM-NEXT:     movt    r0, :upper16:((foo-bar)+1234)

I presume this removal of the existing movt check was unintentional?

// Martin


More information about the llvm-commits mailing list