Skip to content

Add a "platform-specific C types" module to std lib. #103

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
graydon opened this issue Jul 11, 2010 · 4 comments
Closed

Add a "platform-specific C types" module to std lib. #103

graydon opened this issue Jul 11, 2010 · 4 comments

Comments

@graydon
Copy link
Contributor

graydon commented Jul 11, 2010

The C int type is not always equal to intptr_t, and there is always the joyful nature of long, long long, signed/unsigned char, and similar hilarity. Add a module with all the normal numeric typedefs in the C standard library and make it per-platform, so library bindings can discuss this stuff in its natural terminology.

@graydon
Copy link
Contributor Author

graydon commented Jan 27, 2011

Shifted to rustc. Possibly inquire with LLVM to extract these values (else require they come from the platform-specific os module)

@brson
Copy link
Contributor

brson commented Oct 5, 2011

There's a std::ctypes module now, mostly empty

@graydon
Copy link
Contributor Author

graydon commented Dec 5, 2011

is this mature enough to close the bug and just expand the module as needed by libraries?

@brson
Copy link
Contributor

brson commented Dec 5, 2011

I think so.

@brson brson closed this as completed Dec 5, 2011
oli-obk pushed a commit to oli-obk/rust that referenced this issue Jul 19, 2017
allow using tuple variant names as function handles
keeperofdakeys pushed a commit to keeperofdakeys/rust that referenced this issue Dec 12, 2017
kazcw pushed a commit to kazcw/rust that referenced this issue Oct 23, 2018
* Add _mm_{and,andnot,or,xor}_ps

* Add _mm_cmpeq_ss

* Add _mm_cmplt_ss

* Add _mm_cmple_ss

* Add _mm_cmpgt_ss

* Add _mm_cmpge_ss

* Add _mm_cmpneq_ss

* Add _mm_cmpnlt_ss

* Add _mm_cmpnle_ss

* Add _mm_cmpngt_ss

* Add _mm_cmpnge_ss

* Add _mm_cmpord_ss

* Add _mm_cmpunord_ss

* Fix _mm_{and,andnot,or,xor}_ps tests for i586

LLVM for i586 doesn't seem to generate `andps`, and instead generates 4
`and`s. Similar for the other operations.
kazcw pushed a commit to kazcw/rust that referenced this issue Oct 23, 2018
* avx: _mm256_loadu_pd

* avx: _mm256_storeu_pd

* avx: _mm256_loadu_ps

* avx: _mm256_storeu_ps

* avx: fix _mm256_storeu_pd and _mm256_storeu_ps

* avx: _mm256_loadu_si256

* avx: _mm256_undefined_si256

* avx: _mm256_maskload_pd

* avx: _mm256_maskstore_pd

* Attempt to fix CI (rust-lang#108)

Need to bring codegen units back to only one for now

* [x86] sse4.2 add docs for _SIDD_EQUAL_RANGES (rust-lang#107)

- Add docs for the _SIDD_EQUAL_RANGES mode

* Add _MM_TRANSPOSE4_PS pseudo-macro. (rust-lang#106)

This adds a strange macro, which I've replaced with a function, because it
seems there are not many better alternatives.

Also adds a test, and `#[allow(non_snake_case)]` to `#[simd_test]`.

* Fix i586 tests

* Implement bitwise SSE ops & _mm_cmp*_ss  (rust-lang#103)

* Add _mm_{and,andnot,or,xor}_ps

* Add _mm_cmpeq_ss

* Add _mm_cmplt_ss

* Add _mm_cmple_ss

* Add _mm_cmpgt_ss

* Add _mm_cmpge_ss

* Add _mm_cmpneq_ss

* Add _mm_cmpnlt_ss

* Add _mm_cmpnle_ss

* Add _mm_cmpngt_ss

* Add _mm_cmpnge_ss

* Add _mm_cmpord_ss

* Add _mm_cmpunord_ss

* Fix _mm_{and,andnot,or,xor}_ps tests for i586

LLVM for i586 doesn't seem to generate `andps`, and instead generates 4
`and`s. Similar for the other operations.

* avx: _mm_maskload_pd

* avx: _mm_maskstore_pd

* avx: _mm256_maskload_ps

* avx: _mm256_maskstore_ps

* avx: _mm_maskload_ps, _mm_maskstore_ps

* avx: _mm256_movehdup_ps

* avx: _mm256_moveldup_ps
rchaser53 pushed a commit to rchaser53/rust that referenced this issue Jan 19, 2019
bors pushed a commit to rust-lang-ci/rust that referenced this issue Oct 1, 2021
Implement trait Select<Mask> and fn select
djtech-dev pushed a commit to djtech-dev/rust that referenced this issue Dec 9, 2021
Add TryFrom traits from BasicValueEnum and BasicTypeEnum.
bjorn3 pushed a commit to bjorn3/rust that referenced this issue Feb 1, 2022
…ng#103)

* Use sized integer types

* Add support for integer types not supported on some platforms

* Add feature to test non-native integers in CI
celinval pushed a commit to celinval/rust-dev that referenced this issue Dec 6, 2024
…_from` (rust-lang#103)

# Description:

This PR introduces function contracts and proof harness for the NonNull
pointer in the Rust core library. Specifically, it verifies three new
APIs—`byte_offset`, `byte_add`, and `byte_offset_from` with Kani. These
changes enhance the functionality of pointer arithmetic and verification
for NonNull pointers.

# Changes Overview:

**Covered APIs:**
1. `NonNull::byte_add`: Adds a specified byte offset to a pointer.
2. `NonNull::byte_offset`: Allows calculating an offset from a pointer
in bytes.
4. `NonNull::byte_offset_from`: Calculates the distance between two
pointers in bytes.

**Proof harness:**
1. `non_null_byte_add_proof`
2. `non_null_byte_offset_proof`
3. `non_null_byte_offset_from_proof`

Towards rust-lang#53
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants