Commit graph

226 commits

Author SHA1 Message Date
Gergely Nagy
1bb7310bf8 Fix compilation when using MASM on x86
The generated asm code from x86cpuid.pl contains CMOVE instructions
which are only available on i686 and later CPUs.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1459)
2016-08-16 14:46:55 -04:00
Andy Polyakov
9c940446f6 crypto/x86[_64]cpuid.pl: add OPENSSL_ia32_rd[rand|seed]_bytes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-15 13:20:52 +02:00
Andy Polyakov
f198cc43a0 SPARC assembly pack: enforce V8+ ABI constraints.
Even though it's hard to imagine, it turned out that upper half of
arguments passed to V8+ subroutine can be non-zero.

["n" pseudo-instructions, such as srln being srl in 32-bit case and
srlx in 64-bit one, were implemented in binutils 2.10. It's assumed
that Solaris assembler implemented it around same time, i.e. 2000.]

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-07-01 14:25:08 +02:00
Andy Polyakov
67b8bf4d84 perlasm/x86_64-xlate.pl: address errors and warnings in elderly perls.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-24 22:10:19 +02:00
David Benjamin
abeae4d325 Make arm-xlate.pl set use strict.
It was already nearly clean. Just one undeclared variable.

Reviewed-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1240)
2016-06-20 16:26:15 -04:00
Andy Polyakov
4e3d2866b6 perlasm/x86*.pl: add endbranch instruction.
For further information see "Control-flow Enforcement Technology
Preview" by Intel.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 23:43:52 +02:00
Andy Polyakov
1eb12c437b perlasm/x86_64-xlate.pl: add commentary.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:50:47 +02:00
Andy Polyakov
6a4ea0022c perlasm/x86_64-xlate.pl: refactor argument parsing loop.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:50:42 +02:00
David Benjamin
c25278db8e Make x86_64-xlate.pl 'use strict' clean.
use strict would have caught a number of historical bugs in the perlasm
code, some in the repository and some found during review. It even found
a fresh masm-only bug (see below).

This required some tweaks. The "single instance is enough" globals got
switched to proper blessed objects rather than relying on symbolic refs.
A few types need $opcode passed in as a result.

The $$line thing is a little bit of a nuisance. There may be a clearer
pattern to use instead.

This even a bug in the masm code.
9b634c9b37 added logic to make labels
global or function-global based on whether something starts with a $,
seemingly intended to capture the $decor setting of '$L$'. However, it
references $ret which is not defined in label::out. label::out is always
called after label::re, so $ret was always the label itself, so the line
always ran.

I've removed the regular expression so as not to change the behavior of
the script. A number of the assembly files now routinely jump across
functions, so this seems to be the desired behavior now.

GH#1165

Signed-off-by: Andy Polyakov <appro@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-06-14 22:50:04 +02:00
Rich Salz
b8a9af6881 Remove/rename some old files.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-06-01 11:29:57 -04:00
Rich Salz
e0a651945c Copyright consolidation: perl files
Add copyright to most .pl files
This does NOT cover any .pl file that has other copyright in it.
Most of those are Andy's but some are public domain.
Fix typo's in some existing files.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20 09:45:40 -04:00
Andy Polyakov
d405aa2ff2 perlasm/x86_64-xlate.pl: make latest ml64 work.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-20 09:51:33 +02:00
Andy Polyakov
e0e532823f PPC assebmly pack: initial POWER9 support tidbits.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-04-13 12:09:46 +02:00
Andy Polyakov
eb77e8886d SPARCv9 assembly pack: unify build rules and argument handling.
Make all scripts produce .S, make interpretation of $(CFLAGS)
pre-processor's responsibility, start accepting $(PERLASM_SCHEME).
[$(PERLASM_SCHEME) is redundant in this case, because there are
no deviataions between Solaris and Linux assemblers. This is
purely to unify .pl->.S handling across all targets.]

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-03-08 15:51:06 +01:00
Andy Polyakov
6e42e3ff9c perlasm/x86_64-xlate.pl: handle binary constants early.
Not all assemblers of "gas" flavour handle binary constants, e.g.
seasoned MacOS Xcode doesn't, so give them a hand.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-03-07 14:51:26 +01:00
Viktor Dukhovni
ce3d25d3e5 Fix some issues near recent chomp changes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 02:54:48 -05:00
Richard Levitte
9ba96fbb25 Perl's chop / chomp considered bad, use a regexp instead
Once upon a time, there was chop, which somply chopped off the last
character of $_ or a given variable, and it was used to take off the
EOL character (\n) of strings.

... but then, you had to check for the presence of such character.

So came chomp, the better chop which checks for \n before chopping it
off.  And this worked well, as long as Perl made internally sure that
all EOLs were converted to \n.

