-
Notifications
You must be signed in to change notification settings - Fork 2.4k
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
[CPU]fix offset in store emitter issue #26083
Changes from 6 commits
a14d9db
f9c9066
586bf6c
9295a5a
f9fb181
90c460c
35d46b7
7e064db
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -110,6 +110,7 @@ size_t jit_load_emitter::aux_gprs_count() const { | |
} | ||
|
||
void jit_load_emitter::emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const { | ||
// offset in load emitter is the offset of src gpr register, should be parsed from in_idxs. | ||
const int offset = in_idxs.size() == 2 ? in_idxs[1] : 0; | ||
if (host_isa_ == cpu::x64::sse41) { | ||
emit_isa<cpu::x64::sse41>(Reg64(in_idxs[0]), static_cast<int>(out_idxs[0]), offset); | ||
|
@@ -676,7 +677,8 @@ void jit_store_emitter::emit_data() const { | |
} | ||
|
||
void jit_store_emitter::emit_impl(const std::vector<size_t> &in_idxs, const std::vector<size_t> &out_idxs) const { | ||
const int offset = in_idxs.size() == 2 ? in_idxs[1] : 0; | ||
// offset in store emitter is the offset of dst gpr register, should be parsed from out_ids. | ||
const int offset = out_idxs.size() == 2 ? out_idxs[1] : 0; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could you please also add a description regarding offset for store and load emitter? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Agree. Otherwise this is sacred knowledge which is known by a few developers |
||
if (host_isa_ == cpu::x64::sse41) { | ||
emit_isa<cpu::x64::sse41>(static_cast<int>(in_idxs[0]), Reg64(out_idxs[0]), offset); | ||
} else if (host_isa_ == cpu::x64::avx2) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Minor: The best place for this comment in the corresponding header file before class definitions 😃 Another developer will take a look at interface and won't find the description for
offset
. And only after searching in files, he will find this comment.