Imported Upstream version 3.2.2
[debian/gnuradio] / gnuradio-core / src / lib / filter / gr_fir_ccf_simd.cc
index 77432118cf76fb72c4f658920a47547cc824a00b..c20cd4e623fc3e6d3b91aa2d56433a7263051dac 100644 (file)
@@ -1,12 +1,12 @@
 /* -*- c++ -*- */
 /*
- * Copyright 2002 Free Software Foundation, Inc.
+ * Copyright 2002,2007 Free Software Foundation, Inc.
  * 
  * This file is part of GNU Radio
  * 
  * GNU Radio is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation; either version 2, or (at your option)
+ * the Free Software Foundation; either version 3, or (at your option)
  * any later version.
  * 
  * GNU Radio is distributed in the hope that it will be useful,
@@ -28,6 +28,7 @@
 #include <assert.h>
 #include <malloc16.h>
 #include <iostream>
+#include <stdexcept>
 
 using std::cerr;
 using std::endl;
@@ -103,6 +104,8 @@ gr_fir_ccf_simd::filter (const gr_complex input[])
   if (ntaps () == 0)
     return 0.0;
 
+  if (((intptr_t) input & 0x7) != 0)
+    throw std::invalid_argument("gr_complex must be 8-byte aligned");
 
   // Round input data address down to 16 byte boundary
   // NB: depending on the alignment of input[], memory