From 9bd338fcc191fbc364f5cc1d4b2e1cbd645959a3 Mon Sep 17 00:00:00 2001 From: Ruiling Song Date: Mon, 26 May 2014 10:07:15 +0800 Subject: [PATCH] GBE: Make compatible with old gcc version. Signed-off-by: Ruiling Song Reviewed-by: "Yang, Rong R" --- backend/src/backend/gen75_context.hpp | 2 +- backend/src/backend/gen75_encoder.hpp | 2 +- backend/src/backend/gen_context.hpp | 2 +- backend/src/backend/gen_encoder.hpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/backend/src/backend/gen75_context.hpp b/backend/src/backend/gen75_context.hpp index 291e260..6f62b02 100644 --- a/backend/src/backend/gen75_context.hpp +++ b/backend/src/backend/gen75_context.hpp @@ -37,7 +37,7 @@ namespace gbe : GenContext(unit, name, deviceID, relaxMath) { }; /*! device's max srcatch buffer size */ - const int GEN75_SCRATCH_SIZE = 2 * KB * KB; + #define GEN75_SCRATCH_SIZE (2 * KB * KB) /*! Emit the per-lane stack pointer computation */ virtual void emitStackPointer(void); /*! Align the scratch size to the device's scratch unit size */ diff --git a/backend/src/backend/gen75_encoder.hpp b/backend/src/backend/gen75_encoder.hpp index 60dea7b..01520ed 100644 --- a/backend/src/backend/gen75_encoder.hpp +++ b/backend/src/backend/gen75_encoder.hpp @@ -32,7 +32,7 @@ namespace gbe { public: /*! exec width of the double data type */ - const int GEN75_DOUBLE_EXEC_WIDTH = 4; + #define GEN75_DOUBLE_EXEC_WIDTH 4 virtual ~Gen75Encoder(void) { } Gen75Encoder(uint32_t simdWidth, uint32_t gen, uint32_t deviceID) diff --git a/backend/src/backend/gen_context.hpp b/backend/src/backend/gen_context.hpp index 4a08ed7..02c83d0 100644 --- a/backend/src/backend/gen_context.hpp +++ b/backend/src/backend/gen_context.hpp @@ -65,7 +65,7 @@ namespace gbe /*! Release everything needed */ virtual ~GenContext(void); /*! device's max srcatch buffer size */ - const int GEN7_SCRATCH_SIZE = 12 * KB; + #define GEN7_SCRATCH_SIZE (12 * KB) /*! Start new code generation with specific parameters */ void startNewCG(uint32_t simdWidth, uint32_t reservedSpillRegs, bool limitRegisterPressure); /*! Target device ID*/ diff --git a/backend/src/backend/gen_encoder.hpp b/backend/src/backend/gen_encoder.hpp index e0bb4cc..bd4a8e7 100644 --- a/backend/src/backend/gen_encoder.hpp +++ b/backend/src/backend/gen_encoder.hpp @@ -71,7 +71,7 @@ namespace gbe /*! Size of the stack (should be large enough) */ enum { MAX_STATE_NUM = 16 }; /*! gen7 exec width of the double data type */ - const int GEN7_DOUBLE_EXEC_WIDTH = 8; + #define GEN7_DOUBLE_EXEC_WIDTH 8 /*! Push the current instruction state */ void push(void); /*! Pop the latest pushed state */ -- 2.7.4