DOSBox-X
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator
include/mmx.h
00001 /*
00002  *  Copyright (C) 2002-2013  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
00015  *  along with this program; if not, write to the Free Software
00016  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00017  */
00018 
00019 #ifndef DOSBOX_MMX_H
00020 #define DOSBOX_MMX_H
00021 
00022 typedef union {
00023 
00024         Bit64u q;
00025 
00026 #ifndef WORDS_BIGENDIAN
00027         struct {
00028                 Bit32u d0,d1;
00029         } ud;
00030 
00031         struct {
00032                 Bit32s d0,d1;
00033         } sd;
00034 
00035         struct {
00036                 Bit16u w0,w1,w2,w3;
00037         } uw;
00038 
00039         struct {
00040                 Bit16s w0,w1,w2,w3;
00041         } sw;
00042 
00043         struct {
00044                 Bit8u b0,b1,b2,b3,b4,b5,b6,b7;
00045         } ub;
00046 
00047         struct {
00048                 Bit8s b0,b1,b2,b3,b4,b5,b6,b7;
00049         } sb;
00050 #else
00051         struct {
00052                 Bit32u d1,d0;
00053         } ud;
00054 
00055         struct {
00056                 Bit32s d1,d0;
00057         } sd;
00058 
00059         struct {
00060                 Bit16u w3,w2,w1,w0;
00061         } uw;
00062 
00063         struct {
00064                 Bit16u w3,w2,w1,w0;
00065         } sw;
00066 
00067         struct {
00068                 Bit8u b7,b6,b5,b4,b3,b2,b1,b0;
00069         } ub;
00070 
00071         struct {
00072                 Bit8u b7,b6,b5,b4,b3,b2,b1,b0;
00073         } sb;
00074 #endif
00075 
00076 } MMX_reg;
00077 
00078 extern MMX_reg reg_mmx[8];
00079 extern MMX_reg * lookupRMregMM[256];
00080 
00081 
00082 Bit8s  SaturateWordSToByteS(Bit16s value);
00083 Bit16s SaturateDwordSToWordS(Bit32s value);
00084 Bit8u  SaturateWordSToByteU(Bit16s value);
00085 Bit16u SaturateDwordSToWordU(Bit32s value);
00086 
00087 void   setFPU(Bit16u tag);
00088 
00089 #endif