OLD | NEW |
1 // Copyright 2011 the V8 project authors. All rights reserved. | 1 // Copyright 2011 the V8 project authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #include <assert.h> | 5 #include <assert.h> |
6 #include <stdarg.h> | 6 #include <stdarg.h> |
7 #include <stdio.h> | 7 #include <stdio.h> |
8 | 8 |
9 #if V8_TARGET_ARCH_IA32 | 9 #if V8_TARGET_ARCH_IA32 |
10 | 10 |
11 #include "src/base/compiler-specific.h" | 11 #include "src/base/compiler-specific.h" |
12 #include "src/disasm.h" | 12 #include "src/disasm.h" |
| 13 #include "src/ia32/sse-instr.h" |
13 | 14 |
14 namespace disasm { | 15 namespace disasm { |
15 | 16 |
16 enum OperandOrder { | 17 enum OperandOrder { |
17 UNSET_OP_ORDER = 0, | 18 UNSET_OP_ORDER = 0, |
18 REG_OPER_OP_ORDER, | 19 REG_OPER_OP_ORDER, |
19 OPER_REG_OP_ORDER | 20 OPER_REG_OP_ORDER |
20 }; | 21 }; |
21 | 22 |
22 | 23 |
(...skipping 972 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
995 case 0x54: | 996 case 0x54: |
996 AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop), | 997 AppendToBuffer("vandpd %s,%s,", NameOfXMMRegister(regop), |
997 NameOfXMMRegister(vvvv)); | 998 NameOfXMMRegister(vvvv)); |
998 current += PrintRightXMMOperand(current); | 999 current += PrintRightXMMOperand(current); |
999 break; | 1000 break; |
1000 case 0x57: | 1001 case 0x57: |
1001 AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop), | 1002 AppendToBuffer("vxorpd %s,%s,", NameOfXMMRegister(regop), |
1002 NameOfXMMRegister(vvvv)); | 1003 NameOfXMMRegister(vvvv)); |
1003 current += PrintRightXMMOperand(current); | 1004 current += PrintRightXMMOperand(current); |
1004 break; | 1005 break; |
| 1006 #define DECLARE_SSE_AVX_DIS_CASE(instruction, notUsed1, notUsed2, opcode) \ |
| 1007 case 0x##opcode: { \ |
| 1008 AppendToBuffer("v" #instruction " %s,%s,", NameOfXMMRegister(regop), \ |
| 1009 NameOfXMMRegister(vvvv)); \ |
| 1010 current += PrintRightXMMOperand(current); \ |
| 1011 break; \ |
| 1012 } |
| 1013 |
| 1014 SSE2_INSTRUCTION_LIST(DECLARE_SSE_AVX_DIS_CASE) |
| 1015 #undef DECLARE_SSE_AVX_DIS_CASE |
1005 default: | 1016 default: |
1006 UnimplementedInstruction(); | 1017 UnimplementedInstruction(); |
1007 } | 1018 } |
1008 } else { | 1019 } else { |
1009 UnimplementedInstruction(); | 1020 UnimplementedInstruction(); |
1010 } | 1021 } |
1011 | 1022 |
1012 return static_cast<int>(current - data); | 1023 return static_cast<int>(current - data); |
1013 } | 1024 } |
1014 | 1025 |
(...skipping 907 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1922 NameOfXMMRegister(rm)); | 1933 NameOfXMMRegister(rm)); |
1923 data++; | 1934 data++; |
1924 } else if (*data == 0xEB) { | 1935 } else if (*data == 0xEB) { |
1925 data++; | 1936 data++; |
1926 int mod, regop, rm; | 1937 int mod, regop, rm; |
1927 get_modrm(*data, &mod, ®op, &rm); | 1938 get_modrm(*data, &mod, ®op, &rm); |
1928 AppendToBuffer("por %s,%s", | 1939 AppendToBuffer("por %s,%s", |
1929 NameOfXMMRegister(regop), | 1940 NameOfXMMRegister(regop), |
1930 NameOfXMMRegister(rm)); | 1941 NameOfXMMRegister(rm)); |
1931 data++; | 1942 data++; |
| 1943 } else if (*data == 0xFA) { |
| 1944 data++; |
| 1945 int mod, regop, rm; |
| 1946 get_modrm(*data, &mod, ®op, &rm); |
| 1947 AppendToBuffer("psubd %s,", NameOfXMMRegister(regop)); |
| 1948 data += PrintRightXMMOperand(data); |
| 1949 } else if (*data == 0xFE) { |
| 1950 data++; |
| 1951 int mod, regop, rm; |
| 1952 get_modrm(*data, &mod, ®op, &rm); |
| 1953 AppendToBuffer("paddd %s,", NameOfXMMRegister(regop)); |
| 1954 data += PrintRightXMMOperand(data); |
1932 } else if (*data == 0xB1) { | 1955 } else if (*data == 0xB1) { |
1933 data++; | 1956 data++; |
1934 data += PrintOperands("cmpxchg_w", OPER_REG_OP_ORDER, data); | 1957 data += PrintOperands("cmpxchg_w", OPER_REG_OP_ORDER, data); |
1935 } else { | 1958 } else { |
1936 UnimplementedInstruction(); | 1959 UnimplementedInstruction(); |
1937 } | 1960 } |
1938 } else { | 1961 } else { |
1939 UnimplementedInstruction(); | 1962 UnimplementedInstruction(); |
1940 } | 1963 } |
1941 break; | 1964 break; |
(...skipping 393 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
2335 fprintf(f, " "); | 2358 fprintf(f, " "); |
2336 } | 2359 } |
2337 fprintf(f, " %s\n", buffer.start()); | 2360 fprintf(f, " %s\n", buffer.start()); |
2338 } | 2361 } |
2339 } | 2362 } |
2340 | 2363 |
2341 | 2364 |
2342 } // namespace disasm | 2365 } // namespace disasm |
2343 | 2366 |
2344 #endif // V8_TARGET_ARCH_IA32 | 2367 #endif // V8_TARGET_ARCH_IA32 |
OLD | NEW |