[ixp1200] Problem in microcode optimizer

Alok Kumar alok at cs.utexas.edu
Mon Apr 30 18:27:44 EDT 2001


Hello Everyone,

I found a problem in microcode optimizer in the Developer Workbench, so I
thought to send it through in the mailing list so that you can turn off
the code optimizer is your optomized code has similar problem.

The problem is when we use "alu" instruction with operation  "+ifsign".
Probably, optimizer does not account for the fact the resulf of alu with
+ifsign depends on the condition code. For example the following code is
optimized incorrectly

.local num den res diff
alu[num, num, -, den]						; instr 1
alu[--,--, B, num]						; instr 2
alu[res, 1, +IFSIGN, res, <<1]					; instr 3
alu[num, den, +IFSIGN, num]					; instr 4

alu[den, --, B, den, >>1]					; instr 5
alu[diff, diff, -, 1]						; instr 6
br<0[header_stored#]						; instr 7
.endlocal

The optimizer expands it as:

.local num den res diff
alu[l000!num, l000!num, -, l000!den]				; instr 1
alu[--,--, b, l000!num]						; instr 2
alu_shf[l000!res, 1, +ifsign, l000!res, <<1]			; instr 3
alu_shf[l000!diff, l000!diff, -, 1, 0]				; instr 6
br<0[header_stored#],						; instr 7
	defer[2]
	; BRANCH LATENCY FILL OPTIMIZATION:  the uword below was "pushed"
down 2 positions
alu[l000!num, l000!den, +ifsign, l000!num]			; instr 4
	; BRANCH LATENCY FILL OPTIMIZATION:  the uword below was "pushed"
down 2 positions
alu_shf[l000!den, --, b, l000!den, >>1]				; instr 5
.endlocal

Here semantics of instr 4 changes in optimized code and it works on
condition code set by instr 6 instead of condition code set by instr 2 as
it should. Using +carry in alu instruction also has similar problem. I
think optimizer assumes that alu instruction does not depend on any condition
codes. Please, turn off optimizer if you are using +ifsing or +carry.

Thanks
Alok


_______________________________________________________________________________

Alok Kumar

Residence:
3401 Red River St #201
Austin, TX 78705

Office:
Dept of Computer Science
ACES Building
University of Texas
Austin, TX 78712

Ph:  Home   - (512) 472-6443
     Office - (512) 232-7883
Fax: (401) 679 8171

Homepage: http://www.cs.utexas.edu/~alok
_______________________________________________________________________________




More information about the ixp1200 mailing list