<pre style='margin:0'>
Christopher Nielsen (mascguy) pushed a commit to branch master
in repository macports-ports.
</pre>
<p><a href="https://github.com/macports/macports-ports/commit/00aa6edefafa42a25a79710e7b39dd8399f919ef">https://github.com/macports/macports-ports/commit/00aa6edefafa42a25a79710e7b39dd8399f919ef</a></p>
<pre style="white-space: pre; background: #F8F8F8">The following commit(s) were added to refs/heads/master by this push:
<span style='display:block; white-space:pre;color:#404040;'> new 00aa6edefaf openssl3: fix PowerPC assembly generation
</span>00aa6edefaf is described below
<span style='display:block; white-space:pre;color:#808000;'>commit 00aa6edefafa42a25a79710e7b39dd8399f919ef
</span>Author: Evan Miller <emmiller@gmail.com>
AuthorDate: Mon Nov 8 20:24:24 2021 -0500
<span style='display:block; white-space:pre;color:#404040;'> openssl3: fix PowerPC assembly generation
</span><span style='display:block; white-space:pre;color:#404040;'>
</span><span style='display:block; white-space:pre;color:#404040;'> Closes: https://trac.macports.org/ticket/63847
</span>---
devel/openssl3/Portfile | 8 +
devel/openssl3/files/ppc-xlate.pl | 346 ++++++++++++++++++++++++++++++++++++++
2 files changed, 354 insertions(+)
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/openssl3/Portfile b/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;color:#808080;'>index 7bcad290ae1..458c6a17532 100644
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>--- a/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/openssl3/Portfile
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -83,6 +83,14 @@ if {${os.platform} eq "darwin" && ${os.major} < 19} {
</span> patchfiles-append patch-disable-avx512.diff
}
<span style='display:block; white-space:pre;background:#e0ffe0;'>+# Copy in the previous version of ppc-xlate.pl because the current one is broken
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://trac.macports.org/ticket/63847
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+platform darwin powerpc {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ post-patch {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ copy -force ${portpath}/${filesdir}/ppc-xlate.pl ${worksrcpath}/crypto/perlasm
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span> configure.ccache no
configure.perl /usr/bin/perl
configure.cmd ./Configure
<span style='display:block; white-space:pre;color:#808080;'>diff --git a/devel/openssl3/files/ppc-xlate.pl b/devel/openssl3/files/ppc-xlate.pl
</span>new file mode 100755
<span style='display:block; white-space:pre;color:#808080;'>index 00000000000..136e73e8afd
</span><span style='display:block; white-space:pre;background:#ffe0e0;'>--- /dev/null
</span><span style='display:block; white-space:pre;background:#e0e0ff;'>+++ b/devel/openssl3/files/ppc-xlate.pl
</span><span style='display:block; white-space:pre;background:#e0e0e0;'>@@ -0,0 +1,346 @@
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#! /usr/bin/env perl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Copyright 2006-2020 The OpenSSL Project Authors. All Rights Reserved.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+#
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Licensed under the Apache License 2.0 (the "License"). You may not use
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# this file except in compliance with the License. You can obtain a copy
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# in the file LICENSE in the source distribution or at
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# https://www.openssl.org/source/license.html
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $flavour = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $output = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+open STDOUT,">$output" || die "can't open $output: $!";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my %GLOBALS;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my %TYPES;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $dotinlocallabels=($flavour=~/linux/)?1:0;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+################################################################
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# directives which need special treatment on different platforms
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+################################################################
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $type = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($dir,$name,$type) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $TYPES{$name} = $type;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($flavour =~ /linux/) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $name =~ s|^\.||;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ".type $name,$type";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ "";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $globl = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $junk = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $name = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $global = \$GLOBALS{$name};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $type = \$TYPES{$name};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $name =~ s|^\.||;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ SWITCH: for ($flavour) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /aix/ && do { if (!$$type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $$type = "\@function";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($$type =~ /function/) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $name = ".$name";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ last;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /osx/ && do { $name = "_$name";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ last;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /linux.*(32|64(le|v2))/
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ && do { $ret .= ".globl $name";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!$$type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.type $name,\@function";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $$type = "\@function";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ last;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ /linux.*64/ && do { $ret .= ".globl $name";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (!$$type) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.type $name,\@function";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $$type = "\@function";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($$type =~ /function/) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.section \".opd\",\"aw\"";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.align 3";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n$name:";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.quad .$name,.TOC.\@tocbase,0";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.previous";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $name = ".$name";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ last;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret = ".globl $name" if (!$ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $$global = $name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $text = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $ret = ($flavour =~ /aix/) ? ".csect\t.text[PR],7" : ".text";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret = ".abiversion 2\n".$ret if ($flavour =~ /linux.*64(le|v2)/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $machine = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $junk = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $arch = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($flavour =~ /osx/)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { $arch =~ s/\"//g;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $arch = ($flavour=~/64/) ? "ppc970-64" : "ppc970" if ($arch eq "any");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ".machine $arch";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $size = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($flavour =~ /linux/)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $name = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $real = $GLOBALS{$name} ? \$GLOBALS{$name} : \$name;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $ret = ".size $$real,.-$$real";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $name =~ s|^\.||;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($$real ne $name) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret .= "\n.size $name,.-$$real";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ""; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $asciz = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $line = join(",",@_);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($line =~ /^"(.*)"$/)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ".byte " . join(",",unpack("C*",$1),0) . "\n.align 2"; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { ""; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $quad = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my @ret;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($hi,$lo);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ for (@_) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (/^0x([0-9a-f]*?)([0-9a-f]{1,8})$/io)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { $hi=$1?"0x$1":"0"; $lo="0x$2"; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elsif (/^([0-9]+)$/o)
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { $hi=$1>>32; $lo=$1&0xffffffff; } # error-prone with 32-bit perl
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { $hi=undef; $lo=$_; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (defined($hi))
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { push(@ret,$flavour=~/le$/o?".long\t$lo,$hi":".long\t$hi,$lo"); }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ else
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ { push(@ret,".quad $lo"); }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ join("\n",@ret);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+################################################################
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# simplified mnemonics not handled by at least one assembler
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+################################################################
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $cmplw = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $cr = 0; $cr = shift if ($#_>1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ # Some out-of-date 32-bit GNU assembler just can't handle cmplw...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ($flavour =~ /linux.*32/) ?
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%x",31<<26|$cr<<23|$_[0]<<16|$_[1]<<11|64 :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " cmplw ".join(',',$cr,@_);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $bdnz = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $bo = $f=~/[\+\-]/ ? 16+9 : 16; # optional "to be taken" hint
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " bc $bo,0,".shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+} if ($flavour!~/linux/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $bltlr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $bo = $f=~/\-/ ? 12+2 : 12; # optional "not to be taken" hint
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ($flavour =~ /linux/) ? # GNU as doesn't allow most recent hints
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%x",19<<26|$bo<<21|16<<1 :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " bclr $bo,0";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $bnelr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $bo = $f=~/\-/ ? 4+2 : 4; # optional "not to be taken" hint
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ($flavour =~ /linux/) ? # GNU as doesn't allow most recent hints
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%x",19<<26|$bo<<21|2<<16|16<<1 :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " bclr $bo,2";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $beqlr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = shift;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $bo = $f=~/-/ ? 12+2 : 12; # optional "not to be taken" hint
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ ($flavour =~ /linux/) ? # GNU as doesn't allow most recent hints
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",19<<26|$bo<<21|2<<16|16<<1 :
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " bclr $bo,2";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# GNU assembler can't handle extrdi rA,rS,16,48, or when sum of last two
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# arguments is 64, with "operand out of range" error.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $extrdi = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f,$ra,$rs,$n,$b) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $b = ($b+$n)&63; $n = 64-$n;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " rldicl $ra,$rs,$b,$n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f,$vx,$vy) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " vor $vx,$vy,$vy";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# Some ABIs specify vrsave, special-purpose register #256, as reserved
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# for system use.
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $no_vrsave = ($flavour =~ /aix|linux64(le|v2)/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $mtspr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f,$idx,$ra) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($idx == 256 && $no_vrsave) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " or $ra,$ra,$ra";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " mtspr $idx,$ra";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $mfspr = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f,$rd,$idx) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($idx == 256 && $no_vrsave) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " li $rd,-1";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ } else {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " mfspr $rd,$idx";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PowerISA 2.06 stuff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+sub vsxmem_op {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $ra, $rb, $op) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($vrt<<21)|($ra<<16)|($rb<<11)|($op*2+1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# made-up unaligned memory reference AltiVec/VMX instructions
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $lvx_u = sub { vsxmem_op(@_, 844); }; # lxvd2x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $stvx_u = sub { vsxmem_op(@_, 972); }; # stxvd2x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $lvdx_u = sub { vsxmem_op(@_, 588); }; # lxsdx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $stvdx_u = sub { vsxmem_op(@_, 716); }; # stxsdx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $lvx_4w = sub { vsxmem_op(@_, 780); }; # lxvw4x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $stvx_4w = sub { vsxmem_op(@_, 908); }; # stxvw4x
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $lvx_splt = sub { vsxmem_op(@_, 332); }; # lxvdsx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# VSX instruction[s] masqueraded as made-up AltiVec/VMX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vpermdi = sub { # xxpermdi
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $vra, $vrb, $dm) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $dm = oct($dm) if ($dm =~ /^0/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(60<<26)|($vrt<<21)|($vra<<16)|($vrb<<11)|($dm<<8)|(10<<3)|7;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PowerISA 2.07 stuff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+sub vcrypto_op {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $vra, $vrb, $op) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(4<<26)|($vrt<<21)|($vra<<16)|($vrb<<11)|$op;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+sub vfour {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $vra, $vrb, $vrc, $op) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(4<<26)|($vrt<<21)|($vra<<16)|($vrb<<11)|($vrc<<6)|$op;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vcipher = sub { vcrypto_op(@_, 1288); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vcipherlast = sub { vcrypto_op(@_, 1289); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vncipher = sub { vcrypto_op(@_, 1352); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vncipherlast= sub { vcrypto_op(@_, 1353); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vsbox = sub { vcrypto_op(@_, 0, 1480); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vshasigmad = sub { my ($st,$six)=splice(@_,-2); vcrypto_op(@_, $st<<4|$six, 1730); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vshasigmaw = sub { my ($st,$six)=splice(@_,-2); vcrypto_op(@_, $st<<4|$six, 1666); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vpmsumb = sub { vcrypto_op(@_, 1032); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vpmsumd = sub { vcrypto_op(@_, 1224); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vpmsubh = sub { vcrypto_op(@_, 1096); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vpmsumw = sub { vcrypto_op(@_, 1160); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# These are not really crypto, but vcrypto_op template works
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vaddudm = sub { vcrypto_op(@_, 192); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vadduqm = sub { vcrypto_op(@_, 256); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmuleuw = sub { vcrypto_op(@_, 648); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmulouw = sub { vcrypto_op(@_, 136); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vrld = sub { vcrypto_op(@_, 196); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vsld = sub { vcrypto_op(@_, 1476); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vsrd = sub { vcrypto_op(@_, 1732); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vsubudm = sub { vcrypto_op(@_, 1216); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vaddcuq = sub { vcrypto_op(@_, 320); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vaddeuqm = sub { vfour(@_,60); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vaddecuq = sub { vfour(@_,61); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmrgew = sub { vfour(@_,0,1932); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmrgow = sub { vfour(@_,0,1676); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $mtsle = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $arg) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($arg<<21)|(147*2);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# VSX instructions masqueraded as AltiVec/VMX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $mtvrd = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $ra) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($vrt<<21)|($ra<<16)|(179<<1)|1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $mtvrwz = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $ra) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($vrt<<21)|($ra<<16)|(243<<1)|1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $lvwzx_u = sub { vsxmem_op(@_, 12); }; # lxsiwzx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $stvwx_u = sub { vsxmem_op(@_, 140); }; # stxsiwx
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PowerISA 3.0 stuff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $maddhdu = sub { vfour(@_,49); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $maddld = sub { vfour(@_,51); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $darn = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $rt, $l) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($rt<<21)|($l<<16)|(755<<1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $iseleq = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $rt, $ra, $rb) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($rt<<21)|($ra<<16)|($rb<<11)|(2<<6)|30;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# VSX instruction[s] masqueraded as made-up AltiVec/VMX
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vspltib = sub { # xxspltib
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $vrt, $imm8) = @_;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $imm8 = oct($imm8) if ($imm8 =~ /^0/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $imm8 &= 0xff;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(60<<26)|($vrt<<21)|($imm8<<11)|(360<<1)|1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+# PowerISA 3.0B stuff
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $addex = sub {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my ($f, $rt, $ra, $rb, $cy) = @_; # only cy==0 is specified in 3.0B
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ " .long ".sprintf "0x%X",(31<<26)|($rt<<21)|($ra<<16)|($rb<<11)|($cy<<9)|(170<<1);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+};
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+my $vmsumudm = sub { vfour(@_,35); };
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+while($line=<>) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|[#!;].*$||; # get rid of asm-style comments...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|/\*.*\*/||; # ... and C-style comments...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|^\s+||; # ... and skip whitespaces in beginning...
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|\s+$||; # ... and at the end
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|\.L(\w+)|L$1|g; # common denominator for Locallabel
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|\bL(\w+)|\.L$1|g if ($dotinlocallabels);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|(^[\.\w]+)\:\s*||;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $label = $1;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($label) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $xlated = ($GLOBALS{$label} or $label);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ print "$xlated:";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($flavour =~ /linux.*64(le|v2)/) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if ($TYPES{$label} =~ /function/) {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ printf "\n.localentry %s,0\n",$xlated;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ {
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s|^\s*(\.?)(\w+)([\.\+\-]?)\s*||;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $c = $1; $c = "\t" if ($c eq "");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $mnemonic = $2;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $f = $3;
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ my $opcode = eval("\$$mnemonic");
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ $line =~ s/\b(c?[rf]|v|vs)([0-9]+)\b/$2/g if ($c ne "." and $flavour !~ /osx/);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ if (ref($opcode) eq 'CODE') { $line = &$opcode($f,split(/,\s*/,$line)); }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ elsif ($mnemonic) { $line = $c.$mnemonic.$f."\t".$line; }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ }
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ print $line if ($line);
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+ print "\n";
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+}
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+
</span><span style='display:block; white-space:pre;background:#e0ffe0;'>+close STDOUT or die "error closing STDOUT: $!";
</span></pre><pre style='margin:0'>
</pre>