From dd60a1d73c8017fd3d80ccf91e4549fc47a90760 Mon Sep 17 00:00:00 2001 From: Kartik Agaram Date: Mon, 16 Nov 2020 20:44:02 -0800 Subject: 7252 --- html/apps/raytracing/vec.mu.html | 52 ++++++++++++++++++++-------------------- 1 file changed, 26 insertions(+), 26 deletions(-) (limited to 'html/apps/raytracing/vec.mu.html') diff --git a/html/apps/raytracing/vec.mu.html b/html/apps/raytracing/vec.mu.html index b3aeb5f0..9b8961c2 100644 --- a/html/apps/raytracing/vec.mu.html +++ b/html/apps/raytracing/vec.mu.html @@ -57,14 +57,14 @@ if ('onhashchange' in window) { https://github.com/akkartik/mu/blob/master/apps/raytracing/vec.mu
-  1 type vec3 {
+  1 type vec3 {
   2   x: float
   3   y: float
   4   z: float
   5 }
   6 
-  7 fn print-vec3 screen: (addr screen), _v: (addr vec3) {
-  8   var v/esi: (addr vec3) <- copy _v
+  7 fn print-vec3 screen: (addr screen), _v: (addr vec3) {
+  8   var v/esi: (addr vec3) <- copy _v
   9   print-string screen, "("
  10   var tmp/eax: (addr float) <- get v, x
  11   print-float screen, *tmp
@@ -77,9 +77,9 @@ if ('onhashchange' in window) {
  18   print-string screen, ")"
  19 }
  20 
- 21 fn vec3-add-to _v1: (addr vec3), _v2: (addr vec3) {
- 22   var v1/edi: (addr vec3) <- copy _v1
- 23   var v2/esi: (addr vec3) <- copy _v2
+ 21 fn vec3-add-to _v1: (addr vec3), _v2: (addr vec3) {
+ 22   var v1/edi: (addr vec3) <- copy _v1
+ 23   var v2/esi: (addr vec3) <- copy _v2
  24   # v1.x += v2.x
  25   var arg1/eax: (addr float) <- get v1, x
  26   var arg2/ecx: (addr float) <- get v2, x
@@ -100,22 +100,22 @@ if ('onhashchange' in window) {
  41   copy-to *arg1, result
  42 }
  43 
- 44 fn vec3-subtract-from v1: (addr vec3), v2: (addr vec3) {
- 45   var tmp-storage: vec3
- 46   var tmp/eax: (addr vec3) <- address tmp-storage
+ 44 fn vec3-subtract-from v1: (addr vec3), v2: (addr vec3) {
+ 45   var tmp-storage: vec3
+ 46   var tmp/eax: (addr vec3) <- address tmp-storage
  47   copy-object v2, tmp
- 48   vec3-negate tmp
- 49   vec3-add-to v1, tmp
+ 48   vec3-negate tmp
+ 49   vec3-add-to v1, tmp
  50 }
  51 
- 52 fn vec3-negate v: (addr vec3) {
+ 52 fn vec3-negate v: (addr vec3) {
  53   var negative-one/eax: int <- copy -1
  54   var negative-one-f/xmm0: float <- convert negative-one
- 55   vec3-scale-up v, negative-one-f
+ 55   vec3-scale-up v, negative-one-f
  56 }
  57 
- 58 fn vec3-scale-up _v: (addr vec3), f: float {
- 59   var v/edi: (addr vec3) <- copy _v
+ 58 fn vec3-scale-up _v: (addr vec3), f: float {
+ 59   var v/edi: (addr vec3) <- copy _v
  60   # v.x *= f
  61   var dest/eax: (addr float) <- get v, x
  62   var result/xmm0: float <- copy *dest
@@ -133,8 +133,8 @@ if ('onhashchange' in window) {
  74   copy-to *dest, result
  75 }
  76 
- 77 fn vec3-scale-down _v: (addr vec3), f: float {
- 78   var v/edi: (addr vec3) <- copy _v
+ 77 fn vec3-scale-down _v: (addr vec3), f: float {
+ 78   var v/edi: (addr vec3) <- copy _v
  79   # v.x /= f
  80   var dest/eax: (addr float) <- get v, x
  81   var result/xmm0: float <- copy *dest
@@ -152,23 +152,23 @@ if ('onhashchange' in window) {
  93   copy-to *dest, result
  94 }
  95 
- 96 fn vec3-unit in: (addr vec3), out: (addr vec3) {
- 97   var len/xmm0: float <- vec3-length in
+ 96 fn vec3-unit in: (addr vec3), out: (addr vec3) {
+ 97   var len/xmm0: float <- vec3-length in
  98 #?   print-string 0, "len: "
  99 #?   print-float 0, len
 100 #?   print-string 0, "\n"
 101   copy-object in, out
-102   vec3-scale-down out, len
+102   vec3-scale-down out, len
 103 }
 104 
-105 fn vec3-length v: (addr vec3) -> _/xmm0: float {
-106   var result/xmm0: float <- vec3-length-squared v
+105 fn vec3-length v: (addr vec3) -> _/xmm0: float {
+106   var result/xmm0: float <- vec3-length-squared v
 107   result <- square-root result
 108   return result
 109 }
 110 
-111 fn vec3-length-squared _v: (addr vec3) -> _/xmm0: float {
-112   var v/esi: (addr vec3) <- copy _v
+111 fn vec3-length-squared _v: (addr vec3) -> _/xmm0: float {
+112   var v/esi: (addr vec3) <- copy _v
 113   # result = v.x * v.x
 114   var src/eax: (addr float) <- get v, x
 115   var tmp/xmm1: float <- copy *src
@@ -187,10 +187,10 @@ if ('onhashchange' in window) {
 128   return result
 129 }
 130 
-131 fn vec3-dot _v1: (addr vec3), _v2: (addr vec3) -> _/xmm0: float {
+131 fn vec3-dot _v1: (addr vec3), _v2: (addr vec3) -> _/xmm0: float {
 132 }
 133 
-134 fn vec3-cross _v1: (addr vec3), _v2: (addr vec3), out: (addr vec3) {
+134 fn vec3-cross _v1: (addr vec3), _v2: (addr vec3), out: (addr vec3) {
 135 }
 
-- cgit 1.4.1-2-gfad0