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] Added missing types to CodeGen_Xtensa.cpp and fixed the issues with 0_off_3 functions. #7184

Merged
merged 2 commits into from
Dec 2, 2022

Conversation

Aelphy
Copy link
Contributor

@Aelphy Aelphy commented Nov 29, 2022

No description provided.

@vksnk vksnk changed the title Added add_platform_headers hook in CodeGen_C and relocated the common Xtensa code there. [xtensa] Added add_platform_headers hook in CodeGen_C and relocated the common Xtensa code there. Nov 29, 2022
@Aelphy Aelphy changed the title [xtensa] Added add_platform_headers hook in CodeGen_C and relocated the common Xtensa code there. [xtensa] Added missing types to CodeGen_Xtensa.cpp and fixed the issues with 0_off_3 functions. Nov 29, 2022
@@ -63,6 +63,46 @@ class UsesDmaCopy : public IRGraphVisitor {
bool uses_dma = false;
};

void CodeGen_Xtensa::add_platform_headers() {
Copy link
Contributor

Choose a reason for hiding this comment

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

Style question: this is named add_platform_headers() but doesn't actually add any headers, just explicit extern defines. Maybe it would be more helpful to name it something like add_platform_prologue()?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed in #7186, where it belongs to

@@ -1397,6 +1440,19 @@ HALIDE_ALWAYS_INLINE native_vector_u8 halide_xtensa_extract_0_of_3_u8(const nati
return halide_xtensa_extract_0_of_3_u8(a.native_vector[0], a.native_vector[1], a.native_vector[2]);
}

HALIDE_ALWAYS_INLINE native_vector_i8 halide_xtensa_extract_0_of_3_i8(const native_vector_i8& a0, const native_vector_i8& a1, const native_vector_i8& a2) {
Copy link
Contributor

Choose a reason for hiding this comment

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

These changes look good but also look completely unrelated to add_platform_headers() -- you should either update the PR description to include these, or move them into a separate PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

moved platform_prologue stuff to #7186

@@ -992,23 +992,23 @@ class MatchXtensaPatterns : public IRGraphMutator {
{mutate(op->vectors[0]), op->slice_begin() / 4}, Call::PureExtern);
} else if (op->type.is_int_or_uint() && (op->type.bits() == 8) && (op->type.lanes() == 64)) {
if ((op->vectors.size() == 1) && (op->vectors[0].type().lanes() == 192)) {
bool is_extract_off_0_3 = true;
bool is_extract_of_0_3 = true;
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you mean "is_extract_0_of_3"?

@steven-johnson
Copy link
Contributor

Ready to land?

@vksnk vksnk merged commit 80b9a1f into halide:xtensa-codegen Dec 2, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants