Page 2 of 2

Re: issue-#27 Adding SET conversion to Strings

Posted: Mon Feb 09, 2015 12:54 am
by Ivan Denisov
cfbsoftware wrote:
Ivan Denisov wrote: contains 122 symbols... it will be reduced to " {1..32}0X"
The correct set range for the 1.6 version of BlackBox is {0..31}. Is that what is supported in this change?
Yes, this was my fault in answering! The authors of the code for this issue were more accurate :) I fixed my message.

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 9:23 am
by Josef Templ
The discussion seems to be over and the result is stable and unambiguous.
Unless there are any objections I will lock it tomorrow.

- Josef

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 11:02 am
by Zinn
The second entry here offers a link to the test version of blackbox-1.7-a1.059

I compared blackbox-1.7-a1.059 with the privious blackbox-1.7-a1.052
and I relize that the changes

- 20141027, center #24, fixing the name table handling in DevLinker
in Dev/Mod/Linker

and

- 20141027, center #25, fixing a bug in stack overflow handling
in System/Mod/Kernel

are exist in .052 but not in .059

Are change number #24 & #25 canceled and rollback to the original version? Why they are not avaiable in version .059?

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 11:28 am
by Ivan Denisov
Helmut, this branch is made a bit later than this issues were merged with master, so it does not include this changes.

You can see all the history here:
http://redmine.blackboxframework.org/pr ... r_page=100

Also there is 60 test version available already:
http://blackboxframework.org/unstable/i ... a1.060.zip

After merging this 27 branch with the master, this two issues will be united with this version automatically.

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 12:01 pm
by Robert
I am afraid I have not yet learnt how to use these marvelous development tools (I do not mean this in a sarcastic way),
so could someone tell me how to read the latest proposal for the code for the SetToString function.

I am guessing that the "diff" Ivan posted earlier is now out of date.

Thanks

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 12:21 pm
by Ivan Denisov
Robert wrote:I am afraid I have not yet learnt how to use these marvelous development tools (I do not mean this in a sarcastic way),
so could someone tell me how to read the latest proposal for the code for the SetToString function.

I am guessing that the "diff" Ivan posted earlier is now out of date.
Current diff for all changes in issue #27.

The way to find it:

1. Choose branch in the repository mirror
branch.png
branch.png (4.94 KiB) Viewed 11274 times
2. Choose versions to compare
versions.png
versions.png (44.62 KiB) Viewed 11274 times
3. Press "View differences" button

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 1:34 pm
by Robert
Thanks Ivan
Josef Templ wrote:It is a much better formulation because it is faster for small sets ...
If speed is important replace k + 2 <= MAX(SET) by k <= MAX(SET) - 2 so the subtraction takes place once at compile time rather than several times at run time.

A cheeky optimisation might be to replace MAX(SET) by

Code: Select all

PROCEDURE [code] BitScanReverse* (set : SET) : INTEGER
  0FH, 0BDH, 0C0H;	(*  bsr   eax  ->  eax  *)
Do this outside the loop. Don't worry that it is undefined for empty sets.

On second thoughts, what we already have is simpler!

OK - Lets lock this topic now!

Re: issue-#27 Adding SET conversion to Strings

Posted: Tue Feb 10, 2015 3:26 pm
by Josef Templ
> If speed is important replace k + 2 <= MAX(SET) by k <= MAX(SET) - 2 so the subtraction takes place at compile time rather than run time.

this is a simple and useful optimization. Thanks for the hint.
I have included it in issue-#27.

> A cheeky optimisation might be to replace MAX(SET) by

It is true that some useful bit operations are available at the assembly
language level that are not directly available at the
CP language level. However, I would not go to assembly level for the purpose
of set-to-string conversion unless it turns out to be really necessary.
And in that case a general purpose built-in (or library) function
should be made available for bit scans in both directions.
Currently, set-to-string conversion is a rarely used feature and most
probably not time critical.

- Josef