[llvm-dev] [RFC] Print FP constant assembly in hexadecimal form instead of decimal

Jinsong Ji via llvm-dev llvm-dev at lists.llvm.org
Tue Feb 4 08:01:57 PST 2020


Thank you for the feedback and suggestion.

There are more than 300 testcases with hex form in assembly test under llvm
source tree.
So I think at least following major tools and platforms have supported it
well.
And I have tried on the platforms that I can access, no problem found yet
either.

$ grep ".long\s*0x" test -R|cut -d ':' -f 1 | cut -d '/' -f 3 |sort|uniq
AArch64
AMDGPU
ARM
AsmParser
COFF
Hexagon
llvm-dwarfdump
llvm-objdump
llvm-readobj
llvm-symbolizer
MachO
PowerPC
RISCV
Thumb
X86



Best,

Jinsong Ji (纪金松), PhD.

XL/LLVM on Power Compiler Development
E-mail: jji at us.ibm.com



From:	Nemanja Ivanovic <nemanja.i.ibm at gmail.com>
To:	Jacob Lifshay <programmerjake at gmail.com>
Cc:	Jinsong Ji <jji at us.ibm.com>, llvm-dev
            <llvm-dev at lists.llvm.org>, Robert Enenkel <enenkel at ca.ibm.com>
Date:	02/04/2020 08:52 AM
Subject:	[EXTERNAL] Re: [llvm-dev] [RFC] Print FP constant assembly in
            hexadecimal form instead of decimal



Seems reasonable to me, but we should make sure that various assemblers out
there support this.
I think it would make sense to try this out on some number of platforms
before proceeding. Perhaps a few Linux distros, AIX, Windows, MacOS,
FreeBSD. And of course, to make sure that LLVM's own llvm-mc understands
it :) (but I suspect this is in the mentioned patch which I haven't looked
at yet).

On Tue, Jan 28, 2020 at 4:33 PM Jacob Lifshay via llvm-dev <
llvm-dev at lists.llvm.org> wrote:
  On Tue, Jan 28, 2020 at 11:05 AM Jinsong Ji via llvm-dev
  <llvm-dev at lists.llvm.org> wrote:
  >
  > Hi:
  >
  > When debugging some floating point assembly, we found it is
  inconvenient to read the decimal constants in assembly.
  >
  > In hex form many FP numbers are immediately recognizable, their
  exponents are more obvious etc.
  > We normally use hex form in debugger or LLVM IR,
  > not sure what is the reason that we want to use decimal in assembly?

  This seems like a really good idea!

  Jacob
  _______________________________________________
  LLVM Developers mailing list
  llvm-dev at lists.llvm.org
  https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200204/ab42976c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: graycol.gif
Type: image/gif
Size: 105 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20200204/ab42976c/attachment.gif>


More information about the llvm-dev mailing list