llvm-project/llvm/test/CodeGen/BPF
Yonghong Song 25bf825961 bpf: add support for objdump -print-imm-hex
Add support for 'objdump -print-imm-hex' for imm64, operand imm
and branch target. If user programs encode immediate values
as hex numbers, such an option will make it easy to correlate
asm insns with source code. This option also makes it easy
to correlate imm values with insn encoding.

There is one changed behavior in this patch. In old way, we
print the 64bit imm as u64:
  O << (uint64_t)Op.getImm();
and the new way is:
  O << formatImm(Op.getImm());

The formatImm is defined in llvm/MC/MCInstPrinter.h as
  format_object<int64_t> formatImm(int64_t Value)

So the new way to print 64bit imm is i64 type.
If a 64bit value has the highest bit set, the old way
will print the value as a positive value and the
new way will print as a negative value. The new way
is consistent with x86_64.
For the code (see the test program):
 ...
 if (a == 0xABCDABCDabcdabcdULL)
 ...
x86_64 objdump, with and without -print-imm-hex, looks like:
 48 b8 cd ab cd ab cd ab cd ab   movabsq $-6067004223159161907, %rax
 48 b8 cd ab cd ab cd ab cd ab   movabsq $-0x5432543254325433, %rax

Signed-off-by: Yonghong Song <yhs@fb.com>
llvm-svn: 321215
2017-12-20 19:39:58 +00:00
..
alu8.ll
atomics.ll
basictest.ll
byval.ll
cc_args.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
cc_args_be.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
cc_ret.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
cmp.ll
dwarfdump.ll llvm-dwarfdump: Replace -debug-dump=sect option with individual options. 2017-09-11 22:59:45 +00:00
ex1.ll bpf: add " ll" in the LD_IMM64 asmstring 2017-09-11 23:43:35 +00:00
fi_ri.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
inline_asm.ll bpf: add inline-asm support 2017-09-18 23:29:36 +00:00
intrinsics.ll bpf: add new insns for bswap_to_le and negation 2017-09-28 02:46:11 +00:00
lit.local.cfg
load.ll
loops.ll
many_args1.ll
many_args2.ll
mem_offset.ll [bpf] Fix memory offset check for loads and stores 2017-04-13 22:24:13 +00:00
mem_offset_be.ll bpf: add " ll" in the LD_IMM64 asmstring 2017-09-11 23:43:35 +00:00
objdump_atomics.ll
objdump_cond_op.ll bpf: print backward branch target properly 2017-11-16 19:15:36 +00:00
objdump_cond_op_2.ll bpf: print backward branch target properly 2017-11-16 19:15:36 +00:00
objdump_imm_hex.ll bpf: add support for objdump -print-imm-hex 2017-12-20 19:39:58 +00:00
objdump_intrinsics.ll bpf: add new insns for bswap_to_le and negation 2017-09-28 02:46:11 +00:00
objdump_trivial.ll
reloc.ll [bpf] add relocation support 2017-05-03 17:30:56 +00:00
remove_truncate_1.ll bpf: remove unnecessary truncate operation 2017-06-29 15:18:54 +00:00
remove_truncate_2.ll bpf: remove unnecessary truncate operation 2017-06-29 15:18:54 +00:00
remove_truncate_3.ll bpf: add a test case for trunc-op optimization 2017-11-20 21:37:58 +00:00
rodata_1.ll bpf: fix test failures due to previous bpf change of assembly code syntax 2017-09-09 00:11:13 +00:00
rodata_2.ll bpf: fix test failures due to previous bpf change of assembly code syntax 2017-09-09 00:11:13 +00:00
rodata_3.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
rodata_4.ll bpf: avoid load from read-only sections 2017-06-16 15:41:16 +00:00
sanity.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
sdiv_error.ll
select_ri.ll bpf: fix bug on silently truncating 64-bit immediate 2017-10-16 04:14:53 +00:00
setcc.ll bpf: add variants of -mcpu=# and support for additional jmp insns 2017-08-23 04:25:57 +00:00
shifts.ll
sockex2.ll [CodeGen] Print register names in lowercase in both MIR and debug output 2017-11-28 17:15:09 +00:00
struct_ret1.ll
struct_ret2.ll
undef.ll [DAG] Do MergeConsecutiveStores again before Instruction Selection 2017-11-27 15:28:15 +00:00
vararg1.ll
warn-call.ll [bpf] allow direct and indirect calls 2017-11-19 01:35:00 +00:00
warn-stack.ll Add address space mangling to lifetime intrinsics 2017-04-10 20:18:21 +00:00