Commit f57fbc7
committed
Omit reserved DXIL ops from OpCode enum
This change excludes reserved ops from DXIL::OpCode enum, so they don't need a unique name. They should never be referenced, so this makes that using them basically impossible. The reserved values will be listed in a comment at the end of the enum, before NumOpCodes. Catch and reject reserved opcodes during validation.
Since the OpCodeProperty table entries corresponding to their opcode must still be occupied due to the way ops are looked up by indexing the table, there's a new single ReservedOpCodeProps value, with opcode set to OpCode::Invalid, supplied for each reserved slot. This way the slot is occupied (reserved), but not valid for use.
For instance, for a reserved opcode, now:
- DecodeOpCode will return false (for invalid)
- IsValidOpCode will return false
- IsOverloadLegal will return false
- getOpCode on instruction will return OpCode::Invalid
- GetDxilOpFuncCallInst on instruction will return OpCode::Invalid
- new IsReservedOpCode function will return true
Added a validation test. Previously, it would have incorrectly accepted the reserved opcode as valid.1 parent aa889e9 commit f57fbc7
File tree
8 files changed
+148
-511
lines changed- docs
- include/dxc/DXIL
- lib
- DXIL
- DxilValidation
- tools/clang/test/LitDXILValidation
- utils/hct
8 files changed
+148
-511
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2342 | 2342 | | |
2343 | 2343 | | |
2344 | 2344 | | |
2345 | | - | |
2346 | | - | |
2347 | | - | |
2348 | | - | |
2349 | | - | |
2350 | | - | |
2351 | | - | |
2352 | | - | |
2353 | | - | |
2354 | | - | |
2355 | | - | |
2356 | | - | |
2357 | 2345 | | |
2358 | 2346 | | |
2359 | 2347 | | |
| |||
2375 | 2363 | | |
2376 | 2364 | | |
2377 | 2365 | | |
2378 | | - | |
2379 | | - | |
2380 | | - | |
2381 | 2366 | | |
2382 | 2367 | | |
2383 | 2368 | | |
| |||
2406 | 2391 | | |
2407 | 2392 | | |
2408 | 2393 | | |
2409 | | - | |
2410 | | - | |
2411 | | - | |
2412 | | - | |
2413 | | - | |
2414 | | - | |
2415 | | - | |
2416 | | - | |
2417 | | - | |
2418 | | - | |
2419 | | - | |
2420 | | - | |
2421 | | - | |
2422 | 2394 | | |
2423 | 2395 | | |
2424 | 2396 | | |
| |||
3095 | 3067 | | |
3096 | 3068 | | |
3097 | 3069 | | |
3098 | | - | |
3099 | | - | |
3100 | | - | |
3101 | 3070 | | |
3102 | 3071 | | |
3103 | 3072 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
523 | 523 | | |
524 | 524 | | |
525 | 525 | | |
526 | | - | |
527 | | - | |
528 | | - | |
529 | | - | |
530 | | - | |
531 | 526 | | |
532 | 527 | | |
533 | 528 | | |
| |||
603 | 598 | | |
604 | 599 | | |
605 | 600 | | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
606 | 604 | | |
607 | 605 | | |
608 | 606 | | |
| |||
618 | 616 | | |
619 | 617 | | |
620 | 618 | | |
621 | | - | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
631 | | - | |
632 | | - | |
633 | | - | |
634 | | - | |
635 | | - | |
636 | | - | |
637 | | - | |
638 | | - | |
639 | | - | |
640 | | - | |
641 | | - | |
642 | | - | |
643 | | - | |
644 | | - | |
645 | | - | |
646 | | - | |
647 | | - | |
648 | | - | |
649 | | - | |
650 | | - | |
651 | 619 | | |
652 | 620 | | |
653 | 621 | | |
| |||
1201 | 1169 | | |
1202 | 1170 | | |
1203 | 1171 | | |
| 1172 | + | |
| 1173 | + | |
| 1174 | + | |
| 1175 | + | |
1204 | 1176 | | |
1205 | 1177 | | |
1206 | 1178 | | |
| |||
1351 | 1323 | | |
1352 | 1324 | | |
1353 | 1325 | | |
1354 | | - | |
1355 | | - | |
1356 | | - | |
1357 | | - | |
1358 | | - | |
1359 | | - | |
1360 | 1326 | | |
1361 | 1327 | | |
1362 | 1328 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
276 | 276 | | |
277 | 277 | | |
278 | 278 | | |
| 279 | + | |
279 | 280 | | |
280 | 281 | | |
281 | 282 | | |
| |||
0 commit comments