qbe

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

_fix4.ssa (353B)


      1 function $test() {
      2 @start
      3 	%x =w copy 3
      4 	%n =w copy 2
      5 @loop
      6 	%c =w ceqw %n, 10000
      7 	jnz %c, @end, @next
      8 @next
      9 	%t =w copy 3
     10 	%x =w add %x, 2
     11 @tloop
     12 	%s =w mul %t, %t
     13 	%c =w csgtw %s, %x
     14 	jnz %c, @prime, @test
     15 @test
     16 	%r =w rem %x, %t
     17 	jnz %r, @tnext, @loop
     18 @tnext
     19 	%t =w add %t, 2
     20 	jmp @tloop
     21 @prime
     22 	%n =w add %n, 1
     23 	jmp @loop
     24 @end
     25 	storew %x, $a
     26 	ret
     27 }