1 This directory tests the x86-32 instruction decoder and instruction
2 validator. It does so using (human readable) text files.
4 Note: The .dis files correspond to using the (new) 32-bit full
5 decoder. By looking at the corresponding outputs, it is clear that the
6 full decoder needs work. See
7 http://code.google.com/p/nativeclient/issues/detail?id=2171 for
8 corresponding issue that has already been filed.
10 For a test FOO, the following files are defined:
14 Textual file defining the sequence of hexidecimal bytes in the code
15 segment for testing. Comments on what the code segment is intended
16 to test are at the top of the file, and begin with a pound (#)
19 By default, the starting program counter is at 0. If you want it at
20 a different place, make the first non-comment line of the form
21 '@XXX' where XXX should be used as the starting program counter.
25 Output generated by the full instruction decoder for the
26 corresponding FOO.hex file.
28 Note: This file is generated by running:
30 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
31 --full_decoder --hex_text=- < FOO.hex
35 Output generated by the corresponding (x86-32) validator
36 instruction decoder for the corresponding FOO.hex file.
38 Note: This file is generated by running:
40 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
41 --validator_decoder --hex_text=- < FOO.hex
45 Output generated by the x86-32 (segment based) validator for the
46 corresponding FOO.hex file. Jump errors are summarized as in
49 Note: This file is generated by running:
51 > scons-out/.../obj/src/trusted/validator_x86/ncval \
52 --hex_text=- --max_errors=-1 --detailed=false \
53 --alignment=32 --cpuid-all < FOO.hex
57 Output generated by the x86-32 (segment based) validator for the
58 corresponding FOO.hex file. Assumes that the block size is 16 bytes
59 instead of 32. Jump errors are summarized as in sel_ldr.
61 Note: This file is generated by running:
63 > scons-out/.../obj/src/trusted/validator_x86/ncval \
64 --hex_text=- --max_errors=-1 --detailed=false \
65 --alignment=16 --cpuid-all < FOO.hex
69 Output generated by the x86-32 (segment based) validator for the
70 corresponding FOO.hex file. Adds summary information. Jump errors
71 are summarized as in sel_ldr.
73 Note: This file is generated by running:
75 > scons-out/.../obj/src/trusted/validator_x86/ncval \
76 --hex_text=- --max_errors=-1 --stats \
77 --alignment=32 --detailed=false --cpuid-all < FOO.hex
81 Output generated by the x86-32 (segment based) validator for the
82 corresponding FOO.hex file. Adds summary information, as well as
83 assume that the block size is 16 bytes instead of 32. Jump errors
84 are summarized as in sel_ldr.
86 Note: This file is generated by running:
88 > scons-out/.../obj/src/trusted/validator_x86/ncval \
89 --hex_text=- --max_errors=-1 --stats \
90 --alignment=16 --detailed=false --cpuid-all < FOO.hex
94 Output generated by the x86-32 (segment based) validator for the
95 corresponding FOO.hex file. Jump errors are detailed, describing
96 each (individual) jump instruction that violates the jump criteria
99 Note: This file is generated by running:
101 > scons-out/.../obj/src/trusted/validator_x86/ncval \
102 --hex_text=- --max_errors=-1 --alignment=32 \
103 --detailed --cpuid-all < FOO.hex
107 Output generated by the x86-32 (segment based) validator for the
108 corresponding FOO.hex file. Assumes that the block size is 16 bytes
109 instead of 32. Jump errors are detailed, describing each
110 (individual) jump instruction that violates the jump criteria of
113 Note: This file is generated by running:
115 > scons-out/.../obj/src/trusted/validator_x86/ncval \
116 --hex_text=- --max_errors=-1 --alignment=16 \
117 --detailed --cpuid-all < FOO.hex
121 Output generated by the x86-32 (segment based) validator for the
122 corresponding FOO.hex file. Adds summary information. Jump errors
125 Note: This file is generated by running:
127 > scons-out/.../obj/src/trusted/validator_x86/ncval \
128 --hex_text=- --max_errors=-1 --stats --alignment=32 \
129 --detailed --cpuid--all < FOO.hex
133 Output generated by the x86-32 (segment based) validator for the
134 corresponding FOO.hex file. Adds summary information, as well as
135 assume that the block size is 16 bytes instead of 32. Jump errors
136 are detailed, describing each (individual) jump instruction that
137 violates the jump criteria of native client.
139 Note: This file is generated by running:
141 > scons-out/.../obj/src/trusted/validator_x86/ncval \
142 --hex_text=- --max_errors=-1 --stats --alignment=16 \
143 --detailed --cpuid-all < FOO.hex
147 Run the installed instruction decoder and validator on the
148 predefined compiled NACL executable FOO.nexe.
150 In addition, the following non-unit tests are run:
154 Self documenting file for the instruction decoder, assuming ncdis
155 was run on each instruction specified in the input file. It is
156 based on using the full decoder.
158 Note: This input matches the generated output (i.e. self
159 documenting) by running:
161 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
162 --self_document --full_decoder --commands=- \
167 Self documenting file for the instruction decoder, assuming ncdis
168 was run on each insruction specified in the input file. It is based
169 on the validator decoder.
171 Note: This input matches the generated output (i.e. self
172 documenting) by running:
174 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
175 --self_document --validator_decoder --commands=-
180 Output generated by the instruction decoder, generated from the
181 input file ncdis_FOO.input. After each printed instruction, the
182 internal form of the matched instruction, and the corresponding
183 expression tree is also printed.
185 Uses the full decoder of ncdis to decode the instruction.
187 Note: This file is generated by running:
189 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
190 --internal --full_decoder --commands=- \
191 < ncdis_iter_test.input
195 Output generated by the instruction decoder, generated from the
196 input file ncdis_FOO.input.
198 Uses the validator decoder of ncdis to decode the instruction.
200 Note: This file is generated by running:
202 > scons-out/.../obj/src/trusted/validator_x86/ncdis \
203 --internal --validator_decoder --commands=- \
208 Automatically generated text describing the instruction set that
209 the full decoder understands.
211 Note: This file is generated by running:
213 > scons-out/.../obj/src/trusted/validator_x86/ncdecode_tablegen \