| !sum | |
| # Average (unsigned byte, unsigned word) | |
| # Instructions: VPAVGB, VPAVGW | |
| - go: Average | |
| asm: "VPAVG[BW]" # Matches VPAVGB (byte) and VPAVGW (word) | |
| in: | |
| - &uint_t # $t will be Uint8xN for VPAVGB, Uint16xN for VPAVGW | |
| go: $t | |
| base: uint | |
| - *uint_t | |
| out: | |
| - *uint_t | |
| # Absolute Value (signed byte, word, dword, qword) | |
| # Instructions: VPABSB, VPABSW, VPABSD, VPABSQ | |
| - go: Abs | |
| asm: "VPABS[BWDQ]" # Matches VPABSB, VPABSW, VPABSD, VPABSQ | |
| in: | |
| - &int_t # $t will be Int8xN, Int16xN, Int32xN, Int64xN | |
| go: $t | |
| base: int | |
| out: | |
| - *int_t # Output is magnitude, fits in the same signed type | |
| # Sign Operation (signed byte, word, dword) | |
| # Instructions: VPSIGNB, VPSIGNW, VPSIGND | |
| - go: MulSign | |
| asm: "VPSIGN[BWD]" # Matches VPSIGNB, VPSIGNW, VPSIGND | |
| in: | |
| - *int_t # value to multiply by sign | |
| - *int_t # value from which to take the sign | |
| out: | |
| - *int_t | |
| # Population Count (count set bits in each element) | |
| # Instructions: VPOPCNTB, VPOPCNTW (AVX512_BITALG) | |
| # VPOPCNTD, VPOPCNTQ (AVX512_VPOPCNTDQ) | |
| - go: onesCount # lower case to coexist with feature-checking emulation | |
| asm: "VPOPCNTB" | |
| hideMaskMethods: true | |
| in: | |
| - &any | |
| go: $t | |
| out: | |
| - *any | |
| # Population Count (count set bits in each element) | |
| # Instructions: VPOPCNTB, VPOPCNTW (AVX512_BITALG) | |
| # VPOPCNTD, VPOPCNTQ (AVX512_VPOPCNTDQ) | |
| - go: OnesCount | |
| asm: "VPOPCNT[WDQ]" | |
| in: | |
| - &any | |
| go: $t | |
| out: | |
| - *any |