Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re: How best to write a cross-platform .xs module using x64 assembler?

by danaj (Friar)
on Mar 28, 2017 at 16:39 UTC ( #1186274=note: print w/replies, xml ) Need Help??


in reply to How best to write a cross-platform .xs module using x64 assembler?

It's more complicated than you need, but there is some inline assembly in Math::Prime::Util. See mulmod.h and montmath.h. Basically just C code with preprocessor wrappers for different platforms.

You can use Devel::CheckLib or similar packages for build time configuration as well.

For testing, I recommend Linux / Unix x86 machines that match your target, an x86 that doesn't (e.g. x86 non-64), a Mac especially since they use clang which acts slightly differently than gcc (different preprocessor defines), Windows. If you're ambitious, Cygwin and a non-x86 machine.

  • Comment on Re: How best to write a cross-platform .xs module using x64 assembler?

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1186274]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (7)
As of 2023-12-04 07:20 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    What's your preferred 'use VERSION' for new CPAN modules in 2023?











    Results (21 votes). Check out past polls.

    Notices?