These days, though, there seems to be a mixture of perls, so lines
from files in the "wrong" environment might have \r\n as EOL, or just
\r (Mac OS, unless I'm misinformed).

So it's time we went for the more generic variant and use s|\R$||, the
better chomp which recognises all kinds of known EOLs and chops them
off.

A few chops were left alone, as they are use as surgical tools to
remove one last slash or one last comma.

NOTE: \R came with perl 5.10.0.  It means that from now on, our
scripts will fail with any older version.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 22:11:48 +01:00
Andy Polyakov
fd7dc201d3 perlasm/x86_64-xlate.pl: pass pure constants verbatim.
RT#3885

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 21:07:44 +01:00
Andy Polyakov
a98c648e40 x86[_64] assembly pack: add ChaCha20 and Poly1305 modules.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-10 10:31:14 +01:00
FdaSilvaYY
0d4fb84390 GH601: Various spelling fixes.
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-05 15:25:50 -05:00
Andy Polyakov
a285992763 ARMv4 assembly pack: allow Thumb2 even in iOS build,
and engage it in most modules.

Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-12-07 12:06:06 +01:00
Andy Polyakov
b5516cfbd6 perlasm/ppc-xlate.pl: comply with ABIs that specify vrsave as reserved.
RT#4162

Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-12-03 13:29:53 +01:00
Andy Polyakov
313e6ec11f Add assembly support for 32-bit iOS.
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2015-04-20 15:06:22 +02:00
Andy Polyakov
7b644df899 perlasm/arm-xlate.pl update (fix end-less loop and prepare for 32-bit iOS).
Reviewed-by: Rich Salz <rsalz@openssl.org>
2015-04-02 09:37:28 +02:00
Andy Polyakov
775b669de3 Fix crash in SPARC T4 XTS.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-02-24 10:11:36 +01:00
Andy Polyakov
2f8d82d641 perlasm/x86masm.pl: make it work.
Though this doesn't mean that masm becomes supported, the script is
still provided on don't-ask-in-case-of-doubt-use-nasm basis.
See RT#3650 for background.

Reviewed-by: Matt Caswell <matt@openssl.org>
2015-02-22 19:23:25 +01:00
Andy Polyakov
9b05cbc33e Add assembly support to ios64-cross.
Fix typos in ios64-cross config line.

Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-23 15:38:41 +01:00
Andy Polyakov
902b30df19 perlasm/x86_64-xlate.pl: handle inter-bank movd.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2014-09-12 00:06:00 +02:00
Rich Salz
f642ebc1e2 Undo a90081576c
Undo unapproved commit that removed DJGPP and WATT32
2014-08-09 08:02:20 -04:00
Rich Salz
a90081576c Remove DJGPP (and therefore WATT32) #ifdef's.
DJGPP is no longer a supported platform.  Remove all #ifdef, etc.,
cases that refer to it.  DJGPP also #define'd WATT32, so that
is now removed as well.
2014-08-08 16:54:14 -04:00
Andy Polyakov
1b0fe79f3e x86_64 assembly pack: improve masm support. 2014-07-09 20:08:01 +02:00
Andy Polyakov
c7ada16d39 perlasm/ppc-xlate.pl update. 2014-07-01 19:11:11 +02:00
Andy Polyakov
f75faa16af Add "teaser" AES module for PowerISA 2.07.
"Teaser" means that it's not integrated yet and purpose of this
commit is primarily informational, to exhibit design choices,
such as how to handle alignment and endianness. In other words
it's proof-of-concept code that EVP module will build upon.
2014-05-12 10:35:29 +02:00
Andy Polyakov
5e44c144e6 SPARC T4 assembly pack: treat zero input length in CBC.
The problem is that OpenSSH calls EVP_Cipher, which is not as
protective as EVP_CipherUpdate. Formally speaking we ought to
do more checks in *_cipher methods, including rejecting
lengths not divisible by block size (unless ciphertext stealing
is in place). But for now I implement check for zero length in
low-level based on precedent.

PR: 3087, 2775
2014-03-07 10:30:37 +01:00
Andy Polyakov
b62a4a1c0e perlasm/x86asm.pl: recognize elf-1 denoting old ELF platforms. 2014-02-27 14:26:12 +01:00
Andy Polyakov
ce876d8316 perlasm/x86gas.pl: limit special OPENSSL_ia32cap_P treatment to ELF. 2014-02-27 14:22:13 +01:00
Andy Polyakov
f4d456408d x86[_64]cpuid.pl: add low-level RDSEED. 2014-02-14 17:24:12 +01:00
Andy Polyakov
128e1d101b PPC assembly pack: improve AIX support (enable vpaes-ppc). 2013-12-18 21:19:08 +01:00
Andy Polyakov
41965a84c4 x86_64-xlate.pl: minor update. 2013-12-09 21:23:19 +01:00
Andy Polyakov
26e18383ef perlasm/ppc-xlate.pl: add support for AltiVec/VMX and VSX.
Suggested by: Marcello Cerri
2013-12-04 22:01:31 +01:00
Andy Polyakov
f586d97191 perlasm/ppc-xlate.pl: improve linux64le support.
Suggested by: Marcello Cerri
2013-12-04 21:47:43 +01:00
Andy Polyakov
0e0a105364 perlas/ppc-xlate.pl: fix typo. 2013-10-31 11:58:50 +01:00
Andy Polyakov
8ff8a829b0 perlasm/ppc-xlate.pl: add .quad directive
sha/asm/sha512-ppc.pl: add little-endian support.

Submitted by: Marcelo Cerri
2013-10-31 11:08:51 +01:00
Andy Polyakov
d6019e1654 PPC assembly pack: add .size directives. 2013-10-15 00:14:39 +02:00
Andy Polyakov
6b2cae0c16 perlasm/sparcv9_modes.pl: make it work even with seasoned perl.
PR: 3130
2013-10-03 10:42:11 +02:00
Andy Polyakov
667053a2f3 x86_64-xlate.pl: fix jrcxz in nasm case. 2013-10-03 00:26:09 +02:00
Veres Lajos
478b50cf67 misspellings fixes by https://github.com/vlajos/misspell_fixer 2013-09-05 21:39:42 +01:00
Andy Polyakov
a9d14832fd x86_64-xlate.pl: Windows fixes. 2013-06-30 23:07:33 +02:00
Andy Polyakov
22de0e6583 x86_64-xlate.pl: minor size/performance improvement. 2013-05-13 16:06:25 +02:00
Andy Polyakov
c5d975a743 Add support for SPARC T4 DES opcode. 2013-03-31 14:32:05 +02:00