[llvm-commits] [llvm-gcc] Removal of signedness from gcc/config/i386/i386.h

Reid Spencer rspencer at reidspencer.com
Wed Dec 20 17:57:25 PST 2006


Okay, one more time ..

On Wed, 2006-12-20 at 16:34 -0800, Reid Spencer wrote:
> (this email actually has the patch attached)
> 
> The attached patch removes signedness from the i386.h file, in
> particular the LLVM_TARGET_INTRINSIC_LOWER macro. The macro takes three
> additional arguments and depends on a change in the function its called
> from, like this:
> 
> Index: gcc/llvm-convert.cpp
> ===================================================================
> --- gcc/llvm-convert.cpp        (revision 230)
> +++ gcc/llvm-convert.cpp        (working copy)
> @@ -3011,9 +3090,11 @@
>    for (tree args = TREE_OPERAND(exp, 1); args; args = TREE_CHAIN(args))
>      Operands.push_back(Emit(TREE_VALUE(args), 0));
> 
> +  bool ResIsSigned = !TYPE_UNSIGNED(TREE_TYPE(TREE_TYPE(fndecl)));
> +  bool ExpIsSigned = !TYPE_UNSIGNED(TREE_TYPE(exp));
>    unsigned FnCode = DECL_FUNCTION_CODE(fndecl);
> -  LLVM_TARGET_INTRINSIC_LOWER(FnCode, DestLoc, Result,
> -                              ResultType, Operands, CurBB);
> +  LLVM_TARGET_INTRINSIC_LOWER(FnCode, DestLoc, Result, ResultType,
> Operands,
> +                              CurBB, exp, ResIsSigned, ExpIsSigned);
>  #endif
>    return false;
>  }
> 
> This allows the macro to make signedness determinations based on the gcc
> tree codes.
> 
> Although this patch removes isSigned() calls and is correct, it is not
> optimal. It is still using CastInst::getCastOpcode to figure out the
> casting opcode for it. Perhaps someone with a little more knowledge of
> the intrinsic functions could narrow these down to the appropriate cast
> opcode.
> 
> Please review and commit when you can.
> 
> Reid.
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
-------------- next part --------------
A non-text attachment was scrubbed...
Name: i386-llvmgcc.patch
Type: text/x-patch
Size: 19268 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20061220/26e3e19f/attachment.bin>


More information about the llvm-commits mailing list