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

Building for 32-bit ARM target fails in src/codegen/shuffle1_dyn.rs #309

Open
hsivonen opened this issue Oct 29, 2020 · 2 comments
Open

Comments

@hsivonen
Copy link
Member

This happens both when targeting Android and glibc:

(bionic)hsivonen@localhost:~/Projects/packed_simd$ RUSTFLAGS='-Z macro-backtrace' cargo build --target thumbv7neon-unknown-linux-gnueabihf --verbose
   Compiling cfg-if v0.1.10
     Running `rustc --crate-name cfg_if --edition=2018 /home/hsivonen/.cargo/registry/src/github.com-1285ae84e5963aae/cfg-if-0.1.10/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 -C metadata=eb2569c80076c7ec -C extra-filename=-eb2569c80076c7ec --out-dir /home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps --target thumbv7neon-unknown-linux-gnueabihf -L dependency=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps -L dependency=/home/hsivonen/Projects/packed_simd/target/debug/deps --cap-lints allow -Z macro-backtrace`
   Compiling libm v0.1.4
     Running `rustc --crate-name libm --edition=2018 /home/hsivonen/.cargo/registry/src/github.com-1285ae84e5963aae/libm-0.1.4/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi,artifacts --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' --cfg 'feature="stable"' -C metadata=bbe286ea499eab57 -C extra-filename=-bbe286ea499eab57 --out-dir /home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps --target thumbv7neon-unknown-linux-gnueabihf -L dependency=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps -L dependency=/home/hsivonen/Projects/packed_simd/target/debug/deps --cap-lints allow -Z macro-backtrace`
   Compiling packed_simd_2 v0.3.4 (/home/hsivonen/Projects/packed_simd)
     Running `rustc --crate-name packed_simd_2 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=a0a4ef0e719e0d1f -C extra-filename=-a0a4ef0e719e0d1f --out-dir /home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps --target thumbv7neon-unknown-linux-gnueabihf -C incremental=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/incremental -L dependency=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps -L dependency=/home/hsivonen/Projects/packed_simd/target/debug/deps --extern cfg_if=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps/libcfg_if-eb2569c80076c7ec.rmeta --extern libm=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps/liblibm-bbe286ea499eab57.rmeta -Z macro-backtrace --cfg libcore_neon`
error[E0425]: cannot find value `y` in this scope
   --> src/codegen/shuffle1_dyn.rs:125:51
    |
28  | / macro_rules! impl_shuffle1_dyn {
29  | |     (u8x8) => {
30  | |         cfg_if! {
31  | |             if #[cfg(all(
...   |
125 | |                             let (i0, i1) = U { j: y }.s;
    | |                                                   ^ not found in this scope
...   |
271 | |     ($id:ident) => { impl_fallback!($id); }
272 | | }
    | |_- in this expansion of `impl_shuffle1_dyn!`
...
277 |   impl_shuffle1_dyn!(u8x16);
    |   -------------------------- in this macro invocation

error[E0425]: cannot find value `x` in this scope
   --> src/codegen/shuffle1_dyn.rs:128:48
    |
28  | / macro_rules! impl_shuffle1_dyn {
29  | |     (u8x8) => {
30  | |         cfg_if! {
31  | |             if #[cfg(all(
...   |
128 | |                                 mem::transmute(x),
    | |                                                ^ not found in this scope
...   |
271 | |     ($id:ident) => { impl_fallback!($id); }
272 | | }
    | |_- in this expansion of `impl_shuffle1_dyn!`
...
277 |   impl_shuffle1_dyn!(u8x16);
    |   -------------------------- in this macro invocation

error[E0425]: cannot find value `x` in this scope
   --> src/codegen/shuffle1_dyn.rs:132:48
    |
28  | / macro_rules! impl_shuffle1_dyn {
29  | |     (u8x8) => {
30  | |         cfg_if! {
31  | |             if #[cfg(all(
...   |
132 | |                                 mem::transmute(x),
    | |                                                ^ not found in this scope
...   |
271 | |     ($id:ident) => { impl_fallback!($id); }
272 | | }
    | |_- in this expansion of `impl_shuffle1_dyn!`
...
277 |   impl_shuffle1_dyn!(u8x16);
    |   -------------------------- in this macro invocation

error[E0308]: mismatched types
   --> src/codegen/shuffle1_dyn.rs:136:45
    |
28  | / macro_rules! impl_shuffle1_dyn {
29  | |     (u8x8) => {
30  | |         cfg_if! {
31  | |             if #[cfg(all(
...   |
136 | |                             let r = U { s: (r0, r1) }.j;
    | |                                             ^^ expected struct `Simd`, found struct `uint8x8_t`
...   |
271 | |     ($id:ident) => { impl_fallback!($id); }
272 | | }
    | |_- in this expansion of `impl_shuffle1_dyn!`
...
277 |   impl_shuffle1_dyn!(u8x16);
    |   -------------------------- in this macro invocation
    |
    = note: expected struct `Simd<[u8; 8]>`
               found struct `uint8x8_t`

error[E0308]: mismatched types
   --> src/codegen/shuffle1_dyn.rs:136:49
    |
28  | / macro_rules! impl_shuffle1_dyn {
29  | |     (u8x8) => {
30  | |         cfg_if! {
31  | |             if #[cfg(all(
...   |
136 | |                             let r = U { s: (r0, r1) }.j;
    | |                                                 ^^ expected struct `Simd`, found struct `uint8x8_t`
...   |
271 | |     ($id:ident) => { impl_fallback!($id); }
272 | | }
    | |_- in this expansion of `impl_shuffle1_dyn!`
...
277 |   impl_shuffle1_dyn!(u8x16);
    |   -------------------------- in this macro invocation
    |
    = note: expected struct `Simd<[u8; 8]>`
               found struct `uint8x8_t`

error: aborting due to 5 previous errors

Some errors have detailed explanations: E0308, E0425.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `packed_simd_2`

Caused by:
  process didn't exit successfully: `rustc --crate-name packed_simd_2 --edition=2018 src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C embed-bitcode=no -C debuginfo=2 --cfg 'feature="default"' -C metadata=a0a4ef0e719e0d1f -C extra-filename=-a0a4ef0e719e0d1f --out-dir /home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps --target thumbv7neon-unknown-linux-gnueabihf -C incremental=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/incremental -L dependency=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps -L dependency=/home/hsivonen/Projects/packed_simd/target/debug/deps --extern cfg_if=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps/libcfg_if-eb2569c80076c7ec.rmeta --extern libm=/home/hsivonen/Projects/packed_simd/target/thumbv7neon-unknown-linux-gnueabihf/debug/deps/liblibm-bbe286ea499eab57.rmeta -Z macro-backtrace --cfg libcore_neon` (exit code: 1)

rustc --version: rustc 1.49.0-nightly (31ee872db 2020-10-28)

@hsivonen
Copy link
Member Author

It appears that the ARMv7 specialization of dynamic shuffles was been bogus, and fixing the typos in 026b10e revealed it.

hsivonen added a commit to hsivonen/packed_simd that referenced this issue Oct 29, 2020
(encoding_rs does not use dynamic shuffles.)

See rust-lang#309
@workingjubilee
Copy link
Member

Oh, that's "lovely". Thank you for finding that.

workingjubilee pushed a commit that referenced this issue Apr 2, 2021
(encoding_rs does not use dynamic shuffles.)

See #309
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

No branches or pull requests

2 participants