Hi,

Am Sonntag, 8. April 2012 um 23:16 schrieb Brian Anderson:

> 
> #[abi = "rust-intrinsic"]
> native mod intrinsics {
> fn bswap_i16(i: i16) -> i16;
> }
> 
> The rust intrinsics would all just be hardcoded into the compiler to 
> translate to the appropriate llvm intrinsics.
> 
> As an llvm intrinsic:
> 
> #[abi = "llvm-intrinsic"]
> native mod intrinsics {
> #[link_name = "bswap.i16"]
> fn bswap_i16(i16: i16) -> i16;
> }
> 
> In this case rustc probably doesn't need to know anything specific about 
> the intrinsic - we just generate an intrinsic instruction with the given 
> name and types.


is there any advantage from choosing one form over the other (maybe in terms of 
optimizability) beyond what already was mentioned?


Greets,


Stefan 


_______________________________________________
Rust-dev mailing list
[email protected]
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to