News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests

Main Menu

MASM FOR FUN - REBORN - #0 Extract low order bytes from dwords

Started by frktons, November 25, 2012, 02:48:06 AM

Previous topic - Next topic

frktons

So the complete test for greater, less than or equal should
be something like this:


        pcmpgtd   xmm0,xmm1
pmovmskb eax,xmm0
        .if bit ax, 15
            jmp IsGreater
        .endif

pcmpgtd xmm2,xmm3; same values in reverse order
pmovmskb ebx,xmm2
        .if bit bx, 15
            jmp IsLessThan
        .endif
        .if ax == bx
            jmp AreEqual
        .elseif ax > bx
            jmp IsGreater
        .else
            jmp IsLessThan
        .endif


I'll try the code and let you know.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

nidud

deleted

frktons

Read again my last posts, yes we can know if the
compare gives GT, LT or EQ.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

nidud

deleted

nidud

deleted

nidud

deleted

frktons

my test for atol:


Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz (SSE4)
--------------------------------------------------------
429117  cycles for atol LODSB
350976  cycles for atol SHL
411231  cycles for atol LEA
--------------------------------------------------------
430242  cycles for atol LODSB
509282  cycles for atol SHL
395102  cycles for atol LEA
--------------------------------------------------------


well they are a bit random, as you said.
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

frktons

Memcpy:


Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz (SSE4)
--------------------------------------------------------
757223  cycles for memcpy A
288975  cycles for memcpy movdqa xmm0 A
1352024 cycles for memcpy movdqu xmm0 A
1367569 cycles for memcpy movdqu xmm0..xmm7 A
5668726 cycles for memcpy movdqu xmm0 U
4563076 cycles for memcpy movdqu xmm0..xmm7 U
--------------------------------------------------------
749649  cycles for memcpy A
302916  cycles for memcpy movdqa xmm0 A
1737163 cycles for memcpy movdqu xmm0 A
1841807 cycles for memcpy movdqu xmm0..xmm7 A
6136384 cycles for memcpy movdqu xmm0 U
4055501 cycles for memcpy movdqu xmm0..xmm7 U
--------------------------------------------------------


and the last routines:


Intel(R) Core(TM)2 CPU          6600  @ 2.40GHz (SSE4)
--------------------------------------------------------
5825483 cycles for crt_memcpy A
7352188 cycles for memcpy A
7269901 cycles for memcpyd A
4146083 cycles for memcpy movdqa A
8700368 cycles for memcpy movdqu A
27212513        cycles for memcpy movdqu U
--------------------------------------------------------
6180618 cycles for crt_memcpy A
9100718 cycles for memcpy A
7028934 cycles for memcpyd A
4151090 cycles for memcpy movdqa A
11923657        cycles for memcpy movdqu A
29665081        cycles for memcpy movdqu U
--------------------------------------------------------


There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

frktons

You could find interesting the test we did a couple of years ago:



There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

nidud

deleted


nidud

deleted

frktons

Quote from: nidud on December 04, 2012, 06:48:06 AM

We either all use the same CPU or stick to the basic then  :lol:


Optimization is quite a strange beast indeed, it comes and goes
depending on many [maybe too many] factors.
Nevertheless we can try and find something that we didn't expect :lol:
There are only two days a year when you can't do anything: one is called yesterday, the other is called tomorrow, so today is the right day to love, believe, do and, above all, live.

Dalai Lama

jj2007

Quote from: nidud on December 04, 2012, 06:48:06 AM
Intel(R) Core(TM) i3 CPU         540  @ 3.07GHz (SSE4)
6.065.640       cycles for RtlZeroMemory
5.992.196       cycles for rep stosd
7.240.756       cycles for MOVNTDQ

It seems Intel is still working on rep stosd..!

GabrielRavier

I tried it for fun (haven't even read messages here though so this is prolly bad code) :
My github profile
https://github.com/GabrielRavier