JuliaSIMD / JuliaSIMD/LoopVectorization.jl

Multiply 2 16-bit integers and accumulate to 32-bit integer

オープン
#37 コメント 10 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Julia
スター
789
フォーク
73
PR マージ指標
30日以内にマージされた PR はありません

説明

How would I multiply 2 16-bit integers and accumulate to 32-bit integer? Something like `_mm_madd_epi16`
So far the result of the multiplication seems to be done in 16-bit:
```julia
a = Int16.([1 << 8, 1 << 9, 1 << 10, 1 << 10])
b = Int16.([1 << 7, 1 << 8, 1 << 11, 1 << 10])
function fma_avx(a, b)
res = Int32(0)
@avx for i = 1:4
res = res + a[i] * b[i]
end
res
end
```
```julia
julia> fma_avx(a, b)
-32768

julia> fma_avx(Int32.(a), Int32.(b))
3309568
```

コントリビューションガイド

このリポジトリのコントリビューションガイドは索引されていません

調査の方向性

Start with the provided `fma_avx` reproducer and its `@avx` loop, comparing the `Int16` and `Int32` calls. Check how the loop handles `Int16` multiplication and accumulation, then verify the behavior against the requested 32-bit result; done means the intended result is supported or the limitation is clearly established with a regression test.

索引モデルが issue の本文から書いたものです。

評価

技術スタック
julia
領域
performance
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。