diff options
author | Trevor Smigiel <trevor_smigiel@playstation.sony.com> | 2008-11-19 03:18:53 +0000 |
---|---|---|
committer | Trevor Smigiel <trevor_smigiel@playstation.sony.com> | 2008-11-19 03:18:53 +0000 |
commit | 472b8186f82999ec1a5555e37fed1860e4e786da (patch) | |
tree | c2158a28faa9dc93f4ef93f2d6b1d5fbdc878f0e | |
parent | f1fd0e5ee80b25c88259bc56be5ee8e0a7dca9e0 (diff) |
Consider this check-in part of r141975. Fixes error on out of range literals.
git-svn-id: https://gcc.gnu.org/svn/gcc/branches/cell-4_3-branch@141989 138bc75d-0d04-0410-961f-82ee72b054a4
-rw-r--r-- | gcc/config/spu/spu-builtins.md | 30 |
1 files changed, 28 insertions, 2 deletions
diff --git a/gcc/config/spu/spu-builtins.md b/gcc/config/spu/spu-builtins.md index 054d2c6f32e..5b71d3aabad 100644 --- a/gcc/config/spu/spu-builtins.md +++ b/gcc/config/spu/spu-builtins.md @@ -525,6 +525,12 @@ (match_operand:SI 2 "spu_nonmem_operand")] 0 ))] "" { + if (GET_CODE (operands[2]) == CONST_INT + && (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) > 127)) + { + error ("spu_convtf expects an integer literal in the range [0, 127]."); + operands[2] = force_reg (SImode, operands[2]); + } if (GET_CODE (operands[2]) != CONST_INT) { rtx exp2; @@ -551,7 +557,14 @@ (match_operand:SI 2 "spu_nonmem_operand")] 0 ))] "" { - rtx exp2 = spu_gen_exp2 (V4SFmode, operands[2]); + rtx exp2; + if (GET_CODE (operands[2]) == CONST_INT + && (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) > 127)) + { + error ("spu_convts expects an integer literal in the range [0, 127]."); + operands[2] = force_reg (SImode, operands[2]); + } + exp2 = spu_gen_exp2 (V4SFmode, operands[2]); if (GET_CODE (operands[2]) != CONST_INT) { rtx mul = gen_reg_rtx (V4SFmode); @@ -569,6 +582,12 @@ (match_operand:SI 2 "spu_nonmem_operand")] 0 ))] "" { + if (GET_CODE (operands[2]) == CONST_INT + && (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) > 127)) + { + error ("spu_convtf expects an integer literal in the range [0, 127]."); + operands[2] = force_reg (SImode, operands[2]); + } if (GET_CODE (operands[2]) != CONST_INT) { rtx exp2; @@ -595,7 +614,14 @@ (match_operand:SI 2 "spu_nonmem_operand")] 0 ))] "" { - rtx exp2 = spu_gen_exp2 (V4SFmode, operands[2]); + rtx exp2; + if (GET_CODE (operands[2]) == CONST_INT + && (INTVAL (operands[2]) < 0 || INTVAL (operands[2]) > 127)) + { + error ("spu_convtu expects an integer literal in the range [0, 127]."); + operands[2] = force_reg (SImode, operands[2]); + } + exp2 = spu_gen_exp2 (V4SFmode, operands[2]); if (GET_CODE (operands[2]) != CONST_INT) { rtx mul = gen_reg_rtx (V4SFmode); |