Commit 27c572f2 authored by David Schleef's avatar David Schleef

convert from stdint types to orc types

parent 8f2cc55f
......@@ -43,8 +43,6 @@ AS_HOST_DEFINES()
AC_C_BIGENDIAN
AX_CREATE_STDINT_H([orc/orc-stdint.h])
AC_FUNC_MMAP()
AC_CHECK_HEADERS([inttypes.h])
......
......@@ -6,11 +6,11 @@
#define N 10
int16_t a[N];
int16_t b[N];
int16_t c[N];
orc_int16 a[N];
orc_int16 b[N];
orc_int16 c[N];
void add_s16(int16_t *dest, int16_t *src1, int16_t *src2, int n);
void add_s16(orc_int16 *dest, orc_int16 *src1, orc_int16 *src2, int n);
int
......@@ -39,7 +39,7 @@ main (int argc, char *argv[])
}
void
add_s16(int16_t *dest, int16_t *src1, int16_t *src2, int n)
add_s16(orc_int16 *dest, orc_int16 *src1, orc_int16 *src2, int n)
{
static OrcProgram *p = NULL;
OrcExecutor _ex;
......
......@@ -57,12 +57,12 @@
/* mag01[x] = x * MATRIX_A for x=0,1 */
static const uint32_t mag01[2]={0x0UL, MATRIX_A};
static const orc_uint32 mag01[2]={0x0UL, MATRIX_A};
void
mt19937_ref (uint32_t *d, uint32_t *mt)
mt19937_ref (orc_uint32 *d, orc_uint32 *mt)
{
uint32_t y;
orc_uint32 y;
int kk;
for (kk=0;kk<N-M;kk++) {
......
......@@ -86,7 +86,7 @@ sse_register_rules (void)
static void
mulhslw (OrcOpcodeExecutor *ex, void *user)
{
int32_t src, sl, sh, scale;
orc_int32 src, sl, sh, scale;
scale = ex->src_values[0];
src = ex->src_values[1];
......@@ -94,7 +94,7 @@ mulhslw (OrcOpcodeExecutor *ex, void *user)
sh = scale >> 16;
sl = scale & 0xffff;
ex->dest_values[0] = (int32_t) ((src * sl) >> 16) + (src * sh);
ex->dest_values[0] = (orc_int32) ((src * sl) >> 16) + (src * sh);
}
static OrcStaticOpcode opcodes[] = {
......@@ -112,19 +112,19 @@ register_instr (void)
}
static void
do_volume_c (int16_t *dest, const int32_t *vols, const int16_t *samp, int len)
do_volume_c (orc_int16 *dest, const orc_int32 *vols, const orc_int16 *samp, int len)
{
int i;
for (i = 0; i < len; i++) {
int32_t t, hi, lo;
orc_int32 t, hi, lo;
hi = vols[i] >> 16;
lo = vols[i] & 0xffff;
t = (int32_t)(samp[i]);
t = (orc_int32)(samp[i]);
t = ((t * lo) >> 16) + (t * hi);
dest[i] = (int16_t) ORC_CLAMP (t, -0x8000, 0x7FFF);
dest[i] = (orc_int16) ORC_CLAMP (t, -0x8000, 0x7FFF);
}
}
......@@ -132,9 +132,9 @@ do_volume_c (int16_t *dest, const int32_t *vols, const int16_t *samp, int len)
static void
do_volume_backup (OrcExecutor *ex)
{
int16_t *dest;
int32_t *vols;
const int16_t *samp;
orc_int16 *dest;
orc_int32 *vols;
const orc_int16 *samp;
int len;
dest = ex->arrays[ORC_VAR_D1];
......@@ -174,7 +174,7 @@ make_volume_orc()
}
static void
do_volume_orc (int16_t *dest, int32_t *volumes, int16_t *samp, int length)
do_volume_orc (orc_int16 *dest, orc_int32 *volumes, orc_int16 *samp, int length)
{
OrcExecutor _ex;
OrcExecutor *ex = &_ex;
......@@ -191,7 +191,7 @@ do_volume_orc (int16_t *dest, int32_t *volumes, int16_t *samp, int length)
orc_executor_run (ex);
}
static uint64_t
static orc_uint64
get_timestamp ()
{
#ifndef _MSC_VER
......@@ -208,15 +208,15 @@ get_timestamp ()
#define TIMES 100000
#define N 1024
int16_t dest[N];
int16_t samp[N];
int32_t vols[N];
orc_int16 dest[N];
orc_int16 samp[N];
orc_int32 vols[N];
int
main (int argc, char *argv[])
{
int i;
uint64_t start, stop;
orc_uint64 start, stop;
/* orc_init() must be called before any other Orc function */
orc_init ();
......
......@@ -21,7 +21,7 @@ orc_random_init (OrcRandomContext *context, int seed)
void
orc_random_bits (OrcRandomContext *context, void *data, int n_bytes)
{
uint8_t *d = data;
orc_uint8 *d = data;
int i;
for(i=0;i<n_bytes;i++){
context->x = 1103515245*context->x + 12345;
......
......@@ -342,7 +342,7 @@ void
orc_test_random_bits (void *data, int n_bytes)
{
#if 1
uint8_t *d = data;
orc_uint8 *d = data;
int i;
for(i=0;i<n_bytes;i++){
d[i] = rand();
......@@ -365,17 +365,17 @@ print_array_val_signed (OrcArray *array, int i, int j)
switch (array->element_size) {
case 1:
printf(" %4d", *(int8_t *)ptr);
return *(int8_t *)ptr;
printf(" %4d", *(orc_int8 *)ptr);
return *(orc_int8 *)ptr;
case 2:
printf(" %5d", *(int16_t *)ptr);
return *(int16_t *)ptr;
printf(" %5d", *(orc_int16 *)ptr);
return *(orc_int16 *)ptr;
case 4:
printf(" %10d", *(int32_t *)ptr);
return *(int32_t *)ptr;
printf(" %10d", *(orc_int32 *)ptr);
return *(orc_int32 *)ptr;
case 8:
printf(" %20lld", (long long)*(int64_t *)ptr);
return *(int64_t *)ptr;
printf(" %20lld", (long long)*(orc_int64 *)ptr);
return *(orc_int64 *)ptr;
default:
return -1;
}
......@@ -389,17 +389,17 @@ print_array_val_unsigned (OrcArray *array, int i, int j)
switch (array->element_size) {
case 1:
printf(" %4u", *(uint8_t *)ptr);
return *(int8_t *)ptr;
printf(" %4u", *(orc_uint8 *)ptr);
return *(orc_int8 *)ptr;
case 2:
printf(" %5u", *(uint16_t *)ptr);
return *(int16_t *)ptr;
printf(" %5u", *(orc_uint16 *)ptr);
return *(orc_int16 *)ptr;
case 4:
printf(" %10u", *(uint32_t *)ptr);
return *(int32_t *)ptr;
printf(" %10u", *(orc_uint32 *)ptr);
return *(orc_int32 *)ptr;
case 8:
printf(" %20llu", (long long)*(uint64_t *)ptr);
return *(int64_t *)ptr;
printf(" %20llu", (long long)*(orc_uint64 *)ptr);
return *(orc_int64 *)ptr;
default:
return -1;
}
......@@ -413,17 +413,17 @@ print_array_val_hex (OrcArray *array, int i, int j)
switch (array->element_size) {
case 1:
printf(" %02x", *(uint8_t *)ptr);
return *(int8_t *)ptr;
printf(" %02x", *(orc_uint8 *)ptr);
return *(orc_int8 *)ptr;
case 2:
printf(" %04x", *(uint16_t *)ptr);
return *(int16_t *)ptr;
printf(" %04x", *(orc_uint16 *)ptr);
return *(orc_int16 *)ptr;
case 4:
printf(" %08x", *(uint32_t *)ptr);
return *(int32_t *)ptr;
printf(" %08x", *(orc_uint32 *)ptr);
return *(orc_int32 *)ptr;
case 8:
printf(" %016llx", (long long)*(uint64_t *)ptr);
return *(int64_t *)ptr;
printf(" %016llx", (long long)*(orc_uint64 *)ptr);
return *(orc_int64 *)ptr;
default:
return -1;
}
......@@ -438,16 +438,16 @@ print_array_val_float (OrcArray *array, int i, int j)
switch (array->element_size) {
case 4:
if (isnan(*(float *)ptr)) {
printf(" nan %08x", *(uint32_t *)ptr);
printf(" nan %08x", *(orc_uint32 *)ptr);
/* This is to get around signaling/non-signaling nans in the output */
return (*(uint32_t *)ptr) & 0xffbfffff;
return (*(orc_uint32 *)ptr) & 0xffbfffff;
} else {
printf(" %12.5g", *(float *)ptr);
return *(int32_t *)ptr;
return *(orc_int32 *)ptr;
}
case 8:
printf(" %12.5g", *(double *)ptr);
return *(int64_t *)ptr;
return *(orc_int64 *)ptr;
default:
printf(" ERROR");
return -1;
......
......@@ -84,12 +84,6 @@ pkginclude_HEADERS = \
orcpowerpc.h \
orcarm.h
nodist_pkginclude_HEADERS = orc-stdint.h
DISTCLEANFILES = orc-stdint.h
orcfunctions:
$(top_builddir)/tools/orcc$(EXEEXT) --implementation -o orcfunctions.c orcfunctions.orc
$(top_builddir)/tools/orcc$(EXEEXT) --header -o orcfunctions.h orcfunctions.orc
......
UNARY_SB(absb, "ORC_ABS(%s)")
BINARY_SB(addb, "%s + %s")
BINARY_SB(addssb, "ORC_CLAMP_SB(%s + %s)")
BINARY_UB(addusb, "ORC_CLAMP_UB((uint8_t)%s + (uint8_t)%s)")
BINARY_UB(addusb, "ORC_CLAMP_UB((orc_uint8)%s + (orc_uint8)%s)")
BINARY_SB(andb, "%s & %s")
BINARY_SB(andnb, "(~%s) & %s")
BINARY_SB(avgsb, "(%s + %s + 1)>>1")
BINARY_UB(avgub, "((uint8_t)%s + (uint8_t)%s + 1)>>1")
BINARY_UB(avgub, "((orc_uint8)%s + (orc_uint8)%s + 1)>>1")
BINARY_SB(cmpeqb, "(%s == %s) ? (~0) : 0")
BINARY_SB(cmpgtsb, "(%s > %s) ? (~0) : 0")
UNARY_SB(copyb, "%s")
BINARY_SB(maxsb, "ORC_MAX(%s, %s)")
BINARY_UB(maxub, "ORC_MAX((uint8_t)%s, (uint8_t)%s)")
BINARY_UB(maxub, "ORC_MAX((orc_uint8)%s, (orc_uint8)%s)")
BINARY_SB(minsb, "ORC_MIN(%s, %s)")
BINARY_UB(minub, "ORC_MIN((uint8_t)%s, (uint8_t)%s)")
BINARY_UB(minub, "ORC_MIN((orc_uint8)%s, (orc_uint8)%s)")
BINARY_SB(mullb, "(%s * %s) & 0xff")
BINARY_SB(mulhsb, "(%s * %s) >> 8")
BINARY_UB(mulhub, "((uint32_t)(uint8_t)%s * (uint32_t)(uint8_t)%s) >> 8")
BINARY_UB(mulhub, "((orc_uint32)(orc_uint8)%s * (orc_uint32)(orc_uint8)%s) >> 8")
BINARY_SB(orb, "%s | %s")
BINARY_SB(shlb, "%s << %s")
BINARY_SB(shrsb, "%s >> %s")
BINARY_UB(shrub, "((uint8_t)%s) >> %s")
BINARY_UB(shrub, "((orc_uint8)%s) >> %s")
UNARY_SB(signb, "ORC_CLAMP(%s,-1,1)")
BINARY_SB(subb, "%s - %s")
BINARY_SB(subssb, "ORC_CLAMP_SB(%s - %s)")
BINARY_UB(subusb, "ORC_CLAMP_UB((uint8_t)%s - (uint8_t)%s)")
BINARY_UB(subusb, "ORC_CLAMP_UB((orc_uint8)%s - (orc_uint8)%s)")
BINARY_SB(xorb, "%s ^ %s")
UNARY_SW(absw, "ORC_ABS(%s)")
BINARY_SW(addw, "%s + %s")
BINARY_SW(addssw, "ORC_CLAMP_SW(%s + %s)")
BINARY_UW(addusw, "ORC_CLAMP_UW((uint16_t)%s + (uint16_t)%s)")
BINARY_UW(addusw, "ORC_CLAMP_UW((orc_uint16)%s + (orc_uint16)%s)")
BINARY_SW(andw, "%s & %s")
BINARY_SW(andnw, "(~%s) & %s")
BINARY_SW(avgsw, "(%s + %s + 1)>>1")
BINARY_UW(avguw, "((uint16_t)%s + (uint16_t)%s + 1)>>1")
BINARY_UW(avguw, "((orc_uint16)%s + (orc_uint16)%s + 1)>>1")
BINARY_SW(cmpeqw, "(%s == %s) ? (~0) : 0")
BINARY_SW(cmpgtsw, "(%s > %s) ? (~0) : 0")
UNARY_SW(copyw, "%s")
BINARY_SW(maxsw, "ORC_MAX(%s, %s)")
BINARY_UW(maxuw, "ORC_MAX((uint16_t)%s, (uint16_t)%s)")
BINARY_UW(maxuw, "ORC_MAX((orc_uint16)%s, (orc_uint16)%s)")
BINARY_SW(minsw, "ORC_MIN(%s, %s)")
BINARY_UW(minuw, "ORC_MIN((uint16_t)%s, (uint16_t)%s)")
BINARY_UW(minuw, "ORC_MIN((orc_uint16)%s, (orc_uint16)%s)")
BINARY_SW(mullw, "(%s * %s) & 0xffff")
BINARY_SW(mulhsw, "(%s * %s) >> 16")
BINARY_UW(mulhuw, "((uint32_t)((uint16_t)%s) * (uint32_t)((uint16_t)%s)) >> 16")
BINARY_UW(mulhuw, "((orc_uint32)((orc_uint16)%s) * (orc_uint32)((orc_uint16)%s)) >> 16")
BINARY_SW(orw, "%s | %s")
BINARY_SW(shlw, "%s << %s")
BINARY_SW(shrsw, "%s >> %s")
BINARY_UW(shruw, "((uint16_t)%s) >> %s")
BINARY_UW(shruw, "((orc_uint16)%s) >> %s")
UNARY_SW(signw, "ORC_CLAMP(%s,-1,1)")
BINARY_SW(subw, "%s - %s")
BINARY_SW(subssw, "ORC_CLAMP_SW(%s - %s)")
BINARY_UW(subusw, "ORC_CLAMP_UW((uint16_t)%s - (uint16_t)%s)")
BINARY_UW(subusw, "ORC_CLAMP_UW((orc_uint16)%s - (orc_uint16)%s)")
BINARY_SW(xorw, "%s ^ %s")
UNARY_SL(absl, "ORC_ABS(%s)")
BINARY_SL(addl, "%s + %s")
BINARY_SL(addssl, "ORC_CLAMP_SL((int64_t)%s + (int64_t)%s)")
BINARY_UL(addusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s + (int64_t)(uint32_t)%s)")
BINARY_SL(addssl, "ORC_CLAMP_SL((orc_int64)%s + (orc_int64)%s)")
BINARY_UL(addusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s + (orc_int64)(orc_uint32)%s)")
BINARY_SL(andl, "%s & %s")
BINARY_SL(andnl, "(~%s) & %s")
BINARY_SL(avgsl, "((int64_t)%s + (int64_t)%s + 1)>>1")
BINARY_UL(avgul, "((uint64_t)(uint32_t)%s + (uint64_t)(uint32_t)%s + 1)>>1")
BINARY_SL(avgsl, "((orc_int64)%s + (orc_int64)%s + 1)>>1")
BINARY_UL(avgul, "((orc_uint64)(orc_uint32)%s + (orc_uint64)(orc_uint32)%s + 1)>>1")
BINARY_SL(cmpeql, "(%s == %s) ? (~0) : 0")
BINARY_SL(cmpgtsl, "(%s > %s) ? (~0) : 0")
UNARY_SL(copyl, "%s")
BINARY_SL(maxsl, "ORC_MAX(%s, %s)")
BINARY_UL(maxul, "ORC_MAX((uint32_t)%s, (uint32_t)%s)")
BINARY_UL(maxul, "ORC_MAX((orc_uint32)%s, (orc_uint32)%s)")
BINARY_SL(minsl, "ORC_MIN(%s, %s)")
BINARY_UL(minul, "ORC_MIN((uint32_t)%s, (uint32_t)%s)")
BINARY_UL(minul, "ORC_MIN((orc_uint32)%s, (orc_uint32)%s)")
BINARY_SL(mulll, "(%s * %s) & 0xffffffff")
BINARY_SL(mulhsl, "((int64_t)%s * (int64_t)%s) >> 32")
BINARY_UL(mulhul, "((uint64_t)%s * (uint64_t)%s) >> 32")
BINARY_SL(mulhsl, "((orc_int64)%s * (orc_int64)%s) >> 32")
BINARY_UL(mulhul, "((orc_uint64)%s * (orc_uint64)%s) >> 32")
BINARY_SL(orl, "%s | %s")
BINARY_SL(shll, "%s << %s")
BINARY_SL(shrsl, "%s >> %s")
BINARY_UL(shrul, "((uint32_t)%s) >> %s")
BINARY_UL(shrul, "((orc_uint32)%s) >> %s")
UNARY_SL(signl, "ORC_CLAMP(%s,-1,1)")
BINARY_SL(subl, "%s - %s")
BINARY_SL(subssl, "ORC_CLAMP_SL((int64_t)%s - (int64_t)%s)")
BINARY_UL(subusl, "ORC_CLAMP_UL((int64_t)(uint32_t)%s - (int64_t)(uint32_t)%s)")
BINARY_SL(subssl, "ORC_CLAMP_SL((orc_int64)%s - (orc_int64)%s)")
BINARY_UL(subusl, "ORC_CLAMP_UL((orc_int64)(orc_uint32)%s - (orc_int64)(orc_uint32)%s)")
BINARY_SL(xorl, "%s ^ %s")
UNARY_BW(convsbw, "%s")
UNARY_BW(convubw, "(uint8_t)%s")
UNARY_BW(convubw, "(orc_uint8)%s")
UNARY_WL(convswl, "%s")
UNARY_WL(convuwl, "(uint16_t)%s")
UNARY_WL(convuwl, "(orc_uint16)%s")
UNARY_WB(convwb, "%s")
UNARY_WB(convssswb, "ORC_CLAMP_SB(%s)")
UNARY_WB(convsuswb, "ORC_CLAMP_UB(%s)")
UNARY_WB(convusswb, "ORC_CLAMP_SB((uint16_t)%s)")
UNARY_WB(convuuswb, "ORC_CLAMP_UB((uint16_t)%s)")
UNARY_WB(convusswb, "ORC_CLAMP_SB((orc_uint16)%s)")
UNARY_WB(convuuswb, "ORC_CLAMP_UB((orc_uint16)%s)")
UNARY_LW(convlw, "%s")
UNARY_LW(convssslw, "ORC_CLAMP_SW(%s)")
UNARY_LW(convsuslw, "ORC_CLAMP_UW(%s)")
UNARY_LW(convusslw, "ORC_CLAMP_SW((uint32_t)%s)")
UNARY_LW(convuuslw, "ORC_CLAMP_UW((uint32_t)%s)")
UNARY_LW(convusslw, "ORC_CLAMP_SW((orc_uint32)%s)")
UNARY_LW(convuuslw, "ORC_CLAMP_UW((orc_uint32)%s)")
BINARY_BW(mulsbw, "%s * %s")
BINARY_BW(mulubw, "(uint8_t)%s * (uint8_t)%s")
BINARY_BW(mulubw, "(orc_uint8)%s * (orc_uint8)%s")
BINARY_WL(mulswl, "%s * %s")
BINARY_WL(muluwl, "(uint16_t)%s * (uint16_t)%s")
BINARY_WL(muluwl, "(orc_uint16)%s * (orc_uint16)%s")
BINARY_WL(mergewl, "((uint16_t)%s) | ((uint16_t)%s << 16)")
BINARY_BW(mergebw, "((uint8_t)%s) | ((uint8_t)%s << 8)")
UNARY_WB(select0wb, "(uint16_t)%s & 0xff")
UNARY_WB(select1wb, "((uint16_t)%s >> 8)&0xff")
UNARY_LW(select0lw, "(uint32_t)%s & 0xffff")
UNARY_LW(select1lw, "((uint32_t)%s >> 16)&0xffff")
BINARY_WL(mergewl, "((orc_uint16)%s) | ((orc_uint16)%s << 16)")
BINARY_BW(mergebw, "((orc_uint8)%s) | ((orc_uint8)%s << 8)")
UNARY_WB(select0wb, "(orc_uint16)%s & 0xff")
UNARY_WB(select1wb, "((orc_uint16)%s >> 8)&0xff")
UNARY_LW(select0lw, "(orc_uint32)%s & 0xffff")
UNARY_LW(select1lw, "((orc_uint32)%s >> 16)&0xffff")
UNARY_UW(swapw, "ORC_SWAP_W(%s)")
UNARY_UL(swapl, "ORC_SWAP_L(%s)")
......
......@@ -3,7 +3,6 @@
#define _ORC_ORC_H_
#include <orc/orcprogram.h>
#include <orc/orc-stdint.h>
#include <orc/orcarm.h>
#include <orc/orcdebug.h>
#include <orc/orcfunctions.h>
......
......@@ -59,7 +59,7 @@ orc_arm_reg_name (int reg)
}
void
orc_arm_emit (OrcCompiler *compiler, uint32_t insn)
orc_arm_emit (OrcCompiler *compiler, orc_uint32 insn)
{
ORC_WRITE_UINT32_LE (compiler->codeptr, insn);
compiler->codeptr+=4;
......@@ -138,7 +138,7 @@ orc_arm_do_fixups (OrcCompiler *compiler)
for(i=0;i<compiler->n_fixups;i++){
unsigned char *label = compiler->labels[compiler->fixups[i].label];
unsigned char *ptr = compiler->fixups[i].ptr;
uint32_t code;
orc_uint32 code;
int diff;
if (compiler->fixups[i].type == 0) {
......@@ -169,7 +169,7 @@ orc_arm_emit_align (OrcCompiler *compiler, int align_shift)
void
orc_arm_emit_branch (OrcCompiler *compiler, int cond, int label)
{
uint32_t code;
orc_uint32 code;
code = 0x0afffffe;
code |= (cond&0xf) << 28;
......@@ -182,7 +182,7 @@ orc_arm_emit_branch (OrcCompiler *compiler, int cond, int label)
void
orc_arm_emit_load_imm (OrcCompiler *compiler, int dest, int imm)
{
uint32_t code;
orc_uint32 code;
int shift2;
unsigned int x;
......@@ -213,7 +213,7 @@ orc_arm_emit_load_imm (OrcCompiler *compiler, int dest, int imm)
void
orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int imm)
{
uint32_t code;
orc_uint32 code;
int shift2;
unsigned int x;
......@@ -246,7 +246,7 @@ orc_arm_emit_add_imm (OrcCompiler *compiler, int dest, int src1, int imm)
void
orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int value)
{
uint32_t code;
orc_uint32 code;
code = 0xe2000000;
code |= (src1&0xf) << 16;
......@@ -263,7 +263,7 @@ orc_arm_emit_and_imm (OrcCompiler *compiler, int dest, int src1, int value)
void
orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2)
{
uint32_t code;
orc_uint32 code;
code = 0xe1500000;
code |= (src1&0xf) << 16;
......@@ -278,7 +278,7 @@ orc_arm_emit_cmp (OrcCompiler *compiler, int src1, int src2)
void
orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int value)
{
uint32_t code;
orc_uint32 code;
if (value == 0) {
ORC_ERROR("bad immediate value");
......@@ -298,7 +298,7 @@ orc_arm_emit_asr_imm (OrcCompiler *compiler, int dest, int src1, int value)
void
orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int value)
{
uint32_t code;
orc_uint32 code;
if (value == 0) {
ORC_ERROR("bad immediate value");
......@@ -318,7 +318,7 @@ orc_arm_emit_lsl_imm (OrcCompiler *compiler, int dest, int src1, int value)
void
orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int offset)
{
uint32_t code;
orc_uint32 code;
code = 0xe5900000;
code |= (src1&0xf) << 16;
......@@ -334,7 +334,7 @@ orc_arm_emit_load_reg (OrcCompiler *compiler, int dest, int src1, int offset)
void
orc_arm_emit_store_reg (OrcCompiler *compiler, int src1, int dest, int offset)
{
uint32_t code;
orc_uint32 code;
code = 0xe5800000;
code |= (dest&0xf) << 16;
......@@ -424,13 +424,13 @@ orc_arm_emit_cmp_imm (OrcCompiler *compiler, int src1, int value)
*/
void
orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP opcode,
int S, int Rd, int Rn, int Rm, int shift, uint32_t val)
int S, int Rd, int Rn, int Rm, int shift, orc_uint32 val)
{
uint32_t code;
orc_uint32 code;
int I = 0;
int shifter_op;
char shifter[64];
uint32_t imm;
orc_uint32 imm;
static const char *shift_names[] = {
"LSL", "LSR", "ASR", "ROR"
};
......@@ -450,7 +450,7 @@ orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP opcode,
switch (type) {
case 0:
/* #imm */
imm = (uint32_t) val;
imm = (orc_uint32) val;
/* if imm <= 0xff we're done. It's recommanded that we choose the
* smallest shifter value. Impossible values will overflow the shifter. */
while (imm > 0xff && shift < 16) {
......@@ -529,7 +529,7 @@ void
orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond,
int Rd, int Rn, int Rm)
{
uint32_t code;
orc_uint32 code;
static const int par_op[] = {
1, 3, 5, 7, 9, 15, 11, 5, 5
};
......@@ -565,9 +565,9 @@ void
orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond,
int Rd, int Rn, int Rm, int r8)
{
uint32_t code;
orc_uint32 code;
char shifter[64];
static const uint32_t xt_opcodes[] = {
static const orc_uint32 xt_opcodes[] = {
0x06800070, 0x06a00070, 0x06b00070, 0x06c00070, 0x06e00070, 0x06f00070
};
static const char *xt_insn_names[] = {
......@@ -604,9 +604,9 @@ void
orc_arm_emit_pkh (OrcCompiler *p, int op, OrcArmCond cond,
int Rd, int Rn, int Rm, int sh)
{
uint32_t code;
orc_uint32 code;
char shifter[64];
static const uint32_t pkh_opcodes[] = { 0x06800010, 0x06800050 };
static const orc_uint32 pkh_opcodes[] = { 0x06800010, 0x06800050 };
static const char *pkh_insn_names[] = { "pkhbt", "pkhtb" };
if (sh > 0) {
......@@ -640,9 +640,9 @@ void
orc_arm_emit_sat (OrcCompiler *p, int op, OrcArmCond cond,
int Rd, int sat, int Rm, int sh, int asr)
{
uint32_t code;
orc_uint32 code;
char shifter[64];
static const uint32_t sat_opcodes[] = { 0x06a00010, 0x06e00010, 0, 0 };
static const orc_uint32 sat_opcodes[] = { 0x06a00010, 0x06e00010, 0, 0 };
static const char *sat_insn_names[] = { "ssat", "usat", "ssat16", "usat16" };
static const int par_mode[] = { 0, 0, 0x6a, 0x6e };
static const int par_op[] = { 0, 0, 3, 3 };
......@@ -673,8 +673,8 @@ void
orc_arm_emit_rv (OrcCompiler *p, int op, OrcArmCond cond,
int Rd, int Rm)
{
uint32_t code;
static const uint32_t rv_opcodes[] = { 0x06b00030, 0x06e000b0 };
orc_uint32 code;
static const orc_uint32 rv_opcodes[] = { 0x06b00030, 0x06e000b0 };
static const char *rv_insn_names[] = { "rev", "rev16" };
code = arm_code_rv (rv_opcodes[op], cond, Rd, Rm);
......
......@@ -68,7 +68,7 @@ typedef enum {
ORC_ARM_ROR
} OrcArmShift;
void orc_arm_emit (OrcCompiler *compiler, uint32_t insn);
void orc_arm_emit (OrcCompiler *compiler, orc_uint32 insn);
void orc_arm_emit_bx_lr (OrcCompiler *compiler);
const char * orc_arm_reg_name (int reg);
const char * orc_arm_cond_name (OrcArmCond cond);
......@@ -101,7 +101,7 @@ void orc_arm_add_fixup (OrcCompiler *compiler, int label, int type);
void orc_arm_do_fixups (OrcCompiler *compiler);
void orc_arm_emit_dp (OrcCompiler *p, int type, OrcArmCond cond, OrcArmDP opcode,
int S, int Rd, int Rn, int Rm, int shift, uint32_t val);
int S, int Rd, int Rn, int Rm, int shift, orc_uint32 val);
void orc_arm_emit_par (OrcCompiler *p, int op, int mode, OrcArmCond cond,
int Rd, int Rn, int Rm);
void orc_arm_emit_xt (OrcCompiler *p, int op, OrcArmCond cond,
......
......@@ -165,7 +165,7 @@ orc_mmx_getflags_cpuinfo (char *cpuinfo)
#ifdef USE_I386_CPUID
#ifdef _MSC_VER
static void
get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
get_cpuid (orc_uint32 op, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d)
{
int tmp[4];
__cpuid(tmp, op);
......@@ -178,7 +178,7 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
#ifdef __i386__
static void
get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
get_cpuid (orc_uint32 op, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d)
{
__asm__ (
" pushl %%ebx\n"
......@@ -192,7 +192,7 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
#ifdef __amd64__
static void
get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
get_cpuid (orc_uint32 op, orc_uint32 *a, orc_uint32 *b, orc_uint32 *c, orc_uint32 *d)
{
__asm__ (
" pushq %%rbx\n"
......@@ -208,7 +208,7 @@ get_cpuid (uint32_t op, uint32_t *a, uint32_t *b, uint32_t *c, uint32_t *d)
static void
test_cpuid (void *ignored)
{
uint32_t eax, ebx, ecx, edx;
orc_uint32 eax, ebx, ecx, edx;
get_cpuid (0x00000000, &eax, &ebx, &ecx, &edx);
}
......@@ -217,8 +217,8 @@ test_cpuid (void *ignored)
static unsigned int
orc_sse_detect_cpuid (void)
{
uint32_t eax, ebx, ecx, edx;
uint32_t level;
orc_uint32 eax, ebx, ecx, edx;
orc_uint32 level;
char vendor[13] = { 0 };
unsigned int sse_flags = 0;
#if 0
......@@ -233,8 +233,8 @@ orc_sse_detect_cpuid (void)
}
#endif
get_cpuid (0x00000000, &level, (uint32_t *)(vendor+0),
(uint32_t *)(vendor+8), (uint32_t *)(vendor+4));
get_cpuid (0x00000000, &level, (orc_uint32 *)(vendor+0),
(orc_uint32 *)(vendor+8), (orc_uint32 *)(vendor+4));
ORC_DEBUG("cpuid %d %s", level, vendor);
......@@ -298,13 +298,13 @@ orc_sse_detect_cpuid (void)
static unsigned int
orc_mmx_detect_cpuid (void)
{
uint32_t eax, ebx, ecx, edx;
uint32_t level;
orc_uint32 eax, ebx, ecx, edx;
orc_uint32 level;
char vendor[13] = { 0 };
unsigned int mmx_flags = 0;
get_cpuid (0x00000000, &level, (uint32_t *)(vendor+0),
(uint32_t *)(vendor+8), (uint32_t *)(vendor+4));
get_cpuid (0x00000000, &level, (orc_uint32 *)(vendor+0),
(orc_uint32 *)(vendor+8), (orc_uint32 *)(vendor+4));
ORC_DEBUG("cpuid %d %s", level, vendor);
......
......@@ -173,16 +173,16 @@ orc_executor_emulate (OrcExecutor *ex)
switch (var->size) {
case 1:
opcode_ex.src_values[k] = *(int8_t *)ptr;
opcode_ex.src_values[k] = *(orc_int8 *)ptr;
break;
case 2:
opcode_ex.src_values[k] = *(int16_t *)ptr;
opcode_ex.src_values[k] = *(orc_int16 *)ptr;
break;
case 4:
opcode_ex.src_values[k] = *(int32_t *)ptr;
opcode_ex.src_values[k] = *(orc_int32 *)ptr;
break;
case 8:
opcode_ex.src_values[k] = *(int64_t *)ptr;
opcode_ex.src_values[k] = *(orc_int64 *)ptr;
break;
default:
ORC_ERROR("unhandled size %d", program->vars[insn->src_args[k]].size);
......@@ -208,16 +208,16 @@ orc_executor_emulate (OrcExecutor *ex)
switch (var->size) {
case 1: