[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-06-27 Thread Dan Gohman


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.42 - 1.43
---
Log message:

Remove a redundant newline in the asm output for ELF .rodata sections.


---
Diffs of the changes:  (+1 -1)

 X86TargetAsmInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.42 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.43
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.42   Sat May 12 17:36:25 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Jun 27 10:09:47 2007
@@ -98,7 +98,7 @@
 break;
 
   case X86Subtarget::isELF:
-ReadOnlySection = \t.section\t.rodata\n;
+ReadOnlySection = \t.section\t.rodata;
 FourByteConstantSection = \t.section\t.rodata.cst4,\aM\,@progbits,4;
 EightByteConstantSection = \t.section\t.rodata.cst8,\aM\,@progbits,8;
 SixteenByteConstantSection = 
\t.section\t.rodata.cst16,\aM\,@progbits,16;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-05-03 Thread Dan Gohman


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.39 - 1.40
---
Log message:

Sets the section names for fixed-size constants and use the mergeable
flag for ELF on x86 so that duplicate constants can be eliminated by
the linker. This matches what GCC does with its -fmerge-constants
option, which is enabled at most -O levels.


---
Diffs of the changes:  (+5 -0)

 X86TargetAsmInfo.cpp |5 +
 1 files changed, 5 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.40
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39   Tue May  1 17:23:12 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppThu May  3 11:38:57 2007
@@ -107,6 +107,11 @@
 // HasDotFile - True if target asm supports .file directives.
 // bool HasDotFile; // Defaults to false.
 ReadOnlySection = \t.section\t.rodata\n;
+FourByteConstantSection = \t.section\t.rodata.cst4,\aM\,@progbits,4;
+EightByteConstantSection = \t.section\t.rodata.cst8,\aM\,@progbits,8;
+SixteenByteConstantSection =
+ \t.section\t.rodata.cst16,\aM\,@progbits,16;
+CStringSection = \t.section\t.rodata.str1.1,\aMS\,@progbits,1;
 PrivateGlobalPrefix = .L;
 WeakRefDirective = \t.weak\t;
 SetDirective = \t.set\t;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-05-01 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.36 - 1.37
---
Log message:

Adjust correct EH-related sections


---
Diffs of the changes:  (+4 -0)

 X86TargetAsmInfo.cpp |4 
 1 files changed, 4 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.36 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.36   Wed Apr 25 09:27:10 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue May  1 05:16:06 2007
@@ -121,6 +121,10 @@
 DwarfARangesSection = \t.section\t.debug_aranges,\\,@progbits;
 DwarfRangesSection =  \t.section\t.debug_ranges,\\,@progbits;
 DwarfMacInfoSection = \t.section\t.debug_macinfo,\\,@progbits;
+
+SupportsExceptionHandling = true;
+DwarfEHFrameSection = \t.section\t.eh_frame,\aw\,@progbits;
+DwarfExceptionSection = \t.section\t.gcc_except_table,\a\,@progbits;
 break;
 
   case X86Subtarget::isCygwin:



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-05-01 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.37 - 1.38
---
Log message:

Use correct PC symbol


---
Diffs of the changes:  (+2 -0)

 X86TargetAsmInfo.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.37   Tue May  1 05:16:06 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue May  1 05:19:31 2007
@@ -109,6 +109,8 @@
 PrivateGlobalPrefix = .L;
 WeakRefDirective = \t.weak\t;
 SetDirective = \t.set\t;
+PCSymbol = .;
+
 DwarfRequiresFrameSection = false;
 DwarfAbbrevSection =  \t.section\t.debug_abbrev,\\,@progbits;
 DwarfInfoSection =\t.section\t.debug_info,\\,@progbits;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-05-01 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.38 - 1.39
---
Log message:

Fix couple of bugs connected with eh info:
1. Correct output offsets on Linux
2. Fix style of personality function. It shouldn't be indirect.


---
Diffs of the changes:  (+4 -2)

 X86TargetAsmInfo.cpp |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.39
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.38   Tue May  1 05:19:31 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue May  1 17:23:12 2007
@@ -99,7 +99,8 @@
   case X86Subtarget::isELF:
 // Set up DWARF directives
 HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
-AbsoluteSectionOffsets = true;
+AbsoluteDebugSectionOffsets = true;
+AbsoluteEHSectionOffsets = false;
 // bool HasLEB128; // Defaults to false.
 // hasDotLoc - True if target asm supports .loc directives.
 // bool HasDotLoc; // Defaults to false.
@@ -141,7 +142,8 @@
 
 // Set up DWARF directives
 HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
-AbsoluteSectionOffsets = true;
+AbsoluteDebugSectionOffsets = true;
+AbsoluteEHSectionOffsets = false;
 PrivateGlobalPrefix = L;  // Prefix for private global symbols
 WeakRefDirective = \t.weak\t;
 SetDirective = \t.set\t;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-04-25 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.35 - 1.36
---
Log message:

Implement aliases. This fixes PR1017: http://llvm.org/PR1017  and it's 
dependent bugs. CFE part 
will follow.


---
Diffs of the changes:  (+2 -0)

 X86TargetAsmInfo.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.35 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.36
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.35   Sun Apr  1 15:49:36 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Apr 25 09:27:10 2007
@@ -108,6 +108,7 @@
 ReadOnlySection = \t.section\t.rodata\n;
 PrivateGlobalPrefix = .L;
 WeakRefDirective = \t.weak\t;
+SetDirective = \t.set\t;
 DwarfRequiresFrameSection = false;
 DwarfAbbrevSection =  \t.section\t.debug_abbrev,\\,@progbits;
 DwarfInfoSection =\t.section\t.debug_info,\\,@progbits;
@@ -137,6 +138,7 @@
 AbsoluteSectionOffsets = true;
 PrivateGlobalPrefix = L;  // Prefix for private global symbols
 WeakRefDirective = \t.weak\t;
+SetDirective = \t.set\t;
 DwarfRequiresFrameSection = false;
 DwarfSectionOffsetDirective = \t.secrel32\t;
 DwarfAbbrevSection =  \t.section\t.debug_abbrev,\dr\;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-04-01 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.34 - 1.35
---
Log message:

fix breakage from last night, simplify code.


---
Diffs of the changes:  (+6 -15)

 X86TargetAsmInfo.cpp |   21 ++---
 1 files changed, 6 insertions(+), 15 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.34 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.35
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.34   Wed Mar  7 19:07:07 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppSun Apr  1 15:49:36 2007
@@ -17,6 +17,7 @@
 #include llvm/DerivedTypes.h
 #include llvm/InlineAsm.h
 #include llvm/Instructions.h
+#include llvm/Intrinsics.h
 #include llvm/Module.h
 #include llvm/ADT/StringExtras.h
 using namespace llvm;
@@ -199,24 +200,14 @@
   !CI-getType()-isInteger())
 return false;
   
