diff --git a/dnn/nnet.c b/dnn/nnet.c
index 05d125887ed71b4280e404b9179bf4df198822ea..9ff7e6ea1dfc9b5b843d855ab658057701184717 100644
--- a/dnn/nnet.c
+++ b/dnn/nnet.c
@@ -40,6 +40,7 @@
 #include "plc_data.h"
 #include "fargan.h"
 #include "os_support.h"
+#include "vec.h"
 
 #ifdef NO_OPTIMIZATIONS
 #if defined(_MSC_VER)
diff --git a/dnn/nnet.h b/dnn/nnet.h
index ebfb23de627e579c113fc91db89ceff12e7b174c..5db0c52a8066fcb4f210469d1d248dbbbe497dc8 100644
--- a/dnn/nnet.h
+++ b/dnn/nnet.h
@@ -29,7 +29,14 @@
 #define _NNET_H_
 
 #include <stddef.h>
-#include "vec.h"
+#include "opus_types.h"
+
+#ifdef DISABLE_DOT_PROD
+typedef float qweight;
+#else
+typedef signed char qweight;
+#define DOT_PROD
+#endif
 
 #define ACTIVATION_LINEAR  0
 #define ACTIVATION_SIGMOID 1
diff --git a/dnn/vec.h b/dnn/vec.h
index 5b6951bbbb9920b98b967ce4c7c06cf0940adfba..64e7210652b814a43c701ce6d4f66f0bb9510065 100644
--- a/dnn/vec.h
+++ b/dnn/vec.h
@@ -47,17 +47,6 @@
 
 #define NO_OPTIMIZATIONS
 
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-/*#define USE_SU_BIAS*/
-#endif
-
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
-
 static inline void sgemv16x1(float *out, const float *weights, int rows, int cols, int col_stride, const float *x)
 {
    int i, j;
diff --git a/dnn/vec_avx.h b/dnn/vec_avx.h
index 39002b110577ae3b442947db5a8e12d84ac516ee..b41f9862e424994854467306d9d7058bba1ba4dd 100644
--- a/dnn/vec_avx.h
+++ b/dnn/vec_avx.h
@@ -40,13 +40,6 @@
 
 #define USE_SU_BIAS
 
-
-/* Use 8-bit dot products unless disabled or if stuck with SSE2. */
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-#endif
-
-
 #ifndef __SSE_4_1__
 static inline __m128 mm_floor_ps(__m128 x) {
   __m128 half = _mm_set1_ps(0.5);
@@ -882,11 +875,5 @@ static inline void cgemv8x4(float *_out, const opus_int8 *w, const float *scale,
 #define SCALE_1 (1.f/128.f/127.f)
 #define USE_SU_BIAS
 
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
-
 
 #endif /*VEC_AVX_H*/
diff --git a/dnn/vec_neon.h b/dnn/vec_neon.h
index db5beef4350c869065c411dd1b125545b88867d7..e9959b973017d6a7ea06a74991b496888768ecdd 100644
--- a/dnn/vec_neon.h
+++ b/dnn/vec_neon.h
@@ -34,17 +34,6 @@
 #include <arm_neon.h>
 #include "os_support.h"
 
-#ifndef DISABLE_DOT_PROD
-#define DOT_PROD
-#endif
-
-#ifdef DOT_PROD
-typedef signed char qweight;
-#else
-typedef float qweight;
-#endif
-
-
 #ifndef LPCNET_TEST
 static inline float32x4_t exp4_approx(float32x4_t x) {
   int32x4_t i;
diff --git a/dnn/write_lpcnet_weights.c b/dnn/write_lpcnet_weights.c
index 395b8d5d674efcdaf8096238a270263a9da3e4ac..722a373d7a920fd2d40ef697170c20453f8d489b 100644
--- a/dnn/write_lpcnet_weights.c
+++ b/dnn/write_lpcnet_weights.c
@@ -33,6 +33,7 @@
 #include <stddef.h>
 #include "nnet.h"
 #include "os_support.h"
+#include "arch.h"
 
 /* This is a bit of a hack because we need to build nnet_data.c and plc_data.c without USE_WEIGHTS_FILE,
    but USE_WEIGHTS_FILE is defined in config.h. */