flat assembler
Message board for the users of flat assembler.
Index
> Main > What is faster Div or SSE2 divss ? |
Author |
|
Roman 09 Aug 2013, 09:42
What is faster Div or SSE2 divss ?
And how write asm code work like Div ? And asm code faster than Div (asm comand) |
|||
09 Aug 2013, 09:42 |
|
tthsqe 09 Aug 2013, 10:10
The timings of division instructions (integer, single, double) depend on the divisor. Why don't you run some tests on you own computer?
|
|||
09 Aug 2013, 10:10 |
|
Roman 09 Aug 2013, 11:18
tthsqe
ok ! PS: А так хотелось поговорить,пообщяться. |
|||
09 Aug 2013, 11:18 |
|
Madis731 12 Aug 2013, 05:29
Your questions cannot be answered because DIV/IDIV work on integers, but DIVSS/DIVPS work on floating point numbers. They are generally equally fast, integer one taking 20-27 clocks while floating point taking 10-14 clock to execute (these are the latencies for Sandy Bridge CPU). While comparing DIVSS to FDIV you lose precision. FDIV takes 10-24 clocks. So you see they are competing in the same class, measured in "tens of clocks".
There are some tricks (with integer arithmetric): http://www.azillionmonkeys.com/qed/adiv.html For example I often find myself using (x*0x55555556) shr 32 instead of x/3 because in simple cases it works and is a lot faster. You can easily extend this to division by 6, 12 etc by shifting. Useful in 24-bi / 32-bit RGB / RGBA conversions. |
|||
12 Aug 2013, 05:29 |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2024, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.