Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module fstress.utils;
- const long
- sample_size = 1000000000,
- op_size = 8;
- private const float
- a = 1.2345f,
- b = 2.3456f,
- c = 3.4567f;
- private const real
- ca = 1.2345f,
- cb = 2.3456f,
- cc = 3.4567f;
- // Perform floating point operations in general
- // purpose registers (EAX, EBX, ECX, EDX)
- void FPBenchGPR() {
- asm {
- mov EAX, a ;
- mov EBX, b ;
- mov ECX, c ;
- div EAX, EBX ;
- imul ECX, EAX ;
- add EBX, ECX ;
- sub ECX, EAX ;
- }
- }
- // Perform floating point operations in SSE registers
- // (XMM0, XMM1, XMM2, XMM3, XMM4, XMM5, XMM6, XMM7)
- void FPBenchXMM() {
- asm {
- movaps XMM0, ca;
- movaps XMM1, cb;
- movaps XMM2, cc;
- divps XMM0, XMM1;
- mulps XMM2, XMM0;
- addps XMM1, XMM2;
- subps XMM2, XMM0;
- }
- }
Add Comment
Please, Sign In to add comment