mirror of
https://github.com/kmc7468/cs420.git
synced 2025-12-15 23:18:48 +00:00
Update tests
This commit is contained in:
@@ -1,10 +1,10 @@
|
||||
|
||||
fun f64 @average (i32, *i32) {
|
||||
fun f64 @average (i32, i32*) {
|
||||
init:
|
||||
bid: b0
|
||||
allocations:
|
||||
%l0:i32:len
|
||||
%l1:*i32:a
|
||||
%l1:i32*:a
|
||||
%l2:i32:sum
|
||||
%l3:i32:i
|
||||
|
||||
@@ -29,8 +29,8 @@ block b3:
|
||||
%b3:i2:unit = nop
|
||||
%b3:i3:i64 = typecast %b2:p1:i32 to i64
|
||||
%b3:i4:i64 = mul %b3:i3:i64 4:i64
|
||||
%b3:i5:*i32 = getelementptr %b0:p1:*i32 offset %b3:i4:i64
|
||||
%b3:i6:i32 = load %b3:i5:*i32
|
||||
%b3:i5:i32* = getelementptr %b0:p1:i32* offset %b3:i4:i64
|
||||
%b3:i6:i32 = load %b3:i5:i32*
|
||||
%b3:i7:i32 = add %b2:p0:i32 %b3:i6:i32
|
||||
%b3:i8:unit = nop
|
||||
%b3:i9:unit = nop
|
||||
@@ -127,16 +127,16 @@ block b0:
|
||||
%b0:i4:unit = nop
|
||||
%b0:i5:unit = nop
|
||||
%b0:i6:f64 = sub %b0:p0:f64 %b0:p1:f64
|
||||
%b0:i7:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:i6:f64)
|
||||
%b0:i7:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:i6:f64)
|
||||
%b0:i8:unit = nop
|
||||
%b0:i9:unit = nop
|
||||
%b0:i10:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:p0:f64)
|
||||
%b0:i10:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:p0:f64)
|
||||
%b0:i11:unit = nop
|
||||
%b0:i12:f64 = call @custom_abs:*[ret:f64 params:(f64)](%b0:p1:f64)
|
||||
%b0:i13:f64 = call @custom_max:*[ret:f64 params:(f64, f64)](%b0:i10:f64, %b0:i12:f64)
|
||||
%b0:i12:f64 = call @custom_abs:[ret:f64 params:(f64)]*(%b0:p1:f64)
|
||||
%b0:i13:f64 = call @custom_max:[ret:f64 params:(f64, f64)]*(%b0:i10:f64, %b0:i12:f64)
|
||||
%b0:i14:f64 = mul %b0:p2:f64 %b0:i13:f64
|
||||
%b0:i15:unit = nop
|
||||
%b0:i16:f64 = call @custom_max:*[ret:f64 params:(f64, f64)](%b0:i14:f64, %b0:p3:f64)
|
||||
%b0:i16:f64 = call @custom_max:[ret:f64 params:(f64, f64)]*(%b0:i14:f64, %b0:p3:f64)
|
||||
%b0:i17:u1 = cmp le %b0:i7:f64 %b0:i16:f64
|
||||
%b0:i18:i32 = typecast %b0:i17:u1 to i32
|
||||
ret %b0:i18:i32
|
||||
@@ -164,13 +164,13 @@ block b2:
|
||||
br %b2:i2:u1, b3(), b5()
|
||||
|
||||
block b3:
|
||||
%b3:i0:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
|
||||
%b3:i0:i32* = getelementptr %l0:[10 x i32]* offset 0:i32
|
||||
%b3:i1:unit = nop
|
||||
%b3:i2:i64 = typecast %b2:p0:i32 to i64
|
||||
%b3:i3:i64 = mul %b3:i2:i64 4:i64
|
||||
%b3:i4:*i32 = getelementptr %b3:i0:*i32 offset %b3:i3:i64
|
||||
%b3:i4:i32* = getelementptr %b3:i0:i32* offset %b3:i3:i64
|
||||
%b3:i5:unit = nop
|
||||
%b3:i6:unit = store %b2:p0:i32 %b3:i4:*i32
|
||||
%b3:i6:unit = store %b2:p0:i32 %b3:i4:i32*
|
||||
%b3:i7:unit = nop
|
||||
%b3:i8:i32 = add %b2:p0:i32 1:i32
|
||||
%b3:i9:unit = nop
|
||||
@@ -178,12 +178,12 @@ block b3:
|
||||
|
||||
block b5:
|
||||
%b5:i0:unit = nop
|
||||
%b5:i1:*i32 = getelementptr %l0:*[10 x i32] offset 0:i32
|
||||
%b5:i2:f64 = call @average:*[ret:f64 params:(i32, *i32)](10:i32, %b5:i1:*i32)
|
||||
%b5:i1:i32* = getelementptr %l0:[10 x i32]* offset 0:i32
|
||||
%b5:i2:f64 = call @average:[ret:f64 params:(i32, i32*)]*(10:i32, %b5:i1:i32*)
|
||||
%b5:i3:f32 = typecast %b5:i2:f64 to f32
|
||||
%b5:i4:unit = nop
|
||||
%b5:i5:unit = nop
|
||||
%b5:i6:f64 = typecast %b5:i3:f32 to f64
|
||||
%b5:i7:i32 = call @is_close:*[ret:i32 params:(f64, f64, f64, f64)](%b5:i6:f64, 4.5:f64, 0.000000001:f64, 0.1:f64)
|
||||
%b5:i7:i32 = call @is_close:[ret:i32 params:(f64, f64, f64, f64)]*(%b5:i6:f64, 4.5:f64, 0.000000001:f64, 0.1:f64)
|
||||
ret %b5:i7:i32
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user