Why doesn't my processor have built-in BigInt support?

后端 未结 8 1899
执笔经年
执笔经年 2021-02-20 13:20

As far as I understood it, BigInts are usually implemented in most programming languages as arrays containing digits, where, eg.: when adding two of them, each digit is added on

8条回答
  •  盖世英雄少女心
    2021-02-20 14:08

    BigInt: the fundamental function required is: Unsigned Integer Multiplication, add previous high order I wrote one in Intel 16bit assembler, then 32 bit... C code is usually fast enough .. ie for BigInt you use a software library. CPUs (and GPUs) are not designed with unsigned Integer as top priority.

    If you want to write your own BigInt...

    Division is done via Knuths Vol 2 (its a bunch of multiply and subtract, with some tricky add-backs)

    Add with carry and subtract are easier. etc etc

    I just posted this in Intel: xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx SSE4 is there a BigInt LIbrary?

    i5 2410M processor I suppose can NOT use AVX [AVX is only on very recent Intel CPUs] but can use SSE4.2

    Is there a BigInt Library for SSE? I Guess I am looking for something that implements unsigned integer

    PMULUDQ (with 128-Bit operands) PMULUDQ __m128i _mm_mul_epu32 ( __m128i a, __m128i b)

    and does the carries.

    Its a Laptop so I cant buy an NVIDIA GTX 550, which isnt so grand on unsigned Ints, I hear. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx

提交回复
热议问题