2026-08-20 14:31:15 +02:00
|
|
|
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|
|
|
|
// SPDX-License-Identifier: BSD-3-Clause
|
|
|
|
|
|
|
|
|
|
#include "textflag.h"
|
|
|
|
|
|
|
|
|
|
// branch exercises all conditional branch forms and jump chain folding.
|
|
|
|
|
TEXT ·branch(SB), NOSPLIT, $0-0
|
2026-09-17 20:33:18 +02:00
|
|
|
BEQ done
|
|
|
|
|
BNE skip
|
|
|
|
|
BGE done
|
|
|
|
|
BLT done
|
|
|
|
|
BGT done
|
|
|
|
|
BLE done
|
|
|
|
|
BCS done
|
|
|
|
|
BCC done
|
|
|
|
|
BMI done
|
|
|
|
|
BPL done
|
|
|
|
|
BVS done
|
|
|
|
|
BVC done
|
|
|
|
|
BHI done
|
|
|
|
|
BLS done
|
|
|
|
|
|
2026-08-20 14:31:15 +02:00
|
|
|
skip:
|
2026-09-17 20:33:18 +02:00
|
|
|
B loop
|
|
|
|
|
|
2026-08-20 14:31:15 +02:00
|
|
|
loop:
|
2026-09-17 20:33:18 +02:00
|
|
|
ADD R4, R5
|
|
|
|
|
|
2026-08-20 14:31:15 +02:00
|
|
|
done:
|
|
|
|
|
RET
|