Open64 (mfef90, whirl2f, and IR tools)  TAG: version-openad; SVN changeset: 916
q_cmplx.c
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 #include "quad.h"
00037 
00038 /* various type conversions involving long doubles and complex or
00039    quad complex
00040 */
00041 
00042 /* conversions to complex */
00043 
00044   /* R16 to X8 */
00045 
00046 void __cmplx1_q(complex *result, long double *u)
00047 {
00048   result->real = *u;
00049   result->imag = 0.0L;
00050 }
00051 
00052 void __cmplx2_q(complex *result, long double *u, long double *v)
00053 {
00054   result->real = *u;
00055   result->imag = *v;
00056 }
00057 
00058   /* X32 to X8 */
00059 
00060 void __cmplx_cq(complex *result, qcomplex *u)
00061 {
00062   result->real = u->qreal;
00063   result->imag = u->qimag;
00064 }
00065 
00066 /* conversions to double complex */
00067 
00068   /* R16 to X16 */
00069 
00070 void __dcmplx1_q(dcomplex *result, long double *u)
00071 {
00072   result->dreal = *u;
00073   result->dimag = 0.0L;
00074 }
00075 
00076 void __dcmplx2_q(dcomplex *result, long double *u, long double *v)
00077 {
00078   result->dreal = *u;
00079   result->dimag = *v;
00080 }
00081 
00082   /* X32 to X16 */
00083 
00084 void __dcmplx_cq(dcomplex *result, qcomplex *u)
00085 {
00086   result->dreal = u->qreal;
00087   result->dimag = u->qimag;
00088 }
00089 
00090   /* I2 to X32 */
00091 
00092 void __qcmplx1_i(qcomplex *result, short *u)
00093 {
00094   result->qreal = *u;
00095   result->qimag = 0.0L;
00096 }
00097 
00098 void __qcmplx2_i(qcomplex *result, short *u, short *v)
00099 {
00100   result->qreal = *u;
00101   result->qreal = *v;
00102 }
00103 
00104   /* I4 to X32 */
00105 
00106 void __qcmplx1_j(qcomplex *result, int *u)
00107 {
00108   result->qreal = *u;
00109   result->qimag = 0.0L;
00110 }
00111 
00112 void __qcmplx2_j(qcomplex *result, int *u, int *v)
00113 {
00114   result->qreal = *u;
00115   result->qreal = *v;
00116 }
00117 
00118   /* I8 to X32 */
00119 
00120 void __qcmplx1_k(qcomplex *result, long long *u)
00121 {
00122   result->qreal = *u;
00123   result->qimag = 0.0L;
00124 }
00125 
00126 void __qcmplx2_k(qcomplex *result, long long *u, long long *v)
00127 {
00128   result->qreal = *u;
00129   result->qreal = *v;
00130 }
00131 
00132   /* R4 to X32 */
00133 
00134 void __qcmplx1_r(qcomplex *result, float *u)
00135 {
00136   result->qreal = *u;
00137   result->qimag = 0.0L;
00138 }
00139 
00140 void __qcmplx2_r(qcomplex *result, float *u, float *v)
00141 {
00142   result->qreal = *u;
00143   result->qimag = *v;
00144 }
00145 
00146   /* R8 to X32 */
00147 
00148 void __qcmplx1_d(qcomplex *result, double *u)
00149 {
00150   result->qreal = *u;
00151   result->qimag = 0.0L;
00152 }
00153 
00154 void __qcmplx2_d(qcomplex *result, double *u, double *v)
00155 {
00156   result->qreal = *u;
00157   result->qimag = *v;
00158 }
00159 
00160   /* R16 to X32 */
00161 
00162 void __qcmplx1_q(qcomplex *result, long double *u)
00163 {
00164   result->qreal = *u;
00165   result->qimag = 0.0L;
00166 }
00167 
00168 void __qcmplx2_q(qcomplex *result, long double *u, long double *v)
00169 {
00170   result->qreal = *u;
00171   result->qimag = *v;
00172 }
00173 
00174   /* X8 to X32 */
00175 
00176 void __qcmplx_c(qcomplex *result, complex *u)
00177 {
00178   result->qreal = u->real;
00179   result->qimag = u->imag;
00180 }
00181 
00182   /* X16 to X32 */
00183 
00184 void __qcmplx_z(qcomplex *result, dcomplex *u)
00185 {
00186   result->qreal = u->dreal;
00187   result->qimag = u->dimag;
00188 }
00189 
00190   /* X8 to R16 */
00191 
00192 long double __q_c(complex *u)
00193 {
00194   long double  __q_ext(float);
00195 
00196   return (__q_ext(u->real));
00197 }
00198 
00199   /* X16 to R16 */
00200 
00201 long double __q_z(dcomplex *u)
00202 {
00203   long double  __q_extd(double);
00204 
00205   return (__q_extd(u->dreal));
00206 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines