Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

xtensa RzIL #4712

Merged
merged 4 commits into from
Dec 25, 2024
Merged

xtensa RzIL #4712

merged 4 commits into from
Dec 25, 2024

Conversation

imbillow
Copy link
Contributor

@imbillow imbillow commented Nov 11, 2024

Your checklist for this pull request

  • I've read the guidelines for contributing to this repository
  • I made sure to follow the project's coding style
  • I've documented or updated the documentation of every function and struct this PR changes. If not so I've explained why.
  • 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

xtensa: add rzil support

Test plan

...

Closing issues

...

@imbillow

This comment was marked as outdated.

@imbillow imbillow marked this pull request as ready for review December 16, 2024 08:33
@imbillow imbillow requested a review from XVilka December 16, 2024 08:33
@imbillow

This comment was marked as outdated.

XVilka

This comment was marked as resolved.

@imbillow

This comment was marked as outdated.

@XVilka

This comment was marked as resolved.

XVilka

This comment was marked as resolved.

librz/il/il_events.c Outdated Show resolved Hide resolved
@imbillow
Copy link
Contributor Author

#4789

Copy link
Member

@XVilka XVilka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, impressive work as always. Please rebase and address these few nitpicks.

librz/arch/isa/xtensa/xtensa_il.c Outdated Show resolved Hide resolved
librz/arch/isa/xtensa/xtensa_il.c Show resolved Hide resolved
librz/arch/isa/xtensa/xtensa_il.c Outdated Show resolved Hide resolved
librz/arch/isa/xtensa/xtensa_il.c Outdated Show resolved Hide resolved
librz/arch/isa/xtensa/xtensa_il.c Outdated Show resolved Hide resolved
SETG(REGN(0), SHIFTL0(IREG(1), VARL("sa"))));
}

// TODO: see Divide and Square Root Sequences on page 110.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you plan to fix this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm planning to do this in another new PR, and the instructions are so strange that I'm not sure it's necessary to implement them.

image

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It depends if these instructions are used in the real code or not. Yep, it's okay to do in a subsequent PR.

return NOP();
}

// TODO: datatlb
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these todos aren't needed. There is no point of uplifting barrier instructions to RzIL, I think.

- **Add support for rzIL**: Implement various Xtensa instructions and functionalities.
- **Instruction Set Additions**:
  - **Arithmetic and Logical Operations**: sub*, add*, and*, or*, xor*, mul*, div*, rem*, neg*, abs, addi*, addmi, addexp*, addexpm*, addx2|4|8
  - **Bitwise Operations**: srl*, sra*, sll*, andb, andbc, nsau, nsa
  - **Branching and Jumps**: b*, beq*, bne*, ball, bany, bnall, bnone, j, jx, loop*, loopgez, loopnez
  - **Data Transfer**: st*, ld*, l32*, l16*, l8ui, ssi*, ssa*, src
  - **Floating Point**: sqrt0.s, float.s, floor.s, trunc*, ueq*, ule*, ult*, ufloat*, neg.s, oeq.s, ole.s, olt.s, min, max, clamps, nex
  - **System Calls and Synchronization**: syscall, simcall, entry, isync, dsync, esync, rsync, memw
  - **Miscellaneous**: const_s, extui, extw, excw, sext, witlb, wur, rur.*, mksadj.ss, mkdadj.s, const_s

- **Testing and Patches**:
  - Implement asm tests for all

- **Miscellaneous Improvements**:
  - Update Capstone and fix ARM architecture support for building.

This commit consolidates various enhancements, bug fixes, and testing for Xtensa architecture within rzil framework.
@XVilka
Copy link
Member

XVilka commented Dec 25, 2024

../librz/arch/isa/xtensa/xtensa_il.c:1220:7: error: expected expression
                                                LET("b2", EQ(VARL("sign"), EXTRACT32(VARLP("t2"), U32(4), U32(4))), ))))));
                                                ^
../librz/include/rz_il/rz_il_opbuilder_begin.h:160:58: note: expanded from macro 'LET'
#define LET(name, v, body) rz_il_op_new_let(name, v, body)
                                                         ^
1 error generated.

@XVilka XVilka merged commit 42302da into dev Dec 25, 2024
48 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants