]> Zhao Yanbai Git Server - minix.git/commitdiff
New instructions in gas2ack
authorTomas Hruby <tom@minix3.org>
Mon, 16 Nov 2009 21:32:48 +0000 (21:32 +0000)
committerTomas Hruby <tom@minix3.org>
Mon, 16 Nov 2009 21:32:48 +0000 (21:32 +0000)
pause
mfence
rdtsc
rdpmc

commands/i386/gas2ack/asm86.h
commands/i386/gas2ack/emit_ack.c
commands/i386/gas2ack/parse_gnu.c

index 499413312d274a8d08645c69e978db9cf1bdf458..52afc6917c6d22c84c1243a582fcdb310cf10c32 100644 (file)
@@ -129,6 +129,7 @@ typedef enum opcode {       /* 80486 opcodes, from the i486 reference manual.
        LOOP,   LOOPE,  LOOPNE,
        LSL,
        LTR,
+       MFENCE,
        MOV,
        MOVS,
        MOVSX,
@@ -142,6 +143,7 @@ typedef enum opcode {       /* 80486 opcodes, from the i486 reference manual.
        OR,
        OUT,
        OUTS,
+       PAUSE,
        POP,
        POPA,
        POPAD,
@@ -151,8 +153,10 @@ typedef enum opcode {      /* 80486 opcodes, from the i486 reference manual.
        PUSHAD,
        PUSHF,
        RCL,    RCR,    ROL,    ROR,
-       RET,    RETF,                   /* RETF added */
        RDMSR,
+       RDPMC,
+       RDTSC,
+       RET,    RETF,                   /* RETF added */
        SAHF,
        SAL,    SAR,    SHL,    SHR,
        SBB,
index 8b97d66c192d5db37a440aa6bfcedb087c18a97f..3082cc78936533a46f31f5307beffda8d4051578 100644 (file)
@@ -224,6 +224,7 @@ static mnemonic_t mnemtab[] = {
        { LSL,          "lsl"           },
        { LSS,          "lss"           },
        { LTR,          "ltr"           },
+       { MFENCE,       ".data1 0x0f, 0xae, 0x0f"},
        { MOV,          "mov%"          },
        { MOVS,         "movs%"         },
        { MOVSX,        "movsx"         },
@@ -237,6 +238,7 @@ static mnemonic_t mnemtab[] = {
        { OR,           "or%"           },
        { OUT,          "out%"          },
        { OUTS,         "outs%"         },
+       { PAUSE,        ".data1 0xf3, 0x90"},
        { POP,          "pop"           },
        { POPA,         "popa"          },
        { POPAD,        "popad"         },
@@ -249,7 +251,9 @@ static mnemonic_t mnemtab[] = {
        { RCR,          "rcr%"          },
        { RET,          "ret"           },
        { RETF,         "retf"          },
-       { RDMSR,        "rdmsr"         },
+       { RDMSR,        ".data1 0x0f, 0x32"},
+       { RDPMC,        ".data1 0x0f, 0x33"},
+       { RDTSC,        ".data1 0x0f, 0x31"},
        { ROL,          "rol%"          },
        { ROR,          "ror%"          },
        { SAHF,         "sahf"          },
@@ -292,7 +296,7 @@ static mnemonic_t mnemtab[] = {
        { VERW,         "verw"          },
        { WAIT,         "wait"          },
        { WBINVD,       "wbinvd"        },
-       { WRMSR,        "wrmsr"         },
+       { WRMSR,        ".data1 0x0f, 0x30"},
        { XADD,         "xadd"          },
        { XCHG,         "xchg%"         },
        { XLAT,         "xlat"          },
@@ -607,14 +611,6 @@ void ack_emit_instruction(asm86_t *a)
                                return;
                        }
                }
-               if (a->opcode == RDMSR) {
-                       ack_printf(".data1 0x0f, 0x32\n");
-                       return;
-               }
-               if (a->opcode == WRMSR) {
-                       ack_printf(".data1 0x0f, 0x30\n");
-                       return;
-               }
                /* we are translating from GNU */
                if (a->args && a->args->operator == ','
                                /* don't swap ljmp prefixed with segment */
index 3c2674265eeb828b9e6d0f9a35d51e1d0818d1ea..295cf9cb58093731539506b68738620bf27b6e47 100644 (file)
@@ -282,6 +282,7 @@ static mnemonic_t mnemtab[] = {                     /* This array is sorted. */
        { "lsl",        LSL,            WORD },
        { "lss",        LSS,            WORD },
        { "ltr",        LTR,            WORD },
+       { "mfence",     MFENCE,         WORD },
        { "movb",       MOV,            BYTE },
        { "movl",       MOV,            WORD },
        { "movsb",      MOVS,           BYTE },
@@ -313,6 +314,7 @@ static mnemonic_t mnemtab[] = {                     /* This array is sorted. */
        { "outsl",      OUTS,           WORD },
        { "outsw",      OUTS,           OWORD },
        { "outw",       OUT,            OWORD },
+       { "pause",      PAUSE,          WORD },
        { "pop",        POP,            WORD },
        { "popa",       POPA,           WORD },
        { "popal",      POPAD,          WORD },
@@ -332,9 +334,11 @@ static mnemonic_t mnemtab[] = {                    /* This array is sorted. */
        { "rcrb",       RCR,            BYTE },
        { "rcrl",       RCR,            WORD },
        { "rcrw",       RCR,            OWORD },
+       { "rdmsr",      RDMSR,          WORD },
+       { "rdpmc",      RDPMC,          WORD },
+       { "rdtsc",      RDTSC,          WORD },
        { "ret",        RET,            JUMP },
        { "retf",       RETF,           JUMP },
-       { "rdmsr",      RDMSR,          WORD },
        { "rolb",       ROL,            BYTE },
        { "roll",       ROL,            WORD },
        { "rolw",       ROL,            OWORD },