mirror of
https://github.com/capstone-engine/llvm-capstone.git
synced 2025-03-04 00:20:14 +00:00
Add assembly.h for use in .S files.
llvm-svn: 85263
This commit is contained in:
parent
805c49408f
commit
7d50478889
@ -17,6 +17,6 @@ ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
|
||||
Target := Optimized
|
||||
|
||||
# FIXME: use automatic dependencies?
|
||||
Dependencies := $(wildcard $(Dir)/*.h)
|
||||
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)
|
||||
|
||||
include make/subdir.mk
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// double __adddf3vfp(double a, double b) { return a + b; }
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __addsf3vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern uint64_t __bswapdi2(uint64_t);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern uint32_t __bswapsi2(uint32_t);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __divdf3vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __divsf3vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __eqdf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __eqsf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __extendsfdf2vfp(float a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __fixdfsivfp(double a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __fixsfsivfp(float a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern unsigned int __fixunsdfsivfp(double a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern unsigned int __fixunssfsivfp(float a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __floatsidfvfp(int a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __floatsisfvfp(int a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __floatunssidfvfp(unsigned int a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __floatunssisfvfp(unsigned int a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __gedf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __gesf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __gtdf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __gtsf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __ledf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __lesf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __ltdf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __ltsf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __muldf3vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __mulsf3vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __nedf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __negdf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __negsf2vfp(float a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __nesf2vfp(float a, float b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern double __subdf3vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __subsf3vfp(float a, float b);
|
||||
|
@ -7,6 +7,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// When compiling switch statements in thumb mode, the compiler
|
||||
// can use these __switch* helper functions The compiler emits a blx to
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern float __truncdfsf2vfp(double a);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __unorddf2vfp(double a, double b);
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// extern int __unordsf2vfp(float a, float b);
|
||||
|
42
compiler-rt/lib/assembly.h
Normal file
42
compiler-rt/lib/assembly.h
Normal file
@ -0,0 +1,42 @@
|
||||
/* ===-- assembly.h - compiler-rt assembler support macros -----------------===
|
||||
*
|
||||
* The LLVM Compiler Infrastructure
|
||||
*
|
||||
* This file is distributed under the University of Illinois Open Source
|
||||
* License. See LICENSE.TXT for details.
|
||||
*
|
||||
* ===----------------------------------------------------------------------===
|
||||
*
|
||||
* This file defines macros for use in compiler-rt assembler source.
|
||||
* This file is not part of the interface of this library.
|
||||
*
|
||||
* ===----------------------------------------------------------------------===
|
||||
*/
|
||||
|
||||
#ifndef COMPILERRT_ASSEMBLY_H
|
||||
#define COMPILERRT_ASSEMBLY_H
|
||||
|
||||
// Define SYMBOL_NAME to add the appropriate symbol prefix; we can't use
|
||||
// USER_LABEL_PREFIX directly because of cpp brokenness.
|
||||
#if defined(__POWERPC__) || defined(__powerpc__) || defined(__ppc__)
|
||||
|
||||
#define SYMBOL_NAME(name) name
|
||||
#define SEPARATOR @
|
||||
|
||||
#else
|
||||
|
||||
#define SYMBOL_NAME(name) _##name
|
||||
#define SEPARATOR ;
|
||||
|
||||
#endif
|
||||
|
||||
#define DEFINE_COMPILERRT_FUNCTION(name) \
|
||||
.globl SYMBOL_NAME(name) SEPARATOR \
|
||||
SYMBOL_NAME(name):
|
||||
|
||||
#define DEFINE_COMPILERRT_PRIVATE_FUNCTION(name) \
|
||||
.globl SYMBOL_NAME(name) SEPARATOR \
|
||||
.private_extern SYMBOL_NAME(name) SEPARATOR \
|
||||
SYMBOL_NAME(name):
|
||||
|
||||
#endif /* COMPILERRT_ASSEMBLY_H */
|
@ -17,6 +17,6 @@ ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
|
||||
Target := Optimized
|
||||
|
||||
# FIXME: use automatic dependencies?
|
||||
Dependencies := $(wildcard $(Dir)/*.h)
|
||||
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)
|
||||
|
||||
include make/subdir.mk
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __ashldi3(di_int input, int count);
|
||||
|
||||
// This routine has some extra memory traffic, loading the 64-bit input via two
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __ashrdi3(di_int input, int count);
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __divdi3(di_int a, di_int b);
|
||||
|
||||
// result = a / b.
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// double __floatundidf(du_int a);
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// float __floatdisf(di_int a);
|
||||
|
||||
// This routine has some extra memory traffic, loading the 64-bit input via two
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// float __floatdixf(di_int a);
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -11,6 +11,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// double __floatundidf(du_int a);
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// float __floatundisf(du_int a);
|
||||
|
||||
// Note that there is a hardware instruction, fildll, that does most of what
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// long double __floatundixf(du_int a);16
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __lshrdi3(di_int input, int count);
|
||||
|
||||
// This routine has some extra memory traffic, loading the 64-bit input via two
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __moddi3(di_int a, di_int b);
|
||||
|
||||
// result = remainder of a / b.
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// di_int __muldi3(di_int a, di_int b);
|
||||
|
||||
#ifdef __i386__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// du_int __udivdi3(du_int a, du_int b);
|
||||
|
||||
// result = a / b.
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// du_int __umoddi3(du_int a, du_int b);
|
||||
|
||||
// result = remainder of a / b.
|
||||
|
@ -17,6 +17,6 @@ ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
|
||||
Target := Optimized
|
||||
|
||||
# FIXME: use automatic dependencies?
|
||||
Dependencies := $(wildcard $(Dir)/*.h)
|
||||
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)
|
||||
|
||||
include make/subdir.mk
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// Helper function used by compiler to restore ppc floating point registers at
|
||||
|
@ -7,6 +7,7 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
//
|
||||
// Helper function used by compiler to save ppc floating point registers in
|
||||
|
@ -17,6 +17,6 @@ ObjNames := $(Sources:%.c=%.o) $(AsmSources:%.S=%.o)
|
||||
Target := Optimized
|
||||
|
||||
# FIXME: use automatic dependencies?
|
||||
Dependencies := $(wildcard $(Dir)/*.h)
|
||||
Dependencies := $(wildcard lib/*.h $(Dir)/*.h)
|
||||
|
||||
include make/subdir.mk
|
||||
|
@ -11,6 +11,8 @@
|
||||
//
|
||||
//===----------------------------------------------------------------------===//
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// double __floatundidf(du_int a);
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// float __floatundisf(du_int a);
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
@ -1,6 +1,8 @@
|
||||
// This file is distributed under the University of Illinois Open Source
|
||||
// License. See LICENSE.TXT for details.
|
||||
|
||||
#include "../assembly.h"
|
||||
|
||||
// long double __floatundixf(du_int a);
|
||||
|
||||
#ifdef __x86_64__
|
||||
|
Loading…
x
Reference in New Issue
Block a user