mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-25 06:30:10 +01:00
pan/va: make valhall_parse_isa input explicit
Usage of implicit input file in valhall_parse_isa makes it very complicated for tools like ninja-to-soong to generate the Android equivalent build file. Instead use an explicit argument. It also deduplicate the location of the input file name to have it only in 'meson.build'. Acked-by: Boris Brezillon <boris.brezillon@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/37742>
This commit is contained in:
parent
7c268a1e91
commit
762be5eae1
6 changed files with 27 additions and 9 deletions
|
|
@ -22,11 +22,12 @@
|
|||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
import os
|
||||
import sys
|
||||
import struct
|
||||
from valhall import valhall_parse_isa
|
||||
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa()
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa(os.path.join(os.path.dirname(__file__), 'ISA.xml'))
|
||||
|
||||
LINE = ''
|
||||
|
||||
|
|
|
|||
|
|
@ -21,12 +21,18 @@
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from valhall import valhall_parse_isa
|
||||
from mako.template import Template
|
||||
from mako import exceptions
|
||||
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa()
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--xml', required=True, help='Input ISA XML file')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa(args.xml)
|
||||
|
||||
template = """
|
||||
#include "disassemble.h"
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ valhall_c = custom_target(
|
|||
'valhall_c',
|
||||
input : ['valhall.c.py', 'ISA.xml'],
|
||||
output : 'valhall.c',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
command : [prog_python, '@INPUT0@', '--xml', '@INPUT1@'],
|
||||
capture : true,
|
||||
depend_files : files('valhall.py'),
|
||||
)
|
||||
|
|
@ -15,7 +15,7 @@ valhall_enums_h = custom_target(
|
|||
'valhall_enums.h',
|
||||
input : ['valhall_enums.h.py', 'ISA.xml'],
|
||||
output : 'valhall_enums.h',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
command : [prog_python, '@INPUT0@', '--xml', '@INPUT1@'],
|
||||
capture : true,
|
||||
depend_files : files('valhall.py'),
|
||||
)
|
||||
|
|
@ -29,7 +29,7 @@ valhall_disasm_c = custom_target(
|
|||
'valhall_disasm_c',
|
||||
input : ['disasm.py', 'ISA.xml'],
|
||||
output : 'valhall_disasm.c',
|
||||
command : [prog_python, '@INPUT@'],
|
||||
command : [prog_python, '@INPUT0@', '--xml', '@INPUT1@'],
|
||||
capture : true,
|
||||
depend_files : files('valhall.py'),
|
||||
)
|
||||
|
|
|
|||
|
|
@ -21,12 +21,18 @@
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from valhall import valhall_parse_isa
|
||||
from mako.template import Template
|
||||
from mako import exceptions
|
||||
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa()
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--xml', required=True, help='Input ISA XML file')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
(instructions, immediates, enums, typesize, safe_name) = valhall_parse_isa(args.xml)
|
||||
|
||||
SKIP = set([
|
||||
# Extra conversions
|
||||
|
|
|
|||
|
|
@ -367,13 +367,12 @@ def typesize(opcode):
|
|||
return 32
|
||||
|
||||
# Parse the ISA
|
||||
def valhall_parse_isa(xmlfile = False):
|
||||
def valhall_parse_isa(xmlfile):
|
||||
global MODIFIERS
|
||||
global enums
|
||||
global immediates
|
||||
global root
|
||||
|
||||
xmlfile = os.path.join(os.path.dirname(__file__), 'ISA.xml')
|
||||
tree = ET.parse(xmlfile)
|
||||
root = tree.getroot()
|
||||
|
||||
|
|
|
|||
|
|
@ -21,10 +21,16 @@
|
|||
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
|
||||
# IN THE SOFTWARE.
|
||||
|
||||
import argparse
|
||||
import sys
|
||||
from valhall import valhall_parse_isa
|
||||
|
||||
(_, _, enums, _, safe_name) = valhall_parse_isa()
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--xml', required=True, help='Input ISA XML file')
|
||||
|
||||
args = parser.parse_args()
|
||||
|
||||
(_, _, enums, _, safe_name) = valhall_parse_isa(args.xml)
|
||||
|
||||
print("#ifndef __VALHALL_ENUMS_H_")
|
||||
print("#define __VALHALL_ENUMS_H_")
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue