1/* Author(s): 2 * Connor Abbott 3 * Alyssa Rosenzweig 4 * 5 * Copyright (c) 2013 Connor Abbott (connor@abbott.cx) 6 * Copyright (c) 2018 Alyssa Rosenzweig (alyssa@rosenzweig.io) 7 * 8 * Permission is hereby granted, free of charge, to any person obtaining a copy 9 * of this software and associated documentation files (the "Software"), to deal 10 * in the Software without restriction, including without limitation the rights 11 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 12 * copies of the Software, and to permit persons to whom the Software is 13 * furnished to do so, subject to the following conditions: 14 * 15 * The above copyright notice and this permission notice shall be included in 16 * all copies or substantial portions of the Software. 17 * 18 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 19 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 20 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 21 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 22 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 23 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN 24 * THE SOFTWARE. 25 */ 26 27#ifndef __midgard_parse_h__ 28#define __midgard_parse_h__ 29 30/* Additional metadata for parsing Midgard binaries, not needed for compilation */ 31 32static midgard_word_type midgard_word_types[16] = { 33 midgard_word_type_unknown, /* 0x0 */ 34 midgard_word_type_unknown, /* 0x1 */ 35 midgard_word_type_texture, /* 0x2 */ 36 midgard_word_type_texture, /* 0x3 */ 37 midgard_word_type_unknown, /* 0x4 */ 38 midgard_word_type_load_store, /* 0x5 */ 39 midgard_word_type_unknown, /* 0x6 */ 40 midgard_word_type_unknown, /* 0x7 */ 41 midgard_word_type_alu, /* 0x8 */ 42 midgard_word_type_alu, /* 0x9 */ 43 midgard_word_type_alu, /* 0xA */ 44 midgard_word_type_alu, /* 0xB */ 45 midgard_word_type_alu, /* 0xC */ 46 midgard_word_type_alu, /* 0xD */ 47 midgard_word_type_alu, /* 0xE */ 48 midgard_word_type_alu, /* 0xF */ 49}; 50 51static unsigned midgard_word_size[16] = { 52 0, /* 0x0 */ 53 0, /* 0x1 */ 54 1, /* 0x2 */ 55 1, /* 0x3 */ 56 0, /* 0x4 */ 57 1, /* 0x5 */ 58 0, /* 0x6 */ 59 0, /* 0x7 */ 60 1, /* 0x8 */ 61 2, /* 0x9 */ 62 3, /* 0xA */ 63 4, /* 0xB */ 64 1, /* 0xC */ 65 2, /* 0xD */ 66 3, /* 0xE */ 67 4, /* 0xF */ 68}; 69 70#endif 71