Skip to content

arm64: lift scvtf#5459

Closed
yrp604 wants to merge 1 commit into
Vector35:devfrom
yrp604:arm64-peter
Closed

arm64: lift scvtf#5459
yrp604 wants to merge 1 commit into
Vector35:devfrom
yrp604:arm64-peter

Conversation

@yrp604
Copy link
Copy Markdown
Contributor

@yrp604 yrp604 commented May 25, 2024

Partially fixes #5417

From the attached example:

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

NOTE: the neon code gen script is broken for me:

C:\Users\x\OneDrive\Documents\binja\binaryninja-api\arch\arm64\misc\neon_intrins.py:59: SyntaxWarning: invalid escape sequence '\d'
  m = re.match('^.* - (Vt(\d)\..*)}', reg0)
Traceback (most recent call last):
  File "C:\Users\x\OneDrive\Documents\binja\binaryninja-api\arch\arm64\misc\neon_intrins.py", line 124, in <module>
    (fsig, asig) = l.split('; // ')
    ^^^^^^^^^^^^
ValueError: not enough values to unpack (expected 2, got 1)

So I deleted the relevant scvtf code from the source and sink and called it Good Enough.

@CLAassistant
Copy link
Copy Markdown

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.

@galenbwill galenbwill self-assigned this May 26, 2024
@galenbwill galenbwill added Component: Architecture Issue needs changes to an architecture plugin Arch: ARM64 Issues with the AArch64 architecture plugin Lifting issues related to LLIL lifting labels May 26, 2024
@yrp604
Copy link
Copy Markdown
Contributor Author

yrp604 commented May 26, 2024

Also, we might want to do UCVTF at the same time...

@galenbwill
Copy link
Copy Markdown
Contributor

Superseded by 12d47835

@galenbwill galenbwill closed this May 30, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Arch: ARM64 Issues with the AArch64 architecture plugin Component: Architecture Issue needs changes to an architecture plugin Lifting issues related to LLIL lifting

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Lift commonly used arm64 floating point instructions scvtf and sxtl

4 participants