mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 06:58:50 +00:00
Update ir examples
This commit is contained in:
@@ -6,6 +6,8 @@ init:
|
||||
|
||||
|
||||
block b0:
|
||||
%b0:p0:i32:len
|
||||
%b0:p1:i32*:a
|
||||
j b2(0:i32, 0:i32)
|
||||
|
||||
block b2:
|
||||
@@ -37,6 +39,7 @@ init:
|
||||
|
||||
|
||||
block b0:
|
||||
%b0:p0:f64:a
|
||||
%b0:i0:f64 = typecast 0:i32 to f64
|
||||
%b0:i1:u1 = cmp lt %b0:p0:f64 %b0:i0:f64
|
||||
br %b0:i1:u1, b1(), b2()
|
||||
@@ -60,6 +63,8 @@ init:
|
||||
|
||||
|
||||
block b0:
|
||||
%b0:p0:f64:a
|
||||
%b0:p1:f64:b
|
||||
%b0:i0:u1 = cmp gt %b0:p0:f64 %b0:p1:f64
|
||||
br %b0:i0:u1, b1(), b2()
|
||||
|
||||
@@ -81,6 +86,10 @@ init:
|
||||
|
||||
|
||||
block b0:
|
||||
%b0:p0:f64:a
|
||||
%b0:p1:f64:b
|
||||
%b0:p2:f64:rel_tol
|
||||
%b0:p3:f64:abs_tol
|
||||
%b0:i0:f64 = sub %b0:p0:f64 %b0:p1:f64
|
||||
%b0:i1:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:i0:f64)
|
||||
%b0:i2:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:p0:f64)
|
||||
|
||||
Reference in New Issue
Block a user