summaryrefslogtreecommitdiff
path: root/src/arch/arm/isa
diff options
context:
space:
mode:
authorAndreas Hansson <andreas.hansson@arm.com>2012-03-19 06:36:09 -0400
committerAndreas Hansson <andreas.hansson@arm.com>2012-03-19 06:36:09 -0400
commit72538294fb1eb2e4dcd5d818c78bcdf78b0de491 (patch)
treeba95d431b41d54c7c25a3b5e84dfca9707a9feb2 /src/arch/arm/isa
parentadb862103138caf11191da50d34eb4c93295633a (diff)
downloadgem5-72538294fb1eb2e4dcd5d818c78bcdf78b0de491.tar.xz
gcc: Clean-up of non-C++0x compliant code, first steps
This patch cleans up a number of minor issues aiming to get closer to compliance with the C++0x standard as interpreted by gcc and clang (compile with std=c++0x and -pedantic-errors). In particular, the patch cleans up enums where the last item was succeded by a comma, namespaces closed by a curcly brace followed by a semi-colon, and the use of the GNU-extension typeof (replaced by templated functions). It does not address variable-length arrays, zero-size arrays, anonymous structs, range expressions in switch statements, and the use of long long. The generated CPU code also has a large number of issues that remain to be fixed, mainly related to overflows in implicit constant conversion (due to shifts).
Diffstat (limited to 'src/arch/arm/isa')
-rw-r--r--src/arch/arm/isa/templates/neon.isa18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/arch/arm/isa/templates/neon.isa b/src/arch/arm/isa/templates/neon.isa
index fe3a026b8..573d245b8 100644
--- a/src/arch/arm/isa/templates/neon.isa
+++ b/src/arch/arm/isa/templates/neon.isa
@@ -234,12 +234,16 @@ def template NeonEqualRegExecute {{
}};
output header {{
- uint16_t nextBiggerType(uint8_t);
- uint32_t nextBiggerType(uint16_t);
- uint64_t nextBiggerType(uint32_t);
- int16_t nextBiggerType(int8_t);
- int32_t nextBiggerType(int16_t);
- int64_t nextBiggerType(int32_t);
+ template <typename T>
+ struct bigger_type_t;
+
+ template<> struct bigger_type_t<uint8_t> { typedef uint16_t type; };
+ template<> struct bigger_type_t<uint16_t> { typedef uint32_t type; };
+ template<> struct bigger_type_t<uint32_t> { typedef uint64_t type; };
+
+ template<> struct bigger_type_t<int8_t> { typedef int16_t type; };
+ template<> struct bigger_type_t<int16_t> { typedef int32_t type; };
+ template<> struct bigger_type_t<int32_t> { typedef int64_t type; };
}};
def template NeonUnequalRegExecute {{
@@ -247,7 +251,7 @@ def template NeonUnequalRegExecute {{
Fault %(class_name)s<Element>::execute(%(CPU_exec_context)s *xc,
Trace::InstRecord *traceData) const
{
- typedef typeof(nextBiggerType((Element)0)) BigElement;
+ typedef typename bigger_type_t<Element>::type BigElement;
Fault fault = NoFault;
%(op_decl)s;
%(op_rd)s;