> Implement correct bitcast of int<->float and long<->double by using a
> union to perform the bitcast.
> @@ -1508,6 +1508,16 @@
>  /// type name is found, emit its declaration...
>  ///
>  void CWriter::printModuleTypes(const SymbolTable &ST) {
> +  Out << "/* Helper union for bitcasts */\n";
> +  Out << "typedef union {\n";
> +  Out << "  unsigned int  UInt;\n";
> +  Out << "    signed int  SInt;\n";
> +  Out << "  unsigned long ULong;\n";
> +  Out << "    signed long SLong;\n";
> +  Out << "          float Float;\n";
> +  Out << "         double Double;\n";
> +  Out << "} llvmBitCastUnion;\n"

This is wrong for 32-bit targets.  ULong should be 'unsigned long  
long'.  SLong should be 'signed long long'.

Thanks Reid,

-Chris

_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to