⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 x-cvsweb-markup(46)

📁 软件浮点数计算功能
💻
📖 第 1 页 / 共 3 页
字号:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><HTML><HEAD><!-- hennerik CVSweb $Revision: 1.93 $ --><TITLE>glibc.dead/soft-fp/op-1.h - view - 1.1.1.2</TITLE></HEAD><BODY BGCOLOR="#eeeeee"><table width="100%" border=0 cellspacing=0 cellpadding=1 bgcolor="#9999ee"><tr valign=bottom><td><a href="op-1.h#rev1.1.1.2"><IMG SRC="/icons/back.gif" ALT="[BACK]" BORDER="0" WIDTH="20" HEIGHT="22"></a> <b>Return to <A HREF="op-1.h#rev1.1.1.2">op-1.h</A> CVS log</b> <IMG SRC="/icons/text.gif" ALT="[TXT]" BORDER="0" WIDTH="20" HEIGHT="22"></td><td align=right><IMG SRC="/icons/dir.gif" ALT="[DIR]" BORDER="0" WIDTH="20" HEIGHT="22"> <b>Up to  <a href="/cgi-bin/cvsweb.cgi/#dirlist">[Development]</a> / <a href="/cgi-bin/cvsweb.cgi/glibc.dead/#dirlist">glibc.dead</a> / <a href="/cgi-bin/cvsweb.cgi/glibc.dead/soft-fp/#dirlist">soft-fp</a></b></td></tr></table><HR noshade><table width="100%"><tr><td bgcolor="#ffffff">File:  <a href="/cgi-bin/cvsweb.cgi/#dirlist">[Development]</a> / <a href="/cgi-bin/cvsweb.cgi/glibc.dead/#dirlist">glibc.dead</a> / <a href="/cgi-bin/cvsweb.cgi/glibc.dead/soft-fp/#dirlist">soft-fp</a> / <a href="/cgi-bin/cvsweb.cgi/glibc.dead/soft-fp/op-1.h">op-1.h</a>&nbsp;(<A HREF="/cgi-bin/cvsweb.cgi/~checkout~/glibc.dead/soft-fp/op-1.h?rev=1.1.1.2" target="cvs_checkout" onClick="window.open('/cgi-bin/cvsweb.cgi/~checkout~/glibc.dead/soft-fp/op-1.h?rev=1.1.1.2','cvs_checkout','resizeable,scrollbars');"><b>download</b></A>)<BR>Revision <B>1.1.1.2</B> <i>(vendor branch)</i>, <i>Thu Aug  2 11:38:45 2001 UTC</i> (3 years, 4 months ago) by <i>aj</i><BR>Branch: <b>glibc-2001-09-13, MAIN</b><BR>CVS Tags: <b>glibc-pre-merge-2001-09-13, glibc-2001-08-02, HEAD, GLIBC_MAIN</b><BR>Changes since <b>1.1.1.1: +8 -8 lines</b><PRE>Import from main glibc repository at 2001-08-02.</PRE></td></tr></table><HR noshade><PRE>/* Software floating-point emulation. &nbsp; Basic one-word fraction declaration and manipulation. &nbsp; Copyright (C) 1997,1998,1999 Free Software Foundation, Inc. &nbsp; This file is part of the GNU C Library. &nbsp; Contributed by Richard Henderson (<A HREF="mailto:rth@cygnus.com">rth@cygnus.com</A>), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Jakub Jelinek (<A HREF="mailto:jj@ultra.linux.cz">jj@ultra.linux.cz</A>), &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;David S. Miller (<A HREF="mailto:davem@redhat.com">davem@redhat.com</A>) and &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;Peter Maydell (<A HREF="mailto:pmaydell@chiark.greenend.org.uk">pmaydell@chiark.greenend.org.uk</A>). &nbsp; The GNU C Library is free software; you can redistribute it and/or &nbsp; modify it under the terms of the GNU Lesser General Public &nbsp; License as published by the Free Software Foundation; either &nbsp; version 2.1 of the License, or (at your option) any later version. &nbsp; The GNU C Library is distributed in the hope that it will be useful, &nbsp; but WITHOUT ANY WARRANTY; without even the implied warranty of &nbsp; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. &nbsp;See the GNU &nbsp; Lesser General Public License for more details. &nbsp; You should have received a copy of the GNU Lesser General Public &nbsp; License along with the GNU C Library; if not, write to the Free &nbsp; Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA &nbsp; 02111-1307 USA. &nbsp;*/#define _FP_FRAC_DECL_1(X) &nbsp; &nbsp; &nbsp;_FP_W_TYPE X##_f#define _FP_FRAC_COPY_1(D,S) &nbsp; &nbsp;(D##_f = S##_f)#define _FP_FRAC_SET_1(X,I) &nbsp; &nbsp; (X##_f = I)#define _FP_FRAC_HIGH_1(X) &nbsp; &nbsp; &nbsp;(X##_f)#define _FP_FRAC_LOW_1(X) &nbsp; &nbsp; &nbsp; (X##_f)#define _FP_FRAC_WORD_1(X,w) &nbsp; &nbsp;(X##_f)#define _FP_FRAC_ADDI_1(X,I) &nbsp; &nbsp;(X##_f += I)#define _FP_FRAC_SLL_1(X,N) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp;do { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;if (__builtin_constant_p(N) &amp;&amp; (N) == 1) &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp;X##_f += X##_f; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp; &nbsp;else &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp;X##_f &lt;&lt;= (N); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp;} while (0)#define _FP_FRAC_SRL_1(X,N) &nbsp; &nbsp; (X##_f &gt;&gt;= N)/* Right shift with sticky-lsb. &nbsp;*/#define _FP_FRAC_SRS_1(X,N,sz) &nbsp;__FP_FRAC_SRS_1(X##_f, N, sz)#define __FP_FRAC_SRS_1(X,N,sz) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp; (X = (X &gt;&gt; (N) | (__builtin_constant_p(N) &amp;&amp; (N) == 1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ? X &amp; 1 : (X &lt;&lt; (_FP_W_TYPE_SIZE - (N))) != 0)))#define _FP_FRAC_ADD_1(R,X,Y) &nbsp; (R##_f = X##_f + Y##_f)#define _FP_FRAC_SUB_1(R,X,Y) &nbsp; (R##_f = X##_f - Y##_f)#define _FP_FRAC_DEC_1(X,Y) &nbsp; &nbsp; (X##_f -= Y##_f)#define _FP_FRAC_CLZ_1(z, X) &nbsp; &nbsp;__FP_CLZ(z, X##_f)/* Predicates */#define _FP_FRAC_NEGP_1(X) &nbsp; &nbsp; &nbsp;((_FP_WS_TYPE)X##_f &lt; 0)#define _FP_FRAC_ZEROP_1(X) &nbsp; &nbsp; (X##_f == 0)#define _FP_FRAC_OVERP_1(fs,X) &nbsp;(X##_f &amp; _FP_OVERFLOW_##fs)#define _FP_FRAC_EQ_1(X, Y) &nbsp; &nbsp; (X##_f == Y##_f)#define _FP_FRAC_GE_1(X, Y) &nbsp; &nbsp; (X##_f &gt;= Y##_f)#define _FP_FRAC_GT_1(X, Y) &nbsp; &nbsp; (X##_f &gt; Y##_f)#define _FP_ZEROFRAC_1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;0#define _FP_MINFRAC_1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; 1#define _FP_MAXFRAC_1 &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; (~(_FP_WS_TYPE)0)/* * Unpack the raw bits of a native fp value. &nbsp;Do not classify or * normalize the data. */#define _FP_UNPACK_RAW_1(fs, X, val) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp;do { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;union _FP_UNION_##fs _flo; _flo.flt = (val); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;X##_f = _flo.bits.frac; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp; &nbsp;X##_e = _flo.bits.exp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;X##_s = _flo.bits.sign; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp;} while (0)#define _FP_UNPACK_RAW_1_P(fs, X, val) &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp;do { &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;union _FP_UNION_##fs *_flo = &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp;(union _FP_UNION_##fs *)(val); &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;X##_f = _flo-&gt;bits.frac; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp; &nbsp;X##_e = _flo-&gt;bits.exp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; \ &nbsp; &nbsp;X##_s = _flo-&gt;bits.sign; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;\ &nbsp;} while (0)/* * Repack the raw bits of a native fp value.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -