pike.git
/
src
/
code
/
sparc.c
version
»
Context lines:
10
20
40
80
file
none
3
pike.git/src/code/sparc.c:1:
/* || This file is part of Pike. For copyright information see COPYRIGHT. || Pike is distributed under GPL, LGPL and MPL. See the file COPYING || for more information.
-
|| $Id$
+
*/ /* * Machine code generator for sparc. * * Henrik Grubbström 20010720 */ #include "global.h" #include "svalue.h"
pike.git/src/code/sparc.c:471:
SET_REG(SPARC_REG_I1, x); reg = SPARC_REG_I1; } if (sizeof(INT_TYPE) == 4) { SPARC_STW(reg, SPARC_REG_PIKE_SP, sparc_pike_sp_bias + OFFSETOF(svalue, u.integer), 1); } else { SPARC_STX(reg, SPARC_REG_PIKE_SP, sparc_pike_sp_bias + OFFSETOF(svalue, u.integer), 1); }
-
if (x != type_word) {
+
if (
!type_word) {
+
reg = SPARC_REG_G0;
+
} else if (
x != type_word) {
SET_REG(SPARC_REG_I1, type_word);
-
+
reg = SPARC_REG_I1;
}
-
/*
This is safe since type_word is never zero. */
-
/*
stw %
i1
, [ %pike_sp ] */
-
SPARC_STW(
SPARC_REG_I1
, SPARC_REG_PIKE_SP, sparc_pike_sp_bias, 1);
+
/* stw %
reg
, [ %pike_sp ] */
+
SPARC_STW(
reg
, SPARC_REG_PIKE_SP, sparc_pike_sp_bias, 1);
sparc_pike_sp_bias += sizeof(struct svalue); sparc_codegen_state |= SPARC_CODEGEN_SP_NEEDS_STORE; } static void sparc_clear_string_subtype(void) { LOAD_PIKE_SP(); /* lduh [ %pike_sp, %g0 ], %i0 */ SPARC_LDUH(SPARC_REG_I0, SPARC_REG_PIKE_SP,
-
sparc_pike_sp_bias + OFFSETOF(svalue, type), 1);
+
sparc_pike_sp_bias + OFFSETOF(svalue,
tu.t.
type), 1);
/* subcc %g0, %i0, 8 */ SPARC_SUBcc(SPARC_REG_G0, SPARC_REG_I0, PIKE_T_INT, 1); /* be,a .+8 */ SPARC_BE(8, 1); /* sth %g0, [ %pike_sp, 2 ] */ SPARC_STH(SPARC_REG_G0, SPARC_REG_PIKE_SP,
-
sparc_pike_sp_bias + OFFSETOF(svalue, subtype), 1);
+
sparc_pike_sp_bias + OFFSETOF(svalue,
tu.t.
subtype), 1);
} static void sparc_push_lfun(unsigned int no) { LOAD_PIKE_FP(); LOAD_PIKE_SP(); /* lduw [ %pike_fp, %offset(pike_frame, current_object) ], %pike_obj */ PIKE_LDPTR(SPARC_REG_PIKE_OBJ, SPARC_REG_PIKE_FP, OFFSETOF(pike_frame, current_object), 1); /* stw %pike_obj, [ %pike_sp, %offset(svalue, u.object) ] */
pike.git/src/code/sparc.c:637:
ADD_CALL(sparc_debug_check_registers, 1); #endif /* PIKE_BYTECODE_SPARC64 */ } } #else /* !PIKE_DEBUG */ #define ins_sparc_debug() #endif /* PIKE_DEBUG */ static void low_ins_call(void *addr, int delay_ok, int i_flags) {
+
LOAD_PIKE_INTERPRETER();
SPARC_FLUSH_UNSTORED(); { static int last_prog_id=-1; static size_t last_num_linenumbers=(size_t)~0; if(last_prog_id != Pike_compiler->new_program->id || last_num_linenumbers != Pike_compiler->new_program->num_linenumbers) { last_prog_id=Pike_compiler->new_program->id; last_num_linenumbers = Pike_compiler->new_program->num_linenumbers;
pike.git/src/code/sparc.c:816:
SET_REG(SPARC_REG_O0, c); SET_REG(SPARC_REG_O1, b); low_ins_f_byte(a, 1); return; } #define addstr(s, l) low_my_binary_strcat((s), (l), buf) #define adddata2(s,l) addstr((char *)(s),(l) * sizeof((s)[0]));
+
int sparc_force_fp(void)
+
{
+
return 0;
+
}
+
void sparc_encode_program(struct program *p, struct dynamic_buffer_s *buf) { size_t prev = 0, rel; /* De-relocate the program... */ for (rel = 0; rel < p->num_relocations; rel++) { size_t off = p->relocations[rel]; INT32 opcode; #ifdef PIKE_DEBUG if (off < prev) { Pike_fatal("Relocations in bad order!\n");