This is the mail archive of the
binutils@sourceware.org
mailing list for the binutils project.
Re: [PATCH] Add option -mfence-as-lock-add=[no|yes]
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: Andrew Senkevich <andrew dot n dot senkevich at gmail dot com>
- Cc: Binutils <binutils at sourceware dot org>
- Date: Tue, 26 Jan 2016 05:26:43 -0800
- Subject: Re: [PATCH] Add option -mfence-as-lock-add=[no|yes]
- Authentication-results: sourceware.org; auth=none
- References: <CAMXFM3uagMp5t3fsDysXunTeMqc7xsLxD0h26heLkzzRO=YyUA at mail dot gmail dot com> <CAMe9rOoWm8MsHUCEQBKt8iwASEe6xz_r7G9-Cm2av9dvo7X=oA at mail dot gmail dot com> <CAMXFM3vNDmmSTghK-p2wDJu+4J4ZF87z8A00rLivGhGRfY73zQ at mail dot gmail dot com>
On Tue, Jan 26, 2016 at 5:13 AM, Andrew Senkevich
<andrew.n.senkevich@gmail.com> wrote:
> 2016-01-25 22:26 GMT+03:00 H.J. Lu <hjl.tools@gmail.com>:
>> On Mon, Jan 25, 2016 at 10:50 AM, Andrew Senkevich
>> <andrew.n.senkevich@gmail.com> wrote:
>>> Hi,
>>>
>>> this patch adds -mfence-as-lock-add=[no|yes] option.
>>> With -mfence-as-lock-add=yes lfence, mfence and sfence will be encoded
>>> as lock addl $0x0, (%{r,e}sp).
>>>
>>> gas/
>>> * config/tc-i386.c (avoid_fence): New.
>>> (output_insn): Encode as lock addl $0x0, (%{r,e}sp) if avoid_fence is true.
>>> (OPTION_FENCE_AS_LOCK_ADD): New.
>>
>> Please rename OPTION_FENCE_AS_LOCK_ADD to
>> OPTION_MFENCE_AS_LOCK_ADD.
>>
>>> (md_longopts): Add -mfence-as-lock-add.
>>> (md_parse_option): Handle -mfence-as-lock-add.
>>> (md_show_usage): Add -mfence-as-lock-add=[no|yes].
>>> * doc/c-i386.texi (-mfence-as-lock-add): Document.
>>
>> The doc change is wrong:
>>
>> hjl@gnu-6 gas]$ make info
>> Making info in doc
>> make[1]: Entering directory
>> '/export/build/gnu/binutils/build-x86_64-linux/gas/doc'
>> restore=: && backupdir=".am$$" && \
>> rm -rf $backupdir && mkdir $backupdir && \
>> if (makeinfo --split-size=5000000 --split-size=5000000 --version)
>>>/dev/null 2>&1; then \
>> for f in as.info as.info-[0-9] as.info-[0-9][0-9] as.i[0-9]
>> as.i[0-9][0-9]; do \
>> if test -f $f; then mv $f $backupdir; restore=mv; else :; fi; \
>> done; \
>> else :; fi && \
>> if makeinfo --split-size=5000000 --split-size=5000000 -I
>> "/export/gnu/import/git/sources/binutils-gdb/gas/doc" -I
>> "/export/gnu/import/git/sources/binutils-gdb/gas/../libiberty" -I
>> "/export/gnu/import/git/sources/binutils-gdb/gas/../bfd/doc" -I
>> ../../bfd/doc -I /export/gnu/import/git/sources/binutils-gdb/gas/doc
>> \
>> -o as.info `test -f 'as.texinfo' || echo
>> '/export/gnu/import/git/sources/binutils-gdb/gas/doc/'`as.texinfo; \
>> then \
>> rc=0; \
>> else \
>> rc=$?; \
>> $restore $backupdir/* `echo "./as.info" | sed 's|[^/]*$||'`; \
>> fi; \
>> rm -rf $backupdir; exit $rc
>> /export/gnu/import/git/sources/binutils-gdb/gas/doc/c-i386.texi:337: misplaced {
>> /export/gnu/import/git/sources/binutils-gdb/gas/doc/c-i386.texi:337: misplaced }
>> Makefile:400: recipe for target 'as.info' failed
>> make[1]: *** [as.info] Error 1
>> make[1]: Leaving directory
>> '/export/build/gnu/binutils/build-x86_64-linux/gas/doc'
>> Makefile:2211: recipe for target 'info-recursive' failed
>> make: *** [info-recursive] Error 1
>> [hjl@gnu-6 gas]$
>>
>>> gas/testsuite/
>>>
>>> * gas/i386/i386.exp: Run new tests.
>>> * gas/i386/fence-as-lock-add.s: New.
>>> * gas/i386/fence-as-lock-add-yes.d: Likewise.
>>> * gas/i386/fence-as-lock-add-no.d: Likewise.
>>
>> Need 64-bit testcase.
>
> Please look at attached.
>
+ -mfence-as-lock-add=[no|yes]\n\
+ encode lfence, mfence and sfence as\n\
+ lock addl $0x0, (%%{re}sp)\n"));
Please use space instead of tab here.
+sfence as @samp{lock addl $0x0, (%rsp)} for 64-bit case;
+as @samp{lock addl $0x0, (%esp)} for 32-bit case.
Please change it to
sfence as @samp{lock addl $0x0, (%rsp)} in 64-bit mode and
@samp{lock addl $0x0, (%esp)} in 32-bit mode.
+++ b/gas/testsuite/gas/i386/x86-64-fence-as-lock-add.s
Please remove it since it isn't used.
--
H.J.