-  const Type *Ty = CI-getType();
-  const char *IntName;
-  if (const IntegerType *ITy = dyn_castIntegerType(Ty)) {
-unsigned BitWidth = ITy-getBitWidth();
-if (BitWidth == 16)
-  IntName = llvm.bswap.i16;
-else if (BitWidth == 32)
-  IntName = llvm.bswap.i32;
-else if (BitWidth == 64)
-  IntName = llvm.bswap.i64;
-else
-  return false;
-  } else
+  const IntegerType *Ty = dyn_castIntegerType(CI-getType());
+  if (!Ty || Ty-getBitWidth() % 16 != 0)
 return false;
-
+  
   // Okay, we can do this xform, do so now.
+  const Type *Tys[] = { Ty, Ty };
   Module *M = CI-getParent()-getParent()-getParent();
-  Constant *Int = M-getOrInsertFunction(IntName, Ty, Ty, (Type*)0);
+  Constant *Int = Intrinsic::getDeclaration(M, Intrinsic::bswap, Tys, 2);
   
   Value *Op = CI-getOperand(1);
   Op = new CallInst(Int, Op, CI-getName(), CI);



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-03-06 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.32 - 1.33
---
Log message:

Fix DWARF debugging information on x86/Linux and (hopefully) 
Mingw32/Cygwin targets. This fixes PR978: http://llvm.org/PR978 


---
Diffs of the changes:  (+3 -0)

 X86TargetAsmInfo.cpp |3 +++
 1 files changed, 3 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.32 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.33
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.32   Thu Feb 22 19:58:50 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue Mar  6 20:47:57 2007
@@ -97,6 +97,7 @@
   case X86Subtarget::isELF:
 // Set up DWARF directives
 HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
+AbsoluteSectionOffsets = true;
 // bool HasLEB128; // Defaults to false.
 // hasDotLoc - True if target asm supports .loc directives.
 // bool HasDotLoc; // Defaults to false.
@@ -130,9 +131,11 @@
 
 // Set up DWARF directives
 HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)
+AbsoluteSectionOffsets = true;
 PrivateGlobalPrefix = L;  // Prefix for private global symbols
 WeakRefDirective = \t.weak\t;
 DwarfRequiresFrameSection = false;
+DwarfSectionOffsetDirective = \t.secrel32\t;
 DwarfAbbrevSection =  \t.section\t.debug_abbrev,\dr\;
 DwarfInfoSection =\t.section\t.debug_info,\dr\;
 DwarfLineSection =\t.section\t.debug_line,\dr\;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-17 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.28 - 1.29
---
Log message:

darwin doesn't support .bss, but it does have .zerofill


---
Diffs of the changes:  (+2 -0)

 X86TargetAsmInfo.cpp |2 ++
 1 files changed, 2 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.28 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.29
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.28   Tue Jan 16 03:29:17 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Jan 17 11:43:33 2007
@@ -47,6 +47,8 @@
   Data64bitsDirective = 0;   // we can't emit a 64-bit unit
 ZeroDirective = \t.space\t;  // .space N emits N zeros.
 PrivateGlobalPrefix = L; // Marker for constant pool idxs
