Ver Mensaje Individual
  #8  
Antiguo 20-02-2016
xangiesaurx xangiesaurx is offline
Miembro
NULL
 
Registrado: feb 2016
Posts: 57
Reputación: 9
xangiesaurx Va por buen camino
Si, muchas gracias, se me había pasado lo del NativeInt :P Pero ya esta implementado

Ahora tengo otra duda (ya se que soy algo latosa en esto), pero me acabo de encontrar parte de código ensamblador, pero a lo que eh leido, ya no es compatible con XE5, existe alguna forma de lograr esta compatibilidad?
(Aquí dejo el código en cuestion)

Código Delphi [-]
function FastCpySSE(const D:Pointer; const S:Pointer; const count:dword):integer;
var dwNumElements, dwNumPacksWORD;
begin
 dwNumElements := count div sizeof(integer);
 // not really using it, just for debuging. it keeps number of looping.
 // it also means number of packed data.
 dwNumPacks := dwNumElements div (128 div (sizeof(integer)*8));

 asm
  // remember for cleanup
  pusha;
@@begin:
  // init counter to SizeInBytes
  mov  ecx,count
  // get destination pointer
  mov  edi,D
  // get source pointer
  mov  esi,S
@@begina:
  // check if counter is 0, yes end loop.
  cmp  ecx,0
  jz  @@end
@@body:
  // calculate offset
  mov  ebx,count
  sub  ebx,ecx
  // copy source's content to 128 bits registers
  movdqa xmm1,[esi+ebx]
  // copy 128 bits registers to destination
  movdqa [edi+ebx],xmm1;

@@bodya:
  // we've done "1 packed == 4 * sizeof(int)" already.
  sub  ecx,16;
  jmp  @@begina
@@end:
  // cleanup
  popa;
end;

 result := 0;;
end;
Gracias por toda su ayuda y de nuevo una disculpa por las molestias

Última edición por Casimiro Notevi fecha: 20-02-2016 a las 00:45:45.
Responder Con Cita