English Amiga Board


Go Back   English Amiga Board > Coders > Coders. General

 
 
Thread Tools
Old 27 May 2021, 21:25   #241
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
Quote:
Originally Posted by litwr View Post
Yes, D4 sets the same limit too but you added another one. If we want 9400 digits we must make D4 and D6 long word now. For the previous version it was enough to make D4 double word.
You wrote Then sub 28 is less readable than sub 14 ? - Exactly! It is because the original algorithm uses 14.
Are you able to understand 68k code?
Check this post:
http://eab.abime.net/showpost.php?p=...&postcount=232

You see this (your original code):

mulu #7,d6 ;kv = d6

this is D6 longword value, with highword equal $0000 if $10000 buff is max.
clr.l D4
move d6,d4 ;i <- kv ; 2 bytes
add.l d4,d4 ;i <- i*2 ; 2 bytes

Now this. Clear D4 and move D6 word.
D4 is doubled later.
If here you will be set/trash bit 16 for D4, then you CANT USE divu.w D4,D3 later.
Understand?
You must change rest of code to support divu.l or divu.l emulation. And this is ORIGINAL limit, YOUR CODE LIMIT.

Then dont wrote more nonsenses again then this is my limit.
Changing sub.w #14,d6 to sub.w #28,d6 dont change magically limit from 9400 to 9360.

Limited is your code. And $10000 buff. With bigger buff other/slowest 68k code must be used. Then for me $10000 buff limit is ok for 68k too, not only for 8 bit CPUs.

D4 can not be $10108-1 value, because OUT OF D4 WORD RANGE.

