rust-shogi-crates / shogi_core

Defines fundamental data types and functions
MIT License
9 stars 0 forks source link

#[align(16)] for `Bitboard` #34

Open koba-e964 opened 2 years ago

koba-e964 commented 2 years ago

Advantages and disadvanges

Advantages:

Disadvantages:

API

The only possible candidate is:

#[repr(C, align(16))]
pub struct Bitboard([u64; 2]);

This doesn't work with cbindgen well (emits an opaque type for Bitboard).

Unresolved Questions

(Thank you for bringing this to my attention, @mizar!)

mizar commented 2 years ago

Documents

Related sources

else // no SSE

u64 p[2];

endif



## Issues/PullRequests in cbindgen

- https://github.com/eqrion/cbindgen/issues/432
- https://github.com/eqrion/cbindgen/issues/433