[llvm-commits] [llvm-gcc-4.2] r48508 - /llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
Dale Johannesen
dalej at apple.com
Tue Mar 18 15:21:42 PDT 2008
Author: johannes
Date: Tue Mar 18 17:21:41 2008
New Revision: 48508
URL: http://llvm.org/viewvc/llvm-project?rev=48508&view=rev
Log:
Handle some generic vectors in gcc-compatible fashion.
Modified:
llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
Modified: llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h
URL: http://llvm.org/viewvc/llvm-project/llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h?rev=48508&r1=48507&r2=48508&view=diff
==============================================================================
--- llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h (original)
+++ llvm-gcc-4.2/trunk/gcc/config/i386/llvm-i386-target.h Tue Mar 18 17:21:41 2008
@@ -99,28 +99,39 @@
#endif
/* The MMX vector v1i64 is returned in EAX and EDX on Darwin. Communicate
- this by returning i64 here. */
+ this by returning i64 here. Likewise, (genercic) vectors such as v2i16
+ are returned in EAX. */
#define LLVM_SHOULD_RETURN_VECTOR_AS_SCALAR(X,isBuiltin)\
((TARGET_MACHO && \
!isBuiltin && \
!TARGET_64BIT && \
TREE_CODE(X) == VECTOR_TYPE && \
TYPE_SIZE(X) && \
- TREE_CODE(TYPE_SIZE(X))==INTEGER_CST && \
- TREE_INT_CST_LOW(TYPE_SIZE(X))==64 && \
- TYPE_VECTOR_SUBPARTS(X)==1) ? uint64_type_node : 0)
+ TREE_CODE(TYPE_SIZE(X))==INTEGER_CST) \
+ ? (TREE_INT_CST_LOW(TYPE_SIZE(X))==64 && \
+ TYPE_VECTOR_SUBPARTS(X)==1) \
+ ? uint64_type_node \
+ : (TREE_INT_CST_LOW(TYPE_SIZE(X))==32) \
+ ? uint32_type_node \
+ : 0 \
+ : 0)
/* MMX vectors v2i32, v4i16, v8i8, v2f32 are returned using sret on Darwin
- 32-bit. */
+ 32-bit. Vectors bigger than 128 are returned using sret. */
#define LLVM_SHOULD_RETURN_VECTOR_AS_SHADOW(X,isBuiltin)\
((TARGET_MACHO && \
!isBuiltin && \
!TARGET_64BIT && \
TREE_CODE(X) == VECTOR_TYPE && \
TYPE_SIZE(X) && \
- TREE_CODE(TYPE_SIZE(X))==INTEGER_CST && \
- TREE_INT_CST_LOW(TYPE_SIZE(X))==64 && \
- TYPE_VECTOR_SUBPARTS(X)>1) ? true : false)
+ TREE_CODE(TYPE_SIZE(X))==INTEGER_CST) \
+ ? (TREE_INT_CST_LOW(TYPE_SIZE(X))==64 && \
+ TYPE_VECTOR_SUBPARTS(X)>1) \
+ ? true \
+ : (TREE_INT_CST_LOW(TYPE_SIZE(X))>128) \
+ ? true \
+ : false \
+ : false)
extern bool llvm_x86_should_pass_aggregate_in_memory(tree, const Type *);
More information about the llvm-commits
mailing list