string.isa (4952:2d7c40dd10bd) string.isa (5125:62bd932bcb0b)
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// Redistribution and use of this software in source and binary forms,
7// with or without modification, are permitted provided that the
8// following conditions are met:

--- 47 unchanged lines hidden (view full) ---

56// Authors: Gabe Black
57
58//////////////////////////////////////////////////////////////////////////
59//
60// String Instructions
61//
62//////////////////////////////////////////////////////////////////////////
63
1// -*- mode:c++ -*-
2
3// Copyright (c) 2007 The Hewlett-Packard Development Company
4// All rights reserved.
5//
6// Redistribution and use of this software in source and binary forms,
7// with or without modification, are permitted provided that the
8// following conditions are met:

--- 47 unchanged lines hidden (view full) ---

56// Authors: Gabe Black
57
58//////////////////////////////////////////////////////////////////////////
59//
60// String Instructions
61//
62//////////////////////////////////////////////////////////////////////////
63
64def format StringInst(*opTypeSet) {{
64def format StringTestInst(*opTypeSet) {{
65 allBlocks = OutputBlocks()
66
67 regBlocks = specializeInst(Name, list(opTypeSet), EmulEnv())
68 eBlocks = specializeInst(Name + "_E", list(opTypeSet), EmulEnv())
69 nBlocks = specializeInst(Name + "_N", list(opTypeSet), EmulEnv())
70
71 for blocks in (regBlocks, eBlocks, nBlocks):
72 allBlocks.header_output += blocks.header_output

--- 8 unchanged lines hidden (view full) ---

81 } else {
82 %s
83 }
84 ''' % (eBlocks.decode_block, nBlocks.decode_block, regBlocks.decode_block)
85
86 (header_output, decoder_output,
87 decode_block, exec_output) = allBlocks.makeList()
88}};
65 allBlocks = OutputBlocks()
66
67 regBlocks = specializeInst(Name, list(opTypeSet), EmulEnv())
68 eBlocks = specializeInst(Name + "_E", list(opTypeSet), EmulEnv())
69 nBlocks = specializeInst(Name + "_N", list(opTypeSet), EmulEnv())
70
71 for blocks in (regBlocks, eBlocks, nBlocks):
72 allBlocks.header_output += blocks.header_output

--- 8 unchanged lines hidden (view full) ---

81 } else {
82 %s
83 }
84 ''' % (eBlocks.decode_block, nBlocks.decode_block, regBlocks.decode_block)
85
86 (header_output, decoder_output,
87 decode_block, exec_output) = allBlocks.makeList()
88}};
89
90def format StringInst(*opTypeSet) {{
91 allBlocks = OutputBlocks()
92
93 regBlocks = specializeInst(Name, list(opTypeSet), EmulEnv())
94 eBlocks = specializeInst(Name + "_E", list(opTypeSet), EmulEnv())
95
96 for blocks in (regBlocks, eBlocks):
97 allBlocks.header_output += blocks.header_output
98 allBlocks.decoder_output += blocks.decoder_output
99 allBlocks.exec_output += blocks.exec_output
100
101 allBlocks.decode_block = '''
102 if (LEGACY_REP) {
103 %s
104 } else if (LEGACY_REPNE) {
105 // The repne prefix is illegal
106 return new MicroFault(machInst, "illprefix", new InvalidOpcode);
107 } else {
108 %s
109 }
110 ''' % (eBlocks.decode_block, regBlocks.decode_block)
111
112 (header_output, decoder_output,
113 decode_block, exec_output) = allBlocks.makeList()
114}};