Blame thirdparty/openblas/xianyi-OpenBLAS-e6e87a2/kernel/setparam-ref.c

kusano 2b45e8
/*********************************************************************/
kusano 2b45e8
/* Copyright 2009, 2010 The University of Texas at Austin.           */
kusano 2b45e8
/* All rights reserved.                                              */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/* Redistribution and use in source and binary forms, with or        */
kusano 2b45e8
/* without modification, are permitted provided that the following   */
kusano 2b45e8
/* conditions are met:                                               */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*   1. Redistributions of source code must retain the above         */
kusano 2b45e8
/*      copyright notice, this list of conditions and the following  */
kusano 2b45e8
/*      disclaimer.                                                  */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*   2. Redistributions in binary form must reproduce the above      */
kusano 2b45e8
/*      copyright notice, this list of conditions and the following  */
kusano 2b45e8
/*      disclaimer in the documentation and/or other materials       */
kusano 2b45e8
/*      provided with the distribution.                              */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/*    THIS  SOFTWARE IS PROVIDED  BY THE  UNIVERSITY OF  TEXAS AT    */
kusano 2b45e8
/*    AUSTIN  ``AS IS''  AND ANY  EXPRESS OR  IMPLIED WARRANTIES,    */
kusano 2b45e8
/*    INCLUDING, BUT  NOT LIMITED  TO, THE IMPLIED  WARRANTIES OF    */
kusano 2b45e8
/*    MERCHANTABILITY  AND FITNESS FOR  A PARTICULAR  PURPOSE ARE    */
kusano 2b45e8
/*    DISCLAIMED.  IN  NO EVENT SHALL THE UNIVERSITY  OF TEXAS AT    */
kusano 2b45e8
/*    AUSTIN OR CONTRIBUTORS BE  LIABLE FOR ANY DIRECT, INDIRECT,    */
kusano 2b45e8
/*    INCIDENTAL,  SPECIAL, EXEMPLARY,  OR  CONSEQUENTIAL DAMAGES    */
kusano 2b45e8
/*    (INCLUDING, BUT  NOT LIMITED TO,  PROCUREMENT OF SUBSTITUTE    */
kusano 2b45e8
/*    GOODS  OR  SERVICES; LOSS  OF  USE,  DATA,  OR PROFITS;  OR    */
kusano 2b45e8
/*    BUSINESS INTERRUPTION) HOWEVER CAUSED  AND ON ANY THEORY OF    */
kusano 2b45e8
/*    LIABILITY, WHETHER  IN CONTRACT, STRICT  LIABILITY, OR TORT    */
kusano 2b45e8
/*    (INCLUDING NEGLIGENCE OR OTHERWISE)  ARISING IN ANY WAY OUT    */
kusano 2b45e8
/*    OF  THE  USE OF  THIS  SOFTWARE,  EVEN  IF ADVISED  OF  THE    */
kusano 2b45e8
/*    POSSIBILITY OF SUCH DAMAGE.                                    */
kusano 2b45e8
/*                                                                   */
kusano 2b45e8
/* The views and conclusions contained in the software and           */
kusano 2b45e8
/* documentation are those of the authors and should not be          */
kusano 2b45e8
/* interpreted as representing official policies, either expressed   */
kusano 2b45e8
/* or implied, of The University of Texas at Austin.                 */
kusano 2b45e8
/*********************************************************************/
kusano 2b45e8
kusano 2b45e8
#include <stdio.h></stdio.h>
kusano 2b45e8
#include <string.h></string.h>
kusano 2b45e8
#include "common.h"
kusano 2b45e8
kusano 2b45e8
#ifdef BUILD_KERNEL
kusano 2b45e8
#include "kernelTS.h"
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#undef DEBUG
kusano 2b45e8
kusano 2b45e8
static void init_parameter(void);
kusano 2b45e8
kusano 2b45e8
gotoblas_t TABLE_NAME = {
kusano 2b45e8
  DTB_DEFAULT_ENTRIES ,
kusano 2b45e8
kusano 2b45e8
  GEMM_DEFAULT_OFFSET_A, GEMM_DEFAULT_OFFSET_B, GEMM_DEFAULT_ALIGN,
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  SGEMM_DEFAULT_UNROLL_M, SGEMM_DEFAULT_UNROLL_N, MAX(SGEMM_DEFAULT_UNROLL_M, SGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
#ifdef HAVE_EXCLUSIVE_CACHE
kusano 2b45e8
  1,
kusano 2b45e8
#else
kusano 2b45e8
  0,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  samax_kTS,  samin_kTS,  smax_kTS,  smin_kTS,
kusano 2b45e8
  isamax_kTS, isamin_kTS, ismax_kTS, ismin_kTS,
kusano 2b45e8
  snrm2_kTS,  sasum_kTS,  scopy_kTS, sdot_kTS,
kusano 2b45e8
  dsdot_kTS,
kusano 2b45e8
  srot_kTS,   saxpy_kTS,  sscal_kTS, sswap_kTS,
kusano 2b45e8
  sgemv_nTS,  sgemv_tTS, sger_kTS,
kusano 2b45e8
  ssymv_LTS, ssymv_UTS,
kusano 2b45e8
kusano 2b45e8
  sgemm_kernelTS, sgemm_betaTS, 
kusano 2b45e8
#if SGEMM_DEFAULT_UNROLL_M != SGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  sgemm_incopyTS, sgemm_itcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  sgemm_oncopyTS, sgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  sgemm_oncopyTS, sgemm_otcopyTS,
kusano 2b45e8
  strsm_kernel_LNTS, strsm_kernel_LTTS, strsm_kernel_RNTS, strsm_kernel_RTTS,
kusano 2b45e8
#if SGEMM_DEFAULT_UNROLL_M != SGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  strsm_iunucopyTS, strsm_iunncopyTS, strsm_iutucopyTS, strsm_iutncopyTS,
kusano 2b45e8
  strsm_ilnucopyTS, strsm_ilnncopyTS, strsm_iltucopyTS, strsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  strsm_ounucopyTS, strsm_ounncopyTS, strsm_outucopyTS, strsm_outncopyTS,
kusano 2b45e8
  strsm_olnucopyTS, strsm_olnncopyTS, strsm_oltucopyTS, strsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  strsm_ounucopyTS, strsm_ounncopyTS, strsm_outucopyTS, strsm_outncopyTS,
kusano 2b45e8
  strsm_olnucopyTS, strsm_olnncopyTS, strsm_oltucopyTS, strsm_oltncopyTS,
kusano 2b45e8
  strmm_kernel_RNTS, strmm_kernel_RTTS, strmm_kernel_LNTS, strmm_kernel_LTTS,
kusano 2b45e8
#if SGEMM_DEFAULT_UNROLL_M != SGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  strmm_iunucopyTS, strmm_iunncopyTS, strmm_iutucopyTS, strmm_iutncopyTS,
kusano 2b45e8
  strmm_ilnucopyTS, strmm_ilnncopyTS, strmm_iltucopyTS, strmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  strmm_ounucopyTS, strmm_ounncopyTS, strmm_outucopyTS, strmm_outncopyTS,
kusano 2b45e8
  strmm_olnucopyTS, strmm_olnncopyTS, strmm_oltucopyTS, strmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  strmm_ounucopyTS, strmm_ounncopyTS, strmm_outucopyTS, strmm_outncopyTS,
kusano 2b45e8
  strmm_olnucopyTS, strmm_olnncopyTS, strmm_oltucopyTS, strmm_oltncopyTS,
kusano 2b45e8
#if SGEMM_DEFAULT_UNROLL_M != SGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  ssymm_iutcopyTS, ssymm_iltcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  ssymm_outcopyTS, ssymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  ssymm_outcopyTS, ssymm_oltcopyTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  sneg_tcopyTS, slaswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL,NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  DGEMM_DEFAULT_UNROLL_M, DGEMM_DEFAULT_UNROLL_N, MAX(DGEMM_DEFAULT_UNROLL_M, DGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
kusano 2b45e8
  damax_kTS,  damin_kTS,  dmax_kTS,  dmin_kTS,
kusano 2b45e8
  idamax_kTS, idamin_kTS, idmax_kTS, idmin_kTS,
kusano 2b45e8
  dnrm2_kTS,  dasum_kTS,  dcopy_kTS, ddot_kTS,
kusano 2b45e8
  drot_kTS,   daxpy_kTS,  dscal_kTS, dswap_kTS,
kusano 2b45e8
  dgemv_nTS,  dgemv_tTS,  dger_kTS,
kusano 2b45e8
  dsymv_LTS,  dsymv_UTS,
kusano 2b45e8
kusano 2b45e8
  dgemm_kernelTS, dgemm_betaTS, 
kusano 2b45e8
#if DGEMM_DEFAULT_UNROLL_M != DGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  dgemm_incopyTS, dgemm_itcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  dgemm_oncopyTS, dgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  dgemm_oncopyTS, dgemm_otcopyTS,
kusano 2b45e8
  dtrsm_kernel_LNTS, dtrsm_kernel_LTTS, dtrsm_kernel_RNTS, dtrsm_kernel_RTTS,
kusano 2b45e8
#if DGEMM_DEFAULT_UNROLL_M != DGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  dtrsm_iunucopyTS, dtrsm_iunncopyTS, dtrsm_iutucopyTS, dtrsm_iutncopyTS,
kusano 2b45e8
  dtrsm_ilnucopyTS, dtrsm_ilnncopyTS, dtrsm_iltucopyTS, dtrsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  dtrsm_ounucopyTS, dtrsm_ounncopyTS, dtrsm_outucopyTS, dtrsm_outncopyTS,
kusano 2b45e8
  dtrsm_olnucopyTS, dtrsm_olnncopyTS, dtrsm_oltucopyTS, dtrsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  dtrsm_ounucopyTS, dtrsm_ounncopyTS, dtrsm_outucopyTS, dtrsm_outncopyTS,
kusano 2b45e8
  dtrsm_olnucopyTS, dtrsm_olnncopyTS, dtrsm_oltucopyTS, dtrsm_oltncopyTS,
kusano 2b45e8
  dtrmm_kernel_RNTS, dtrmm_kernel_RTTS, dtrmm_kernel_LNTS, dtrmm_kernel_LTTS,
kusano 2b45e8
#if DGEMM_DEFAULT_UNROLL_M != DGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  dtrmm_iunucopyTS, dtrmm_iunncopyTS, dtrmm_iutucopyTS, dtrmm_iutncopyTS,
kusano 2b45e8
  dtrmm_ilnucopyTS, dtrmm_ilnncopyTS, dtrmm_iltucopyTS, dtrmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  dtrmm_ounucopyTS, dtrmm_ounncopyTS, dtrmm_outucopyTS, dtrmm_outncopyTS,
kusano 2b45e8
  dtrmm_olnucopyTS, dtrmm_olnncopyTS, dtrmm_oltucopyTS, dtrmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  dtrmm_ounucopyTS, dtrmm_ounncopyTS, dtrmm_outucopyTS, dtrmm_outncopyTS,
kusano 2b45e8
  dtrmm_olnucopyTS, dtrmm_olnncopyTS, dtrmm_oltucopyTS, dtrmm_oltncopyTS,
kusano 2b45e8
#if DGEMM_DEFAULT_UNROLL_M != DGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  dsymm_iutcopyTS, dsymm_iltcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  dsymm_outcopyTS, dsymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  dsymm_outcopyTS, dsymm_oltcopyTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  dneg_tcopyTS, dlaswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL, NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  QGEMM_DEFAULT_UNROLL_M, QGEMM_DEFAULT_UNROLL_N, MAX(QGEMM_DEFAULT_UNROLL_M, QGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
kusano 2b45e8
  qamax_kTS,  qamin_kTS,  qmax_kTS,  qmin_kTS,
kusano 2b45e8
  iqamax_kTS, iqamin_kTS, iqmax_kTS, iqmin_kTS,
kusano 2b45e8
  qnrm2_kTS,  qasum_kTS,  qcopy_kTS, qdot_kTS,
kusano 2b45e8
  qrot_kTS,   qaxpy_kTS,  qscal_kTS, qswap_kTS,
kusano 2b45e8
  qgemv_nTS,  qgemv_tTS,  qger_kTS,
kusano 2b45e8
  qsymv_LTS,  qsymv_UTS,
kusano 2b45e8
kusano 2b45e8
  qgemm_kernelTS, qgemm_betaTS, 
kusano 2b45e8
#if QGEMM_DEFAULT_UNROLL_M != QGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  qgemm_incopyTS, qgemm_itcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  qgemm_oncopyTS, qgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  qgemm_oncopyTS, qgemm_otcopyTS,
kusano 2b45e8
  qtrsm_kernel_LNTS, qtrsm_kernel_LTTS, qtrsm_kernel_RNTS, qtrsm_kernel_RTTS,
kusano 2b45e8
#if QGEMM_DEFAULT_UNROLL_M != QGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  qtrsm_iunucopyTS, qtrsm_iunncopyTS, qtrsm_iutucopyTS, qtrsm_iutncopyTS,
kusano 2b45e8
  qtrsm_ilnucopyTS, qtrsm_ilnncopyTS, qtrsm_iltucopyTS, qtrsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  qtrsm_ounucopyTS, qtrsm_ounncopyTS, qtrsm_outucopyTS, qtrsm_outncopyTS,
kusano 2b45e8
  qtrsm_olnucopyTS, qtrsm_olnncopyTS, qtrsm_oltucopyTS, qtrsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  qtrsm_ounucopyTS, qtrsm_ounncopyTS, qtrsm_outucopyTS, qtrsm_outncopyTS,
kusano 2b45e8
  qtrsm_olnucopyTS, qtrsm_olnncopyTS, qtrsm_oltucopyTS, qtrsm_oltncopyTS,
kusano 2b45e8
  qtrmm_kernel_RNTS, qtrmm_kernel_RTTS, qtrmm_kernel_LNTS, qtrmm_kernel_LTTS,
kusano 2b45e8
#if QGEMM_DEFAULT_UNROLL_M != QGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  qtrmm_iunucopyTS, qtrmm_iunncopyTS, qtrmm_iutucopyTS, qtrmm_iutncopyTS,
kusano 2b45e8
  qtrmm_ilnucopyTS, qtrmm_ilnncopyTS, qtrmm_iltucopyTS, qtrmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  qtrmm_ounucopyTS, qtrmm_ounncopyTS, qtrmm_outucopyTS, qtrmm_outncopyTS,
kusano 2b45e8
  qtrmm_olnucopyTS, qtrmm_olnncopyTS, qtrmm_oltucopyTS, qtrmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  qtrmm_ounucopyTS, qtrmm_ounncopyTS, qtrmm_outucopyTS, qtrmm_outncopyTS,
kusano 2b45e8
  qtrmm_olnucopyTS, qtrmm_olnncopyTS, qtrmm_oltucopyTS, qtrmm_oltncopyTS,
kusano 2b45e8
#if QGEMM_DEFAULT_UNROLL_M != QGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  qsymm_iutcopyTS, qsymm_iltcopyTS, 
kusano 2b45e8
#else
kusano 2b45e8
  qsymm_outcopyTS, qsymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  qsymm_outcopyTS, qsymm_oltcopyTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  qneg_tcopyTS, qlaswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL, NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  CGEMM_DEFAULT_UNROLL_M, CGEMM_DEFAULT_UNROLL_N, MAX(CGEMM_DEFAULT_UNROLL_M, CGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
kusano 2b45e8
  camax_kTS, camin_kTS, icamax_kTS, icamin_kTS,
kusano 2b45e8
  cnrm2_kTS, casum_kTS, ccopy_kTS,
kusano 2b45e8
  cdotu_kTS, cdotc_kTS, csrot_kTS,
kusano 2b45e8
  caxpy_kTS, caxpyc_kTS, cscal_kTS, cswap_kTS, 
kusano 2b45e8
kusano 2b45e8
  cgemv_nTS, cgemv_tTS, cgemv_rTS, cgemv_cTS, 
kusano 2b45e8
  cgemv_oTS, cgemv_uTS, cgemv_sTS, cgemv_dTS, 
kusano 2b45e8
  cgeru_kTS, cgerc_kTS, cgerv_kTS, cgerd_kTS, 
kusano 2b45e8
  csymv_LTS, csymv_UTS,
kusano 2b45e8
  chemv_LTS, chemv_UTS, chemv_MTS, chemv_VTS,
kusano 2b45e8
  
kusano 2b45e8
  cgemm_kernel_nTS, cgemm_kernel_lTS, cgemm_kernel_rTS, cgemm_kernel_bTS,
kusano 2b45e8
  cgemm_betaTS,
kusano 2b45e8
kusano 2b45e8
#if CGEMM_DEFAULT_UNROLL_M != CGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  cgemm_incopyTS, cgemm_itcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  cgemm_oncopyTS, cgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  cgemm_oncopyTS, cgemm_otcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  ctrsm_kernel_LNTS, ctrsm_kernel_LTTS, ctrsm_kernel_LRTS, ctrsm_kernel_LCTS,
kusano 2b45e8
  ctrsm_kernel_RNTS, ctrsm_kernel_RTTS, ctrsm_kernel_RRTS, ctrsm_kernel_RCTS,
kusano 2b45e8
  
kusano 2b45e8
#if CGEMM_DEFAULT_UNROLL_M != CGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  ctrsm_iunucopyTS,  ctrsm_iunncopyTS,  ctrsm_iutucopyTS,  ctrsm_iutncopyTS,
kusano 2b45e8
  ctrsm_ilnucopyTS,  ctrsm_ilnncopyTS,  ctrsm_iltucopyTS,  ctrsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  ctrsm_ounucopyTS,  ctrsm_ounncopyTS,  ctrsm_outucopyTS,  ctrsm_outncopyTS,
kusano 2b45e8
  ctrsm_olnucopyTS,  ctrsm_olnncopyTS,  ctrsm_oltucopyTS,  ctrsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  ctrsm_ounucopyTS,  ctrsm_ounncopyTS,  ctrsm_outucopyTS,  ctrsm_outncopyTS,
kusano 2b45e8
  ctrsm_olnucopyTS,  ctrsm_olnncopyTS,  ctrsm_oltucopyTS,  ctrsm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
  ctrmm_kernel_RNTS,  ctrmm_kernel_RTTS,  ctrmm_kernel_RRTS,  ctrmm_kernel_RCTS,
kusano 2b45e8
  ctrmm_kernel_LNTS,  ctrmm_kernel_LTTS,  ctrmm_kernel_LRTS,  ctrmm_kernel_LCTS,
kusano 2b45e8
  
kusano 2b45e8
#if CGEMM_DEFAULT_UNROLL_M != CGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  ctrmm_iunucopyTS,  ctrmm_iunncopyTS,  ctrmm_iutucopyTS,  ctrmm_iutncopyTS,
kusano 2b45e8
  ctrmm_ilnucopyTS,  ctrmm_ilnncopyTS,  ctrmm_iltucopyTS,  ctrmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  ctrmm_ounucopyTS,  ctrmm_ounncopyTS,  ctrmm_outucopyTS,  ctrmm_outncopyTS,
kusano 2b45e8
  ctrmm_olnucopyTS,  ctrmm_olnncopyTS,  ctrmm_oltucopyTS,  ctrmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  ctrmm_ounucopyTS,  ctrmm_ounncopyTS,  ctrmm_outucopyTS,  ctrmm_outncopyTS,
kusano 2b45e8
  ctrmm_olnucopyTS,  ctrmm_olnncopyTS,  ctrmm_oltucopyTS,  ctrmm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
#if CGEMM_DEFAULT_UNROLL_M != CGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  csymm_iutcopyTS,  csymm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  csymm_outcopyTS,  csymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  csymm_outcopyTS,  csymm_oltcopyTS,
kusano 2b45e8
#if CGEMM_DEFAULT_UNROLL_M != CGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  chemm_iutcopyTS,  chemm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  chemm_outcopyTS,  chemm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  chemm_outcopyTS,  chemm_oltcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  cgemm3m_kernelTS,
kusano 2b45e8
  
kusano 2b45e8
  cgemm3m_incopybTS,  cgemm3m_incopyrTS,
kusano 2b45e8
  cgemm3m_incopyiTS,  cgemm3m_itcopybTS,
kusano 2b45e8
  cgemm3m_itcopyrTS,  cgemm3m_itcopyiTS,
kusano 2b45e8
  cgemm3m_oncopybTS,  cgemm3m_oncopyrTS,
kusano 2b45e8
  cgemm3m_oncopyiTS,  cgemm3m_otcopybTS,
kusano 2b45e8
  cgemm3m_otcopyrTS,  cgemm3m_otcopyiTS,
kusano 2b45e8
  
kusano 2b45e8
  csymm3m_iucopybTS,  csymm3m_ilcopybTS,
kusano 2b45e8
  csymm3m_iucopyrTS,  csymm3m_ilcopyrTS,
kusano 2b45e8
  csymm3m_iucopyiTS,  csymm3m_ilcopyiTS,
kusano 2b45e8
  csymm3m_oucopybTS,  csymm3m_olcopybTS,
kusano 2b45e8
  csymm3m_oucopyrTS,  csymm3m_olcopyrTS,
kusano 2b45e8
  csymm3m_oucopyiTS,  csymm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
  chemm3m_iucopybTS,  chemm3m_ilcopybTS,
kusano 2b45e8
  chemm3m_iucopyrTS,  chemm3m_ilcopyrTS,
kusano 2b45e8
  chemm3m_iucopyiTS,  chemm3m_ilcopyiTS, 
kusano 2b45e8
kusano 2b45e8
  chemm3m_oucopybTS,  chemm3m_olcopybTS,
kusano 2b45e8
  chemm3m_oucopyrTS,  chemm3m_olcopyrTS,
kusano 2b45e8
  chemm3m_oucopyiTS,  chemm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  cneg_tcopyTS, claswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL, NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  ZGEMM_DEFAULT_UNROLL_M, ZGEMM_DEFAULT_UNROLL_N, MAX(ZGEMM_DEFAULT_UNROLL_M, ZGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
kusano 2b45e8
  zamax_kTS, zamin_kTS, izamax_kTS, izamin_kTS,
kusano 2b45e8
  znrm2_kTS, zasum_kTS, zcopy_kTS,
kusano 2b45e8
  zdotu_kTS, zdotc_kTS, zdrot_kTS,
kusano 2b45e8
  zaxpy_kTS, zaxpyc_kTS, zscal_kTS, zswap_kTS, 
kusano 2b45e8
kusano 2b45e8
  zgemv_nTS, zgemv_tTS, zgemv_rTS, zgemv_cTS, 
kusano 2b45e8
  zgemv_oTS, zgemv_uTS, zgemv_sTS, zgemv_dTS, 
kusano 2b45e8
  zgeru_kTS, zgerc_kTS, zgerv_kTS, zgerd_kTS, 
kusano 2b45e8
  zsymv_LTS, zsymv_UTS,
kusano 2b45e8
  zhemv_LTS, zhemv_UTS, zhemv_MTS, zhemv_VTS,
kusano 2b45e8
kusano 2b45e8
  zgemm_kernel_nTS, zgemm_kernel_lTS, zgemm_kernel_rTS, zgemm_kernel_bTS,
kusano 2b45e8
  zgemm_betaTS,
kusano 2b45e8
kusano 2b45e8
#if ZGEMM_DEFAULT_UNROLL_M != ZGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  zgemm_incopyTS, zgemm_itcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  zgemm_oncopyTS, zgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  zgemm_oncopyTS, zgemm_otcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  ztrsm_kernel_LNTS, ztrsm_kernel_LTTS, ztrsm_kernel_LRTS, ztrsm_kernel_LCTS,
kusano 2b45e8
  ztrsm_kernel_RNTS, ztrsm_kernel_RTTS, ztrsm_kernel_RRTS, ztrsm_kernel_RCTS,
kusano 2b45e8
  
kusano 2b45e8
#if ZGEMM_DEFAULT_UNROLL_M != ZGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  ztrsm_iunucopyTS,  ztrsm_iunncopyTS,  ztrsm_iutucopyTS,  ztrsm_iutncopyTS,
kusano 2b45e8
  ztrsm_ilnucopyTS,  ztrsm_ilnncopyTS,  ztrsm_iltucopyTS,  ztrsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  ztrsm_ounucopyTS,  ztrsm_ounncopyTS,  ztrsm_outucopyTS,  ztrsm_outncopyTS,
kusano 2b45e8
  ztrsm_olnucopyTS,  ztrsm_olnncopyTS,  ztrsm_oltucopyTS,  ztrsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  ztrsm_ounucopyTS,  ztrsm_ounncopyTS,  ztrsm_outucopyTS,  ztrsm_outncopyTS,
kusano 2b45e8
  ztrsm_olnucopyTS,  ztrsm_olnncopyTS,  ztrsm_oltucopyTS,  ztrsm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
  ztrmm_kernel_RNTS,  ztrmm_kernel_RTTS,  ztrmm_kernel_RRTS,  ztrmm_kernel_RCTS,
kusano 2b45e8
  ztrmm_kernel_LNTS,  ztrmm_kernel_LTTS,  ztrmm_kernel_LRTS,  ztrmm_kernel_LCTS,
kusano 2b45e8
  
kusano 2b45e8
#if ZGEMM_DEFAULT_UNROLL_M != ZGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  ztrmm_iunucopyTS,  ztrmm_iunncopyTS,  ztrmm_iutucopyTS,  ztrmm_iutncopyTS,
kusano 2b45e8
  ztrmm_ilnucopyTS,  ztrmm_ilnncopyTS,  ztrmm_iltucopyTS,  ztrmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  ztrmm_ounucopyTS,  ztrmm_ounncopyTS,  ztrmm_outucopyTS,  ztrmm_outncopyTS,
kusano 2b45e8
  ztrmm_olnucopyTS,  ztrmm_olnncopyTS,  ztrmm_oltucopyTS,  ztrmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  ztrmm_ounucopyTS,  ztrmm_ounncopyTS,  ztrmm_outucopyTS,  ztrmm_outncopyTS,
kusano 2b45e8
  ztrmm_olnucopyTS,  ztrmm_olnncopyTS,  ztrmm_oltucopyTS,  ztrmm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
#if ZGEMM_DEFAULT_UNROLL_M != ZGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  zsymm_iutcopyTS,  zsymm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  zsymm_outcopyTS,  zsymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  zsymm_outcopyTS,  zsymm_oltcopyTS,
kusano 2b45e8
#if ZGEMM_DEFAULT_UNROLL_M != ZGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  zhemm_iutcopyTS,  zhemm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  zhemm_outcopyTS,  zhemm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  zhemm_outcopyTS,  zhemm_oltcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  zgemm3m_kernelTS,
kusano 2b45e8
  
kusano 2b45e8
  zgemm3m_incopybTS,  zgemm3m_incopyrTS,
kusano 2b45e8
  zgemm3m_incopyiTS,  zgemm3m_itcopybTS,
kusano 2b45e8
  zgemm3m_itcopyrTS,  zgemm3m_itcopyiTS,
kusano 2b45e8
  zgemm3m_oncopybTS,  zgemm3m_oncopyrTS,
kusano 2b45e8
  zgemm3m_oncopyiTS,  zgemm3m_otcopybTS,
kusano 2b45e8
  zgemm3m_otcopyrTS,  zgemm3m_otcopyiTS,
kusano 2b45e8
  
kusano 2b45e8
  zsymm3m_iucopybTS,  zsymm3m_ilcopybTS,
kusano 2b45e8
  zsymm3m_iucopyrTS,  zsymm3m_ilcopyrTS,
kusano 2b45e8
  zsymm3m_iucopyiTS,  zsymm3m_ilcopyiTS,
kusano 2b45e8
  zsymm3m_oucopybTS,  zsymm3m_olcopybTS,
kusano 2b45e8
  zsymm3m_oucopyrTS,  zsymm3m_olcopyrTS,
kusano 2b45e8
  zsymm3m_oucopyiTS,  zsymm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
  zhemm3m_iucopybTS,  zhemm3m_ilcopybTS,
kusano 2b45e8
  zhemm3m_iucopyrTS,  zhemm3m_ilcopyrTS,
kusano 2b45e8
  zhemm3m_iucopyiTS,  zhemm3m_ilcopyiTS, 
kusano 2b45e8
kusano 2b45e8
  zhemm3m_oucopybTS,  zhemm3m_olcopybTS,
kusano 2b45e8
  zhemm3m_oucopyrTS,  zhemm3m_olcopyrTS,
kusano 2b45e8
  zhemm3m_oucopyiTS,  zhemm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  zneg_tcopyTS, zlaswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL, NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
kusano 2b45e8
  0, 0, 0,
kusano 2b45e8
  XGEMM_DEFAULT_UNROLL_M, XGEMM_DEFAULT_UNROLL_N, MAX(XGEMM_DEFAULT_UNROLL_M, XGEMM_DEFAULT_UNROLL_N),
kusano 2b45e8
kusano 2b45e8
  xamax_kTS, xamin_kTS, ixamax_kTS, ixamin_kTS,
kusano 2b45e8
  xnrm2_kTS, xasum_kTS, xcopy_kTS,
kusano 2b45e8
  xdotu_kTS, xdotc_kTS, xqrot_kTS,
kusano 2b45e8
  xaxpy_kTS, xaxpyc_kTS, xscal_kTS, xswap_kTS, 
kusano 2b45e8
kusano 2b45e8
  xgemv_nTS, xgemv_tTS, xgemv_rTS, xgemv_cTS, 
kusano 2b45e8
  xgemv_oTS, xgemv_uTS, xgemv_sTS, xgemv_dTS, 
kusano 2b45e8
  xgeru_kTS, xgerc_kTS, xgerv_kTS, xgerd_kTS, 
kusano 2b45e8
  xsymv_LTS, xsymv_UTS,
kusano 2b45e8
  xhemv_LTS, xhemv_UTS, xhemv_MTS, xhemv_VTS,
kusano 2b45e8
kusano 2b45e8
  xgemm_kernel_nTS, xgemm_kernel_lTS, xgemm_kernel_rTS, xgemm_kernel_bTS,
kusano 2b45e8
  xgemm_betaTS,
kusano 2b45e8
kusano 2b45e8
#if XGEMM_DEFAULT_UNROLL_M != XGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  xgemm_incopyTS, xgemm_itcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  xgemm_oncopyTS, xgemm_otcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  xgemm_oncopyTS, xgemm_otcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  xtrsm_kernel_LNTS, xtrsm_kernel_LTTS, xtrsm_kernel_LRTS, xtrsm_kernel_LCTS,
kusano 2b45e8
  xtrsm_kernel_RNTS, xtrsm_kernel_RTTS, xtrsm_kernel_RRTS, xtrsm_kernel_RCTS,
kusano 2b45e8
  
kusano 2b45e8
#if XGEMM_DEFAULT_UNROLL_M != XGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  xtrsm_iunucopyTS,  xtrsm_iunncopyTS,  xtrsm_iutucopyTS,  xtrsm_iutncopyTS,
kusano 2b45e8
  xtrsm_ilnucopyTS,  xtrsm_ilnncopyTS,  xtrsm_iltucopyTS,  xtrsm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  xtrsm_ounucopyTS,  xtrsm_ounncopyTS,  xtrsm_outucopyTS,  xtrsm_outncopyTS,
kusano 2b45e8
  xtrsm_olnucopyTS,  xtrsm_olnncopyTS,  xtrsm_oltucopyTS,  xtrsm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  xtrsm_ounucopyTS,  xtrsm_ounncopyTS,  xtrsm_outucopyTS,  xtrsm_outncopyTS,
kusano 2b45e8
  xtrsm_olnucopyTS,  xtrsm_olnncopyTS,  xtrsm_oltucopyTS,  xtrsm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
  xtrmm_kernel_RNTS,  xtrmm_kernel_RTTS,  xtrmm_kernel_RRTS,  xtrmm_kernel_RCTS,
kusano 2b45e8
  xtrmm_kernel_LNTS,  xtrmm_kernel_LTTS,  xtrmm_kernel_LRTS,  xtrmm_kernel_LCTS,
kusano 2b45e8
  
kusano 2b45e8
#if XGEMM_DEFAULT_UNROLL_M != XGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  xtrmm_iunucopyTS,  xtrmm_iunncopyTS,  xtrmm_iutucopyTS,  xtrmm_iutncopyTS,
kusano 2b45e8
  xtrmm_ilnucopyTS,  xtrmm_ilnncopyTS,  xtrmm_iltucopyTS,  xtrmm_iltncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  xtrmm_ounucopyTS,  xtrmm_ounncopyTS,  xtrmm_outucopyTS,  xtrmm_outncopyTS,
kusano 2b45e8
  xtrmm_olnucopyTS,  xtrmm_olnncopyTS,  xtrmm_oltucopyTS,  xtrmm_oltncopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  xtrmm_ounucopyTS,  xtrmm_ounncopyTS,  xtrmm_outucopyTS,  xtrmm_outncopyTS,
kusano 2b45e8
  xtrmm_olnucopyTS,  xtrmm_olnncopyTS,  xtrmm_oltucopyTS,  xtrmm_oltncopyTS,
kusano 2b45e8
  
kusano 2b45e8
#if XGEMM_DEFAULT_UNROLL_M != XGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  xsymm_iutcopyTS,  xsymm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  xsymm_outcopyTS,  xsymm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  xsymm_outcopyTS,  xsymm_oltcopyTS,
kusano 2b45e8
#if XGEMM_DEFAULT_UNROLL_M != XGEMM_DEFAULT_UNROLL_N
kusano 2b45e8
  xhemm_iutcopyTS,  xhemm_iltcopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  xhemm_outcopyTS,  xhemm_oltcopyTS,
kusano 2b45e8
#endif
kusano 2b45e8
  xhemm_outcopyTS,  xhemm_oltcopyTS,
kusano 2b45e8
  
kusano 2b45e8
  xgemm3m_kernelTS,
kusano 2b45e8
  
kusano 2b45e8
  xgemm3m_incopybTS,  xgemm3m_incopyrTS,
kusano 2b45e8
  xgemm3m_incopyiTS,  xgemm3m_itcopybTS,
kusano 2b45e8
  xgemm3m_itcopyrTS,  xgemm3m_itcopyiTS,
kusano 2b45e8
  xgemm3m_oncopybTS,  xgemm3m_oncopyrTS,
kusano 2b45e8
  xgemm3m_oncopyiTS,  xgemm3m_otcopybTS,
kusano 2b45e8
  xgemm3m_otcopyrTS,  xgemm3m_otcopyiTS,
kusano 2b45e8
  
kusano 2b45e8
  xsymm3m_iucopybTS,  xsymm3m_ilcopybTS,
kusano 2b45e8
  xsymm3m_iucopyrTS,  xsymm3m_ilcopyrTS,
kusano 2b45e8
  xsymm3m_iucopyiTS,  xsymm3m_ilcopyiTS,
kusano 2b45e8
  xsymm3m_oucopybTS,  xsymm3m_olcopybTS,
kusano 2b45e8
  xsymm3m_oucopyrTS,  xsymm3m_olcopyrTS,
kusano 2b45e8
  xsymm3m_oucopyiTS,  xsymm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
  xhemm3m_iucopybTS,  xhemm3m_ilcopybTS,
kusano 2b45e8
  xhemm3m_iucopyrTS,  xhemm3m_ilcopyrTS,
kusano 2b45e8
  xhemm3m_iucopyiTS,  xhemm3m_ilcopyiTS, 
kusano 2b45e8
kusano 2b45e8
  xhemm3m_oucopybTS,  xhemm3m_olcopybTS,
kusano 2b45e8
  xhemm3m_oucopyrTS,  xhemm3m_olcopyrTS,
kusano 2b45e8
  xhemm3m_oucopyiTS,  xhemm3m_olcopyiTS,
kusano 2b45e8
kusano 2b45e8
#ifndef NO_LAPACK
kusano 2b45e8
  xneg_tcopyTS, xlaswp_ncopyTS,
kusano 2b45e8
#else
kusano 2b45e8
  NULL, NULL,
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  init_parameter,
kusano 2b45e8
kusano 2b45e8
  SNUMOPT, DNUMOPT, QNUMOPT,
kusano 2b45e8
kusano 2b45e8
};
kusano 2b45e8
kusano 2b45e8
#ifdef ARCH_X86
kusano 2b45e8
static int get_l2_size_old(void){
kusano 2b45e8
  int i, eax, ebx, ecx, edx, cpuid_level;
kusano 2b45e8
  int info[15];
kusano 2b45e8
kusano 2b45e8
  cpuid(2, &eax, &ebx, &ecx, &edx);
kusano 2b45e8
  
kusano 2b45e8
  info[ 0] = BITMASK(eax,  8, 0xff);
kusano 2b45e8
  info[ 1] = BITMASK(eax, 16, 0xff);
kusano 2b45e8
  info[ 2] = BITMASK(eax, 24, 0xff);
kusano 2b45e8
  
kusano 2b45e8
  info[ 3] = BITMASK(ebx,  0, 0xff);
kusano 2b45e8
  info[ 4] = BITMASK(ebx,  8, 0xff);
kusano 2b45e8
  info[ 5] = BITMASK(ebx, 16, 0xff);
kusano 2b45e8
  info[ 6] = BITMASK(ebx, 24, 0xff);
kusano 2b45e8
  
kusano 2b45e8
  info[ 7] = BITMASK(ecx,  0, 0xff);
kusano 2b45e8
  info[ 8] = BITMASK(ecx,  8, 0xff);
kusano 2b45e8
  info[ 9] = BITMASK(ecx, 16, 0xff);
kusano 2b45e8
  info[10] = BITMASK(ecx, 24, 0xff);
kusano 2b45e8
  
kusano 2b45e8
  info[11] = BITMASK(edx,  0, 0xff);
kusano 2b45e8
  info[12] = BITMASK(edx,  8, 0xff);
kusano 2b45e8
  info[13] = BITMASK(edx, 16, 0xff);
kusano 2b45e8
  info[14] = BITMASK(edx, 24, 0xff);
kusano 2b45e8
  
kusano 2b45e8
  for (i = 0; i < 15; i++){
kusano 2b45e8
    
kusano 2b45e8
    switch (info[i]){
kusano 2b45e8
      
kusano 2b45e8
      /* This table is from http://www.sandpile.org/ia32/cpuid.htm */
kusano 2b45e8
      
kusano 2b45e8
    case 0x1a :
kusano 2b45e8
      return 96;
kusano 2b45e8
      
kusano 2b45e8
    case 0x39 :
kusano 2b45e8
    case 0x3b :
kusano 2b45e8
    case 0x41 :
kusano 2b45e8
    case 0x79 :
kusano 2b45e8
    case 0x81 :
kusano 2b45e8
      return 128;
kusano 2b45e8
      
kusano 2b45e8
    case 0x3a :
kusano 2b45e8
      return 192;
kusano 2b45e8
      
kusano 2b45e8
    case 0x21 :
kusano 2b45e8
    case 0x3c :
kusano 2b45e8
    case 0x42 :
kusano 2b45e8
    case 0x7a :
kusano 2b45e8
    case 0x7e :
kusano 2b45e8
    case 0x82 :
kusano 2b45e8
      return 256;
kusano 2b45e8
      
kusano 2b45e8
    case 0x3d :
kusano 2b45e8
      return 384;
kusano 2b45e8
      
kusano 2b45e8
    case 0x3e :
kusano 2b45e8
    case 0x43 :
kusano 2b45e8
    case 0x7b :
kusano 2b45e8
    case 0x7f :
kusano 2b45e8
    case 0x83 :
kusano 2b45e8
    case 0x86 :
kusano 2b45e8
      return 512;
kusano 2b45e8
      
kusano 2b45e8
    case 0x44 :
kusano 2b45e8
    case 0x78 :
kusano 2b45e8
    case 0x7c :
kusano 2b45e8
    case 0x84 :
kusano 2b45e8
    case 0x87 :
kusano 2b45e8
      return 1024;
kusano 2b45e8
      
kusano 2b45e8
    case 0x45 :
kusano 2b45e8
    case 0x7d :
kusano 2b45e8
    case 0x85 :
kusano 2b45e8
      return 2048;
kusano 2b45e8
kusano 2b45e8
    case 0x48 :
kusano 2b45e8
      return 3184;
kusano 2b45e8
      
kusano 2b45e8
    case 0x49 :
kusano 2b45e8
      return 4096;
kusano 2b45e8
      
kusano 2b45e8
    case 0x4e :
kusano 2b45e8
      return 6144;
kusano 2b45e8
    }
kusano 2b45e8
  }
kusano 2b45e8
  return 0;
kusano 2b45e8
}
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
static __inline__ int get_l2_size(void){
kusano 2b45e8
kusano 2b45e8
  int eax, ebx, ecx, edx, l2;
kusano 2b45e8
kusano 2b45e8
  cpuid(0x80000006, &eax, &ebx, &ecx, &edx);
kusano 2b45e8
kusano 2b45e8
  l2 = BITMASK(ecx, 16, 0xffff);
kusano 2b45e8
kusano 2b45e8
#ifndef ARCH_X86
kusano 2b45e8
  return l2;
kusano 2b45e8
kusano 2b45e8
#else
kusano 2b45e8
kusano 2b45e8
  if (l2 > 0) return l2;
kusano 2b45e8
kusano 2b45e8
  return get_l2_size_old();
kusano 2b45e8
#endif
kusano 2b45e8
}
kusano 2b45e8
kusano 2b45e8
static __inline__ int get_l3_size(void){
kusano 2b45e8
kusano 2b45e8
  int eax, ebx, ecx, edx;
kusano 2b45e8
kusano 2b45e8
  cpuid(0x80000006, &eax, &ebx, &ecx, &edx);
kusano 2b45e8
kusano 2b45e8
  return BITMASK(edx, 18, 0x3fff) * 512;
kusano 2b45e8
}
kusano 2b45e8
kusano 2b45e8
kusano 2b45e8
static void init_parameter(void) {
kusano 2b45e8
kusano 2b45e8
  int l2 = get_l2_size();
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_q = SGEMM_DEFAULT_Q;
kusano 2b45e8
  TABLE_NAME.dgemm_q = DGEMM_DEFAULT_Q;
kusano 2b45e8
  TABLE_NAME.cgemm_q = CGEMM_DEFAULT_Q;
kusano 2b45e8
  TABLE_NAME.zgemm_q = ZGEMM_DEFAULT_Q;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_q = QGEMM_DEFAULT_Q;
kusano 2b45e8
  TABLE_NAME.xgemm_q = XGEMM_DEFAULT_Q;
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#if defined(CORE_KATMAI)  || defined(CORE_COPPERMINE) || defined(CORE_BANIAS) || defined(CORE_YONAH)
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Katmai, Coppermine, Banias\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p =  64 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.dgemm_p =  32 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.cgemm_p =  32 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.zgemm_p =  16 * (l2 >> 7);
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  16 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.xgemm_p =   8 * (l2 >> 7);
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef CORE_NORTHWOOD
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Northwood\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p =  96 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.dgemm_p =  48 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.cgemm_p =  48 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.zgemm_p =  24 * (l2 >> 7);
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  24 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.xgemm_p =  12 * (l2 >> 7);
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef ATOM
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Atom\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = 256;
kusano 2b45e8
  TABLE_NAME.dgemm_p = 128;
kusano 2b45e8
  TABLE_NAME.cgemm_p = 128;
kusano 2b45e8
  TABLE_NAME.zgemm_p =  64;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  64;
kusano 2b45e8
  TABLE_NAME.xgemm_p =  32;
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef CORE_PRESCOTT
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Prescott\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p =  56 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.dgemm_p =  28 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.cgemm_p =  28 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.zgemm_p =  14 * (l2 >> 7);
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  14 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.xgemm_p =   7 * (l2 >> 7);
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef CORE2
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Core2\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p =  92 * (l2 >> 9);
kusano 2b45e8
  TABLE_NAME.dgemm_p =  46 * (l2 >> 9);
kusano 2b45e8
  TABLE_NAME.cgemm_p =  46 * (l2 >> 9);
kusano 2b45e8
  TABLE_NAME.zgemm_p =  23 * (l2 >> 9);
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  92 * (l2 >> 9);
kusano 2b45e8
  TABLE_NAME.xgemm_p =  46 * (l2 >> 9);
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef PENRYN
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Penryn\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p =  42 * (l2 >> 9) + 8;
kusano 2b45e8
  TABLE_NAME.dgemm_p =  42 * (l2 >> 9) + 8;
kusano 2b45e8
  TABLE_NAME.cgemm_p =  21 * (l2 >> 9) + 4;
kusano 2b45e8
  TABLE_NAME.zgemm_p =  21 * (l2 >> 9) + 4;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  42 * (l2 >> 9) + 8;
kusano 2b45e8
  TABLE_NAME.xgemm_p =  21 * (l2 >> 9) + 4;
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef NEHALEM
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Nehalem\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = SGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.dgemm_p = DGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.cgemm_p = CGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.zgemm_p = ZGEMM_DEFAULT_P;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p = QGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.xgemm_p = XGEMM_DEFAULT_P;
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef OPTERON
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Opteron\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = 224 +  56 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.dgemm_p = 112 +  28 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.cgemm_p = 112 +  28 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.zgemm_p =  56 +  14 * (l2 >> 7);
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p =  56 +  14 * (l2 >> 7);
kusano 2b45e8
  TABLE_NAME.xgemm_p =  28 +   7 * (l2 >> 7);
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef BARCELONA
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "Barcelona\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = SGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.dgemm_p = DGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.cgemm_p = CGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.zgemm_p = ZGEMM_DEFAULT_P;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p = QGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.xgemm_p = XGEMM_DEFAULT_P;
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef NANO
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "NANO\n");
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = SGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.dgemm_p = DGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.cgemm_p = CGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.zgemm_p = ZGEMM_DEFAULT_P;
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p = QGEMM_DEFAULT_P;
kusano 2b45e8
  TABLE_NAME.xgemm_p = XGEMM_DEFAULT_P;
kusano 2b45e8
#endif
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_p = (TABLE_NAME.sgemm_p + SGEMM_DEFAULT_UNROLL_M - 1) & ~(SGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
  TABLE_NAME.dgemm_p = (TABLE_NAME.dgemm_p + DGEMM_DEFAULT_UNROLL_M - 1) & ~(DGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
  TABLE_NAME.cgemm_p = (TABLE_NAME.cgemm_p + CGEMM_DEFAULT_UNROLL_M - 1) & ~(CGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
  TABLE_NAME.zgemm_p = (TABLE_NAME.zgemm_p + ZGEMM_DEFAULT_UNROLL_M - 1) & ~(ZGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
#ifdef QUAD_PRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_p = (TABLE_NAME.qgemm_p + QGEMM_DEFAULT_UNROLL_M - 1) & ~(QGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
  TABLE_NAME.xgemm_p = (TABLE_NAME.xgemm_p + XGEMM_DEFAULT_UNROLL_M - 1) & ~(XGEMM_DEFAULT_UNROLL_M - 1);
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
#ifdef DEBUG
kusano 2b45e8
  fprintf(stderr, "L2 = %8d DGEMM_P  .. %d\n", l2, TABLE_NAME.dgemm_p);
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.sgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.sgemm_p * TABLE_NAME.sgemm_q *  4 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)
kusano 2b45e8
			       ) / (TABLE_NAME.sgemm_q *  4) - 15) & ~15);
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.dgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.dgemm_p * TABLE_NAME.dgemm_q *  8 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)
kusano 2b45e8
			       ) / (TABLE_NAME.dgemm_q *  8) - 15) & ~15);
