binaryninja-api icon indicating copy to clipboard operation
binaryninja-api copied to clipboard

arm64: lift sxtl, sxtl2, sshll, sshll2

Open yrp604 opened this issue 1 year ago • 1 comments

Partially fixes #5417

Also superficial re-ordering of the tests to make it easier to add new tests.

With both PRs targeting #5417 we get this LLIL:

  41 @ 100003ea0  s1 = [x29 - 8 {var_18}].d
  42 @ 100003ea4  s0 = s1
  43 @ 100003ea8  v0.d[0] = sx.q(v0.s[0] u>> 0 << 0)
  44 @ 100003ea8  v0.d[1] = sx.q(v0.s[1] u>> 0 << 0)
  45 @ 100003eac  d1 = int.q(d0)
  46 @ 100003eb0  d0 = 10.0
  47 @ 100003eb4  d0 = d0 f+ d1
  48 @ 100003eb8  s0 = fconvert.s(d0)
  49 @ 100003ebc  x8 = sx.q([x29 - 8 {var_18}].d)
  50 @ 100003ec0  x9 = 0x2c
  51 @ 100003ec4  x9 = x8 * x9
  52 @ 100003ec8  x8 = &main::x
  53 @ 100003ecc  x8 = x8
  54 @ 100003ed0  x8 = x8 + x9
  55 @ 100003ed4  [x8 + 0x28].d = s0
  56 @ 100003ed8  [x29 - 0xc {var_1c_1}].d = 0
  57 @ 100003edc  goto 58 @ 0x100003ee0

and this HLIL:

  10 @ 100003ea0  int64_t v1
  11 @ 100003ea0  v1.d = var_18
  12 @ 100003ea4  v0.d = v1.d
  13 @ 100003eb8  v0.d = fconvert.s(10.0 f+ int.q((v0.d u>> 0 << 0):4.d u>> 0 << 0))
  14 @ 100003ed4  *(sx.q(var_18) * 0x2c + 0x100008028) = v0.d
  15 @ 100003ed8  int32_t var_1c_1 = 0

Finally, it looks like there are some other unlifted SHL variants that would probably follow the same template. Let me know if you've come across any of these and I can take a look.

yrp604 avatar May 26 '24 04:05 yrp604

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

CLAassistant avatar May 26 '24 04:05 CLAassistant

Closing PR because superseded by e3b91f9e65646a6b9cc69d2a353ad268ee20767b

galenbwill avatar Jul 03 '24 18:07 galenbwill