[mips] Return {f128} correctly for N32/N64.
[oota-llvm.git] / lib / Target / Mips / MipsCallingConv.td
index 8fda1be846933a184432b1831f3b824ff8f9647e..bb45d4195ec7295a5917ec3e4c9eeab6b55b80be 100644 (file)
@@ -29,6 +29,12 @@ def RetCC_F128SoftFloat : CallingConv<[
 // pair of i64's.
 def RetCC_F128HardFloat : CallingConv<[
   CCBitConvertToType<f64>,
+
+  // Contrary to the ABI documentation, a struct containing a long double is
+  // returned in $f0, and $f1 instead of the usual $f0, and $f2. This is to
+  // match the de facto ABI as implemented by GCC.
+  CCIfInReg<CCAssignToReg<[D0_64, D1_64]>>,
+
   CCAssignToReg<[D0_64, D2_64]>
 ]>;