Subject: Re: uvm.page_idle_zero access on bool changes (Re: CVS commit: src/sys)
To: None <tnn+nbsd@nygren.pp.se>
From: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
List: port-alpha
Date: 02/24/2007 21:14:16
tnn+nbsd@nygren.pp.se wrote:
> >> + ldq_u t1, UVM_PAGE_IDLE_ZERO(t0)
> >> + lda t0, UVM_PAGE_IDLE_ZERO(t0) /* should we zero some
> >> pages? */
> >> + extbl t1, t0, t0
> >> + and t0, 0xff, t0
> >> beq t0, 3f /* nope. */
> >> CALL(uvm_pageidlezero)
> >> 3: ldl t0, sched_whichqs /* look for non-empty queue */
> > AARM section (I) 4-53 says that's the intended sequence for loading
> > a byte from unaligned storage, so it should be ok.
> Actually that final "and" is not required. Did gcc emit that?
Hmm. I added the following code at the end of uvm_init() in uvm_init.c:
---
if (uvm.page_idle_zero)
printf("foo");
---
then gcc -O0 emitted:
---
15c: 15 00 41 2c ldq_u t1,21(t0)
160: 15 00 21 20 lda t0,21(t0)
164: c1 00 41 48 extbl t1,t0,t0
168: 01 f0 3f 44 and t0,0xff,t0
16c: 06 00 20 e4 beq t0,188 <uvm_init+0x188>
---
but now gcc -O1 says:
---
144: 15 00 29 2c ldq_u t0,21(s0)
148: 15 00 29 21 lda s0,21(s0)
14c: c1 00 29 48 extbl t0,s0,t0
150: 06 00 20 e4 beq t0,16c <uvm_init+0x16c>
---
and -O2:
---
134: 15 00 29 2c ldq_u t0,21(s0)
138: 15 00 29 21 lda s0,21(s0)
13c: c1 00 29 48 extbl t0,s0,t0
140: 1f 04 ff 47 nop
144: 06 00 20 e4 beq t0,160 <uvm_init+0x160>
---
I'm not sure why gcc -O2 puts an extra nop, but I think
you are correct.
---
Izumi Tsutsui