diff options
author | Camil Staps | 2021-01-07 18:58:20 +0100 |
---|---|---|
committer | Camil Staps | 2021-01-07 18:58:20 +0100 |
commit | 7648792e62a349dd6c05a5f97658e1ae3be090f6 (patch) | |
tree | 8afe81af6a69ba04ee8db205b01823e070a387ab /fib_eqI_b.ll | |
parent | Centralize instruction implementations (diff) |
Replace tabs by two spaces
Diffstat (limited to 'fib_eqI_b.ll')
-rw-r--r-- | fib_eqI_b.ll | 200 |
1 files changed, 100 insertions, 100 deletions
diff --git a/fib_eqI_b.ll b/fib_eqI_b.ll index 73a9b81..ac9cbca 100644 --- a/fib_eqI_b.ll +++ b/fib_eqI_b.ll @@ -1,145 +1,145 @@ define i64* @e_fib_eqI_b_nfib(i64* %n, i64** %globasp) prefix {i8*, i64} {i8* inttoptr (i64 0 to i8*), i64 1} { - %astack = alloca i64*, i64 10 - %asp.000 = getelementptr i64*, i64** %astack - %bstack = alloca i64, i64 10 - %bsp.000 = getelementptr i64, i64* %bstack, i64 9 + %astack = alloca i64*, i64 10 + %asp.000 = getelementptr i64*, i64** %astack + %bstack = alloca i64, i64 10 + %bsp.000 = getelementptr i64, i64* %bstack, i64 9 - %asp.001 = getelementptr i64*, i64** %asp.000, i64 1 - store i64* %n, i64** %asp.001 + %asp.001 = getelementptr i64*, i64** %asp.000, i64 1 + store i64* %n, i64** %asp.001 - %t.0 = bitcast i64*(i64**)* @_cycle_in_spine to i64* - %asp.002 = call i64** @push_node(i64* %t.0, i64 1, i64** %asp.001) + %t.0 = bitcast i64*(i64**)* @_cycle_in_spine to i64* + %asp.002 = call i64** @push_node(i64* %t.0, i64 1, i64** %asp.001) - %t.1 = call i64* @peek_a(i64** %asp.002) - %asp.003 = call i64** @pop_a1(i64** %asp.002) - %globasp.0 = call i64** @_push_local_astack(i64** %asp.003, i64** %asp.000, i64** %globasp) - %t.2 = call i64 @ea1(i64* %t.1, i64** %globasp.0) - %bsp.001 = call i64* @pushI(i64 %t.2, i64* %bsp.000) + %t.1 = call i64* @peek_a(i64** %asp.002) + %asp.003 = call i64** @pop_a1(i64** %asp.002) + %globasp.0 = call i64** @_push_local_astack(i64** %asp.003, i64** %asp.000, i64** %globasp) + %t.2 = call i64 @ea1(i64* %t.1, i64** %globasp.0) + %bsp.001 = call i64* @pushI(i64 %t.2, i64* %bsp.000) - %asp.004 = call i64** @fillI_b(i64 0, i64 -0, i64* %bsp.001, i64** %asp.003) - %bsp.002 = call i64* @pop_b1(i64* %bsp.001) + %asp.004 = call i64** @fillI_b(i64 0, i64 -0, i64* %bsp.001, i64** %asp.003) + %bsp.002 = call i64* @pop_b1(i64* %bsp.001) - %t.3 = call i64* @peek_a(i64** %asp.004) - %asp.005 = call i64** @pop_a1(i64** %asp.004) - ret i64* %t.3 + %t.3 = call i64* @peek_a(i64** %asp.004) + %asp.005 = call i64** @pop_a1(i64** %asp.004) + ret i64* %t.3 } define private i64 @ea1(i64* %n, i64** %globasp) { - %astack = alloca i64*, i64 10 - %asp.000 = getelementptr i64*, i64** %astack, i64 0 - %bstack = alloca i64, i64 10 - %bsp.000 = getelementptr i64, i64* %bstack, i64 9 - - %asp.001 = getelementptr i64*, i64** %asp.000, i64 1 - store i64* %n, i64** %asp.001 - - %asp.002 = call i64** @jsr_eval(i64 -0, i64** %asp.001, i64** %asp.000, i64** %globasp) - %bsp.001 = call i64* @pushI_a(i64 -0, i64* %bsp.000, i64** %asp.002) - %asp.003 = call i64** @pop_a1(i64** %asp.002) - - %t.0 = call i64 @peek_b(i64* %bsp.001) - %bsp.002 = call i64* @pop_b1(i64* %bsp.001) - %t.1 = tail call i64 @s1(i64 %t.0, i64** %globasp) - ret i64 %t.1 + %astack = alloca i64*, i64 10 + %asp.000 = getelementptr i64*, i64** %astack, i64 0 + %bstack = alloca i64, i64 10 + %bsp.000 = getelementptr i64, i64* %bstack, i64 9 + + %asp.001 = getelementptr i64*, i64** %asp.000, i64 1 + store i64* %n, i64** %asp.001 + + %asp.002 = call i64** @jsr_eval(i64 -0, i64** %asp.001, i64** %asp.000, i64** %globasp) + %bsp.001 = call i64* @pushI_a(i64 -0, i64* %bsp.000, i64** %asp.002) + %asp.003 = call i64** @pop_a1(i64** %asp.002) + + %t.0 = call i64 @peek_b(i64* %bsp.001) + %bsp.002 = call i64* @pop_b1(i64* %bsp.001) + %t.1 = tail call i64 @s1(i64 %t.0, i64** %globasp) + ret i64 %t.1 } define i64 @e_fib_eqI_b_sfib(i64 %arg, i64** %globasp) #0 { - %r = tail call i64 @s1(i64 %arg, i64** %globasp) - ret i64 %r + %r = tail call i64 @s1(i64 %arg, i64** %globasp) + ret i64 %r } define private i64 @s1(i64 %arg, i64** %globasp) #0 { - %astack = alloca i64*, i64 10000 - %asp.000 = getelementptr i64*, i64** %astack - %bstack = alloca i64, i64 10000 - %bsp.000 = getelementptr i64, i64* %bstack, i64 9999 + %astack = alloca i64*, i64 10000 + %asp.000 = getelementptr i64*, i64** %astack + %bstack = alloca i64, i64 10000 + %bsp.000 = getelementptr i64, i64* %bstack, i64 9999 - %bsp.001 = call i64* @pushI(i64 %arg, i64* %bsp.000) + %bsp.001 = call i64* @pushI(i64 %arg, i64* %bsp.000) - %bsp.002 = call i64* @eqI_b(i64 0, i64 0, i64* %bsp.001) - %t.0 = call i64 @peek_b(i64* %bsp.002) - %bsp.003 = call i64* @pop_b1(i64* %bsp.002) - %t.1 = trunc i64 %t.0 to i1 - br i1 %t.1, label %case.1, label %l.0 + %bsp.002 = call i64* @eqI_b(i64 0, i64 0, i64* %bsp.001) + %t.0 = call i64 @peek_b(i64* %bsp.002) + %bsp.003 = call i64* @pop_b1(i64* %bsp.002) + %t.1 = trunc i64 %t.0 to i1 + br i1 %t.1, label %case.1, label %l.0 l.0: - %bsp.004 = call i64* @eqI_b(i64 1, i64 0, i64* %bsp.003) - %t.2 = call i64 @peek_b(i64* %bsp.004) - %bsp.005 = call i64* @pop_b1(i64* %bsp.004) - %t.3 = trunc i64 %t.2 to i1 - br i1 %t.3, label %case.2, label %case.3 + %bsp.004 = call i64* @eqI_b(i64 1, i64 0, i64* %bsp.003) + %t.2 = call i64 @peek_b(i64* %bsp.004) + %bsp.005 = call i64* @pop_b1(i64* %bsp.004) + %t.3 = trunc i64 %t.2 to i1 + br i1 %t.3, label %case.2, label %case.3 case.1: - %bsp.100 = call i64* @pop_b1(i64* %bsp.003) - %bsp.101 = call i64* @pushI(i64 1, i64* %bsp.100) + %bsp.100 = call i64* @pop_b1(i64* %bsp.003) + %bsp.101 = call i64* @pushI(i64 1, i64* %bsp.100) - %r.1 = call i64 @peek_b(i64* %bsp.101) - %bsp.102 = call i64* @pop_b1(i64* %bsp.101) + %r.1 = call i64 @peek_b(i64* %bsp.101) + %bsp.102 = call i64* @pop_b1(i64* %bsp.101) - ret i64 %r.1 + ret i64 %r.1 case.2: - %bsp.200 = call i64* @pop_b1(i64* %bsp.005) - %bsp.201 = call i64* @pushI(i64 1, i64* %bsp.200) + %bsp.200 = call i64* @pop_b1(i64* %bsp.005) + %bsp.201 = call i64* @pushI(i64 1, i64* %bsp.200) - %r.2 = call i64 @peek_b(i64* %bsp.201) - %bsp.202 = call i64* @pop_b1(i64* %bsp.201) + %r.2 = call i64 @peek_b(i64* %bsp.201) + %bsp.202 = call i64* @pop_b1(i64* %bsp.201) - ret i64 %r.2 + ret i64 %r.2 case.3: - %bsp.300 = call i64* @pushI(i64 1, i64* %bsp.005) - %bsp.301 = call i64* @push_b(i64 1, i64* %bsp.300) - %bsp.302 = call i64* @subI(i64* %bsp.301) + %bsp.300 = call i64* @pushI(i64 1, i64* %bsp.005) + %bsp.301 = call i64* @push_b(i64 1, i64* %bsp.300) + %bsp.302 = call i64* @subI(i64* %bsp.301) - %arg.0 = call i64 @peek_b(i64* %bsp.302) - %bsp.302.0 = call i64* @pop_b1(i64* %bsp.302) - %ret.0 = call i64 @s1(i64 %arg.0, i64** %globasp) - %bsp.303 = call i64* @pushI(i64 %ret.0, i64* %bsp.302.0) + %arg.0 = call i64 @peek_b(i64* %bsp.302) + %bsp.302.0 = call i64* @pop_b1(i64* %bsp.302) + %ret.0 = call i64 @s1(i64 %arg.0, i64** %globasp) + %bsp.303 = call i64* @pushI(i64 %ret.0, i64* %bsp.302.0) - %bsp.304 = call i64* @pushI(i64 2, i64* %bsp.303) - %bsp.305 = call i64* @push_b(i64 2, i64* %bsp.304) - %bsp.306 = call i64* @subI(i64* %bsp.305) + %bsp.304 = call i64* @pushI(i64 2, i64* %bsp.303) + %bsp.305 = call i64* @push_b(i64 2, i64* %bsp.304) + %bsp.306 = call i64* @subI(i64* %bsp.305) - %arg.1 = call i64 @peek_b(i64* %bsp.306) - %bsp.306.0 = call i64* @pop_b1(i64* %bsp.306) - %ret.1 = call i64 @s1(i64 %arg.1, i64** %globasp) - %bsp.307 = call i64* @pushI(i64 %ret.1, i64* %bsp.306.0) + %arg.1 = call i64 @peek_b(i64* %bsp.306) + %bsp.306.0 = call i64* @pop_b1(i64* %bsp.306) + %ret.1 = call i64 @s1(i64 %arg.1, i64** %globasp) + %bsp.307 = call i64* @pushI(i64 %ret.1, i64* %bsp.306.0) - %bsp.308 = call i64* @update_b(i64 1, i64 2, i64* %bsp.307) - %bsp.309 = call i64* @updatepop_b01(i64* %bsp.308) - %bsp.310 = call i64* @addI(i64* %bsp.309) + %bsp.308 = call i64* @update_b(i64 1, i64 2, i64* %bsp.307) + %bsp.309 = call i64* @updatepop_b01(i64* %bsp.308) + %bsp.310 = call i64* @addI(i64* %bsp.309) - %r.3 = call i64 @peek_b(i64* %bsp.310) - %bsp.311 = call i64* @pop_b1(i64* %bsp.310) + %r.3 = call i64 @peek_b(i64* %bsp.310) + %bsp.311 = call i64* @pop_b1(i64* %bsp.310) - ret i64 %r.3 + ret i64 %r.3 } define i64 @main() { - %heap = bitcast [10000 x i64]* @heap to i64* - %astack = bitcast [10000 x i64*]* @astack to i64** + %heap = bitcast [10000 x i64]* @heap to i64* + %astack = bitcast [10000 x i64*]* @astack to i64** - %n.0 = getelementptr i64, i64* %heap - %INT.0 = ptrtoint {i64, i64, i64*, i64, i8, i8, i8}* @INT to i64 - %INT.1 = add i64 %INT.0, 2 - store i64 %INT.1, i64* %n.0 - %n.0.0 = getelementptr i64, i64* %n.0, i64 1 - store i64 43, i64* %n.0.0 + %n.0 = getelementptr i64, i64* %heap + %INT.0 = ptrtoint {i64, i64, i64*, i64, i8, i8, i8}* @INT to i64 + %INT.1 = add i64 %INT.0, 2 + store i64 %INT.1, i64* %n.0 + %n.0.0 = getelementptr i64, i64* %n.0, i64 1 + store i64 43, i64* %n.0.0 - %n.1 = getelementptr i64, i64* %n.0, i64 2 - store i64 ptrtoint (i64*(i64*,i64**)* @e_fib_eqI_b_nfib to i64), i64* %n.1 - %t.0 = ptrtoint i64* %n.0 to i64 - %n.1.0 = getelementptr i64, i64* %n.1, i64 1 - store i64 %t.0, i64* %n.1.0 + %n.1 = getelementptr i64, i64* %n.0, i64 2 + store i64 ptrtoint (i64*(i64*,i64**)* @e_fib_eqI_b_nfib to i64), i64* %n.1 + %t.0 = ptrtoint i64* %n.0 to i64 + %n.1.0 = getelementptr i64, i64* %n.1, i64 1 + store i64 %t.0, i64* %n.1.0 - %n.2 = call i64* @e_fib_eqI_b_nfib(i64* %n.1, i64** %astack) - %n.3 = getelementptr i64, i64* %n.2, i64 1 + %n.2 = call i64* @e_fib_eqI_b_nfib(i64* %n.1, i64** %astack) + %n.3 = getelementptr i64, i64* %n.2, i64 1 - %r = load i64, i64* %n.3 + %r = load i64, i64* %n.3 - call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @printf_d, i64 0, i64 0), i64 %r) - call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @printf_c, i64 0, i64 0), i64 10) + call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @printf_d, i64 0, i64 0), i64 %r) + call i64 (i8*, ...) @printf(i8* getelementptr inbounds ([3 x i8], [3 x i8]* @printf_c, i64 0, i64 0), i64 10) - ret i64 0 + ret i64 0 } |