[PATCH] D20793: [ELF] - Implemented support for test/binop relaxations from latest ABI.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Tue May 31 01:36:57 PDT 2016


>От: Rafael Espíndola <rafael.espindola at gmail.com>
>Отправлено: 30 мая 2016 г. 23:39
>Кому: reviews+D20793+public+de03617519a1da0d at reviews.llvm.org
>Копия: George Rimar; Rui Ueyama; llvm-commits
>Тема: Re: [PATCH] D20793: [ELF] - Implemented support for test/binop relaxations from latest ABI.
>
>On 30 May 2016 at 12:42, George Rimar <grimar at accesssoftek.com> wrote:
>> grimar created this revision.
>> grimar added reviewers: rafael, ruiu.
>> grimar added subscribers: llvm-commits, grimar.
>>
>> Patch implements next relaxation from latest ABI:
>>
>> "Convert memory operand of test and binop into immediate operand, where binop is one of adc, add, and, cmp, or,
>> sbb, sub, xor instructions, when position-independent code is disabled."
>>
>> It is described in System V Application Binary Interface AMD64 Architecture Processor
>> Supplement Draft Version 0.99.8 (https://github.com/hjl-tools/x86-psABI/wiki/x86-64-psABI-r249.pdf,
>> B.2 "B.2 Optimize GOTPCRELX Relocations").
>>
>> Note: because of broken llvm-mc atm (https://llvm.org/bugs/show_bug.cgi?id=27939),
>> it uses precompiled binary produced by gas as input.
>
>How are you getting instructions that use only 32 bits of a got entry?
>I mean, one can write them in assembly, but what is the use case?

I do not have non-assembly use case. For this patch I used
binutils testcase as reference (ld\testsuite\ld-x86-64\load1.s) and assumed
it tests something from real life needs.

If that is not true, we probably can do not perform relaxations for these and so far do not
generate the special relaxations types by mc.

>Cheers,
>Rafael


More information about the llvm-commits mailing list