Path: blob/master/thirdparty/graphite/src/inc/opcode_table.h
9906 views
// SPDX-License-Identifier: MIT OR MPL-2.0 OR LGPL-2.1-or-later OR GPL-2.0-or-later1// Copyright 2010, SIL International, All rights reserved.23// This file will be pulled into and integrated into a machine implmentation4// DO NOT build directly5#pragma once67#define do2(n) do_(n) ,do_(n)8#define NILOP 0U910// types or parameters are: (.. is inclusive)11// number - any byte12// output_class - 0 .. silf.m_nClass13// input_class - 0 .. silf.m_nClass14// sattrnum - 0 .. 29 (gr_slatJWidth) , 55 (gr_slatUserDefn)15// attrid - 0 .. silf.numUser() where sattrnum == 55; 0..silf.m_iMaxComp where sattrnum == 15 otherwise 016// gattrnum - 0 .. face->getGlyphFaceCache->numAttrs()17// gmetric - 0 .. 11 (kgmetDescent)18// featidx - 0 .. face.numFeatures()19// level - any byte20static const opcode_t opcode_table[] =21{22{{do2(nop)}, 0, "NOP"},2324{{do2(push_byte)}, 1, "PUSH_BYTE"}, // number25{{do2(push_byte_u)}, 1, "PUSH_BYTE_U"}, // number26{{do2(push_short)}, 2, "PUSH_SHORT"}, // number number27{{do2(push_short_u)}, 2, "PUSH_SHORT_U"}, // number number28{{do2(push_long)}, 4, "PUSH_LONG"}, // number number number number2930{{do2(add)}, 0, "ADD"},31{{do2(sub)}, 0, "SUB"},32{{do2(mul)}, 0, "MUL"},33{{do2(div_)}, 0, "DIV"},34{{do2(min_)}, 0, "MIN"},35{{do2(max_)}, 0, "MAX"},36{{do2(neg)}, 0, "NEG"},37{{do2(trunc8)}, 0, "TRUNC8"},38{{do2(trunc16)}, 0, "TRUNC16"},3940{{do2(cond)}, 0, "COND"},41{{do2(and_)}, 0, "AND"}, // 0x1042{{do2(or_)}, 0, "OR"},43{{do2(not_)}, 0, "NOT"},44{{do2(equal)}, 0, "EQUAL"},45{{do2(not_eq_)}, 0, "NOT_EQ"},46{{do2(less)}, 0, "LESS"},47{{do2(gtr)}, 0, "GTR"},48{{do2(less_eq)}, 0, "LESS_EQ"},49{{do2(gtr_eq)}, 0, "GTR_EQ"}, // 0x185051{{do_(next), NILOP}, 0, "NEXT"},52{{NILOP, NILOP}, 1, "NEXT_N"}, // number <= smap.end - map53{{do_(next), NILOP}, 0, "COPY_NEXT"},54{{do_(put_glyph_8bit_obs), NILOP}, 1, "PUT_GLYPH_8BIT_OBS"}, // output_class55{{do_(put_subs_8bit_obs), NILOP}, 3, "PUT_SUBS_8BIT_OBS"}, // slot input_class output_class56{{do_(put_copy), NILOP}, 1, "PUT_COPY"}, // slot57{{do_(insert), NILOP}, 0, "INSERT"},58{{do_(delete_), NILOP}, 0, "DELETE"}, // 0x2059{{do_(assoc), NILOP}, VARARGS, "ASSOC"},60{{NILOP ,do_(cntxt_item)}, 2, "CNTXT_ITEM"}, // slot offset6162{{do_(attr_set), NILOP}, 1, "ATTR_SET"}, // sattrnum63{{do_(attr_add), NILOP}, 1, "ATTR_ADD"}, // sattrnum64{{do_(attr_sub), NILOP}, 1, "ATTR_SUB"}, // sattrnum65{{do_(attr_set_slot), NILOP}, 1, "ATTR_SET_SLOT"}, // sattrnum66{{do_(iattr_set_slot), NILOP}, 2, "IATTR_SET_SLOT"}, // sattrnum attrid67{{do2(push_slot_attr)}, 2, "PUSH_SLOT_ATTR"}, // sattrnum slot68{{do2(push_glyph_attr_obs)}, 2, "PUSH_GLYPH_ATTR_OBS"}, // gattrnum slot69{{do2(push_glyph_metric)}, 3, "PUSH_GLYPH_METRIC"}, // gmetric slot level70{{do2(push_feat)}, 2, "PUSH_FEAT"}, // featidx slot7172{{do2(push_att_to_gattr_obs)}, 2, "PUSH_ATT_TO_GATTR_OBS"}, // gattrnum slot73{{do2(push_att_to_glyph_metric)}, 3, "PUSH_ATT_TO_GLYPH_METRIC"}, // gmetric slot level74{{do2(push_islot_attr)}, 3, "PUSH_ISLOT_ATTR"}, // sattrnum slot attrid7576{{NILOP,NILOP}, 3, "PUSH_IGLYPH_ATTR"},7778{{do2(pop_ret)}, 0, "POP_RET"}, // 0x3079{{do2(ret_zero)}, 0, "RET_ZERO"},80{{do2(ret_true)}, 0, "RET_TRUE"},8182{{do_(iattr_set), NILOP}, 2, "IATTR_SET"}, // sattrnum attrid83{{do_(iattr_add), NILOP}, 2, "IATTR_ADD"}, // sattrnum attrid84{{do_(iattr_sub), NILOP}, 2, "IATTR_SUB"}, // sattrnum attrid85{{do2(push_proc_state)}, 1, "PUSH_PROC_STATE"}, // dummy86{{do2(push_version)}, 0, "PUSH_VERSION"},87{{do_(put_subs), NILOP}, 5, "PUT_SUBS"}, // slot input_class input_class output_class output_class88{{NILOP,NILOP}, 0, "PUT_SUBS2"},89{{NILOP,NILOP}, 0, "PUT_SUBS3"},90{{do_(put_glyph), NILOP}, 2, "PUT_GLYPH"}, // output_class output_class91{{do2(push_glyph_attr)}, 3, "PUSH_GLYPH_ATTR"}, // gattrnum gattrnum slot92{{do2(push_att_to_glyph_attr)}, 3, "PUSH_ATT_TO_GLYPH_ATTR"}, // gattrnum gattrnum slot93{{do2(bor)}, 0, "BITOR"},94{{do2(band)}, 0, "BITAND"},95{{do2(bnot)}, 0, "BITNOT"}, // 0x4096{{do2(setbits)}, 4, "BITSET"},97{{do_(set_feat), NILOP}, 2, "SET_FEAT"}, // featidx slot98// private opcodes for internal use only, comes after all other on disk opcodes.99{{do_(temp_copy), NILOP}, 0, "TEMP_COPY"}100};101102103