News:

Masm32 SDK description, downloads and other helpful links
Message to All Guests
NB: Posting URL's See here: Posted URL Change

Main Menu

Mixcolumns ordination

Started by cpu2, April 03, 2014, 03:41:12 PM

Previous topic - Next topic

cpu2

Hello

I`m implementing the function Mixcolunms. I`m on the step of instructing the double word, they do it with shift bits.

I wonder if there is a better way. I cant not use pshufb. I can show what i have done.

Thanks an sorry for my expression.


Gunther

Hi cpu2,

please show us your code and we'll see what can be done.

Gunther
You have to know the facts before you can distort them.

dedndave

this isn't exactly what you are looking for
but, it is pretty cool and might give you ideas to work with

Drizz "Stir Fry" bitswap
http://www.masmforum.com/board/index.php?topic=12722.msg98224#msg98224

cpu2

Okay, i will read the link.

This is the implementation.

bts0_: .quad 0x8080808080808080,0x8080808080808080    ; 0x600218
dlb0_: .quad 0x7f7f7f7f7f7f7f7f,0x7f7f7f7f7f7f7f7f    ; 0x600228
xrb0_: .quad 0x1b1b1b1b1b1b1b1b,0x1b1b1b1b1b1b1b1b    ; 0x600238

.section .text
.globl _start

_start:

//// intel_syntax

//// xmm0 = 2 x ; xmm1 = 1 x ; xmm2 = 3 x

movdqa xmm1, xmm0
movdqa xmm2, xmm1
pand xmm0, 0x600218
pcmpeqb xmm0, 0x600218
movdqa xmm3, xmm0
pand xmm1, xmm0
pandn xmm0, xmm2
pand xmm1, 0x600228
pslld xmm0, 1
pslld xmm1, 1
pxor xmm1, 0x600238
pand xmm1, xmm3
pxor xmm0, xmm1
pxor xmm2, xmm0


Only is the ordination an XOR. As seen?

Thanks.

cpu2

Already solved the problem. I use the pslld/psrld and movdqa instructions, for the ordination.

If i want the result, say.

Regards.