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