utility.hh (8300:eb279d6e08a2) utility.hh (8303:5a95f1d2494e)
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 51 unchanged lines hidden (view full) ---

60buildRetPC(const PCState &curPC, const PCState &callPC)
61{
62 PCState retPC = callPC;
63 retPC.uEnd();
64 return retPC;
65}
66
67inline bool
1/*
2 * Copyright (c) 2010 ARM Limited
3 * All rights reserved
4 *
5 * The license below extends only to copyright in the software and shall
6 * not be construed as granting a license to any other intellectual
7 * property including but not limited to intellectual property relating
8 * to a hardware implementation of the functionality of the software

--- 51 unchanged lines hidden (view full) ---

60buildRetPC(const PCState &curPC, const PCState &callPC)
61{
62 PCState retPC = callPC;
63 retPC.uEnd();
64 return retPC;
65}
66
67inline bool
68testPredicate(CPSR cpsr, ConditionCode code)
68testPredicate(uint32_t nz, uint32_t c, uint32_t v, ConditionCode code)
69{
69{
70 bool n = (nz & 0x2);
71 bool z = (nz & 0x1);
72
70 switch (code)
71 {
73 switch (code)
74 {
72 case COND_EQ: return cpsr.z;
73 case COND_NE: return !cpsr.z;
74 case COND_CS: return cpsr.c;
75 case COND_CC: return !cpsr.c;
76 case COND_MI: return cpsr.n;
77 case COND_PL: return !cpsr.n;
78 case COND_VS: return cpsr.v;
79 case COND_VC: return !cpsr.v;
80 case COND_HI: return (cpsr.c && !cpsr.z);
81 case COND_LS: return !(cpsr.c && !cpsr.z);
82 case COND_GE: return !(cpsr.n ^ cpsr.v);
83 case COND_LT: return (cpsr.n ^ cpsr.v);
84 case COND_GT: return !(cpsr.n ^ cpsr.v || cpsr.z);
85 case COND_LE: return (cpsr.n ^ cpsr.v || cpsr.z);
75 case COND_EQ: return z;
76 case COND_NE: return !z;
77 case COND_CS: return c;
78 case COND_CC: return !c;
79 case COND_MI: return n;
80 case COND_PL: return !n;
81 case COND_VS: return v;
82 case COND_VC: return !v;
83 case COND_HI: return (c && !z);
84 case COND_LS: return !(c && !z);
85 case COND_GE: return !(n ^ v);
86 case COND_LT: return (n ^ v);
87 case COND_GT: return !(n ^ v || z);
88 case COND_LE: return (n ^ v || z);
86 case COND_AL: return true;
87 case COND_UC: return true;
88 default:
89 panic("Unhandled predicate condition: %d\n", code);
90 }
91}
92
93/**

--- 91 unchanged lines hidden ---
89 case COND_AL: return true;
90 case COND_UC: return true;
91 default:
92 panic("Unhandled predicate condition: %d\n", code);
93 }
94}
95
96/**

--- 91 unchanged lines hidden ---