A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://lists.llvm.org/pipermail/llvm-dev/2020-July/143079.html below:

[llvm-dev] [RFC] carry-less multiplication instruction

[llvm-dev] [RFC] carry-less multiplication instructionRoman Lebedev via llvm-dev llvm-dev at lists.llvm.org
Sun Jul 5 13:09:10 PDT 2020
On Sun, Jul 5, 2020 at 11:07 PM Chris Lattner <clattner at nondot.org> wrote:
>
>
>
> On Jul 5, 2020, at 5:12 AM, Nicolai Hähnle via llvm-dev <llvm-dev at lists.llvm.org> wrote:
>
> [1] https://en.wikipedia.org/wiki/Carry-less_product
> [2] (page 30) https://raw.githubusercontent.com/riscv/riscv-bitmanip/master/bitmanip-0.92.pdf
> [3] https://www.bearssl.org/constanttime.html
>
> What benefit would this intrinsic would bring to the middle-end IR,
> over it's current naive expanded form?
>
>
> Isn't a "naive" expansion of NxN carryless multiply extremely involved? I'd expect something like 2N shifts, N truncs, N selects, and N xors.
>
> That link mentions an alternative that is more efficient, but I wouldn't exactly call it naive…
>
>
> No, the typical expansion (used by the existing LLVM code generator) uses “grade school math” to decompose large multiplications into smaller ones.
>
> Wide multiplications (e.g. those on X86) are pretty easy to pattern match from “sign/zero extend operands from 64 bits to 128 bits, then do a 128x128=128 multiply” for example.
That is what i meant, yes.

> This is all already handled by the existing selection dag infra, my understanding is that it works well in practice.
>
> -Chris
Roman
More information about the llvm-dev mailing list

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4