impc:ir:compiler:loop   scheme


Defined in:  https://github.com/digego/extempore/tree/v0.8.9/runtime/llvmir.xtm

Implementation

(define impc:ir:compiler:loop
  (lambda (ast types)
    (let* ((os (make-string 0))
           (loop-num (llvm:count++))
           (loop-label (string-append "loop" (number->string loop-num) ":"))
           (closeloop-label (string-append "closeloop" (number->string loop-num) ":"))
           (after-label (string-append "after" (number->string loop-num) ":"))
           (loop (string-append "%loop" (number->string loop-num)))
           (closeloop (string-append "%closeloop" (number->string loop-num)))
           (cmp (string-append "%cmp" (number->string loop-num)))
           (after (string-append "%after" (number->string  loop-num)))
           (iterator (string-append "%" (symbol->string (caar ast)))) ; "Loop" (number->string loop-num)))
           (iterator-type (impc:ir:get-type-str (cdr (assoc-strcmp (caar ast) types))))
           (startstr (impc:ir:compiler (cadar ast) types (impc:ir:get-type-from-str iterator-type)))
           (start (impc:ir:gname))
           (start-value? (> (length (car ast)) 2))
           (numstr (impc:ir:compiler (if start-value?
                                         (caddar ast)
                                         (cadar ast))
                                     types
                                     (cdr (assoc-strcmp (caar ast) types))))
           (num (impc:ir:gname)) ;(ir:eval (cadar ast) os stack sym-table))
           (bodystr (impc:ir:compiler (cdr ast) types)))
      (emit "; setup loop\n" os)
                                        ;(print num 'numstr numstr)
      (emit numstr os)
      (if start-value? (emit startstr os))


Back to Index

Similar Entries

  • AudioBuffer_read_looped    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • AudioBuffer_read_looped    xtlang    /digego/extempore/tree/v0.8.9/libs/core/audiobuffer.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • _glib_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • _gst_main_loop_call    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/mediaplayer.xtm
  • beat_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/going-native.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/game-of-life.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_vg.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/drawtext.xtm
  • gl-loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/particles.xtm
  • gl-loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • gl-loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/kinect_fire.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/spectrogram.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/arrows.xtm
  • gl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/particles.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluids_2d.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nuklear.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/raymarcher.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender3.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender2.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/gl-compatibility.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender1.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender5.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender4.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/xtmrender6.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/simple-triangle.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/framebuffer.xtm
  • gl_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/triangle.xtm
  • glib-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/slideshow.xtm
  • glib-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • glib_main_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo.xtm
  • gst-main-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/mediaplayer.xtm
  • gui_render_loop    xtlang    /digego/extempore/tree/v0.8.9/libs/external/gui.xtm
  • impc:ir:compiler:loop    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • impc:ir:compiler:while-loop    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmir.xtm
  • impc:ti:doloop    scheme    /digego/extempore/tree/v0.8.9/runtime/llvmti.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/core/audio_101.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/rtmidi.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/polysynth.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/kinect.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/particles.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/opencv_test.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/sampler.xtm
  • loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/sing_a_song.xtm
  • loop2    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/polysynth.xtm
  • loop2    scheme    /digego/extempore/tree/v0.8.9/examples/external/sampler.xtm
  • mainLoop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/horde3d_knight.xtm
  • mainLoop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/bullet.xtm
  • midi-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/portmidi.xtm
  • midi-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/portmidi-output.xtm
  • midi_read_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/portmidi.xtm
  • my-gl-loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/fluid_dynamics.xtm
  • node_reply_loop    xtlang    /digego/extempore/tree/v0.8.9/libs/external/fleet-node.xtm
  • node_reply_loop_stop    xtlang    /digego/extempore/tree/v0.8.9/libs/external/fleet-node.xtm
  • nonblocking_read_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg-request.xtm
  • nonblocking_read_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg-reply.xtm
  • nonblocking_read_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg-respondent.xtm
  • nonblocking_read_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg-surveyor.xtm
  • nvg_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/chipmunk-simple.xtm
  • nvg_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/datavis.xtm
  • nvg_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanovg_helper.xtm
  • nvg_draw_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/external/openvg.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/shadowmap.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/multilight.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/shaderlight.xtm
  • opengl-loop    scheme    /digego/extempore/tree/v0.8.9/examples/contrib/gstvideo_multi.xtm
  • receiver_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg.xtm
  • reply_loop    xtlang    /digego/extempore/tree/v0.8.9/examples/contrib/nanomsg.xtm
  • rmap-loop-runner    macro    /digego/extempore/tree/v0.8.9/libs/core/pattern-language.xtm
  • run_main_event_loop    xtlang    /digego/extempore/tree/v0.8.9/libs/core/scheduler.xtm
  • shadertoy-loop    scheme    /digego/extempore/tree/v0.8.9/examples/external/shader-tutorials/shadertoy.xtm
  • xtm-setup-and-start-gl-loop    scheme    /digego/extempore/tree/v0.8.9/libs/external/graphics-pipeline-scm.xtm