Fix up documentation
authorDavid Schleef <ds@schleef.org>
Fri, 29 May 2009 01:04:06 +0000 (18:04 -0700)
committerDavid Schleef <ds@schleef.org>
Fri, 29 May 2009 01:04:06 +0000 (18:04 -0700)
32 files changed:
configure.ac
doc/orc-docs.sgml
doc/orc-sections.txt
orc-pixel/orcpixel.c
orc/Makefile.am
orc/orcarm.c
orc/orcarm.h
orc/orccompiler.c
orc/orccpu-arm.c
orc/orccpu-misc.c [deleted file]
orc/orccpu-x86.c
orc/orccpu.c [deleted file]
orc/orccpu.h [deleted file]
orc/orcdebug.c
orc/orcdebug.h
orc/orcexecutor.c
orc/orcmmx.c
orc/orcmmx.h
orc/orcopcodes.c
orc/orcparse.c
orc/orcprogram-arm.c
orc/orcprogram-mmx.c
orc/orcprogram-sse.c
orc/orcprogram.c
orc/orcprogram.h
orc/orcrule.c
orc/orcsse.c
orc/orcsse.h
orc/orcutils.c
orc/orcutils.h
orc/orcx86.c
orc/orcx86.h

index 7ddb7bd..73d5e59 100644 (file)
@@ -100,7 +100,7 @@ esac
 
 AC_DEFINE(ORC_EXPORTS, 1, [Defined for compiling internal code])
 
-ORC_CFLAGS="$ORC_CFLAGS -I\$(top_srcdir) -DORC_ENABLE_UNSTABLE_API"
+ORC_CFLAGS="$ORC_CFLAGS -I\$(top_srcdir)"
 AC_SUBST(ORC_CFLAGS)
 
 ORC_LIBS="\$(top_builddir)/orc/liborc-$ORC_MAJORMINOR.la $LIBM $LIBRT"
index 7b0ce3c..d3e97b1 100644 (file)
   </bookinfo>
 
   <chapter>
-    <title>[Insert title here]</title>
+    <title>Application API</title>
+    <xi:include href="xml/orc.xml"/>
     <xi:include href="xml/orcprogram.xml"/>
-    <xi:include href="xml/x86.xml"/>
+    <xi:include href="xml/orccompiler.xml"/>
+    <xi:include href="xml/orcexecutor.xml"/>
+  </chapter>
+  <chapter>
+    <title>Extension API</title>
+    <xi:include href="xml/orcdebug.xml"/>
+    <xi:include href="xml/orcopcode.xml"/>
+    <xi:include href="xml/orcutils.xml"/>
+    <xi:include href="xml/orcrule.xml"/>
+  </chapter>
+  <chapter>
+    <title>Code Generation</title>
+    <xi:include href="xml/orcarm.xml"/>
+    <xi:include href="xml/orcmmx.xml"/>
+    <xi:include href="xml/orcsse.xml"/>
+    <xi:include href="xml/orcx86.xml"/>
+  </chapter>
+  <chapter>
+    <title>Herein lie dragons</title>
+    <xi:include href="xml/misc.xml"/>
   </chapter>
 </book>
index 6527a7c..0701036 100644 (file)
@@ -12,43 +12,36 @@ ORC_N_TARGETS
 ORC_PROGRAM_ERROR
 orc_program_new
 orc_program_new_dss
-orc_program_append
-orc_program_append_str
-orc_program_compile
-orc_program_x86_init
-orc_program_powerpc_init
-orc_program_assemble_x86
-orc_program_assemble_powerpc
-orc_program_assemble_c
+orc_program_new_as
+orc_program_new_ass
+orc_program_new_ds
 orc_program_free
-orc_program_find_var_by_name
+orc_program_get_name
+orc_program_set_name
+
 orc_program_add_temporary
-orc_program_dup_temporary
 orc_program_add_source
 orc_program_add_destination
 orc_program_add_constant
-orc_program_x86_reset_alloc
-orc_program_powerpc_reset_alloc
-orc_program_allocate_register
-orc_program_x86_allocate_register
-orc_program_powerpc_allocate_register
-orc_program_x86_register_rules
-orc_program_allocate_codemem
-orc_program_dump_code
 orc_program_add_accumulator
 orc_program_add_parameter
+
+orc_program_append
+orc_program_append_str
 orc_program_append_ds
 orc_program_append_ds_str
+
+orc_program_compile
 orc_program_compile_for_target
 orc_program_compile_full
-orc_program_dump_asm
+
 orc_program_get_asm_code
+
+<SUBSECTION>
+orc_program_find_var_by_name
+orc_program_allocate_register
 orc_program_get_max_var_size
-orc_program_get_name
-orc_program_new_as
-orc_program_new_ass
-orc_program_new_ds
-orc_program_set_name
+orc_program_dup_temporary
 </SECTION>
 
 <SECTION>