Anyway i suspect then you must still learning much more 68k coding. Later you will be see than clr.l D4 was totally useless instruction for your routine. Because your dirty style of coding (missing .w, missing #1, using or d5,d5 etc) is not easy to understand what you want to do.
Don_Adan is offline  
Old 27 May 2021, 22:23   #242
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
I checked your latest repo and:

sub.w #28,d6 ;kv, this limits to 9360 digits - #14 did not have this limit

Hahaha, you are very funny.
BTW. You still dont optimise code speed for full loop. Too big speed progress?
Don_Adan is offline  
Old 28 May 2021, 03:47   #243
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
Especially for you longwords based version, 2 bytes shortest from my previous version.
But of course divu.w d4,d3 limit still occured.

Sorry, 4 bytes shortest

Code:
 .l7 
         mulu.w #7,d6          ;kv = d6
         lsr.l #2,D6               ; /4
         move.l d6,d7
         lea.l ra(pc),a3

         exg a5,a6
         jsr Forbid(a6)
         moveq.l #INTB_VERTB,d0
         lea.l VBlankServer(pc),a1
         jsr AddIntServer(a6)
         exg a5,a6
         ;move.w #$4000,$dff096    ;DMA off
 
         move.l #2000*65537,d0
         move.l a3,a0
.fill    move.l d0,(a0)+
         subq.l #1,D7
         bne.b .fill

         move.l D7,-(SP)    ; cv

.l0      moveq #0,D5       ;d <- 0
         move.l d6,d4     ;i <- kv, i <- i*2
         lsl.l #2,D4           ; *4
         adda.l d4,a3
         subq.l #1,d4     ;b <- 2*i-1
         move.w #10000,d1
         bra.b .l4

.l2     
.......

         subq.l #2,d4    ;i <- i - 1
         bcc.b .l2       ;the main loop
         divu.w d1,d5      ;removed with MULU optimization
 
         add.w (SP),D5 ; cv
         move.l D5,(SP) ; cv
         ext.l D5   ; necessary only for litwr version of PR0000 routine
         bsr PR0000

         subq.l #7,d6   ;kv
         bne.b .l0
         addq.l #4,SP ;  restore stack

Last edited by Don_Adan; 28 May 2021 at 04:07.
Don_Adan is offline  
Old 29 May 2021, 12:54   #244
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Quote:
Originally Posted by litwr View Post
Yes, D4 sets the same limit too but you added another one. If we want 9400 digits we must make D4 and D6 long word now. For the previous version it was enough to make D4 double word.
You wrote Then sub 28 is less readable than sub 14 ? - Exactly! It is because the original algorithm uses 14.
"14 terms give 4 decimal digits"

buffer = (decimals * 14) / 4 = (decimals * 7) / 2
decimals = (buffer / 7) * 2

Right?
modrobert is offline  
Old 29 May 2021, 13:21   #245
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
What is the reason for banning litwr?
modrobert is offline  
Old 29 May 2021, 15:12   #246
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
Quote:
Originally Posted by modrobert View Post
"14 terms give 4 decimal digits"

buffer = (decimals * 14) / 4 = (decimals * 7) / 2
decimals = (buffer / 7) * 2

Right?
No.
decimals = buffer/7

But this 68k routine wrote 4 digits at once.

Then for $10000/7=9362.
Because wrote 4 digits, then 9360 is max.

Perhaps routine which wrote 1 or 2 digits at once will be much fastest (less divu). But i dont read exactly this project rules.
Don_Adan is offline  
Old 29 May 2021, 16:06   #247
a/b
Registered User
 
Join Date: Jun 2016
Location: europe
Posts: 1,065
Quote:
Originally Posted by modrobert View Post
What is the reason for banning litwr?
You mean the official reason? Unofficially, everyone knew it's coming, he was practically begging for it.
And nope, it wasn't me (to report him or complain to admins about him), I simply stopped posting and wasting my time.
That being said, I too would like to hear what was the tipping point.
a/b is offline  
Old 30 May 2021, 00:28   #248
Bruce Abbott
Registered User
 
Bruce Abbott's Avatar
 
Join Date: Mar 2018
Location: Hastings, New Zealand
Posts: 2,742
Quote:
Originally Posted by a/b View Post
You mean the official reason? Unofficially, everyone knew it's coming...
As you say he was 'practically begging for it' but I would have thought we were adult enough to handle it. If he got banned I guess it must be for something other than his (visible) posts.

Anyway, since litwr is now 'on holiday' (for how long?) I would like to see the complete best 'optimized' code collated, so I can assemble and run it on my A1200 to compare to his original version. The goal is to see what progress we have actually made, and was it 'worth it'?
Bruce Abbott is offline  
Old 30 May 2021, 01:30   #249
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
If you want, you can check this version, 2 bytes longer, but full loop is 2 bytes shortest.

Code:
 .l7 
         mulu.w #7,d6          ;kv = d6
         lsr.l #2,D6               ; /4
         move.l d6,d7
         lea.l ra(pc),a3

         exg a5,a6
         jsr Forbid(a6)
         moveq.l #INTB_VERTB,d0
         lea VBlankServer(pc),a1
         jsr AddIntServer(a6)
         exg a5,a6
         ;move.w #$4000,$dff096    ;DMA off
 
         move.l #2000*65537,d0
         move.l a3,a0
.fill    move.l d0,(a0)+
         subq.l #1,D7
         bne.b .fill

         move.l D7,-(SP)    ; cv
         lea 10000.W,A2

.l0      moveq #0,D5       ;d <- 0
         move.l d6,d4     ;i <- kv, i <- i*2
         lsl.l #2,D4           ; *4
         adda.l d4,a3
         subq.l #1,d4     ;b <- 2*i-1
         move.l A2,D1
         bra.b .l4

.l2     
.......

         subq.l #2,d4    ;i <- i - 1
         bcc.b .l2       ;the main loop
         divu.w d1,d5      ;removed with MULU optimization
 
         add.w (SP),D5 ; cv
         move.l D5,(SP) ; cv
         ext.l D5   ; necessary only for litwr version of PR0000 routine
         bsr PR0000

         subq.l #7,d6   ;kv
         bne.b .l0
         addq.l #4,SP ;  restore stack


.....

 msgx dc.b 32,10
 cnop 0,4
; cv  dc.w 0
 time dc.l 0
 cout dc.l 0
 buf ds.b 4
 
;        align 2
ra
Don_Adan is offline  
Old 30 May 2021, 11:13   #250
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Quote:
Originally Posted by a/b View Post
You mean the official reason? Unofficially, everyone knew it's coming, he was practically begging for it.
And nope, it wasn't me (to report him or complain to admins about him), I simply stopped posting and wasting my time.
That being said, I too would like to hear what was the tipping point.
I misunderstood litwr at first, thought he was an Atari troll based on this thread, but later learned he his whole project approach is about testing boundaries and questioning a lot, which can be provocative, but still a "normal process" for anyone with experience of being subjected to peer review.

The bickering about details was mutual among several members in this thread, can't blame litwr alone for that.

Quote:
Originally Posted by Bruce Abbott View Post
If he got banned I guess it must be for something other than his (visible) posts.
That's my conclusion as well.

Quote:
Originally Posted by Bruce Abbott View Post
Anyway, since litwr is now 'on holiday' (for how long?) I would like to see the complete best 'optimized' code collated, so I can assemble and run it on my A1200 to compare to his original version. The goal is to see what progress we have actually made, and was it 'worth it'?
https://github.com/litwr2/rosetta-pi...a/pi-amiga.asm


Quote:
Originally Posted by Don_Adan View Post
No.
decimals = buffer/7

But this 68k routine wrote 4 digits at once.

Then for $10000/7=9362.
Because wrote 4 digits, then 9360 is max.

Perhaps routine which wrote 1 or 2 digits at once will be much fastest (less divu). But i dont read exactly this project rules.
I was referring to the original algorithm in my reply to litwr:

https://crypto.stanford.edu/pbc/notes/pi/code.html
modrobert is offline  
Old 30 May 2021, 17:36   #251
Don_Adan
Registered User
 
Join Date: Jan 2008
Location: Warsaw/Poland
Age: 56
Posts: 2,047
Init code optimised a few.

Code:
 
start    lea libname(pc),a1         ;open the dos library
         move.l 4.W,a5
         move.l a5,a6
         jsr OldOpenLibrary(a6)
         move.l d0,a6
         jsr Output(a6)          ;get stdout
         lea cout(PC),A4
         move.l d0,(A4)            ;cout
         move.l d0,d1                   ;call Write(stdout,buff,size)
 ;        move.l #msg1,d2
         moveq #msg1-cout,D2 ; must be checked if in moveq range, the longest text can be moved at end
         add.l A4,D2
         moveq #msg4-msg1,d3
         jsr Write(a6)
;         move.l #start+$10000-ra,d7
;         divu #7,d7
         move.l #$10000-(ra-start),D7
         divu.w #7*4,D7
         ext.l d7                  ; necessary only for Litwr version of PR0000
 ;        and.b #$fc,d7                 ;d7=maxn
         lsl.l #2,D7

.l20 
;    move.l cout(pc),d1
         move.l (A4),D1    ; cout
;         move.l #msg4,d2
         moveq #msg4-cout,D2
         add.l A4,D2
         moveq #msg5-msg4,d3
         jsr Write(a6)
         move.l d7,d5
         bsr.w PR0000
;         move.l cout(pc),d1
         move.l (A4),D1 ; cout
;         move.l #msg5,d2
         moveq #msg5-cout,D2
         add.l A4,D2
         moveq #msg3-msg5,d3
         jsr Write(a6)
         bsr.w getnum
         cmp.w d7,d5
         bhi.b .l20

         move.w d5,d1
         beq.b .l20

         addq.w #3,d5
         and.w #$fffc,d5
         cmp.b #10,(a0)
         bne.b .l21

         move.w d5,d6
         cmp.w d1,d5
         beq.b .l7

.l21     bsr.w PR0000
;         move.l cout(pc),d1
          move.l (A4),D1 ; cout
;         move.l #msg3,d2
        moveq #msg3-cout,D2
         add.l A4,D2
         moveq #msg2-msg3+1,d3
         jsr Write(a6)

.l7 
         mulu.w #7,d6          ;kv = d6
         lsr.l #2,D6               ; /4
         move.l d6,d7
         lea ra(pc),a3

         exg a5,a6
         jsr Forbid(a6)
         moveq.l #INTB_VERTB,d0
         lea VBlankServer(pc),a1
         jsr AddIntServer(a6)
         exg a5,a6
         ;move.w #$4000,$dff096    ;DMA off
 
         move.l #2000*65537,d0
         move.l a3,a0
.fill    move.l d0,(a0)+
         subq.l #1,D7
         bne.b .fill

         move.l D7,-(SP)    ; cv
         lea 10000.W,A2

.l0      moveq #0,D5       ;d <- 0
         move.l d6,d4     ;i <- kv, i <- i*2
         lsl.l #2,D4           ; *4
         adda.l d4,a3
         subq.l #1,d4     ;b <- 2*i-1
         move.l A2,D1
         bra.b .l4

.l2     
.......

         subq.l #2,d4    ;i <- i - 1
         bcc.b .l2       ;the main loop
         divu.w d1,d5      ;removed with MULU optimization
 
         add.w (SP),D5 ; cv
         move.l D5,(SP) ; cv
         ext.l D5   ; necessary only for litwr version of PR0000 routine
         bsr PR0000

         subq.l #7,d6   ;kv
         bne.b .l0
         addq.l #4,SP ;  restore stack


.....

 msgx dc.b 32,10
 cnop 0,4
; cv  dc.w 0
 time dc.l 0
 cout dc.l 0
 buf ds.b 4
 
;        align 2
ra
For Litwr version of PR0000

lea.l buf(pc),a0
move.l a0,d2
can be moved/added before of full loop, because D2 is unchanged in the full loop.
For my version too, but because i dont know which version is really fastest, i dont change this for now. Anyway 2 commands left, in the future.
Don_Adan is offline  
Old 31 May 2021, 07:32   #252
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Who banned litwr and what was the reason?
modrobert is offline  
Old 31 May 2021, 16:39   #253
BippyM
Global Moderator
 
BippyM's Avatar
 
Join Date: Nov 2001
Location: Derby, UK
Age: 48
Posts: 9,355
Quote:
Originally Posted by modrobert View Post
Who banned litwr and what was the reason?

I banned him after an agreement between mods and gmods. Why is for litwr to tell you on his return.



I would like to point out that we do not have to publicly explain why we have banned a user. The user will always be told the reason they have been banned and in most cases will have had prior warnings too.


Ask litwr when he is back!
BippyM is offline  
Old 31 May 2021, 20:21   #254
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 846
Quote:
Originally Posted by Bruce Abbott View Post
Anyway, since litwr is now 'on holiday' (for how long?)
litwr was banned for 2 weeks.


Quote:
Originally Posted by a/b View Post
And nope, it wasn't me (to report him or complain to admins about him), I simply stopped posting and wasting my time.
It would appear that, some other members could learn something from you (e.g. there is sometimes an alternative to reporting posts).
SpeedGeek is offline  
Old 01 June 2021, 09:57   #255
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Quote:
Originally Posted by BippyM View Post
I banned him after an agreement between mods and gmods. Why is for litwr to tell you on his return.
I'm not so sure he is coming back.

Quote:
Originally Posted by BippyM View Post
I would like to point out that we do not have to publicly explain why we have banned a user. The user will always be told the reason they have been banned and in most cases will have had prior warnings too.
Why? Are you afraid to take responsibility for it?
modrobert is offline  
Old 01 June 2021, 10:11   #256
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
Quote:
Originally Posted by modrobert View Post
Why? Are you afraid to take responsibility for it?
Probably to avoid useless public arguments. There's always people who think users that are banned shouldn't have been and vice versa there's always people who think certain people should be banned that are still there.

At the end of the day, that's what the mods are for - to make that choice based on the rules. Discussing and questioning these kind of decisions in public, often nigh on endlessly (as we've seen on this board before) never changes anything. It only serves to give the impression the mods are the bad guys (because as we've also seen people almost never change their minds), when in reality it's almost always more complicated than that and the mods are basically just doing their job. One that is often rather thankless it seems.

Last edited by roondar; 01 June 2021 at 10:17.
roondar is offline  
Old 01 June 2021, 11:15   #257
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Quote:
Originally Posted by roondar View Post
At the end of the day, that's what the mods are for - to make that choice based on the rules. Discussing and questioning these kind of decisions in public, often nigh on endlessly (as we've seen on this board before) never changes anything. It only serves to give the impression the mods are the bad guys (because as we've also seen people almost never change their minds), when in reality it's almost always more complicated than that and the mods are basically just doing their job. One that is often rather thankless it seems.
Using your argument, it should be easy to point out which rule litwr broke then, right?
modrobert is offline  
Old 01 June 2021, 11:29   #258
roondar
Registered User
 
Join Date: Jul 2015
Location: The Netherlands
Posts: 3,437
Quote:
Originally Posted by modrobert View Post
Using your argument, it should be easy to point out which rule litwr broke then, right?
The essence of my argument is that discussing moderation in public is pointless. I gave some of the reasons for why I think this above. As such, I'm not going to speculate. More so because doing so would be based on incomplete information.

In case you don't realise it, your reply essentially backs up my point: it's feels argumentative in nature and seems to me to assume bad faith acting by the moderation team. Now, it's perfectly possible you don't intend this, but that's how it felt to me anyway. And I personally don't feel that's fair. You don't have all the facts, neither have I.
roondar is offline  
Old 01 June 2021, 12:02   #259
modrobert
old bearded fool
 
modrobert's Avatar
 
Join Date: Jan 2010
Location: Bangkok
Age: 57
Posts: 779
Quote:
Originally Posted by roondar View Post
The essence of my argument is that discussing moderation in public is pointless. I gave some of the reasons for why I think this above. As such, I'm not going to speculate. More so because doing so would be based on incomplete information.

In case you don't realise it, your reply essentially backs up my point: it's feels argumentative in nature and seems to me to assume bad faith acting by the moderation team. Now, it's perfectly possible you don't intend this, but that's how it felt to me anyway. And I personally don't feel that's fair. You don't have all the facts, neither have I.
There is no discussion, because no reason has been given so far for the ban, hence my question. It's a fair question, especially in a topic where several forum members collaborated with litwr.
modrobert is offline  
Old 01 June 2021, 14:29   #260
SpeedGeek
Moderator
 
SpeedGeek's Avatar
 
Join Date: Dec 2010
Location: Wisconsin USA
Age: 60
Posts: 846
@Thread

Ok, I think this discussion regarding litwr's ban, which is in fact off-topic here, has gone far enough. Now, I'm going to quote the EAB rules for you before taking any moderator actions you may not like:

Consistently derail topics:

While not a major issue as topics can veer off topic during the natural course of the discussion, however if you continually steer a discussion away from the subject or towards a topic that you wish to discuss, you will be warned. If you persist, other measures will be taken against you. To avoid this, raise your own thread on the subject rather than hijacking another similar topic.
SpeedGeek is offline  
 


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Similar Threads
Thread Thread Starter Forum Replies Last Post
68020 Bit Field Instructions mcgeezer Coders. Asm / Hardware 9 27 October 2023 23:21
68060 64-bit integer math BSzili Coders. Asm / Hardware 7 25 January 2021 21:18
Discovery: Math Audio Snow request.Old Rare Games 30 20 August 2018 12:17
Math apps mtb support.Apps 1 08 September 2002 18:59

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +2. The time now is 08:05.

Top

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Page generated in 0.19645 seconds with 14 queries