qbe

Internal scc patchset buffer for QBE
Log | Files | Refs | README | LICENSE

commit 6e0c39404795ced4a9b3e6c54e2b361e87d6ee35
parent 97db80da3133cd8d46038e3811a04d340d19ce98
Author: Quentin Carbonneaux <quentin.carbonneaux@yale.edu>
Date:   Thu, 22 Oct 2015 16:42:46 -0400

add a test for addressing mode optimization

Diffstat:
Alisc/test/sum.ssa | 21+++++++++++++++++++++
1 file changed, 21 insertions(+), 0 deletions(-)

diff --git a/lisc/test/sum.ssa b/lisc/test/sum.ssa @@ -0,0 +1,21 @@ +# Simple test for addressing modes. + +function w $sum(l %arr, w %num) { +@start + %n0 =w sub %num, 1 +@loop + %n1 =w phi @start %n0, @loop1 %n2 + %s0 =w phi @start 0, @loop1 %s1 + %c =w csle %n1, 0 + jnz %c, @end, @loop1 +@loop1 + %idx0 =l extuw %num + %idx1 =l mul 4, %idx0 + %idx2 =l add %idx1, %arr + %w =w loadw %idx2 + %s1 =w add %w, %s0 + %n2 =w sub %n1, 1 + jmp @loop +@end + ret %s0 +}