[Beignet] [PATCH] GBE: Make fields in ImageInfoKey fully aligned

Zhigang Gong zhigang.gong at linux.intel.com
Sun Mar 9 19:24:52 PDT 2014


nice catch, will push latter, thanks.

On Fri, Mar 07, 2014 at 02:23:42PM +0800, Ruiling Song wrote:
> We meet an assert (compiler_copy_image1)under debug mode, and it turns out that
> ImageInfoKey.data contains garbage bits. But under release mode, seems that the
> memory was cleared to zero.
> 
> Signed-off-by: Ruiling Song <ruiling.song at intel.com>
> ---
>  backend/src/ir/image.hpp       |    2 +-
>  backend/src/ir/instruction.hpp |    2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/backend/src/ir/image.hpp b/backend/src/ir/image.hpp
> index cf388d4..62e15a6 100644
> --- a/backend/src/ir/image.hpp
> +++ b/backend/src/ir/image.hpp
> @@ -90,7 +90,7 @@ namespace ir {
>    private:
>      map<Register, struct ImageInfo *> regMap;
>      map<uint32_t, struct ImageInfo *> indexMap;
> -    map<uint32_t, Register> infoRegMap;
> +    map<uint16_t, Register> infoRegMap;
>      GBE_CLASS(ImageSet);
>    };
>  } /* namespace ir */
> diff --git a/backend/src/ir/instruction.hpp b/backend/src/ir/instruction.hpp
> index 457b5b4..82d2102 100644
> --- a/backend/src/ir/instruction.hpp
> +++ b/backend/src/ir/instruction.hpp
> @@ -377,7 +377,7 @@ namespace ir {
>       uint8_t index; /*! the allocated image index */
>       uint8_t  type;  /*! the information type */
>      };
> -    uint32_t data;
> +    uint16_t data;
>    } ImageInfoKey;
>  
>    /*! Get image information */
> -- 
> 1.7.9.5
> 
> _______________________________________________
> Beignet mailing list
> Beignet at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet


More information about the Beignet mailing list