Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
quadop.cxx
Go to the documentation of this file.
00001 /*
00002 
00003   Copyright (C) 2000, 2001 Silicon Graphics, Inc.  All Rights Reserved.
00004 
00005   This program is free software; you can redistribute it and/or modify it
00006   under the terms of version 2 of the GNU General Public License as
00007   published by the Free Software Foundation.
00008 
00009   This program is distributed in the hope that it would be useful, but
00010   WITHOUT ANY WARRANTY; without even the implied warranty of
00011   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00012 
00013   Further, this software is distributed without any warranty that it is
00014   free of the rightful claim of any third person regarding infringement 
00015   or the like.  Any license provided herein, whether implied or 
00016   otherwise, applies only to this software file.  Patent licenses, if 
00017   any, provided herein do not apply to combinations of this program with 
00018   other software, or any other product whatsoever.  
00019 
00020   You should have received a copy of the GNU General Public License along
00021   with this program; if not, write the Free Software Foundation, Inc., 59
00022   Temple Place - Suite 330, Boston MA 02111-1307, USA.
00023 
00024   Contact information:  Silicon Graphics, Inc., 1600 Amphitheatre Pky,
00025   Mountain View, CA 94043, or:
00026 
00027   http://www.sgi.com
00028 
00029   For further information regarding this notice, see:
00030 
00031   http://oss.sgi.com/projects/GenInfo/NoticeExplan
00032 
00033 */
00034 
00035 
00036 
00037 static char *source_file = __FILE__;
00038 #include "defs.h"
00039 #include "erglob.h"
00040 #include "config_host.h"
00041 #include "targ_const.h"
00042 
00043 /*
00044    TODO -- reconcile the two quad types (QUAD_TYPE and quad).  These
00045    functions really are defined as using the structure quad, but it's
00046    irrelevant, as long as you don't look at the bits...  quad is
00047    defined to be a structure of two doubles, while QUAD_TYPE is a
00048    structure of four ints...  so, this is a hack, just to get this
00049    to compile (I really should have included quad.h from common/tdt/MIPS,
00050    and done something to reconcile the two kinds of quad types).
00051 */
00052 
00053 INT __c_q_to_a(char*, QUAD_TYPE, INT*);
00054 double __c_dble_q(QUAD_TYPE, INT*);
00055 float __c_sngl_q(QUAD_TYPE, INT*);
00056 INT32 __c_ji_qint(QUAD_TYPE, INT*);
00057 UINT32 __c_ji_quint(QUAD_TYPE, INT*);
00058 INT64 __c_ki_qint(QUAD_TYPE, INT*);
00059 UINT64 __c_ki_quint(QUAD_TYPE, INT*);
00060 QUAD_TYPE __c_a_to_q(char*, INT*);
00061 QUAD_TYPE __c_q_extd(double, INT*);
00062 QUAD_TYPE __c_q_ext(float, INT *);
00063 QUAD_TYPE __c_q_flotj(INT32, INT*);
00064 QUAD_TYPE __c_q_flotju(UINT32, INT*);
00065 QUAD_TYPE __c_q_flotk(INT64, INT*);
00066 QUAD_TYPE __c_q_flotku(UINT64, INT*);
00067 QUAD_TYPE __c_q_add(QUAD_TYPE, QUAD_TYPE, INT*);
00068 QUAD_TYPE __c_q_sub(QUAD_TYPE, QUAD_TYPE, INT*);
00069 QUAD_TYPE __c_q_mul(QUAD_TYPE, QUAD_TYPE, INT*);
00070 QUAD_TYPE __c_q_div(QUAD_TYPE, QUAD_TYPE, INT*);
00071 QUAD_TYPE __c_q_sqrt(QUAD_TYPE, INT*);
00072 QUAD_TYPE __c_q_neg(QUAD_TYPE, INT*);
00073 INT __c_q_eq(QUAD_TYPE, QUAD_TYPE, INT*);
00074 INT __c_q_ne(QUAD_TYPE, QUAD_TYPE, INT*);
00075 INT __c_q_lt(QUAD_TYPE, QUAD_TYPE, INT*);
00076 INT __c_q_le(QUAD_TYPE, QUAD_TYPE, INT*);
00077 INT __c_q_gt(QUAD_TYPE, QUAD_TYPE, INT*);
00078 INT __c_q_ge(QUAD_TYPE, QUAD_TYPE, INT*);
00079 
00080 /* Currently only a stub file. */
00081 QUAD_TYPE My_Atoq(char *str)
00082 {
00083  INT err;
00084  char *sstr;
00085 
00086  for ( sstr = str; *sstr; sstr++ ) {
00087   if (*sstr == 'q' || *sstr == 'Q') {
00088    *sstr='E';
00089    break;
00090   }
00091  }
00092  return (__c_a_to_q(str,&err));
00093 }
00094 
00095 INT QUADOP_EQ(QUAD_TYPE a, QUAD_TYPE b)
00096 {
00097  INT err;
00098  return(__c_q_eq(a,b,&err));
00099 }
00100 
00101 INT QUADOP_NE(QUAD_TYPE a, QUAD_TYPE b)
00102 {
00103  INT err;
00104  return(__c_q_ne(a,b,&err));
00105 }
00106 
00107 INT QUADOP_GE(QUAD_TYPE a, QUAD_TYPE b)
00108 {
00109  INT err;
00110  return(__c_q_ge(a,b,&err));
00111 }
00112 
00113 INT QUADOP_GT(QUAD_TYPE a, QUAD_TYPE b)
00114 {
00115  INT err;
00116  return(__c_q_gt(a,b,&err));
00117 }
00118 
00119 INT QUADOP_LE(QUAD_TYPE a, QUAD_TYPE b)
00120 {
00121  INT err;
00122  return(__c_q_le(a,b,&err));
00123 }
00124 
00125 INT QUADOP_LT(QUAD_TYPE a, QUAD_TYPE b)
00126 {
00127  INT err;
00128  return(__c_q_lt(a,b,&err));
00129 }
00130 
00131 QUAD_TYPE QUADOP_ADD(QUAD_TYPE a,QUAD_TYPE b)
00132 {
00133  INT err;
00134  return(__c_q_add(a,b,&err));
00135 }
00136 
00137 QUAD_TYPE QUADOP_SUB(QUAD_TYPE a,QUAD_TYPE b)
00138 {
00139  INT err;
00140  return(__c_q_sub(a,b,&err));
00141 }
00142 
00143 QUAD_TYPE QUADOP_MPY(QUAD_TYPE a,QUAD_TYPE b)
00144 {
00145  INT err;
00146  return(__c_q_mul(a,b,&err));
00147 }
00148 
00149 QUAD_TYPE QUADOP_DIV(QUAD_TYPE a,QUAD_TYPE b)
00150 {
00151  INT err;
00152  return(__c_q_div(a,b,&err));
00153 }
00154 
00155 QUAD_TYPE QUADOP_NEGATE(QUAD_TYPE a)
00156 {
00157  INT err;
00158  return(__c_q_neg(a,&err));
00159 }
00160 
00161 double QUADOP_QTOD (QUAD_TYPE a)
00162 {
00163  INT err;
00164  return(__c_dble_q(a,&err));
00165 }
00166 
00167 float QUADOP_QTOS (QUAD_TYPE a)
00168 {
00169  INT err;
00170  return(__c_sngl_q(a,&err));
00171 }
00172 
00173 INT QUADOP_QTOI (QUAD_TYPE a)
00174 {
00175  INT err;
00176  return(__c_ji_qint(a,&err));
00177 }
00178 
00179 UINT QUADOP_QTOU (QUAD_TYPE a)
00180 {
00181  INT err;
00182  return(__c_ji_quint(a,&err));
00183 }
00184 
00185 QUAD_TYPE QUADOP_UTOQ (UINT a)
00186 {
00187  INT err;
00188  return(__c_q_flotju(a,&err));
00189 }
00190 
00191 QUAD_TYPE QUADOP_STOQ (float a)
00192 {
00193  INT err;
00194  return(__c_q_ext(a,&err));
00195 }
00196 
00197 QUAD_TYPE QUADOP_DTOQ (double a)
00198 {
00199  INT err;
00200  return(__c_q_extd(a,&err));
00201 }
00202 
00203 QUAD_TYPE QUADOP_ITOQ (INT a)
00204 {
00205  INT err;
00206  return(__c_q_flotj(a,&err));
00207 }
00208 
00209 QUAD_TYPE QUADOP_SQRT(QUAD_TYPE a)
00210 {
00211  INT err;
00212  return(__c_q_sqrt(a,&err));
00213 }
00214 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines