Registry Mirror
Skip to content

Conversation

@huonw

@huonw huonw commented Aug 29, 2015

Copy link
Copy Markdown
Contributor

This adds a new Python script (compatible with 2.7 and 3.x) that will consume some JSON files that define a platform's intrinsics. It can output a file that defines the intrinsics in the compiler, or an extern block that will import them.

The complexity of the generator is to be DRY: platforms (especially ARM and AArch64) have a lot of repetition with their intrinsics, for different versions with different types, so being able to write it once is nice.

@rust-highfive

Copy link
Copy Markdown
Contributor

r? @alexcrichton

(rust_highfive has picked a reviewer for you, use r? to override)

@huonw

huonw commented Aug 29, 2015

Copy link
Copy Markdown
Contributor Author

(I should do some more testing to make sure the definitions are correct before this lands, but if there are any mistakes, they'll probably just be local one-line changes to a JSON file.)

huonw added 9 commits August 29, 2015 15:36
This is necessary to reflect the ARM APIs accurately, since some
functions explicitly take an unsigned parameter and a signed one, of the
same integer shape, so the no-duplicates check will fail unless we
distinguish.
This adds support for flattened intrinsics, which are called in Rust
with tuples but in LLVM without them (e.g. `foo((a, b))` becomes `foo(a,
b)`). Unflattened ones could be supported, but are not yet.
This works better with the code generation approach.
This python script will consume an appropriately formatted JSON file and
output either a Rust file for use in librustc_platform_intrinsics, or an
extern block for importing the intrinsics in an external library.

The --help flag has details.
This means that each platform has total control over the formatting info
it needs.
huonw added 3 commits August 29, 2015 19:26
Some x86 C intrinsics are declared to take `int ...` (i.e. exposed in
Rust as `i32`), but LLVM implements them by taking `i8` instead.
@alexcrichton

Copy link
Copy Markdown
Member

Looks good to me, r=me once you're satisfied the JSON is right

@huonw

huonw commented Aug 31, 2015

Copy link
Copy Markdown
Contributor Author

@bors r=alexcrichton

@bors

bors commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

📌 Commit 29dcff3 has been approved by alexcrichton

@bors

bors commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

⌛ Testing commit 29dcff3 with merge aba9ae5...

@bors

bors commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

💔 Test failed - auto-linux-64-nopt-t

@alexcrichton

Copy link
Copy Markdown
Member

@bors: retry

On Mon, Aug 31, 2015 at 12:31 PM, bors notifications@github.com wrote:

[image: 💔] Test failed - auto-linux-64-nopt-t
http://buildbot.rust-lang.org/builders/auto-linux-64-nopt-t/builds/6221

—
Reply to this email directly or view it on GitHub
#28079 (comment).

@huonw

huonw commented Aug 31, 2015

Copy link
Copy Markdown
Contributor Author

@bors r=alexcrichton

@bors

bors commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

📌 Commit 14f9c97 has been approved by alexcrichton

@bors

bors commented Aug 31, 2015

Copy link
Copy Markdown
Contributor

⌛ Testing commit 14f9c97 with merge 2d3e837...

bors added a commit that referenced this pull request Aug 31, 2015
This adds a new Python script (compatible with 2.7 and 3.x) that will consume some JSON files that define a platform's intrinsics. It can output a file that defines the intrinsics in the compiler, or an `extern` block that will import them.

The complexity of the generator is to be DRY: platforms (especially ARM and AArch64) have a lot of repetition with their intrinsics, for different versions with different types, so being able to write it once is nice.
@bors
bors merged commit 14f9c97 into rust-lang:master Aug 31, 2015
@huonw
huonw deleted the simd branch August 31, 2015 23:32
huonw added a commit to huonw/simd that referenced this pull request Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants