Beefy Boxes and Bandwidth Generously Provided by pair Networks
Think about Loose Coupling
 
PerlMonks  

comment on

( #3333=superdoc: print w/replies, xml ) Need Help??
I have just uploaded Math::Int128 to CPAN

Just tried building it using the mingw64 compiler, and it failed spectacularly. I speculate that this is a shortcoming of the compiler ... though it does have the 16 byte __int128 data type. However, the __int128 data type appears to be a signed value only.
The "unsigned __int128" is, afaict, an unknown type and, I suspect, the cause of the errors reproduced below.

Trying to determine sizeof(unsigned __int128) in a C program produces the compile-time error:
expected ')' before '__int128'

Salva, let me know if there's any point in following this further with that compiler, and I'll certainly try to work through it. Here's what I get when running dmake (x64 build of perl-5.12.0):
C:\sis\Math-Int128-0.01>dmake test cp lib/Math/Int128.pm blib\lib\Math\Int128.pm C:\_64\perl512_M\bin\perl.exe C:\_64\perl512_M\lib\ExtUtils\xsubpp -t +ypemap C:\ _64\perl512_M\lib\ExtUtils\typemap Int128.xs > Int128.xsc && C:\_64\p +erl512_M\b in\perl.exe -MExtUtils::Command -e "mv" -- Int128.xsc Int128.c x86_64-w64-mingw32-gcc -c -I. -s -O2 -DWIN32 -DHAVE_DES_FCRYPT -DWIN +64 -DCONSE RVATIVE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -fno-strict-aliasi +ng -mms-bi tfields -DPERL_MSVCRT_READFIX -g -O0 -DVERSION=\"0.01\" -DXS_V +ERSION=\"0 .01\" "-IC:\_64\perl512_M\lib\CORE" Int128.c Int128.xs:15:27: error: expected '=', ',', ';', 'asm' or '__attribute_ +_' before 'uint128_t' Int128.xs:63:17: error: expected declaration specifiers or '...' befor +e 'uint128 _t' Int128.xs: In function 'newSVu128': Int128.xs:66:22: error: 'u128' undeclared (first use in this function) Int128.xs:66:22: note: each undeclared identifier is reported only onc +e for each function it appears in Int128.xs: At top level: Int128.xs:99:1: error: expected '=', ',', ';', 'asm' or '__attribute__ +' before ' atoa128' Int128.xs:169:1: error: expected '=', ',', ';', 'asm' or '__attribute_ +_' before 'SvU128' Int128.xs: In function 'su128_to_number': Int128.xs:210:5: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:210:15: error: expected ';' before 'u128' Int128.xs:212:10: error: 'u128' undeclared (first use in this function +) Int128.xs: At top level: Int128.xs:221:26: error: expected ')' before 'u128' Int128.xs:247:23: error: expected ')' before 'i128' Int128.xs: In function 'XS_Math__Int128_uint128': Int128.xs:274:5: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__Int128_net_to_uint128': Int128.xs:333:55: error: 'uint128_t' undeclared (first use in this fun +ction) Int128.xs:333:65: error: expected ')' before 'pv' Int128.xs:334:65: error: expected ')' before 'pv' Int128.xs:335:63: error: expected ')' before 'pv' Int128.xs:336:61: error: expected ')' before 'pv' Int128.xs:337:59: error: expected ')' before 'pv' Int128.xs:338:57: error: expected ')' before 'pv' Int128.xs:339:55: error: expected ')' before 'pv' Int128.xs:340:53: error: expected ')' before 'pv' Int128.xs:341:51: error: expected ')' before 'pv' Int128.xs:342:49: error: expected ')' before 'pv' Int128.xs:343:47: error: expected ')' before 'pv' Int128.xs:344:45: error: expected ')' before 'pv' Int128.xs:345:43: error: expected ')' before 'pv' Int128.xs:346:41: error: expected ')' before 'pv' Int128.xs:347:39: error: expected ')' before 'pv' Int128.xs:348:37: error: expected ')' before 'pv' Int128.xs:348:37: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__Int128_uint128_to_net': Int128.xs:375:5: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:375:15: error: expected ';' before 'u128' Int128.xs:383:36: error: 'u128' undeclared (first use in this function +) Int128.xs: In function 'XS_Math__Int128_native_to_uint128': Int128.xs:411:5: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__Int128_uint128_to_native': Int128.xs:437:5: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:437:15: error: expected ';' before 'u128' Int128.xs:443:5: error: 'u128' undeclared (first use in this function) Int128.xs: In function 'XS_Math__Int128_uint128_to_hex': Int128.xs:453:5: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:453:15: error: expected ';' before 'u128' Int128.xs:459:17: error: 'u128' undeclared (first use in this function +) Int128.xs: In function 'XS_Math__Int128__left': Int128.xs:623:9: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:623:19: error: expected ';' before 'b' Int128.xs:626:13: error: 'b' undeclared (first use in this function) Int128.xs:635:19: error: expected ';' before 'b' Int128.xs: In function 'XS_Math__Int128__right': Int128.xs:652:9: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:652:19: error: expected ';' before 'b' Int128.xs:655:13: error: 'b' undeclared (first use in this function) Int128.xs:664:19: error: expected ';' before 'b' Int128.xs: In function 'XS_Math__UInt128__add': Int128.xs:938:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__sub': Int128.xs:957:27: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__mul': Int128.xs:973:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__div': Int128.xs:988:5: error: 'uint128_t' undeclared (first use in this func +tion) Int128.xs:988:15: error: expected ';' before 'up' Int128.xs:989:15: error: expected ';' before 'down' Int128.xs:993:13: error: 'up' undeclared (first use in this function) Int128.xs:994:13: error: 'down' undeclared (first use in this function +) Int128.xs:1002:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__remainder': Int128.xs:1021:5: error: 'uint128_t' undeclared (first use in this fun +ction) Int128.xs:1021:15: error: expected ';' before 'up' Int128.xs:1022:15: error: expected ';' before 'down' Int128.xs:1026:13: error: 'up' undeclared (first use in this function) Int128.xs:1027:13: error: 'down' undeclared (first use in this functio +n) Int128.xs:1035:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__left': Int128.xs:1054:9: error: 'uint128_t' undeclared (first use in this fun +ction) Int128.xs:1054:19: error: expected ';' before 'a' Int128.xs:1056:13: error: 'a' undeclared (first use in this function) Int128.xs:1057:13: error: 'b' undeclared (first use in this function) Int128.xs:1063:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__right': Int128.xs:1082:9: error: 'uint128_t' undeclared (first use in this fun +ction) Int128.xs:1082:19: error: expected ';' before 'a' Int128.xs:1084:13: error: 'a' undeclared (first use in this function) Int128.xs:1085:13: error: 'b' undeclared (first use in this function) Int128.xs:1091:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs:1094:19: error: expected ';' before 'b' Int128.xs: In function 'XS_Math__UInt128__spaceship': Int128.xs:1111:5: error: 'uint128_t' undeclared (first use in this fun +ction) Int128.xs:1111:15: error: expected ';' before 'left' Int128.xs:1112:15: error: expected ';' before 'right' Int128.xs:1115:9: error: 'left' undeclared (first use in this function +) Int128.xs:1116:9: error: 'right' undeclared (first use in this functio +n) Int128.xs: In function 'XS_Math__UInt128__and': Int128.xs:1209:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__or': Int128.xs:1225:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__xor': Int128.xs:1241:9: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__bnot': Int128.xs:1266:5: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__neg': Int128.xs:1276:5: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here Int128.xs: In function 'XS_Math__UInt128__clone': Int128.xs:1306:5: error: too many arguments to function 'newSVu128' Int128.xs:63:1: note: declared here dmake: Error code 129, while making 'Int128.o'
Cheers,
Rob

In reply to Re^6: Module for 128-bit integer math? by syphilis
in thread Module for 128-bit integer math? by BrowserUk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post; it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.
  • Log In?
    Username:
    Password:

    What's my password?
    Create A New User
    Chatterbox?
    and the web crawler heard nothing...

    How do I use this? | Other CB clients
    Other Users?
    Others having an uproarious good time at the Monastery: (4)
    As of 2020-10-28 20:07 GMT
    Sections?
    Information?
    Find Nodes?
    Leftovers?
      Voting Booth?
      My favourite web site is:












      Results (264 votes). Check out past polls.

      Notices?