//speicheradresse des parameters zurueckgeben (wird noch modifziert)
mov %rdi, %rax
- /*===============
- * ab hier uebler hax um nach \0 trotzdem die gleichen bytes wie
- * input zu haben, also um selbiges verhalten wie asmb_ref zu erzwingen */
+ //===============
+ //ab hier uebler hax um nach \0 trotzdem die gleichen bytes wie
+ //input zu haben, also um selbiges verhalten wie asmb_ref zu erzwingen
//\0 byte stelle durch rausfinden des MSB des %ecx
bsf %ecx, %r11d
psubb %xmm9, %xmm11
//ergebnis zurueckspielen und fertig \o/
- movapd %xmm11, -16(%rax, %rdx, 8)
+ movdqu %xmm11, -16(%rax, %rdx, 8)
ret
.LFE2:
}
}
+static void fillregisters(void)
+{
+ __asm__("push %rdx\n\t");
+ __asm__("mov $12345678, %rdx\n\t");
+
+ __asm__("movq %rdx, %xmm0\n\t");
+ __asm__("movq %rdx, %xmm1\n\t");
+ __asm__("movq %rdx, %xmm2\n\t");
+ __asm__("movq %rdx, %xmm3\n\t");
+ __asm__("movq %rdx, %xmm4\n\t");
+ __asm__("movq %rdx, %xmm5\n\t");
+ __asm__("movq %rdx, %xmm6\n\t");
+ __asm__("movq %rdx, %xmm7\n\t");
+ __asm__("movq %rdx, %xmm8\n\t");
+ __asm__("movq %rdx, %xmm9\n\t");
+ __asm__("movq %rdx, %xmm10\n\t");
+ __asm__("movq %rdx, %xmm11\n\t");
+ __asm__("movq %rdx, %xmm12\n\t");
+ __asm__("movq %rdx, %xmm13\n\t");
+ __asm__("movq %rdx, %xmm14\n\t");
+ __asm__("movq %rdx, %xmm15\n\t");
+ __asm__("pop %rdx\n\t");
+}
+
+
#define NUM_TESTCASES 18
int main()
{
16,
17,
};
+ int off[NUM_TESTCASES] = {
+ 0,
+ 0,
+ 0,
+ 0,
+ 1,
+ 2,
+ 2,
+ 1,
+ 3,
+ 6,
+ 5,
+ 6,
+ 6,
+ 2,
+ 0,
+ 0,
+ 0,
+ 0,
+ };
char *output_our, *output_ref;
char *input_our, *input_ref;
int right=0, wrong=0, neither=0, i;
(void) memcpy(input_our, input[i], len[i]+1);
(void) memcpy(input_ref, input[i], len[i]+1);
- output_our = (char *) asmb((unsigned char *) input_our);
- output_ref = (char *) asmb_ref((unsigned char *) input_ref);
+ fillregisters();
+ output_our = (char *) asmb((unsigned char *) input_our+off[i]);
+ output_ref = (char *) asmb_ref((unsigned char *) input_ref+off[i]);
if(memcmp(output_our,output_ref, len[i]) != 0) {
if(strncmp(output_our, output_ref, len[i]) == 0) {