MIPS Gedanken

Aus Wiki CCC Göttingen
Zur Navigation springen Zur Suche springen

<source lang="text"> ohne -O / mips32

9d004ad8 <main>:

       char c;
       int  i;
       long l;

int main(void) { 9d004ad8: 27bdfff8 addiu sp,sp,-8 9d004adc: afbe0004 sw s8,4(sp) 9d004ae0: 03a0f021 move s8,sp


       c = SPI2BUF;

9d004ae4: 3c02bf80 lui v0,0xbf80 9d004ae8: 8c425a20 lw v0,23072(v0) 9d004aec: 7c021420 seb v0,v0 9d004af0: a3828018 sb v0,-32744(gp)

       i = SPI2BUF;

9d004af4: 3c02bf80 lui v0,0xbf80 9d004af8: 8c425a20 lw v0,23072(v0) 9d004afc: af828014 sw v0,-32748(gp)

       l = SPI2BUF;

9d004b00: 3c02bf80 lui v0,0xbf80 9d004b04: 8c425a20 lw v0,23072(v0) 9d004b08: af828010 sw v0,-32752(gp)


... }

-O2

       c = SPI2BUF;

9d004ad8: 3c02bf80 lui v0,0xbf80 9d004adc: 8c435a20 lw v1,23072(v0) 9d004ae0: a3838018 sb v1,-32744(gp)

       i = SPI2BUF;

9d004ae4: 8c435a20 lw v1,23072(v0) 9d004ae8: af838014 sw v1,-32748(gp)

       l = SPI2BUF;

9d004aec: 8c425a20 lw v0,23072(v0)


ohne -O / -mips16e

9d004ad8 <main>: 9d004ad8: 6491 save 8,s1

       char c;
       int  i;
       long l;

int main(void) { 9d004ada: 673d move s1,sp 9d004adc: 675c move v0,gp


       c = SPI2BUF;

9d004ade: 651a move t8,v0 9d004ae0: b20a lw v0,9d004b08 <main+0x30> 9d004ae2: 9a40 lw v0,0(v0) 9d004ae4: ea91 seb v0 9d004ae6: 6778 move v1,t8 9d004ae8: f010 c358 sb v0,-32744(v1) 9d004aec: b207 lw v0,9d004b08 <main+0x30>

       i = SPI2BUF;

9d004aee: 9a40 lw v0,0(v0) 9d004af0: 6778 move v1,t8 9d004af2: f010 db54 sw v0,-32748(v1) 9d004af6: b205 lw v0,9d004b08 <main+0x30>

       l = SPI2BUF;

9d004af8: 9a40 lw v0,0(v0) 9d004afa: 6778 move v1,t8 9d004afc: f010 db50 sw v0,-32752(v1) 9d004b00: 6758 move v0,t8


... }

-O1 -mips16e d004ad8 <main>:

       char c;
       int  i;
       long l;

int main(void) { 9d004ad8: 677c move v1,gp


       c = SPI2BUF;

9d004ada: b406 lw a0,9d004af0 <main+0x18> 9d004adc: 9c40 lw v0,0(a0) 9d004ade: f010 c358 sb v0,-32744(v1) 9d004ae2: 9c40 lw v0,0(a0)

       i = SPI2BUF;

9d004ae4: f010 db54 sw v0,-32748(v1) 9d004ae8: 9c40 lw v0,0(a0)

       l = SPI2BUF;

9d004aea: f010 db50 sw v0,-32752(v1) 9d004aee: e8a0 jrc ra ... } </source>