cb1e8bcf36317fda065159f731e50d9f0ef17882
[uebersetzerbau-ss10.git] / asma / asma.s
1         .file   "asma.c"
2
3         .data
4         .align 16
5 const65:
6         .rept 16
7         .byte 0x65
8         .endr
9 const20:
10         .rept 16
11         .byte 0x20
12         .endr
13 constc0:
14         .rept 16
15         .byte 0xc0
16         .endr
17
18         .text
19 .globl asma
20         .type   asma, @function
21 asma:
22 .LFB2:
23         // folgendes kann umgeformt werden (max_t = 127)
24         // X = 'Z' + 1 + min_t - 'A' > c + min_t - 'A' ? 0xff : 0
25         // X =      -c + max_t + 'A' > - 'Z' -1 + max_t + 'A' ? 0xff : 0
26         // X =         -c + 127 + 65 > - 90 - 1 + 127 + 65 ? 0xff : 0
27         // X =               -c - 64 > 101 ? 0xff : 0
28         // X =               -64 - c > 101 ? 0xff : 0
29         // ...
30         // 101 = 0x65
31         // -64 = 0xc0
32
33         // speicheradresse des pointers zeigt auf 16*8 feld = 128bit
34         movdqu (%rdi), %xmm11
35
36         // -64 - c
37         movdqa constc0, %xmm9
38         psubb %xmm11, %xmm9
39
40         // "Packed COMpare Greater Than (Byte)"
41         // achtung beim intuitiven lesen des befehles. 'kleiner'
42         // ist mit 'groesser' vertauscht und vice versa
43         pcmpgtb const65, %xmm9
44
45         // Y = min(X, 'a' - 'A')
46         // mit 'a'-'A'= 97-65 = 32 = 0x20
47         pminub const20, %xmm9
48
49         // c += Y
50         paddb %xmm9, %xmm11
51
52         // retuniere an die richtige speicheradresse
53         mov %rdi, %rax
54         movdqu %xmm11, (%rax)
55
56         ret
57 .LFE2:
58         .size   asma, .-asma
59         .section        .eh_frame,"a",@progbits
60 .Lframe1:
61         .long   .LECIE1-.LSCIE1
62 .LSCIE1:
63         .long   0x0
64         .byte   0x1
65         .string "zR"
66         .uleb128 0x1
67         .sleb128 -8
68         .byte   0x10
69         .uleb128 0x1
70         .byte   0x3
71         .byte   0xc
72         .uleb128 0x7
73         .uleb128 0x8
74         .byte   0x90
75         .uleb128 0x1
76         .align 8
77 .LECIE1:
78 .LSFDE1:
79         .long   .LEFDE1-.LASFDE1
80 .LASFDE1:
81         .long   .LASFDE1-.Lframe1
82         .long   .LFB2
83         .long   .LFE2-.LFB2
84         .uleb128 0x0
85         .align 8
86 .LEFDE1:
87         .ident  "GCC: (Debian 4.3.2-1.1) 4.3.2"
88         .section        .note.GNU-stack,"",@progbits