-
Notifications
You must be signed in to change notification settings - Fork 13.3k
add built-in complex number types for C ABI compatibility #10500
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
On Thu, Nov 14, 2013 at 10:15:43PM -0800, Daniel Micay wrote:
By "built-in", do you mean lang items? I'd imagine that is sufficient. |
@nikomatsakis: Yeah, language items would work. (In fact, it would be nice to move to language items for all built-in types in order to allow defining methods on them. The constant expression evaluation and syntax wouldn't have to change.) |
Example of this in C: #include<complex.h>
struct test {
float x, y;
};
struct test s() {
struct test ret = { 1.0, 2.0 };
return ret;
}
float complex c() {
return 1.0 + 2.0 * I;
} Compiled with s: # @s
# BB#0:
movl 4(%esp), %eax
movl $1073741824, 4(%eax) # imm = 0x40000000
movl $1065353216, (%eax) # imm = 0x3F800000
retl $4
c: # @c
# BB#0:
movl $1065353216, %eax # imm = 0x3F800000
movl $1073741824, %edx # imm = 0x40000000
retl i.e. the struct (equivalent to |
I'm pulling a massive triage effort to get us ready for 1.0. As part of this, I'm moving stuff that's wishlist-like to the RFCs repo, as that's where major new things should get discussed/prioritized. This issue has been moved to the RFCs repo: rust-lang/rfcs#793 |
Fix documentation for `derived_hash_with_manual_eq` changelog: fix documentation for `derived_hash_with_manual_eq` The documentation retained "vice versa" from the previous incarnation of the lint but the lint itself no longer lints against manual `Hash` implementations with a derived `PartialEq`. I also adjusted the documentation for `PartialOrd`-`Ord` lint as "vice versa" seemed a little confusing to me there (as to what it was refering to exactly.)
These are sadly not just treated as a simple
struct
on various platforms and have ABI requirements. I think support for the existing C math library is important because this isn't something we want to recreate on every platform.The text was updated successfully, but these errors were encountered: