[rust-dev] hashmap benchmark

Stefan Plantikow stefan.plantikow at googlemail.com
Mon Apr 9 05:36:46 PDT 2012


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 




More information about the Rust-dev mailing list