Fix the abi hack on windows
This commit is contained in:
parent
d17042106f
commit
12a0038250
18
src/lib.rs
18
src/lib.rs
@ -78,24 +78,6 @@ macro_rules! urem {
|
||||
}
|
||||
}
|
||||
|
||||
// Hack for LLVM expectations for ABI on windows
|
||||
#[cfg(all(windows, target_pointer_width="64"))]
|
||||
#[repr(simd)]
|
||||
pub struct U64x2(u64, u64);
|
||||
|
||||
#[cfg(all(windows, target_pointer_width="64"))]
|
||||
fn conv(i: u128) -> U64x2 {
|
||||
use int::LargeInt;
|
||||
U64x2(i.low(), i.high())
|
||||
}
|
||||
|
||||
#[cfg(all(windows, target_pointer_width="64"))]
|
||||
fn sconv(i: i128) -> U64x2 {
|
||||
use int::LargeInt;
|
||||
let j = i as u128;
|
||||
U64x2(j.low(), j.high())
|
||||
}
|
||||
|
||||
#[cfg(test)]
|
||||
extern crate core;
|
||||
|
||||
|
@ -110,15 +110,23 @@ macro_rules! intrinsics {
|
||||
$($rest:tt)*
|
||||
) => (
|
||||
#[cfg(all(windows, target_pointer_width = "64"))]
|
||||
intrinsics! {
|
||||
$(#[$attr])*
|
||||
pub extern $abi fn $name( $($argname: $ty),* ) -> $ret {
|
||||
$($body)*
|
||||
}
|
||||
|
||||
#[cfg(all(windows, target_pointer_width = "64"))]
|
||||
pub mod $name {
|
||||
|
||||
intrinsics! {
|
||||
pub extern $abi fn $name( $($argname: $ty),* )
|
||||
-> ::macros::win64_abi_hack::U64x2
|
||||
{
|
||||
let e: $ret = { $($body)* };
|
||||
let e: $ret = super::$name($($argname),*);
|
||||
::macros::win64_abi_hack::U64x2::from(e)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
#[cfg(not(all(windows, target_pointer_width = "64")))]
|
||||
intrinsics! {
|
||||
|
Loading…
Reference in New Issue
Block a user