[SLOF] [PATCH v2] slof/engine.in: refine +COMP and -COMP by not using COMPILE

Thomas Huth thuth at redhat.com
Thu Feb 22 20:04:14 AEDT 2024


On 22/02/2024 08.38, Kautuk Consul wrote:
> Hi Segher/Thomas,
> 
> On 2024-02-02 00:15:48, Kautuk Consul wrote:
>> Use the standard "DOTICK <word> COMPILE," mechanism in +COMP and -COMP
>> as is being used by the rest of the compiler.
>> Also use "SEMICOLON" instead of "EXIT" to compile into HERE in -COMP
>> as that is more informative as it mirrors the way the col() macro defines
>> a colon definition.
>>
>> Signed-off-by: Kautuk Consul <kconsul at linux.vnet.ibm.com>
>> ---
>>   slof/engine.in | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>>
>> diff --git a/slof/engine.in b/slof/engine.in
>> index 59e82f1..fa4d82e 100644
>> --- a/slof/engine.in
>> +++ b/slof/engine.in
>> @@ -422,8 +422,8 @@ imm(.( LIT(')') PARSE TYPE)
>>   col(COMPILE R> CELL+ DUP @ COMPILE, >R)
>>
>>   var(THERE 0)
>> -col(+COMP STATE @ 1 STATE +! 0BRANCH(1) EXIT HERE THERE ! COMP-BUFFER DOTO HERE COMPILE DOCOL)
>> -col(-COMP -1 STATE +! STATE @ 0BRANCH(1) EXIT COMPILE EXIT THERE @ DOTO HERE COMP-BUFFER EXECUTE)
>> +col(+COMP STATE @ 1 STATE +! 0BRANCH(1) EXIT HERE THERE ! COMP-BUFFER DOTO HERE DOTICK DOCOL COMPILE,)
>> +col(-COMP -1 STATE +! STATE @ 0BRANCH(1) EXIT DOTICK SEMICOLON COMPILE, THERE @ DOTO HERE COMP-BUFFER EXECUTE)
>>
> Did you get time to review this simple patch ?
> Is there something wrong in it or the description ?

  Hi Kautuk,

could you maybe do some performance checks to see whether this make a 
difference (e.g. by running the command in a tight loop many times)?
You can use "tb@" to get the current value of the timebase counter, so 
reading that before and after the loop should provide you with a way of 
measuring the required time.

  Thomas




More information about the SLOF mailing list