~ubuntu-branches/ubuntu/trusty/libv8/trusty

« back to all changes in this revision

Viewing changes to src/x64/disasm-x64.cc

  • Committer: Bazaar Package Importer
  • Author(s): Jérémy Lal
  • Date: 2010-06-17 00:06:53 UTC
  • mfrom: (1.2.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100617000653-9tg3xdjru39y3nhm
Tags: 2.2.18-1
* New upstream release, followed the procedure of README.source to update. 
* Drops 0005-constraints-visibility.patch (applied upstream).

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
30
#include <stdarg.h>
31
31
 
32
32
#include "v8.h"
 
33
 
 
34
#if defined(V8_TARGET_ARCH_X64)
 
35
 
33
36
#include "disasm.h"
34
37
 
35
38
namespace disasm {
996
999
  if (operand_size_ == 0x66) {
997
1000
    // 0x66 0x0F prefix.
998
1001
    int mod, regop, rm;
999
 
    get_modrm(*current, &mod, &regop, &rm);
1000
 
    if (opcode == 0x6E) {
1001
 
      AppendToBuffer("movd %s,", NameOfXMMRegister(regop));
1002
 
      current += PrintRightOperand(current);
 
1002
    if (opcode == 0x3A) {
 
1003
      byte third_byte = *current;
 
1004
      current = data + 3;
 
1005
      if (third_byte == 0x17) {
 
1006
        get_modrm(*current, &mod, &regop, &rm);
 
1007
        AppendToBuffer("extractps ");  // reg/m32, xmm, imm8
 
1008
        current += PrintRightOperand(current);
 
1009
        AppendToBuffer(", %s, %d", NameOfCPURegister(regop), (*current) & 3);
 
1010
        current += 1;
 
1011
      } else {
 
1012
        UnimplementedInstruction();
 
1013
      }
1003
1014
    } else {
1004
 
      const char* mnemonic = "?";
1005
 
      if (opcode == 0x57) {
1006
 
        mnemonic = "xorpd";
1007
 
      } else if (opcode == 0x2E) {
1008
 
        mnemonic = "comisd";
1009
 
      } else if (opcode == 0x2F) {
1010
 
        mnemonic = "ucomisd";
 
1015
      get_modrm(*current, &mod, &regop, &rm);
 
1016
      if (opcode == 0x6E) {
 
1017
        AppendToBuffer("mov%c %s,",
 
1018
                       rex_w() ? 'q' : 'd',
 
1019
                       NameOfXMMRegister(regop));
 
1020
        current += PrintRightOperand(current);
 
1021
      } else if (opcode == 0x7E) {
 
1022
        AppendToBuffer("mov%c %s,",
 
1023
                       rex_w() ? 'q' : 'd',
 
1024
                       NameOfCPURegister(regop));
 
1025
        current += PrintRightXMMOperand(current);
1011
1026
      } else {
1012
 
        UnimplementedInstruction();
 
1027
        const char* mnemonic = "?";
 
1028
        if (opcode == 0x57) {
 
1029
          mnemonic = "xorpd";
 
1030
        } else if (opcode == 0x2E) {
 
1031
          mnemonic = "comisd";
 
1032
        } else if (opcode == 0x2F) {
 
1033
          mnemonic = "ucomisd";
 
1034
        } else {
 
1035
          UnimplementedInstruction();
 
1036
        }
 
1037
        AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
 
1038
        current += PrintRightXMMOperand(current);
1013
1039
      }
1014
 
      AppendToBuffer("%s %s,", mnemonic, NameOfXMMRegister(regop));
1015
 
      current += PrintRightXMMOperand(current);
1016
1040
    }
1017
1041
  } else if (group_1_prefix_ == 0xF2) {
1018
1042
    // Beginning of instructions with prefix 0xF2.
1650
1674
}
1651
1675
 
1652
1676
}  // namespace disasm
 
1677
 
 
1678
#endif  // V8_TARGET_ARCH_X64