+BSSSection = 0;   // no BSS section.
+ZeroFillDirective = \t.zerofill\t;  // Uses .zerofill
 ConstantPoolSection = \t.const\n;
 JumpTableDataSection = \t.const\n;
 CStringSection = \t.cstring;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-17 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.29 - 1.30
---
Log message:

Modify emission of jump tables on darwin to emit an extra l label that
delimits the boundaries of jump tables.  This lets the linker's dead code
stripping optimization do a better job.


---
Diffs of the changes:  (+7 -0)

 X86TargetAsmInfo.cpp |7 +++
 1 files changed, 7 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.29 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.30
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.29   Wed Jan 17 11:43:33 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Jan 17 19:15:58 2007
@@ -68,6 +68,13 @@
 WeakRefDirective = \t.weak_reference\t;
 HiddenDirective = \t.private_extern\t;
 
+// In non-PIC modes, emit a special label before jump tables so that the
+// linker can perform more accurate dead code stripping.
+if (TM.getRelocationModel() != Reloc::PIC_) {
+  // Emit a local label that is preserved until the linker runs.
+  JumpTableSpecialLabelPrefix = l;
+}
+
 NeedsSet = true;
 DwarfAbbrevSection = .section __DWARF,__debug_abbrev,regular,debug;
 DwarfInfoSection = .section __DWARF,__debug_info,regular,debug;



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


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h

2007-01-16 Thread Anton Korobeynikov
Hello, Bill.

 +// ASM variant to use.
 +enum {
 +  X86_ATT   = 0,
 +  X86_INTEL = 1
 +};
There is already assembler flavour defined in Subtarget. Why do you need
some more?

-- 
With best regards, Anton Korobeynikov.

Faculty of Mathematics  Mechanics, Saint Petersburg State University.


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


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h

2007-01-16 Thread Bill Wendling
On Jan 16, 2007, at 12:17 AM, Anton Korobeynikov wrote:

 Hello, Bill.

 +// ASM variant to use.
 +enum {
 +  X86_ATT   = 0,
 +  X86_INTEL = 1
 +};
 There is already assembler flavour defined in Subtarget. Why do you  
 need
 some more?

Hmm...Good question. It should use this information to at least  
update the TargetAsmInfo structure. Thanks for catching this.

-bw


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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h

2007-01-15 Thread Bill Wendling


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.25 - 1.26
X86TargetAsmInfo.h updated: 1.3 - 1.4
---
Log message:

Fix for PR1095: http://llvm.org/PR1095 :
LLVM would miscompile ASM dialects when compiling for PPC. Added dialects for
the X86 and PPC backends. It defaults to 0, the first variant of a compound
inline asm expression.



---
Diffs of the changes:  (+8 -1)

 X86TargetAsmInfo.cpp |7 +++
 X86TargetAsmInfo.h   |2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.25 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.26
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.25   Sun Jan 14 20:27:26 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppMon Jan 15 21:42:04 2007
@@ -21,6 +21,12 @@
 #include llvm/ADT/StringExtras.h
 using namespace llvm;
 
+// ASM variant to use.
+enum {
+  X86_ATT   = 0,
+  X86_INTEL = 1
+};
+
 static const char* x86_asm_table[] = {{si}, S,
   {di}, D,
   {ax}, a,
@@ -38,6 +44,7 @@
   // FIXME - Should be simplified.
 
   AsmTransCBE = x86_asm_table;
+  AssemblerDialect = X86_ATT;
   
   switch (Subtarget-TargetType) {
   case X86Subtarget::isDarwin:


Index: llvm/lib/Target/X86/X86TargetAsmInfo.h
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.h:1.3 
llvm/lib/Target/X86/X86TargetAsmInfo.h:1.4
--- llvm/lib/Target/X86/X86TargetAsmInfo.h:1.3  Tue Nov 28 19:14:06 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.h  Mon Jan 15 21:42:04 2007
@@ -17,7 +17,7 @@
 #include llvm/Target/TargetAsmInfo.h
 
 namespace llvm {
-  
+
   // Forward declaration.
   class X86TargetMachine;
 



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-15 Thread Bill Wendling


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.26 - 1.27
---
Log message:

Make inline ASM the INTEL one if it's in that emission mode.


---
Diffs of the changes:  (+4 -2)

 X86TargetAsmInfo.cpp |6 --
 1 files changed, 4 insertions(+), 2 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.26 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.27
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.26   Mon Jan 15 21:42:04 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppMon Jan 15 22:13:03 2007
@@ -137,12 +137,12 @@
 DwarfRangesSection =  \t.section\t.debug_ranges,\dr\;
 DwarfMacInfoSection = \t.section\t.debug_macinfo,\dr\;
 break;
-
-break;
+
   case X86Subtarget::isWindows:
 GlobalPrefix = _;
 HasDotTypeDotSizeDirective = false;
 break;
+
   default: break;
   }
   
@@ -169,6 +169,8 @@
 TextSectionStartSuffix = \tsegment 'CODE';
 DataSectionStartSuffix = \tsegment 'DATA';
 SectionEndDirectiveSuffix = \tends\n;
+
+AssemblerDialect = X86_INTEL;
   }
 }
 



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-14 Thread Anton Korobeynikov


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.22 - 1.23
---
Log message:

