Changeset 1440 in svn for trunk/processor/main.m4


Ignore:
Timestamp:
2013-11-05T18:17:07+01:00 (20 months ago)
Author:
Xuefer
Message:

adds ptrmove

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/processor/main.m4

    r1439 r1440  
    2424dnl ============
    2525define(`INDENT', `xc_dprint_indent(indent);')
     26dnl }}}
     27dnl {{{ SRCPTR(1:type, 2:elm)
     28define(`SRCPTR', `SRCPTR_EX(`$1', `SRC(`$2')')')
     29define(`SRCPTR_EX', `IFPTRMOVE(`(($1 *) (((char *) $2) + ptrmove->src))', `$2')')
     30dnl }}}
     31dnl {{{ SRCPTR(1:type, 2:elm)
     32define(`DSTPTR', `DSTPTR_EX(`$1', `DST(`$2')')')
     33define(`DSTPTR_EX', `SRCPTR_EX($@)')
    2634dnl }}}
    2735dnl {{{ ALLOC(1:dst, 2:type, 3:count=1, 4:clean=false, 5:realtype=$2)
     
    123131define(`EXPORT', `define(`EXPORT_$1')')
    124132dnl }}}
    125 dnl {{{ FIXPOINTER
    126 define(`FIXPOINTER', `FIXPOINTER_EX(`$1', `DST(`$2')')')
    127 define(`FIXPOINTER_EX', `IFSTORE(`
    128     $2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (void *)$2);
    129 ')')
    130 define(`UNFIXPOINTER', `UNFIXPOINTER_EX(`$1', `DST(`$2')')')
    131 define(`UNFIXPOINTER_EX', `IFSTORE(`
    132     $2 = ($1 *) processor->shm->handlers->to_readwrite(processor->shm, (void *)$2);
    133 ')')
     133dnl {{{ FIXPOINTER(1:type, 2:ele)
     134define(`FIXPOINTER', `FIXPOINTER_EX(`$1', `DST(`$2')', `SRCPTR(`$1', `$2')')')
     135dnl }}}
     136dnl {{{ FIXPOINTER_EX(1:type, 2:dst, 3:src)
     137define(`FIXPOINTER_EX', `
     138    IFSTORE(`$2 = ($1 *) processor->shm->handlers->to_readonly(processor->shm, (void *)$2);')
     139    IFPTRMOVE(`$2 = ($1 *) (((char *) $3) + ptrmove->ptrdiff);')
     140')
    134141dnl }}}
    135142dnl {{{ IFNOTMEMCPY
     
    139146define(`COPY', `IFNOTMEMCPY(`IFCOPY(`DST(`$1') = SRC(`$1');')')DONE(`$1')')
    140147dnl }}}
    141 dnl {{{ COPY_N_EX
     148dnl {{{ COPY_N_EX(1:count, 2:type, 3:dst)
    142149define(`COPY_N_EX', `
    143150    ALLOC(`DST(`$3')', `$2', `SRC(`$1')')
     
    147154')
    148155dnl }}}
    149 dnl {{{ COPY_N
    150 define(`COPY_N', `COPY_N_EX(`$1',`$2')DONE(`$1')')
    151 dnl }}}
    152156dnl {{{ COPYPOINTER
    153157define(`COPYPOINTER', `COPY(`$1')')
    154 dnl }}}
    155 dnl {{{ COPYARRAY_EX
    156 define(`COPYARRAY_EX', `IFNOTMEMCPY(`IFCOPY(`memcpy(DST(`$1'), SRC(`$1'), sizeof(DST(`$1')));')')')
    157 dnl }}}
    158 dnl {{{ COPYARRAY
    159 define(`COPYARRAY', `COPYARRAY_EX(`$1',`$2')DONE(`$1')')
    160158dnl }}}
    161159dnl {{{ SETNULL_EX
    162160define(`SETNULL_EX', `IFCOPY(`$1 = NULL;')')
    163161define(`SETNULL', `SETNULL_EX(`DST(`$1')')DONE(`$1')')
    164 dnl }}}
    165 dnl {{{ SETZERO_EX
    166 define(`SETZERO_EX', `IFCOPY(`$1 = 0;')')
    167 define(`SETZERO', `SETZERO_EX(`DST(`$1')')DONE(`$1')')
    168162dnl }}}
    169163dnl {{{ COPYNULL_EX(1:dst, 2:elm-name)
     
    243237define(`IFCALCSTORE', `IFSTORE(`$1', `IFCALC(`$1', `$2')')')
    244238define(`IFRESTORE', `ifelse(PROCESSOR_TYPE, `restore', `$1', `$2')')
     239define(`IFPTRMOVE', `ifelse(PROCESSOR_TYPE, `ptrmove', `$1', `$2')')
    245240define(`IFCOPY', `IFSTORE(`$1', `IFRESTORE(`$1', `$2')')')
    246241define(`IFCALCCOPY', `IFCALC(`$1', `IFCOPY(`$1', `$2')')')
     
    270265REDEF(`PROCESSOR_TYPE', `store') include(srcdir`/processor/processor.m4')
    271266REDEF(`PROCESSOR_TYPE', `restore') include(srcdir`/processor/processor.m4')
     267REDEF(`PROCESSOR_TYPE', `ptrmove') include(srcdir`/processor/processor.m4')
    272268
    273269#ifdef HAVE_XCACHE_DPRINT
Note: See TracChangeset for help on using the changeset viewer.