Conversation
|
(rust_highfive has picked a reviewer for you, use r? to override) |
|
(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.) |
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.
Some x86 C intrinsics are declared to take `int ...` (i.e. exposed in Rust as `i32`), but LLVM implements them by taking `i8` instead.
|
Looks good to me, r=me once you're satisfied the JSON is right |
|
@bors r=alexcrichton |
|
📌 Commit 29dcff3 has been approved by |
|
⌛ Testing commit 29dcff3 with merge aba9ae5... |
|
💔 Test failed - auto-linux-64-nopt-t |
|
@bors: retry On Mon, Aug 31, 2015 at 12:31 PM, bors notifications@github.com wrote:
|
|
@bors r=alexcrichton |
|
📌 Commit 14f9c97 has been approved by |
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.
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
externblock 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.