opcodes/arm: use '@' consistently for the comment character
authorAndrew Burgess <aburgess@redhat.com>
Fri, 2 Sep 2022 17:15:30 +0000 (18:15 +0100)
committerAndrew Burgess <aburgess@redhat.com>
Tue, 1 Nov 2022 09:32:13 +0000 (09:32 +0000)
commit8cb6e17571f3fb66ccd4fa19f881602542cd06fc
treee55c7d09de4ee64ed49f0c9b8b345b2f666ce0de
parent1751ca43fdae8d19e13ae55430700a60eb0f30d3
opcodes/arm: use '@' consistently for the comment character

Looking at the ARM disassembler output, every comment seems to start
with a ';' character, so I assumed this was the correct character to
start an assembler comment.

I then spotted a couple of places where there was no ';', but instead,
just a '@' character.  I thought that this was a case of a missing
';', and proposed a patch to add the missing ';' characters.

Turns out I was wrong, '@' is actually the ARM assembler comment
character, while ';' is the statement separator.  Thus this:

    nop    ;@ comment

is two statements, the first is the 'nop' instruction, while the
second contains no instructions, just the '@ comment' comment text.

This:

    nop    @ comment

is a single 'nop' instruction followed by a comment.  And finally,
this:

    nop    ; comment

is two statements, the first contains the 'nop' instruction, while the
second contains the instruction 'comment', which obviously isn't
actually an instruction at all.

Why this matters is that, in the next commit, I would like to add
libopcodes syntax styling support for ARM.

The question then is how should the disassembler style the three cases
above?

As '@' is the actual comment start character then clearly the '@' and
anything after it can be styled as a comment.  But what about ';' in
the second example?  Style as text?  Style as a comment?

And the third example is even harder, what about the 'comment' text?
Style as an instruction mnemonic?  Style as text?  Style as a comment?

I think the only sensible answer is to move the disassembler to use
'@' consistently as its comment character, and remove all the uses of
';'.

Then, in the next commit, it's obvious what to do.

