It seems likely that floats would need a cast too, because they are
authorBrian Gaeke <gaeke@uiuc.edu>
Wed, 25 Jun 2003 03:05:33 +0000 (03:05 +0000)
committerBrian Gaeke <gaeke@uiuc.edu>
Wed, 25 Jun 2003 03:05:33 +0000 (03:05 +0000)
ordinarily promoted to doubles.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@6894 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/CBackend/CBackend.cpp
lib/Target/CBackend/Writer.cpp

index 9e10d5bc7827b77126776b93f69437a85c7143f7..61072d13402bdb7cdcbda8b17fdd608917302fcd 100644 (file)
@@ -1033,7 +1033,8 @@ void CWriter::visitBinaryOperator(Instruction &I) {
   // We must cast the results of binary operations which might be promoted.
   bool needsCast = false;
   if ((I.getType() == Type::UByteTy) || (I.getType() == Type::SByteTy)
-      || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)) {
+      || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)
+      || (I.getType() == Type::FloatTy)) {
     needsCast = true;
     Out << "((";
     printType(Out, I.getType(), "", false, false);
index 9e10d5bc7827b77126776b93f69437a85c7143f7..61072d13402bdb7cdcbda8b17fdd608917302fcd 100644 (file)
@@ -1033,7 +1033,8 @@ void CWriter::visitBinaryOperator(Instruction &I) {
   // We must cast the results of binary operations which might be promoted.
   bool needsCast = false;
   if ((I.getType() == Type::UByteTy) || (I.getType() == Type::SByteTy)
-      || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)) {
+      || (I.getType() == Type::UShortTy) || (I.getType() == Type::ShortTy)
+      || (I.getType() == Type::FloatTy)) {
     needsCast = true;
     Out << "((";
     printType(Out, I.getType(), "", false, false);