~jderose/ubuntu/raring/qemu/vde-again

« back to all changes in this revision

Viewing changes to target-arm/op_addsub.h

  • Committer: Bazaar Package Importer
  • Author(s): Aurelien Jarno, Aurelien Jarno
  • Date: 2009-03-07 06:20:34 UTC
  • mfrom: (1.1.9 upstream)
  • mto: This revision was merged to the branch mainline in revision 7.
  • Revision ID: james.westby@ubuntu.com-20090307062034-i3pead4mw653v2el
Tags: 0.10.0-1
[ Aurelien Jarno ]
* New upstream release:
  - Fix fr-be keyboard mapping (closes: bug#514462).
  - Fix stat64 structure on ppc-linux-user (closes: bug#470231).
  - Add a chroot option (closes: bug#415996).
  - Add evdev support (closes: bug#513210).
  - Fix loop on symlinks in user mode (closes: bug#297572).
  - Bump depends on openbios-sparc.
  - Depends on openbios-ppc.
  - Update 12_signal_powerpc_support.patch.
  - Update 21_net_soopts.patch.
  - Drop 44_socklen_t_check.patch (merged upstream).
  - Drop 49_null_check.patch (merged upstream).
  - Update 64_ppc_asm_constraints.patch.
  - Drop security/CVE-2008-0928-fedora.patch (merged upstream).
  - Drop security/CVE-2007-5730.patch (merged upstream).
* patches/80_stable-branch.patch: add patches from stable branch:
  - Fix race condition between signal handler/execution loop (closes:
    bug#474386, bug#501731).
* debian/copyright: update.
* Compile and install .dtb files:
  - debian/control: build-depends on device-tree-compiler.
  - debian/patches/81_compile_dtb.patch: new patch from upstream.
  - debian/rules: compile and install bamboo.dtb and mpc8544.dtb.

Show diffs side-by-side

added added

removed removed

Lines of Context:
8
8
 */
9
9
 
10
10
#ifdef ARITH_GE
 
11
#define GE_ARG , void *gep
11
12
#define DECLARE_GE uint32_t ge = 0
12
 
#define SET_GE env->GE = ge
 
13
#define SET_GE *(uint32_t *)gep = ge
13
14
#else
 
15
#define GE_ARG
14
16
#define DECLARE_GE do{}while(0)
15
17
#define SET_GE do{}while(0)
16
18
#endif
18
20
#define RESULT(val, n, width) \
19
21
    res |= ((uint32_t)(glue(glue(uint,width),_t))(val)) << (n * width)
20
22
 
21
 
void OPPROTO glue(glue(op_,PFX),add16_T0_T1)(void)
22
 
{
23
 
    uint32_t res = 0;
24
 
    DECLARE_GE;
25
 
 
26
 
    ADD16(T0, T1, 0);
27
 
    ADD16(T0 >> 16, T1 >> 16, 1);
28
 
    SET_GE;
29
 
    T0 = res;
30
 
    FORCE_RET();
31
 
}
32
 
 
33
 
void OPPROTO glue(glue(op_,PFX),add8_T0_T1)(void)
34
 
{
35
 
    uint32_t res = 0;
36
 
    DECLARE_GE;
37
 
 
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();
45
 
}
46
 
 
47
 
void OPPROTO glue(glue(op_,PFX),sub16_T0_T1)(void)
48
 
{
49
 
    uint32_t res = 0;
50
 
    DECLARE_GE;
51
 
 
52
 
    SUB16(T0, T1, 0);
53
 
    SUB16(T0 >> 16, T1 >> 16, 1);
54
 
    SET_GE;
55
 
    T0 = res;
56
 
    FORCE_RET();
57
 
}
58
 
 
59
 
void OPPROTO glue(glue(op_,PFX),sub8_T0_T1)(void)
60
 
{
61
 
    uint32_t res = 0;
62
 
    DECLARE_GE;
63
 
 
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();
71
 
}
72
 
 
73
 
void OPPROTO glue(glue(op_,PFX),subaddx_T0_T1)(void)
74
 
{
75
 
    uint32_t res = 0;
76
 
    DECLARE_GE;
77
 
 
78
 
    ADD16(T0, T1, 0);
79
 
    SUB16(T0 >> 16, T1 >> 16, 1);
80
 
    SET_GE;
81
 
    T0 = res;
82
 
    FORCE_RET();
83
 
}
84
 
 
85
 
void OPPROTO glue(glue(op_,PFX),addsubx_T0_T1)(void)
86
 
{
87
 
    uint32_t res = 0;
88
 
    DECLARE_GE;
89
 
 
90
 
    SUB16(T0, T1, 0);
91
 
    ADD16(T0 >> 16, T1 >> 16, 1);
92
 
    SET_GE;
93
 
    T0 = res;
94
 
    FORCE_RET();
95
 
}
96
 
 
 
23
uint32_t HELPER(glue(PFX,add16))(uint32_t a, uint32_t b GE_ARG)
 
24
{
 
25
    uint32_t res = 0;
 
26
    DECLARE_GE;
 
27
 
 
28
    ADD16(a, b, 0);
 
29
    ADD16(a >> 16, b >> 16, 1);
 
30
    SET_GE;
 
31
    return res;
 
32
}
 
33
 
 
34
uint32_t HELPER(glue(PFX,add8))(uint32_t a, uint32_t b GE_ARG)
 
35
{
 
36
    uint32_t res = 0;
 
37
    DECLARE_GE;
 
38
 
 
39
    ADD8(a, b, 0);
 
40
    ADD8(a >> 8, b >> 8, 1);
 
41
    ADD8(a >> 16, b >> 16, 2);
 
42
    ADD8(a >> 24, b >> 24, 3);
 
43
    SET_GE;
 
44
    return res;
 
45
}
 
46
 
 
47
uint32_t HELPER(glue(PFX,sub16))(uint32_t a, uint32_t b GE_ARG)
 
48
{
 
49
    uint32_t res = 0;
 
50
    DECLARE_GE;
 
51
 
 
52
    SUB16(a, b, 0);
 
53
    SUB16(a >> 16, b >> 16, 1);
 
54
    SET_GE;
 
55
    return res;
 
56
}
 
57
 
 
58
uint32_t HELPER(glue(PFX,sub8))(uint32_t a, uint32_t b GE_ARG)
 
59
{
 
60
    uint32_t res = 0;
 
61
    DECLARE_GE;
 
62
 
 
63
    SUB8(a, b, 0);
 
64
    SUB8(a >> 8, b >> 8, 1);
 
65
    SUB8(a >> 16, b >> 16, 2);
 
66
    SUB8(a >> 24, b >> 24, 3);
 
67
    SET_GE;
 
68
    return res;
 
69
}
 
70
 
 
71
uint32_t HELPER(glue(PFX,subaddx))(uint32_t a, uint32_t b GE_ARG)
 
72
{
 
73
    uint32_t res = 0;
 
74
    DECLARE_GE;
 
75
 
 
76
    ADD16(a, b, 0);
 
77
    SUB16(a >> 16, b >> 16, 1);
 
78
    SET_GE;
 
79
    return res;
 
80
}
 
81
 
 
82
uint32_t HELPER(glue(PFX,addsubx))(uint32_t a, uint32_t b GE_ARG)
 
83
{
 
84
    uint32_t res = 0;
 
85
    DECLARE_GE;
 
86
 
 
87
    SUB16(a, b, 0);
 
88
    ADD16(a >> 16, b >> 16, 1);
 
89
    SET_GE;
 
90
    return res;
 
91
}
 
92
 
 
93
#undef GE_ARG
97
94
#undef DECLARE_GE
98
95
#undef SET_GE
99
96
#undef RESULT