@@ -69,11 +62,8 @@ ORC_WRITE_UINT32_LE
 
 <SECTION>
 <FILE>misc</FILE>
-OrcType
 OrcVariable
-OrcArgument
 OrcInstruction
-OrcRegister
 OrcRule
 OrcFixup
 OrcRuleEmitFunc
@@ -84,19 +74,21 @@ ORC_N_REGISTERS
 ORC_N_FIXUPS
 ORC_N_LABELS
 ORC_GP_REG_BASE
-ORC_VEC1_REG_BASE
-ORC_VEC2_REG_BASE
-ORC_REGCLASS_GP
+ORC_VEC_REG_BASE
 ORC_STRUCT_OFFSET
 OrcVarType
-orc_type_get
-orc_type_register
-orc_variable_get_size
-orc_x86_init
 orc_powerpc_init
 orc_arm_init
 orc_c_init
 orc_parse
+ARRAY_SIZE
+MAX
+MIN
+get_cpuinfo_line
+get_file
+get_file_int
+get_tag_value
+strsplit
 </SECTION>
 
 <SECTION>
@@ -109,6 +101,7 @@ ORC_WARNING
 ORC_INFO
 ORC_DEBUG
 ORC_LOG
+ORC_FUNCTION
 orc_debug_get_level
 orc_debug_print
 orc_debug_set_level
@@ -119,6 +112,7 @@ orc_debug_set_print_function
 <FILE>orccompiler</FILE>
 OrcCompileResult
 OrcCompiler
+OrcConstant
 ORC_COMPILER_ERROR
 ORC_COMPILE_RESULT_IS_FATAL
 ORC_COMPILE_RESULT_IS_SUCCESSFUL
@@ -132,7 +126,6 @@ orc_compiler_label_new
 
 <SECTION>
 <FILE>orcopcode</FILE>
-OrcOpcode
 OrcOpcodeEmulateFunc
 OrcOpcodeExecutor
 OrcOpcodeSet
@@ -140,7 +133,6 @@ OrcRuleSet
 OrcStaticOpcode
 OrcTarget
 ORC_OPCODE_N_ARGS
-ORC_OPCODE_N_RULES
 ORC_STATIC_OPCODE_ACCUMULATOR
 ORC_STATIC_OPCODE_N_DEST
 ORC_STATIC_OPCODE_N_SRC
@@ -232,6 +224,7 @@ orc_x86_get_regname_mmx
 orc_x86_get_regname_ptr
 orc_x86_get_regname_sse
 orc_x86_get_regnum
+orc_x86_do_fixups
 </SECTION>
 
 <SECTION>
@@ -277,24 +270,9 @@ orc_mmx_init
 
 <SECTION>
 <FILE>orcarm</FILE>
-ORC_ARM_A1
-ORC_ARM_A2
-ORC_ARM_A3
-ORC_ARM_A4
-ORC_ARM_IP
-ORC_ARM_LR
-ORC_ARM_PC
-ORC_ARM_R0
-ORC_ARM_SB
-ORC_ARM_SP
-ORC_ARM_V1
-ORC_ARM_V2
-ORC_ARM_V3
-ORC_ARM_V4
-ORC_ARM_V5
-ORC_ARM_V6
-ORC_ARM_V7
-ORC_ARM_V8
+OrcArmCond
+OrcArmDP
+OrcArmRegister
 orc_arm_do_fixups
 orc_arm_emit
 orc_arm_emit_add
index 3508812..da38b8c 100644 (file)
@@ -20,6 +20,9 @@ orc_pixel_init (void)
   orc_pixel_sse_register_rules ();
 }
 
+#ifndef ORC_CLAMP
+#define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
+#endif
 
 #define COMPOSITE_OVER(d,s,m) ((d) + (s) - ORC_MULDIV_255((d),(m)))
 #define COMPOSITE_ADD(d,s) ORC_CLAMP((d) + (s), 0, 255)
index b7ab486..7cea88d 100644 (file)
@@ -6,7 +6,8 @@ lib_LTLIBRARIES = liborc-@ORC_MAJORMINOR@.la
 liborc_@ORC_MAJORMINOR@_la_LIBS = $(ORC_LIBS)
 liborc_@ORC_MAJORMINOR@_la_LDFLAGS = \
        -no-undefined -export-symbols-regex 'orc_'
-liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS)
+liborc_@ORC_MAJORMINOR@_la_CFLAGS = $(ORC_CFLAGS) \
+       -DORC_ENABLE_UNSTABLE_API
 
 liborc_@ORC_MAJORMINOR@_la_SOURCES = \
        orc.c \
@@ -27,7 +28,6 @@ liborc_@ORC_MAJORMINOR@_la_SOURCES = \
        orcrules-sse.c \
        orcrules-arm.c \
        orcdebug.c \
