Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid
 
PerlMonks  

comment on

( [id://3333]=superdoc: print w/replies, xml ) Need Help??

Wow! That was fast!

Unfortunately, I don't think I'll be able to make use of it :(

Whilst I have MinGW for 32-bit setup and working, I've never succeeded in getting a 64-bit version to work in conjunction with my 64-perl. And I need this to work there.

I will download it and see if I can build it for 32-bit, but it won't be for a couple of days as I'm out tomorrow. I'll also try to knock up a test script, though it won't use Test::*. For this kind of thing I favour a random testing mechanism. Eg. generate a couple of numbers; multiply them; divide the results by one of them and check that result matches the other. Similarly for add/subract, shift-left/right etc.

I've started to develop a my own using MSC and a struct containing two 64-bit ints. Add/subtract and multiply work--albeit that the latter uses a slow algorithm. I'm a bit hung up on div/mod at the moment.

For a first pass I'm doing this using standard C math. In theory, it should be quicker using the 128-bit XMM registers, but the docs for the SSE/SSE2/SSE3 et al. intrinsics are less than detailed. Counter to my understanding earlier in this thread, those instructions don't support 128-bit math directly. They do support SIMD operations on pairs of 64-bit ints/uints, which in theory should speed up multiplication/division no end, but the combinations of incantations required are not at all clear. I've failed completely to turn up any examples on the web.

Maybe if I can get it something to fly here, we could look at adding it to your module; or making a Win module that yours can defer to on this platform?

One thing that might be useful to me if you have the time, is an assembler dump of the sources. Can gcc do that? And if it can, would it show the actual operations involved, or just calls to system library routines? Are they inlined?


Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.

In reply to Re^6: Module for 128-bit integer math? by BrowserUk
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":



  • Are you posting in the right place? Check out Where do I post X? to know for sure.
  • Posts may use any of the Perl Monks Approved HTML tags. Currently these include the following:
    <code> <a> <b> <big> <blockquote> <br /> <dd> <dl> <dt> <em> <font> <h1> <h2> <h3> <h4> <h5> <h6> <hr /> <i> <li> <nbsp> <ol> <p> <small> <strike> <strong> <sub> <sup> <table> <td> <th> <tr> <tt> <u> <ul>
  • Snippets of code should be wrapped in <code> tags not <pre> tags. In fact, <pre> tags should generally be avoided. If they must be used, extreme care should be taken to ensure that their contents do not have long lines (<70 chars), in order to prevent horizontal scrolling (and possible janitor intervention).
  • Want more info? How to link or How to display code and escape characters are good places to start.
Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (6)
As of 2024-04-23 14:53 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found