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

Chris Lattner clattner at apple.com
Wed Dec 20 17:45:39 PST 2006


Is there a change to i386.h that goes along with this?

-Chris

On Dec 20, 2006, at 4:34 PM, 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.
> <macrocall.patch>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits




More information about the llvm-commits mailing list