Skip to content

Doesn't build on powerpc64 #9

@pkubaj

Description

@pkubaj

I'm building as part of SuperCollider with LLVM 11 rc2 on FreeBSD:

/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:23: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]
        return (ivec){i, i, i, i};
                      ^
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:23: note: insert an explicit cast to silence this issue
        return (ivec){i, i, i, i};
                      ^
                      static_cast<unsigned int>( )
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:26: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]
        return (ivec){i, i, i, i};
                         ^
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:26: note: insert an explicit cast to silence this issue
        return (ivec){i, i, i, i};
                         ^
                         static_cast<unsigned int>( )
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:29: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]
        return (ivec){i, i, i, i};
                            ^
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:29: note: insert an explicit cast to silence this issue
        return (ivec){i, i, i, i};
                            ^
                            static_cast<unsigned int>( )
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:32: error: non-constant-expression cannot be narrowed from type 'int' to 'unsigned int' in initializer list [-Wc++11-narrowing]
        return (ivec){i, i, i, i};
                               ^
/tmp/usr/ports/audio/supercollider/work/SuperCollider-3.11.0-Source/external_libraries/nova-simd/vec/vec_int_altivec.hpp:38:32: note: insert an explicit cast to silence this issue
        return (ivec){i, i, i, i};
                               ^
                               static_cast<unsigned int>( )
4 errors generated.

The following patch fixes build, but I'm not sure whether it causes any runtime issues:

--- external_libraries/nova-simd/vec/vec_int_altivec.hpp.orig   2020-09-03 23:55:08.848538000 +0200
+++ external_libraries/nova-simd/vec/vec_int_altivec.hpp        2020-09-03 23:58:16.614642000 +0200
@@ -35,7 +35,7 @@
     static ivec set_vector(int i)
     {
 #ifdef __GNUC__
-        return (ivec){i, i, i, i};
+        return (ivec){static_cast<unsigned int>(i), static_cast<unsigned int>(i), static_cast<unsigned int>(i), static_cast<unsigned int>(i)};
 #else
 #error compiler not supported
 #endif 

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions