00:03
<
Zarutian_HTC >
hmm... I am now wondering about satellite stuff.
00:05
<
Zarutian_HTC >
tp, from where you are do you think you could "see" the satellite TELSTAR 18V ?
00:19
<
tp >
Zarutian_HTC, I've no idea, probably not
00:20
<
tp >
Zarutian_HTC, I have no satellite gear, and Australia uses AUSSAT, a geo sync some 64,000km round trip
00:21
<
tp >
Zarutian_HTC, you need to wait for SpaceX's multiple sat leo constellation, that will be awesome
00:21
iyzsong has joined #forth
00:22
<
tabemann >
now I'm wondering what to do next with zeptoforth
00:23
<
tp >
tabemann, do you have 'pictured numerical output' yet ?
00:23
<
tabemann >
no I don't
00:23
<
tabemann >
I don't know how that works, TBH
00:23
<
tp >
you cant use my svd2forth register pretty prints if you dont
00:24
<
tp >
you know it's just a print formatter like the C "printf" stuff, but very powerful ?
00:25
<
crest >
tabemann: there is a global buffer for formatted output
00:25
<
crest >
you reset it with <#
00:25
<
crest >
add one digit to it with #
00:26
<
crest >
this works by divding the double word on the stack by the base
00:26
<
crest >
#> finishes the conversion and drops the double word
00:26
<
tabemann >
I... don't yet have support for double worods
00:26
<
crest >
replacing it by the address and length of the buffer
00:26
<
crest >
in between <# and #> you format your numbers
00:27
<
tabemann >
because I don't know how to multiply or divide double words
00:27
<
tabemann >
because Thumb-2 has no double word multiply or divide instructions
00:27
<
tp >
I dont have support for double wo-rods either, am I missing out ? whats a single wo-rod do anyway ?
00:27
<
crest >
but does it have a 32x32->64 multiply?
00:27
<
Zarutian_HTC >
crest: dont forget #s and that word that allows you to add chars to the buffer
00:27
<
tabemann >
crest: nope
00:28
<
crest >
Zarutian_HTC: and hold for fixed stuff like units
00:28
<
tp >
tabemann, then maybe add support for doubles ?
00:28
<
crest >
doesn't #s just repeat # until the number is zero?
00:29
<
tabemann >
tp: the problem is that I don't know how to implement multiply and divide for doubles
00:30
<
crest >
(if you want to get fancy)
00:30
<
crest >
if you have just 32x32->32 split the number into 16bit parts
00:31
<
crest >
do it just like you would do multiplication with pen and paper
00:31
<
crest >
just that your base is 2^16 instead of 10
00:31
<
crest >
do you remeber the annoying multiplication tables you had to learn in school?
00:32
<
crest >
well the cpu multiplication instruction is just such a table (it's implemented differently)
00:32
<
crest >
every 16 bit multiplication fits into a 32bit register
00:32
<
tp >
tabemann, dont listen to crest ... just use the floating point peripheral on your mcu!
00:33
<
crest >
tp: because?
00:33
<
tp >
crest, easier ?
00:33
<
crest >
he just wants 64 bit multiply not true bignums
00:33
<
crest >
does the fpu have 32x32->64 multiplier?
00:33
<
tp >
i know, my comment was in jest
00:35
<
crest >
normally ieee754 fpus contain just 56 bit multipliers for the mantissa
00:35
<
tp >
actually Im a fixed point lover
00:35
<
crest >
if you have a fast fpu and no 32x32->64 multiplier you can certainly speed up large bignum operations by using larger limbs
00:36
<
tp >
temp at my desk at 10:36 am
00:36
<
crest >
because all realworld multiplications algorithms have superlinear runtime
00:37
<
crest >
last year there was a new breakthrough in multiplication algorithms
00:37
<
crest >
they claim to have beat n*log(n) long thought to be the lower bound for multiplication
00:38
<
crest >
but it only beats the existing algorithms for number with > 2^100
*digits*
00:38
<
crest >
as in larger than 10^2^100
00:38
<
crest >
which is insane
00:39
<
tp >
not that useful on a cortex-m
00:39
<
crest >
the algorithm may be fast but you could still bruteforce most 128bit ciphers in less time
00:40
<
tabemann >
I have another question
00:40
<
tabemann >
what about 64-bit division?
00:41
<
tp >
tabemann, didn't you learn your 64 bit tables at school ?
00:59
X-Scale has quit [Ping timeout: 256 seconds]
00:59
[X-Scale] has joined #forth
00:59
[X-Scale] is now known as X-Scale
01:41
boru` has joined #forth
01:41
boru has quit [Disconnected by services]
01:41
boru` is now known as boru
01:41
* tabemann
is going to buck the ANS people can make his <# # #> use single words
01:42
<
tabemann >
partially because while the Karatsuba algorithm seems simple on the surface but is too complex in practice
02:02
rdrop-exit has joined #forth
02:10
<
rdrop-exit >
c[] good morning tabemann
02:18
<
tabemann >
does anyone here know how to do doubleword division on a machine without a 64-bit divide instruction?
02:22
<
dave0 >
hi tabemann
02:23
<
dave0 >
i have code for that, but it's slow cos i goes a bit at a time
02:23
<
dave0 >
lots of shifts
02:23
<
dave0 >
is that okay?
02:23
<
dave0 >
ah divison.. one sec
02:26
<
dave0 >
tabemann: 64 bit dividend divided by 64 bit divisor to give a 64 bit quotient and 64 bit remainder ?
02:29
<
dave0 >
gimme a minute
02:30
<
rdrop-exit >
double by single is probably more useful
02:30
<
rdrop-exit >
e.g. 64 by 32
02:32
<
tabemann >
double by single would probably work for me actually, since I'm dividing by BASE
02:34
<
dave0 >
it's for amd64 and you will need to modify it to use 64 bit registers
02:34
<
dave0 >
also it's for gnu as in intel mode
02:35
<
tabemann >
this is for Cortex-M4
02:36
<
dave0 >
that's arm?
02:36
<
dave0 >
you'll have to port it :-(
02:37
<
dave0 >
i'm quite sure i tested the algorithms (with brute force)
02:37
<
tabemann >
yes, Cortex-M4 is ARM
02:38
<
rdrop-exit >
I have 64 by 32 => 32 in C if you like
02:38
<
rdrop-exit >
sorry I mean 128 by 64 => 64 in C
02:39
<
tabemann >
are you using __int128? ;)
02:39
<
rdrop-exit >
I have without
02:41
<
rdrop-exit >
let me figure out how to paste it somewhere
02:44
<
dave0 >
and for text: nc termbin.com 9999 < file.c
02:45
<
rdrop-exit >
I used this pastebin thingie
02:45
<
tp >
I use wgetpaste :)
02:45
<
rdrop-exit >
I use different ones every time, I keep forgetting which one I prefer
02:46
<
tp >
forgetfulpaste ?
02:46
<
dave0 >
rdrop-exit: aha you don't use bit-shifts
02:47
<
dave0 >
you estimate with a smaller division and fix it up to the true quotient
02:47
<
dave0 >
that's faster
02:50
<
rdrop-exit >
I forgot to paste in the U64 etc defines
02:50
<
rdrop-exit >
#define U64 uint64_t
02:51
<
rdrop-exit >
No warranties explicit or implied BTW
02:52
Zarutian_HTC has quit [Quit: Bye]
02:56
cantstanya has quit [Ping timeout: 240 seconds]
03:00
cantstanya has joined #forth
03:08
dddddd has quit [Ping timeout: 240 seconds]
03:09
<
tabemann >
cI've found a problem with the use of the Karatsuba algorithm
03:09
<
tabemann >
it doesn't take into account carries
03:11
<
rdrop-exit >
Karatsuba is for huge numbers, I don't think you need it
03:14
<
rdrop-exit >
ah wait, maybe I'm confusing it with another algorithm
03:17
<
rdrop-exit >
I provided you with a MULH in that paste
03:21
<
dave0 >
tabemann: you have to worry about negative numbers too :-/
03:22
<
tabemann >
dave0: oh, I'm taking negative numbers in question
03:22
<
rdrop-exit >
the MULH gives you the high order bits of a product, it'll work with either signed or unsigned
03:23
<
rdrop-exit >
since it's a macro
03:23
<
tabemann >
rdrop-exit: I'm only using one stage of Karatsuba
03:24
dave0 has quit [Quit: dave's not here]
03:27
<
rdrop-exit >
Have a look at the MULH, it's based on that
03:38
WickedShell has joined #forth
03:41
<
rdrop-exit >
the ARM assembler provides a MULH macro if I understood this page correctly
04:05
webchat9 has joined #forth
04:17
reepca has quit [Read error: Connection reset by peer]
04:18
reepca has joined #forth
04:36
_whitelogger has joined #forth
05:01
rdrop-exit has quit [Ping timeout: 264 seconds]
05:05
rdrop-exit has joined #forth
05:50
xek has joined #forth
05:56
gravicappa has joined #forth
06:26
mtsd has joined #forth
06:54
rdrop-exit has quit [Ping timeout: 256 seconds]
06:58
rdrop-exit has joined #forth
07:15
rdrop-exit has quit [Ping timeout: 256 seconds]
07:21
dys has joined #forth
07:24
rdrop-exit has joined #forth
07:26
mtsd has quit [Quit: Leaving]
07:30
mtsd has joined #forth
07:41
rdrop-exit has quit [Ping timeout: 264 seconds]
07:45
rdrop-exit has joined #forth
07:50
mtsd has quit [Quit: Leaving]
08:04
mtsd has joined #forth
08:11
reepca has quit [Read error: Connection reset by peer]
08:12
reepca` has joined #forth
08:26
dddddd has joined #forth
08:43
dave0 has joined #forth
09:13
mtsd_ has joined #forth
09:15
mtsd has quit [Read error: Connection reset by peer]
09:17
mtsd_ has quit [Client Quit]
09:37
WickedShell has quit [Remote host closed the connection]
09:42
webchat9 has quit [Quit: Leaving]
11:04
mtsd has joined #forth
11:27
diginet2 has quit [Quit: diginet has left the building]
11:27
diginet2 has joined #forth
11:42
Kumool has quit [Quit: FreeZNC - Visit us! Server: chat.freenode.net Channel: ##bnc4you]
11:43
Kumool has joined #forth
11:54
rdrop-exit has quit [Quit: Lost terminal]
12:24
reepca` is now known as reepca
12:44
mtsd has quit [Quit: Leaving]
13:11
<
crest >
rdrop-exit: the link looks like arm64 documentation to me
13:35
reepca has quit [Read error: Connection reset by peer]
13:36
reepca has joined #forth
13:49
reepca has quit [Read error: Connection reset by peer]
13:49
reepca has joined #forth
13:51
<
tabemann >
someone pointed me at some code for implementing D* and DU/MOD.... but it turns out the code is probably proprietary since it is part of SwiftForth... ugh
13:52
<
crest >
tp: about as readable as possible with limited amount of plaintext
13:52
<
crest >
maybe pad with spaces instead of leading zeroes
13:52
<
tp >
tabemann, what about the Mecrisp-Stellaris code ?
13:53
<
tabemann >
tp: hadn't thought of that
13:54
<
tp >
crest, hadn't thought of that
13:54
<
tp >
crest, I have a dim recollection that I did the 8 char printout for a reason
13:55
<
tp >
crest, but for the life of me I cant recall
13:55
<
crest >
take a look at line 3
13:55
<
tabemann >
I need to get off to work
13:55
<
tp >
crest, in any event it's a generated number, changing it wont save code space in the chip
13:56
<
crest >
tp: sure but it might improve readabilty
13:56
<
crest >
why pad the index in decimal with leading zeroes?
13:56
<
tp >
i'll set my subconscious to work on it soon when Im asleep!
13:57
<
tp >
but same question I guess
13:57
<
crest >
line 3 counts in decimal unless you suddenly have $15 pins per port
13:58
<
crest >
how many columns are you prepared to use?
13:59
<
crest >
64? 80? 120? even more?
13:59
<
tp >
I think just the default 80
14:00
<
crest >
because the longest line in your example is just 64 so you could add little more whitespace to make it easier to read
14:01
<
tp >
youd think so :)
14:02
<
tp >
but the Mecrisp-Stellaris print formatter is limited to 64 chars
14:02
<
tp >
I cant generate any more than that, I tried everything initially
14:02
<
crest >
in that case you did the best layout possible within the 64 byte buffer
14:02
<
tp >
yeah, it does the job at least
14:03
<
tp >
any formatted register is better than none imho
14:03
dys has quit [Ping timeout: 256 seconds]
14:06
<
crest >
it's readable but very dense (visually)
14:06
<
tp >
i manually label registers for the f051 like this
14:07
<
tp >
RCC_APB1ENR RW $00000000
14:07
<
tp >
C D P 2 2 R P W I T T T
14:07
<
tp >
E A W C C T I D M I I I
14:07
<
tp >
C C R 2 1 2 2 G 1 M M M
14:07
<
tp >
E E E E E E E E 4 6 3 2
14:07
<
tp >
N N N N N N N N E E E E
14:07
<
tp >
|3|2|2| |2|2| |1| |1| |1| N N N N
14:07
<
tp >
~|0|9|8|~|~|~|~|~|2|1|~|~|~|7|~|~|4|~|~|1|~|~|8|~|~|~|4|~|~|1|0
14:07
<
tp >
0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0
14:07
<
tp >
and add them as I get to them in a project
14:07
<
crest >
nice but to much work
14:07
<
tp >
actually it's pretty fast
14:08
<
tp >
I use gvim in replace mode
14:08
<
crest >
but it requires manual work for each new chip
14:08
<
crest >
unless you can extract the names from the xml files
14:08
<
tp >
and the effort is worth it when running up a infamiliar peripheral, it's either this or have a PDF taking up space on the screen
14:09
<
crest >
it's very useful
14:09
<
crest >
but takes time
14:09
<
tp >
yeah, It could be automated but way beyond my skills
14:10
<
tp >
such a program would be handy for the other chip users who just get a simple default legend
14:11
<
tp >
in my case, doing the legend is also educational for peripheral introduction
14:12
<
tp >
I take the names from the datasheet, but never thought about taking them from the SVD
14:13
<
tp >
ah well, zzz time here
14:13
<
tp >
catch ya on the morrow!
14:42
dave0 has quit [Quit: dave's not here]
14:52
<
crest >
tp: your output looks good enough
15:19
guan has quit [Ping timeout: 245 seconds]
15:20
guan has joined #forth
15:42
TCZ has joined #forth
15:43
TCZ has left #forth ["Leaving"]
17:00
dys has joined #forth
17:37
<
veltas >
: 0<> 0= 0= ;
17:43
<
DKordic >
Law of the Excluded Middle? ;)
17:44
<
veltas >
Quite so :D
17:59
dys has quit [Ping timeout: 240 seconds]
19:13
nonlinear has quit [Read error: Connection reset by peer]
19:14
nonlinear1 has joined #forth
19:19
reepca has quit [Read error: Connection reset by peer]
19:19
reepca has joined #forth
19:28
Croran has quit [Ping timeout: 260 seconds]
19:38
jsoft has quit [Ping timeout: 265 seconds]
19:38
Croran has joined #forth
19:46
pareidolia_ has quit [Ping timeout: 265 seconds]
19:47
pareidolia has joined #forth
19:52
reepca has quit [Read error: Connection reset by peer]
19:52
reepca has joined #forth
19:58
reepca has quit [Read error: Connection reset by peer]
19:58
reepca has joined #forth
20:46
reepca has quit [Read error: Connection reset by peer]
20:47
reepca has joined #forth
21:03
Zarutian_HTC has joined #forth
21:23
TCZ has joined #forth
21:24
Zarutian_HTC has quit [Ping timeout: 256 seconds]
21:25
dave0 has joined #forth
21:26
Zarutian_HTC has joined #forth
21:29
gravicappa has quit [Ping timeout: 256 seconds]
21:30
WickedShell has joined #forth
21:39
TCZ has quit [Quit: Leaving]
21:54
<
veltas >
There are definitely some things Forth seems to do nicer than C-style languages
21:54
<
veltas >
I like the way that you can chain together binary ops
21:55
<
veltas >
Like in C you might have min(max(t, 1), 100) to keep t within 1 and 100
21:55
<
veltas >
And in Forth it's: 1 max 100 min
22:04
reepca has quit [Read error: Connection reset by peer]
22:04
reepca has joined #forth
22:51
reepca has quit [Ping timeout: 258 seconds]
22:53
reepca has joined #forth
23:03
X-Scale` has joined #forth
23:03
X-Scale has quit [Ping timeout: 240 seconds]
23:04
X-Scale` is now known as X-Scale
23:18
<
tabemann >
I got a solution to D* and DUM/MOD... but the problem is that DUM/MOD requires UM/MOD, and I don't have an instruction for that
23:32
<
dave0 >
tabemann: were you able to translate my amd64 code for um/mod ?
23:35
TCZ has joined #forth
23:36
<
tabemann >
I don't need code for UM*, because I realized there's a Thumb-2 instruction that can be used for it, 32x32+64 multiply/accumulate
23:36
<
tabemann >
I'll take a look at your code for UM/MOD though
23:36
TCZ has left #forth ["Leaving"]
23:36
<
dave0 >
aah cool.. that will be way faster
23:40
TCZ has joined #forth
23:40
TCZ has quit [Quit: Leaving]
23:40
TCZ has joined #forth
23:44
<
tabemann >
unfortunately I can't read AMD64 asm
23:45
<
tabemann >
maybe I'm too used to ARM/Thumb asm
23:53
<
dave0 >
fair enough
23:53
<
dave0 >
i can't read arm :-p
23:54
<
dave0 >
i could write it in c if you want, it will just take a while