summaryrefslogtreecommitdiff
path: root/crypto/perlasm
Commit message (Collapse)AuthorAgeFilesLines
* Many spelling fixes/typo's corrected.Josh Soref2017-11-111-3/+3
| | | | | | | | | Around 138 distinct errors found and fixed; thanks! Reviewed-by: Kurt Roeckx <kurt@roeckx.be> Reviewed-by: Tim Hudson <tjh@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3459)
* perlasm/ppc-xlate.pl: add PowerISA 3.0B instructions.Andy Polyakov2017-06-131-2/+28
| | | | | | [As well as few extra instructions from earlier spec.] Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove filename argument to x86 asm_init.David Benjamin2017-05-114-9/+6
| | | | | | | | | | | | | | | The assembler already knows the actual path to the generated file and, in other perlasm architectures, is left to manage debug symbols itself. Notably, in OpenSSL 1.1.x's new build system, which allows a separate build directory, converting .pl to .s as the scripts currently do result in the wrong paths. This also avoids inconsistencies from some of the files using $0 and some passing in the filename. Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3431)
* perlasm/x86_64-xlate.pl: work around problem with hex constants in masm.Andy Polyakov2017-05-051-2/+3
| | | | | | | | | Perl, multiple versions, for some reason occasionally takes issue with letter b[?] in ox([0-9a-f]+) regex. As result some constants, such as 0xb1 came out wrong when generating code for MASM. Fixes GH#3241. Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/3385)
* Fix a few typosFdaSilvaYY2017-02-142-5/+5
| | | | | | | [skip ci] Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2571)
* perlasm/x86_64-xlate.pl: recognize even offset(%reg) in cfa_expression.Andy Polyakov2017-02-131-0/+2
| | | | | | This is handy when "offset(%reg)" is a perl variable. Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: fix pair of typo-bugs in the new cfi_directive.Andy Polyakov2017-02-101-2/+2
| | | | | | .cfi_{start|end}proc and .cfi_def_cfa were not tracked. Reviewed-by: Richard Levitte <levitte@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2585)
* perlasm/x86_64-xlate.pl: typo fix in comment.Adam Langley2017-02-101-1/+1
| | | | | | | | CLA: trivial Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> (Merged from https://github.com/openssl/openssl/pull/2584)
* perlasm/x86_64-xlate.pl: recognize DWARF CFI directives.Andy Polyakov2017-02-091-0/+237
| | | | | | | | | | | | | | | | | | | | | | | | | | | | CFI directives annotate instructions that are significant for stack unwinding procedure. In addition to directives recognized by GNU assembler this module implements three synthetic ones: - .cfi_push annotates push instructions in prologue and translates to .cfi_adjust_cfa_offset (if needed) and .cfi_offset; - .cfi_pop annotates pop instructions in epilogue and translates to .cfi_adjust_cfs_offset (if needed) and .cfi_restore; - .cfi_cfa_expression encodes DW_CFA_def_cfa_expression and passes it to .cfi_escape as byte vector; CFA expression syntax is made up mix of DWARF operator suffixes [subset of] and references to registers with optional bias. Following example describes offloaded original stack pointer at specific offset from current stack pointer: .cfi_cfa_expression %rsp+40,deref,+8 Final +8 has everything to do with the fact that CFA, Canonical Frame Address, is reference to top of caller's stack, and on x86_64 call to subroutine pushes 8-byte return address. Triggered by request from Adam Langley. Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: remove obsolete .picmeup synthetic directive.Andy Polyakov2017-02-091-24/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: minor readability updates.Andy Polyakov2017-02-091-37/+52
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: clarify SEH coding guidelines.Andy Polyakov2017-02-061-12/+17
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: add support for AVX512 OPMASK-ing.Andy Polyakov2016-12-151-13/+23
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* perlasm/x86_64-xlate.pl: refine sign extension in ea package.Andy Polyakov2016-12-121-2/+9
| | | | | | | | | | | $1<<32>>32 worked fine with either 32- or 64-bit perl for a good while, relying on quirk that [pure] 32-bit perl performed it as $1<<0>>0. But this apparently changed in some version past minimally required 5.10, and operation result became 0. Yet, it went unnoticed for another while, because most perl package providers configure their packages with -Duse64bitint option. Reviewed-by: Rich Salz <rsalz@openssl.org>
* Remove trailing whitespace from some files.David Benjamin2016-10-105-21/+21
| | | | | | | | | | | | | | | | | | The prevailing style seems to not have trailing whitespace, but a few lines do. This is mostly in the perlasm files, but a few C files got them after the reformat. This is the result of: find . -name '*.pl' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.c' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' find . -name '*.h' | xargs sed -E -i '' -e 's/( |'$'\t'')*$//' Then bn_prime.h was excluded since this is a generated file. Note mkerr.pl has some changes in a heredoc for some help output, but other lines there lack trailing whitespace too. Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* perlasm/ppc-xlate.pl: recognize .type directive.Andy Polyakov2016-08-291-19/+53
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix compilation when using MASM on x86Gergely Nagy2016-08-161-1/+1
| | | | | | | | 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)
* crypto/x86[_64]cpuid.pl: add OPENSSL_ia32_rd[rand|seed]_bytes.Andy Polyakov2016-07-151-2/+2
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* SPARC assembly pack: enforce V8+ ABI constraints.Andy Polyakov2016-07-011-0/+4
| | | | | | | | | | | 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>
* perlasm/x86_64-xlate.pl: address errors and warnings in elderly perls.Andy Polyakov2016-06-241-7/+8
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make arm-xlate.pl set use strict.David Benjamin2016-06-201-1/+3
| | | | | | | 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)
* perlasm/x86*.pl: add endbranch instruction.Andy Polyakov2016-06-142-0/+9
| | | | | | | For further information see "Control-flow Enforcement Technology Preview" by Intel. Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: add commentary.Andy Polyakov2016-06-141-1/+7
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* perlasm/x86_64-xlate.pl: refactor argument parsing loop.Andy Polyakov2016-06-141-11/+12
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Make x86_64-xlate.pl 'use strict' clean.David Benjamin2016-06-141-114/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. 9b634c9b37afc482a8dc8868e367bdd1b650e507 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>
* Remove/rename some old files.Rich Salz2016-06-011-0/+0
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Copyright consolidation: perl filesRich Salz2016-04-209-13/+70
| | | | | | | | | 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>
* perlasm/x86_64-xlate.pl: make latest ml64 work.Andy Polyakov2016-04-201-2/+5
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* PPC assebmly pack: initial POWER9 support tidbits.Andy Polyakov2016-04-131-0/+15
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* SPARCv9 assembly pack: unify build rules and argument handling.Andy Polyakov2016-03-081-0/+4
| | | | | | | | | | 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>
* perlasm/x86_64-xlate.pl: handle binary constants early.Andy Polyakov2016-03-071-1/+1
| | | | | | | | 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>
* Fix some issues near recent chomp changes.Viktor Dukhovni2016-02-131-1/+1
| | | | Reviewed-by: Richard Levitte <levitte@openssl.org>
* Perl's chop / chomp considered bad, use a regexp insteadRichard Levitte2016-02-111-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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>
* perlasm/x86_64-xlate.pl: pass pure constants verbatim.Andy Polyakov2016-02-111-2/+5
| | | | | | RT#3885 Reviewed-by: Rich Salz <rsalz@openssl.org>
* x86[_64] assembly pack: add ChaCha20 and Poly1305 modules.Andy Polyakov2016-02-101-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* GH601: Various spelling fixes.FdaSilvaYY2016-02-051-2/+2
| | | | | Signed-off-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
* ARMv4 assembly pack: allow Thumb2 even in iOS build,Andy Polyakov2015-12-071-0/+6
| | | | | | and engage it in most modules. Reviewed-by: Tim Hudson <tjh@openssl.org>
* perlasm/ppc-xlate.pl: comply with ABIs that specify vrsave as reserved.Andy Polyakov2015-12-031-0/+20
| | | | | | RT#4162 Reviewed-by: Richard Levitte <levitte@openssl.org>
* Add assembly support for 32-bit iOS.Andy Polyakov2015-04-201-1/+1
| | | | | Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
* perlasm/arm-xlate.pl update (fix end-less loop and prepare for 32-bit iOS).Andy Polyakov2015-04-021-24/+49
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Fix crash in SPARC T4 XTS.Andy Polyakov2015-02-241-0/+1
| | | | Reviewed-by: Tim Hudson <tjh@openssl.org>
* perlasm/x86masm.pl: make it work.Andy Polyakov2015-02-221-6/+6
| | | | | | | | 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>
* Add assembly support to ios64-cross.Andy Polyakov2015-01-231-0/+140
| | | | | | Fix typos in ios64-cross config line. Reviewed-by: Tim Hudson <tjh@openssl.org>
* perlasm/x86_64-xlate.pl: handle inter-bank movd.Andy Polyakov2014-09-121-1/+1
| | | | Reviewed-by: Rich Salz <rsalz@openssl.org>
* Undo a90081576c94f9f54de1755188a00ccc1760549aRich Salz2014-08-091-1/+1
| | | | Undo unapproved commit that removed DJGPP and WATT32
* Remove DJGPP (and therefore WATT32) #ifdef's.Rich Salz2014-08-081-1/+1
| | | | | | 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.
* x86_64 assembly pack: improve masm support.Andy Polyakov2014-07-091-6/+14
|
* perlasm/ppc-xlate.pl update.Andy Polyakov2014-07-011-0/+3
|
* Add "teaser" AES module for PowerISA 2.07.Andy Polyakov2014-05-121-0/+33
| | | | | | | "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.
* SPARC T4 assembly pack: treat zero input length in CBC.Andy Polyakov2014-03-071-0/+6
| | | | | | | | | | | 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