public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Sa Liu <SALIU@de.ibm.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH, spu] fix wrong parameter type in spu intrinsics
Date: Tue, 05 Feb 2008 14:07:00 -0000	[thread overview]
Message-ID: <OFCF162CDE.2CB1579E-ONC12573E6.004A5C55-C12573E6.004DBBB3@de.ibm.com> (raw)

The spu intrinsics spu_convtf, spu_convts and spu_convtu have parameter 
scale of type unsigned int (7-bit literal). Values outside  the range of 
[0, 127] should be flagged as an error and compilation is terminated. 
Currently the compiler doesn't output the error message, but terminates 
with an internal compiler error. This has been fixed by specifying proper 
argument type in the built-in defination.

Ok for mainline?

Index: gcc/gcc/config/spu/spu-builtins.def
===================================================================
--- gcc.orig/gcc/config/spu/spu-builtins.def
+++ gcc/gcc/config/spu/spu-builtins.def
@@ -235,8 +235,8 @@ DEF_BUILTIN (SI_FROM_PTR,    CODE_FOR_sp
 
 /* definitions to support generic builtin functions: */
 
-DEF_BUILTIN (SPU_CONVTS,     CODE_FOR_spu_cflts,      "spu_convts", 
B_INSN,     _A3(SPU_BTI_V4SI,     SPU_BTI_V4SF,   SPU_BTI_INTSI))
-DEF_BUILTIN (SPU_CONVTU,     CODE_FOR_spu_cfltu,      "spu_convtu", 
B_INSN,     _A3(SPU_BTI_UV4SI,    SPU_BTI_V4SF,   SPU_BTI_INTSI))
+DEF_BUILTIN (SPU_CONVTS,     CODE_FOR_spu_cflts,      "spu_convts", 
B_INSN,     _A3(SPU_BTI_V4SI,     SPU_BTI_V4SF,   SPU_BTI_U7))
+DEF_BUILTIN (SPU_CONVTU,     CODE_FOR_spu_cfltu,      "spu_convtu", 
B_INSN,     _A3(SPU_BTI_UV4SI,    SPU_BTI_V4SF,   SPU_BTI_U7))
 DEF_BUILTIN (SPU_ROUNDTF,    CODE_FOR_spu_frds,       "spu_roundtf", 
B_INSN,     _A2(SPU_BTI_V4SF,     SPU_BTI_V2DF))
 DEF_BUILTIN (SPU_MULH,       CODE_FOR_spu_mpyh,       "spu_mulh", B_INSN, 
    _A3(SPU_BTI_V4SI,     SPU_BTI_V8HI,   SPU_BTI_V8HI))
 DEF_BUILTIN (SPU_MULSR,      CODE_FOR_spu_mpys,       "spu_mulsr", 
B_INSN,     _A3(SPU_BTI_V4SI,     SPU_BTI_V8HI,   SPU_BTI_V8HI))
@@ -257,8 +257,8 @@ DEF_BUILTIN (SPU_TESTSV,     CODE_FOR_df
 /* definitions to support overloaded generic builtin functions:  */
 
 DEF_BUILTIN (SPU_CONVTF,           CODE_FOR_nothing,       "spu_convtf",  
        B_OVERLOAD, _A1(SPU_BTI_VOID))
-DEF_BUILTIN (SPU_CONVTF_0,         CODE_FOR_spu_cuflt, "spu_convtf_0",   
B_INTERNAL, _A3(SPU_BTI_V4SF,   SPU_BTI_UV4SI,  SPU_BTI_UINTSI))
-DEF_BUILTIN (SPU_CONVTF_1,         CODE_FOR_spu_csflt, "spu_convtf_1",   
B_INTERNAL, _A3(SPU_BTI_V4SF,   SPU_BTI_V4SI,   SPU_BTI_UINTSI))
+DEF_BUILTIN (SPU_CONVTF_0,         CODE_FOR_spu_cuflt, "spu_convtf_0",   
B_INTERNAL, _A3(SPU_BTI_V4SF,   SPU_BTI_UV4SI,  SPU_BTI_U7))
+DEF_BUILTIN (SPU_CONVTF_1,         CODE_FOR_spu_csflt, "spu_convtf_1",   
B_INTERNAL, _A3(SPU_BTI_V4SF,   SPU_BTI_V4SI,   SPU_BTI_U7))
 DEF_BUILTIN (SPU_EXTEND,           CODE_FOR_nothing,       "spu_extend",  
        B_OVERLOAD, _A1(SPU_BTI_VOID))
 DEF_BUILTIN (SPU_EXTEND_0,         CODE_FOR_spu_xsbh, "spu_extend_0",  
B_INTERNAL, _A2(SPU_BTI_V8HI,   SPU_BTI_V16QI))
 DEF_BUILTIN (SPU_EXTEND_1,         CODE_FOR_spu_xshw, "spu_extend_1",  
B_INTERNAL, _A2(SPU_BTI_V4SI,   SPU_BTI_V8HI))

Thanks!
Sa

             reply	other threads:[~2008-02-05 14:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-02-05 14:07 Sa Liu [this message]
2008-02-08  3:04 ` Andrew Pinski
2008-02-08 14:58   ` Sa Liu

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=OFCF162CDE.2CB1579E-ONC12573E6.004A5C55-C12573E6.004DBBB3@de.ibm.com \
    --to=saliu@de.ibm.com \
    --cc=gcc-patches@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).