[AMDGPU] Add commute for some VOP3 inst (#121326)
[llvm-project.git] / compiler-rt / test / builtins / Unit / arm / call_apsr.h
blob09de115d4edac4e1987f6d4363601072f7b4d6f7
1 #ifndef CALL_APSR_H
2 #define CALL_APSR_H
4 #if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
6 union cpsr {
7 struct {
8 uint32_t filler : 28;
9 uint32_t v : 1;
10 uint32_t c : 1;
11 uint32_t z : 1;
12 uint32_t n : 1;
13 } flags;
14 uint32_t value;
17 #else
19 union cpsr {
20 struct {
21 uint32_t n : 1;
22 uint32_t z : 1;
23 uint32_t c : 1;
24 uint32_t v : 1;
25 uint32_t filler : 28;
26 } flags;
27 uint32_t value;
30 #endif
32 __attribute__((noinline, pcs("aapcs"))) static uint32_t call_apsr_f(float a, float b,
33 __attribute__((pcs("aapcs"))) void (*fn)(float, float)) {
34 uint32_t result;
35 fn(a, b);
36 asm volatile("mrs %0, apsr"
37 : "=r"(result));
38 return result;
41 __attribute__((noinline, pcs("aapcs"))) static uint32_t call_apsr_d(double a, double b,
42 __attribute__((pcs("aapcs"))) void (*fn)(double, double)) {
43 uint32_t result;
44 fn(a, b);
45 asm volatile("mrs %0, apsr"
46 : "=r"(result));
47 return result;
50 #endif // CALL_APSR_H