Skip to main content
16 events
when toggle format what by license comment
May 14, 2015 at 17:21 comment added JS1 @StepTNT It made the explanation easier. I also changed the next line, which used to read movaps xmm7, [mask1 + edx*4 - 16] to movaps xmm7, [mask1 + edx - 16] (notice I don't multiply edx by 4 because I shifted it by two extra already). Both ways should be equivalent.
May 14, 2015 at 12:41 comment added StepTNT Just a quick note: why did you change shl edx, 2 to shl edx, 4 ? It worked fine with 2, using 4 leads to wrong masks.
May 14, 2015 at 12:22 vote accept StepTNT
May 14, 2015 at 12:22 comment added StepTNT Oh dear, forgive me but I was working with the wrong dataset. Actually add ebx, 1 leads to segfault because I'm using movaps instead of movups while add ebx, 4 is 100% fine. Thank you for your reply and sorry for wasting your time like this!
May 14, 2015 at 11:47 history edited JS1 CC BY-SA 3.0
deleted 28 characters in body
May 14, 2015 at 11:43 comment added JS1 @StepTNT Test with these values: 0 10 0 0 0 0 0 0 vs 0 0 0 0 0 0 0 0 and pass in a length of 8. I got with +4: 10 and with +1: 14.14. Also I made an edit to my modified code, I removed an extraneous sub ebx after the end of the loop.
May 14, 2015 at 11:41 history edited JS1 CC BY-SA 3.0
deleted 28 characters in body
May 14, 2015 at 11:29 comment added StepTNT I'm testing it by checking which points are taken at each iteration, and they seem the correct ones. BTW I just discovered that it still works even if I remove completely the add, which is a bit odd. If you need it I can post a little snippet of my dataset with the result of the execution because I may be overlooking something.
May 14, 2015 at 11:24 comment added JS1 @StepTNT Does it really work though? It didn't for me. Did you test it with test values against a working C version?
May 14, 2015 at 11:22 history edited JS1 CC BY-SA 3.0
added 798 characters in body
May 14, 2015 at 11:09 comment added StepTNT I know that a float is 4 bytes, but I'm actually advancing on pointers, that's why ebx*4 moves to the next 4 items. If not, I couldn't explain why it does work :)
May 14, 2015 at 11:02 comment added JS1 @StepTNT A float is 4 bytes so ebx*4 will advance one float per one ebx. You need to advance 16 bytes per iteration, so add 4 to ebx. I'll try to add more explanation to the other parts.
May 14, 2015 at 9:27 comment added StepTNT Thanks for your great feedback. I'm using add ebx, 1 because I've got movaps xmm1, [esi+ebx*4] so it's still moving each 4 items. I don't know which one is faster but I think that the code is correct. Removing the jump is a great idea, but can you please add some explanation to the division and the masking parts? I'd like to understand what I write. Finally, I'm using movaps because I'm aligning my data in the caller, so I'm sure that it won't lead to a segfault.
May 14, 2015 at 3:31 history edited JS1 CC BY-SA 3.0
Use movups instead of movaps.
May 14, 2015 at 3:21 history edited JS1 CC BY-SA 3.0
added 502 characters in body
May 14, 2015 at 3:12 history answered JS1 CC BY-SA 3.0