-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.Category: This is a bug.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
Description
I tried this code:
#![feature(portable_simd)]
use std::simd::{i64x8, f64x8};
use std::arch::asm;
pub fn convert(a: i64x8) -> f64x8{
let converted: f64x8;
unsafe {
asm!(
"vcvtqq2pd {converted} {a}",
a = in(zmm_reg) a,
converted = out(zmm_reg) converted,
);
}
converted
}
I expected to see this happen:
I thought this would compile and do as it says since, https://doc.rust-lang.org/reference/inline-assembly.html states that zmm_reg
accepts vector types., like f64x8 and i64x8.
Instead, this happened:
error: cannot use value of type `Simd<i64, 8>` for inline assembly
--> <source>:12:25
|
12 | a = in(zmm_reg) a,
| ^
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
error: cannot use value of type `Simd<f64, 8>` for inline assembly
--> <source>:13:34
|
13 | converted = out(zmm_reg) converted,
| ^^^^^^^^^
|
= note: only integers, floats, SIMD vectors, pointers and function pointers can be used as arguments for inline assembly
error: aborting due to 2 previous errors
Meta
rustc --version --verbose
:
<redacted>@<redacted>::~$ rustc --version --verbose
rustc 1.68.0-nightly (afaf3e07a 2023-01-14)
binary: rustc
commit-hash: afaf3e07aaa7ca9873bdb439caec53faffa4230c
commit-date: 2023-01-14
host: x86_64-unknown-linux-gnu
release: 1.68.0-nightly
LLVM version: 15.0.6
No backtrace applicable.
Metadata
Metadata
Assignees
Labels
A-SIMDArea: SIMD (Single Instruction Multiple Data)Area: SIMD (Single Instruction Multiple Data)A-diagnosticsArea: Messages for errors, warnings, and lintsArea: Messages for errors, warnings, and lintsA-docsArea: Documentation for any part of the project, including the compiler, standard library, and toolsArea: Documentation for any part of the project, including the compiler, standard library, and toolsA-inline-assemblyArea: Inline assembly (`asm!(…)`)Area: Inline assembly (`asm!(…)`)A-target-featureArea: Enabling/disabling target features like AVX, Neon, etc.Area: Enabling/disabling target features like AVX, Neon, etc.C-bugCategory: This is a bug.Category: This is a bug.PG-portable-simdProject group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)Project group: Portable SIMD (https://github.com/rust-lang/project-portable-simd)T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.