asmb: more hax
[uebersetzerbau-ss10.git] / asmb / asmb.s
index 28942c8d2aaef9c3411f016b9891c28419f436f9..8fb92b199a473241013aeb4388f95ef5258e55e3 100644 (file)
@@ -13,20 +13,22 @@ constc0:
        .rept 16
        .byte 0xc0
        .endr
+const00:
+       .rept 16
+       .byte 0x00
+       .endr
 
        .text
 .globl asmb
        .type   asmb, @function
 asmb:
 .LFB2:
-       xor %rdx, %rdx
-
-       //soll einfach null sein
-       pxor %xmm14, %xmm14
+       //speicheradresse des parameters zurueckgeben
+       mov %rdi, %rax
 
 .nextround:
        //speicheradresse des pointers zeigt auf 16*8 feld = 128bit
-       movdqu (%rdi, %rdx, 8), %xmm11
+       movdqu (%rdi), %xmm11
 
        // -64 - c
        movdqa constc0, %xmm9
@@ -39,26 +41,24 @@ asmb:
 
 .differenz:
        // Y = min(X, 'a' - 'A')
-       pminub const20, %xmm9
+       pand const20, %xmm9
 
        // c += Y
        paddb %xmm9, %xmm11
 
        // retuniere an die richtige speicheradresse
-       movdqu %xmm11, (%rdi, %rdx, 8)
+       movdqu %xmm11, (%rdi)
 
        //entspricht ein byte dem nullbyte dann steht an jener stelle 0xff sonst 0x00
-       pcmpeqb %xmm14, %xmm11
+       pcmpeqb const00, %xmm11
        //hol die MSBs aller bytes raus
        pmovmskb %xmm11, %ecx
-       add $2, %rdx
+       add $16, %rdi
 
        //ist %ecx gleich null? dann die naechsten 16byte bitte
        jecxz .nextround
 
-       //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
@@ -113,12 +113,13 @@ asmb:
 
 .endshift:
        //betreffende speicherstelle in %xmm11 laden
-       movdqu -16(%rax, %rdx, 8), %xmm11
+       movdqu -16(%rdi), %xmm11
        //und overhead wieder subtrahieren
        psubb %xmm9, %xmm11
 
        //ergebnis zurueckspielen und fertig \o/
-       movdqu %xmm11, -16(%rax, %rdx, 8)
+       movdqu %xmm11, -16(%rdi)
+*/
 
        ret
 .LFE2: