AnsweredAssumed Answered

New Intel I5&E5 removed floating point divisions making them extremely slow

Question asked by jlopez2022 on Sep 26, 2017
Latest reply on Sep 30, 2017 by JBtech

Does new Ryzen 7 has still floatin point alus?

 

This was the result of my test on a new E5 processor under win10 with a Intel xeon CPU E5-1620 v3 @3.5Ghz obtaining simitar results than raspberry pi performance. My bear grew waiting.

 

I obtained:

 

integer sums: 2184 Mops (megaoperations/second) as expected

double divisions: 15.6 - 18.32 Mops   !!!!!!!!!!!!!!!

float divisions: 17.3 - 19.1 Mops       not 1700 but 17 only!!!!

double multiplications: 344 -430 Mops

double sums: 881 - 1178 Mops

 

I tested also on a I5 and divisions where slower than 21 MOPs.

 

Please test it in a Ryzen 7.

 

This is the C++ test:

 

#include <iostream>

#include <time.h> //clock(), time_t

#pragma warning(disable:4996) //disable deprecateds
using namespace std;

 

 

time_t start,stop;char null_char='\0';

//Use empty timer() to reset start time:

void timer(char *title=&null_char,int data_size=1){ stop=clock(); if (*title) cout<<title<< " time ="<<(double) (stop-start)/(double) CLOCKS_PER_SEC<< " = " << 1e-6*data_size/( (double)(stop-start)/(double)CLOCKS_PER_SEC ) <<  " Mops/seg"  <<endl; start=clock(); }

 

 

int main()

{

cout << "Perform test in Release mode. Results will be wrong in debug mode" <<endl;

int isum=0,size=100*1024*1024;

timer();//void timer resets timer!

for (int i=0;i<size;i++)

isum+=i;

timer("Time for 100 Mega int sums ",size);

double dsum=1.0;

for (int i=0;i<size;i++)

dsum=dsum/1.1111;

timer("Time for 100 Mega double divisions",size);double d2=1.111;dsum+=0.1;

for (int i=0;i<size;i++)

dsum/=d2;

timer("Time for 100 Mega double divisions-2",size);

float fsum=1.0f;

for (int i=0;i<size;i++)

fsum=fsum/1.1111f;

timer("Time for 100 Mega float divisions",size);

for (int i=0;i<size;i++)

dsum=dsum*d2;

timer("Time for 100 Mega double multiplications",size);

for (int i=0;i<size;i++)

dsum=dsum+d2;

timer("Time for 100 Mega sums multiplications",size);

 

cout<<endl<<" Reject following line data (done to force for loops be performed after compiler optimizations):"<<endl;;

cout<<isum<<dsum<<fsum<<endl;//to force for() be done on isum

cout<<"=== FIN ==="<<endl;getchar();

return 1;

}

Outcomes