Skip to content
TheChatArchiveThe Chat Archive
Qwenqwq-32b· Alibaba (Qwen)Hugging Face LMArena Human Preference 140K

Please suggest new powerful, usefull and realistic SIMD instructions…

From a Chatbot Arena battleThe same person sent this prompt to two anonymous models at once. Compare it with gpt-4.1-mini-2025-04-14’s answer.
  1. User

    Please suggest new powerful, usefull and realistic SIMD instructions (permutations/bit-manipulation/others) that are not present in the main stream SIMD architectures AVX-512/NEON/SVE/RVV.

  2. Qwen Assistant

    Here are some proposed SIMD instructions that address gaps in current architectures (AVX-512, NEON, SVE, RVV), offering enhanced flexibility, efficiency, and capabilities in bit manipulation, permutation, and other operations:


    1. Generalized Bit Permutation (e.g., VPERMBITS)

    • Function: Rearranges individual bits within a vector according to a permutation mask.
    • Use Case: Arbitrary bit-level rearrangement for tasks like bit-reversed FFTs, cryptographic operations, or Morton code generation.
    • Why Needed: Existing instructions (e.g., VPBROADCAST, VPERMD) permute elements or bytes, not individual bits.

    2. Vectorized Variable-Rotate (e.g., VROTATEV)

    • Function: Rotates each element in a vector by a variable number of bits specified by another vector.
    • Use Case: Cryptographic operations (e.g., AES round functions), encoding/decoding with dynamic shifts.
    • Why Needed: Current rotate instructions (e.g., VPROTB) use immediate rotation counts, not vector-based.

    3. Bitwise Blend (e.g., VBLENDBIT)

    • Function: Blends two vectors at the bit level using a third vector as a mask.
    • Use Case: Fine-grained bit-level merging for encoding, compression, or partial updates.
    • Why Needed: Existing blend instructions (e.g., VPBLENDVB) operate at the element or byte level.

    4. Parallel Bitwise Majority (e.g., VMJORITY)

    • Function: Computes the bitwise majority (1 if ≥2 of 3 inputs are 1) across three vectors.
    • Use Case: Error-correcting codes, consensus algorithms, or voting schemes.
    • Why Needed: No existing SIMD instruction combines three vectors at the bit level.

    5. Vectorized Bit Interleave/Deinterleave (e.g., VBITINTER/VBITDEINT)

    • Function: Interleaves/deinterleaves bits from two vectors into a single vector (e.g., 0b1010 and 0b1100 → 0b11100100).
    • Use Case: Morton codes, spatial hashing, or efficient bit-packing.
    • Why Needed: Existing interleave/deinterleave (e.g., VPUNPCK) works on bytes/words, not bits.

    6. Parallel Bit Parity (e.g., VPARITY)

    • Function: Computes the parity (XOR of all bits) for each element in a vector.
    • Use Case: Error detection in data streams or parity-based compression.
    • Why Needed: VPTEST (AND of all bits) exists, but parity (XOR) is missing.

    7. Sparse Vector Compression/Expansion (e.g., VSparseComp/VSparseExp)

    • Function: Compresses vectors with many zero elements into a compact format (e.g., run-length encoding) or expands them.
    • Use Case: Reducing memory bandwidth in sparse matrix operations or machine learning.
    • Why Needed: No SIMD support for sparse vector compression.

    8. Vectorized Transpose for Arbitrary Matrix Sizes (e.g., VTRANSPOSE_NxN)

    • Function: Transposes matrices of arbitrary sizes (e.g., 8×8, 16×16) stored in vectors.
    • Use Case: General-purpose matrix operations without fixed-size limitations.
    • Why Needed: Current transpose instructions (e.g., VPERMILPS) support only specific sizes.

    9. Vectorized Carry Propagation Add/Subtract (e.g., VADDWC/VSUBWC)

    • Function: Performs addition/subtraction across vector elements with carry propagation between elements.
    • Use Case: Big-integer arithmetic, cryptographic operations (e.g., RSA).
    • Why Needed: Existing add-with-carry (ADC) works element-wise, not across elements.

    10. Variable Element Size Manipulation (e.g., VMIX/VSPLIT)

    • Function: Stores/loads vectors with mixed element sizes (e.g., 8-bit and 32-bit in the same vector).
    • Use Case: Heterogeneous data processing (e.g., combining integers and pointers).
    • Why Needed: Current SIMD requires uniform element sizes.

    11. Vectorized Bitwise Lookup (e.g., VBITLOOKUP)

    • Function: Uses each bit in a vector as an index into a lookup table (e.g., vec[i] = lut[input[i]]).
    • Use Case: Custom bit transformations, such as Huffman coding or lookup tables for encoding.
    • Why Needed: No SIMD instruction supports per-bit lookup tables.

    12. Parallel Bit Set/Zero Position (e.g., VBSF/VBLZ)

    • Function: Returns the first set or zero bit’s position for each vector element.
    • Use Case: Efficient bit scanning in data structures (e.g., Bloom filters).
    • Why Needed: Existing BSF/BSR instructions work on scalars, not vectors.

    13. Vectorized Carryless Multiply (e.g., VCARRYLESSMUL)

    • Function: Performs multiplication over GF(2) (carryless multiplication) on vectors of polynomials.
    • Use Case: Cryptography (e.g., AES-GCM, elliptic curve operations).
    • Why Needed: Existing PMULL (NEON) is limited to 128-bit vectors; AVX-512’s VAES lacks general GF(2) support.

    14. Vectorized Population Count with Mask (e.g., VPOPCNTMASK)

    • Function: Counts set bits in each element, but only for bits specified by a mask.
    • Use Case: Partial bit analysis in compression or error-correcting codes.
    • Why Needed: Existing VPPOPCNT counts all bits, not selective.

    15. Vectorized Swizzle-Permute (e.g., VSWIZZLE)

    • Function: Combines bit rotation and permutation in a single step (e.g., rotate bits then rearrange).
    • Use Case: Optimizing common bit manipulation workflows (e.g., encoding/decoding).
    • Why Needed: Reduces instruction count compared to separate rotate-permute steps.

    Rationale for These Instructions

    These proposals address gaps in current SIMD architectures by enabling:

    • Fine-grained bit manipulation (e.g., arbitrary bit permutations, bitwise blends).
    • Dynamic operations (e.g., variable rotates, sparse vector handling).
    • New domains (e.g., sparse data, carry propagation, GF(2) arithmetic).
    • Efficiency (reducing instruction count for common workflows).

    These instructions could significantly accelerate applications in cryptography, compression, machine learning, and scientific computing while maintaining hardware feasibility through pipelining and parallel execution.

Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.