x86 max/min asm instructions?

前端 未结 6 822
礼貌的吻别
礼貌的吻别 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:18

    MAXPS and MINPS from SSE both operate on packed single-precision floating point numbers. PMAXSW, PMINSW, PMAXUB and PMINUB all operate on packed 8-bit words, either signed or unsigned. Please note that these compare the two input SSE registers or address locations element-wise and store the result into an SSE register or memory location.

    The SSE2 versions of MAXPS and MINPS should work on double-precision floats.

    What compiler and optimization flags are you using? gcc 4.0 and better should automatically vectorize operations if your target supports them, earlier versions may need a specific flag.

提交回复
热议问题