asm{a,b}: section hax, finally
authorBernhard Urban <lewurm@gmail.com>
Mon, 8 Mar 2010 15:32:13 +0000 (16:32 +0100)
committerBernhard Urban <lewurm@gmail.com>
Mon, 8 Mar 2010 15:32:13 +0000 (16:32 +0100)
asma/asma.s
asmb/asmb.s

index 84151dbc1036afc4dc32a8cf596cccca3de318f8..301ecef81af469df72d92edc9ad039a73b9144ae 100644 (file)
@@ -1,4 +1,20 @@
        .file   "asma.c"
+
+.section .rodata
+.align 128
+const9a:
+       .rept 16
+       .byte 0x9a
+       .endr
+const20:
+       .rept 16
+       .byte 0x20
+       .endr
+const3f:
+       .rept 16
+       .byte 0x3f
+       .endr
+
        .text
 .globl asma
        .type   asma, @function
@@ -9,14 +25,10 @@ asma:
        * 102 = 01100110
        * ~102 = 10011001
        * (~102)+1 = 10011010 = 0x9A */
-       mov $0x9a9a9a9a9a9a9a9a, %rax
-       movq %rax, %xmm15
-       movddup %xmm15, %xmm8
+       movdqa const9a, %xmm8
 
        //init %xmm9 mit "'a'-'A'= 97-65 = 32 = 0x20
-       mov $0x2020202020202020, %rax
-       movq %rax, %xmm15
-       movddup %xmm15, %xmm9
+       movdqa const20, %xmm9
 
        //speicheradresse des pointers zeigt auf 16*8 feld = 128bit
        movdqu (%rdi), %xmm11
@@ -24,9 +36,7 @@ asma:
 
        /*addiere in %xmm11 "min_t-'A'"
        * = -128 - 65 = 63 = 0x3f */
-       mov $0x3f3f3f3f3f3f3f3f, %rax
-       movq %rax, %xmm15
-       movddup %xmm15, %xmm10
+       movdqa const3f, %xmm10
 
        //c+min_t-'A'
        paddb %xmm10, %xmm11
index 540a28fbccad1658866753fc016b6727ecacf860..e46b6b05662418ad5b6dae681219c5718d4b10ca 100644 (file)
@@ -1,4 +1,19 @@
        .file   "asmb.c"
+.section .rodata
+.align 128
+const9a:
+       .rept 16
+       .byte 0x9a
+       .endr
+const20:
+       .rept 16
+       .byte 0x20
+       .endr
+const3f:
+       .rept 16
+       .byte 0x3f
+       .endr
+
        .text
 .globl asmb
        .type   asmb, @function
@@ -14,20 +29,14 @@ asmb:
        * 102 = 01100110
        * ~102 = 10011001
        * (~102)+1 = 10011010 = 0x9A */
-       mov $0x9a9a9a9a9a9a9a9a, %rax
-       movq %rax, %xmm8
-       punpcklbw %xmm8, %xmm8
+       movdqa const9a, %xmm8
 
        //init %xmm9 mit "'a'-'A'= 97-65 = 32 = 0x20
-       mov $0x2020202020202020, %rax
-       movq %rax, %xmm9
-       punpcklbw %xmm9, %xmm9
+       movdqa const20, %xmm9
 
        /*addiere in %xmm11 "min_t-'A'"
        * = -128 - 65 = 63 = 0x3f */
-       mov $0x3f3f3f3f3f3f3f3f, %rax
-       movq %rax, %xmm10
-       punpcklbw %xmm10, %xmm10
+       movdqa const3f, %xmm10
 
 .nextround:
        //speicheradresse des pointers zeigt auf 16*8 feld = 128bit