Alien-LibJIT

 view release on metacpan or  search on metacpan

LICENSE  view on Meta::CPAN

TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

                     END OF TERMS AND CONDITIONS

        Appendix: How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to humanity, the best way to achieve this is to make it
free software which everyone can redistribute and change under these
terms.

  To do so, attach the following notices to the program.  It is safest to
attach them to the start of each source file to most effectively convey
the exclusion of warranty; and each file should have at least the
"copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) 19yy  <name of author>

libjit/COPYING  view on Meta::CPAN

TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.

		     END OF TERMS AND CONDITIONS

	    How to Apply These Terms to Your New Programs

  If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it
free software which everyone can redistribute and change under these terms.

  To do so, attach the following notices to the program.  It is safest
to attach them to the start of each source file to most effectively
convey the exclusion of warranty; and each file should have at least
the "copyright" line and a pointer to where the full notice is found.

    <one line to give the program's name and a brief idea of what it does.>
    Copyright (C) <year>  <name of author>

libjit/dpas/dpas-scanner.l  view on Meta::CPAN

 * Parse a floating-point value.
 */
static jit_nfloat dpas_parse_float(const char *text)
{
	double value = 0.0;
	sscanf(text, "%lf", &value);
	return (jit_nfloat)value;
}

/*
 * Infer the best type for an integer constant.
 */
static void dpas_infer_type(YYSTYPE *lval)
{
	jit_ulong value = lval->int_const.value;
	if(value <= (jit_ulong)(jit_long)jit_max_int)
	{
		lval->int_const.type = jit_type_int;
	}
	else if(value <= (jit_ulong)jit_max_uint)
	{

libjit/dpas/dpas-types.h  view on Meta::CPAN

 * Get the name of a type, for printing in error messages.
 */
char *dpas_type_name(jit_type_t type);

/*
 * Get the name of a type, combined with a variable name.
 */
char *dpas_type_name_with_var(const char *name, jit_type_t type);

/*
 * Promote a numeric type to its best form for arithmetic.  e.g. byte -> int.
 */
jit_type_t dpas_promote_type(jit_type_t type);

/*
 * Infer a common type for a binary operation.  Returns NULL if not possible.
 */
jit_type_t dpas_common_type(jit_type_t type1, jit_type_t type2, int int_only);

/*
 * Create a subrange type.

libjit/include/jit/jit-type.h  view on Meta::CPAN

int jit_type_get_tagged_kind(jit_type_t type) JIT_NOTHROW;
void *jit_type_get_tagged_data(jit_type_t type) JIT_NOTHROW;
void jit_type_set_tagged_data
	(jit_type_t type, void *data, jit_meta_free_func free_func) JIT_NOTHROW;
int jit_type_is_primitive(jit_type_t type) JIT_NOTHROW;
int jit_type_is_struct(jit_type_t type) JIT_NOTHROW;
int jit_type_is_union(jit_type_t type) JIT_NOTHROW;
int jit_type_is_signature(jit_type_t type) JIT_NOTHROW;
int jit_type_is_pointer(jit_type_t type) JIT_NOTHROW;
int jit_type_is_tagged(jit_type_t type) JIT_NOTHROW;
jit_nuint jit_type_best_alignment(void) JIT_NOTHROW;
jit_type_t jit_type_normalize(jit_type_t type) JIT_NOTHROW;
jit_type_t jit_type_remove_tags(jit_type_t type) JIT_NOTHROW;
jit_type_t jit_type_promote_int(jit_type_t type) JIT_NOTHROW;
int jit_type_return_via_pointer(jit_type_t type) JIT_NOTHROW;
int jit_type_has_tag(jit_type_t type, int kind) JIT_NOTHROW;

#ifdef	__cplusplus
};
#endif

libjit/jit/jit-insn.c  view on Meta::CPAN

 * @end deftypefun
@*/
jit_value_t jit_insn_alloca(jit_function_t func, jit_value_t size)
{
	/* Make sure that all deferred pops have been done */
	if(!jit_insn_flush_defer_pop(func, 0))
	{
		return 0;
	}

	/* Round the size to the best alignment boundary on this platform */
	size = jit_insn_convert(func, size, jit_type_nuint, 0);
	size = jit_insn_add
		(func, size, jit_value_create_nint_constant
			(func, jit_type_nuint, JIT_BEST_ALIGNMENT - 1));
	size = jit_insn_and
		(func, size, jit_value_create_nint_constant
			(func, jit_type_nuint, ~((jit_nint)(JIT_BEST_ALIGNMENT - 1))));

	/* Allocate "size" bytes of memory from the stack */
	return apply_unary(func, JIT_OP_ALLOCA, size, jit_type_void_ptr);

libjit/jit/jit-internal.h  view on Meta::CPAN

 * Include varint encoding for bytecode offset data.
 */
#include "jit-varint.h"

#ifdef	__cplusplus
extern	"C" {
#endif

/*
 * The following is some macro magic that attempts to detect
 * the best alignment to use on the target platform.  The final
 * value, "JIT_BEST_ALIGNMENT", will be a compile-time constant.
 */

#define	_JIT_ALIGN_CHECK_TYPE(type,name)	\
	struct _JIT_align_##name {		\
		jit_sbyte pad;			\
		type field;			\
	}

#define	_JIT_ALIGN_FOR_TYPE(name)	\

libjit/jit/jit-reg-alloc.c  view on Meta::CPAN

		}
		else
		{
			reg = -1;
			other_reg = -1;
		}

		/* See if the input value is thrashed by other inputs. The allocator
		   tries to avoid thrashing so it may only take place if the register
		   is assigned explicitly. For x87 registers the problem of thrashing
		   may be best solved with fxch but as the stack registers are never
		   assigned explicitely there is no such problem for them at all. */
		if(reg >= 0)
		{
			if(index != 0 && regs->ternary
			   && !are_values_equal(desc, &regs->descs[0]))
			{
				if(reg == regs->descs[0].reg
				   || reg == regs->descs[0].other_reg
				   || (other_reg >= 0
				       && (other_reg == regs->descs[0].reg

libjit/jit/jit-reg-alloc.c  view on Meta::CPAN

	{
		set_regdesc_register(gen, regs, 0, suitable_reg, suitable_other_reg);
	}
	else
	{
		jit_exception_builtin(JIT_RESULT_COMPILE_ERROR);
	}
}

/*
 * Select the best argument order for binary ops. The posibility to select
 * the order exists only for commutative ops and for some x87 floating point
 * instructions. Those x87 instructions have variants with reversed
 * destination register.
 */
static void
choose_input_order(jit_gencode_t gen, _jit_regs_t *regs)
{
	jit_value_t value;

	value = regs->descs[2].value;

libjit/jit/jit-type.c  view on Meta::CPAN

	{
		return (type->kind >= JIT_TYPE_FIRST_TAGGED);
	}
	else
	{
		return 0;
	}
}

/*@
 * @deftypefun jit_nuint jit_type_best_alignment (void)
 * Get the best alignment value for this platform.
 * @end deftypefun
@*/
jit_nuint jit_type_best_alignment(void)
{
	return JIT_BEST_ALIGNMENT;
}

/*@
 * @deftypefun jit_type_t jit_type_normalize (jit_type_t @var{type})
 * Normalize a type to its basic numeric form.  e.g. "jit_type_nint" is
 * turned into "jit_type_int" or "jit_type_long", depending upon
 * the underlying platform.  Pointers are normalized like "jit_type_nint".
 * If the type does not have a normalized form, it is left unchanged.



( run in 0.615 second using v1.01-cache-2.11-cpan-4e96b696675 )