Skip to content

powerpc: Gate vec_cntlz on ISA 2.07 and allow 64-bit element vectors - #2295

Open
Gelbpunkt wants to merge 1 commit into
rust-lang:mainfrom
Gelbpunkt:vclzd
Open

Gelbpunkt wants to merge 1 commit into
rust-lang:mainfrom
Gelbpunkt:vclzd

Conversation

@Gelbpunkt

Copy link
Copy Markdown
Contributor

vec_cntlz lowers to vclzb, vclzh and vclzw at the moment. All of these vector count leading zeros instructions are available only since ISA 2.07, which means the correct target feature gate here is power8-altivec instead of altivec.

This also allows us to also unconditionally allow passing a vector_signed_long or vector_unsigned_long, which is lowered to the vclzd instruction (also available since ISA 2.07). This was previously not possible because the altivec target feature alone is not sufficient for allowing 64-bit vector elements, that's only possible since ISA 2.06 (and not just a property of VSX, it's also possible in the vector facility).

vec_cntlz lowers to vclzb, vclzh and vclzw at the moment. All of these
vector count leading zeros instructions are available only since ISA
2.07, which means the correct target feature gate here is power8-altivec
instead of altivec.

This also allows us to also unconditionally allow passing a
vector_signed_long or vector_unsigned_long, which is lowered to the
vclzd instruction (also available since ISA 2.07). This was previously
not possible because the altivec target feature alone is not sufficient
for allowing 64-bit vector elements, that's only possible since ISA
2.06 (and not just a property of VSX, it's also possible in the vector
facility).
@rustbot

rustbot commented Dec 4, 2026

Copy link
Copy Markdown
Collaborator

r? @Amanieu

rustbot has assigned @Amanieu.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

Why was this reviewer chosen?

The reviewer was selected based on:

  • Owners of files modified in this PR: @Amanieu, @adamgemmell, @davidtwco, @folkertdev
  • @Amanieu, @adamgemmell, @davidtwco, @folkertdev expanded to Amanieu, adamgemmell, davidtwco, folkertdev
  • Random selection from Amanieu, adamgemmell, davidtwco, folkertdev

This branch has not been deployed

No deployments
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