2 * ix86 definitions v0.6.2
3 * Authors: linuzappz <linuzappz@pcsx.net>
6 * shadow < shadow@pcsx2.net >
16 #include "../psxcommon.h" // Basic types header
20 #if defined(__MINGW32__)
21 #define PCSX2_ALIGNED16(x) __declspec(align(16)) x
23 #define PCSX2_ALIGNED16(x) x __attribute((aligned(16)))
41 typedef int x86IntRegType;
69 #define X86_TEMP RAX // don't allocate anything
72 extern x86IntRegType g_x86savedregs[8];
73 extern x86IntRegType g_x86tempregs[6];
75 extern x86IntRegType g_x86savedregs[6];
76 extern x86IntRegType g_x86tempregs[8];
79 extern x86IntRegType g_x86allregs[14]; // all registers that can be used by the recs
80 extern x86IntRegType g_x868bitregs[11];
81 extern x86IntRegType g_x86non8bitregs[3];
113 typedef int x86MMXRegType;
132 typedef int x86SSERegType;
136 XMMT_INT = 0, // integer (sse2 only)
137 XMMT_FPS = 1, // floating point
138 //XMMT_FPD = 3, // double
141 extern XMMSSEType g_xmmtypes[XMMREGS];
143 void cpudetectInit( void );//this is all that needs to be called and will fill up the below structs
145 //cpu capabilities structure
147 u32 hasFloatingPointUnit;
148 u32 hasVirtual8086ModeEnhancements;
149 u32 hasDebuggingExtensions;
150 u32 hasPageSizeExtensions;
151 u32 hasTimeStampCounter;
152 u32 hasModelSpecificRegisters;
153 u32 hasPhysicalAddressExtension;
154 u32 hasCOMPXCHG8BInstruction;
155 u32 hasAdvancedProgrammableInterruptController;
156 u32 hasSEPFastSystemCall;
157 u32 hasMemoryTypeRangeRegisters;
158 u32 hasPTEGlobalFlag;
159 u32 hasMachineCheckArchitecture;
160 u32 hasConditionalMoveAndCompareInstructions;
161 u32 hasFGPageAttributeTable;
162 u32 has36bitPageSizeExtension;
163 u32 hasProcessorSerialNumber;
164 u32 hasCFLUSHInstruction;
166 u32 hasACPIThermalMonitorAndClockControl;
167 u32 hasMultimediaExtensions;
168 u32 hasFastStreamingSIMDExtensionsSaveRestore;
169 u32 hasStreamingSIMDExtensions;
170 u32 hasStreamingSIMD2Extensions;
172 u32 hasHyperThreading;
173 u32 hasThermalMonitor;
174 u32 hasIntel64BitArchitecture;
175 u32 hasStreamingSIMD3Extensions;
176 //that is only for AMDs
177 u32 hasMultimediaExtensionsExt;
178 u32 hasAMD64BitArchitecture;
179 u32 has3DNOWInstructionExtensionsExt;
180 u32 has3DNOWInstructionExtensions;
183 extern CAPABILITIES cpucaps;
187 u32 x86Family; // Processor Family
188 u32 x86Model; // Processor Model
189 u32 x86PType; // Processor Type
190 u32 x86StepID; // Stepping ID
191 u32 x86Flags; // Feature Flags
192 u32 x86EFlags; // Extended Feature Flags
193 //all the above returns hex values
194 s8 x86ID[16]; // Vendor ID //the vendor creator (in %s)
195 s8 x86Type[20]; //cpu type in char format //the cpu type (in %s)
196 s8 x86Fam[50]; // family in char format //the original cpu name string (in %s)
197 u32 cpuspeed; // speed of cpu //this will give cpu speed (in %d)
200 extern CPUINFO cpuinfo;
203 extern u8 *j8Ptr[32];
204 extern u32 *j32Ptr[32];
208 #define X86_64ASSERT() assert(0)
209 #define MEMADDR_(addr, oplen) (sptr)((uptr)(addr) - ((uptr)x86Ptr + ((u64)(oplen))))
210 #define SPTR32(addr) ((addr) < 0x80000000L && (addr) >= -0x80000000L)
211 #define UPTR32(addr) ((addr) < 0x100000000L)
212 #define MEMADDR(addr, oplen) ({ sptr _a = MEMADDR_(addr, oplen); assert(SPTR32(_a)); _a; })
214 #define X86_64ASSERT()
217 #define MEMADDR(addr, oplen) (addr)
221 #define Rex( w, r, x, b ) write8( 0x40 | ((w) << 3) | ((r) << 2) | ((x) << 1) | (b) )
223 #define Rex(w,r,x,b) assert(0)
225 #define RexRXB(w, reg, index, base) if(w || (reg) >= 8 || (index) >= 8 || (base) >= 8 ) \
226 Rex(w, (reg)>=8, (index)>=8, (base)>=8)
227 #define RexR(w, reg) RexRXB(w, reg, 0, 0)
228 #define RexB(w, base) RexRXB(w, 0, 0, base)
229 #define RexRB(w, reg, base) RexRXB(w, reg, 0, base)
231 void x86SetPtr( char *ptr );
232 void x86Shutdown( void );
234 void x86SetJ8( u8 *j8 );
235 void x86SetJ8A( u8 *j8 );
236 void x86SetJ16( u16 *j16 );
237 void x86SetJ16A( u16 *j16 );
238 void x86SetJ32( u32 *j32 );
239 void x86SetJ32A( u32 *j32 );
241 void x86Align( int bytes );
242 u64 GetCPUTick( void );
244 // General Helper functions
245 #define ModRM(mod, rm, reg) write8( ( mod << 6 ) | ( (rm & 7) << 3 ) | ( reg & 7 ) )
246 #define SibSB(ss, rm, index) write8( ( ss << 6 ) | ( rm << 3 ) | ( index ) )
247 void SET8R( int cc, int to );
248 u8* J8Rel( int cc, int to );
249 u32* J32Rel( int cc, u32 to );
250 void CMOV32RtoR( int cc, int to, int from );
251 void CMOV32MtoR( int cc, int to, uptr from );
253 void MEMADDR_OP(bool w, unsigned opl, u64 op, bool isreg, int reg, uptr p, sptr off);
255 #define VAROP1(op) 1, op
256 #define VAROP2(op1, op2) 2, (op1) | ((op2) << 8)
273 ////////////////////////////////////
274 // mov instructions //
275 ////////////////////////////////////
278 void MOV64RtoR( x86IntRegType to, x86IntRegType from );
280 void MOV64RtoM( uptr to, x86IntRegType from );
282 void MOV64MtoR( x86IntRegType to, uptr from );
283 // mov sign ext imm32 to m64
284 void MOV64I32toM( uptr to, u32 from );
285 // mov sign ext imm32 to r64
286 void MOV64I32toR( x86IntRegType to, s32 from);
288 void MOV64ItoR( x86IntRegType to, u64 from);
289 // mov imm64 to [r64+off]
290 void MOV64ItoRmOffset( x86IntRegType to, u32 from, int offset);
291 // mov [r64+offset] to r64
292 void MOV64RmOffsettoR( x86IntRegType to, x86IntRegType from, int offset );
293 // mov [r64][r64*scale] to r64
294 void MOV64RmStoR( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale);
295 // mov r64 to [r64+offset]
296 void MOV64RtoRmOffset( x86IntRegType to, x86IntRegType from, int offset );
297 // mov r64 to [r64][r64*scale]
298 void MOV64RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale);
301 void MOV32RtoR( x86IntRegType to, x86IntRegType from );
303 void MOV32RtoM( uptr to, x86IntRegType from );
305 void MOV32MtoR( x86IntRegType to, uptr from );
307 void MOV32RmtoR( x86IntRegType to, x86IntRegType from );
308 void MOV32RmtoROffset( x86IntRegType to, x86IntRegType from, int offset );
309 // mov [r32][r32<<scale] to r32
310 void MOV32RmStoR( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale );
311 // mov [imm32(from2) + r32(from1)<<scale] to r32
312 void MOV32RmSOffsettoR( x86IntRegType to, x86IntRegType from1, int from2, int scale );
314 void MOV32RtoRm( x86IntRegType to, x86IntRegType from );
315 // mov r32 to [r32][r32*scale]
316 void MOV32RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale );
318 void MOV32ItoR( x86IntRegType to, u32 from );
320 void MOV32ItoM( uptr to, u32 from );
321 // mov imm32 to [r32+off]
322 void MOV32ItoRmOffset( x86IntRegType to, u32 from, int offset);
323 // mov r32 to [r32+off]
324 void MOV32RtoRmOffset( x86IntRegType to, x86IntRegType from, int offset);
327 void MOV16RtoM( uptr to, x86IntRegType from );
329 void MOV16MtoR( x86IntRegType to, uptr from );
331 void MOV16RmtoR( x86IntRegType to, x86IntRegType from ) ;
332 void MOV16RmtoROffset( x86IntRegType to, x86IntRegType from, int offset );
333 // mov [imm32(from2) + r32(from1)<<scale] to r16
334 void MOV16RmSOffsettoR( x86IntRegType to, x86IntRegType from1, u32 from2, int scale );
336 void MOV16RtoRm(x86IntRegType to, x86IntRegType from);
338 void MOV16ItoM( uptr to, u16 from );
339 /* mov r16 to [r32][r32*scale] */
340 void MOV16RtoRmS( x86IntRegType to, x86IntRegType from, x86IntRegType from2, int scale);
342 void MOV16ItoR( x86IntRegType to, u16 from );
343 // mov imm16 to [r16+off]
344 void MOV16ItoRmOffset( x86IntRegType to, u16 from, u32 offset);
345 // mov r16 to [r16+off]
346 void MOV16RtoRmOffset( x86IntRegType to, x86IntRegType from, int offset);
349 void MOV8RtoM( uptr to, x86IntRegType from );
351 void MOV8MtoR( x86IntRegType to, uptr from );
353 void MOV8RmtoR(x86IntRegType to, x86IntRegType from);
354 void MOV8RmtoROffset(x86IntRegType to, x86IntRegType from, int offset);
356 void MOV8RtoRm(x86IntRegType to, x86IntRegType from);
358 void MOV8ItoM( uptr to, u8 from );
360 void MOV8ItoR( x86IntRegType to, u8 from );
361 // mov imm8 to [r8+off]
362 void MOV8ItoRmOffset( x86IntRegType to, u8 from, int offset);
363 // mov r8 to [r8+off]
364 void MOV8RtoRmOffset( x86IntRegType to, x86IntRegType from, int offset);
367 void MOVSX32R8toR( x86IntRegType to, x86IntRegType from );
368 void MOVSX32Rm8toR( x86IntRegType to, x86IntRegType from );
369 void MOVSX32Rm8toROffset( x86IntRegType to, x86IntRegType from, int offset );
371 void MOVSX32M8toR( x86IntRegType to, uptr from );
373 void MOVSX32R16toR( x86IntRegType to, x86IntRegType from );
374 void MOVSX32Rm16toR( x86IntRegType to, x86IntRegType from );
375 void MOVSX32Rm16toROffset( x86IntRegType to, x86IntRegType from, int offset );
377 void MOVSX32M16toR( x86IntRegType to, uptr from );
380 void MOVZX32R8toR( x86IntRegType to, x86IntRegType from );
381 void MOVZX32Rm8toR( x86IntRegType to, x86IntRegType from );
382 void MOVZX32Rm8toROffset( x86IntRegType to, x86IntRegType from, int offset );
384 void MOVZX32M8toR( x86IntRegType to, uptr from );
386 void MOVZX32R16toR( x86IntRegType to, x86IntRegType from );
387 void MOVZX32Rm16toR( x86IntRegType to, x86IntRegType from );
388 void MOVZX32Rm16toROffset( x86IntRegType to, x86IntRegType from, int offset );
390 void MOVZX32M16toR( x86IntRegType to, uptr from );
393 void MOVZX64R8toR( x86IntRegType to, x86IntRegType from );
394 void MOVZX64Rm8toR( x86IntRegType to, x86IntRegType from );
395 void MOVZX64Rm8toROffset( x86IntRegType to, x86IntRegType from, int offset );
397 void MOVZX64M8toR( x86IntRegType to, uptr from );
399 void MOVZX64R16toR( x86IntRegType to, x86IntRegType from );
400 void MOVZX64Rm16toR( x86IntRegType to, x86IntRegType from );
401 void MOVZX64Rm16toROffset( x86IntRegType to, x86IntRegType from, int offset );
403 void MOVZX64M16toR( x86IntRegType to, uptr from );
407 void CMOVBE32RtoR( x86IntRegType to, x86IntRegType from );
409 void CMOVBE32MtoR( x86IntRegType to, uptr from );
411 void CMOVB32RtoR( x86IntRegType to, x86IntRegType from );
413 void CMOVB32MtoR( x86IntRegType to, uptr from );
415 void CMOVAE32RtoR( x86IntRegType to, x86IntRegType from );
417 void CMOVAE32MtoR( x86IntRegType to, uptr from );
419 void CMOVA32RtoR( x86IntRegType to, x86IntRegType from );
421 void CMOVA32MtoR( x86IntRegType to, uptr from );
424 void CMOVO32RtoR( x86IntRegType to, x86IntRegType from );
426 void CMOVO32MtoR( x86IntRegType to, uptr from );
428 void CMOVP32RtoR( x86IntRegType to, x86IntRegType from );
430 void CMOVP32MtoR( x86IntRegType to, uptr from );
432 void CMOVS32RtoR( x86IntRegType to, x86IntRegType from );
434 void CMOVS32MtoR( x86IntRegType to, uptr from );
436 void CMOVNO32RtoR( x86IntRegType to, x86IntRegType from );
438 void CMOVNO32MtoR( x86IntRegType to, uptr from );
440 void CMOVNP32RtoR( x86IntRegType to, x86IntRegType from );
442 void CMOVNP32MtoR( x86IntRegType to, uptr from );
444 void CMOVNS32RtoR( x86IntRegType to, x86IntRegType from );
446 void CMOVNS32MtoR( x86IntRegType to, uptr from );
449 void CMOVNE32RtoR( x86IntRegType to, x86IntRegType from );
451 void CMOVNE32MtoR( x86IntRegType to, uptr from );
453 void CMOVE32RtoR( x86IntRegType to, x86IntRegType from );
455 void CMOVE32MtoR( x86IntRegType to, uptr from );
457 void CMOVG32RtoR( x86IntRegType to, x86IntRegType from );
459 void CMOVG32MtoR( x86IntRegType to, uptr from );
461 void CMOVGE32RtoR( x86IntRegType to, x86IntRegType from );
463 void CMOVGE32MtoR( x86IntRegType to, uptr from );
465 void CMOVL32RtoR( x86IntRegType to, x86IntRegType from );
467 void CMOVL32MtoR( x86IntRegType to, uptr from );
469 void CMOVLE32RtoR( x86IntRegType to, x86IntRegType from );
471 void CMOVLE32MtoR( x86IntRegType to, uptr from );
473 ////////////////////////////////////
474 // arithmetic instructions //
475 ////////////////////////////////////
478 void ADD64ItoR( x86IntRegType to, u32 from );
480 void ADD64MtoR( x86IntRegType to, uptr from );
483 void ADD32ItoR( x86IntRegType to, u32 from );
485 void ADD32ItoM( uptr to, u32 from );
486 // add imm32 to [r32+off]
487 void ADD32ItoRmOffset( x86IntRegType to, u32 from, int offset);
489 void ADD32RtoR( x86IntRegType to, x86IntRegType from );
491 void ADD32RtoM( uptr to, x86IntRegType from );
493 void ADD32MtoR( x86IntRegType to, uptr from );
496 void ADD16RtoR( x86IntRegType to , x86IntRegType from );
498 void ADD16ItoR( x86IntRegType to, u16 from );
500 void ADD16ItoM( uptr to, u16 from );
502 void ADD16RtoM( uptr to, x86IntRegType from );
504 void ADD16MtoR( x86IntRegType to, uptr from );
507 void ADD8MtoR( x86IntRegType to, uptr from );
510 void ADC32ItoR( x86IntRegType to, u32 from );
512 void ADC32ItoM( uptr to, u32 from );
514 void ADC32RtoR( x86IntRegType to, x86IntRegType from );
516 void ADC32MtoR( x86IntRegType to, uptr from );
518 void ADC32RtoM( uptr to, x86IntRegType from );
521 void INC32R( x86IntRegType to );
523 void INC32M( uptr to );
525 void INC16R( x86IntRegType to );
527 void INC16M( uptr to );
530 void SUB64MtoR( x86IntRegType to, uptr from );
531 void SUB64ItoR( x86IntRegType to, u32 from );
534 void SUB32ItoR( x86IntRegType to, u32 from );
536 void SUB32ItoM( uptr to, u32 from ) ;
538 void SUB32RtoR( x86IntRegType to, x86IntRegType from );
540 void SUB32MtoR( x86IntRegType to, uptr from ) ;
542 void SUB32RtoM( uptr to, x86IntRegType from );
544 void SUB16RtoR( x86IntRegType to, u16 from );
546 void SUB16ItoR( x86IntRegType to, u16 from );
548 void SUB16ItoM( uptr to, u16 from ) ;
550 void SUB16MtoR( x86IntRegType to, uptr from );
553 void SBB64RtoR( x86IntRegType to, x86IntRegType from );
556 void SBB32ItoR( x86IntRegType to, u32 from );
558 void SBB32ItoM( uptr to, u32 from );
560 void SBB32RtoR( x86IntRegType to, x86IntRegType from );
562 void SBB32MtoR( x86IntRegType to, uptr from );
564 void SBB32RtoM( uptr to, x86IntRegType from );
567 void DEC32R( x86IntRegType to );
569 void DEC32M( uptr to );
571 void DEC16R( x86IntRegType to );
573 void DEC16M( uptr to );
575 // mul eax by r32 to edx:eax
576 void MUL32R( x86IntRegType from );
577 // mul eax by m32 to edx:eax
578 void MUL32M( uptr from );
580 // imul eax by r32 to edx:eax
581 void IMUL32R( x86IntRegType from );
582 // imul eax by m32 to edx:eax
583 void IMUL32M( uptr from );
584 // imul r32 by r32 to r32
585 void IMUL32RtoR( x86IntRegType to, x86IntRegType from );
587 // div eax by r32 to edx:eax
588 void DIV32R( x86IntRegType from );
589 // div eax by m32 to edx:eax
590 void DIV32M( uptr from );
592 // idiv eax by r32 to edx:eax
593 void IDIV32R( x86IntRegType from );
594 // idiv eax by m32 to edx:eax
595 void IDIV32M( uptr from );
597 ////////////////////////////////////
598 // shifting instructions //
599 ////////////////////////////////////
602 void SHL64ItoR( x86IntRegType to, u8 from );
604 void SHL64CLtoR( x86IntRegType to );
606 void SHR64ItoR( x86IntRegType to, u8 from );
608 void SHR64CLtoR( x86IntRegType to );
610 void SAR64ItoR( x86IntRegType to, u8 from );
612 void SAR64CLtoR( x86IntRegType to );
615 void SHL32ItoR( x86IntRegType to, u8 from );
616 /* shl imm8 to m32 */
617 void SHL32ItoM( uptr to, u8 from );
619 void SHL32CLtoR( x86IntRegType to );
622 void SHL16ItoR( x86IntRegType to, u8 from );
624 void SHL8ItoR( x86IntRegType to, u8 from );
627 void SHR32ItoR( x86IntRegType to, u8 from );
628 /* shr imm8 to m32 */
629 void SHR32ItoM( uptr to, u8 from );
631 void SHR32CLtoR( x86IntRegType to );
634 void SHR8ItoR( x86IntRegType to, u8 from );
637 void SAR32ItoR( x86IntRegType to, u8 from );
639 void SAR32ItoM( uptr to, u8 from );
641 void SAR32CLtoR( x86IntRegType to );
644 void SAR16ItoR( x86IntRegType to, u8 from );
646 // ror imm8 to r32 (rotate right)
647 void ROR32ItoR( x86IntRegType to,u8 from );
649 void RCR32ItoR( x86IntRegType to,u8 from );
651 void SHLD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift );
653 void SHRD32ItoR( x86IntRegType to, x86IntRegType from, u8 shift );
656 #define SAL32ItoR SHL32ItoR
658 #define SAL32CLtoR SHL32CLtoR
660 // logical instructions
663 void OR64ItoR( x86IntRegType to, u32 from );
665 void OR64MtoR( x86IntRegType to, uptr from );
667 void OR64RtoR( x86IntRegType to, x86IntRegType from );
669 void OR64RtoM( uptr to, x86IntRegType from );
672 void OR32ItoR( x86IntRegType to, u32 from );
674 void OR32ItoM( uptr to, u32 from );
676 void OR32RtoR( x86IntRegType to, x86IntRegType from );
678 void OR32RtoM( uptr to, x86IntRegType from );
680 void OR32MtoR( x86IntRegType to, uptr from );
682 void OR16RtoR( x86IntRegType to, x86IntRegType from );
684 void OR16ItoR( x86IntRegType to, u16 from );
686 void OR16ItoM( uptr to, u16 from );
688 void OR16MtoR( x86IntRegType to, uptr from );
690 void OR16RtoM( uptr to, x86IntRegType from );
693 void OR8RtoR( x86IntRegType to, x86IntRegType from );
695 void OR8RtoM( uptr to, x86IntRegType from );
697 void OR8ItoM( uptr to, u8 from );
699 void OR8MtoR( x86IntRegType to, uptr from );
702 void XOR64ItoR( x86IntRegType to, u32 from );
704 void XOR64RtoR( x86IntRegType to, x86IntRegType from );
706 void XOR64MtoR( x86IntRegType to, uptr from );
708 void XOR64RtoR( x86IntRegType to, x86IntRegType from );
710 void XOR64RtoM( uptr to, x86IntRegType from );
712 void XOR32ItoR( x86IntRegType to, u32 from );
714 void XOR32ItoM( uptr to, u32 from );
716 void XOR32RtoR( x86IntRegType to, x86IntRegType from );
718 void XOR16RtoR( x86IntRegType to, x86IntRegType from );
720 void XOR32RtoM( uptr to, x86IntRegType from );
722 void XOR32MtoR( x86IntRegType to, uptr from );
724 void XOR16RtoM( uptr to, x86IntRegType from );
726 void XOR16ItoR( x86IntRegType to, u16 from );
729 void AND64I32toR( x86IntRegType to, u32 from );
731 void AND64MtoR( x86IntRegType to, uptr from );
733 void AND64RtoM( uptr to, x86IntRegType from );
735 void AND64RtoR( x86IntRegType to, x86IntRegType from );
737 void AND64I32toM( uptr to, u32 from );
740 void AND32ItoR( x86IntRegType to, u32 from );
741 // and sign ext imm8 to r32
742 void AND32I8toR( x86IntRegType to, u8 from );
744 void AND32ItoM( uptr to, u32 from );
745 // and sign ext imm8 to m32
746 void AND32I8toM( uptr to, u8 from );
748 void AND32RtoR( x86IntRegType to, x86IntRegType from );
750 void AND32RtoM( uptr to, x86IntRegType from );
752 void AND32MtoR( x86IntRegType to, uptr from );
754 void AND16RtoR( x86IntRegType to, x86IntRegType from );
756 void AND16ItoR( x86IntRegType to, u16 from );
758 void AND16ItoM( uptr to, u16 from );
760 void AND16RtoM( uptr to, x86IntRegType from );
762 void AND16MtoR( x86IntRegType to, uptr from );
764 void AND8ItoR( x86IntRegType to, u8 from );
766 void AND8ItoM( uptr to, u8 from );
768 void AND8RtoM( uptr to, x86IntRegType from );
770 void AND8MtoR( x86IntRegType to, uptr from );
772 void AND8RtoR( x86IntRegType to, x86IntRegType from );
775 void NOT64R( x86IntRegType from );
777 void NOT32R( x86IntRegType from );
779 void NOT32M( uptr from );
781 void NEG64R( x86IntRegType from );
783 void NEG32R( x86IntRegType from );
785 void NEG32M( uptr from );
787 void NEG16R( x86IntRegType from );
789 ////////////////////////////////////
790 // jump instructions //
791 ////////////////////////////////////
797 u32* JMP32( uptr to );
798 // jmp r32 (r64 if __x86_64__)
799 void JMPR( x86IntRegType to );
801 void JMP32M( uptr to );
860 u32* JGE32( u32 to );
864 u32* JLE32( u32 to );
866 u32* JAE32( u32 to );
868 u32* JNE32( u32 to );
870 u32* JNZ32( u32 to );
872 u32* JNG32( u32 to );
874 u32* JNGE32( u32 to );
876 u32* JNL32( u32 to );
878 u32* JNLE32( u32 to );
882 u32* JNO32( u32 to );
887 void CALLFunc( uptr func);
889 void CALL32( s32 to );
891 void CALL32R( x86IntRegType to );
893 void CALL64R( x86IntRegType to );
896 ////////////////////////////////////
897 // misc instructions //
898 ////////////////////////////////////
901 void CMP64I32toR( x86IntRegType to, u32 from );
903 void CMP64MtoR( x86IntRegType to, uptr from );
905 void CMP64RtoR( x86IntRegType to, x86IntRegType from );
908 void CMP32ItoR( x86IntRegType to, u32 from );
910 void CMP32ItoM( uptr to, u32 from );
912 void CMP32RtoR( x86IntRegType to, x86IntRegType from );
914 void CMP32MtoR( x86IntRegType to, uptr from );
915 // cmp imm32 to [r32]
916 void CMP32I8toRm( x86IntRegType to, u8 from);
917 // cmp imm32 to [r32+off]
918 void CMP32I8toRmOffset8( x86IntRegType to, u8 from, u8 off);
920 void CMP32I8toM( uptr to, u8 from);
923 void CMP16ItoR( x86IntRegType to, u16 from );
925 void CMP16ItoM( uptr to, u16 from );
927 void CMP16RtoR( x86IntRegType to, x86IntRegType from );
929 void CMP16MtoR( x86IntRegType to, uptr from );
932 void CMP8ItoR( x86IntRegType to, u8 from );
934 void CMP8MtoR( x86IntRegType to, uptr from );
937 void TEST64RtoR( x86IntRegType to, x86IntRegType from );
939 void TEST32ItoR( x86IntRegType to, u32 from );
941 void TEST32ItoM( uptr to, u32 from );
943 void TEST32RtoR( x86IntRegType to, x86IntRegType from );
944 // test imm32 to [r32]
945 void TEST32ItoRm( x86IntRegType to, u32 from );
947 void TEST16ItoR( x86IntRegType to, u16 from );
949 void TEST16RtoR( x86IntRegType to, x86IntRegType from );
951 void TEST8ItoR( x86IntRegType to, u8 from );
953 void TEST8ItoM( uptr to, u8 from );
956 void SETS8R( x86IntRegType to );
958 void SETL8R( x86IntRegType to );
960 void SETGE8R( x86IntRegType to );
962 void SETG8R( x86IntRegType to );
964 void SETA8R( x86IntRegType to );
966 void SETAE8R( x86IntRegType to );
968 void SETB8R( x86IntRegType to );
970 void SETNZ8R( x86IntRegType to );
972 void SETZ8R( x86IntRegType to );
974 void SETE8R( x86IntRegType to );
977 void PUSH32I( u32 from );
980 void PUSHI( u32 from );
982 void PUSH64R( x86IntRegType from );
984 void PUSH64M( uptr from );
986 void POP64R( x86IntRegType from );
989 void PUSH32R( x86IntRegType from );
991 void PUSH32M( u32 from );
993 void PUSH32I( u32 from );
995 void POP32R( x86IntRegType from );
997 void PUSHA32( void );
1002 void PUSHR(x86IntRegType from);
1003 void POPR(x86IntRegType from);
1006 void PUSHFD( void );
1011 // ret (2-byte code used for misprediction)
1026 void BT32ItoR( x86IntRegType to, x86IntRegType from );
1027 void BSRRtoR(x86IntRegType to, x86IntRegType from);
1028 void BSWAP32R( x86IntRegType to );
1030 // to = from + offset
1031 void LEA16RtoR(x86IntRegType to, x86IntRegType from, u16 offset);
1032 void LEA32RtoR(x86IntRegType to, x86IntRegType from, u32 offset);
1034 // to = from0 + from1
1035 void LEA16RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1);
1036 void LEA32RRtoR(x86IntRegType to, x86IntRegType from0, x86IntRegType from1);
1038 // to = from << scale (max is 3)
1039 void LEA16RStoR(x86IntRegType to, x86IntRegType from, u32 scale);
1040 void LEA32RStoR(x86IntRegType to, x86IntRegType from, u32 scale);
1042 //******************
1044 //******************
1046 // fild m32 to fpu reg stack
1047 void FILD32( uptr from );
1048 // fistp m32 from fpu reg stack
1049 void FISTP32( uptr from );
1050 // fld m32 to fpu reg stack
1051 void FLD32( uptr from );
1054 // fld1 (push +1.0f on the stack)
1056 // fld1 (push log_2 e on the stack)
1058 // fst m32 from fpu reg stack
1059 void FST32( uptr to );
1060 // fstp m32 from fpu reg stack
1061 void FSTP32( uptr to );
1065 // fldcw fpu control word from m16
1066 void FLDCW( uptr from );
1067 // fstcw fpu control word to m16
1068 void FNSTCW( uptr to );
1077 // fadd ST(src) to fpu reg stack ST(0)
1078 void FADD32Rto0( x86IntRegType src );
1079 // fadd ST(0) to fpu reg stack ST(src)
1080 void FADD320toR( x86IntRegType src );
1081 // fsub ST(src) to fpu reg stack ST(0)
1082 void FSUB32Rto0( x86IntRegType src );
1083 // fsub ST(0) to fpu reg stack ST(src)
1084 void FSUB320toR( x86IntRegType src );
1085 // fsubp -> subtract ST(0) from ST(1), store in ST(1) and POP stack
1087 // fmul ST(src) to fpu reg stack ST(0)
1088 void FMUL32Rto0( x86IntRegType src );
1089 // fmul ST(0) to fpu reg stack ST(src)
1090 void FMUL320toR( x86IntRegType src );
1091 // fdiv ST(src) to fpu reg stack ST(0)
1092 void FDIV32Rto0( x86IntRegType src );
1093 // fdiv ST(0) to fpu reg stack ST(src)
1094 void FDIV320toR( x86IntRegType src );
1095 // fdiv ST(0) to fpu reg stack ST(src), pop stack, store in ST(src)
1096 void FDIV320toRP( x86IntRegType src );
1098 // fadd m32 to fpu reg stack
1099 void FADD32( uptr from );
1100 // fsub m32 to fpu reg stack
1101 void FSUB32( uptr from );
1102 // fmul m32 to fpu reg stack
1103 void FMUL32( uptr from );
1104 // fdiv m32 to fpu reg stack
1105 void FDIV32( uptr from );
1107 void FCOMI( x86IntRegType src );
1108 // fcomip st, st( i)
1109 void FCOMIP( x86IntRegType src );
1110 // fucomi st, st( i)
1111 void FUCOMI( x86IntRegType src );
1112 // fucomip st, st( i)
1113 void FUCOMIP( x86IntRegType src );
1114 // fcom m32 to fpu reg stack
1115 void FCOM32( uptr from );
1116 // fabs fpu reg stack
1118 // fsqrt fpu reg stack
1120 // ftan fpu reg stack
1121 void FPATAN( void );
1122 // fsin fpu reg stack
1124 // fchs fpu reg stack
1127 // fcmovb fpu reg to fpu reg stack
1128 void FCMOVB32( x86IntRegType from );
1129 // fcmove fpu reg to fpu reg stack
1130 void FCMOVE32( x86IntRegType from );
1131 // fcmovbe fpu reg to fpu reg stack
1132 void FCMOVBE32( x86IntRegType from );
1133 // fcmovu fpu reg to fpu reg stack
1134 void FCMOVU32( x86IntRegType from );
1135 // fcmovnb fpu reg to fpu reg stack
1136 void FCMOVNB32( x86IntRegType from );
1137 // fcmovne fpu reg to fpu reg stack
1138 void FCMOVNE32( x86IntRegType from );
1139 // fcmovnbe fpu reg to fpu reg stack
1140 void FCMOVNBE32( x86IntRegType from );
1141 // fcmovnu fpu reg to fpu reg stack
1142 void FCMOVNU32( x86IntRegType from );
1143 void FCOMP32( uptr from );
1144 void FNSTSWtoAX( void );
1146 // probably a little extreme here, but x86-64 should NOT use MMX
1149 #define MMXONLY(code)
1153 #define MMXONLY(code) code
1155 //******************
1157 //******************
1162 void MOVQMtoR( x86MMXRegType to, uptr from );
1164 void MOVQRtoM( uptr to, x86MMXRegType from );
1167 void PANDRtoR( x86MMXRegType to, x86MMXRegType from );
1168 void PANDNRtoR( x86MMXRegType to, x86MMXRegType from );
1169 // pand m64 to r64 ;
1170 void PANDMtoR( x86MMXRegType to, uptr from );
1172 void PANDNRtoR( x86MMXRegType to, x86MMXRegType from );
1174 void PANDNMtoR( x86MMXRegType to, uptr from );
1176 void PORRtoR( x86MMXRegType to, x86MMXRegType from );
1178 void PORMtoR( x86MMXRegType to, uptr from );
1180 void PXORRtoR( x86MMXRegType to, x86MMXRegType from );
1182 void PXORMtoR( x86MMXRegType to, uptr from );
1185 void PSLLQRtoR( x86MMXRegType to, x86MMXRegType from );
1187 void PSLLQMtoR( x86MMXRegType to, uptr from );
1188 // psllq imm8 to r64
1189 void PSLLQItoR( x86MMXRegType to, u8 from );
1191 void PSRLQRtoR( x86MMXRegType to, x86MMXRegType from );
1193 void PSRLQMtoR( x86MMXRegType to, uptr from );
1194 // psrlq imm8 to r64
1195 void PSRLQItoR( x86MMXRegType to, u8 from );
1197 // paddusb r64 to r64
1198 void PADDUSBRtoR( x86MMXRegType to, x86MMXRegType from );
1199 // paddusb m64 to r64
1200 void PADDUSBMtoR( x86MMXRegType to, uptr from );
1201 // paddusw r64 to r64
1202 void PADDUSWRtoR( x86MMXRegType to, x86MMXRegType from );
1203 // paddusw m64 to r64
1204 void PADDUSWMtoR( x86MMXRegType to, uptr from );
1207 void PADDBRtoR( x86MMXRegType to, x86MMXRegType from );
1209 void PADDBMtoR( x86MMXRegType to, uptr from );
1211 void PADDWRtoR( x86MMXRegType to, x86MMXRegType from );
1213 void PADDWMtoR( x86MMXRegType to, uptr from );
1215 void PADDDRtoR( x86MMXRegType to, x86MMXRegType from );
1217 void PADDDMtoR( x86MMXRegType to, uptr from );
1218 void PADDSBRtoR( x86MMXRegType to, x86MMXRegType from );
1219 void PADDSWRtoR( x86MMXRegType to, x86MMXRegType from );
1221 // paddq m64 to r64 (sse2 only?)
1222 void PADDQMtoR( x86MMXRegType to, uptr from );
1223 // paddq r64 to r64 (sse2 only?)
1224 void PADDQRtoR( x86MMXRegType to, x86MMXRegType from );
1226 void PSUBSBRtoR( x86MMXRegType to, x86MMXRegType from );
1227 void PSUBSWRtoR( x86MMXRegType to, x86MMXRegType from );
1229 void PSUBBRtoR( x86MMXRegType to, x86MMXRegType from );
1230 void PSUBWRtoR( x86MMXRegType to, x86MMXRegType from );
1231 void PSUBDRtoR( x86MMXRegType to, x86MMXRegType from );
1232 void PSUBDMtoR( x86MMXRegType to, uptr from );
1234 // psubq m64 to r64 (sse2 only?)
1235 void PSUBQMtoR( x86MMXRegType to, uptr from );
1236 // psubq r64 to r64 (sse2 only?)
1237 void PSUBQRtoR( x86MMXRegType to, x86MMXRegType from );
1239 // pmuludq m64 to r64 (sse2 only?)
1240 void PMULUDQMtoR( x86MMXRegType to, uptr from );
1241 // pmuludq r64 to r64 (sse2 only?)
1242 void PMULUDQRtoR( x86MMXRegType to, x86MMXRegType from );
1244 void PCMPEQBRtoR( x86MMXRegType to, x86MMXRegType from );
1245 void PCMPEQWRtoR( x86MMXRegType to, x86MMXRegType from );
1246 void PCMPEQDRtoR( x86MMXRegType to, x86MMXRegType from );
1247 void PCMPEQDMtoR( x86MMXRegType to, uptr from );
1248 void PCMPGTBRtoR( x86MMXRegType to, x86MMXRegType from );
1249 void PCMPGTWRtoR( x86MMXRegType to, x86MMXRegType from );
1250 void PCMPGTDRtoR( x86MMXRegType to, x86MMXRegType from );
1251 void PCMPGTDMtoR( x86MMXRegType to, uptr from );
1252 void PSRLWItoR( x86MMXRegType to, u8 from );
1253 void PSRLDItoR( x86MMXRegType to, u8 from );
1254 void PSRLDRtoR( x86MMXRegType to, x86MMXRegType from );
1255 void PSLLWItoR( x86MMXRegType to, u8 from );
1256 void PSLLDItoR( x86MMXRegType to, u8 from );
1257 void PSLLDRtoR( x86MMXRegType to, x86MMXRegType from );
1258 void PSRAWItoR( x86MMXRegType to, u8 from );
1259 void PSRADItoR( x86MMXRegType to, u8 from );
1260 void PSRADRtoR( x86MMXRegType to, x86MMXRegType from );
1261 void PUNPCKLDQRtoR( x86MMXRegType to, x86MMXRegType from );
1262 void PUNPCKLDQMtoR( x86MMXRegType to, uptr from );
1263 void PUNPCKHDQRtoR( x86MMXRegType to, x86MMXRegType from );
1264 void PUNPCKHDQMtoR( x86MMXRegType to, uptr from );
1265 void MOVQ64ItoR( x86MMXRegType reg, u64 i ); //Prototype.Todo add all consts to end of block.not after jr $+8
1266 void MOVQRtoR( x86MMXRegType to, x86MMXRegType from );
1267 void MOVQRmtoROffset( x86MMXRegType to, x86IntRegType from, u32 offset );
1268 void MOVQRtoRmOffset( x86IntRegType to, x86MMXRegType from, u32 offset );
1269 void MOVDMtoMMX( x86MMXRegType to, uptr from );
1270 void MOVDMMXtoM( uptr to, x86MMXRegType from );
1271 void MOVD32RtoMMX( x86MMXRegType to, x86IntRegType from );
1272 void MOVD32RmtoMMX( x86MMXRegType to, x86IntRegType from );
1273 void MOVD32RmOffsettoMMX( x86MMXRegType to, x86IntRegType from, u32 offset );
1274 void MOVD32MMXtoR( x86IntRegType to, x86MMXRegType from );
1275 void MOVD32MMXtoRm( x86IntRegType to, x86MMXRegType from );
1276 void MOVD32MMXtoRmOffset( x86IntRegType to, x86MMXRegType from, u32 offset );
1277 void PINSRWRtoMMX( x86MMXRegType to, x86SSERegType from, u8 imm8 );
1278 void PSHUFWRtoR(x86MMXRegType to, x86MMXRegType from, u8 imm8);
1279 void PSHUFWMtoR(x86MMXRegType to, uptr from, u8 imm8);
1280 void MASKMOVQRtoR(x86MMXRegType to, x86MMXRegType from);
1285 //**********************************************************************************/
1286 //PACKSSWB,PACKSSDW: Pack Saturate Signed Word 64bits
1287 //**********************************************************************************
1288 void PACKSSWBMMXtoMMX(x86MMXRegType to, x86MMXRegType from);
1289 void PACKSSDWMMXtoMMX(x86MMXRegType to, x86MMXRegType from);
1291 void PMOVMSKBMMXtoR(x86IntRegType to, x86MMXRegType from);
1293 void SSE2_MOVDQ2Q_XMM_to_MM( x86MMXRegType to, x86SSERegType from);
1294 void SSE2_MOVQ2DQ_MM_to_XMM( x86SSERegType to, x86MMXRegType from);
1296 #endif // !__x86_64__
1298 //*********************
1299 // SSE instructions *
1300 //*********************
1301 void SSE_MOVAPS_M128_to_XMM( x86SSERegType to, uptr from );
1302 void SSE_MOVAPS_XMM_to_M128( uptr to, x86SSERegType from );
1303 void SSE_MOVAPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1305 void SSE_MOVUPS_M128_to_XMM( x86SSERegType to, uptr from );
1306 void SSE_MOVUPS_XMM_to_M128( uptr to, x86SSERegType from );
1308 void SSE_MOVSS_M32_to_XMM( x86SSERegType to, uptr from );
1309 void SSE_MOVSS_XMM_to_M32( u32 to, x86SSERegType from );
1310 void SSE_MOVSS_XMM_to_Rm( x86IntRegType to, x86SSERegType from );
1311 void SSE_MOVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1312 void SSE_MOVSS_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1313 void SSE_MOVSS_XMM_to_RmOffset( x86IntRegType to, x86SSERegType from, int offset );
1315 void SSE2_MOVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1317 void SSE2_MOVQ_M64_to_XMM( x86SSERegType to, uptr from );
1318 void SSE2_MOVQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1319 void SSE2_MOVQ_XMM_to_M64( u32 to, x86SSERegType from );
1321 void SSE_MASKMOVDQU_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1323 void SSE_MOVLPS_M64_to_XMM( x86SSERegType to, uptr from );
1324 void SSE_MOVLPS_XMM_to_M64( u32 to, x86SSERegType from );
1325 void SSE_MOVLPS_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1326 void SSE_MOVLPS_XMM_to_RmOffset( x86IntRegType to, x86SSERegType from, int offset );
1328 void SSE_MOVHPS_M64_to_XMM( x86SSERegType to, uptr from );
1329 void SSE_MOVHPS_XMM_to_M64( u32 to, x86SSERegType from );
1330 void SSE_MOVHPS_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1331 void SSE_MOVHPS_XMM_to_RmOffset( x86IntRegType to, x86SSERegType from, int offset );
1333 void SSE_MOVLHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1334 void SSE_MOVHLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1335 void SSE_MOVLPSRmtoR( x86SSERegType to, x86IntRegType from );
1336 void SSE_MOVLPSRmtoROffset( x86SSERegType to, x86IntRegType from, int offset );
1337 void SSE_MOVLPSRtoRm( x86SSERegType to, x86IntRegType from );
1338 void SSE_MOVLPSRtoRmOffset( x86SSERegType to, x86IntRegType from, int offset );
1340 void SSE_MOVAPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale );
1341 void SSE_MOVAPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale );
1342 void SSE_MOVAPSRtoRmOffset( x86IntRegType to, x86SSERegType from, int offset );
1343 void SSE_MOVAPSRmtoROffset( x86SSERegType to, x86IntRegType from, int offset );
1344 void SSE_MOVUPSRmStoR( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale );
1345 void SSE_MOVUPSRtoRmS( x86SSERegType to, x86IntRegType from, x86IntRegType from2, int scale );
1346 void SSE_MOVUPSRtoRm( x86IntRegType to, x86IntRegType from );
1347 void SSE_MOVUPSRmtoR( x86IntRegType to, x86IntRegType from );
1349 void SSE_MOVUPSRmtoROffset( x86SSERegType to, x86IntRegType from, int offset );
1350 void SSE_MOVUPSRtoRmOffset( x86SSERegType to, x86IntRegType from, int offset );
1352 void SSE2_MOVDQARtoRmOffset( x86IntRegType to, x86SSERegType from, int offset );
1353 void SSE2_MOVDQARmtoROffset( x86SSERegType to, x86IntRegType from, int offset );
1355 void SSE_RCPPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1356 void SSE_RCPPS_M128_to_XMM( x86SSERegType to, uptr from );
1357 void SSE_RCPSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1358 void SSE_RCPSS_M32_to_XMM( x86SSERegType to, uptr from );
1360 void SSE_ORPS_M128_to_XMM( x86SSERegType to, uptr from );
1361 void SSE_ORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1362 void SSE_XORPS_M128_to_XMM( x86SSERegType to, uptr from );
1363 void SSE_XORPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1364 void SSE_ANDPS_M128_to_XMM( x86SSERegType to, uptr from );
1365 void SSE_ANDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1366 void SSE_ANDNPS_M128_to_XMM( x86SSERegType to, uptr from );
1367 void SSE_ANDNPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1368 void SSE_ADDPS_M128_to_XMM( x86SSERegType to, uptr from );
1369 void SSE_ADDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1370 void SSE_ADDSS_M32_to_XMM( x86SSERegType to, uptr from );
1371 void SSE_ADDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1372 void SSE_SUBPS_M128_to_XMM( x86SSERegType to, uptr from );
1373 void SSE_SUBPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1374 void SSE_SUBSS_M32_to_XMM( x86SSERegType to, uptr from );
1375 void SSE_SUBSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1376 void SSE_MULPS_M128_to_XMM( x86SSERegType to, uptr from );
1377 void SSE_MULPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1378 void SSE_MULSS_M32_to_XMM( x86SSERegType to, uptr from );
1379 void SSE_MULSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1380 void SSE_CMPEQSS_M32_to_XMM( x86SSERegType to, uptr from );
1381 void SSE_CMPEQSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1382 void SSE_CMPLTSS_M32_to_XMM( x86SSERegType to, uptr from );
1383 void SSE_CMPLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1384 void SSE_CMPLESS_M32_to_XMM( x86SSERegType to, uptr from );
1385 void SSE_CMPLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1386 void SSE_CMPUNORDSS_M32_to_XMM( x86SSERegType to, uptr from );
1387 void SSE_CMPUNORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1388 void SSE_CMPNESS_M32_to_XMM( x86SSERegType to, uptr from );
1389 void SSE_CMPNESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1390 void SSE_CMPNLTSS_M32_to_XMM( x86SSERegType to, uptr from );
1391 void SSE_CMPNLTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1392 void SSE_CMPNLESS_M32_to_XMM( x86SSERegType to, uptr from );
1393 void SSE_CMPNLESS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1394 void SSE_CMPORDSS_M32_to_XMM( x86SSERegType to, uptr from );
1395 void SSE_CMPORDSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1397 void SSE_UCOMISS_M32_to_XMM( x86SSERegType to, uptr from );
1398 void SSE_UCOMISS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1401 void SSE_PMAXSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from );
1402 void SSE_PMINSW_MM_to_MM( x86MMXRegType to, x86MMXRegType from );
1403 void SSE_CVTPI2PS_MM_to_XMM( x86SSERegType to, x86MMXRegType from );
1404 void SSE_CVTPS2PI_M64_to_MM( x86MMXRegType to, uptr from );
1405 void SSE_CVTPS2PI_XMM_to_MM( x86MMXRegType to, x86SSERegType from );
1407 void SSE_CVTPI2PS_M64_to_XMM( x86SSERegType to, uptr from );
1408 void SSE_CVTTSS2SI_M32_to_R32(x86IntRegType to, uptr from);
1409 void SSE_CVTTSS2SI_XMM_to_R32(x86IntRegType to, x86SSERegType from);
1410 void SSE_CVTSI2SS_M32_to_XMM(x86SSERegType to, uptr from);
1411 void SSE_CVTSI2SS_R_to_XMM(x86SSERegType to, x86IntRegType from);
1413 void SSE2_CVTDQ2PS_M128_to_XMM( x86SSERegType to, uptr from );
1414 void SSE2_CVTDQ2PS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1415 void SSE2_CVTPS2DQ_M128_to_XMM( x86SSERegType to, uptr from );
1416 void SSE2_CVTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1417 void SSE2_CVTTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1419 void SSE_MAXPS_M128_to_XMM( x86SSERegType to, uptr from );
1420 void SSE_MAXPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1421 void SSE_MAXSS_M32_to_XMM( x86SSERegType to, uptr from );
1422 void SSE_MAXSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1423 void SSE_MINPS_M128_to_XMM( x86SSERegType to, uptr from );
1424 void SSE_MINPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1425 void SSE_MINSS_M32_to_XMM( x86SSERegType to, uptr from );
1426 void SSE_MINSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1427 void SSE_RSQRTPS_M128_to_XMM( x86SSERegType to, uptr from );
1428 void SSE_RSQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1429 void SSE_RSQRTSS_M32_to_XMM( x86SSERegType to, uptr from );
1430 void SSE_RSQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1431 void SSE_SQRTPS_M128_to_XMM( x86SSERegType to, uptr from );
1432 void SSE_SQRTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1433 void SSE_SQRTSS_M32_to_XMM( x86SSERegType to, uptr from );
1434 void SSE_SQRTSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1435 void SSE_UNPCKLPS_M128_to_XMM( x86SSERegType to, uptr from );
1436 void SSE_UNPCKLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1437 void SSE_UNPCKHPS_M128_to_XMM( x86SSERegType to, uptr from );
1438 void SSE_UNPCKHPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1439 void SSE_SHUFPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 );
1440 void SSE_SHUFPS_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 );
1441 void SSE_SHUFPS_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset, u8 imm8 );
1442 void SSE_CMPEQPS_M128_to_XMM( x86SSERegType to, uptr from );
1443 void SSE_CMPEQPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1444 void SSE_CMPLTPS_M128_to_XMM( x86SSERegType to, uptr from );
1445 void SSE_CMPLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1446 void SSE_CMPLEPS_M128_to_XMM( x86SSERegType to, uptr from );
1447 void SSE_CMPLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1448 void SSE_CMPUNORDPS_M128_to_XMM( x86SSERegType to, uptr from );
1449 void SSE_CMPUNORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1450 void SSE_CMPNEPS_M128_to_XMM( x86SSERegType to, uptr from );
1451 void SSE_CMPNEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1452 void SSE_CMPNLTPS_M128_to_XMM( x86SSERegType to, uptr from );
1453 void SSE_CMPNLTPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1454 void SSE_CMPNLEPS_M128_to_XMM( x86SSERegType to, uptr from );
1455 void SSE_CMPNLEPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1456 void SSE_CMPORDPS_M128_to_XMM( x86SSERegType to, uptr from );
1457 void SSE_CMPORDPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1458 void SSE_DIVPS_M128_to_XMM( x86SSERegType to, uptr from );
1459 void SSE_DIVPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1460 void SSE_DIVSS_M32_to_XMM( x86SSERegType to, uptr from );
1461 void SSE_DIVSS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1463 void SSE2_PSHUFD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 );
1464 void SSE2_PSHUFD_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 );
1466 void SSE2_PSHUFLW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 );
1467 void SSE2_PSHUFLW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 );
1468 void SSE2_PSHUFHW_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 );
1469 void SSE2_PSHUFHW_M128_to_XMM( x86SSERegType to, uptr from, u8 imm8 );
1471 void SSE_STMXCSR( uptr from );
1472 void SSE_LDMXCSR( uptr from );
1475 //*********************
1476 // SSE 2 Instructions*
1477 //*********************
1478 void SSE2_MOVDQA_M128_to_XMM(x86SSERegType to, uptr from);
1479 void SSE2_MOVDQA_XMM_to_M128( uptr to, x86SSERegType from);
1480 void SSE2_MOVDQA_XMM_to_XMM( x86SSERegType to, x86SSERegType from);
1482 void SSE2_MOVDQU_M128_to_XMM(x86SSERegType to, uptr from);
1483 void SSE2_MOVDQU_XMM_to_M128( uptr to, x86SSERegType from);
1484 void SSE2_MOVDQU_XMM_to_XMM( x86SSERegType to, x86SSERegType from);
1486 void SSE2_PSRLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1487 void SSE2_PSRLW_M128_to_XMM(x86SSERegType to, uptr from);
1488 void SSE2_PSRLW_I8_to_XMM(x86SSERegType to, u8 imm8);
1489 void SSE2_PSRLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1490 void SSE2_PSRLD_M128_to_XMM(x86SSERegType to, uptr from);
1491 void SSE2_PSRLD_I8_to_XMM(x86SSERegType to, u8 imm8);
1492 void SSE2_PSRLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1493 void SSE2_PSRLQ_M128_to_XMM(x86SSERegType to, uptr from);
1494 void SSE2_PSRLQ_I8_to_XMM(x86SSERegType to, u8 imm8);
1495 void SSE2_PSRLDQ_I8_to_XMM(x86SSERegType to, u8 imm8);
1496 void SSE2_PSRAW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1497 void SSE2_PSRAW_M128_to_XMM(x86SSERegType to, uptr from);
1498 void SSE2_PSRAW_I8_to_XMM(x86SSERegType to, u8 imm8);
1499 void SSE2_PSRAD_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1500 void SSE2_PSRAD_M128_to_XMM(x86SSERegType to, uptr from);
1501 void SSE2_PSRAD_I8_to_XMM(x86SSERegType to, u8 imm8);
1502 void SSE2_PSLLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1503 void SSE2_PSLLW_M128_to_XMM(x86SSERegType to, uptr from);
1504 void SSE2_PSLLW_I8_to_XMM(x86SSERegType to, u8 imm8);
1505 void SSE2_PSLLD_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1506 void SSE2_PSLLD_M128_to_XMM(x86SSERegType to, uptr from);
1507 void SSE2_PSLLD_I8_to_XMM(x86SSERegType to, u8 imm8);
1508 void SSE2_PSLLQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1509 void SSE2_PSLLQ_M128_to_XMM(x86SSERegType to, uptr from);
1510 void SSE2_PSLLQ_I8_to_XMM(x86SSERegType to, u8 imm8);
1511 void SSE2_PSLLDQ_I8_to_XMM(x86SSERegType to, u8 imm8);
1512 void SSE2_PMAXSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1513 void SSE2_PMAXSW_M128_to_XMM( x86SSERegType to, uptr from );
1514 void SSE2_PMAXUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1515 void SSE2_PMAXUB_M128_to_XMM( x86SSERegType to, uptr from );
1516 void SSE2_PMINSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1517 void SSE2_PMINSW_M128_to_XMM( x86SSERegType to, uptr from );
1518 void SSE2_PMINUB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1519 void SSE2_PMINUB_M128_to_XMM( x86SSERegType to, uptr from );
1520 void SSE2_PADDSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1521 void SSE2_PADDSB_M128_to_XMM( x86SSERegType to, uptr from );
1522 void SSE2_PADDSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1523 void SSE2_PADDSW_M128_to_XMM( x86SSERegType to, uptr from );
1524 void SSE2_PSUBSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1525 void SSE2_PSUBSB_M128_to_XMM( x86SSERegType to, uptr from );
1526 void SSE2_PSUBSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1527 void SSE2_PSUBSW_M128_to_XMM( x86SSERegType to, uptr from );
1528 void SSE2_PSUBUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1529 void SSE2_PSUBUSB_M128_to_XMM( x86SSERegType to, uptr from );
1530 void SSE2_PSUBUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1531 void SSE2_PSUBUSW_M128_to_XMM( x86SSERegType to, uptr from );
1532 void SSE2_PAND_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1533 void SSE2_PAND_M128_to_XMM( x86SSERegType to, uptr from );
1534 void SSE2_PANDN_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1535 void SSE2_PANDN_M128_to_XMM( x86SSERegType to, uptr from );
1536 void SSE2_PXOR_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1537 void SSE2_PXOR_M128_to_XMM( x86SSERegType to, uptr from );
1538 void SSE2_PADDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1539 void SSE2_PADDW_M128_to_XMM(x86SSERegType to, uptr from );
1540 void SSE2_PADDUSB_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1541 void SSE2_PADDUSB_M128_to_XMM( x86SSERegType to, uptr from );
1542 void SSE2_PADDUSW_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1543 void SSE2_PADDUSW_M128_to_XMM( x86SSERegType to, uptr from );
1544 void SSE2_PADDB_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1545 void SSE2_PADDB_M128_to_XMM(x86SSERegType to, uptr from );
1546 void SSE2_PADDD_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1547 void SSE2_PADDD_M128_to_XMM(x86SSERegType to, uptr from );
1548 void SSE2_PADDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1549 void SSE2_PADDQ_M128_to_XMM(x86SSERegType to, uptr from );
1551 //**********************************************************************************/
1552 //PACKSSWB,PACKSSDW: Pack Saturate Signed Word
1553 //**********************************************************************************
1554 void SSE2_PACKSSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1555 void SSE2_PACKSSWB_M128_to_XMM(x86SSERegType to, uptr from);
1556 void SSE2_PACKSSDW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1557 void SSE2_PACKSSDW_M128_to_XMM(x86SSERegType to, uptr from);
1559 void SSE2_PACKUSWB_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1560 void SSE2_PACKUSWB_M128_to_XMM(x86SSERegType to, uptr from);
1562 //**********************************************************************************/
1563 //PUNPCKHWD: Unpack 16bit high
1564 //**********************************************************************************
1565 void SSE2_PUNPCKLBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1566 void SSE2_PUNPCKLBW_M128_to_XMM(x86SSERegType to, uptr from);
1567 void SSE2_PUNPCKHBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1568 void SSE2_PUNPCKHBW_M128_to_XMM(x86SSERegType to, uptr from);
1570 void SSE2_PUNPCKLWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1571 void SSE2_PUNPCKLWD_M128_to_XMM(x86SSERegType to, uptr from);
1572 void SSE2_PUNPCKHWD_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1573 void SSE2_PUNPCKHWD_M128_to_XMM(x86SSERegType to, uptr from);
1575 void SSE2_PUNPCKLDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1576 void SSE2_PUNPCKLDQ_M128_to_XMM(x86SSERegType to, uptr from);
1577 void SSE2_PUNPCKHDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1578 void SSE2_PUNPCKHDQ_M128_to_XMM(x86SSERegType to, uptr from);
1580 void SSE2_PUNPCKLQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1581 void SSE2_PUNPCKLQDQ_M128_to_XMM(x86SSERegType to, uptr from);
1583 void SSE2_PUNPCKHQDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1584 void SSE2_PUNPCKHQDQ_M128_to_XMM(x86SSERegType to, uptr from);
1586 // mult by half words
1587 void SSE2_PMULLW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1588 void SSE2_PMULLW_M128_to_XMM(x86SSERegType to, uptr from);
1589 void SSE2_PMULHW_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1590 void SSE2_PMULHW_M128_to_XMM(x86SSERegType to, uptr from);
1592 void SSE2_PMULUDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1593 void SSE2_PMULUDQ_M128_to_XMM(x86SSERegType to, uptr from);
1596 //**********************************************************************************/
1597 //PMOVMSKB: Create 16bit mask from signs of 8bit integers
1598 //**********************************************************************************
1599 void SSE2_PMOVMSKB_XMM_to_R32(x86IntRegType to, x86SSERegType from);
1601 void SSE_MOVMSKPS_XMM_to_R32(x86IntRegType to, x86SSERegType from);
1602 void SSE2_MOVMSKPD_XMM_to_R32(x86IntRegType to, x86SSERegType from);
1604 //**********************************************************************************/
1605 //PEXTRW,PINSRW: Packed Extract/Insert Word *
1606 //**********************************************************************************
1607 void SSE_PEXTRW_XMM_to_R32(x86IntRegType to, x86SSERegType from, u8 imm8 );
1608 void SSE_PINSRW_R32_to_XMM(x86SSERegType from, x86IntRegType to, u8 imm8 );
1611 //**********************************************************************************/
1612 //PSUBx: Subtract Packed Integers *
1613 //**********************************************************************************
1614 void SSE2_PSUBB_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1615 void SSE2_PSUBB_M128_to_XMM(x86SSERegType to, uptr from );
1616 void SSE2_PSUBW_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1617 void SSE2_PSUBW_M128_to_XMM(x86SSERegType to, uptr from );
1618 void SSE2_PSUBD_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1619 void SSE2_PSUBD_M128_to_XMM(x86SSERegType to, uptr from );
1620 void SSE2_PSUBQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1621 void SSE2_PSUBQ_M128_to_XMM(x86SSERegType to, uptr from );
1622 ///////////////////////////////////////////////////////////////////////////////////////
1623 //**********************************************************************************/
1624 //PCMPxx: Compare Packed Integers *
1625 //**********************************************************************************
1626 void SSE2_PCMPGTB_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1627 void SSE2_PCMPGTB_M128_to_XMM(x86SSERegType to, uptr from );
1628 void SSE2_PCMPGTW_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1629 void SSE2_PCMPGTW_M128_to_XMM(x86SSERegType to, uptr from );
1630 void SSE2_PCMPGTD_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1631 void SSE2_PCMPGTD_M128_to_XMM(x86SSERegType to, uptr from );
1632 void SSE2_PCMPEQB_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1633 void SSE2_PCMPEQB_M128_to_XMM(x86SSERegType to, uptr from );
1634 void SSE2_PCMPEQW_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1635 void SSE2_PCMPEQW_M128_to_XMM(x86SSERegType to, uptr from );
1636 void SSE2_PCMPEQD_XMM_to_XMM(x86SSERegType to, x86SSERegType from );
1637 void SSE2_PCMPEQD_M128_to_XMM(x86SSERegType to, uptr from );
1638 //**********************************************************************************/
1639 //MOVD: Move Dword(32bit) to /from XMM reg *
1640 //**********************************************************************************
1641 void SSE2_MOVD_M32_to_XMM( x86SSERegType to, uptr from );
1642 void SSE2_MOVD_R_to_XMM( x86SSERegType to, x86IntRegType from );
1643 void SSE2_MOVD_Rm_to_XMM( x86SSERegType to, x86IntRegType from );
1644 void SSE2_MOVD_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1645 void SSE2_MOVD_XMM_to_M32( u32 to, x86SSERegType from );
1646 void SSE2_MOVD_XMM_to_R( x86IntRegType to, x86SSERegType from );
1647 void SSE2_MOVD_XMM_to_Rm( x86IntRegType to, x86SSERegType from );
1648 void SSE2_MOVD_XMM_to_RmOffset( x86IntRegType to, x86SSERegType from, int offset );
1651 void SSE2_MOVQ_XMM_to_R( x86IntRegType to, x86SSERegType from );
1652 void SSE2_MOVQ_R_to_XMM( x86SSERegType to, x86IntRegType from );
1655 //**********************************************************************************/
1656 //POR : SSE Bitwise OR *
1657 //**********************************************************************************
1658 void SSE2_POR_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1659 void SSE2_POR_M128_to_XMM( x86SSERegType to, uptr from );
1661 void SSE3_HADDPS_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1662 void SSE3_HADDPS_M128_to_XMM(x86SSERegType to, uptr from);
1664 void SSE3_MOVSLDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1665 void SSE3_MOVSLDUP_M128_to_XMM(x86SSERegType to, uptr from);
1666 void SSE3_MOVSHDUP_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1667 void SSE3_MOVSHDUP_M128_to_XMM(x86SSERegType to, uptr from);
1668 //*********************
1669 // SSE-X - uses both SSE,SSE2 code and tries to keep consistensies between the data
1670 // Uses g_xmmtypes to infer the correct type.
1671 //*********************
1672 void SSEX_MOVDQA_M128_to_XMM( x86SSERegType to, uptr from );
1673 void SSEX_MOVDQA_XMM_to_M128( uptr to, x86SSERegType from );
1674 void SSEX_MOVDQA_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1676 void SSEX_MOVDQARmtoROffset( x86SSERegType to, x86IntRegType from, int offset );
1677 void SSEX_MOVDQARtoRmOffset( x86IntRegType to, x86SSERegType from, int offset );
1679 void SSEX_MOVDQU_M128_to_XMM( x86SSERegType to, uptr from );
1680 void SSEX_MOVDQU_XMM_to_M128( uptr to, x86SSERegType from );
1681 void SSEX_MOVDQU_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1683 void SSEX_MOVD_M32_to_XMM( x86SSERegType to, uptr from );
1684 void SSEX_MOVD_XMM_to_M32( u32 to, x86SSERegType from );
1685 void SSEX_MOVD_XMM_to_Rm( x86IntRegType to, x86SSERegType from );
1686 void SSEX_MOVD_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1687 void SSEX_MOVD_XMM_to_RmOffset( x86IntRegType to, x86SSERegType from, int offset );
1689 void SSEX_POR_M128_to_XMM( x86SSERegType to, uptr from );
1690 void SSEX_POR_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1691 void SSEX_PXOR_M128_to_XMM( x86SSERegType to, uptr from );
1692 void SSEX_PXOR_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1693 void SSEX_PAND_M128_to_XMM( x86SSERegType to, uptr from );
1694 void SSEX_PAND_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1695 void SSEX_PANDN_M128_to_XMM( x86SSERegType to, uptr from );
1696 void SSEX_PANDN_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1698 void SSEX_PUNPCKLDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1699 void SSEX_PUNPCKLDQ_M128_to_XMM(x86SSERegType to, uptr from);
1700 void SSEX_PUNPCKHDQ_XMM_to_XMM(x86SSERegType to, x86SSERegType from);
1701 void SSEX_PUNPCKHDQ_M128_to_XMM(x86SSERegType to, uptr from);
1703 void SSEX_MOVHLPS_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1705 //*********************
1706 // 3DNOW instructions *
1707 //*********************
1709 void PFCMPEQMtoR( x86IntRegType to, uptr from );
1710 void PFCMPGTMtoR( x86IntRegType to, uptr from );
1711 void PFCMPGEMtoR( x86IntRegType to, uptr from );
1712 void PFADDMtoR( x86IntRegType to, uptr from );
1713 void PFADDRtoR( x86IntRegType to, x86IntRegType from );
1714 void PFSUBMtoR( x86IntRegType to, uptr from );
1715 void PFSUBRtoR( x86IntRegType to, x86IntRegType from );
1716 void PFMULMtoR( x86IntRegType to, uptr from );
1717 void PFMULRtoR( x86IntRegType to, x86IntRegType from );
1718 void PFRCPMtoR( x86IntRegType to, uptr from );
1719 void PFRCPRtoR( x86IntRegType to, x86IntRegType from );
1720 void PFRCPIT1RtoR( x86IntRegType to, x86IntRegType from );
1721 void PFRCPIT2RtoR( x86IntRegType to, x86IntRegType from );
1722 void PFRSQRTRtoR( x86IntRegType to, x86IntRegType from );
1723 void PFRSQIT1RtoR( x86IntRegType to, x86IntRegType from );
1724 void PF2IDMtoR( x86IntRegType to, uptr from );
1725 void PF2IDRtoR( x86IntRegType to, x86IntRegType from );
1726 void PI2FDMtoR( x86IntRegType to, uptr from );
1727 void PI2FDRtoR( x86IntRegType to, x86IntRegType from );
1728 void PFMAXMtoR( x86IntRegType to, uptr from );
1729 void PFMAXRtoR( x86IntRegType to, x86IntRegType from );
1730 void PFMINMtoR( x86IntRegType to, uptr from );
1731 void PFMINRtoR( x86IntRegType to, x86IntRegType from );
1733 void SSE2EMU_MOVSD_XMM_to_XMM( x86SSERegType to, x86SSERegType from);
1734 void SSE2EMU_MOVQ_M64_to_XMM( x86SSERegType to, uptr from);
1735 void SSE2EMU_MOVQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from);
1736 void SSE2EMU_MOVD_RmOffset_to_XMM( x86SSERegType to, x86IntRegType from, int offset );
1737 void SSE2EMU_MOVD_XMM_to_RmOffset(x86IntRegType to, x86SSERegType from, int offset );
1740 void SSE2EMU_MOVDQ2Q_XMM_to_MM( x86MMXRegType to, x86SSERegType from);
1741 void SSE2EMU_MOVQ2DQ_MM_to_XMM( x86SSERegType to, x86MMXRegType from);
1744 /* SSE2 emulated functions for SSE CPU's by kekko*/
1746 void SSE2EMU_PSHUFD_XMM_to_XMM( x86SSERegType to, x86SSERegType from, u8 imm8 );
1747 void SSE2EMU_MOVD_XMM_to_R( x86IntRegType to, x86SSERegType from );
1748 void SSE2EMU_CVTPS2DQ_XMM_to_XMM( x86SSERegType to, x86SSERegType from );
1749 void SSE2EMU_CVTDQ2PS_M128_to_XMM( x86SSERegType to, uptr from );
1750 void SSE2EMU_MOVD_XMM_to_M32( uptr to, x86SSERegType from );
1751 void SSE2EMU_MOVD_R_to_XMM( x86SSERegType to, x86IntRegType from );
1753 ////////////////////////////////////////////////////
1755 #define WRITECHECK() CheckX86Ptr()
1757 #define WRITECHECK()
1760 #define writeVAL(val) ({ \
1762 *(typeof(val)*)x86Ptr = (val); \
1763 x86Ptr += sizeof(val); \
1767 #define write8(val ) writeVAL((u8)(val))
1768 #define write16(val ) writeVAL((u16)(val))
1769 #define write32( val ) writeVAL((u32)(val))
1770 #define write64( val ) writeVAL((u64)(val))
1776 #endif // __IX86_H__