-       orccpu.c \
        orcutils.c \
        orcsse.c \
        orcmmx.c \
@@ -36,20 +36,15 @@ liborc_@ORC_MAJORMINOR@_la_SOURCES = \
 
 if HAVE_I386
 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c
-else
+endif
 if HAVE_AMD64
 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-x86.c
-else
+endif
 if HAVE_POWERPC
 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-powerpc.c
-else
+endif
 if HAVE_ARM
 liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-arm.c
-else
-liborc_@ORC_MAJORMINOR@_la_SOURCES += orccpu-misc.c
-endif
-endif
-endif
 endif
 
 pkginclude_HEADERS = \
@@ -58,7 +53,6 @@ pkginclude_HEADERS = \
        orcprogram.h \
        orcutils.h \
        orcparse.h \
-       orccpu.h \
        opcodes.h \
        orcsse.h \
        orcmmx.h \
index 85ed76d..a19dc99 100644 (file)
 #include <orc/orcarm.h>
 #include <orc/orcutils.h>
 
+/**
+ * SECTION:orcarm
+ * @title: ARM
+ * @short_description: code generation for ARM
+ */
+
 
 const char *
 orc_arm_reg_name (int reg)
index 82c237a..e1f7dd3 100644 (file)
@@ -4,28 +4,27 @@
 
 #include <orc/orcprogram.h>
 
