<div dir="auto"><div><br><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Thu, Jun 27, 2024, 5:25 PM Jan Beulich <<a href="mailto:jbeulich@suse.com">jbeulich@suse.com</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On 27.06.2024 08:06, Kong, Lingling wrote:<br>
>> --- a/gas/config/tc-i386.c<br>
>> +++ b/gas/config/tc-i386.c<br>
>> @@ -7137,7 +7137,8 @@ md_assemble (char *line)<br>
>> && i.base_reg<br>
>> && i.base_reg->reg_num == RegIP<br>
>> && i.tm.operand_types[0].bitfield.class == Reg<br>
>> - && i.tm.operand_types[2].bitfield.class == Reg)<br>
>> + && (i.tm.operand_types[2].bitfield.class == Reg<br>
>> + || (i.tm.operands == 2 && <a href="http://i.tm.opcode_modifier.nf" rel="noreferrer noreferrer" target="_blank">i.tm.opcode_modifier.nf</a>)))<br>
>> /* Allow APX: add %reg1, foo@gottpoff(%rip), %reg2. */<br>
>> break;<br>
<br>
What does the <a href="http://i.tm.opcode_modifier.nf" rel="noreferrer noreferrer" target="_blank">i.tm.opcode_modifier.nf</a> check achieve here? All EVexMap4<br>
ADD forms permit {nf}. The comment also needs updating, to avoid it<br>
going further stale (it already hasn't been quite accurate). With the<br>
comment properly updated to list all permissible forms, I think you'll<br>
also note that what you add to the condition is too lax: Aiui<br>
<br>
add %rax, foo@GOTTPOFF(%rip)<br>
<br>
is not supposed to be permitted (according to the testsuite additions<br>
you make).<br>
<br>
Finally a question perhaps more for H.J. than for you: Why is it that<br>
ADD is special-cased here for the APX EVEX-encoded case, when there's<br>
no similar special casing for legacy encodings?<br></blockquote></div></div><div dir="auto"><br></div><div dir="auto">ADD is the part of TLS sequence.</div><div dir="auto"><br></div><div dir="auto"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<br>
>> --- a/gas/testsuite/gas/i386/x86-64-gottpoff.s<br>
>> +++ b/gas/testsuite/gas/i386/x86-64-gottpoff.s<br>
>> @@ -18,8 +18,22 @@ _start:<br>
>><br>
>> addq %r8, foo@GOTTPOFF(%rip), %r16<br>
>> addq foo@GOTTPOFF(%rip), %rax, %r12<br>
>> + {nf} addq %r8, foo@GOTTPOFF(%rip), %r16<br>
>> + {nf} addq foo@GOTTPOFF(%rip), %rax, %r12<br>
>><br>
>> .intel_syntax noprefix<br>
>><br>
>> add r16, QWORD PTR [rip + foo@GOTTPOFF], r8<br>
>> add r12, rax, QWORD PTR [rip + foo@GOTTPOFF]<br>
>> + {nf} addq r16, QWORD PTR [rip + foo@GOTTPOFF], r8<br>
>> + {nf} addq r12, rax, QWORD PTR [rip + foo@GOTTPOFF]<br>
> <br>
> + {nf} add r16, QWORD PTR [rip + foo@GOTTPOFF], r8<br>
> + {nf} add r12, rax, QWORD PTR [rip + foo@GOTTPOFF]<br>
> <br>
>> +<br>
>> + .att_syntax prefix<br>
>> +<br>
>> + {nf} addq foo@GOTTPOFF(%rip), %rax<br>
>> + {nf} addq foo@GOTTPOFF(%rip), %r16<br>
<br>
Isn't the {evex} form similarly permitted by the change you make to tc-i386.c?<br>
<br>
Jan<br>
</blockquote></div></div></div>