Some updates
authorEvan Cheng <evan.cheng@apple.com>
Mon, 20 Feb 2006 19:58:27 +0000 (19:58 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Mon, 20 Feb 2006 19:58:27 +0000 (19:58 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@26292 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Target/X86/README.txt

index bab702e96e3eb19efbe7a1faf4d975f7d4c185a7..da4f5b7cdedd17805c0bc38859b8ca7150c04531 100644 (file)
@@ -39,6 +39,19 @@ http://gcc.gnu.org/ml/gcc-patches/2004-04/msg00659.html
 This should use fiadd on chips where it is profitable:
 double foo(double P, int *I) { return P+*I; }
 
+We have fiadd patterns now but the followings have the same cost and
+complexity. We need a way to specify the later is more profitable.
+
+def FpADD32m  : FpI<(ops RFP:$dst, RFP:$src1, f32mem:$src2), OneArgFPRW,
+                    [(set RFP:$dst, (fadd RFP:$src1,
+                                     (extloadf64f32 addr:$src2)))]>;
+                // ST(0) = ST(0) + [mem32]
+
+def FpIADD32m : FpI<(ops RFP:$dst, RFP:$src1, i32mem:$src2), OneArgFPRW,
+                    [(set RFP:$dst, (fadd RFP:$src1,
+                                     (X86fild addr:$src2, i32)))]>;
+                // ST(0) = ST(0) + [mem32int]
+
 //===---------------------------------------------------------------------===//
 
 The FP stackifier needs to be global.  Also, it should handle simple permutates
@@ -386,11 +399,6 @@ LBB_X_2:
 
 //===---------------------------------------------------------------------===//
 
-The x86 backend currently supports dynamic-no-pic. Need to add asm
-printer support for static and PIC.
-
-//===---------------------------------------------------------------------===//
-
 We should generate bts/btr/etc instructions on targets where they are cheap or
 when codesize is important.  e.g., for:
 
@@ -419,10 +427,6 @@ When: "movl $_dst, _ptr" is sufficient.
 
 //===---------------------------------------------------------------------===//
 
-Use fisttp to do FP to integer conversion whenever it is available.
-
-//===---------------------------------------------------------------------===//
-
 Instead of the following for memset char*, 1, 10:
 
        movl $16843009, 4(%edx)
@@ -475,3 +479,21 @@ _test1:
 
 which is probably slower, but it's interesting at least :)
 
+//===---------------------------------------------------------------------===//
+
+Currently the x86 codegen isn't very good at mixing SSE and FPStack
+code:
+
+unsigned int foo(double x) { return x; }
+
+foo:
+       subl $20, %esp
+       movsd 24(%esp), %xmm0
+       movsd %xmm0, 8(%esp)
+       fldl 8(%esp)
+       fisttpll (%esp)
+       movl (%esp), %eax
+       addl $20, %esp
+       ret
+
+This will be solved when we go to a dynamic programming based isel.