Skip to content

Unavailability of integer multiplication BASOPs for UWord64 x Word16

In ivas_qmetadata_enc.c, there is a static function create_combined_index, which gives an index as output which is in uint64_t data type. In this function an accumulation takes place which takes sum of product of uint64_t variable with a uint16_t variable followed by another multiplication of uint64_t variable with int16_t variable.

Issue: BASOPs are not available for such multiplications.

What should be used in this case?

Attached below is the function definition:

static uint64_t create_combined_index(
    uint16_t *idx_dct,       /* i  : indexes to combine */
    const int16_t len,       /* i  : number of indexes */
    const int16_t *no_cb_vec /* i  : how many codewords for each position */
)
{
    int16_t i;
    uint64_t idx, base;

    base = 1;
    idx = 0;
    for ( i = 0; i < len; i++ )
    {
        idx += base * idx_dct[i]; // uint64_t = uint64_t + uint64_t * uint16_t
        base *= no_cb_vec[i]; // unint64_t = uint64_t * int16_t
    }

    return idx;
}