[rust-dev] hashmap benchmark

Brian Anderson banderson at mozilla.com
Mon Apr 9 11:47:08 PDT 2012


On 04/09/2012 05:36 AM, Stefan Plantikow wrote:
> 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?
>

I don't think so.

-Brian


More information about the Rust-dev mailing list