From 2bb78a37f318881f202fd60111e8eabb580d3082 Mon Sep 17 00:00:00 2001 From: Bernhard Urban Date: Tue, 9 Mar 2010 15:08:00 +0100 Subject: [PATCH] asma: ahh.. man kann ja gleich die speicherstelle der konstanten angeben --- asma/asma.s | 25 ++++++++++--------------- 1 file changed, 10 insertions(+), 15 deletions(-) diff --git a/asma/asma.s b/asma/asma.s index 301ecef..e8ef508 100644 --- a/asma/asma.s +++ b/asma/asma.s @@ -27,19 +27,13 @@ asma: * (~102)+1 = 10011010 = 0x9A */ movdqa const9a, %xmm8 - //init %xmm9 mit "'a'-'A'= 97-65 = 32 = 0x20 - movdqa const20, %xmm9 - //speicheradresse des pointers zeigt auf 16*8 feld = 128bit movdqu (%rdi), %xmm11 - movdqu (%rdi), %xmm12 /*addiere in %xmm11 "min_t-'A'" - * = -128 - 65 = 63 = 0x3f */ - movdqa const3f, %xmm10 - - //c+min_t-'A' - paddb %xmm10, %xmm11 + * = -128 - 65 = 63 = 0x3f + * c+min_t-'A' */ + paddb const3f, %xmm11 /*"Packed COMpare Greater Than (Byte)" * X = 'Z' + 1 + min_t - 'A' > c + min_t - 'A' ? 0xff : 0 @@ -47,15 +41,16 @@ asma: * ist mit 'groesser' vertauscht und vice versa */ pcmpgtb %xmm11, %xmm8 - //Y = min(X, 'a' - 'A') - pminub %xmm9, %xmm8 - - //c += Y - paddb %xmm8, %xmm12 + /*Y = min(X, 'a' - 'A') + * mit "'a'-'A'= 97-65 = 32 = 0x20 */ + pminub const20, %xmm8 //retuniere an die richtige speicheradresse mov %rdi, %rax - movapd %xmm12, (%rax) + //c += Y + paddb (%rax), %xmm8 + movapd %xmm8, (%rax) + ret .LFE2: .size asma, .-asma -- 2.25.1