OLD | NEW |
1 #!/usr/bin/python | 1 #!/usr/bin/python |
2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. | 2 # Copyright (c) 2012 The Native Client Authors. All rights reserved. |
3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
5 | 5 |
6 import collections | 6 import collections |
7 import copy | 7 import copy |
8 import itertools | 8 import itertools |
9 import optparse | 9 import optparse |
10 import re | 10 import re |
(...skipping 988 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
999 if not instruction.HasOpcodeInsteadOfImmediate(): | 999 if not instruction.HasOpcodeInsteadOfImmediate(): |
1000 self._PrintSignature(instruction) | 1000 self._PrintSignature(instruction) |
1001 self._PrintDetachedOperandSources(instruction) | 1001 self._PrintDetachedOperandSources(instruction) |
1002 | 1002 |
1003 self._PrintModRMOperandSources(instruction) | 1003 self._PrintModRMOperandSources(instruction) |
1004 | 1004 |
1005 self._out.write(' any* &\n') | 1005 self._out.write(' any* &\n') |
1006 self._out.write(address_mode.mode) | 1006 self._out.write(address_mode.mode) |
1007 if self._mode == VALIDATOR and self._bitness == 64: | 1007 if self._mode == VALIDATOR and self._bitness == 64: |
1008 if Attribute('no_memory_access') not in instruction.attributes: | 1008 if Attribute('no_memory_access') not in instruction.attributes: |
1009 self._out.write(' @check_access') | 1009 self._out.write(' @check_memory_access') |
1010 self._out.write(')\n') | 1010 self._out.write(')\n') |
1011 | 1011 |
1012 if instruction.HasOpcodeInsteadOfImmediate(): | 1012 if instruction.HasOpcodeInsteadOfImmediate(): |
1013 assert instruction.opcodes[-2] == '/' | 1013 assert instruction.opcodes[-2] == '/' |
1014 self._out.write('%s\n' % instruction.opcodes[-1]) | 1014 self._out.write('%s\n' % instruction.opcodes[-1]) |
1015 if self._mode == VALIDATOR: | 1015 if self._mode == VALIDATOR: |
1016 self._out.write('@last_byte_is_not_immediate\n') | 1016 self._out.write('@last_byte_is_not_immediate\n') |
1017 self._PrintSignature(instruction) | 1017 self._PrintSignature(instruction) |
1018 self._PrintDetachedOperandSources(instruction) | 1018 self._PrintDetachedOperandSources(instruction) |
1019 | 1019 |
(...skipping 422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1442 continue | 1442 continue |
1443 if (options.bitness == 64 and | 1443 if (options.bitness == 64 and |
1444 Attribute('nacl-amd64-forbidden') in instruction.attributes): | 1444 Attribute('nacl-amd64-forbidden') in instruction.attributes): |
1445 continue | 1445 continue |
1446 | 1446 |
1447 # TODO(shcherbina): Remove it once compilation time problem | 1447 # TODO(shcherbina): Remove it once compilation time problem |
1448 # (https://code.google.com/p/nativeclient/issues/detail?id=3327) | 1448 # (https://code.google.com/p/nativeclient/issues/detail?id=3327) |
1449 # is resolved. | 1449 # is resolved. |
1450 if Attribute('CPUFeature_AVX') in instruction.attributes: | 1450 if Attribute('CPUFeature_AVX') in instruction.attributes: |
1451 continue | 1451 continue |
| 1452 if Attribute('CPUFeature_FMA') in instruction.attributes: |
| 1453 continue |
| 1454 if Attribute('CPUFeature_FMA4') in instruction.attributes: |
| 1455 continue |
1452 if Attribute('CPUFeature_XOP') in instruction.attributes: | 1456 if Attribute('CPUFeature_XOP') in instruction.attributes: |
1453 continue | 1457 continue |
1454 | 1458 |
1455 instruction_names.add((instruction.GetNameAsIdentifier(), | 1459 instruction_names.add((instruction.GetNameAsIdentifier(), |
1456 instruction.name)) | 1460 instruction.name)) |
1457 | 1461 |
1458 instructions = [instruction] | 1462 instructions = [instruction] |
1459 instructions = sum(map(SplitRM, instructions), []) | 1463 instructions = sum(map(SplitRM, instructions), []) |
1460 instructions = sum(map(SplitByteNonByte, instructions), []) | 1464 instructions = sum(map(SplitByteNonByte, instructions), []) |
1461 instructions = sum([SplitVYZ(options.bitness, instr) | 1465 instructions = sum([SplitVYZ(options.bitness, instr) |
(...skipping 15 matching lines...) Expand all Loading... |
1477 | 1481 |
1478 print ' one_instruction = ' | 1482 print ' one_instruction = ' |
1479 print '|\n'.join(printed_instrs) | 1483 print '|\n'.join(printed_instrs) |
1480 | 1484 |
1481 print ' ;' | 1485 print ' ;' |
1482 print '}%%' | 1486 print '}%%' |
1483 | 1487 |
1484 | 1488 |
1485 if __name__ == '__main__': | 1489 if __name__ == '__main__': |
1486 main() | 1490 main() |
OLD | NEW |