Guest User

Untitled

a guest
Sep 10th, 2018
125
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. addFloat: float1 repeat: count
  2.  
  3.  
  4.     <primitive: #primitiveNativeCall module: #NativeBoostPlugin>
  5.    
  6.     ^ NBFFICallout cdecl: #( double (ulong count, double float1 ))
  7.     emitCall: [:gen | | asm  proxy smpfr scnt|
  8.         asm := gen asm.
  9.         proxy := gen proxy.
  10.        
  11.         asm pop: asm ECX.
  12.         asm fld:  asm ESP ptr64 .
  13.         asm fld:  asm ESP ptr64 .
  14.         asm
  15.             label: #top;
  16.             cmp: asm ECX with: 0;
  17.             jz: #bottom.
  18.            
  19.             asm fadd: asm ST0 to: asm ST1.
  20.            
  21.         asm
  22.        
  23.             dec: asm ECX;
  24.             jmp: #top.
  25.        
  26.         asm label: #bottom.
  27.         "reserve temps for parameters passed in from Smalltalk"
  28.    
  29.                 "setup loop compare and jmp or push ECX and pass through to function call"
  30.    
  31.  
  32.     ]
Add Comment
Please, Sign In to add comment