This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: [PATCH, PR86257, i386/debug] Fix insn prefix in tls_global_dynamic_64_<mode>
- From: Tom de Vries <tdevries at suse dot de>
- To: Nathan Sidwell <nathan at acm dot org>, Jan Hubicka <hubicka at ucw dot cz>
- Cc: gcc-patches at gcc dot gnu dot org, Uros Bizjak <ubizjak at gmail dot com>
- Date: Tue, 17 Jul 2018 18:19:26 +0200
- Subject: Re: [PATCH, PR86257, i386/debug] Fix insn prefix in tls_global_dynamic_64_<mode>
- References: <20180624115027.zjjyorpdpb32ekm6@localhost.localdomain> <20180624215648.GB66444@kam.mff.cuni.cz> <91150fb0-e08c-3e59-1c47-ff0112fa0b05@suse.de> <ccaad4b3-e311-3c91-84e1-d16a7c428dc4@acm.org> <bb76fc6c-6ae3-7d3a-74fd-8fa2db69cc74@suse.de>
On 06/25/2018 03:02 PM, Tom de Vries wrote:
> On 06/25/2018 02:45 PM, Nathan Sidwell wrote:
>> On 06/25/2018 08:25 AM, Tom de Vries wrote:
>>
>>> If we'd implemented something like this in gas:
>>> ...
>>> .insn
>>> .byte 0x66
>>> .endinsn
>>> ...
>>> we could fix this more generically.
>>
>> Doesn't arm gas provide this functionality with some target-specific
>> pseudo? It'd be good to copy that.
>>
>> ah, inst:
>>
>> @cindex @code{.inst} directive, ARM
>> @item .inst @var{opcode} [ , @dots{} ]
>> @itemx .inst.n @var{opcode} [ , @dots{} ]
>> @itemx .inst.w @var{opcode} [ , @dots{} ]
>> Generates the instruction corresponding to the numerical value
>> @var{opcode}.
>> @code{.inst.n} and @code{.inst.w} allow the Thumb instruction size to be
>> specified explicitly, overriding the normal encoding rules.
>>
>>
>> (ARM needs to distinguish data from insns to emit the mapping symbols
>> needed for be8 endianness xforms).
>>
>
> Hmm, thanks for pointing that out. There's also something similar for
> s390 and riscv.
>
> For mips there's another form of .insn (
> https://sourceware.org/binutils/docs/as/MIPS-insn.html#index-_002einsn
> ), which is similar to what I was proposing:
> ...
> 9.27.8 Directive to mark data as an instruction
>
> The .insn directive tells as that the following data is actually
> instructions. This makes a difference in MIPS 16 and microMIPS modes:
> when loading the address of a label which precedes instructions, as
> automatically adds 1 to the value, so that jumping to the loaded address
> will do the right thing.
> ...
>
Filed as PR23423 - "generic directive to mark data as insn" (
https://sourceware.org/bugzilla/show_bug.cgi?id=23423 ).
Thanks,
- Tom