flat assembler
Message board for the users of flat assembler.
![]() |
Author |
|
windwakr 11 Jul 2009, 23:41
3. Use CPUID, its in the cpuid manual.
Call CPUID with EAX being 1 EDX can tell you support for SSE and SSE2 bit 25 is SSE bit 26 is SSE2 ECX can tell you support for SSE3 SSSE3 SSE4.1 and SSE4.2 bit 0 is SSE3 bit 9 is SSSE3 bit 19 is SSE4.1 bit 20 is SSE4.2 EDIT: *FACEPALM*, I stupidly forgot that the Windows API modifies the registers, boy do I feel dumb...Works good now... Code: ;SSE detection, by ---- aka windwakr ;Saturday, July 11, 2009 7/11/09 Last edited by windwakr on 15 Jul 2012, 21:02; edited 7 times in total |
|||
![]() |
|
r22 12 Jul 2009, 00:10
@pal
In regards to your questions 1 - Loading data into XMMX is best performed all at once using an aligned data source and the MOVDQA opcode Code: align 16 bignum dq 1234567812345678h, 11111111ffffffffh ... movdqa xmm0, dqword[bignum] 2. Subtracting one can be performed similar to the above, using an aligned data source. Code: align 16 sub1fromallbytes dq 0101010101010101h, 0101010101010101h sub1fromallqwords dq 0000000000000001h, 0000000000000001h ... psubb XMM0,dqword[sub1fromallbytes] psubq XMM0,dqword[sub1fromallqwords] I find encryption and prng a very interesting topic. In fact I wrote my honors thesis for college on it, and documented my work on this board. http://board.flatassembler.net/topic.php?t=6518&postdays=0&postorder=asc&start=0 You may want to read it if you get a chance. The PROE algorithm is used for encryption, but the PRNG portion can be easily stripped out and analyzed. Using the NIST (national institute of standards and technology) test suite as well as ENT (a program used for testing randomness). I was able to verify that my PRNG is cryptographically secure (extremely random). |
|||
![]() |
|
pal 12 Jul 2009, 12:02
windwakr: I thought it may have been something to do with cpuid, stupidly I didn't check the manual even though I was reading it the other day. Personally to test it I would have used bt but upon reading I have found that this takes 4 clocks for a reg,imm8.
r22: Again stupidly I completely forgot about just putting the data in a memory location, though I haven't come across movdqa yet so I'll have a play with that. Your PRNG looks very interesting, I am going to be sure to have a decent look at it, cheers for linking me to that man. Cheers to both of you for your help by the way ![]() |
|||
![]() |
|
< Last Thread | Next Thread > |
Forum Rules:
|
Copyright © 1999-2023, Tomasz Grysztar. Also on GitHub, YouTube.
Website powered by rwasa.