diff --git a/tests/naive/armv8m/_test.py b/tests/naive/armv8m/_test.py index a86b84d4..9d4e357f 100644 --- a/tests/naive/armv8m/_test.py +++ b/tests/naive/armv8m/_test.py @@ -130,6 +130,15 @@ def core(self, slothy): slothy.optimize() +class IfElse(OptimizationRunner): + def __init__(self): + super().__init__("ifelse", base_dir="tests") + + def core(self, slothy): + slothy.config.allow_useless_instructions = True + slothy.optimize(start="start", end="end") + + test_instances = [ Instructions(), Instructions(target=Target_CortexM85r1), @@ -141,4 +150,5 @@ def core(self, slothy): LoopLetp(), HintTest(), TagTest(), + IfElse(), ] diff --git a/tests/naive/armv8m/ifelse.s b/tests/naive/armv8m/ifelse.s new file mode 100644 index 00000000..0fafab63 --- /dev/null +++ b/tests/naive/armv8m/ifelse.s @@ -0,0 +1,12 @@ +.equ RCxy_44, 14 +.macro shift x, y +.if (RCxy_\x\()\y % 2) == 0 + vshr.u32 q, q, #32-(RCxy_\x\()\y/2) +.else + unimp +.endif +.endm + +start: +shift 4, 4 +end: \ No newline at end of file