supporting more instructions seen in stdlib
This commit is contained in:
37
internal/load/annoyingaliases.sh
Executable file
37
internal/load/annoyingaliases.sh
Executable file
@@ -0,0 +1,37 @@
|
||||
#!/bin/bash -e
|
||||
|
||||
self=$(basename $0)
|
||||
output=$1
|
||||
|
||||
eval $(go env)
|
||||
arch=${GOROOT}/src/cmd/asm/internal/arch/arch.go
|
||||
|
||||
{
|
||||
|
||||
echo "// Code generated by ${self}. DO NOT EDIT."
|
||||
echo
|
||||
echo 'package load'
|
||||
echo
|
||||
echo 'var annoyingaliases = map[string]string{'
|
||||
|
||||
awk '
|
||||
/archX86/ { x86=1 }
|
||||
/^}/ { x86=0 }
|
||||
|
||||
x86 && /x86/ && /instructions\[/ {
|
||||
from=$1
|
||||
to=$3
|
||||
|
||||
sub(/instructions\[\"/, "", from)
|
||||
sub(/\"\]/, "", from)
|
||||
sub(/x86\.A/, "", to)
|
||||
|
||||
if(from != to) {
|
||||
printf("\t\"%s\": \"%s\",\n", from, to)
|
||||
}
|
||||
}
|
||||
' ${arch}
|
||||
|
||||
echo '}'
|
||||
|
||||
} | gofmt > ${output}
|
||||
Reference in New Issue
Block a user