Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

xst_instructions.h

Go to the documentation of this file.
00001 
00002 // Common Text Transformation Library
00003 // Copyright (C) 1997-2006 by Igor Kholodov. 
00004 //
00005 // This library is free software; you can redistribute it and/or
00006 // modify it under the terms of the GNU Lesser General Public
00007 // License as published by the Free Software Foundation; either
00008 // version 2.1 of the License, or (at your option) any later version.
00009 //
00010 // This library is distributed in the hope that it will be useful,
00011 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00012 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013 // Lesser General Public License for more details.
00014 //
00015 // You should have received a copy of the GNU Lesser General Public
00016 // License along with this library; if not, write to the
00017 // Free Software Foundation, Inc.,
00018 // 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019 //
00020 // mailto:cttl@users.sourceforge.net
00021 // http://sourceforge.net/projects/cttl/
00023 
00033 // xst_instructions.h
00034 
00035 #ifndef _XST_INSTRUCTIONS_H_INCLUDED_
00036 #define _XST_INSTRUCTIONS_H_INCLUDED_
00037 
00039 #define CTTL_POP_DATA( XLOCATION )              const_scalar( pop_data_ )   ^const_scalar( XLOCATION )
00040 
00042 #define CTTL_NEG_TOP( XLOCATION )               const_scalar( neg_top_ )    ^const_scalar( XLOCATION )
00043 
00044 
00046 #define CTTL_PUSH_DATA( XLOCATION )             const_scalar( push_data_ )  ^const_scalar( XLOCATION )
00047 
00049 #define CTTL_PUSH_VALUE( XLOCATION, XVALUE )    const_scalar( push_value_ ) ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00050 
00052 #define CTTL_PUSH_TOP( XLOCATION, XLOCATION2 )  const_scalar( push_top_ )   ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00053 
00055 #define CTTL_PUSH_SIZE( XLOCATION, XLOCATION2 ) const_scalar( push_size_ )  ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00056 
00057 
00059 #define CTTL_MOVE_VALUE( XLOCATION, XVALUE )    const_scalar( move_value_ ) ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00060 
00062 #define CTTL_MOVE_TOP( XLOCATION, XLOCATION2 )  const_scalar( move_top_ )   ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00063 
00065 #define CTTL_MOVE_SIZE( XLOCATION, XLOCATION2 ) const_scalar( move_size_ )  ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00066 
00067 
00069 #define CTTL_ADD_VALUE( XLOCATION, XVALUE )    const_scalar( add_value_ )   ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00070 
00072 #define CTTL_ADD_TOP( XLOCATION, XLOCATION2 )  const_scalar( add_top_ )     ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00073 
00075 #define CTTL_ADD_SIZE( XLOCATION, XLOCATION2 ) const_scalar( add_size_ )    ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00076 
00077 
00079 #define CTTL_SUB_VALUE( XLOCATION, XVALUE )    const_scalar( sub_value_ )   ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00080 
00082 #define CTTL_SUB_TOP( XLOCATION, XLOCATION2 )  const_scalar( sub_top_ )     ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00083 
00085 #define CTTL_SUB_SIZE( XLOCATION, XLOCATION2 ) const_scalar( sub_size_ )    ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00086 
00087 
00089 #define CTTL_MUL_VALUE( XLOCATION, XVALUE )    const_scalar( mul_value_ )   ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00090 
00092 #define CTTL_MUL_TOP( XLOCATION, XLOCATION2 )  const_scalar( mul_top_ )     ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00093 
00095 #define CTTL_MUL_SIZE( XLOCATION, XLOCATION2 ) const_scalar( mul_size_ )    ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00096 
00097 
00099 #define CTTL_DIV_VALUE( XLOCATION, XVALUE )    const_scalar( div_value_ )   ^const_scalar( XLOCATION )  ^const_scalar( XVALUE )
00100 
00102 #define CTTL_DIV_TOP( XLOCATION, XLOCATION2 )  const_scalar( div_top_ )     ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00103 
00105 #define CTTL_DIV_SIZE( XLOCATION, XLOCATION2 ) const_scalar( div_size_ )    ^const_scalar( XLOCATION )  ^const_scalar( XLOCATION2 )
00106 
00107 
00108 namespace cttl_impl {
00109 
00111 // lambda instructions
00113 
00114 // one-operand instructions
00115 
00117 template< int FirstOperandT, int OpcodeT >
00118 struct xst_instruction_1_operand {
00119 
00120     template< typename TargetLambdaT >
00121     static void instruction( TargetLambdaT& )
00122     {
00123         assert( false );
00124     }
00125 
00126 };  // struct xst_instruction_1_operand
00127 
00128 // two-operand instructions
00129 
00131 template< int FirstOperandT, int SecondOperandT, int OpcodeT >
00132 struct xst_instruction_2_operand {
00133 
00134     template< typename TargetLambdaT >
00135     static void instruction( TargetLambdaT& )
00136     {
00137         assert( false );
00138     }
00139 
00140 };  // struct xst_instruction_2_operand
00141 
00151 template< int FirstOperandT >
00152 struct xst_instruction_1_operand< FirstOperandT, pop_data_ > {
00153 
00154     template< typename TargetLambdaT >
00155     static void instruction( TargetLambdaT& lambda_ )
00156     {
00157         CTTL_TRACE_DEPOSIT_JUSTIFY();
00158         CTTL_TRACE_DEPOSIT_TEXT( "pop_data\t" );
00159         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00160         CTTL_TRACE_DEPOSIT_TEXT( ';' );
00161         static const int first_operand = FirstOperandT;
00162         lambda_.pop( const_scalar( first_operand ) );
00163         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00164     }
00165 
00166 };  // struct xst_instruction_1_operand
00167 
00168 
00178 template< int FirstOperandT >
00179 struct xst_instruction_1_operand< FirstOperandT, push_data_ > {
00180 
00181     template< typename TargetLambdaT >
00182     static void instruction( TargetLambdaT& lambda_ )
00183     {
00184         CTTL_TRACE_DEPOSIT_JUSTIFY();
00185         CTTL_TRACE_DEPOSIT_TEXT( "push_data\t" );
00186         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00187         CTTL_TRACE_DEPOSIT_TEXT( ';' );
00188         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00189         static const int first_operand = FirstOperandT;
00190         lambda_.push( const_scalar( first_operand ), true );
00191     }
00192 
00193 };  // struct xst_instruction_1_operand
00194 
00195 
00205 template< int FirstOperandT >
00206 struct xst_instruction_1_operand< FirstOperandT, neg_top_ > {
00207 
00208     template< typename TargetLambdaT >
00209     static void instruction( TargetLambdaT& lambda_ )
00210     {
00211         CTTL_TRACE_DEPOSIT_JUSTIFY();
00212         CTTL_TRACE_DEPOSIT_TEXT( "neg_top\t" );
00213         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00214         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00215         static const int first_operand = FirstOperandT;
00216         lambda_.top( const_scalar( first_operand ) ) = -lambda_.top( const_scalar( first_operand ) );
00217         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00218     }
00219 
00220 };  // struct xst_instruction_1_operand
00221 
00222 
00223 
00224 // binary operator instructions
00225 
00238 template< int FirstOperandT, int SecondOperandT >
00239 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, push_value_ > {
00240 
00241     template< typename TargetLambdaT >
00242     static void instruction( TargetLambdaT& lambda_ )
00243     {
00244         CTTL_TRACE_DEPOSIT_JUSTIFY();
00245         CTTL_TRACE_DEPOSIT_TEXT( "push_value\t" );
00246         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00247         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00248         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00249         CTTL_TRACE_DEPOSIT_TEXT( ';' );
00250         static const int first_operand = FirstOperandT;
00251         lambda_.push( const_scalar( first_operand ), SecondOperandT ); // 
00252         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00253     }
00254 
00255 };  // struct xst_instruction_2_operand
00256 
00269 template< int FirstOperandT, int SecondOperandT >
00270 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, push_top_ > {
00271 
00272     template< typename TargetLambdaT >
00273     static void instruction( TargetLambdaT& lambda_ )
00274     {
00275         static const int first_operand = FirstOperandT;
00276         static const int second_operand = SecondOperandT;
00277 
00278         CTTL_TRACE_DEPOSIT_JUSTIFY();
00279         CTTL_TRACE_DEPOSIT_TEXT( "push_top\t" );
00280         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00281         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00282         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00283         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00284         lambda_.push( const_scalar( first_operand ), lambda_.top( const_scalar( second_operand ) ) );
00285         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00286     }
00287 
00288 };  // struct xst_instruction_2_operand
00289 
00302 template< int FirstOperandT, int SecondOperandT >
00303 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, push_size_ > {
00304 
00305     template< typename TargetLambdaT >
00306     static void instruction( TargetLambdaT& lambda_ )
00307     {
00308         typedef typename TargetLambdaT::value_T value_T;
00309         static const int first_operand = FirstOperandT;
00310         static const int second_operand = SecondOperandT;
00311 
00312         CTTL_TRACE_DEPOSIT_JUSTIFY();
00313         CTTL_TRACE_DEPOSIT_TEXT( "push_size\t" );
00314         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00315         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00316         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00317         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00318         lambda_.push( const_scalar( first_operand ), value_T( lambda_.size( const_scalar( second_operand ) ) ) );
00319         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00320     }
00321 
00322 };  // struct xst_instruction_2_operand
00323 
00324 
00337 template< int FirstOperandT, int SecondOperandT >
00338 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, move_value_ > {
00339 
00340     template< typename TargetLambdaT >
00341     static void instruction( TargetLambdaT& lambda_ )
00342     {
00343         static const int first_operand = FirstOperandT;
00344 
00345         CTTL_TRACE_DEPOSIT_JUSTIFY();
00346         CTTL_TRACE_DEPOSIT_TEXT( "move_value\t" );
00347         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00348         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00349         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00350         CTTL_TRACE_DEPOSIT_TEXT( ';' );
00351         lambda_.top( const_scalar( first_operand ) ) = SecondOperandT;
00352         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00353     }
00354 
00355 };  // struct xst_instruction_2_operand
00356 
00357 
00370 template< int FirstOperandT, int SecondOperandT >
00371 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, move_top_ > {
00372 
00373     template< typename TargetLambdaT >
00374     static void instruction( TargetLambdaT& lambda_ )
00375     {
00376         static const int first_operand = FirstOperandT;
00377         static const int second_operand = SecondOperandT;
00378 
00379         CTTL_TRACE_DEPOSIT_JUSTIFY();
00380         CTTL_TRACE_DEPOSIT_TEXT( "move_top\t" );
00381         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00382         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00383         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00384         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00385         lambda_.top( const_scalar( first_operand ) ) = lambda_.top( const_scalar( second_operand ) );
00386         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00387     }
00388 
00389 };  // struct xst_instruction_2_operand
00390 
00403 template< int FirstOperandT, int SecondOperandT >
00404 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, move_size_ > {
00405 
00406     template< typename TargetLambdaT >
00407     static void instruction( TargetLambdaT& lambda_ )
00408     {
00409         typedef typename TargetLambdaT::value_T value_T;
00410         static const int first_operand = FirstOperandT;
00411         static const int second_operand = SecondOperandT;
00412 
00413         CTTL_TRACE_DEPOSIT_JUSTIFY();
00414         CTTL_TRACE_DEPOSIT_TEXT( "move_size\t" );
00415         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00416         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00417         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00418         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00419         lambda_.top( const_scalar( first_operand ) ) = value_T( lambda_.size( const_scalar( second_operand ) ) );
00420         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00421     }
00422 
00423 };  // struct xst_instruction_2_operand
00424 
00425 
00438 template< int FirstOperandT, int SecondOperandT >
00439 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, add_value_ > {
00440 
00441     template< typename TargetLambdaT >
00442     static void instruction( TargetLambdaT& lambda_ )
00443     {
00444         static const int first_operand = FirstOperandT;
00445 
00446         CTTL_TRACE_DEPOSIT_JUSTIFY();
00447         CTTL_TRACE_DEPOSIT_TEXT( "add_value\t" );
00448         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00449         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00450         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00451         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00452         lambda_.top( const_scalar( first_operand ) ) += SecondOperandT;
00453         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00454     }
00455 
00456 };  // struct xst_instruction_2_operand
00457 
00458 
00471 template< int FirstOperandT, int SecondOperandT >
00472 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, add_top_ > {
00473 
00474     template< typename TargetLambdaT >
00475     static void instruction( TargetLambdaT& lambda_ )
00476     {
00477         static const int first_operand = FirstOperandT;
00478         static const int second_operand = SecondOperandT;
00479 
00480         CTTL_TRACE_DEPOSIT_JUSTIFY();
00481         CTTL_TRACE_DEPOSIT_TEXT( "add_top\t" );
00482         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00483         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00484         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00485         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00486         lambda_.top( const_scalar( first_operand ) ) += lambda_.top( const_scalar( second_operand ) );
00487         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00488     }
00489 
00490 };  // struct xst_instruction_2_operand
00491 
00492 
00505 template< int FirstOperandT, int SecondOperandT >
00506 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, add_size_ > {
00507 
00508     template< typename TargetLambdaT >
00509     static void instruction( TargetLambdaT& lambda_ )
00510     {
00511         typedef typename TargetLambdaT::value_T value_T;
00512         static const int first_operand = FirstOperandT;
00513         static const int second_operand = SecondOperandT;
00514 
00515         CTTL_TRACE_DEPOSIT_JUSTIFY();
00516         CTTL_TRACE_DEPOSIT_TEXT( "add_size\t" );
00517         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00518         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00519         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00520         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00521         lambda_.top( const_scalar( first_operand ) ) += value_T( lambda_.size( const_scalar( second_operand ) ) );
00522         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00523     }
00524 
00525 };  // struct xst_instruction_2_operand
00526 
00527 
00540 template< int FirstOperandT, int SecondOperandT >
00541 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, sub_value_ > {
00542 
00543     template< typename TargetLambdaT >
00544     static void instruction( TargetLambdaT& lambda_ )
00545     {
00546         static const int first_operand = FirstOperandT;
00547 
00548         CTTL_TRACE_DEPOSIT_JUSTIFY();
00549         CTTL_TRACE_DEPOSIT_TEXT( "sub_value\t" );
00550         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00551         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00552         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00553         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00554         lambda_.top( const_scalar( first_operand ) ) -= SecondOperandT;
00555         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00556     }
00557 
00558 };  // struct xst_instruction_2_operand
00559 
00560 
00573 template< int FirstOperandT, int SecondOperandT >
00574 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, sub_top_ > {
00575 
00576     template< typename TargetLambdaT >
00577     static void instruction( TargetLambdaT& lambda_ )
00578     {
00579         static const int first_operand = FirstOperandT;
00580         static const int second_operand = SecondOperandT;
00581 
00582         CTTL_TRACE_DEPOSIT_JUSTIFY();
00583         CTTL_TRACE_DEPOSIT_TEXT( "sub_top\t" );
00584         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00585         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00586         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00587         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00588         lambda_.top( const_scalar( first_operand ) ) -= lambda_.top( const_scalar( second_operand ) );
00589         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00590     }
00591 
00592 };  // struct xst_instruction_2_operand
00593 
00594 
00595 
00608 template< int FirstOperandT, int SecondOperandT >
00609 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, sub_size_ > {
00610 
00611     template< typename TargetLambdaT >
00612     static void instruction( TargetLambdaT& lambda_ )
00613     {
00614         typedef typename TargetLambdaT::value_T value_T;
00615         static const int first_operand = FirstOperandT;
00616         static const int second_operand = SecondOperandT;
00617 
00618         CTTL_TRACE_DEPOSIT_JUSTIFY();
00619         CTTL_TRACE_DEPOSIT_TEXT( "sub_size\t" );
00620         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00621         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00622         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00623         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00624         lambda_.top( const_scalar( first_operand ) ) -= value_T( lambda_.size( const_scalar( second_operand ) ) );
00625         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00626     }
00627 
00628 };  // struct xst_instruction_2_operand
00629 
00630 
00643 template< int FirstOperandT, int SecondOperandT >
00644 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, mul_value_ > {
00645 
00646     template< typename TargetLambdaT >
00647     static void instruction( TargetLambdaT& lambda_ )
00648     {
00649         static const int first_operand = FirstOperandT;
00650 
00651         CTTL_TRACE_DEPOSIT_JUSTIFY();
00652         CTTL_TRACE_DEPOSIT_TEXT( "mul_value\t" );
00653         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00654         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00655         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00656         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00657         lambda_.top( const_scalar( first_operand ) ) *= SecondOperandT;
00658         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00659     }
00660 
00661 };  // struct xst_instruction_2_operand
00662 
00663 
00676 template< int FirstOperandT, int SecondOperandT >
00677 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, mul_top_ > {
00678 
00679     template< typename TargetLambdaT >
00680     static void instruction( TargetLambdaT& lambda_ )
00681     {
00682         static const int first_operand = FirstOperandT;
00683         static const int second_operand = SecondOperandT;
00684 
00685         CTTL_TRACE_DEPOSIT_JUSTIFY();
00686         CTTL_TRACE_DEPOSIT_TEXT( "mul_top\t" );
00687         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00688         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00689         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00690         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00691         lambda_.top( const_scalar( first_operand ) ) *= lambda_.top( const_scalar( second_operand ) );
00692         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00693     }
00694 
00695 };  // struct xst_instruction_2_operand
00696 
00697 
00710 template< int FirstOperandT, int SecondOperandT >
00711 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, mul_size_ > {
00712 
00713     template< typename TargetLambdaT >
00714     static void instruction( TargetLambdaT& lambda_ )
00715     {
00716         typedef typename TargetLambdaT::value_T value_T;
00717         static const int first_operand = FirstOperandT;
00718         static const int second_operand = SecondOperandT;
00719 
00720         CTTL_TRACE_DEPOSIT_JUSTIFY();
00721         CTTL_TRACE_DEPOSIT_TEXT( "mul_size\t" );
00722         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00723         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00724         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00725         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00726         lambda_.top( const_scalar( first_operand ) ) *= value_T( lambda_.size( const_scalar( second_operand ) ) );
00727         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00728     }
00729 
00730 };  // struct xst_instruction_2_operand
00731 
00732 
00745 template< int FirstOperandT, int SecondOperandT >
00746 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, div_value_ > {
00747 
00748     template< typename TargetLambdaT >
00749     static void instruction( TargetLambdaT& lambda_ )
00750     {
00751         static const int first_operand = FirstOperandT;
00752 
00753         CTTL_TRACE_DEPOSIT_JUSTIFY();
00754         CTTL_TRACE_DEPOSIT_TEXT( "div_value\t" );
00755         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00756         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00757         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00758         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00759         lambda_.top( const_scalar( first_operand ) ) /= SecondOperandT;
00760         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00761     }
00762 
00763 };  // struct xst_instruction_2_operand
00764 
00765 
00778 template< int FirstOperandT, int SecondOperandT >
00779 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, div_top_ > {
00780 
00781     template< typename TargetLambdaT >
00782     static void instruction( TargetLambdaT& lambda_ )
00783     {
00784         static const int first_operand = FirstOperandT;
00785         static const int second_operand = SecondOperandT;
00786 
00787         CTTL_TRACE_DEPOSIT_JUSTIFY();
00788         CTTL_TRACE_DEPOSIT_TEXT( "div_top\t" );
00789         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00790         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00791         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00792         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00793         lambda_.top( const_scalar( first_operand ) ) /= lambda_.top( const_scalar( second_operand ) );
00794         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00795     }
00796 
00797 };  // struct xst_instruction_2_operand
00798 
00799 
00812 template< int FirstOperandT, int SecondOperandT >
00813 struct xst_instruction_2_operand< FirstOperandT, SecondOperandT, div_size_ > {
00814 
00815     template< typename TargetLambdaT >
00816     static void instruction( TargetLambdaT& lambda_ )
00817     {
00818         typedef typename TargetLambdaT::value_T value_T;
00819         static const int first_operand = FirstOperandT;
00820         static const int second_operand = SecondOperandT;
00821 
00822         CTTL_TRACE_DEPOSIT_JUSTIFY();
00823         CTTL_TRACE_DEPOSIT_TEXT( "div_size\t" );
00824         CTTL_TRACE_DEPOSIT_TEXT( FirstOperandT );
00825         CTTL_TRACE_DEPOSIT_TEXT( '\t' );
00826         CTTL_TRACE_DEPOSIT_TEXT( SecondOperandT );
00827         CTTL_TRACE_DEPOSIT_TEXT( "; " );
00828         lambda_.top( const_scalar( first_operand ) ) /= value_T( lambda_.size( const_scalar( second_operand ) ) );
00829         CTTL_TRACE_DEPOSIT_TEXT( std::endl );
00830     }
00831 
00832 };  // struct xst_instruction_2_operand
00833 
00834 
00835 }   // namespace cttl_impl
00836 
00837 #endif //_XST_INSTRUCTIONS_H_INCLUDED_

Generated on Thu Nov 2 17:48:23 2006 for CTTL Lambda Expression by  doxygen 1.3.9.1