DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
include/mmx.h
00001 /*
00002  *  Copyright (C) 2002-2020  The DOSBox Team
00003  *
00004  *  This program is free software; you can redistribute it and/or modify
00005  *  it under the terms of the GNU General Public License as published by
00006  *  the Free Software Foundation; either version 2 of the License, or
00007  *  (at your option) any later version.
00008  *
00009  *  This program is distributed in the hope that it will be useful,
00010  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  *  GNU General Public License for more details.
00013  *
00014  *  You should have received a copy of the GNU General Public License along
00015  *  with this program; if not, write to the Free Software Foundation, Inc.,
00016  *  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
00017  */
00018 
00019 #ifndef DOSBOX_MMX_H
00020 #define DOSBOX_MMX_H
00021 
00022 #if C_FPU
00023 
00024 typedef union {
00025 
00026         Bit64u q;
00027 
00028 #ifndef WORDS_BIGENDIAN
00029         struct {
00030                 Bit32u d0,d1;
00031         } ud;
00032 
00033         struct {
00034                 Bit32s d0,d1;
00035         } sd;
00036 
00037         struct {
00038                 Bit16u w0,w1,w2,w3;
00039         } uw;
00040 
00041         struct {
00042                 Bit16s w0,w1,w2,w3;
00043         } sw;
00044 
00045         struct {
00046                 Bit8u b0,b1,b2,b3,b4,b5,b6,b7;
00047         } ub;
00048 
00049         struct {
00050                 Bit8s b0,b1,b2,b3,b4,b5,b6,b7;
00051         } sb;
00052 #else
00053         struct {
00054                 Bit32u d1,d0;
00055         } ud;
00056 
00057         struct {
00058                 Bit32s d1,d0;
00059         } sd;
00060 
00061         struct {
00062                 Bit16u w3,w2,w1,w0;
00063         } uw;
00064 
00065         struct {
00066                 Bit16u w3,w2,w1,w0;
00067         } sw;
00068 
00069         struct {
00070                 Bit8u b7,b6,b5,b4,b3,b2,b1,b0;
00071         } ub;
00072 
00073         struct {
00074                 Bit8u b7,b6,b5,b4,b3,b2,b1,b0;
00075         } sb;
00076 #endif
00077 
00078 } MMX_reg;
00079 
00080 extern MMX_reg * reg_mmx[8];
00081 extern MMX_reg * lookupRMregMM[256];
00082 
00083 
00084 Bit8s  SaturateWordSToByteS(Bit16s value);
00085 Bit16s SaturateDwordSToWordS(Bit32s value);
00086 Bit8u  SaturateWordSToByteU(Bit16s value);
00087 Bit16u SaturateDwordSToWordU(Bit32s value);
00088 
00089 void   setFPUTagEmpty();
00090 
00091 #endif
00092 
00093 #endif