[PATCH] D73566: [AsmPrinter] Print FP constant in hexadecimal form instead

Jinsong Ji via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Tue Jan 28 10:49:15 PST 2020


jsji created this revision.
jsji added reviewers: t.p.northover, hfinkel, uweigand.
Herald added subscribers: llvm-commits, dmgreen, mstorsjo, arphaman, atanasyan, jrtc27, kbarton, aheejin, hiraditya, jgravelle-google, sbc100, nemanjai, sdardis, dschuff.
Herald added a project: LLVM.

Printing floating point number in decimal is inconvenient for humans.
Verbose asm output will print out floating point values in comments, it
helps.

But in lots of cases, users still need additional work to covert the
decimal back to hex or binary to check the bit patterns,
especially when there are small precision difference.

Hexadecimal form is one of the suppored form in LLVM IR, and easier for
debugging.

This patch try to print all FP constant in hex form instead.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D73566

Files:
  llvm/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
  llvm/test/CodeGen/AArch64/arm64-fp-imm-size.ll
  llvm/test/CodeGen/AArch64/arm64-fp-imm.ll
  llvm/test/CodeGen/AArch64/f16-imm.ll
  llvm/test/CodeGen/AArch64/win_cst_pool.ll
  llvm/test/CodeGen/ARM/big-endian-neon-fp16-bitconv.ll
  llvm/test/CodeGen/ARM/constant-islands.ll
  llvm/test/CodeGen/ARM/constantfp.ll
  llvm/test/CodeGen/Mips/cconv/memory-layout.ll
  llvm/test/CodeGen/PowerPC/aix-lower-constant-pool-index.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-data.ll
  llvm/test/CodeGen/PowerPC/aix-xcoff-rodata.ll
  llvm/test/CodeGen/PowerPC/float-asmprint.ll
  llvm/test/CodeGen/PowerPC/mcm-12.ll
  llvm/test/CodeGen/PowerPC/mcm-4.ll
  llvm/test/CodeGen/PowerPC/ppcf128-endian.ll
  llvm/test/CodeGen/PowerPC/pr16573.ll
  llvm/test/CodeGen/SystemZ/fp-const-03.ll
  llvm/test/CodeGen/SystemZ/fp-const-04.ll
  llvm/test/CodeGen/SystemZ/fp-const-05.ll
  llvm/test/CodeGen/SystemZ/fp-const-06.ll
  llvm/test/CodeGen/SystemZ/fp-const-07.ll
  llvm/test/CodeGen/SystemZ/fp-const-08.ll
  llvm/test/CodeGen/SystemZ/fp-const-09.ll
  llvm/test/CodeGen/SystemZ/fp-const-10.ll
  llvm/test/CodeGen/SystemZ/fp-const-11.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/fast-fp-loops.ll
  llvm/test/CodeGen/Thumb2/LowOverheadLoops/mve-float-loops.ll
  llvm/test/CodeGen/Thumb2/aligned-constants.ll
  llvm/test/CodeGen/Thumb2/constant-islands-new-island-padding.ll
  llvm/test/CodeGen/Thumb2/mve-ctlz.ll
  llvm/test/CodeGen/Thumb2/mve-ctpop.ll
  llvm/test/CodeGen/Thumb2/mve-cttz.ll
  llvm/test/CodeGen/Thumb2/mve-phireg.ll
  llvm/test/CodeGen/Thumb2/mve-pred-build-var.ll
  llvm/test/CodeGen/WebAssembly/global.ll
  llvm/test/CodeGen/X86/broadcast-elm-cross-splat-vec.ll
  llvm/test/CodeGen/X86/copysign-constant-magnitude.ll
  llvm/test/CodeGen/X86/float-asmprint.ll
  llvm/test/CodeGen/X86/fp-immediate-shorten.ll
  llvm/test/CodeGen/X86/fp128-load.ll
  llvm/test/CodeGen/X86/pr13577.ll
  llvm/test/CodeGen/X86/pr40730.ll
  llvm/test/CodeGen/X86/vec-copysign.ll
  llvm/test/CodeGen/X86/vec_uint_to_fp-fastmath.ll
  llvm/test/CodeGen/X86/vec_uint_to_fp.ll
  llvm/test/CodeGen/X86/win_cst_pool.ll
  llvm/test/CodeGen/X86/x86-setcc-int-to-fp-combine.ll

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D73566.240940.patch
Type: text/x-patch
Size: 62025 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200128/2efaf333/attachment.bin>


More information about the llvm-commits mailing list