After this fix, we can run the luxmark with medium scene correctly.

> -----Original Message-----
> From: [email protected]
> [mailto:[email protected]] On Behalf Of Zhigang Gong
> Sent: Wednesday, February 19, 2014 4:41 PM
> To: [email protected]
> Cc: Zhigang Gong
> Subject: [Beignet] [PATCH] GBE: fix the overflow bug in register spilling.
> 
> Change to use int32 to represent the maxID.
> 
> Signed-off-by: Zhigang Gong <[email protected]>
> ---
>  backend/src/backend/gen_reg_allocation.cpp |   11 ++++-------
>  1 file changed, 4 insertions(+), 7 deletions(-)
> 
> diff --git a/backend/src/backend/gen_reg_allocation.cpp
> b/backend/src/backend/gen_reg_allocation.cpp
> index 726b78c..8243f19 100644
> --- a/backend/src/backend/gen_reg_allocation.cpp
> +++ b/backend/src/backend/gen_reg_allocation.cpp
> @@ -53,19 +53,16 @@ namespace gbe
>    };
> 
>    typedef struct GenRegIntervalKey {
> -    GenRegIntervalKey(uint16_t reg, uint16_t maxID) {
> -      if (maxID == INT_MAX)
> -        maxID = 0xFFFF;
> -      GBE_ASSERT(reg <= 0xFFFF && maxID <= 0xFFFF);
> -      key = (maxID << 16) | reg;
> +    GenRegIntervalKey(uint16_t reg, int32_t maxID) {
> +      key = ((uint64_t)maxID << 16) | reg;
>      }
>      const ir::Register getReg() const {
>        return (ir::Register)(key & 0xFFFF);
>      }
> -    const uint16_t getMaxID() const {
> +    const int32_t getMaxID() const {
>        return key >> 16;
>      }
> -    uint32_t key;
> +    uint64_t key;
>    } GenRegIntervalKey;
> 
>    struct spillCmp {
> --
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> [email protected]
> http://lists.freedesktop.org/mailman/listinfo/beignet

_______________________________________________
Beignet mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/beignet

Reply via email to