rizin icon indicating copy to clipboard operation
rizin copied to clipboard

[Hexagon] RzIL uplifiting

Open Rot127 opened this issue 2 years ago • 8 comments

WIP

Your checklist for this pull request

  • [x] I've read the guidelines for contributing to this repository
  • [x] I made sure to follow the project's coding style
  • [x] I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • [x] I've added tests that prove my fix is effective or that my feature works (if possible)
  • [ ] I've updated the rizin book with the relevant information (if needed)

Detailed description

Future Hexagon uplifting PR.

Currently successful compile instructions (and tested):

[*] 1573/1733 standard instructions compiled.
[*] 431/643 HVX instructions compiled.
[*] In total: 2004/2376 instructions compiled.

Test plan

...

TODO

  • [ ] Generate jumps always at the end of a packet.
  • [ ] WARNING: Invalid il ops sequence! There should be at least two il ops per packet. if get_il_ops() is called for unimplemented instructions.

Rot127 avatar Sep 08 '23 00:09 Rot127

Open this for the first round of review now.

There are still the rz-test cases missing. Due to inner working of the RzIL generation it is not really possible to add the asm style tests (so I check it again to be sure). Instead I would simply execute most test bins to the address where they can be considered passed.

Currently the tests fail due to missing https://github.com/rizinorg/rizin/pull/3973

Rot127 avatar Nov 13 '23 19:11 Rot127

In order that the tests succeed we need https://github.com/rizinorg/rizin-testbins/pull/127 merged though. Before that maybe look at https://github.com/rizinorg/rizin/pull/3837/files#diff-a1583f59ca1cc7b3c25cde35c24fade6df510112bcf21174d5d2995a5baa14e2

Rot127 avatar Nov 21 '23 20:11 Rot127

@thestr4ng3r To your notice: https://github.com/rizinorg/rizin/pull/3837/commits/722e5c0a624136b7a07cd4d2ee42e54d3c5fc0c6

Rot127 avatar Nov 21 '23 20:11 Rot127

rebase.

wargio avatar Dec 04 '23 05:12 wargio

If this is green, could you guys take a look at it again.

Rot127 avatar Jan 14 '24 14:01 Rot127

If this is green, could you guys take a look at it again.

It's not:

101/102 rizin:unit / tokens               FAIL            1.03s   killed by signal 6 SIGABRT
>>> UBSAN_OPTIONS=halt_on_error=1:abort_on_error=1:print_summary=1:print_stacktrace=1 MALLOC_PERTURB_=183 LD_LIBRARY_PATH=/home/runner/work/rizin/rizin/build/librz/egg:/home/runner/work/rizin/rizin/build/librz/reg:/home/runner/work/rizin/rizin/build/librz/core:/home/runner/work/rizin/rizin/build/librz/hash:/home/runner/work/rizin/rizin/build/librz/bp:/home/runner/work/rizin/rizin/build/librz/search:/home/runner/work/rizin/rizin/build/librz/asm:/home/runner/work/rizin/rizin/build/librz/demangler:/home/runner/work/rizin/rizin/build/librz/flag:/home/runner/work/rizin/rizin/build/librz/parse:/home/runner/work/rizin/rizin/build/librz/debug:/home/runner/work/rizin/rizin/build/librz/crypto:/home/runner/work/rizin/rizin/build/librz/io:/home/runner/work/rizin/rizin/build/librz/il:/home/runner/work/rizin/rizin/build/librz/util:/home/runner/work/rizin/rizin/build/librz/magic:/home/runner/work/rizin/rizin/build/librz/lang:/home/runner/work/rizin/rizin/build/librz/cons:/home/runner/work/rizin/rizin/build/librz/bin:/home/runner/work/rizin/rizin/build/librz/sign:/home/runner/work/rizin/rizin/build/librz/type:/home/runner/work/rizin/rizin/build/librz/diff:/home/runner/work/rizin/rizin/build/librz/config:/home/runner/work/rizin/rizin/build/librz/syscall:/home/runner/work/rizin/rizin/build/librz/socket:/home/runner/work/rizin/rizin/build/librz/analysis:/home/runner/work/rizin/rizin/build/librz/main:/home/runner/lib/x86_64-linux-gnu:/home/runner/lib:/home/runner/lib64: /home/runner/work/rizin/rizin/build/test/unit/test_tokens

XVilka avatar Jan 14 '24 15:01 XVilka

Going to move https://github.com/rizinorg/rizin/pull/3837/commits/458fc61836e82da8ceee5de36c58dca6d38bd200 into a separated PR. But first wanted to see if it finally works.

Rot127 avatar Jan 14 '24 19:01 Rot127

So besides https://github.com/rizinorg/rizin/issues/4121 everything runs fine now. I have no idea what the problem with it is unfortunately. But it isn't related to the RzIL stuff.

The appveyor fails due to https://github.com/rizinorg/rizin/issues/4121 and some timeouts, as it looks like. Though I wouldn't like to increase them anymore since they are already pretty high.

Rot127 avatar Jan 17 '24 18:01 Rot127

Please let me run all rz-tracetest tests after https://github.com/rizinorg/rizin/pull/4373. Just to be sure.

Rot127 avatar Mar 21 '24 16:03 Rot127

Ok, all good now:

./run-test-sets.sh -i -t essentials,float
test_vspliceb [PASS]
test_vpmpyh [PASS]
test_vminh [PASS]
test_vmaxh [PASS]
test_vlsrw [PASS]
test_vcmpw [PASS]
test_vcmpb [PASS]
test_vavgw [PASS]
test_round [PASS]
test_reorder [PASS]
test_packet [PASS]
test_mpyi [PASS]
test_lsr [PASS]
test_jmp [PASS]
test_hwloops [PASS]
test_hl [PASS]
test_fibonacci [PASS]
test_ext [PASS]
test_dotnew [PASS]
test_cmp [PASS]
test_clobber [PASS]
test_call [PASS]
test_bitsplit [PASS]
test_bitcnt [PASS]
test_abs [PASS]
usr [PASS]
v68_scalar [PASS]
v73_scalar [PASS]
test-vma [PASS]
load_align [PASS]
multi_result [PASS]
overflow [PASS]
first [PASS]
mem_noshuf [PASS]
preg_alias [PASS]
dual_stores [PASS]
mem_noshuf_exception [PASS]
read_write_overlap [PASS]
reg_mut [PASS]
misc [PASS]
fpstuff [PASS]

Rot127 avatar Mar 22 '24 05:03 Rot127