Skip to content

loongarch: Rename SIMD helper intrinsics to avoid macro path issues#2177

Open
heiher wants to merge 1 commit into
rust-lang:mainfrom
heiher:rename-helper
Open

loongarch: Rename SIMD helper intrinsics to avoid macro path issues#2177
heiher wants to merge 1 commit into
rust-lang:mainfrom
heiher:rename-helper

Conversation

@heiher

@heiher heiher commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

The is::, cs::, and ls:: prefixes were originally used to clearly distinguish helper intrinsics from different namespaces at call sites.

However, due to limitations in Rust macro expansion, impl_xxx!(..., prefix::simd_xxx, ...); cannot always be used. Some macro expansions only accept an identifier, causing errors such as:

  ($ft:literal, $name:ident, $op:path, $oty:ty, $ity:ident) => {
      let r: $ity = $op::<IMM, _>(a);
                       ^^ expected one of `.`, `;`, `?`, `else`, or an operator

Instead of relying on namespace prefixes, rename the LoongArch-specific simd_xxx helpers to simd_ext_xxx and remove the is::, cs::, and ls:: prefixes from macro invocations. This preserves the distinction between helper intrinsics while avoiding the macro expansion limitation.

r? @folkertdev

The `is::`, `cs::`, and `ls::` prefixes were originally used to clearly
distinguish helper intrinsics from different namespaces at call sites.

However, due to limitations in Rust macro expansion, `prefix::simd_xxx`
cannot always be used. Some macro expansions only accept an identifier,
causing errors such as:

```
  ($ft:literal, $name:ident, $op:path, $oty:ty, $ity:ident) => {
      let r: $ity = $op::<IMM, _>(a);
                       ^^ expected one of `.`, `;`, `?`, `else`, or an operator
```

Instead of relying on namespace prefixes, rename the LoongArch-specific
`simd_xxx` helpers to `simd_ext_xxx` and remove the `is::`, `cs::`, and
`ls::` prefixes from macro invocations. This preserves the distinction
between helper intrinsics while avoiding the macro expansion limitation.
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.

2 participants