GBE/IMM: Temporarily allow integer type in getFloatValue()

Submitted by Song, Ruiling on July 15, 2015, 8:46 a.m.

Details

Message ID 1436950001-23262-1-git-send-email-ruiling.song@intel.com
State New
Headers show

Not browsing as part of any series.

Commit Message

Song, Ruiling July 15, 2015, 8:46 a.m.
The second argument of simd_shuffle is integer, which is not the
same as the instruction type. but when we are dealing with
BinaryInstruction in instruction selection, we would call
getFloatValue() to do some imm optimization. We should
implement a separate pattern for simd shuffle. after that,
I will revert this patch.

Signed-off-by: Ruiling Song <ruiling.song@intel.com>
---
 backend/src/ir/immediate.hpp | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch hide | download patch | download mbox

diff --git a/backend/src/ir/immediate.hpp b/backend/src/ir/immediate.hpp
index a25895a..3141643 100644
--- a/backend/src/ir/immediate.hpp
+++ b/backend/src/ir/immediate.hpp
@@ -209,7 +209,7 @@  namespace ir {
 
     INLINE float getFloatValue(void) const {
       // we allow bitcast from u32/s32 immediate to float
-      GBE_ASSERT(type == IMM_TYPE_FLOAT);
+      GBE_ASSERT(type == IMM_TYPE_FLOAT || type == IMM_TYPE_U32 || type == IMM_TYPE_S32);
       return *data.f32;
     }
 

Comments

LGTM, will push it, thanks.

> -----Original Message-----

> From: Beignet [mailto:beignet-bounces@lists.freedesktop.org] On Behalf Of

> Ruiling Song

> Sent: Wednesday, July 15, 2015 16:47

> To: beignet@lists.freedesktop.org

> Cc: Song, Ruiling

> Subject: [Beignet] [PATCH] GBE/IMM: Temporarily allow integer type in

> getFloatValue()

> 

> The second argument of simd_shuffle is integer, which is not the same as the

> instruction type. but when we are dealing with BinaryInstruction in

> instruction selection, we would call

> getFloatValue() to do some imm optimization. We should implement a

> separate pattern for simd shuffle. after that, I will revert this patch.

> 

> Signed-off-by: Ruiling Song <ruiling.song@intel.com>

> ---

>  backend/src/ir/immediate.hpp | 2 +-

>  1 file changed, 1 insertion(+), 1 deletion(-)

> 

> diff --git a/backend/src/ir/immediate.hpp b/backend/src/ir/immediate.hpp

> index a25895a..3141643 100644

> --- a/backend/src/ir/immediate.hpp

> +++ b/backend/src/ir/immediate.hpp

> @@ -209,7 +209,7 @@ namespace ir {

> 

>      INLINE float getFloatValue(void) const {

>        // we allow bitcast from u32/s32 immediate to float

> -      GBE_ASSERT(type == IMM_TYPE_FLOAT);

> +      GBE_ASSERT(type == IMM_TYPE_FLOAT || type == IMM_TYPE_U32 ||

> type

> + == IMM_TYPE_S32);

>        return *data.f32;

>      }

> 

> --

> 2.3.1

> 

> _______________________________________________

> Beignet mailing list

> Beignet@lists.freedesktop.org

> http://lists.freedesktop.org/mailman/listinfo/beignet