X-Git-Url: https://git.openssl.org/?a=blobdiff_plain;f=crypto%2Fperlasm%2Fx86unix.pl;h=cdfd740154d079f2a32f83e4eb0f94867d4f3f39;hb=0c0788ba0ad28b493b50a97439f67b92d1edc6f7;hp=79c1abb99dad49f1e3e0b94f2384a79f4cd9b76d;hpb=c85c5c408af0996daa5f807c488f921e7e7ad524;p=openssl.git diff --git a/crypto/perlasm/x86unix.pl b/crypto/perlasm/x86unix.pl index 79c1abb99d..cdfd740154 100644 --- a/crypto/perlasm/x86unix.pl +++ b/crypto/perlasm/x86unix.pl @@ -161,13 +161,13 @@ sub main'shl { &out2("sall",@_); } sub main'shr { &out2("shrl",@_); } sub main'xor { &out2("xorl",@_); } sub main'xorb { &out2("xorb",@_); } -sub main'add { &out2("addl",@_); } +sub main'add { &out2($_[0]=~/%[a-d][lh]/?"addb":"addl",@_); } sub main'adc { &out2("adcl",@_); } sub main'sub { &out2("subl",@_); } sub main'sbb { &out2("sbbl",@_); } sub main'rotl { &out2("roll",@_); } sub main'rotr { &out2("rorl",@_); } -sub main'exch { &out2("xchg",@_); } +sub main'exch { &out2($_[0]=~/%[a-d][lh]/?"xchgb":"xchgl",@_); } sub main'cmp { &out2("cmpl",@_); } sub main'lea { &out2("leal",@_); } sub main'mul { &out1("mull",@_); } @@ -189,7 +189,7 @@ sub main'jc { &out1("jc",@_); } sub main'jnc { &out1("jnc",@_); } sub main'jno { &out1("jno",@_); } sub main'dec { &out1("decl",@_); } -sub main'inc { &out1("incl",@_); } +sub main'inc { &out1($_[0]=~/%[a-d][hl]/?"incb":"incl",@_); } sub main'push { &out1("pushl",@_); $stack+=4; } sub main'pop { &out1("popl",@_); $stack-=4; } sub main'pushf { &out0("pushfl"); $stack+=4; } @@ -205,9 +205,10 @@ sub main'nop { &out0("nop"); } sub main'test { &out2("testl",@_); } sub main'bt { &out2("btl",@_); } sub main'leave { &out0("leave"); } -sub main'cpuid { &out0(".word\t0xa20f"); } -sub main'rdtsc { &out0(".word\t0x310f"); } +sub main'cpuid { &out0(".byte\t0x0f,0xa2"); } +sub main'rdtsc { &out0(".byte\t0x0f,0x31"); } sub main'halt { &out0("hlt"); } +sub main'movz { &out2("movzbl",@_); } # SSE2 sub main'emms { &out0("emms"); } @@ -552,18 +553,18 @@ sub main'file_end pushf popl %eax xorl %ecx,%eax - bt \$21,%eax + btl \$21,%eax jnc 1f pushl %edi pushl %ebx movl %edx,%edi movl \$1,%eax - .word 0xa20f + .byte 0x0f,0xa2 orl \$1<<10,%edx movl %edx,0(%edi) popl %ebx popl %edi - .align 4 + .align $align 1: ___ push (@out,$tmp); @@ -708,6 +709,7 @@ sub main'initseg $tmp=<<___; .section .init call $under$f + .align $align ___ } elsif ($main'coff)