No hidden visiblity on Mingw32/Cygwin


---
Diffs of the changes:  (+1 -0)

 X86TargetAsmInfo.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.22 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.23
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.22   Sun Jan 14 00:29:53 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppSun Jan 14 05:49:39 2007
@@ -112,6 +112,7 @@
 HasDotTypeDotSizeDirective = false;
 StaticCtorsSection = \t.section .ctors,\aw\;
 StaticDtorsSection = \t.section .dtors,\aw\;
+HiddenDirective = NULL;
 
 // Set up DWARF directives
 HasLEB128 = true;  // Target asm supports leb128 directives (little-endian)



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-12 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.20 - 1.21
---
Log message:

remove over-general code.


---
Diffs of the changes:  (+3 -3)

 X86TargetAsmInfo.cpp |6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.20 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.21
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.20   Fri Jan 12 17:22:14 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppFri Jan 12 17:28:32 2007
@@ -179,11 +179,11 @@
   const char *IntName;
   if (const IntegerType *ITy = dyn_castIntegerType(Ty)) {
 unsigned BitWidth = ITy-getBitWidth();
-if (BitWidth  8  BitWidth = 16)
+if (BitWidth == 16)
   IntName = llvm.bswap.i16;
-else if (BitWidth  24   BitWidth = 32)
+else if (BitWidth == 32)
   IntName = llvm.bswap.i32;
-else if (BitWidth  56  BitWidth = 64)
+else if (BitWidth == 64)
   IntName = llvm.bswap.i64;
 else
   return false;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-11 Thread Reid Spencer


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.18 - 1.19
---
Log message:

For PR1064: http://llvm.org/PR1064 :
Implement the arbitrary bit-width integer feature. The feature allows
integers of any bitwidth (up to 64) to be defined instead of just 1, 8, 
16, 32, and 64 bit integers.  

This change does several things:
1. Introduces a new Derived Type, IntegerType, to represent the number of
   bits in an integer. The Type classes SubclassData field is used to
   store the number of bits. This allows 2^23 bits in an integer type. 
2. Removes the five integer Type::TypeID values for the 1, 8, 16, 32 and
   64-bit integers. These are replaced with just IntegerType which is not
   a primitive any more. 
3. Adjust the rest of LLVM to account for this change.

Note that while this incremental change lays the foundation for arbitrary
bit-width integers, LLVM has not yet been converted to actually deal with 
them in any significant way. Most optimization passes, for example, will 
still only deal with the byte-width integer types.  Future increments
will rectify this situation.



---
Diffs of the changes:  (+12 -6)

 X86TargetAsmInfo.cpp |   18 --
 1 files changed, 12 insertions(+), 6 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.18 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.19
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.18   Sun Jan  7 01:24:32 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppFri Jan 12 01:05:13 2007
@@ -176,12 +176,18 @@
   
   const Type *Ty = CI-getType();
   const char *IntName;
-  switch (Ty-getTypeID()) {
-  default: return false;
-  case Type::Int16TyID: IntName = llvm.bswap.i16; break;
-  case Type::Int32TyID:   IntName = llvm.bswap.i32; break;
-  case Type::Int64TyID:  IntName = llvm.bswap.i64; break;
-  }
+  if (const IntegerType *ITy = dyn_castIntegerType(Ty)) {
+unsigned BitWidth = ITy-getBitWidth();
+if (BitWidth  8  BitWidth = 16)
+  IntName = llvm.bswap.i16;
+else if (BitWidth  24   BitWidth = 32)
+  IntName = llvm.bswap.i32;
+else if (BitWidth  56  BitWidth = 64)
+  IntName = llvm.bswap.i64;
+else
+  return false;
+  } else
+return false;
 
   // Okay, we can do this xform, do so now.
   Module *M = CI-getParent()-getParent()-getParent();



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-07 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.17 - 1.18
---
Log message:

relax type


---
Diffs of the changes:  (+1 -1)

 X86TargetAsmInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.17 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.18
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.17   Wed Jan  3 12:16:48 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppSun Jan  7 01:24:32 2007
@@ -185,7 +185,7 @@
 
   // Okay, we can do this xform, do so now.
   Module *M = CI-getParent()-getParent()-getParent();
-  Function *Int = M-getOrInsertFunction(IntName, Ty, Ty, (Type*)0);
+  Constant *Int = M-getOrInsertFunction(IntName, Ty, Ty, (Type*)0);
   
   Value *Op = CI-getOperand(1);
   Op = new CallInst(Int, Op, CI-getName(), CI);



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-03 Thread Reid Spencer


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.15 - 1.16
---
Log message:

Remove two useless bit casts.


---
Diffs of the changes:  (+0 -6)

 X86TargetAsmInfo.cpp |6 --
 1 files changed, 6 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.15 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.16
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.15   Wed Jan  3 05:43:14 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Jan  3 11:24:11 2007
@@ -188,14 +188,8 @@
   Function *Int = M-getOrInsertFunction(IntName, Ty, Ty, (Type*)0);
   
   Value *Op = CI-getOperand(1);
-  if (CI-getOperand(1)-getType() != Ty)
-Op = new BitCastInst(Op, Ty, Op-getName(), CI);
-  
   Op = new CallInst(Int, Op, CI-getName(), CI);
   
-  if (Op-getType() != CI-getType())
-Op = new BitCastInst(Op, CI-getType(), Op-getName(), CI);
-  
   CI-replaceAllUsesWith(Op);
   CI-eraseFromParent();
   return true;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2007-01-03 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.16 - 1.17
---
Log message:

Private labels start with .L on linux, not just .


---
Diffs of the changes:  (+1 -1)

 X86TargetAsmInfo.cpp |2 +-
 1 files changed, 1 insertion(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.16 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.17
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.16   Wed Jan  3 11:24:11 2007
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppWed Jan  3 12:16:48 2007
@@ -86,7 +86,7 @@
 // bool HasDotLoc; // Defaults to false.
 // HasDotFile - True if target asm supports .file directives.
 // bool HasDotFile; // Defaults to false.
-PrivateGlobalPrefix = .;  // Prefix for private global symbols
+PrivateGlobalPrefix = .L;
 WeakRefDirective = \t.weak\t;
 DwarfRequiresFrameSection = false;
 DwarfAbbrevSection =  \t.section\t.debug_abbrev,\\,@progbits;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2006-11-28 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.7 - 1.8
---
Log message:

X86 asm - gcc asm translation table (incomplete)

---
Diffs of the changes:  (+18 -1)

 X86TargetAsmInfo.cpp |   19 ++-
 1 files changed, 18 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7Tue Oct 31 02:31:24 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue Nov 28 13:52:49 2006
@@ -14,14 +14,31 @@
 #include X86TargetAsmInfo.h
 #include X86TargetMachine.h
 #include X86Subtarget.h
+#include iostream
 
 using namespace llvm;
 
+static const char* x86_asm_table[] = {{si}, S,
+  {di}, D,
+  {ax}, a,
+  {cx}, c,
+  q,q,
+  r,r,
+  m,m,
+  {memory}, memory,
+  {flags}, ,
+  {dirflag}, ,
+  {fpsr}, ,
+  {cc}, cc,
+  0,0};
+
 X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine TM) {
   const X86Subtarget *Subtarget = TM.getSubtargetX86Subtarget();
   
   // FIXME - Should be simplified.
-   
+
+  AsmTransCBE = x86_asm_table;
+  
   switch (Subtarget-TargetType) {
   case X86Subtarget::isDarwin:
 AlignmentIsInBytes = false;



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


Re: [llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2006-11-28 Thread Chris Lattner

On Nov 28, 2006, at 11:53 AM, Andrew Lenharth wrote:


 diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7 llvm/lib/ 
 Target/X86/X86TargetAsmInfo.cpp:1.8
 --- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.7  Tue Oct 31  
 02:31:24 2006
 +++ llvm/lib/Target/X86/X86TargetAsmInfo.cpp  Tue Nov 28 13:52:49 2006
 @@ -14,14 +14,31 @@
  #include X86TargetAsmInfo.h
  #include X86TargetMachine.h
  #include X86Subtarget.h
 +#include iostream

Please remove this #include.

  using namespace llvm;

 +static const char* x86_asm_table[] = {{si}, S,
 +  {di}, D,
 +  {ax}, a,
 +  {cx}, c,
 +  q,q,
 +  r,r,
 +  m,m,

Why not have identity translations (r - r) be implicit?

-Chris

 +  {memory}, memory,
 +  {flags}, ,
 +  {dirflag}, ,
 +  {fpsr}, ,
 +  {cc}, cc,
 +  0,0};
 +
  X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine TM) {
const X86Subtarget *Subtarget = TM.getSubtargetX86Subtarget();

// FIXME - Should be simplified.
 -
 +
 +  AsmTransCBE = x86_asm_table;
 +
switch (Subtarget-TargetType) {
case X86Subtarget::isDarwin:
  AlignmentIsInBytes = false;



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

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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2006-11-28 Thread Andrew Lenharth


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.8 - 1.9
---
Log message:

Identities are default now

---
Diffs of the changes:  (+0 -4)

 X86TargetAsmInfo.cpp |4 
 1 files changed, 4 deletions(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.8Tue Nov 28 13:52:49 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue Nov 28 16:28:08 2006
@@ -14,7 +14,6 @@
 #include X86TargetAsmInfo.h
 #include X86TargetMachine.h
 #include X86Subtarget.h
-#include iostream
 
 using namespace llvm;
 
@@ -22,9 +21,6 @@
   {di}, D,
   {ax}, a,
   {cx}, c,
-  q,q,
-  r,r,
-  m,m,
   {memory}, memory,
   {flags}, ,
   {dirflag}, ,



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h

2006-11-28 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.9 - 1.10
X86TargetAsmInfo.h updated: 1.2 - 1.3
---
Log message:

Trivially lower 'bswap $0' into llvm.bswap.  This fixes hexxagon with the
JIT on darwin/x86, which has htonl implemented as inline asm.


---
Diffs of the changes:  (+75 -1)

 X86TargetAsmInfo.cpp |   72 ++-
 X86TargetAsmInfo.h   |4 ++
 2 files changed, 75 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.9Tue Nov 28 16:28:08 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue Nov 28 19:14:06 2006
@@ -14,7 +14,10 @@
 #include X86TargetAsmInfo.h
 #include X86TargetMachine.h
 #include X86Subtarget.h
-
+#include llvm/InlineAsm.h
+#include llvm/Instructions.h
+#include llvm/Module.h
+#include llvm/ADT/StringExtras.h
 using namespace llvm;
 
 static const char* x86_asm_table[] = {{si}, S,
@@ -154,3 +157,70 @@
   }
 }
 
+bool X86TargetAsmInfo::LowerToBSwap(CallInst *CI) const {
+  // FIXME: this should verify that we are targetting a 486 or better.  If not,
+  // we will turn this bswap into something that will be lowered to logical ops
+  // instead of emitting the bswap asm.  For now, we don't support 486 or lower
+  // so don't worry about this.
+  
+  // Verify this is a simple bswap.
+  if (CI-getNumOperands() != 2 ||
+  CI-getType() != CI-getOperand(1)-getType() ||
+  !CI-getType()-isInteger())
+return false;
+  
+  const Type *Ty = CI-getType()-getUnsignedVersion();
+  const char *IntName;
+  switch (Ty-getTypeID()) {
+  default: return false;
+  case Type::UShortTyID: IntName = llvm.bswap.i16; break;
+  case Type::UIntTyID:   IntName = llvm.bswap.i32; break;
+  case Type::ULongTyID:  IntName = llvm.bswap.i64; break;
+  }
+
+  // Okay, we can do this xform, do so now.
+  Module *M = CI-getParent()-getParent()-getParent();
+  Function *Int = M-getOrInsertFunction(IntName, Ty, Ty, (Type*)0);
+  
+  Value *Op = CI-getOperand(1);
+  if (CI-getOperand(1)-getType() != Ty)
+Op = new BitCastInst(Op, Ty, Op-getName(), CI);
+  
+  Op = new CallInst(Int, Op, CI-getName(), CI);
+  
+  if (Op-getType() != CI-getType())
+Op = new BitCastInst(Op, CI-getType(), Op-getName(), CI);
+  
+  CI-replaceAllUsesWith(Op);
+  CI-eraseFromParent();
+  return true;
+}
+
+
+bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const {
+  InlineAsm *IA = castInlineAsm(CI-getCalledValue());
+  //std::vectorInlineAsm::ConstraintInfo Constraints = 
IA-ParseConstraints();
+  
+  std::string AsmStr = IA-getAsmString();
+  
+  // TODO: should remove alternatives from the asmstring: foo {a|b} - foo 
a
+  std::vectorstd::string AsmPieces;
+  SplitString(AsmStr, AsmPieces, \n);  // ; as separator?
+  
+  switch (AsmPieces.size()) {
+  default: return false;
+  case 1:
+AsmStr = AsmPieces[0];
+AsmPieces.clear();
+SplitString(AsmStr, AsmPieces,  \t);  // Split with whitespace.
+
+if (AsmPieces.size() == 2  
+AsmPieces[0] == bswap  AsmPieces[1] == $0) {
+  // No need to check constraints, nothing other than the equivalent of
+  // =r,0 would be valid here.
+  return LowerToBSwap(CI);
+}
+break;
+  }
+  return false;
+}


Index: llvm/lib/Target/X86/X86TargetAsmInfo.h
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.h:1.2 
llvm/lib/Target/X86/X86TargetAsmInfo.h:1.3
--- llvm/lib/Target/X86/X86TargetAsmInfo.h:1.2  Wed Oct  4 21:43:52 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.h  Tue Nov 28 19:14:06 2006
@@ -23,6 +23,10 @@
 
   struct X86TargetAsmInfo : public TargetAsmInfo {
 X86TargetAsmInfo(const X86TargetMachine TM);
+
+virtual bool ExpandInlineAsm(CallInst *CI) const;
+  private:
+bool LowerToBSwap(CallInst *CI) const;
   };
 } // namespace llvm
 



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2006-11-28 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.10 - 1.11
---
Log message:

Upgrade the ugly darwin 64-bit bswap idiom (bswap %eax / bswap %edx / 
xchgl %eax, %edx) to llvm.bswap.i64.  This compiles:

long long test2(long long A) {
  return _OSSwapInt64(A);
}

to:

_test2:
movl 8(%esp), %eax
movl 4(%esp), %edx
bswapl %eax
bswapl %edx
ret

instead of:

_test2:
movl 8(%esp), %edx
movl 4(%esp), %eax
bswap   %eax
bswap   %edx
xchgl   %eax, %edx
ret

GCC manages (with -fomit-frame-pointer) the uglier:

_test2:
subl$4, %esp
movl8(%esp), %eax
movl12(%esp), %edx
bswap   %eax
bswap   %edx
xchgl   %eax, %edx
addl$4, %esp
ret




---
Diffs of the changes:  (+23 -1)

 X86TargetAsmInfo.cpp |   24 +++-
 1 files changed, 23 insertions(+), 1 deletion(-)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.11
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.10   Tue Nov 28 19:14:06 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppTue Nov 28 19:48:01 2006
@@ -199,7 +199,7 @@
 
 bool X86TargetAsmInfo::ExpandInlineAsm(CallInst *CI) const {
   InlineAsm *IA = castInlineAsm(CI-getCalledValue());
-  //std::vectorInlineAsm::ConstraintInfo Constraints = 
IA-ParseConstraints();
+  std::vectorInlineAsm::ConstraintInfo Constraints = IA-ParseConstraints();
   
   std::string AsmStr = IA-getAsmString();
   
@@ -214,6 +214,7 @@
 AsmPieces.clear();
 SplitString(AsmStr, AsmPieces,  \t);  // Split with whitespace.
 
+// bswap $0
 if (AsmPieces.size() == 2  
 AsmPieces[0] == bswap  AsmPieces[1] == $0) {
   // No need to check constraints, nothing other than the equivalent of
@@ -221,6 +222,27 @@
   return LowerToBSwap(CI);
 }
 break;
+  case 3:
+if (CI-getType() == Type::ULongTy  Constraints.size() = 2 
+Constraints[0].Codes.size() == 1  Constraints[0].Codes[0] == A 
+Constraints[1].Codes.size() == 1  Constraints[1].Codes[0] == 0) {
+  // bswap %eax / bswap %edx / xchgl %eax, %edx  - llvm.bswap.i64
+  std::vectorstd::string Words;
+  SplitString(AsmPieces[0], Words,  \t);
+  if (Words.size() == 2  Words[0] == bswap  Words[1] == %eax) {
+Words.clear();
+SplitString(AsmPieces[1], Words,  \t);
+if (Words.size() == 2  Words[0] == bswap  Words[1] == %edx) {
+  Words.clear();
+  SplitString(AsmPieces[2], Words,  \t,);
+  if (Words.size() == 3  Words[0] == xchgl  Words[1] == %eax 
+  Words[2] == %edx) {
+return LowerToBSwap(CI);
+  }
+}
+  }
+}
+break;
   }
   return false;
 }



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp

2006-09-25 Thread Chris Lattner


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp updated: 1.2 - 1.3
---
Log message:

Compile:
int x __attribute__((used));

to:

.data
.comm _x,4  ; 'x'
.no_dead_strip  _x

on both x86 and ppc darwin targets.



---
Diffs of the changes:  (+1 -0)

 X86TargetAsmInfo.cpp |1 +
 1 files changed, 1 insertion(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -u llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.2 
llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.3
--- llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.2Fri Sep  8 01:48:29 2006
+++ llvm/lib/Target/X86/X86TargetAsmInfo.cppMon Sep 25 22:39:53 2006
@@ -44,6 +44,7 @@
 InlineAsmStart = # InlineAsm Start;
 InlineAsmEnd = # InlineAsm End;
 SetDirective = \t.set;
+UsedDirective = \t.no_dead_strip\t;
 
 NeedsSet = true;
 DwarfAbbrevSection = .section __DWARF,__debug_abbrev,regular,debug;



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


[llvm-commits] CVS: llvm/lib/Target/X86/X86TargetAsmInfo.cpp X86TargetAsmInfo.h

2006-09-07 Thread Jim Laskey


Changes in directory llvm/lib/Target/X86:

X86TargetAsmInfo.cpp added (r1.1)
X86TargetAsmInfo.h added (r1.1)
---
Log message:

Break out target asm info into separate files.


---
Diffs of the changes:  (+126 -0)

 X86TargetAsmInfo.cpp |   95 +++
 X86TargetAsmInfo.h   |   31 
 2 files changed, 126 insertions(+)


Index: llvm/lib/Target/X86/X86TargetAsmInfo.cpp
diff -c /dev/null llvm/lib/Target/X86/X86TargetAsmInfo.cpp:1.1
*** /dev/null   Thu Sep  7 17:05:12 2006
--- llvm/lib/Target/X86/X86TargetAsmInfo.cppThu Sep  7 17:05:02 2006
***
*** 0 
--- 1,95 
+ //===-- X86TargetAsmInfo.cpp - X86 asm properties ---*- C++ 
-*-===//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by James M. Laskey and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This file contains the declarations of the X86TargetAsmInfo properties.
+ //
+ 
//===--===//
+ 
+ #include X86TargetAsmInfo.h
+ #include X86TargetMachine.h
+ #include X86Subtarget.h
+ 
+ using namespace llvm;
+ 
+ X86TargetAsmInfo::X86TargetAsmInfo(const X86TargetMachine TM) {
+   const X86Subtarget *Subtarget = TM.getSubtargetX86Subtarget();
+   
+   //FIXME - Should to be simplified.
+
+   switch (Subtarget-TargetType) {
+   case X86Subtarget::isDarwin:
+ AlignmentIsInBytes = false;
+ GlobalPrefix = _;
+ Data64bitsDirective = 0;   // we can't emit a 64-bit unit
+ ZeroDirective = \t.space\t;  // .space N emits N zeros.
+ PrivateGlobalPrefix = L; // Marker for constant pool idxs
+ ConstantPoolSection = \t.const\n;
+ JumpTableDataSection = \t.const\n; // FIXME: depends on PIC mode
+ FourByteConstantSection = \t.literal4\n;
+ EightByteConstantSection = \t.literal8\n;
+ LCOMMDirective = \t.lcomm\t;
+ COMMDirectiveTakesAlignment = false;
+ HasDotTypeDotSizeDirective = false;
+ StaticCtorsSection = .mod_init_func;
+ StaticDtorsSection = .mod_term_func;
+ InlineAsmStart = # InlineAsm Start;
+ InlineAsmEnd = # InlineAsm End;
+ SetDirective = \t.set;
+ 
+ NeedsSet = true;
+ DwarfAbbrevSection = .section __DWARF,__debug_abbrev,regular,debug;
+ DwarfInfoSection = .section __DWARF,__debug_info,regular,debug;
+ DwarfLineSection = .section __DWARF,__debug_line,regular,debug;
+ DwarfFrameSection = .section __DWARF,__debug_frame,regular,debug;
+ DwarfPubNamesSection = .section __DWARF,__debug_pubnames,regular,debug;
+ DwarfPubTypesSection = .section __DWARF,__debug_pubtypes,regular,debug;
+ DwarfStrSection = .section __DWARF,__debug_str,regular,debug;
+ DwarfLocSection = .section __DWARF,__debug_loc,regular,debug;
+ DwarfARangesSection = .section __DWARF,__debug_aranges,regular,debug;
+ DwarfRangesSection = .section __DWARF,__debug_ranges,regular,debug;
+ DwarfMacInfoSection = .section __DWARF,__debug_macinfo,regular,debug;
+ break;
+   case X86Subtarget::isCygwin:
+ GlobalPrefix = _;
+ COMMDirectiveTakesAlignment = false;
+ HasDotTypeDotSizeDirective = false;
+ StaticCtorsSection = \t.section .ctors,\aw\;
+ StaticDtorsSection = \t.section .dtors,\aw\;
+ break;
+   case X86Subtarget::isWindows:
+ GlobalPrefix = _;
+ HasDotTypeDotSizeDirective = false;
+ break;
+   default: break;
+   }
+   
+   if (Subtarget-isFlavorIntel()) {
+ GlobalPrefix = _;
+ CommentString = ;;
+   
+ PrivateGlobalPrefix = $;
+ AlignDirective = \talign\t;
+ ZeroDirective = \tdb\t;
+ ZeroDirectiveSuffix =  dup(0);
+ AsciiDirective = \tdb\t;
+ AscizDirective = 0;
+ Data8bitsDirective = \tdb\t;
+ Data16bitsDirective = \tdw\t;
+ Data32bitsDirective = \tdd\t;
+ Data64bitsDirective = \tdq\t;
+ HasDotTypeDotSizeDirective = false;
+ 
+ TextSection = _text;
+ DataSection = _data;
+ SwitchToSectionDirective = ;
+ TextSectionStartSuffix = \tsegment 'CODE';
+ DataSectionStartSuffix = \tsegment 'DATA';
+ SectionEndDirectiveSuffix = \tends\n;
+   }
+ }


Index: llvm/lib/Target/X86/X86TargetAsmInfo.h
diff -c /dev/null llvm/lib/Target/X86/X86TargetAsmInfo.h:1.1
*** /dev/null   Thu Sep  7 17:05:20 2006
--- llvm/lib/Target/X86/X86TargetAsmInfo.h  Thu Sep  7 17:05:02 2006
***
*** 0 
--- 1,31 
+ //=-- X86TargetAsmInfo.h - X86 asm properties -*- C++ 
-*--//
+ //
+ // The LLVM Compiler Infrastructure
+ //
+ // This file was developed by James M. Laskey and is distributed under the
+ // University of Illinois Open Source License. See LICENSE.TXT for details.
+ //
+ 
//===--===//
+ //
+ // This