asm{a,b}: section hax, finally
[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         //init %xmm9 mit "'a'-'A'= 97-65 = 32 = 0x20
31         movdqa const20, %xmm9
32
33         //speicheradresse des pointers zeigt auf 16*8 feld = 128bit
34         movdqu (%rdi), %xmm11
35         movdqu (%rdi), %xmm12
36
37         /*addiere in %xmm11 "min_t-'A'"
38         * = -128 - 65 = 63 = 0x3f */
39         movdqa const3f, %xmm10
40
41         //c+min_t-'A'
42         paddb %xmm10, %xmm11
43
44         /*"Packed COMpare Greater Than (Byte)"
45         * X = 'Z' + 1 + min_t - 'A' > c + min_t - 'A' ? 0xff : 0
46         * achtung beim intuitiven lesen des befehles. 'kleiner' 
47         * ist mit 'groesser' vertauscht und vice versa */
48         pcmpgtb %xmm11, %xmm8
49
50         //Y = min(X, 'a' - 'A')
51         pminub %xmm9, %xmm8
52
53         //c += Y
54         paddb %xmm8, %xmm12
55
56         //retuniere an die richtige speicheradresse
57         mov %rdi, %rax
58         movapd %xmm12, (%rax)
59         ret
60 .LFE2:
61         .size   asma, .-asma
62         .section        .eh_frame,"a",@progbits
63 .Lframe1:
64         .long   .LECIE1-.LSCIE1
65 .LSCIE1:
66         .long   0x0
67         .byte   0x1
68         .string "zR"
69         .uleb128 0x1
70         .sleb128 -8
71         .byte   0x10
72         .uleb128 0x1
73         .byte   0x3
74         .byte   0xc
75         .uleb128 0x7
76         .uleb128 0x8
77         .byte   0x90
78         .uleb128 0x1
79         .align 8
80 .LECIE1:
81 .LSFDE1:
82         .long   .LEFDE1-.LASFDE1
83 .LASFDE1:
84         .long   .LASFDE1-.Lframe1
85         .long   .LFB2
86         .long   .LFE2-.LFB2
87         .uleb128 0x0
88         .align 8
89 .LEFDE1:
90         .ident  "GCC: (Debian 4.3.2-1.1) 4.3.2"
91         .section        .note.GNU-stack,"",@progbits