diff --git a/control.hh b/control.hh index d555d17..dfe7981 100644 --- a/control.hh +++ b/control.hh @@ -67,6 +67,7 @@ enum E_OpType // OP_UI_PENTER , OP_UI_PEXIT , + OP_UI_INPUT_DFT , }; M_LSHIFT_OP( T_StringBuilder , E_OpType ); diff --git a/opcomp.cc b/opcomp.cc index 9b3b828..d34523b 100644 --- a/opcomp.cc +++ b/opcomp.cc @@ -615,6 +615,25 @@ bool T_CompilerImpl_::compileNode( } break; + case A_Node::OP_INPUT: + if ( exit ) { + auto& in( (T_InputInstrNode&) node ); + T_OpValue value; + value.f = in.defValue( ); + + addInstruction( OP_FP_LOAD , + constants.indexOf( value.u ) + 3 , + in.defValueLocation( ) ); + addInstruction( OP_PUSH , in.defValueLocation( ) ); + addInstruction( OP_FP_SSTORE_INT , 0 , in.defValueLocation( ) ); + + addInstruction( OP_CONST , output->inputs.indexOf( in.id( ) ) , in.idLocation( ) ); + addInstruction( OP_PUSH , in.defValueLocation( ) ); + + addInstruction( OP_UI_INPUT_DFT , node.location( ) ); + } + break; + //- EXPRESSIONS - ARGUMENTS ----------------------------------------------------------- diff --git a/ops.cc b/ops.cc index b617c97..44d717a 100644 --- a/ops.cc +++ b/ops.cc @@ -139,6 +139,7 @@ static T_KeyValueTable< E_OpType , T_OpInfo > OpInfoTable_{ ([]() { // infos.add( E_OpType::OP_UI_PENTER , T_OpInfo{ "ui-prof-enter" , 1 } ); infos.add( E_OpType::OP_UI_PEXIT , T_OpInfo{ "ui-prof-exit" } ); + infos.add( E_OpType::OP_UI_INPUT_DFT , T_OpInfo{ "ui-input-default" , 0 , OpStackMain{ -2 } } ); return infos; })( ) };