Skip to content

Conversation

@sayantn
Copy link
Contributor

@sayantn sayantn commented Nov 20, 2025

Currently, we use 2 procedural macros, assert_instr and simd_test, for testing. It is convenient, but the problem is that it significantly slows down compilation. Seeing that these macros are pretty small, I thought of using declarative attribute macros (rust-lang/rust#143547) instead

The diffcount is huge due to all uses of simd_test being changed, like

#[simd_test(enable = "avx,gfni")]

got changed to

#[simd_test("avx", "gfni")]

The reason being that we cannot do string splitting etc in declarative macros

@bjorn3
Copy link
Member

bjorn3 commented Nov 20, 2025

The reason being that we cannot do string splitting etc in declarative macros

Wouldn't a split at runtime work fine here?

@sayantn
Copy link
Contributor Author

sayantn commented Nov 20, 2025

No, we need to pass the target features to the std::arch detection macros, and they only accept literals

@sayantn
Copy link
Contributor Author

sayantn commented Nov 23, 2025

for some reason this is actually a little bit slower on my pc. Does anyone know what's going on? I thought proc-macros are supposed to be slower than decl macros in general

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