@@ -4627,7 +4627,7 @@ elem* toElemCast(CastExp ce, elem* e, bool isLvalue, ref IRState irs)
4627
4627
* information available to do it.
4628
4628
*
4629
4629
* Casting from a C++ interface to a non-C++ interface
4630
- * always results in null because there's no way one
4630
+ * always results in null because there is no way one
4631
4631
* can be derived from the other.
4632
4632
*/
4633
4633
e = el_bin(OPcomma, TYnptr, e, el_long(TYnptr, 0 ));
@@ -4660,6 +4660,9 @@ elem* toElemCast(CastExp ce, elem* e, bool isLvalue, ref IRState irs)
4660
4660
if (ftym == ttym)
4661
4661
return Lret (ce, e);
4662
4662
4663
+ // OSX AArch64 long doubles are 64 bits
4664
+ bool RealIsDouble = target.os == Target.os.OSX && target.isAArch64;
4665
+
4663
4666
/* Reduce combinatorial explosion by rewriting the 'to' and 'from' types to a
4664
4667
* generic equivalent (as far as casting goes)
4665
4668
*/
@@ -4676,6 +4679,10 @@ elem* toElemCast(CastExp ce, elem* e, bool isLvalue, ref IRState irs)
4676
4679
case Tdchar: tty = Tuns32; break ;
4677
4680
case Tvoid: return Lpaint(ce, e, ttym);
4678
4681
4682
+ case Tfloat80: if (RealIsDouble) tty = Tfloat64; break ;
4683
+ case Timaginary80: if (RealIsDouble) tty = Timaginary64; break ;
4684
+ case Tcomplex80: if (RealIsDouble) tty = Tcomplex64; break ;
4685
+
4679
4686
case Tbool:
4680
4687
{
4681
4688
// Construct e?true:false
@@ -4703,6 +4710,10 @@ elem* toElemCast(CastExp ce, elem* e, bool isLvalue, ref IRState irs)
4703
4710
case Tnoreturn:
4704
4711
return Lret (ce, e);
4705
4712
4713
+ case Tfloat80: if (RealIsDouble) fty = Tfloat64; break ;
4714
+ case Timaginary80: if (RealIsDouble) fty = Timaginary64; break ;
4715
+ case Tcomplex80: if (RealIsDouble) fty = Tcomplex64; break ;
4716
+
4706
4717
default :
4707
4718
break ;
4708
4719
}
0 commit comments