There's obviously a *lot* of tests that get updated by this commit,
the only actual code changes are in opcodes/arm-dis.c.
237 files changed:
gas/testsuite/gas/arm/adr.d
gas/testsuite/gas/arm/adrl.d
gas/testsuite/gas/arm/arch4t-eabi.d
gas/testsuite/gas/arm/arch4t.d
gas/testsuite/gas/arm/arch7.d
gas/testsuite/gas/arm/arch7a-mp.d
gas/testsuite/gas/arm/arch7r-mp.d
gas/testsuite/gas/arm/archv6t2.d
gas/testsuite/gas/arm/archv8m-base.d
gas/testsuite/gas/arm/archv8m-main-dsp-1.d
gas/testsuite/gas/arm/archv8m-main.d
gas/testsuite/gas/arm/arm3.d
gas/testsuite/gas/arm/arm6.d
gas/testsuite/gas/arm/arm7dm.d
gas/testsuite/gas/arm/arm7t.d
gas/testsuite/gas/arm/armv1.d
gas/testsuite/gas/arm/armv7-a+virt.d
gas/testsuite/gas/arm/armv8-2-fp16-scalar-ext.d
gas/testsuite/gas/arm/armv8-2-fp16-scalar-thumb-ext.d
gas/testsuite/gas/arm/armv8-2-fp16-scalar-thumb.d
gas/testsuite/gas/arm/armv8-2-fp16-scalar.d
gas/testsuite/gas/arm/armv8.1-m.main-fp.d
gas/testsuite/gas/arm/armv8.1-m.main-hp.d
gas/testsuite/gas/arm/bl-local-2.d
gas/testsuite/gas/arm/bl-local-v4t.d
gas/testsuite/gas/arm/blx-bad.d
gas/testsuite/gas/arm/blx-local-thumb.d
gas/testsuite/gas/arm/blx-local.d
gas/testsuite/gas/arm/branch-reloc.d
gas/testsuite/gas/arm/ccs.d
gas/testsuite/gas/arm/copro-arm_v2plus-arm_v2.d
gas/testsuite/gas/arm/copro-arm_v5plus-arm_v5.d
gas/testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-1.d
gas/testsuite/gas/arm/copro-thumb_v6t2plus-thumb_v6t2-2.d
gas/testsuite/gas/arm/crc32-armv8-a-bad.d
gas/testsuite/gas/arm/crc32-armv8-r-bad.d
gas/testsuite/gas/arm/dis-data3.d
gas/testsuite/gas/arm/el_segundo.d
gas/testsuite/gas/arm/float.d
gas/testsuite/gas/arm/group-reloc-alu.d
gas/testsuite/gas/arm/group-reloc-ldrs.d
gas/testsuite/gas/arm/immed.d
gas/testsuite/gas/arm/immed2.d
gas/testsuite/gas/arm/inst.d
gas/testsuite/gas/arm/iwmmxt.d
gas/testsuite/gas/arm/ldconst.d
gas/testsuite/gas/arm/ldr-global.d
gas/testsuite/gas/arm/ldr-t.d
gas/testsuite/gas/arm/ldr.d
gas/testsuite/gas/arm/ldst-offset0.d
gas/testsuite/gas/arm/ldst-pc.d
gas/testsuite/gas/arm/m0-load-pseudo.d
gas/testsuite/gas/arm/m23-load-pseudo.d
gas/testsuite/gas/arm/m33-load-pseudo.d
gas/testsuite/gas/arm/macro1.d
gas/testsuite/gas/arm/mapdir.d
gas/testsuite/gas/arm/mapmisc.d
gas/testsuite/gas/arm/mapsecs.d
gas/testsuite/gas/arm/mapshort-eabi.d
gas/testsuite/gas/arm/mapshort-elf.d
gas/testsuite/gas/arm/mask_1-armv8-a.d
gas/testsuite/gas/arm/mask_1-armv8-r.d
gas/testsuite/gas/arm/mrs-msr-arm-v6.d
gas/testsuite/gas/arm/mrs-msr-arm-v7-a.d
gas/testsuite/gas/arm/msr-imm.d
gas/testsuite/gas/arm/mve-vand.d
gas/testsuite/gas/arm/mve-vbic.d
gas/testsuite/gas/arm/mve-vcvt-3.d
gas/testsuite/gas/arm/mve-vmov-1.d
gas/testsuite/gas/arm/mve-vmov-2.d
gas/testsuite/gas/arm/mve-vmov-vmvn-vorr-vbic.d
gas/testsuite/gas/arm/mve-vmvn.d
gas/testsuite/gas/arm/mve-vorn.d
gas/testsuite/gas/arm/mve-vorr.d
gas/testsuite/gas/arm/neon-cond-bad_t2.d
gas/testsuite/gas/arm/neon-const.d
gas/testsuite/gas/arm/neon-cov.d
gas/testsuite/gas/arm/neon-ldst-rm.d
gas/testsuite/gas/arm/neon-logic.d
gas/testsuite/gas/arm/nops.d
gas/testsuite/gas/arm/offset-1.d
gas/testsuite/gas/arm/offset.d
gas/testsuite/gas/arm/pr21458.d
gas/testsuite/gas/arm/pr24907.d
gas/testsuite/gas/arm/pr25235.d
gas/testsuite/gas/arm/push-pop.d
gas/testsuite/gas/arm/reg-alias.d
gas/testsuite/gas/arm/relax_branch_align.d
gas/testsuite/gas/arm/relax_load_align.d
gas/testsuite/gas/arm/sp-pc-usage-t.d
gas/testsuite/gas/arm/tcompat.d
gas/testsuite/gas/arm/tcompat2.d
gas/testsuite/gas/arm/thumb-eabi.d
gas/testsuite/gas/arm/thumb-nop.d
gas/testsuite/gas/arm/thumb.d
gas/testsuite/gas/arm/thumb1_unified.d
gas/testsuite/gas/arm/thumb2_add.d
gas/testsuite/gas/arm/thumb2_invert.d
gas/testsuite/gas/arm/thumb2_pool.d
gas/testsuite/gas/arm/thumb2_relax.d
gas/testsuite/gas/arm/thumb2_vpool.d
gas/testsuite/gas/arm/thumb2_vpool_be.d
gas/testsuite/gas/arm/thumb32.d
gas/testsuite/gas/arm/thumbv6.d
gas/testsuite/gas/arm/thumbv6k.d
gas/testsuite/gas/arm/tls.d
gas/testsuite/gas/arm/tls_vxworks.d
gas/testsuite/gas/arm/udf.d
gas/testsuite/gas/arm/unpredictable.d
gas/testsuite/gas/arm/vfp-mov-enc.d
gas/testsuite/gas/arm/vfp-neon-overlap.d
gas/testsuite/gas/arm/vfp1.d
gas/testsuite/gas/arm/vfp1xD.d
gas/testsuite/gas/arm/vfp1xD_t2.d
gas/testsuite/gas/arm/vfpv3-32drs.d
gas/testsuite/gas/arm/vldconst.d
gas/testsuite/gas/arm/vldconst_be.d
gas/testsuite/gas/arm/vldr.d
gas/testsuite/gas/arm/wince.d
gas/testsuite/gas/arm/wince_inst.d
gas/testsuite/gas/arm/xscale.d
ld/testsuite/ld-arm/arm-app-abs32.d
ld/testsuite/ld-arm/arm-app.d
ld/testsuite/ld-arm/arm-be8.d
ld/testsuite/ld-arm/arm-call.d
ld/testsuite/ld-arm/arm-lib-plt32.d
ld/testsuite/ld-arm/arm-lib.d
ld/testsuite/ld-arm/arm-movwt.d
ld/testsuite/ld-arm/arm-pic-veneer.d
ld/testsuite/ld-arm/armthumb-lib.d
ld/testsuite/ld-arm/attr-merge-wchar-24.d
ld/testsuite/ld-arm/attr-merge-wchar-42.d
ld/testsuite/ld-arm/callweak.d
ld/testsuite/ld-arm/cortex-a8-far.d
ld/testsuite/ld-arm/cortex-a8-fix-b-plt.d
ld/testsuite/ld-arm/cortex-a8-fix-bcc-plt.d
ld/testsuite/ld-arm/cortex-a8-fix-bl-plt.d
ld/testsuite/ld-arm/cortex-a8-fix-bl-rel-plt.d
ld/testsuite/ld-arm/cortex-a8-fix-blx-plt.d
ld/testsuite/ld-arm/farcall-arm-arm-pic-veneer.d
ld/testsuite/ld-arm/farcall-arm-arm.d
ld/testsuite/ld-arm/farcall-arm-nacl-pic.d
ld/testsuite/ld-arm/farcall-arm-nacl.d
ld/testsuite/ld-arm/farcall-arm-thumb-blx-pic-veneer.d
ld/testsuite/ld-arm/farcall-arm-thumb-blx.d
ld/testsuite/ld-arm/farcall-arm-thumb-pic-veneer.d
ld/testsuite/ld-arm/farcall-arm-thumb.d
ld/testsuite/ld-arm/farcall-data-nacl.d
ld/testsuite/ld-arm/farcall-data.d
ld/testsuite/ld-arm/farcall-group-limit.d
ld/testsuite/ld-arm/farcall-group-size2.d
ld/testsuite/ld-arm/farcall-group.d
ld/testsuite/ld-arm/farcall-mix.d
ld/testsuite/ld-arm/farcall-mix2.d
ld/testsuite/ld-arm/farcall-mixed-app-v5.d
ld/testsuite/ld-arm/farcall-mixed-app.d
ld/testsuite/ld-arm/farcall-mixed-app2.d
ld/testsuite/ld-arm/farcall-mixed-lib-v4t.d
ld/testsuite/ld-arm/farcall-mixed-lib.d
ld/testsuite/ld-arm/farcall-thumb-arm-blx-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-arm-blx.d
ld/testsuite/ld-arm/farcall-thumb-arm-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-arm.d
ld/testsuite/ld-arm/farcall-thumb-thumb-blx-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-thumb-blx.d
ld/testsuite/ld-arm/farcall-thumb-thumb-m-no-profile.d
ld/testsuite/ld-arm/farcall-thumb-thumb-m-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-thumb-m.d
ld/testsuite/ld-arm/farcall-thumb-thumb-pic-veneer.d
ld/testsuite/ld-arm/farcall-thumb-thumb.d
ld/testsuite/ld-arm/farcall-thumb2-purecode.d
ld/testsuite/ld-arm/farcall-thumb2-thumb2-m.d
ld/testsuite/ld-arm/fdpic-main-m.d
ld/testsuite/ld-arm/fdpic-main.d
ld/testsuite/ld-arm/fdpic-shared-m.d
ld/testsuite/ld-arm/fdpic-shared.d
ld/testsuite/ld-arm/fix-arm1176-off.d
ld/testsuite/ld-arm/fix-arm1176-on.d
ld/testsuite/ld-arm/gc-hidden-1.d
ld/testsuite/ld-arm/group-relocs.d
ld/testsuite/ld-arm/ifunc-1.dd
ld/testsuite/ld-arm/ifunc-10.dd
ld/testsuite/ld-arm/ifunc-11.dd
ld/testsuite/ld-arm/ifunc-12.dd
ld/testsuite/ld-arm/ifunc-13.dd
ld/testsuite/ld-arm/ifunc-14.dd
ld/testsuite/ld-arm/ifunc-15.dd
ld/testsuite/ld-arm/ifunc-16.dd
ld/testsuite/ld-arm/ifunc-17.dd
ld/testsuite/ld-arm/ifunc-2.dd
ld/testsuite/ld-arm/ifunc-3.dd
ld/testsuite/ld-arm/ifunc-4.dd
ld/testsuite/ld-arm/ifunc-5.dd
ld/testsuite/ld-arm/ifunc-6.dd
ld/testsuite/ld-arm/ifunc-7.dd
ld/testsuite/ld-arm/ifunc-8.dd
ld/testsuite/ld-arm/ifunc-9.dd
ld/testsuite/ld-arm/jump-reloc-veneers-cond-long-backward.d
ld/testsuite/ld-arm/jump-reloc-veneers-cond-long.d
ld/testsuite/ld-arm/jump-reloc-veneers-long.d
ld/testsuite/ld-arm/long-plt-format.d
ld/testsuite/ld-arm/mixed-app-v5.d
ld/testsuite/ld-arm/mixed-app.d
ld/testsuite/ld-arm/mixed-lib.d
ld/testsuite/ld-arm/movw-merge.d
ld/testsuite/ld-arm/non-contiguous-arm2.d
ld/testsuite/ld-arm/non-contiguous-arm3.d
ld/testsuite/ld-arm/non-contiguous-arm5.d
ld/testsuite/ld-arm/non-contiguous-arm6.d
ld/testsuite/ld-arm/stm32l4xx-cannot-fix-far-ldm.d
ld/testsuite/ld-arm/stm32l4xx-fix-ldm.d
ld/testsuite/ld-arm/stm32l4xx-fix-vldm-dp.d
ld/testsuite/ld-arm/stm32l4xx-fix-vldm.d
ld/testsuite/ld-arm/thumb-plt.d
ld/testsuite/ld-arm/thumb1-adds.d
ld/testsuite/ld-arm/thumb1-movs.d
ld/testsuite/ld-arm/thumb2-bl-as-thumb1-bad.d
ld/testsuite/ld-arm/thumb2-bl-bad.d
ld/testsuite/ld-arm/tls-app.d
ld/testsuite/ld-arm/tls-descrelax-be32.d
ld/testsuite/ld-arm/tls-descrelax-be8.d
ld/testsuite/ld-arm/tls-descrelax-v7.d
ld/testsuite/ld-arm/tls-descrelax.d
ld/testsuite/ld-arm/tls-descseq.d
ld/testsuite/ld-arm/tls-gdesc-neg.d
ld/testsuite/ld-arm/tls-gdesc.d
ld/testsuite/ld-arm/tls-gdierelax.d
ld/testsuite/ld-arm/tls-gdierelax2.d
ld/testsuite/ld-arm/tls-gdlerelax.d
ld/testsuite/ld-arm/tls-lib-loc.d
ld/testsuite/ld-arm/tls-lib.d
ld/testsuite/ld-arm/tls-longplt-lib.d
ld/testsuite/ld-arm/tls-longplt.d
ld/testsuite/ld-arm/tls-thumb1.d
ld/testsuite/ld-arm/vxworks1-lib.dd
ld/testsuite/ld-arm/vxworks1.dd
opcodes/arm-dis.c