From 0efe2f676972b0aeb7e8e7b756a367f36293b091 Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Wed, 25 Aug 2010 19:10:42 -0500 Subject: ARM: Fix type comparison warnings in Neon. --- src/arch/arm/isa/templates/neon.isa | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/arch/arm/isa/templates/neon.isa') diff --git a/src/arch/arm/isa/templates/neon.isa b/src/arch/arm/isa/templates/neon.isa index e402979dc..20c1d26b8 100644 --- a/src/arch/arm/isa/templates/neon.isa +++ b/src/arch/arm/isa/templates/neon.isa @@ -142,6 +142,32 @@ def template NeonExecDeclare {{ %(CPU_exec_context)s *, Trace::InstRecord *) const; }}; +output header {{ + template + // Implement a less-than-zero function: ltz() + // this function exists because some versions of GCC complain when a + // comparison is done between a unsigned variable and 0 and for GCC 4.2 + // there is no way to disable this warning + inline bool ltz(T t); + + template <> + inline bool ltz(uint8_t) { return false; } + template <> + inline bool ltz(uint16_t) { return false; } + template <> + inline bool ltz(uint32_t) { return false; } + template <> + inline bool ltz(uint64_t) { return false; } + template <> + inline bool ltz(int8_t v) { return v < 0; } + template <> + inline bool ltz(int16_t v) { return v < 0; } + template <> + inline bool ltz(int32_t v) { return v < 0; } + template <> + inline bool ltz(int64_t v) { return v < 0; } +}}; + def template NeonEqualRegExecute {{ template Fault %(class_name)s::execute(%(CPU_exec_context)s *xc, -- cgit v1.2.3