bcmpinc / voxel-engine

An experimental non-gpu 3d voxel engine.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build error: ‘_mm_max_epi32’ was not declared

tau-dev opened this issue · comments

commented

Following the installation instructions, I get the following errors after running make:

/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp: In function ‘__m128i blend_epi32(__m128i, __m128i)’:
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp:73:29: error: there are no arguments to ‘_mm_blend_ps’ that depend on a template parameter, so a declaration of ‘_mm_blend_ps’ must be available [-fpermissive]
   73 |     return _mm_castps_si128(_mm_blend_ps(_mm_castsi128_ps(a),_mm_castsi128_ps(b),mask));
      |                             ^~~~~~~~~~~~
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp:73:29: note: (if you use ‘-fpermissive’, G++ will accept your code, but allowing the use of an undeclared name is deprecated)
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp: In function ‘int extract_epi32(__m128i)’:
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp:84:12: error: there are no arguments to ‘_mm_extract_epi32’ that depend on a template parameter, so a declaration of ‘_mm_extract_epi32’ must be available [-fpermissive]
   84 |     return _mm_extract_epi32(a, index);
      |            ^~~~~~~~~~~~~~~~~
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp: In function ‘__m128i compute_frustum(__m128i, __m128i, __m128i)’:
/home/tau/foreign/voxel-engine/src/engine/octree_draw.cpp:99:38: error: ‘_mm_max_epi32’ was not declared in this scope; did you mean ‘_mm_max_epi16’?
   99 |     frustum = _mm_sub_epi32(frustum, _mm_max_epi32(dx, nil));
      |                                      ^~~~~~~~~~~~~
      |                                      _mm_max_epi16

... and a couple of similar ones, all relating to undeclared __mm* identifiers.

I'm using g++ (GCC) 11.1.0 on a Ryzen 5 4600H, which does support SSE4.1. Do I need to enable it with the compiler in some way?

It used to work with:
#include <xmmintrin.h>
But for some reason now it requires
#include <smmintrin.h>
I've changed it. This might break the SSE3 compatibility mode, but nowadays most computers should have SSE4.1 support anyways.

I got the program running, but am getting a blank screen now. I'm not sure why.