x86 max/min asm instructions?

前端 未结 6 819
礼貌的吻别
礼貌的吻别 2021-02-06 06:55

Are there any asm instructions that can speed up computation of min/max of vector of doubles/integers on Core i7 architecture?

Update:

I didn\'t

6条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-06 07:25

    In response to your second question: on most platforms, there are libraries that already contained optimized implementations of this very operation (and most other simple vector operations). Use them.

    • On OS X, there is vDSP_maxviD( ) and cblas_idamax( ) in the Accelerate.framework
    • The Intel compilers include the IPP and MKL libraries, which have high performance implementations, including cblas_idamax( )
    • Most Linux systems will have cblas_idamax( ) in the BLAS library, which may or may not be well-tuned depending on its provenance; users who care about performance will generally have a good implementation (or can be persuaded to install one)
    • If all else fails, you can use ATLAS (Automatically Tuned Linear Algebra Software) to get a decent performance implementation on the target platform

提交回复
热议问题