Home My Page Projects Code Snippets Project Openings SML/NJ
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files

SCM Repository

[smlnj] Diff of /sml/trunk/src/runtime/mach-dep/assyntax.h
ViewVC logotype

Diff of /sml/trunk/src/runtime/mach-dep/assyntax.h

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 651, Thu Jun 1 18:34:03 2000 UTC revision 1186, Fri Apr 12 17:54:31 2002 UTC
# Line 1  Line 1 
1    
 /* Here it is.  Define INTEL_ASSEMBLER to output Intel syntax.  Please  
   send me any improvements you make, and let me know how it works out.  
   
 Josh  
 */  
   
 /* $XFree86: xc/programs/Xserver/hw/xfree86/os-support/assyntax.h,v 3.7.2.2 1997/05/11 02:56:22 dawes Exp $ */  
2  #ifndef __ASSYNTAX_H__  #ifndef __ASSYNTAX_H__
3  #define __ASSYNTAX_H__  #define __ASSYNTAX_H__
4  #endif  
5  /*  /*
6   * Copyright 1992 Vrije Universiteit, The Netherlands   * Copyright 1992 Vrije Universiteit, The Netherlands
7   *   *
# Line 22  Line 15 
15   * representations about the suitability of this software for any purpose.   * representations about the suitability of this software for any purpose.
16   * It is provided "as is" without express or implied warranty.   * It is provided "as is" without express or implied warranty.
17   *   *
18   * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,   * The Vrije Universiteit DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS
19   * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO   * SOFTWARE, INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS,
20   * EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL, INDIRECT OR   * IN NO EVENT SHALL The Vrije Universiteit BE LIABLE FOR ANY SPECIAL,
21   * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,   * INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
22   * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER   * LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
23   * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR   * OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
24   * PERFORMANCE OF THIS SOFTWARE.   * PERFORMANCE OF THIS SOFTWARE.
25   */   */
26  /* $XConsortium: assyntax.h /main/5 1996/02/21 17:50:49 kaleb $ */  /* $XFree86: xc/extras/Mesa/src/X86/assyntax.h,v 1.10 2002/03/05 20:27:24 dawes Exp $ */
27    
28   /*   /*
29   * assyntax.h   * assyntax.h
# Line 49  Line 42 
42   *   *
43   * Supported assemblers:   * Supported assemblers:
44   *   *
45   * (a) AT&T SysVr4 as(1):       default   * (a) AT&T SysVr4 as(1):       define ATT_ASSEMBLER
46   * (b) GNU Assembler gas:       define USE_GAS or GNU_ASSEMBLER   * (b) GNU Assembler gas:       define GNU_ASSEMBLER (default)
47   * (c) Amsterdam Compiler kit:  define ACK_ASSEMBLER   * (c) Amsterdam Compiler kit:  define ACK_ASSEMBLER
48     * (d) The Netwide Assembler:   define NASM_ASSEMBLER
49     * (e) Microsoft Assembler:     define MASM_ASSEMBLER (UNTESTED!)
50   *   *
51   * The following naming conventions have been used to identify the various   * The following naming conventions have been used to identify the various
52   * data types:   * data types:
# Line 68  Line 63 
63   *   *
64   * Author: Gregory J. Sharp, Sept 1992   * Author: Gregory J. Sharp, Sept 1992
65   *         Vrije Universiteit, Amsterdam, The Netherlands   *         Vrije Universiteit, Amsterdam, The Netherlands
66     *
67     *         [support for Intel syntax added by Josh Vanderhoof, 1999]
68   */   */
69    
70  #if !defined(INTEL_ASSEMBLER)  #if !(defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER))
71    
72    /* Default to ATT_ASSEMBLER when SVR4 or SYSV are defined */
73    #if (defined(SVR4) || defined(SYSV)) && !defined(GNU_ASSEMBLER)
74    #define ATT_ASSEMBLER
75    #endif
76    
77  #if defined(USE_GAS) && !defined(GNU_ASSEMBLER)  #if !defined(ATT_ASSEMBLER) && !defined(GNU_ASSEMBLER) && !defined(ACK_ASSEMBLER)
78  #define GNU_ASSEMBLER  #define GNU_ASSEMBLER
79  #endif  #endif
80    
# Line 194  Line 196 
196  #define DR6     %db6  #define DR6     %db6
197  #define DR7     %db7  #define DR7     %db7
198  /* Floating-point Stack */  /* Floating-point Stack */
199  #define ST      %st  #define _STX0           %st(0)
200    #define _STX1           %st(1)
201    #define _STX2           %st(2)
202    #define _STX3           %st(3)
203    #define _STX4           %st(4)
204    #define _STX5           %st(5)
205    #define _STX6           %st(6)
206    #define _STX7           %st(7)
207    #define ST(x)           CONCAT(_STX,x)
208    #ifdef GNU_ASSEMBLER
209    #define ST0             %st(0)
210    #else
211    #define ST0             %st
212    #endif
213    /* MMX Registers */
214    #define MM0             %mm0
215    #define MM1             %mm1
216    #define MM2             %mm2
217    #define MM3             %mm3
218    #define MM4             %mm4
219    #define MM5             %mm5
220    #define MM6             %mm6
221    #define MM7             %mm7
222    /* SSE Registers */
223    #define XMM0            %xmm0
224    #define XMM1            %xmm1
225    #define XMM2            %xmm2
226    #define XMM3            %xmm3
227    #define XMM4            %xmm4
228    #define XMM5            %xmm5
229    #define XMM6            %xmm6
230    #define XMM7            %xmm7
231    
232  #define AS_BEGIN  #define AS_BEGIN
233  #define USE16  #define USE16
# Line 221  Line 254 
254  #endif /* ACK_ASSEMBLER */  #endif /* ACK_ASSEMBLER */
255    
256    
257  #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__)  #if defined(__QNX__) || defined(Lynx) || (defined(SYSV) || defined(SVR4)) && !defined(ACK_ASSEMBLER) || defined(__ELF__) || defined(__GNU__) || defined(__GNUC__)
258  #define GLNAME(a)       a  #define GLNAME(a)       a
259  #else  #else
260  #define GLNAME(a)       CONCAT(_,a)  #define GLNAME(a)       CONCAT(_,a)
# Line 238  Line 271 
271  /* Redefine assembler directives */  /* Redefine assembler directives */
272  /*********************************/  /*********************************/
273  #define GLOBL           CHOICE(.globl, .globl, .extern)  #define GLOBL           CHOICE(.globl, .globl, .extern)
274  #define ALIGNTEXT4      CHOICE(.align 4, .align ARG2(2,0x90), .align 4)  #define GLOBAL          GLOBL
275  #define ALIGNTEXT2      CHOICE(.align 2, .align ARG2(1,0x90), .align 2)  #define EXTERN          GLOBL
276    /*
277    #define ALIGNTEXT32     CHOICE(.align 32, .align ARG2(5,0x90), .align 32)
278    */
279    #define ALIGNTEXT32     CHOICE(.align 32, .balign 32, .align 32)
280    #define ALIGNTEXT16     CHOICE(.align 16, .balign 16, .align 16)
281    #define ALIGNTEXT8      CHOICE(.align 8, .balign 8, .align 8)
282    #define ALIGNTEXT4      CHOICE(.align 4, .balign 4, .align 4)
283    #define ALIGNTEXT2      CHOICE(.align 2, .balign 2, .align 2)
284  /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is  /* ALIGNTEXT4ifNOP is the same as ALIGNTEXT4, but only if the space is
285   * guaranteed to be filled with NOPs.  Otherwise it does nothing.   * guaranteed to be filled with NOPs.  Otherwise it does nothing.
286   */   */
287  #define ALIGNTEXT4ifNOP CHOICE(.align 4, .align ARG2(2,0x90), /*can't do it*/)  #define ALIGNTEXT32ifNOP        CHOICE(.align 32, .balign ARG2(32,0x90), /*can't do it*/)
288  #define ALIGNDATA4      CHOICE(.align 4, .align ARG2(2,0x0), .align 4)  #define ALIGNTEXT16ifNOP        CHOICE(.align 16, .balign ARG2(16,0x90), /*can't do it*/)
289  #define ALIGNDATA2      CHOICE(.align 2, .align ARG2(1,0x0), .align 2)  #define ALIGNTEXT8ifNOP CHOICE(.align 8, .balign ARG2(8,0x90), /*can't do it*/)
290    #define ALIGNTEXT4ifNOP CHOICE(.align 4, .balign ARG2(4,0x90), /*can't do it*/)
291    #define ALIGNDATA32     CHOICE(.align 32, .balign ARG2(32,0x0), .align 32)
292    #define ALIGNDATA16     CHOICE(.align 16, .balign ARG2(16,0x0), .align 16)
293    #define ALIGNDATA8      CHOICE(.align 8, .balign ARG2(8,0x0), .align 8)
294    #define ALIGNDATA4      CHOICE(.align 4, .balign ARG2(4,0x0), .align 4)
295    #define ALIGNDATA2      CHOICE(.align 2, .balign ARG2(2,0x0), .align 2)
296  #define FILE(s)         CHOICE(.file s, .file s, .file s)  #define FILE(s)         CHOICE(.file s, .file s, .file s)
297  #define STRING(s)       CHOICE(.string s, .asciz s, .asciz s)  #define STRING(s)       CHOICE(.string s, .asciz s, .asciz s)
298  #define D_LONG          CHOICE(.long, .long, .data4)  #define D_LONG          CHOICE(.long, .long, .data4)
# Line 277  Line 324 
324   * which has no scaling   * which has no scaling
325   */   */
326  #define REGBID(b,i,d)   CHOICE(d(b,i), d(b,i), d(b)(i))  #define REGBID(b,i,d)   CHOICE(d(b,i), d(b,i), d(b)(i))
327    /* Reg indirect Base + (Index * Scale) */
328    #define REGBIS(b,i,s)   CHOICE((b,i,s), (b,i,s), (b)(i*s))
329  /* Reg indirect Base + (Index * Scale) + Displacement */  /* Reg indirect Base + (Index * Scale) + Displacement */
330  #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))  #define REGBISD(b,i,s,d) CHOICE(d(b,i,s), d(b,i,s), d(b)(i*s))
331  /* Displaced Scaled Index: */  /* Displaced Scaled Index: */
# Line 691  Line 740 
740  #define FPTAN           CHOICE(fptan, fptan, fptan)  #define FPTAN           CHOICE(fptan, fptan, fptan)
741  #define FRNDINT         CHOICE(frndint, frndint, frndint)  #define FRNDINT         CHOICE(frndint, frndint, frndint)
742  #define FRSTOR(a)       CHOICE(frstor a, frstor a, frstor a)  #define FRSTOR(a)       CHOICE(frstor a, frstor a, frstor a)
743  #define FSAVE(a)        CHOICE(fsave a, fwait; fnsave a, fwait; fsave a)  #define FSAVE(a)        CHOICE(fsave a, wait; fnsave a, wait; fsave a)
744  #define FNSAVE(a)       CHOICE(fnsave a, fnsave a, fsave a)  #define FNSAVE(a)       CHOICE(fnsave a, fnsave a, fsave a)
745  #define FSCALE          CHOICE(fscale, fscale, fscale)  #define FSCALE          CHOICE(fscale, fscale, fscale)
746  #define FSIN            CHOICE(fsin, fsin, fsin)  #define FSIN            CHOICE(fsin, fsin, fsin)
# Line 702  Line 751 
751  #define FSTP_X(a)       CHOICE(fstpt a, fstpt a, fstpx a)  #define FSTP_X(a)       CHOICE(fstpt a, fstpt a, fstpx a)
752  #define FSTP_D(a)       CHOICE(fstpl a, fstpl a, fstpd a)  #define FSTP_D(a)       CHOICE(fstpl a, fstpl a, fstpd a)
753  #define FSTP_S(a)       CHOICE(fstps a, fstps a, fstps a)  #define FSTP_S(a)       CHOICE(fstps a, fstps a, fstps a)
754    #define FSTP(a)         CHOICE(fstp a, fstp a, fstp a)
755  #define FSTCW(a)        CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)  #define FSTCW(a)        CHOICE(fstcw a, wait; fnstcw a, wait; fstcw a)
756  #define FNSTCW(a)       CHOICE(fnstcw a, fnstcw a, fstcw a)  #define FNSTCW(a)       CHOICE(fnstcw a, fnstcw a, fstcw a)
757  #define FSTENV(a)       CHOICE(fstenv a, wait; fnstenv a, fstenv a)  #define FSTENV(a)       CHOICE(fstenv a, wait; fnstenv a, fstenv a)
# Line 731  Line 781 
781  #define FYL2X           CHOICE(fyl2x, fyl2x, fyl2x)  #define FYL2X           CHOICE(fyl2x, fyl2x, fyl2x)
782  #define FYL2XP1         CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)  #define FYL2XP1         CHOICE(fyl2xp1, fyl2xp1, fyl2xp1)
783    
784    /* New instructions */
785    #define CPUID           CHOICE(D_BYTE ARG2(15, 162), cpuid, D_BYTE ARG2(15, 162))
786    #define RDTSC           CHOICE(D_BYTE ARG2(15, 49), rdtsc, D_BYTE ARG2(15, 49))
787    
788  #else /* INTEL_ASSEMBLER */  #else /* NASM_ASSEMBLER || MASM_ASSEMBLER is defined */
789    
790            /****************************************/
791            /*                                      */
792            /*      Intel style assemblers.         */
793            /*      (NASM and MASM)                 */
794            /*                                      */
795            /****************************************/
796    
797    #define P_EAX           EAX
798  #define L_EAX   EAX  #define L_EAX   EAX
799  #define W_AX    AX  #define W_AX    AX
800  #define B_AH    AH  #define B_AH    AH
801  #define B_AL    AL  #define B_AL    AL
802    
803    #define P_EBX           EBX
804  #define L_EBX   EBX  #define L_EBX   EBX
805  #define W_BX    BX  #define W_BX    BX
806  #define B_BH    BH  #define B_BH    BH
807  #define B_BL    BL  #define B_BL    BL
808    
809    #define P_ECX           ECX
810  #define L_ECX   ECX  #define L_ECX   ECX
811  #define W_CX    CX  #define W_CX    CX
812  #define B_CH    CH  #define B_CH    CH
813  #define B_CL    CL  #define B_CL    CL
814    
815    #define P_EDX           EDX
816  #define L_EDX   EDX  #define L_EDX   EDX
817  #define W_DX    DX  #define W_DX    DX
818  #define B_DH    DH  #define B_DH    DH
819  #define B_DL    DL  #define B_DL    DL
820    
821    #define P_EBP           EBP
822  #define L_EBP   EBP  #define L_EBP   EBP
823  #define W_BP    BP  #define W_BP    BP
824    
825    #define P_ESI           ESI
826  #define L_ESI   ESI  #define L_ESI   ESI
827  #define W_SI    SI  #define W_SI    SI
828    
829    #define P_EDI           EDI
830  #define L_EDI   EDI  #define L_EDI   EDI
831  #define W_DI    DI  #define W_DI    DI
832    
833    #define P_ESP           ESP
834  #define L_ESP   ESP  #define L_ESP   ESP
835  #define W_SP    SP  #define W_SP    SP
836    
# Line 778  Line 845 
845  #define D_ST    ST  #define D_ST    ST
846  #define L_ST    ST  #define L_ST    ST
847    
848  #define GLNAME(a) _ ## a  #define P_MM0           mm0
849    #define P_MM1           mm1
850    #define P_MM2           mm2
851    #define P_MM3           mm3
852    #define P_MM4           mm4
853    #define P_MM5           mm5
854    #define P_MM6           mm6
855    #define P_MM7           mm7
856    
857    #define P_XMM0          xmm0
858    #define P_XMM1          xmm1
859    #define P_XMM2          xmm2
860    #define P_XMM3          xmm3
861    #define P_XMM4          xmm4
862    #define P_XMM5          xmm5
863    #define P_XMM6          xmm6
864    #define P_XMM7          xmm7
865    
866    #define CONCAT(x, y)    x ## y
867    
868    #if defined(NASM_ASSEMBLER)
869    
870    #define ST(n)           st ## n
871    #define ST0             st0
872    
873    #define TBYTE_PTR       tword
874    #define QWORD_PTR       qword
875    #define DWORD_PTR       dword
876    #define WORD_PTR        word
877    #define BYTE_PTR        byte
878    
879    #define OFFSET
880    
881  #define GLOBL GLOBAL  #define GLOBL GLOBAL
882    #define ALIGNTEXT32             ALIGN 32
883    #define ALIGNTEXT16             ALIGN 16
884    #define ALIGNTEXT8              ALIGN 8
885  #define ALIGNTEXT4 ALIGN 4  #define ALIGNTEXT4 ALIGN 4
886  #define ALIGNTEXT2 ALIGN 2  #define ALIGNTEXT2 ALIGN 2
887    #define ALIGNTEXT32ifNOP        ALIGN 32
888    #define ALIGNTEXT16ifNOP        ALIGN 16
889    #define ALIGNTEXT8ifNOP         ALIGN 8
890  #define ALIGNTEXT4ifNOP ALIGN 4  #define ALIGNTEXT4ifNOP ALIGN 4
891    #define ALIGNDATA32             ALIGN 32
892    #define ALIGNDATA16             ALIGN 16
893    #define ALIGNDATA8              ALIGN 8
894    #define ALIGNDATA4              ALIGN 4
895    #define ALIGNDATA2              ALIGN 2
896    #define FILE(s)
897    #define STRING(s)       db s
898    #define D_LONG          dd
899    #define D_WORD          dw
900    #define D_BYTE          db
901    /* #define SPACE */
902    /* #define COMM */
903    #if defined(__WATCOMC__)
904    SECTION _TEXT public align=16 class=CODE use32 flat
905    SECTION _DATA public align=16 class=DATA use32 flat
906    #define SEG_TEXT        SECTION _TEXT
907    #define SEG_DATA        SECTION _DATA
908    #define SEG_BSS         SECTION .bss
909    #else
910    #define SEG_DATA        SECTION .data
911    #define SEG_TEXT        SECTION .text
912    #define SEG_BSS         SECTION .bss
913    #endif
914    
915    #define D_SPACE(n)      db n REP 0
916    
917    #define AS_BEGIN
918    
919    /* Jcc's should be handled better than this... */
920    #define NEAR            near
921    
922    #else /* MASM */
923    
924    #define TBYTE_PTR       tbyte ptr
925    #define QWORD_PTR       qword ptr
926    #define DWORD_PTR       dword ptr
927    #define WORD_PTR        word ptr
928    #define BYTE_PTR        byte ptr
929    
930    #define OFFSET          offset
931    
932    #define GLOBL                   GLOBAL
933    #define ALIGNTEXT32             ALIGN 32
934    #define ALIGNTEXT16             ALIGN 16
935    #define ALIGNTEXT8              ALIGN 8
936    #define ALIGNTEXT4              ALIGN 4
937    #define ALIGNTEXT2              ALIGN 2
938    #define ALIGNTEXT32ifNOP        ALIGN 32
939    #define ALIGNTEXT16ifNOP        ALIGN 16
940    #define ALIGNTEXT8ifNOP         ALIGN 8
941    #define ALIGNTEXT4ifNOP         ALIGN 4
942    #define ALIGNDATA32             ALIGN 32
943    #define ALIGNDATA16             ALIGN 16
944    #define ALIGNDATA8              ALIGN 8
945  #define ALIGNDATA4 ALIGN 4  #define ALIGNDATA4 ALIGN 4
946  #define ALIGNDATA2 ALIGN 2  #define ALIGNDATA2 ALIGN 2
947  #define FILE(s)  #define FILE(s)
# Line 800  Line 959 
959    
960  #define AS_BEGIN  #define AS_BEGIN
961    
962    #define NEAR
963    
964    #endif
965    
966    #if defined(Lynx) || (defined(SYSV) || defined(SVR4)) \
967     || (defined(linux) || defined(__OS2ELF__)) && defined(__ELF__) \
968     || defined(__FreeBSD__) && __FreeBSD__ >= 3
969    #define GLNAME(a)       a
970    #else
971    #define GLNAME(a)       _ ## a
972    #endif
973    
974  /*  /*
975   *      Addressing Modes   *      Addressing Modes
976   */   */
977    
978  /* Immediate Mode */  /* Immediate Mode */
979  #define X_ADDR(a)       offset a  #define P_ADDR(a)               OFFSET a
980  #define D_ADDR(a)       offset a  #define X_ADDR(a)               OFFSET a
981  #define L_ADDR(a)       offset a  #define D_ADDR(a)               OFFSET a
982  #define W_ADDR(a)       offset a  #define L_ADDR(a)               OFFSET a
983  #define B_ADDR(a)       offset a  #define W_ADDR(a)               OFFSET a
984    #define B_ADDR(a)               OFFSET a
985    
986    #define P_CONST(a)              a
987  #define X_CONST(a)      a  #define X_CONST(a)      a
988  #define D_CONST(a)      a  #define D_CONST(a)      a
989  #define L_CONST(a)      a  #define L_CONST(a)      a
# Line 818  Line 991 
991  #define B_CONST(a)      a  #define B_CONST(a)      a
992    
993  /* Indirect Mode */  /* Indirect Mode */
994  #define X_CONTENT(a)    tbyte ptr a  #define P_CONTENT(a)            a
995  #define D_CONTENT(a)    qword ptr a  #define X_CONTENT(a)            TBYTE_PTR a
996  #define L_CONTENT(a)    dword ptr a  #define D_CONTENT(a)            QWORD_PTR a
997  #define W_CONTENT(a)    word ptr a  #define L_CONTENT(a)            DWORD_PTR a
998  #define B_CONTENT(a)    byte ptr a  #define W_CONTENT(a)            WORD_PTR a
999    #define B_CONTENT(a)            BYTE_PTR a
1000    
1001  /* Register a indirect */  /* Register a indirect */
1002  #define X_REGIND(a)     tbyte ptr [a]  #define P_REGIND(a)             [a]
1003  #define D_REGIND(a)     qword ptr [a]  #define X_REGIND(a)             TBYTE_PTR [a]
1004  #define L_REGIND(a)     dword ptr [a]  #define D_REGIND(a)             QWORD_PTR [a]
1005  #define W_REGIND(a)     word ptr [a]  #define L_REGIND(a)             DWORD_PTR [a]
1006  #define B_REGIND(a)     byte ptr [a]  #define W_REGIND(a)             WORD_PTR [a]
1007    #define B_REGIND(a)             BYTE_PTR [a]
1008    
1009  /* Register b indirect plus displacement a */  /* Register b indirect plus displacement a */
1010  #define X_REGOFF(a, b)  tbyte ptr [a + b]  #define P_REGOFF(a, b)          [b + a]
1011  #define D_REGOFF(a, b)  qword ptr [a + b]  #define X_REGOFF(a, b)          TBYTE_PTR [b + a]
1012  #define L_REGOFF(a, b)  dword ptr [a + b]  #define D_REGOFF(a, b)          QWORD_PTR [b + a]
1013  #define W_REGOFF(a, b)  word ptr [a + b]  #define L_REGOFF(a, b)          DWORD_PTR [b + a]
1014  #define B_REGOFF(a, b)  byte ptr [a + b]  #define W_REGOFF(a, b)          WORD_PTR [b + a]
1015    #define B_REGOFF(a, b)          BYTE_PTR [b + a]
1016    
1017  /* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode  /* Reg indirect Base + Index + Displacement  - this is mainly for 16-bit mode
1018   * which has no scaling   * which has no scaling
1019   */   */
1020  #define X_REGBID(b, i, d)       tbyte ptr [b + i + d]  #define P_REGBID(b, i, d)       [b + i + d]
1021  #define D_REGBID(b, i, d)       qword ptr [b + i + d]  #define X_REGBID(b, i, d)       TBYTE_PTR [b + i + d]
1022  #define L_REGBID(b, i, d)       dword ptr [b + i + d]  #define D_REGBID(b, i, d)       QWORD_PTR [b + i + d]
1023  #define W_REGBID(b, i, d)       word ptr [b + i + d]  #define L_REGBID(b, i, d)       DWORD_PTR [b + i + d]
1024  #define B_REGBID(b, i, d)       byte ptr [b + i + d]  #define W_REGBID(b, i, d)       WORD_PTR [b + i + d]
1025    #define B_REGBID(b, i, d)       BYTE_PTR [b + i + d]
1026    
1027    /* Reg indirect Base + (Index * Scale) */
1028    #define P_REGBIS(b, i, s)       [b + i * s]
1029    #define X_REGBIS(b, i, s)       TBYTE_PTR [b + i * s]
1030    #define D_REGBIS(b, i, s)       QWORD_PTR [b + i * s]
1031    #define L_REGBIS(b, i, s)       DWORD_PTR [b + i * s]
1032    #define W_REGBIS(b, i, s)       WORD_PTR [b + i * s]
1033    #define B_REGBIS(b, i, s)       BYTE_PTR [b + i * s]
1034    
1035  /* Reg indirect Base + (Index * Scale) + Displacement */  /* Reg indirect Base + (Index * Scale) + Displacement */
1036  #define X_REGBISD(b, i, s, d)   tbyte ptr [b + i * s + d]  #define P_REGBISD(b, i, s, d)   [b + i * s + d]
1037  #define D_REGBISD(b, i, s, d)   qword ptr [b + i * s + d]  #define X_REGBISD(b, i, s, d)   TBYTE_PTR [b + i * s + d]
1038  #define L_REGBISD(b, i, s, d)   dword ptr [b + i * s + d]  #define D_REGBISD(b, i, s, d)   QWORD_PTR [b + i * s + d]
1039  #define W_REGBISD(b, i, s, d)   word ptr [b + i * s + d]  #define L_REGBISD(b, i, s, d)   DWORD_PTR [b + i * s + d]
1040  #define B_REGBISD(b, i, s, d)   byte ptr [b + i * s + d]  #define W_REGBISD(b, i, s, d)   WORD_PTR [b + i * s + d]
1041    #define B_REGBISD(b, i, s, d)   BYTE_PTR [b + i * s + d]
1042    
1043  /* Displaced Scaled Index: */  /* Displaced Scaled Index: */
1044  #define X_REGDIS(d, i, s)       tbyte ptr [i * s + d]  #define P_REGDIS(d, i, s)       [i * s + d]
1045  #define D_REGDIS(d, i, s)       qword ptr [i * s + d]  #define X_REGDIS(d, i, s)       TBYTE_PTR [i * s + d]
1046  #define L_REGDIS(d, i, s)       dword ptr [i * s + d]  #define D_REGDIS(d, i, s)       QWORD_PTR [i * s + d]
1047  #define W_REGDIS(d, i, s)       word ptr [i * s + d]  #define L_REGDIS(d, i, s)       DWORD_PTR [i * s + d]
1048  #define B_REGDIS(d, i, s)       byte ptr [i * s + d]  #define W_REGDIS(d, i, s)       WORD_PTR [i * s + d]
1049    #define B_REGDIS(d, i, s)       BYTE_PTR [i * s + d]
1050    
1051  /* Indexed Base: */  /* Indexed Base: */
1052  #define X_REGBI(b, i)   tbyte ptr [b + i]  #define P_REGBI(b, i)           [b + i]
1053  #define D_REGBI(b, i)   qword ptr [b + i]  #define X_REGBI(b, i)           TBYTE_PTR [b + i]
1054  #define L_REGBI(b, i)   dword ptr [b + i]  #define D_REGBI(b, i)           QWORD_PTR [b + i]
1055  #define W_REGBI(b, i)   word ptr [b + i]  #define L_REGBI(b, i)           DWORD_PTR [b + i]
1056  #define B_REGBI(b, i)   byte ptr [b + i]  #define W_REGBI(b, i)           WORD_PTR [b + i]
1057    #define B_REGBI(b, i)           BYTE_PTR [b + i]
1058    
1059  /* Displaced Base: */  /* Displaced Base: */
1060  #define X_REGDB(d, b)   tbyte ptr [b + d]  #define P_REGDB(d, b)           [b + d]
1061  #define D_REGDB(d, b)   qword ptr [b + d]  #define X_REGDB(d, b)           TBYTE_PTR [b + d]
1062  #define L_REGDB(d, b)   dword ptr [b + d]  #define D_REGDB(d, b)           QWORD_PTR [b + d]
1063  #define W_REGDB(d, b)   word ptr [b + d]  #define L_REGDB(d, b)           DWORD_PTR [b + d]
1064  #define B_REGDB(d, b)   byte ptr [b + d]  #define W_REGDB(d, b)           WORD_PTR [b + d]
1065    #define B_REGDB(d, b)           BYTE_PTR [b + d]
1066    
1067  /* Variable indirect: */  /* Variable indirect: */
1068  #define VARINDIRECT(var)        [var]  #define VARINDIRECT(var)        var
1069    
1070  /* Use register contents as jump/call target: */  /* Use register contents as jump/call target: */
1071  #define CODEPTR(reg)    [reg]  #define CODEPTR(reg)            reg
1072    
1073  /*  /*
1074   *      Redefine assembler commands   *      Redefine assembler commands
1075   */   */
1076    
1077    #define P_(a)                   P_ ## a
1078  #define X_(a)   X_ ## a  #define X_(a)   X_ ## a
1079  #define D_(a)   D_ ## a  #define D_(a)   D_ ## a
1080  #define S_(a)   L_ ## a  #define S_(a)   L_ ## a
# Line 935  Line 1125 
1125  #define CMPS_L          cmpsd  #define CMPS_L          cmpsd
1126  #define CMPS_W          cmpsw  #define CMPS_W          cmpsw
1127  #define CMPS_B          cmpsb  #define CMPS_B          cmpsb
1128    #define CPUID                   cpuid
1129  #define CWD             cwd  #define CWD             cwd
1130  #define CDQ             cdq  #define CDQ             cdq
1131  #define DAA             daa  #define DAA             daa
# Line 970  Line 1161 
1161  #define INTO            into  #define INTO            into
1162  #define IRET            iret  #define IRET            iret
1163  #define IRETD           iretd  #define IRETD           iretd
1164  #define JA(a)           ja a  #define JA(a)                   ja NEAR a
1165  #define JAE(a)          jae a  #define JAE(a)                  jae NEAR a
1166  #define JB(a)           jb a  #define JB(a)                   jb NEAR a
1167  #define JBE(a)          jbe a  #define JBE(a)                  jbe NEAR a
1168  #define JC(a)           jc a  #define JC(a)                   jc NEAR a
1169  #define JE(a)           je a  #define JE(a)                   je NEAR a
1170  #define JG(a)           jg a  #define JG(a)                   jg NEAR a
1171  #define JGE(a)          jge a  #define JGE(a)                  jge NEAR a
1172  #define JL(a)           jl a  #define JL(a)                   jl NEAR a
1173  #define JLE(a)          jle a  #define JLE(a)                  jle NEAR a
1174  #define JNA(a)          jna a  #define JNA(a)                  jna NEAR a
1175  #define JNAE(a)         jnae a  #define JNAE(a)                 jnae NEAR a
1176  #define JNB(a)          jnb a  #define JNB(a)                  jnb NEAR a
1177  #define JNBE(a)         jnbe a  #define JNBE(a)                 jnbe NEAR a
1178  #define JNC(a)          jnc a  #define JNC(a)                  jnc NEAR a
1179  #define JNE(a)          jne a  #define JNE(a)                  jne NEAR a
1180  #define JNG(a)          jng a  #define JNG(a)                  jng NEAR a
1181  #define JNGE(a)         jnge a  #define JNGE(a)                 jnge NEAR a
1182  #define JNL(a)          jnl a  #define JNL(a)                  jnl NEAR a
1183  #define JNLE(a)         jnle a  #define JNLE(a)                 jnle NEAR a
1184  #define JNO(a)          jno a  #define JNO(a)                  jno NEAR a
1185  #define JNP(a)          jnp a  #define JNP(a)                  jnp NEAR a
1186  #define JNS(a)          jns a  #define JNS(a)                  jns NEAR a
1187  #define JNZ(a)          jnz a  #define JNZ(a)                  jnz NEAR a
1188  #define JO(a)           jo a  #define JO(a)                   jo NEAR a
1189  #define JP(a)           jp a  #define JP(a)                   jp NEAR a
1190  #define JPE(a)          jpe a  #define JPE(a)                  jpe NEAR a
1191  #define JPO(a)          jpo a  #define JPO(a)                  jpo NEAR a
1192  #define JS(a)           js a  #define JS(a)                   js NEAR a
1193  #define JZ(a)           jz a  #define JZ(a)                   jz NEAR a
1194  #define JMP(a)          jmp a  #define JMP(a)          jmp a
1195  #define JMPF(s,a)       jmpf  #define JMPF(s,a)       jmpf
1196  #define LAHF            lahf  #define LAHF            lahf
1197  #define LAR(a, b)       lar b, a  #define LAR(a, b)       lar b, a
1198  #define LEA_L(a, b)     lea L_(b), L_(a)  #define LEA_L(a, b)             lea P_(b), P_(a)
1199  #define LEA_W(a, b)     lea W_(b), W_(a)  #define LEA_W(a, b)             lea P_(b), P_(a)
1200  #define LEAVE           leave  #define LEAVE           leave
1201  #define LGDT(a)         lgdt a  #define LGDT(a)         lgdt a
1202  #define LIDT(a)         lidt a  #define LIDT(a)         lidt a
# Line 1083  Line 1274 
1274  #define RCR_L(a, b)     rcr L_(b), L_(a)  #define RCR_L(a, b)     rcr L_(b), L_(a)
1275  #define RCR_W(a, b)     rcr W_(b), W_(a)  #define RCR_W(a, b)     rcr W_(b), W_(a)
1276  #define RCR_B(a, b)     rcr B_(b), B_(a)  #define RCR_B(a, b)     rcr B_(b), B_(a)
1277    #define RDTSC                   rdtsc
1278  #define ROL_L(a, b)     rol L_(b), L_(a)  #define ROL_L(a, b)     rol L_(b), L_(a)
1279  #define ROL_W(a, b)     rol W_(b), W_(a)  #define ROL_W(a, b)     rol W_(b), W_(a)
1280  #define ROL_B(a, b)     rol B_(b), B_(a)  #define ROL_B(a, b)     rol B_(b), B_(a)
# Line 1144  Line 1336 
1336  #define SHL_W(a, b)     shl W_(b), W_(a)  #define SHL_W(a, b)     shl W_(b), W_(a)
1337  #define SHL_B(a, b)     shl B_(b), B_(a)  #define SHL_B(a, b)     shl B_(b), B_(a)
1338  #define SHLD_L(a,b,c)   shld  #define SHLD_L(a,b,c)   shld
1339  #define SHLD2_L(a,b)    shld2 L_(b), L_(a)  #define SHLD2_L(a,b)            shld L_(b), L_(a)
1340  #define SHLD_W(a,b,c)   shld  #define SHLD_W(a,b,c)   shld
1341  #define SHLD2_W(a,b)    shld2 W_(b), W_(a)  #define SHLD2_W(a,b)            shld W_(b), W_(a)
1342  #define SHR_L(a, b)     shr L_(b), L_(a)  #define SHR_L(a, b)     shr L_(b), L_(a)
1343  #define SHR_W(a, b)     shr W_(b), W_(a)  #define SHR_W(a, b)     shr W_(b), W_(a)
1344  #define SHR_B(a, b)     shr B_(b), B_(a)  #define SHR_B(a, b)     shr B_(b), B_(a)
1345  #define SHRD_L(a,b,c)   shrd  #define SHRD_L(a,b,c)   shrd
1346  #define SHRD2_L(a,b)    shrd2 L_(b), L_(a)  #define SHRD2_L(a,b)            shrd L_(b), L_(a)
1347  #define SHRD_W(a,b,c)   shrd  #define SHRD_W(a,b,c)   shrd
1348  #define SHRD2_W(a,b)    shrd2 W_(b), W_(a)  #define SHRD2_W(a,b)            shrd W_(b), W_(a)
1349  #define SLDT(a)         sldt a  #define SLDT(a)         sldt a
1350  #define SMSW(a)         smsw a  #define SMSW(a)         smsw a
1351  #define STC             stc  #define STC             stc
# Line 1179  Line 1371 
1371  #define XOR_L(a, b)     xor L_(b), L_(a)  #define XOR_L(a, b)     xor L_(b), L_(a)
1372  #define XOR_W(a, b)     xor W_(b), W_(a)  #define XOR_W(a, b)     xor W_(b), W_(a)
1373  #define XOR_B(a, b)     xor B_(b), B_(a)  #define XOR_B(a, b)     xor B_(b), B_(a)
1374    
1375    
1376    /* Floating Point Instructions */
1377  #define F2XM1           f2xm1  #define F2XM1           f2xm1
1378  #define FABS            fabs  #define FABS            fabs
1379  #define FADD_D(a)       fadd D_(a)  #define FADD_D(a)       fadd D_(a)
1380  #define FADD_S(a)       fadd S_(a)  #define FADD_S(a)       fadd S_(a)
1381  #define FADD2(a, b)     fadd2 b, a  #define FADD2(a, b)             fadd b, a
1382  #define FADDP(a, b)     faddp b, a  #define FADDP(a, b)     faddp b, a
1383  #define FIADD_L(a)      fiadd L_(a)  #define FIADD_L(a)      fiadd L_(a)
1384  #define FIADD_W(a)      fiadd W_(a)  #define FIADD_W(a)      fiadd W_(a)
# Line 1203  Line 1398 
1398  #define FDECSTP         fdecstp  #define FDECSTP         fdecstp
1399  #define FDIV_D(a)       fdiv D_(a)  #define FDIV_D(a)       fdiv D_(a)
1400  #define FDIV_S(a)       fdiv S_(a)  #define FDIV_S(a)       fdiv S_(a)
1401  #define FDIV2(a, b)     fdiv2 b, a  #define FDIV2(a, b)             fdiv b, a
1402  #define FDIVP(a, b)     fdivp b, a  #define FDIVP(a, b)     fdivp b, a
1403  #define FIDIV_L(a)      fidiv L_(a)  #define FIDIV_L(a)      fidiv L_(a)
1404  #define FIDIV_W(a)      fidiv W_(a)  #define FIDIV_W(a)      fidiv W_(a)
1405  #define FDIVR_D(a)      fdivr D_(a)  #define FDIVR_D(a)      fdivr D_(a)
1406  #define FDIVR_S(a)      fdivr S_(a)  #define FDIVR_S(a)      fdivr S_(a)
1407  #define FDIVR2(a, b)    fdivr2 b, a  #define FDIVR2(a, b)            fdivr b, a
1408  #define FDIVRP(a, b)    fdivrp b, a  #define FDIVRP(a, b)    fdivrp b, a
1409  #define FIDIVR_L(a)     fidivr L_(a)  #define FIDIVR_L(a)     fidivr L_(a)
1410  #define FIDIVR_W(a)     fidivr W_(a)  #define FIDIVR_W(a)     fidivr W_(a)
# Line 1243  Line 1438 
1438  #define FLDENV(a)       fldenv a  #define FLDENV(a)       fldenv a
1439  #define FMUL_S(a)       fmul S_(a)  #define FMUL_S(a)       fmul S_(a)
1440  #define FMUL_D(a)       fmul D_(a)  #define FMUL_D(a)       fmul D_(a)
1441  #define FMUL2(a, b)     fmul2 b, a  #define FMUL2(a, b)             fmul b, a
1442  #define FMULP(a, b)     fmulp b, a  #define FMULP(a, b)     fmulp b, a
1443  #define FIMUL_L(a)      fimul L_(a)  #define FIMUL_L(a)      fimul L_(a)
1444  #define FIMUL_W(a)      fimul W_(a)  #define FIMUL_W(a)      fimul W_(a)
# Line 1265  Line 1460 
1460  #define FSTP_X(a)       fstp X_(a)  #define FSTP_X(a)       fstp X_(a)
1461  #define FSTP_D(a)       fstp D_(a)  #define FSTP_D(a)       fstp D_(a)
1462  #define FSTP_S(a)       fstp S_(a)  #define FSTP_S(a)       fstp S_(a)
1463    #define FSTP(a)                 fstp a
1464  #define FSTCW(a)        fstcw a  #define FSTCW(a)        fstcw a
1465  #define FNSTCW(a)       fnstcw a  #define FNSTCW(a)       fnstcw a
1466  #define FSTENV(a)       fstenv a  #define FSTENV(a)       fstenv a
# Line 1273  Line 1469 
1469  #define FNSTSW(a)       fnstsw a  #define FNSTSW(a)       fnstsw a
1470  #define FSUB_S(a)       fsub S_(a)  #define FSUB_S(a)       fsub S_(a)
1471  #define FSUB_D(a)       fsub D_(a)  #define FSUB_D(a)       fsub D_(a)
1472  #define FSUB2(a, b)     fsub2 b, a  #define FSUB2(a, b)             fsub b, a
1473  #define FSUBP(a, b)     fsubp b, a  #define FSUBP(a, b)     fsubp b, a
1474  #define FISUB_L(a)      fisub L_(a)  #define FISUB_L(a)      fisub L_(a)
1475  #define FISUB_W(a)      fisub W_(a)  #define FISUB_W(a)      fisub W_(a)
1476  #define FSUBR_S(a)      fsubr S_(a)  #define FSUBR_S(a)      fsubr S_(a)
1477  #define FSUBR_D(a)      fsubr D_(a)  #define FSUBR_D(a)      fsubr D_(a)
1478  #define FSUBR2(a, b)    fsubr2 b, a  #define FSUBR2(a, b)            fsubr b, a
1479  #define FSUBRP(a, b)    fsubrp b, a  #define FSUBRP(a, b)    fsubrp b, a
1480  #define FISUBR_L(a)     fisubr L_(a)  #define FISUBR_L(a)     fisubr L_(a)
1481  #define FISUBR_W(a)     fisubr W_(a)  #define FISUBR_W(a)     fisubr W_(a)
# Line 1294  Line 1490 
1490  #define FYL2X           fyl2x  #define FYL2X           fyl2x
1491  #define FYL2XP1         fyl2xp1  #define FYL2XP1         fyl2xp1
1492    
1493  #endif /* __ASSYNTAX_H__ */  #endif /* NASM_ASSEMBLER, MASM_ASSEMBLER */
1494    
1495            /****************************************/
1496            /*                                      */
1497            /*      Extensions to x86 insn set -    */
1498            /*      MMX, 3DNow!                     */
1499            /*                                      */
1500            /****************************************/
1501    
1502    #if defined(NASM_ASSEMBLER) || defined(MASM_ASSEMBLER)
1503    #define P_ARG1(a)               P_ ## a
1504    #define P_ARG2(a, b)            P_ ## b, P_ ## a
1505    #define P_ARG3(a, b, c)         P_ ## c, P_ ## b, P_ ## a
1506    #else
1507    #define P_ARG1(a)               a
1508    #define P_ARG2(a, b)            a, b
1509    #define P_ARG3(a, b, c)         a, b, c
1510    #endif
1511    
1512    /* MMX */
1513    #define MOVD(a, b)              movd P_ARG2(a, b)
1514    #define MOVQ(a, b)              movq P_ARG2(a, b)
1515    
1516    #define PADDB(a, b)             paddb P_ARG2(a, b)
1517    #define PADDW(a, b)             paddw P_ARG2(a, b)
1518    #define PADDD(a, b)             paddd P_ARG2(a, b)
1519    
1520    #define PADDSB(a, b)            paddsb P_ARG2(a, b)
1521    #define PADDSW(a, b)            paddsw P_ARG2(a, b)
1522    
1523    #define PADDUSB(a, b)           paddusb P_ARG2(a, b)
1524    #define PADDUSW(a, b)           paddusw P_ARG2(a, b)
1525    
1526    #define PSUBB(a, b)             psubb P_ARG2(a, b)
1527    #define PSUBW(a, b)             psubw P_ARG2(a, b)
1528    #define PSUBD(a, b)             psubd P_ARG2(a, b)
1529    
1530    #define PSUBSB(a, b)            psubsb P_ARG2(a, b)
1531    #define PSUBSW(a, b)            psubsw P_ARG2(a, b)
1532    
1533    #define PSUBUSB(a, b)           psubusb P_ARG2(a, b)
1534    #define PSUBUSW(a, b)           psubusw P_ARG2(a, b)
1535    
1536    #define PCMPEQB(a, b)           pcmpeqb P_ARG2(a, b)
1537    #define PCMPEQW(a, b)           pcmpeqw P_ARG2(a, b)
1538    #define PCMPEQD(a, b)           pcmpeqd P_ARG2(a, b)
1539    
1540    #define PCMPGTB(a, b)           pcmpgtb P_ARG2(a, b)
1541    #define PCMPGTW(a, b)           pcmpgtw P_ARG2(a, b)
1542    #define PCMPGTD(a, b)           pcmpgtd P_ARG2(a, b)
1543    
1544    #define PMULHW(a, b)            pmulhw P_ARG2(a, b)
1545    #define PMULLW(a, b)            pmullw P_ARG2(a, b)
1546    
1547    #define PMADDWD(a, b)           pmaddwd P_ARG2(a, b)
1548    
1549    #define PAND(a, b)              pand P_ARG2(a, b)
1550    
1551    #define PANDN(a, b)             pandn P_ARG2(a, b)
1552    
1553    #define POR(a, b)               por P_ARG2(a, b)
1554    
1555    #define PXOR(a, b)              pxor P_ARG2(a, b)
1556    
1557    #define PSRAW(a, b)             psraw P_ARG2(a, b)
1558    #define PSRAD(a, b)             psrad P_ARG2(a, b)
1559    
1560    #define PSRLW(a, b)             psrlw P_ARG2(a, b)
1561    #define PSRLD(a, b)             psrld P_ARG2(a, b)
1562    #define PSRLQ(a, b)             psrlq P_ARG2(a, b)
1563    
1564    #define PSLLW(a, b)             psllw P_ARG2(a, b)
1565    #define PSLLD(a, b)             pslld P_ARG2(a, b)
1566    #define PSLLQ(a, b)             psllq P_ARG2(a, b)
1567    
1568    #define PACKSSWB(a, b)          packsswb P_ARG2(a, b)
1569    #define PACKSSDW(a, b)          packssdw P_ARG2(a, b)
1570    #define PACKUSWB(a, b)          packuswb P_ARG2(a, b)
1571    
1572    #define PUNPCKHBW(a, b)         punpckhbw P_ARG2(a, b)
1573    #define PUNPCKHWD(a, b)         punpckhwd P_ARG2(a, b)
1574    #define PUNPCKHDQ(a, b)         punpckhdq P_ARG2(a, b)
1575    #define PUNPCKLBW(a, b)         punpcklbw P_ARG2(a, b)
1576    #define PUNPCKLWD(a, b)         punpcklwd P_ARG2(a, b)
1577    #define PUNPCKLDQ(a, b)         punpckldq P_ARG2(a, b)
1578    
1579    #define EMMS                    emms
1580    
1581    /* AMD 3DNow! */
1582    #define PAVGUSB(a, b)           pavgusb P_ARG2(a, b)
1583    #define PFADD(a, b)             pfadd P_ARG2(a, b)
1584    #define PFSUB(a, b)             pfsub P_ARG2(a, b)
1585    #define PFSUBR(a, b)            pfsubr P_ARG2(a, b)
1586    #define PFACC(a, b)             pfacc P_ARG2(a, b)
1587    #define PFCMPGE(a, b)           pfcmpge P_ARG2(a, b)
1588    #define PFCMPGT(a, b)           pfcmpgt P_ARG2(a, b)
1589    #define PFCMPEQ(a, b)           pfcmpeq P_ARG2(a, b)
1590    #define PFMIN(a, b)             pfmin P_ARG2(a, b)
1591    #define PFMAX(a, b)             pfmax P_ARG2(a, b)
1592    #define PI2FD(a, b)             pi2fd P_ARG2(a, b)
1593    #define PF2ID(a, b)             pf2id P_ARG2(a, b)
1594    #define PFRCP(a, b)             pfrcp P_ARG2(a, b)
1595    #define PFRSQRT(a, b)           pfrsqrt P_ARG2(a, b)
1596    #define PFMUL(a, b)             pfmul P_ARG2(a, b)
1597    #define PFRCPIT1(a, b)          pfrcpit1 P_ARG2(a, b)
1598    #define PFRSQIT1(a, b)          pfrsqit1 P_ARG2(a, b)
1599    #define PFRCPIT2(a, b)          pfrcpit2 P_ARG2(a, b)
1600    #define PMULHRW(a, b)           pmulhrw P_ARG2(a, b)
1601    
1602    #define FEMMS                   femms
1603    #define PREFETCH(a)             prefetch P_ARG1(a)
1604    #define PREFETCHW(a)            prefetchw P_ARG1(a)
1605    
1606    /* Intel SSE */
1607    #define ADDPS(a, b)             addps P_ARG2(a, b)
1608    #define ADDSS(a, b)             addss P_ARG2(a, b)
1609    #define ANDNPS(a, b)            andnps P_ARG2(a, b)
1610    #define ANDPS(a, b)             andps P_ARG2(a, b)
1611    /* NASM only knows the pseudo ops for these.
1612    #define CMPPS(a, b, c)          cmpps P_ARG3(a, b, c)
1613    #define CMPSS(a, b, c)          cmpss P_ARG3(a, b, c)
1614    */
1615    #define CMPEQPS(a, b)           cmpeqps P_ARG2(a, b)
1616    #define CMPLTPS(a, b)           cmpltps P_ARG2(a, b)
1617    #define CMPLEPS(a, b)           cmpleps P_ARG2(a, b)
1618    #define CMPUNORDPS(a, b)        cmpunordps P_ARG2(a, b)
1619    #define CMPNEQPS(a, b)          cmpneqps P_ARG2(a, b)
1620    #define CMPNLTPS(a, b)          cmpnltps P_ARG2(a, b)
1621    #define CMPNLEPS(a, b)          cmpnleps P_ARG2(a, b)
1622    #define CMPORDPS(a, b)          cmpordps P_ARG2(a, b)
1623    #define CMPEQSS(a, b)           cmpeqss P_ARG2(a, b)
1624    #define CMPLTSS(a, b)           cmpltss P_ARG2(a, b)
1625    #define CMPLESS(a, b)           cmpless P_ARG2(a, b)
1626    #define CMPUNORDSS(a, b)        cmpunordss P_ARG2(a, b)
1627    #define CMPNEQSS(a, b)          cmpneqss P_ARG2(a, b)
1628    #define CMPNLTSS(a, b)          cmpnltss P_ARG2(a, b)
1629    #define CMPNLESS(a, b)          cmpnless P_ARG2(a, b)
1630    #define CMPORDSS(a, b)          cmpordss P_ARG2(a, b)
1631    #define COMISS(a, b)            comiss P_ARG2(a, b)
1632    #define CVTPI2PS(a, b)          cvtpi2ps P_ARG2(a, b)
1633    #define CVTPS2PI(a, b)          cvtps2pi P_ARG2(a, b)
1634    #define CVTSI2SS(a, b)          cvtsi2ss P_ARG2(a, b)
1635    #define CVTSS2SI(a, b)          cvtss2si P_ARG2(a, b)
1636    #define CVTTPS2PI(a, b)         cvttps2pi P_ARG2(a, b)
1637    #define CVTTSS2SI(a, b)         cvttss2si P_ARG2(a, b)
1638    #define DIVPS(a, b)             divps P_ARG2(a, b)
1639    #define DIVSS(a, b)             divss P_ARG2(a, b)
1640    #define FXRSTOR(a)              fxrstor P_ARG1(a)
1641    #define FXSAVE(a)               fxsave P_ARG1(a)
1642    #define LDMXCSR(a)              ldmxcsr P_ARG1(a)
1643    #define MAXPS(a, b)             maxps P_ARG2(a, b)
1644    #define MAXSS(a, b)             maxss P_ARG2(a, b)
1645    #define MINPS(a, b)             minps P_ARG2(a, b)
1646    #define MINSS(a, b)             minss P_ARG2(a, b)
1647    #define MOVAPS(a, b)            movaps P_ARG2(a, b)
1648    #define MOVHLPS(a, b)           movhlps P_ARG2(a, b)
1649    #define MOVHPS(a, b)            movhps P_ARG2(a, b)
1650    #define MOVLHPS(a, b)           movlhps P_ARG2(a, b)
1651    #define MOVLPS(a, b)            movlps P_ARG2(a, b)
1652    #define MOVMSKPS(a, b)          movmskps P_ARG2(a, b)
1653    #define MOVNTPS(a, b)           movntps P_ARG2(a, b)
1654    #define MOVNTQ(a, b)            movntq P_ARG2(a, b)
1655    #define MOVSS(a, b)             movss P_ARG2(a, b)
1656    #define MOVUPS(a, b)            movups P_ARG2(a, b)
1657    #define MULPS(a, b)             mulps P_ARG2(a, b)
1658    #define MULSS(a, b)             mulss P_ARG2(a, b)
1659    #define ORPS(a, b)              orps P_ARG2(a, b)
1660    #define RCPPS(a, b)             rcpps P_ARG2(a, b)
1661    #define RCPSS(a, b)             rcpss P_ARG2(a, b)
1662    #define RSQRTPS(a, b)           rsqrtps P_ARG2(a, b)
1663    #define RSQRTSS(a, b)           rsqrtss P_ARG2(a, b)
1664    #define SHUFPS(a, b, c)         shufps P_ARG3(a, b, c)
1665    #define SQRTPS(a, b)            sqrtps P_ARG2(a, b)
1666    #define SQRTSS(a, b)            sqrtss P_ARG2(a, b)
1667    #define STMXCSR(a)              stmxcsr P_ARG1(a)
1668    #define SUBPS(a, b)             subps P_ARG2(a, b)
1669    #define UCOMISS(a, b)           ucomiss P_ARG2(a, b)
1670    #define UNPCKHPS(a, b)          unpckhps P_ARG2(a, b)
1671    #define UNPCKLPS(a, b)          unpcklps P_ARG2(a, b)
1672    #define XORPS(a, b)             xorps P_ARG2(a, b)
1673    
1674    #define PREFETCHNTA(a)          prefetchnta P_ARG1(a)
1675    #define PREFETCHT0(a)           prefetcht0 P_ARG1(a)
1676    #define PREFETCHT1(a)           prefetcht1 P_ARG1(a)
1677    #define PREFETCHT2(a)           prefetcht2 P_ARG1(a)
1678    #define SFENCE                  sfence
1679    
1680    /* Added by BrianP for FreeBSD (per David Dawes) */
1681    #if !defined(NASM_ASSEMBLER) && !defined(MASM_ASSEMBLER) && !defined(__bsdi__)
1682    #define LLBL(a)         CONCAT(.L,a)
1683    #else
1684    #define LLBL(a)         a
1685    #endif
1686    
1687    
1688    #endif /* __ASSYNTAX_H__ */

Legend:
Removed from v.651  
changed lines
  Added in v.1186

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0