Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(166)

Side by Side Diff: src/trusted/validator_ragel/gen_dfa.py

Issue 1234393005: A mechanism to identify/forbid/"rewrite" non-temporal instructions (and other) (Closed) Base URL: https://chromium.googlesource.com/native_client/src/native_client.git@master
Patch Set: Fixing nits Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 626 matching lines...) Expand 10 before | Expand all | Expand 10 after
637 (operand.index, operand.GetFormat(self._bitness))) 637 (operand.index, operand.GetFormat(self._bitness)))
638 638
639 for attr in instruction.attributes: 639 for attr in instruction.attributes:
640 if attr.startswith('CPUFeature_'): 640 if attr.startswith('CPUFeature_'):
641 self._out.write('@%s\n' % attr) 641 self._out.write('@%s\n' % attr)
642 642
643 if self._mode == VALIDATOR and self._bitness == 64: 643 if self._mode == VALIDATOR and self._bitness == 64:
644 if Attribute('nacl-amd64-modifiable') in instruction.attributes: 644 if Attribute('nacl-amd64-modifiable') in instruction.attributes:
645 self._out.write('@modifiable_instruction\n') 645 self._out.write('@modifiable_instruction\n')
646 646
647 if self._mode == VALIDATOR:
648 if Attribute('nacl-unsupported') in instruction.attributes:
649 self._out.write('@unsupported_instruction\n')
650
647 def _NeedOperandInfo(self, operand): 651 def _NeedOperandInfo(self, operand):
648 """Whether we need to print actions describing operand format and source.""" 652 """Whether we need to print actions describing operand format and source."""
649 if self._mode == DECODER: 653 if self._mode == DECODER:
650 return True 654 return True
651 655
652 if self._bitness == 32: 656 if self._bitness == 32:
653 return False 657 return False
654 658
655 # In 64-bit validator we only care about general purpose registers we 659 # In 64-bit validator we only care about general purpose registers we
656 # are writing to. 660 # are writing to.
(...skipping 836 matching lines...) Expand 10 before | Expand all | Expand 10 after
1493 1497
1494 print ' one_instruction = ' 1498 print ' one_instruction = '
1495 print '|\n'.join(printed_instrs) 1499 print '|\n'.join(printed_instrs)
1496 1500
1497 print ' ;' 1501 print ' ;'
1498 print '}%%' 1502 print '}%%'
1499 1503
1500 1504
1501 if __name__ == '__main__': 1505 if __name__ == '__main__':
1502 main() 1506 main()
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698