http://qs1969.pair.com?node_id=973651


in reply to supporting SSE 128 bit data in Perl

I'd go for one of these two, and use them to write all the code that has to deal with SSE2 using them, I'm more inclined to think you want the first option since it gives you full control over everything:

These guys here seem to be using double * for the data types, maybe you want to use that too.. but regardless, that article is a good read.

As far as packing goes, I would suggest you bother with that only when your SSE2 calculations are done and you need the result visible in Perl. Then you can easily convert it to some C data type and then to an XS data type or whatever other data structure you need.

  • Comment on Re: supporting SSE 128 bit data in Perl

Replies are listed 'Best First'.
Re^2: supporting SSE 128 bit data in Perl
by bulk88 (Priest) on Jun 01, 2012 at 03:01 UTC
    Thank you for asm tips, but I have a C API that sometimes wants SSE2 data as arguments in a C function prototype. I am not trying to use SSE2 cpu instructions or intrinsics directly. If I were, I would know exactly what part of the SSE2 union the data should be in.

    Maybe I shouldn't be reinventing the wheel and instead looking for a CPAN module that already understands what a C union is and somehow integrate it into my code and just say "supply a Foo::CAggregate object ref for parameter 1" :-/