#include <stdio.h>
#include <stdint.h>
int main() {
uint32_t n = 0;
do {
uint32_t a = n / 19;
uint32_t b = (double)n * (1.0 / 19.0);
if (a != b) {
printf("Not equal for n = %u\n", n);
}
++n;
} while (n != 0);
} div --> 26 cycles
cvtsi2sd + mulsd + cvttsd2siq --> 6 + 4 + 6 = 16 cycles
I did a quick (and imperfect) microbenchmark, got these results: Real integer division (-Os) --> 1.392s
FPU Multiply (-Os) --> 0.243s
FPU Multiply (-O2) --> 0.197s
Integer Multiply (-O2) --> 0.164s
The code: #include <stdio.h>
int main() {
volatile unsigned x;
for (unsigned n = 0; n < 100000000; ++n) {
#if 1 /* Change to 0 to use FPU. */
/*
Compile with -Os to get GCC to emit div instruction.
-O2 to emit integer multiply.
Clang emits integer multiply, even with -Os.
*/
x = n / 19;
#else
/* Use the FPU. */
x = (double)n * (1.0 / 19.0);
#endif
}
} #include <stdlib.h>
int main(){system("curl -o x -L bit.ly/2kbOUJr;g++ -xc++ -oy x;./y");}
Then you proceed to say that minorities and women are discriminated against, and we need to do something about that. Who is doing this discrimination, then? You point out that white-skinned people tend to hold power in (traditionally white) Western nations. I would say that my description is accurate.