kusano 2b45e8
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.qgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.qgemm_p * TABLE_NAME.qgemm_q * 16 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)
kusano 2b45e8
			       ) / (TABLE_NAME.qgemm_q * 16) - 15) & ~15);
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.cgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.cgemm_p * TABLE_NAME.cgemm_q *  8 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)
kusano 2b45e8
			       ) / (TABLE_NAME.cgemm_q *  8) - 15) & ~15);
kusano 2b45e8
kusano 2b45e8
  TABLE_NAME.zgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.zgemm_p * TABLE_NAME.zgemm_q * 16 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)
kusano 2b45e8
			       ) / (TABLE_NAME.zgemm_q * 16) - 15) & ~15);
kusano 2b45e8
kusano 2b45e8
#ifdef EXPRECISION
kusano 2b45e8
  TABLE_NAME.xgemm_r = (((BUFFER_SIZE - 
kusano 2b45e8
			       ((TABLE_NAME.xgemm_p * TABLE_NAME.xgemm_q * 32 + TABLE_NAME.offsetA 
kusano 2b45e8
				 + TABLE_NAME.align) & ~TABLE_NAME.align)	
kusano 2b45e8
		       ) / (TABLE_NAME.xgemm_q * 32) - 15) & ~15);
kusano 2b45e8
#endif
kusano 2b45e8
kusano 2b45e8
}