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

Add tricore tc1.8 instructions #2595

Open
wants to merge 6 commits into
base: next
Choose a base branch
from

Conversation

Changqing-JING
Copy link

@Changqing-JING Changqing-JING commented Jan 6, 2025

Your checklist for this pull request

  • I've documented or updated the documentation of every API function and struct this PR changes.
  • I've added tests that prove my fix is effective or that my feature works (if possible)

Detailed description

Add tricore tc1.8 instructions:

add.df
sub.df
madd.df
msub.df
mul.df
div.df
cmp.df
max.df
min.df
min.f
max.f
dftoi
dftoiz
dftoin
ftoin
dftou
dftouz
dftol
dftoul
dftoulz
abs.f
abs.df
dftolz
neg.df
neg.f
qseed.df
itodf
utodf
ltodf
ultodf
dftof
ftodf
div64
div64.u
rem64
rem64.u

The inc files are updated by:
capstone-engine/llvm-capstone#73

...

Test plan

cmake --build ./build/linux-x64 && ./build/linux-x64/suite/cstest/Debug/cstest tests/MC/TriCore > build/test.lo

...

Closing issues

...

add.df
sub.df
madd.df
msub.df
mul.df
div.df
cmp.df
max.df
min.df
min.f
max.f
dftoi
dftoiz
dftoin
ftoin
dftou
dftouz
dftol
dftoul
dftoulz
abs.f
abs.df
dftolz
neg.df
neg.f
qseed.df
itodf
utodf
ltodf
ultodf
dftof
ftodf
@XVilka
Copy link
Contributor

XVilka commented Jan 6, 2025

@imbillow and this one, please

cc @Rot127

@Changqing-JING
Copy link
Author

Since this PR is not merged yet. I added a bit more instructions

div64
div64.u
rem64
rem64.u

Copy link
Collaborator

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

I'll try to find time for a full review on the weekend. But please don't forget to add tests for the instruction details in tests/details.

@Changqing-JING
Copy link
Author

@Rot127 Thank you very much for review.
I have added tests to tests/details

But I still have a question. The tests under tests/details seems similar to tests/MC. What's the reason to have both? Why not merge them to one?

@Rot127
Copy link
Collaborator

Rot127 commented Jan 10, 2025

But I still have a question. The tests under tests/details seems similar to tests/MC. What's the reason to have both? Why not merge them to one?

The MC tests are copies of the assembler/disassembler regression tests from LLVM. They get translated from the LLVM format to our yaml test files with the Auto-Sync.
They effectively test all code which is from LLVM. And only the asm text. Not any of the details.

The detail tests on the other hand, test the code added by Capstone. So all the details. They should (but don't, yet) cover all functions in <ARCH>Mapping.c files.

Copy link
Collaborator

@Rot127 Rot127 left a comment

Choose a reason for hiding this comment

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

Lovely! Thanks a lot!
Just address those small comments please. Otherwise lgtm.
@kabeor

arch/TriCore/TriCoreDisassembler.c Outdated Show resolved Hide resolved
include/capstone/tricore.h Outdated Show resolved Hide resolved
include/capstone/tricore.h Outdated Show resolved Hide resolved
suite/MC/TriCore/tc130.s.cs Show resolved Hide resolved
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.

3 participants