mirror of
https://github.com/danog/ir.git
synced 2024-12-02 09:38:29 +01:00
206 lines
5.2 KiB
Plaintext
206 lines
5.2 KiB
Plaintext
--TEST--
|
|
Test
|
|
--TARGET--
|
|
aarch64
|
|
--ARGS--
|
|
--debug-regset 0x3ffffffff --save --dump-live-ranges -S
|
|
--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--
|
|
{
|
|
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_30);
|
|
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_36);
|
|
double d_13 = PHI(l_11, c_5, d_34);
|
|
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 = VAR(l_11, "zr2");
|
|
double d_18 = MUL(d_13, d_13);
|
|
double d_19 = VAR(l_11, "zi2");
|
|
double d_20 = MUL(d_12, d_12);
|
|
double d_21 = ADD(d_20, d_18);
|
|
bool d_22 = GT(d_21, c_8);
|
|
l_23 = IF(l_11, d_22);
|
|
l_24 = IF_TRUE(l_23);
|
|
l_25 = RETURN(l_24, d_15);
|
|
l_26 = IF_FALSE(l_23);
|
|
bool d_27 = GT(d_15, c_9);
|
|
l_28 = IF(l_26, d_27);
|
|
l_29 = IF_TRUE(l_28);
|
|
l_30 = RETURN(l_29, c_6, l_25);
|
|
l_31 = IF_FALSE(l_28);
|
|
double d_32 = MUL(d_13, d_12);
|
|
double d_33 = SUB(d_18, d_20);
|
|
double d_34 = ADD(d_33, d_5);
|
|
double d_35 = ADD(d_32, d_32);
|
|
double d_36 = ADD(d_35, d_2);
|
|
l_37 = LOOP_END(l_31, l_11);
|
|
}
|
|
{ # LIVE-RANGES (vregs_count=12)
|
|
TMP
|
|
[%d0]: [5.0-5.2)
|
|
[%d1]: [10.2-10.3)
|
|
[%w0]: [10.2-10.3)
|
|
[%d1]: [22.0-22.2)
|
|
R1 (d_2) [SPILL=0x0]
|
|
[%d0]: [2.3-5.0), DEF(2.3, hint=%d0)
|
|
: [5.0-24.0), [26.0-29.0), [31.0-36.0)
|
|
[%d1]: [36.0-38.0), USE(36.1/2)!
|
|
R2 (d_3) [%d1]: [3.3-5.1), DEF(3.3, hint=%d1), USE(5.1/1)!
|
|
R3 (d_5) [SPILL=0x8]
|
|
[%d0]: [5.2-10.2), DEF(5.2)!
|
|
: [10.2-24.0), [26.0-29.0), [31.0-34.0)
|
|
[%d1]: [34.0-34.1), USE(34.1/2)!
|
|
: [34.1-38.0)
|
|
R4 (d_12, d_36) [SPILL=0x10]
|
|
[%d0]: [11.0-20.2), DEF(12.2), USE(20.1/1)!, USE(20.1/2)!
|
|
: [20.2-24.0), [26.0-29.0), [31.0-32.0)
|
|
[%d0]: [32.0-32.1), [36.2-38.0), USE(32.1/2)!, DEF(36.2)!, PHI_USE(37.2, phi=d_12/3)
|
|
R5 (d_13, d_34) [SPILL=0x18]
|
|
[%d1]: [11.0-18.2), DEF(13.2), USE(18.1/1)!, USE(18.1/2)!
|
|
: [18.2-24.0), [26.0-29.0), [31.0-32.0)
|
|
[%d1]: [32.0-32.1), [34.2-36.0), USE(32.1/1)!, DEF(34.2)!
|
|
: [36.0-37.1)
|
|
: [37.1-38.0), PHI_USE(37.2, phi=d_13/3)
|
|
R6 (d_14, d_15) [%w0]: [11.0-15.1), [15.2-25.0), [26.0-29.0), [31.0-38.0), DEF(14.2), USE(15.1/1)!, DEF(15.2)!, USE(25.0/2, hint=%w0), USE(27.1/1)!, PHI_USE(37.2, phi=d_14/3)
|
|
R7 (d_18) [SPILL=0x20]
|
|
[%d1]: [18.2-22.0), DEF(18.2)!, USE(21.1/2)!
|
|
: [22.0-24.0), [26.0-29.0), [31.0-33.0)
|
|
[%d0]: [33.0-33.1), USE(33.1/1)!
|
|
R8 (d_20) [SPILL=0x28]
|
|
[%d0]: [20.2-21.2), DEF(20.2)!, USE(21.1/1)!
|
|
: [21.2-24.0), [26.0-29.0), [31.0-33.0)
|
|
[%d1]: [33.0-33.1), USE(33.1/2)!
|
|
R9 (d_21) [%d0]: [21.2-22.1), DEF(21.2)!, USE(22.1/1)!
|
|
R10 (d_32) [SPILL=0x30]
|
|
[%d0]: [32.2-33.0), DEF(32.2)!
|
|
: [33.0-35.0)
|
|
[%d0]: [35.0-35.1), USE(35.1/1)!, USE(35.1/2)!
|
|
R11 (d_33) [%d0]: [33.2-34.1), DEF(33.2)!, USE(34.1/1)!
|
|
R12 (d_35) [%d0]: [35.2-36.1), DEF(35.2)!, USE(36.1/1)!
|
|
[%x0] : [25.0-25.1), [30.0-30.1)
|
|
[%d0] : [1.0-2.3)
|
|
[%d1] : [1.0-3.3)
|
|
}
|
|
test:
|
|
sub sp, sp, #0x38
|
|
str d0, [sp]
|
|
ldr d0, .L4
|
|
fsub d0, d1, d0
|
|
str d0, [sp, #8]
|
|
fmov d0, xzr
|
|
str d0, [sp, #0x10]
|
|
fmov d1, xzr
|
|
str d1, [sp, #0x18]
|
|
mov w0, wzr
|
|
.L1:
|
|
add w0, w0, #1
|
|
ldr d1, [sp, #0x18]
|
|
fmul d1, d1, d1
|
|
str d1, [sp, #0x20]
|
|
ldr d0, [sp, #0x10]
|
|
fmul d0, d0, d0
|
|
str d0, [sp, #0x28]
|
|
ldr d0, [sp, #0x28]
|
|
ldr d1, [sp, #0x20]
|
|
fadd d0, d0, d1
|
|
ldr d1, .L5
|
|
fcmp d0, d1
|
|
b.gt .L2
|
|
cmp w0, #0x3e8
|
|
b.gt .L3
|
|
ldr d1, [sp, #0x18]
|
|
ldr d0, [sp, #0x10]
|
|
fmul d0, d1, d0
|
|
str d0, [sp, #0x30]
|
|
ldr d0, [sp, #0x20]
|
|
ldr d1, [sp, #0x28]
|
|
fsub d0, d0, d1
|
|
ldr d1, [sp, #8]
|
|
fadd d1, d0, d1
|
|
str d1, [sp, #0x18]
|
|
ldr d0, [sp, #0x30]
|
|
fadd d0, d0, d0
|
|
ldr d1, [sp]
|
|
fadd d0, d0, d1
|
|
str d0, [sp, #0x10]
|
|
b .L1
|
|
.L2:
|
|
add sp, sp, #0x38
|
|
ret
|
|
.L3:
|
|
mov w0, wzr
|
|
add sp, sp, #0x38
|
|
ret
|
|
.rodata
|
|
.L4:
|
|
.db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xe0, 0x3f
|
|
.L5:
|
|
.db 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x30, 0x40
|