Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.forth > #55357

Re: esp8266 eForth and it's development software

From Cecil Bayona <cbayona@cbayona.com>
Newsgroups comp.lang.forth
Subject Re: esp8266 eForth and it's development software
Date 2017-03-01 22:44 -0600
Organization A noiseless patient Spider
Message-ID <o987s3$upp$1@dont-email.me> (permalink)
References (7 earlier) <87bmtkfnkq.fsf@nightsong.com> <o981bq$n4c$1@dont-email.me> <877f48fkqx.fsf@nightsong.com> <o982o4$ib3$1@dont-email.me> <8737ewfist.fsf@nightsong.com>

Show all headers | View raw


On 3/1/2017 9:40 PM, Paul Rubin wrote:
> Cecil Bayona <cbayona@cbayona.com> writes:
>> IP = data(IP / sizeof(w));
>
> You've inspected the asm code and there's really a division there?
>
> Why not just change it to a shift?
>
In some cases it uses shift in a few cases it uses divide, below is an 
example where it uses shift, it's pretty hard to find anything as the 
code is all mixed up with libraries in between routines;

void cellsl(void) {
   top /= sizeof(w);
40201c60:	fffc31        	l32r	a3, 40201c50 <_Z22__run_user_rf_pre_initv+0x4>
40201c63:	fffe51        	l32r	a5, 40201c5c 
<_Z22__run_user_rf_pre_initv+0x10>
40201c66:	0328      	l32i.n	a2, a3, 0
40201c68:	424b      	addi.n	a4, a2, 4
40201c6a:	0349      	s32i.n	a4, a3, 0
40201c6c:	fffa41        	l32r	a4, 40201c54 <_Z22__run_user_rf_pre_initv+0x8>
40201c6f:	0438      	l32i.n	a3, a4, 0
40201c71:	1239      	s32i.n	a3, a2, 4
40201c73:	fff921        	l32r	a2, 40201c58 <_Z22__run_user_rf_pre_initv+0xc>
40201c76:	0238      	l32i.n	a3, a2, 0
40201c78:	416230        	srli	a6, a3, 2
40201c7b:	a05650        	addx4	a5, a6, a5
40201c7e:	0558      	l32i.n	a5, a5, 0
40201c80:	334b      	addi.n	a3, a3, 4
40201c82:	0459      	s32i.n	a5, a4, 0
40201c84:	0239      	s32i.n	a3, a2, 0
40201c86:	f00d      	ret.n

An awful lot of code to store a number shifted right twice;

Looking at the code generated there is so much code to do something very 
simple that a divide would hardly be any worse, it has multiply and 
divide instructions built in.

  "top" is the cached top of the Data Stack so its replacing the top of 
the Data Stack with itself shifted right 2 places.

-- 
Cecil - k5nwa

Back to comp.lang.forth | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread


Thread

esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 15:18 -0600
  Re: esp8266 eForth and it's development software David Schultz <abuse@127.0.0.1> - 2017-03-01 15:29 -0600
    Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 17:16 -0600
      Re: esp8266 eForth and it's development software David Schultz <abuse@127.0.0.1> - 2017-03-01 17:51 -0600
        Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 18:36 -0600
          Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 16:53 -0800
            Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 19:28 -0600
              Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 17:56 -0800
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 20:53 -0600
                Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 18:57 -0800
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 21:17 -0600
                Re: esp8266 eForth and it's development software David Schultz <abuse@127.0.0.1> - 2017-03-01 21:38 -0600
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 22:02 -0600
                Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 19:40 -0800
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 22:44 -0600
  Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 14:50 -0800
    Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 17:26 -0600
      Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-01 15:41 -0800
      Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-01 18:10 -0600
  Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-04 20:50 -0600
    Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-04 20:10 -0800
      Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-04 23:06 -0600
        Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-04 21:25 -0800
          Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-05 00:47 -0600
            Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-05 01:36 -0800
              Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-05 17:11 -0600
              Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-05 15:43 -0600
            Re: esp8266 eForth and it's development software Mark Wills <markwills1970@gmail.com> - 2017-03-06 01:45 -0800
              Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-06 10:44 -0600
              Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-06 12:28 -0600
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-06 16:00 -0600
                Re: esp8266 eForth and it's development software Rod Pemberton <NeedNotReplyHere@xrsevnneqk.cem> - 2017-03-06 17:57 -0500
                Re: esp8266 eForth and it's development software Mark Wills <markwills1970@gmail.com> - 2017-03-07 01:23 -0800
                Re: esp8266 eForth and it's development software albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-07 12:32 +0100
                Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-07 10:39 -0600
  Re: esp8266 eForth and it's development software albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-06 13:35 +0100
    Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-06 10:51 -0600
      Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-07 22:33 -0600
        Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-07 20:39 -0800
          Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-07 23:42 -0600
            Re: esp8266 eForth and it's development software Paul Rubin <no.email@nospam.invalid> - 2017-03-07 23:44 -0800
              Re: esp8266 eForth and it's development software Cecil Bayona <cbayona@cbayona.com> - 2017-03-08 11:03 -0600
          Re: esp8266 eForth and it's development software albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-08 12:05 +0100
    Re: esp8266 eForth and it's development software anton@mips.complang.tuwien.ac.at (Anton Ertl) - 2017-03-06 17:09 +0000
      Re: esp8266 eForth and it's development software albert@cherry.spenarnc.xs4all.nl (Albert van der Horst) - 2017-03-07 12:52 +0100

csiph-web