-#define ORC_ARM_R0 (ORC_GP_REG_BASE+0)
-
-#define ORC_ARM_A1 (ORC_GP_REG_BASE+0)
-#define ORC_ARM_A2 (ORC_GP_REG_BASE+1)
-#define ORC_ARM_A3 (ORC_GP_REG_BASE+2)
-#define ORC_ARM_A4 (ORC_GP_REG_BASE+3)
-#define ORC_ARM_V1 (ORC_GP_REG_BASE+4)
-#define ORC_ARM_V2 (ORC_GP_REG_BASE+5)
-#define ORC_ARM_V3 (ORC_GP_REG_BASE+6)
-#define ORC_ARM_V4 (ORC_GP_REG_BASE+7)
-#define ORC_ARM_V5 (ORC_GP_REG_BASE+8)
-#define ORC_ARM_V6 (ORC_GP_REG_BASE+9)
-#define ORC_ARM_V7 (ORC_GP_REG_BASE+10)
-#define ORC_ARM_V8 (ORC_GP_REG_BASE+11)
-#define ORC_ARM_IP (ORC_GP_REG_BASE+12)
-#define ORC_ARM_SP (ORC_GP_REG_BASE+13)
-#define ORC_ARM_LR (ORC_GP_REG_BASE+14)
-#define ORC_ARM_PC (ORC_GP_REG_BASE+15)
-
-#define ORC_ARM_SB (ORC_GP_REG_BASE+9)
-
-enum {
+
+typedef enum {
+  ORC_ARM_A1 = ORC_GP_REG_BASE+0,
+  ORC_ARM_A2,
+  ORC_ARM_A3,
+  ORC_ARM_A4,
+  ORC_ARM_V1,
+  ORC_ARM_V2,
+  ORC_ARM_V3,
+  ORC_ARM_V4,
+  ORC_ARM_V5,
+  ORC_ARM_V6,
+  ORC_ARM_V7,
+  ORC_ARM_V8,
+  ORC_ARM_IP,
+  ORC_ARM_SP,
+  ORC_ARM_LR,
+  ORC_ARM_PC
+} OrcArmRegister;
+
+typedef enum {
   ORC_ARM_DP_AND = 0,
   ORC_ARM_DP_EOR,
   ORC_ARM_DP_SUB,
@@ -42,9 +41,9 @@ enum {
   ORC_ARM_DP_MOV,
   ORC_ARM_DP_BIC,
   ORC_ARM_DP_MVN
-};
+} OrcArmDP;
 
-enum {
+typedef enum {
   ORC_ARM_COND_EQ = 0,
   ORC_ARM_COND_NE,
   ORC_ARM_COND_CS,
@@ -60,7 +59,7 @@ enum {
   ORC_ARM_COND_GT,
   ORC_ARM_COND_LE,
   ORC_ARM_COND_AL,
-};
+} OrcArmCond;
 
 void orc_arm_emit (OrcCompiler *compiler, uint32_t insn);
 void orc_arm_emit_bx_lr (OrcCompiler *compiler);
index a2bb76b..905affb 100644 (file)
@@ -9,6 +9,12 @@
 #include <orc/orcprogram.h>
 #include <orc/orcdebug.h>
 
+/**
+ * SECTION:orccompiler
+ * @title: OrcCompiler
+ * @short_description: Compile Orc programs
+ */
+
 void orc_compiler_assign_rules (OrcCompiler *compiler);
 void orc_compiler_global_reg_alloc (OrcCompiler *compiler);
 void orc_compiler_rewrite_vars (OrcCompiler *compiler);
index 94f92c5..3819833 100644 (file)
@@ -28,7 +28,7 @@
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
-#include <orc/orccpu.h>
+#include <orc/orcarm.h>
 #include <orc/orcutils.h>
 #include <orc/orcdebug.h>
 
diff --git a/orc/orccpu-misc.c b/orc/orccpu-misc.c
deleted file mode 100644 (file)
index 97b740c..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*
- * LIBOIL - Library of Optimized Inner Loops
- * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <liboil/liboilfunction.h>
-#include <liboil/liboildebug.h>
-#include <liboil/liboilcpu.h>
-#include <liboil/liboilfault.h>
-#include <liboil/liboilutils.h>
-
-#include <unistd.h>
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <setjmp.h>
-#include <signal.h>
-#include <sys/time.h>
-#include <time.h>
-
-/***** alpha *****/
-
-#if defined(__alpha__)
-static unsigned long
-oil_profile_stamp_alpha(void)
-{
-  unsigned int ts;
-  __asm__ __volatile__ ("rpcc %0\n" : "=r"(ts));
-  return ts;
-}
-
-static void
-oil_cpu_detect_alpha(void)
-{
-  _oil_profile_stamp = oil_profile_stamp_alpha;
-}
-#endif
-
-/***** ia64 *****/
-
-#if defined(__ia64__)
-static unsigned long
-oil_profile_stamp_ia64(void)
-{
-  unsigned int ts;
-  __asm__ __volatile__("mov %0=ar.itc\n" : "=r"(ts) :: "memory");
-  return ts;
-}
-
-static void
-oil_cpu_detect_ia64(void)
-{
-  _oil_profile_stamp = oil_profile_stamp_ia64;
-}
-#endif
-
-/***** s390 *****/
-
-#if defined(__s390__)
-static unsigned long
-oil_profile_stamp_s390(void)
-{
-  uint64_t ts;
-  __asm__ __volatile__ ("STCK %0(%0)\n" : : "r" (&ts));
-  return ts;
-}
-
-static void
-oil_cpu_detect_s390(void)
-{
-  _oil_profile_stamp = oil_profile_stamp_s390;
-}
-#endif
-
-/***** mips *****/
-
-#if defined(__mips__)
-#if 0
-/* broken */
-static unsigned long
-oil_profile_stamp_mips(void)
-{
-       unsigned int ts;
-       __asm__ __volatile__ (
-               "       .set    push            \n"
-               "       .set    reorder         \n"
-               "       mfc0    %0,$9           \n"
-               "       .set    pop             \n"
-       : "=m" (ts));
-       return ts;
-}
-#endif
-
-static void
-oil_cpu_detect_mips(void)
-{
-  //_oil_profile_stamp = oil_profile_stamp_mips;
-}
-#endif
-
-void
-oil_cpu_detect_arch(void)
-{
-#ifdef __alpha__
-  oil_cpu_detect_alpha();
-#endif
-#ifdef __ia64__
-  oil_cpu_detect_ia64();
-#endif
-#ifdef __s390__
-  oil_cpu_detect_s390();
-#endif
-#ifdef __mips__
-  oil_cpu_detect_mips();
-#endif
-}
-
index be11443..eef2f51 100644 (file)
@@ -29,7 +29,8 @@
 #include "config.h"
 #endif
 #include <orc/orcdebug.h>
-#include <orc/orccpu.h>
+#include <orc/orcsse.h>
+#include <orc/orcmmx.h>
 #include <orc/orcprogram.h>
 #include <orc/orcutils.h>
 
diff --git a/orc/orccpu.c b/orc/orccpu.c
deleted file mode 100644 (file)
index ee5aaaf..0000000
+++ /dev/null
@@ -1,158 +0,0 @@
-/*
- * ORC - Library of Optimized Inner Loops
- * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifdef HAVE_CONFIG_H
-#include "config.h"
-#endif
-#include <orc/orcdebug.h>
-#include <orc/orccpu.h>
-#include <orc/orcutils.h>
-
-#ifdef HAVE_UNISTD_H
-#include <unistd.h>
-#endif
-#include <fcntl.h>
-#include <stdlib.h>
-#include <string.h>
-#include <stdio.h>
-#include <setjmp.h>
-#include <signal.h>
-#ifdef HAVE_SYS_TIME_H
-#include <sys/time.h>
-#endif
-#include <time.h>
-
-#if defined(__FreeBSD__)
-#include <sys/types.h>
-#include <sys/sysctl.h>
-#endif
-
-#ifdef __sun
-#include <sys/auxv.h>
-#endif
-
-
-
-/**
- * SECTION:liborccpu
- * @title: CPU
- * @short_description: Check the capabilities of the current CPU
- *
- */
-
-void orc_cpu_detect_arch(void);
-
-unsigned long orc_cpu_flags;
-
-#if 0
-extern unsigned long (*_orc_profile_stamp)(void);
-#endif
-
-#if 0
-#ifdef HAVE_GETTIMEOFDAY
-static unsigned long
-orc_profile_stamp_gtod (void)
-{
-  struct timeval tv;
-  gettimeofday(&tv,NULL);
-  return 1000000*(unsigned long)tv.tv_sec + (unsigned long)tv.tv_usec;
-}
-#endif
-
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK)
-static unsigned long
-orc_profile_stamp_clock_gettime (void)
-{
-  struct timespec ts;
-  clock_gettime (CLOCK_MONOTONIC, &ts);
-  return 1000000000*ts.tv_sec + ts.tv_nsec;
-}
-#endif
-
-static unsigned long
-orc_profile_stamp_zero (void)
-{
-  return 0;
-}
-#endif
-
-void
-_orc_cpu_init (void)
-{
-  const char *envvar;
-
-  //orc_cpu_detect_arch();
-
-  envvar = getenv ("ORC_CPU_FLAGS");
-  if (envvar != NULL) {
-    char *end = NULL;
-    unsigned long flags;
-
-    flags = strtoul (envvar, &end, 0);
-    if (end > envvar) {
-      orc_cpu_flags = flags;
-    }
-    ORC_INFO ("cpu flags from environment %08lx", orc_cpu_flags);
-  }
-
-  ORC_INFO ("cpu flags %08lx", orc_cpu_flags);
-
-#if 0
-#if defined(HAVE_CLOCK_GETTIME) && defined(HAVE_MONOTONIC_CLOCK)
-  if (_orc_profile_stamp == NULL) {
-    _orc_profile_stamp = orc_profile_stamp_clock_gettime;
-    ORC_INFO("Using clock_gettime() as a timestamp function.");
-  }
-#endif
-
-#ifdef HAVE_GETTIMEOFDAY
-  if (_orc_profile_stamp == NULL) {
-    _orc_profile_stamp = orc_profile_stamp_gtod;
-    ORC_WARNING("Using gettimeofday() as a timestamp function.");
-  }
-#endif
-  if (_orc_profile_stamp == NULL) {
-    _orc_profile_stamp = orc_profile_stamp_zero;
-    ORC_ERROR("No timestamping function.  This is kinda bad.");
-  }
-#endif
-}
-
-/**
- * orc_cpu_get_flags:
- *
- * Returns a bitmask containing the available CPU features.
- *
- * Returns: the CPU features.
- */
-unsigned int
-orc_cpu_get_flags (void)
-{
-  return orc_cpu_flags;
-}
-
-
diff --git a/orc/orccpu.h b/orc/orccpu.h
deleted file mode 100644 (file)
index 4d55e2b..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*
- * ORC - Library of Optimized Inner Loops
- * Copyright (c) 2003,2004 David A. Schleef <ds@schleef.org>
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without
- * modification, are permitted provided that the following conditions
- * are met:
- * 1. Redistributions of source code must retain the above copyright
- *    notice, this list of conditions and the following disclaimer.
- * 2. Redistributions in binary form must reproduce the above copyright
- *    notice, this list of conditions and the following disclaimer in the
- *    documentation and/or other materials provided with the distribution.
- * 
- * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
- * IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
- * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT,
- * INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
- * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
- * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
- * STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
- * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
- * POSSIBILITY OF SUCH DAMAGE.
- */
-
-#ifndef _ORC_CPU_H_
-#define _ORC_CPU_H_
-
-#include <orc/orcutils.h>
-
-ORC_BEGIN_DECLS
-
-#ifdef ORC_ENABLE_UNSTABLE_API
-
-typedef enum {
-  ORC_CPU_FLAG_CMOV = (1<<0),
-  ORC_CPU_FLAG_MMX = (1<<1),
-  ORC_CPU_FLAG_SSE = (1<<2),
-  ORC_CPU_FLAG_MMXEXT = (1<<3),
-  ORC_CPU_FLAG_SSE2 = (1<<4),
-  ORC_CPU_FLAG_3DNOW = (1<<5),
-  ORC_CPU_FLAG_3DNOWEXT = (1<<6),
-  ORC_CPU_FLAG_SSE3 = (1<<7),
-  ORC_CPU_FLAG_ALTIVEC = (1<<8),
-  ORC_CPU_FLAG_EDSP = (1<<9),
-  ORC_CPU_FLAG_ARM6 = (1<<10),
-  ORC_CPU_FLAG_VFP = (1<<11),
-  ORC_CPU_FLAG_SSSE3 = (1<<12)
-} OrcCpuFlag;
-
-unsigned int orc_sse_get_cpu_flags (void);
-unsigned int orc_mmx_get_cpu_flags (void);
-
-void _orc_cpu_init (void);
-
-ORC_EXPORT unsigned long orc_cpu_flags;
-
-#endif
-
-ORC_END_DECLS
-
-#endif
-
index 22b8c9d..38bde6a 100644 (file)
@@ -37,7 +37,7 @@
 
 /**
  * SECTION:orcdebug
- * @title: Debug
+ * @title: OrcDebug
  * @short_description: Printing and formatting debug information
  */
 
index e71ab5c..7964ab6 100644 (file)
@@ -33,8 +33,6 @@
 
 ORC_BEGIN_DECLS
 
-#ifdef ORC_ENABLE_UNSTABLE_API
-
 /**
  * OrcDebugPrintFunc:
  * @level: the debug level
@@ -54,7 +52,7 @@ typedef void (*OrcDebugPrintFunc) (int level, const char *file,
 /**
  * OrcDebugLevel:
  *
- * Enumeration describing debug levels in Liborc.
+ * Enumeration describing debug levels in Orc.
  */
 typedef enum {
   ORC_DEBUG_NONE = 0,
@@ -138,8 +136,6 @@ void _orc_debug_init (void);
 void orc_debug_print (int level, const char *file, const char *func,
     int line, const char *format, ...);
 
-#endif
-
 ORC_END_DECLS
 
 #endif
index a142330..1b25773 100644 (file)
@@ -8,6 +8,12 @@
 #include <orc/orcprogram.h>
 #include <orc/orcdebug.h>
 
+/**
+ * SECTION:orcexecutor
+ * @title: OrcExecutor
+ * @short_description: Running Orc programs
+ */
+
 
 OrcExecutor *
 orc_executor_new (OrcProgram *program)
index b07c163..1091fcb 100644 (file)
 #include <orc/orcdebug.h>
 #include <orc/orcmmx.h>
 
+/**
+ * SECTION:orcmmx
+ * @title: MMX
+ * @short_description: code generation for MMX
+ */
+
 
 const char *
 orc_x86_get_regname_mmx(int i)
index 631d929..ca5152c 100644 (file)
@@ -44,6 +44,7 @@ void orc_mmx_emit_0f (OrcCompiler *p, const char *insn_name, int code,
 void orc_mmx_emit_pshufw (OrcCompiler *p, int shuf, int src, int dest);
 void orc_mmx_emit_shiftimm (OrcCompiler *p, const char *insn_name,
     int code, int modrm_code, int shift, int reg);
+unsigned int orc_mmx_get_cpu_flags (void);
 
 #endif
 
index 20679cf..7a42586 100644 (file)
@@ -8,6 +8,12 @@
 #include <orc/orcprogram.h>
 #include <orc/orcdebug.h>
 
+/**
+ * SECTION:orcopcode
+ * @title: OrcOpcode
+ * @short_description: Operations
+ */
+
 
 static OrcOpcodeSet *opcode_sets;
 static int n_opcode_sets;
index 0c25c85..5f3af6f 100644 (file)
 #include <stdlib.h>
 #include <stdio.h>
 
+/**
+ * SECTION:orcparse
+ * @title: Parser
+ * @short_description: Parse Orc source code
+ */
+
 
 typedef struct _OrcParser OrcParser;
 struct _OrcParser {
index 2f5a108..84e9c9f 100644 (file)
@@ -15,7 +15,7 @@
 
 #define SIZE 65536
 
-int orc_arm_exec_ptr = ORC_ARM_R0;
+int orc_arm_exec_ptr = ORC_ARM_A1;
 
 void orc_arm_emit_loop (OrcCompiler *compiler);
 
@@ -119,7 +119,7 @@ orc_compiler_orc_arm_init (OrcCompiler *compiler)
   for(i=ORC_GP_REG_BASE;i<ORC_GP_REG_BASE+9;i++){
     compiler->valid_regs[i] = 1;
   }
-  compiler->valid_regs[ORC_ARM_R0] = 0;
+  compiler->valid_regs[ORC_ARM_A1] = 0;
   //compiler->valid_regs[ORC_ARM_SB] = 0;
   compiler->valid_regs[ORC_ARM_IP] = 0;
   compiler->valid_regs[ORC_ARM_SP] = 0;
index 564f504..c791055 100644 (file)
@@ -13,7 +13,6 @@
 #include <orc/orcmmx.h>
 #include <orc/orcutils.h>
 #include <orc/orcdebug.h>
-#include <orc/orccpu.h>
 
 #define SIZE 65536
 
@@ -522,7 +521,7 @@ orc_compiler_mmx_assemble (OrcCompiler *compiler)
 
   orc_x86_emit_epilogue (compiler);
 
-  x86_do_fixups (compiler);
+  orc_x86_do_fixups (compiler);
 }
 
 void
index 6710754..1fb6d6f 100644 (file)
@@ -13,7 +13,6 @@
 #include <orc/orcsse.h>
 #include <orc/orcutils.h>
 #include <orc/orcdebug.h>
-#include <orc/orccpu.h>
 
 #define SIZE 65536
 
@@ -521,7 +520,7 @@ orc_compiler_sse_assemble (OrcCompiler *compiler)
 
   orc_x86_emit_epilogue (compiler);
 
-  x86_do_fixups (compiler);
+  orc_x86_do_fixups (compiler);
 }
 
 void
index 2e9cddf..2114382 100644 (file)
@@ -9,6 +9,12 @@
 #include <orc/orcprogram.h>
 #include <orc/orcdebug.h>
 
+/**
+ * SECTION:orcprogram
+ * @title: OrcProgram
+ * @short_description: Creating and manipulating Orc programs
+ */
+
 
 OrcProgram *
 orc_program_new (void)
index 7bc33a9..105fbcc 100644 (file)
@@ -33,9 +33,6 @@ typedef void (*OrcRuleEmitFunc)(OrcCompiler *p, void *user, OrcInstruction *insn
 #define ORC_GP_REG_BASE 32
 #define ORC_VEC_REG_BASE 64
 
-#define ORC_REGCLASS_GP 1
-#define ORC_REGCLASS_VEC 2
-
 #define ORC_STATIC_OPCODE_N_SRC 4
 #define ORC_STATIC_OPCODE_N_DEST 2
 
@@ -400,10 +397,6 @@ int orc_program_add_constant (OrcProgram *program, int size, int value, const ch
 int orc_program_add_parameter (OrcProgram *program, int size, const char *name);
 int orc_program_add_accumulator (OrcProgram *program, int size, const char *name);
 
-void orc_program_x86_reset_alloc (OrcProgram *program);
-void orc_program_powerpc_reset_alloc (OrcProgram *program);
-
-
 OrcExecutor * orc_executor_new (OrcProgram *program);
 void orc_executor_free (OrcExecutor *ex);
 void orc_executor_set_program (OrcExecutor *ex, OrcProgram *program);
@@ -432,16 +425,11 @@ unsigned int orc_target_get_default_flags (OrcTarget *target);
 const char * orc_target_get_name (OrcTarget *target);
 
 int orc_program_allocate_register (OrcProgram *program, int is_data);
-int orc_program_x86_allocate_register (OrcProgram *program, int is_data);
-int orc_program_powerpc_allocate_register (OrcProgram *program, int is_data);
 
-void orc_program_x86_register_rules (void);
 void orc_compiler_allocate_codemem (OrcCompiler *compiler);
-void orc_program_dump_code (OrcProgram *program);
 int orc_compiler_label_new (OrcCompiler *compiler);
 
 const char *orc_program_get_asm_code (OrcProgram *program);
-void orc_program_dump_asm (OrcProgram *program);
 const char *orc_target_get_asm_preamble (const char *target);
 
 void orc_compiler_append_code (OrcCompiler *p, const char *fmt, ...)
index d2f676d..de57f78 100644 (file)
@@ -8,6 +8,12 @@
 #include <orc/orcprogram.h>
 #include <orc/orcdebug.h>
 
+/**
+ * SECTION:orcrule
+ * @title: OrcRule
+ * @short_description: Creating rules for code generation
+ */
+
 
 void
 orc_rule_register (OrcRuleSet *rule_set,
index aa68909..ed19339 100644 (file)
 #include <orc/orcdebug.h>
 #include <orc/orcsse.h>
 
+/**
+ * SECTION:orcsse
+ * @title: SSE
+ * @short_description: code generation for SSE
+ */
+
 
 const char *
 orc_x86_get_regname_sse(int i)
index 3d18529..c6cf594 100644 (file)
@@ -54,6 +54,7 @@ void orc_sse_emit_pshuflw (OrcCompiler *p, int shuf, int src, int dest);
 void orc_sse_emit_shiftimm (OrcCompiler *p, const char *insn_name,
     int code, int modrm_code, int shift, int reg);
 
+unsigned int orc_sse_get_cpu_flags (void);
 
 #endif
 
index 39aa909..82d9aff 100644 (file)
 #include <stdlib.h>
 #include <string.h>
 
+/**
+ * SECTION:orcutils
+ * @title: Utility functions
+ * @short_description: Orc utility functions
+ */
+
 int
 get_file_int (const char *file, int *value)
 {
index 31b685e..79ad8e1 100644 (file)
@@ -42,7 +42,6 @@ typedef unsigned int orc_bool;
 #ifdef ORC_ENABLE_UNSTABLE_API
 
 #define ARRAY_SIZE(x) (sizeof(x)/sizeof(x[0]))
-#define DIVIDE_ROUND_UP(a,b) (((a) + (b) - 1)/(b))
 #ifndef MIN
 #define MIN(a,b) ((a)<(b) ? (a) : (b))
 #endif
@@ -53,12 +52,6 @@ typedef unsigned int orc_bool;
 #define ORC_CLAMP(x,a,b) ((x)<(a) ? (a) : ((x)>(b) ? (b) : (x)))
 #endif
 #define ORC_PTR_TO_INT(x) ((int)(long)(x))
-#define ROUND_UP_SHIFT(x,y) (((x) + (1<<(y)) - 1)>>(y))
-#define ROUND_UP_POW2(x,y) (((x) + (1<<(y)) - 1)&((~0)<<(y)))
-#define ROUND_UP_2(x) ROUND_UP_POW2(x,1)
-#define ROUND_UP_4(x) ROUND_UP_POW2(x,2)
-#define ROUND_UP_8(x) ROUND_UP_POW2(x,3)
-#define ROUND_SHIFT(x,y) (((x) + (1<<((y)-1)))>>(y))
 
 #define ORC_READ_UINT32_LE(ptr) \
   ((uint32_t)( \
index cd6753e..5c13b86 100644 (file)
 #include <orc/orcutils.h>
 
 
+/**
+ * SECTION:orcx86
+ * @title: x86
+ * @short_description: code generation for x86
+ */
+
 const char *
 orc_x86_get_regname(int i)
 {
@@ -726,7 +732,7 @@ void orc_x86_emit_label (OrcCompiler *compiler, int label)
 }
 
 void
-x86_do_fixups (OrcCompiler *compiler)
+orc_x86_do_fixups (OrcCompiler *compiler)
 {
   int i;
   for(i=0;i<compiler->n_fixups;i++){
@@ -824,43 +830,3 @@ orc_x86_emit_align (OrcCompiler *compiler)
   }
 }
 
-void
-x86_test (OrcCompiler *compiler)
-{
-  int size;
-  int i;
-  int j;
-  int reg;
-
-  for(size=2;size<=4;size+=2) {
-    for(i=0;i<8;i++){
-      reg = ORC_GP_REG_BASE + i;
-      orc_x86_emit_push (compiler, size, reg);
-      orc_x86_emit_pop (compiler, size, reg);
-      orc_x86_emit_mov_imm_reg (compiler, size, 0, reg);
-      orc_x86_emit_mov_imm_reg (compiler, size, 1, reg);
-      orc_x86_emit_mov_imm_reg (compiler, size, 256, reg);
-      orc_x86_emit_dec_memoffset (compiler, size, 0, reg);
-      orc_x86_emit_dec_memoffset (compiler, size, 1, reg);
-      orc_x86_emit_dec_memoffset (compiler, size, 256, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 1, 0, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 1, 1, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 1, 256, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 256, 0, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 256, 1, reg);
-      orc_x86_emit_add_imm_memoffset (compiler, size, 256, 256, reg);
-      for(j=0;j<8;j++){
-        int reg2 = ORC_GP_REG_BASE + j;
-        orc_x86_emit_mov_reg_reg (compiler, size, reg, reg2);
-        orc_x86_emit_mov_memoffset_reg (compiler, size, 0, reg, reg2);
-        orc_x86_emit_mov_memoffset_reg (compiler, size, 1, reg, reg2);
-        orc_x86_emit_mov_memoffset_reg (compiler, size, 256, reg, reg2);
-        orc_x86_emit_mov_reg_memoffset (compiler, size, reg, 0, reg2);
-        orc_x86_emit_mov_reg_memoffset (compiler, size, reg, 1, reg2);
-        orc_x86_emit_mov_reg_memoffset (compiler, size, reg, 256, reg2);
-      }
-    }
-  }
-
-}
-
index 6e27a98..1e70d62 100644 (file)
@@ -58,14 +58,14 @@ void orc_x86_emit_jne (OrcCompiler *compiler, int label);
 void orc_x86_emit_jmp (OrcCompiler *compiler, int label);
 void orc_x86_emit_label (OrcCompiler *compiler, int label);
 void orc_x86_emit_align (OrcCompiler *compiler);
-void x86_do_fixups (OrcCompiler *compiler);
 void orc_x86_emit_prologue (OrcCompiler *compiler);
 void orc_x86_emit_epilogue (OrcCompiler *compiler);
 
 void orc_x86_emit_rex (OrcCompiler *compiler, int size, int reg1, int reg2, int reg3);
 void orc_x86_emit_modrm_memoffset (OrcCompiler *compiler, int reg1, int offset, int reg2);
 void orc_x86_emit_modrm_reg (OrcCompiler *compiler, int reg1, int reg2);
-void x86_test (OrcCompiler *compiler);
+
+void orc_x86_do_fixups (OrcCompiler *compiler);
 
 
 #endif