Device hot-remove
[qemu-kvm/fedora.git] / target-arm / op_addsub.h
blobd15360d8072543d613a2f61c87ce53138f5743f0
1 /*
2 * ARMv6 integer SIMD operations.
4 * Copyright (c) 2007 CodeSourcery.
5 * Written by Paul Brook
7 * This code is licenced under the GPL.
8 */
10 #ifdef ARITH_GE
11 #define DECLARE_GE uint32_t ge = 0
12 #define SET_GE env->GE = ge
13 #else
14 #define DECLARE_GE do{}while(0)
15 #define SET_GE do{}while(0)
16 #endif
18 #define RESULT(val, n, width) \
19 res |= ((uint32_t)(glue(glue(uint,width),_t))(val)) << (n * width)
21 void OPPROTO glue(glue(op_,PFX),add16_T0_T1)(void)
23 uint32_t res = 0;
24 DECLARE_GE;
26 ADD16(T0, T1, 0);
27 ADD16(T0 >> 16, T1 >> 16, 1);
28 SET_GE;
29 T0 = res;
30 FORCE_RET();
33 void OPPROTO glue(glue(op_,PFX),add8_T0_T1)(void)
35 uint32_t res = 0;
36 DECLARE_GE;
38 ADD8(T0, T1, 0);
39 ADD8(T0 >> 8, T1 >> 8, 1);
40 ADD8(T0 >> 16, T1 >> 16, 2);
41 ADD8(T0 >> 24, T1 >> 24, 3);
42 SET_GE;
43 T0 = res;
44 FORCE_RET();
47 void OPPROTO glue(glue(op_,PFX),sub16_T0_T1)(void)
49 uint32_t res = 0;
50 DECLARE_GE;
52 SUB16(T0, T1, 0);
53 SUB16(T0 >> 16, T1 >> 16, 1);
54 SET_GE;
55 T0 = res;
56 FORCE_RET();
59 void OPPROTO glue(glue(op_,PFX),sub8_T0_T1)(void)
61 uint32_t res = 0;
62 DECLARE_GE;
64 SUB8(T0, T1, 0);
65 SUB8(T0 >> 8, T1 >> 8, 1);
66 SUB8(T0 >> 16, T1 >> 16, 2);
67 SUB8(T0 >> 24, T1 >> 24, 3);
68 SET_GE;
69 T0 = res;
70 FORCE_RET();
73 void OPPROTO glue(glue(op_,PFX),subaddx_T0_T1)(void)
75 uint32_t res = 0;
76 DECLARE_GE;
78 ADD16(T0, T1, 0);
79 SUB16(T0 >> 16, T1 >> 16, 1);
80 SET_GE;
81 T0 = res;
82 FORCE_RET();
85 void OPPROTO glue(glue(op_,PFX),addsubx_T0_T1)(void)
87 uint32_t res = 0;
88 DECLARE_GE;
90 SUB16(T0, T1, 0);
91 ADD16(T0 >> 16, T1 >> 16, 1);
92 SET_GE;
93 T0 = res;
94 FORCE_RET();
97 #undef DECLARE_GE
98 #undef SET_GE
99 #undef RESULT
101 #undef ARITH_GE
102 #undef PFX
103 #undef ADD16
104 #undef SUB16
105 #undef ADD8
106 #undef SUB8