mirror of
https://github.com/danog/ir.git
synced 2024-11-30 04:39:43 +01:00
118 lines
2.5 KiB
Plaintext
118 lines
2.5 KiB
Plaintext
--TEST--
|
|
Mandelbrot Test (-O0)
|
|
--ARGS--
|
|
-S -O0
|
|
--CODE--
|
|
{
|
|
uintptr_t c_1 = 0;
|
|
bool c_2 = 0;
|
|
bool c_3 = 1;
|
|
double c_4 = 0.5;
|
|
double c_5 = 0;
|
|
int32_t c_6 = 0;
|
|
int32_t c_7 = 1;
|
|
double c_8 = 16;
|
|
int32_t c_9 = 1000;
|
|
l_1 = START(l_35);
|
|
double d_2 = PARAM(l_1, "x", 0);
|
|
double d_3 = PARAM(l_1, "y", 1);
|
|
double d_4 = VAR(l_1, "cr");
|
|
double d_5 = SUB(d_3, c_4);
|
|
double d_6 = VAR(l_1, "ci");
|
|
double d_7 = VAR(l_1, "zi");
|
|
double d_8 = VAR(l_1, "zr");
|
|
int32_t d_9 = VAR(l_1, "i");
|
|
l_10 = END(l_1);
|
|
l_11 = LOOP_BEGIN(l_10, l_37);
|
|
double d_12 = PHI(l_11, c_5, d_25);
|
|
double d_13 = PHI(l_11, c_5, d_23);
|
|
int32_t d_14 = PHI(l_11, c_6, d_15);
|
|
int32_t d_15 = ADD(d_14, c_7);
|
|
double d_16 = VAR(l_11, "temp");
|
|
double d_17 = MUL(d_13, d_12);
|
|
double d_18 = VAR(l_11, "zr2");
|
|
double d_19 = MUL(d_13, d_13);
|
|
double d_20 = VAR(l_11, "zi2");
|
|
double d_21 = MUL(d_12, d_12);
|
|
double d_22 = SUB(d_19, d_21);
|
|
double d_23 = ADD(d_22, d_5);
|
|
double d_24 = ADD(d_17, d_17);
|
|
double d_25 = ADD(d_24, d_2);
|
|
double d_26 = ADD(d_21, d_19);
|
|
bool d_27 = GT(d_26, c_8);
|
|
l_28 = IF(l_11, d_27);
|
|
l_29 = IF_TRUE(l_28);
|
|
l_30 = RETURN(l_29, d_15);
|
|
l_31 = IF_FALSE(l_28);
|
|
bool d_32 = GT(d_15, c_9);
|
|
l_33 = IF(l_31, d_32);
|
|
l_34 = IF_TRUE(l_33);
|
|
l_35 = RETURN(l_34, c_6, l_30);
|
|
l_36 = IF_FALSE(l_33);
|
|
l_37 = LOOP_END(l_36, l_11);
|
|
}
|
|
--EXPECT--
|
|
test:
|
|
subq $0x78, %rsp
|
|
movsd %xmm0, (%rsp)
|
|
movsd %xmm1, 8(%rsp)
|
|
movsd 8(%rsp), %xmm7
|
|
subsd 0x10b(%rip), %xmm7
|
|
movsd %xmm7, 0x10(%rsp)
|
|
xorpd %xmm0, %xmm0
|
|
movsd %xmm0, 0x18(%rsp)
|
|
xorpd %xmm0, %xmm0
|
|
movsd %xmm0, 0x20(%rsp)
|
|
movl $0, 0x28(%rsp)
|
|
.L1:
|
|
movl 0x28(%rsp), %eax
|
|
addl $1, %eax
|
|
movl %eax, 0x30(%rsp)
|
|
movsd 0x20(%rsp), %xmm7
|
|
mulsd 0x18(%rsp), %xmm7
|
|
movsd %xmm7, 0x38(%rsp)
|
|
movsd 0x20(%rsp), %xmm7
|
|
mulsd %xmm7, %xmm7
|
|
movsd %xmm7, 0x40(%rsp)
|
|
movsd 0x18(%rsp), %xmm7
|
|
mulsd %xmm7, %xmm7
|
|
movsd %xmm7, 0x48(%rsp)
|
|
movsd 0x40(%rsp), %xmm7
|
|
subsd 0x48(%rsp), %xmm7
|
|
movsd %xmm7, 0x50(%rsp)
|
|
movsd 0x50(%rsp), %xmm7
|
|
addsd 0x10(%rsp), %xmm7
|
|
movsd %xmm7, 0x58(%rsp)
|
|
movsd 0x38(%rsp), %xmm7
|
|
addsd %xmm7, %xmm7
|
|
movsd %xmm7, 0x60(%rsp)
|
|
movsd 0x60(%rsp), %xmm7
|
|
addsd (%rsp), %xmm7
|
|
movsd %xmm7, 0x68(%rsp)
|
|
movsd 0x48(%rsp), %xmm7
|
|
addsd 0x40(%rsp), %xmm7
|
|
movsd %xmm7, 0x70(%rsp)
|
|
movsd 0x70(%rsp), %xmm7
|
|
ucomisd 0x4f(%rip), %xmm7
|
|
ja .L2
|
|
jmp .L3
|
|
.L2:
|
|
movl 0x30(%rsp), %eax
|
|
addq $0x78, %rsp
|
|
retq
|
|
.L3:
|
|
cmpl $0x3e8, 0x30(%rsp)
|
|
jl .L4
|
|
xorl %eax, %eax
|
|
addq $0x78, %rsp
|
|
retq
|
|
.L4:
|
|
movsd 0x68(%rsp), %xmm0
|
|
movsd %xmm0, 0x18(%rsp)
|
|
movsd 0x58(%rsp), %xmm0
|
|
movsd %xmm0, 0x20(%rsp)
|
|
movl 0x30(%rsp), %edx
|
|
movl %edx, 0x28(%rsp)
|
|
jmp .L1
|
|
|