Results 1 to 3 of 3

Thread: mdlSSE: Using SSE instructions (floating point related) in VB6 (in ASM)

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2009
    Posts
    2

    Post mdlSSE: Using SSE instructions (floating point related) in VB6 (in ASM)

    Hello all!
    I've developed this module to allow the use of SSE (SSE2 and 3) operations, to compute floating point operations directly by the CPU (and in 1 clock!).
    SSE support the sum, sub, mul, div, and some other functions, applied in "matrices". Those are just arrays of floats. SSE (one) supports 8 operands (single precision), and it will apply the same operation to all. For example, we can have 2 arrays A and B, with their items labeled as A1, A2, etc. So, if we apply the sum operation, the result would be RESULT = A + B, so RESULT1 = A1 + B1, and so on until RESULT4 = A4 + B4.
    SSE2 handles double precision, but it does use just 4 operands (A1, A2, B1, B2).

    Overall I've seen some nice stuff done with SSE, like obtaining the size (projection) of a vector into other vector; mostly 3D related. But this module it's just a simple wrapper for the simpler operations.

    This module allocates some memory which later is loaded with some assembly. Since the "operations" that can be done with SSE are stored in just 1 byte of the assembly, every time you call the module to do some operation, the code changes that byte accordingly.
    When there is no need to use the SSE module anymore, call the free function, which releases the memory allocated previously. Source ASM file inclueded (compiled with fasm).

    However, I thought that it would be nice to share it with all the devs.
    The attached file includes a crude example.

    Licence: Do whatever you want with the source, but a shout in your "about" would be great
    Attached Files Attached Files
    Last edited by el_coco; Feb 17th, 2016 at 09:21 PM. Reason: Attached the .zip file in the post, instead of the dropbox link

  2. #2
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: mdlSSE: Using SSE instructions (floating point related) in VB6 (in ASM)

    you might want to attach it to the post, instead of link to a dropbox.
    Thanks!

  3. #3
    PowerPoster
    Join Date
    Jun 2015
    Posts
    2,224

    Re: mdlSSE: Using SSE instructions (floating point related) in VB6 (in ASM)

    neat, have you should do some benchmarks showing whether the overhead is worth using SSE2, from VB

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width