summaryrefslogtreecommitdiffstats
path: root/lib/libcrypto/perlasm
diff options
context:
space:
mode:
authorbcook <bcook@openbsd.org>2015-09-11 12:17:57 +0000
committerbcook <bcook@openbsd.org>2015-09-11 12:17:57 +0000
commit90d63fe2da68c2e2d9219706a367d5cd9c70b682 (patch)
tree6841c29457a000110f214fc78d333251be38cf55 /lib/libcrypto/perlasm
parentFirst step at making ix(4) MPSAVE. This is largely based on the em(4) (diff)
downloadwireguard-openbsd-90d63fe2da68c2e2d9219706a367d5cd9c70b682.tar.xz
wireguard-openbsd-90d63fe2da68c2e2d9219706a367d5cd9c70b682.zip
Fixup inter-bank movq/movd operations, emit bytes for pclmulqdq again.
Fixes builds gcc + Apple's assembler, working on reenabling builds with older OpenBSD releases. based on OpenSSL commit: https://git.openssl.org/?p=openssl.git;a=commitdiff;h=902b30df193afc3417a96ba72a81ed390bd50de3 ok miod@
Diffstat (limited to 'lib/libcrypto/perlasm')
-rwxr-xr-xlib/libcrypto/perlasm/x86_64-xlate.pl16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/libcrypto/perlasm/x86_64-xlate.pl b/lib/libcrypto/perlasm/x86_64-xlate.pl
index ed1f3ed6ab9..82992f41e5e 100755
--- a/lib/libcrypto/perlasm/x86_64-xlate.pl
+++ b/lib/libcrypto/perlasm/x86_64-xlate.pl
@@ -121,7 +121,7 @@ my %globals;
$self->{sz} = "";
} elsif ($self->{op} =~ /^v/) { # VEX
$self->{sz} = "";
- } elsif ($self->{op} =~ /movq/ && $line =~ /%xmm/) {
+ } elsif ($self->{op} =~ /mov[dq]/ && $line =~ /%xmm/) {
$self->{sz} = "";
} elsif ($self->{op} =~ /([a-z]{3,})([qlwb])$/) {
$self->{op} = $1;
@@ -698,6 +698,20 @@ my $pinsrd = sub {
}
};
+my $pclmulqdq = sub {
+ if (shift =~ /\$([x0-9a-f]+),\s*%xmm([0-9]+),\s*%xmm([0-9]+)/) {
+ my @opcode=(0x66);
+ rex(\@opcode,$3,$2);
+ push @opcode,0x0f,0x3a,0x44;
+ push @opcode,0xc0|($2&7)|(($3&7)<<3); # ModR/M
+ my $c=$1;
+ push @opcode,$c=~/^0/?oct($c):$c;
+ @opcode;
+ } else {
+ ();
+ }
+};
+
if ($nasm) {
print <<___;
default rel