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

unittest: Add jit compare for jit IR #18228

Merged
merged 3 commits into from
Sep 24, 2023

Conversation

unknownbrackets
Copy link
Collaborator

This makes it so you can easily compare a code block's codegen between:

  • Interpreter
  • IR Interpreter
  • Linear JIT
  • JIT IR

Also adds a thread name for UnitTest so asserts don't break.

-[Unknown]

@unknownbrackets unknownbrackets added the IRInterpreter Occurs with IR Interpreter but not with another CPU backend. label Sep 24, 2023
@hrydgard
Copy link
Owner

Oh that's great for microbenching, yeah.

@hrydgard
Copy link
Owner

Does look like the unittest is actually crashing on Linux, it's not the usual thing...

@unknownbrackets
Copy link
Collaborator Author

unknownbrackets commented Sep 24, 2023

The unittest was using 0x89100000 as an address. At least on RISC-V, this was sign extending and crashing. Not sure why Linux is unhappy though (Windows is fine and I had a 7FFFFFFF mask there)... I cleaned up the displacements to be safer, though.

-[Unknown]

LI(SCRATCH2, constant);
ADD(SCRATCH1, *reg, SCRATCH2);
// It can't be this negative, must be a constant with top bit set.
if ((constant & 0xC0000000) == 0x80000000) {
Copy link
Owner

Choose a reason for hiding this comment

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

shouldn't this check be (constant & 0x80000000)? or are we explicitly diallowing 0xC0000000 addresses (granted, you did mention previously that disabling the cache in kernel space is likely not allowed...)

Copy link
Collaborator Author

@unknownbrackets unknownbrackets Sep 24, 2023

Choose a reason for hiding this comment

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

No, because the constant can be a negative offset. We end up turning absolute addresses into this constant offsets, but we also have signed offsets.

-[Unknown]

@hrydgard hrydgard merged commit 7b2657f into hrydgard:master Sep 24, 2023
18 checks passed
@unknownbrackets unknownbrackets deleted the ir-jit-unittest branch September 24, 2023 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
IRInterpreter Occurs with IR Interpreter but not with another CPU backend.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants