From: Jacob Lifshay Date: Tue, 1 Aug 2023 04:35:13 +0000 (-0700) Subject: add split-insns.sh X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=a221880faa57441e129d171a3cbc2d72480445e5;p=openpower-isa.git add split-insns.sh --- diff --git a/.gitignore b/.gitignore index 6ce67a3b..2b65439b 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,6 @@ dist /crtl* /formal_test_temp /test-out/ +*~ +*.~[0-9]~ +*.~[0-9][0-9]~ diff --git a/split-insns.sh b/split-insns.sh new file mode 100755 index 00000000..1ef222ae --- /dev/null +++ b/split-insns.sh @@ -0,0 +1,140 @@ +#!/bin/bash +cd "$(dirname "$0")" +set -C + +function note() { + echo "$fname:$((lidx + 1)): note: $@" +} + +function warn() { + echo "$fname:$((lidx + 1)): warning: $@" >&2 +} + +function fatal() { + echo "$fname:$((lidx + 1)): fatal: $@" >&2 + exit 1 +} + +function next_line() { + line="${lines[++lidx]}" +} + +function skip_comments() { + while [[ "$line" =~ ^"