OSDN Git Service

Whitespace fixups
[pf3gnuchains/gcc-fork.git] / libgfortran / generated / dotprod_c8.c
index fe2d82d..df7738f 100644 (file)
@@ -26,27 +26,29 @@ GNU General Public License for more details.
 
 You should have received a copy of the GNU General Public
 License along with libgfortran; see the file COPYING.  If not,
-write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
-Boston, MA 02111-1307, USA.  */
+write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
+Boston, MA 02110-1301, USA.  */
 
 #include "config.h"
 #include <stdlib.h>
 #include <assert.h>
 #include "libgfortran.h"
 
+#if defined (HAVE_GFC_COMPLEX_8)
+
 typedef GFC_ARRAY_DESCRIPTOR(GFC_MAX_DIMENSIONS, char) char_array;
 
-extern GFC_COMPLEX_8 dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b);
+extern GFC_COMPLEX_8 dot_product_c8 (gfc_array_c8 * const restrict a, 
+       gfc_array_c8 * const restrict b);
 export_proto(dot_product_c8);
 
 /* Both parameters will already have been converted to the result type.  */
 GFC_COMPLEX_8
-dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b)
+dot_product_c8 (gfc_array_c8 * const restrict a, gfc_array_c8 * const restrict b)
 {
-  GFC_COMPLEX_8 *pa;
-  GFC_COMPLEX_8 *pb;
+  const GFC_COMPLEX_8 * restrict pa;
+  const GFC_COMPLEX_8 * restrict pb;
   GFC_COMPLEX_8 res;
-  GFC_COMPLEX_8 conjga;
   index_type count;
   index_type astride;
   index_type bstride;
@@ -68,11 +70,12 @@ dot_product_c8 (gfc_array_c8 * a, gfc_array_c8 * b)
 
   while (count--)
     {
-      COMPLEX_ASSIGN(conjga, REALPART (*pa), -IMAGPART (*pa));
-      res += conjga * *pb;
+      res += __builtin_conj (*pa) * *pb;
       pa += astride;
       pb += bstride;
     }
 
   return res;
 }
+
+#endif