xref: /aosp_15_r20/external/llvm/test/CodeGen/AArch64/nzcv-save.ll (revision 9880d6810fe72a1726cb53787c6711e909410d58)
1*9880d681SAndroid Build Coastguard Worker; RUN: llc -verify-machineinstrs -march=aarch64 < %s | FileCheck %s
2*9880d681SAndroid Build Coastguard Worker
3*9880d681SAndroid Build Coastguard Worker; CHECK: mrs [[NZCV_SAVE:x[0-9]+]], NZCV
4*9880d681SAndroid Build Coastguard Worker; CHECK: msr NZCV, [[NZCV_SAVE]]
5*9880d681SAndroid Build Coastguard Worker
6*9880d681SAndroid Build Coastguard Worker; DAG ends up with two uses for the flags from an ADCS node, which means they
7*9880d681SAndroid Build Coastguard Worker; must be saved for later.
8*9880d681SAndroid Build Coastguard Workerdefine void @f(i256* nocapture %a, i256* nocapture %b, i256* nocapture %cc, i256* nocapture %dd) nounwind uwtable noinline ssp {
9*9880d681SAndroid Build Coastguard Workerentry:
10*9880d681SAndroid Build Coastguard Worker  %c = load i256, i256* %cc
11*9880d681SAndroid Build Coastguard Worker  %d = load i256, i256* %dd
12*9880d681SAndroid Build Coastguard Worker  %add = add nsw i256 %c, %d
13*9880d681SAndroid Build Coastguard Worker  store i256 %add, i256* %a, align 8
14*9880d681SAndroid Build Coastguard Worker  %or = or i256 %c, 1606938044258990275541962092341162602522202993782792835301376
15*9880d681SAndroid Build Coastguard Worker  %add6 = add nsw i256 %or, %d
16*9880d681SAndroid Build Coastguard Worker  store i256 %add6, i256* %b, align 8
17*9880d681SAndroid Build Coastguard Worker  ret void
18*9880d681SAndroid Build Coastguard Worker}
19