Skip to content

Commit cb4f54d

Browse files
committed
Add usage examples to the documentation of etc/platform-intrinsics/generator.py
1 parent 45cde97 commit cb4f54d

File tree

1 file changed

+21
-0
lines changed

1 file changed

+21
-0
lines changed

src/etc/platform-intrinsics/generator.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -561,6 +561,27 @@ def parse_args():
561561
formatter_class = argparse.RawDescriptionHelpFormatter,
562562
description = 'Render an intrinsic definition JSON to various formats.',
563563
epilog = textwrap.dedent('''\
564+
Quick How-To:
565+
566+
There are two operating modes: single file and multiple files.
567+
568+
For example, ARM is specified as a single file. To generate the
569+
compiler-definitions for ARM just pass the script the "arm.json" file:
570+
571+
python generator.py --format compiler-defs arm.json
572+
573+
The X86 architecture is specified as multiple files (for the different
574+
instruction sets that x86 supports). To generate the compiler
575+
definitions one needs to pass the script a "platform information file"
576+
(with the -i flag) next to the files of the different intruction sets.
577+
For example, to generate the X86 compiler-definitions for SSE4.2, just:
578+
579+
python generator.py --format compiler-defs -i x86/info.json sse42.json
580+
581+
And to generate the compiler-definitions for SSE4.1 and SSE4.2, just:
582+
583+
python generator.py --format compiler-defs -i x86/info.json sse41.json sse42.json
584+
564585
An intrinsic definition consists of a map with fields:
565586
- intrinsic: pattern for the name(s) of the vendor's C intrinsic(s)
566587
- llvm: pattern for the name(s) of the internal llvm intrinsic(s)

0 commit comments

Comments
 (0)