issue-#27 Adding SET conversion to Strings

Should we merge the changes of issue-#27 into master?

Yes
8
100%
No
0
No votes
Abstain
0
No votes
 
Total votes: 8

Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#27 Adding SET conversion to Strings

Post 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.
User avatar
Josef Templ
Posts: 2048
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#27 Adding SET conversion to Strings

Post 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
Zinn
Posts: 476
Joined: Tue Mar 25, 2014 5:56 pm
Location: Frankfurt am Main
Contact:

Re: issue-#27 Adding SET conversion to Strings

Post 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?
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#27 Adding SET conversion to Strings

Post 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.
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#27 Adding SET conversion to Strings

Post 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
Ivan Denisov
Posts: 1700
Joined: Tue Sep 17, 2013 12:21 am
Location: Russia

Re: issue-#27 Adding SET conversion to Strings

Post 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 11270 times
2. Choose versions to compare
versions.png
versions.png (44.62 KiB) Viewed 11270 times
3. Press "View differences" button
User avatar
Robert
Posts: 1024
Joined: Sat Sep 28, 2013 11:04 am
Location: Edinburgh, Scotland

Re: issue-#27 Adding SET conversion to Strings

Post 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!
Last edited by Robert on Tue Feb 10, 2015 4:33 pm, edited 1 time in total.
User avatar
Josef Templ
Posts: 2048
Joined: Tue Sep 17, 2013 6:50 am

Re: issue-#27 Adding SET conversion to Strings

Post 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
Locked