Skip to content

Commit

Permalink
cpuid -> jl_cpuid
Browse files Browse the repository at this point in the history
  • Loading branch information
Keno committed Mar 20, 2014
1 parent a6476e0 commit aa76e58
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 13 deletions.
4 changes: 2 additions & 2 deletions src/cgutils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ extern "C" int32_t jl_get_llvm_gv(jl_value_t *p)
}

extern "C" {
extern void cpuid(int32_t CPUInfo[4], int32_t InfoType);
extern void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType);
}

static void jl_gen_llvm_gv_array()
Expand Down Expand Up @@ -253,7 +253,7 @@ static void jl_gen_llvm_gv_array()
if(strcmp(jl_cpu_string,"native") == 0) {
uint32_t info[4];

cpuid((int32_t*)info, 1);
jl_cpuid((int32_t*)info, 1);
new GlobalVariable(
*jl_Module,
T_int64,
Expand Down
4 changes: 2 additions & 2 deletions src/dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ static jl_value_t *jl_deserialize_value_internal(ios_t *s);
jl_value_t ***sysimg_gvars = NULL;

extern int globalUnique;
extern void cpuid(int32_t CPUInfo[4], int32_t InfoType);
extern void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType);
extern const char *jl_cpu_string;

static void jl_load_sysimg_so(char *fname)
Expand All @@ -115,7 +115,7 @@ static void jl_load_sysimg_so(char *fname)
jl_error("Julia and the system image were compiled for different architectures.\n"
"Please delete or regenerate sys.{so,dll,dylib}.");
uint32_t info[4];
cpuid((int32_t*)info, 1);
jl_cpuid((int32_t*)info, 1);
if (strcmp(cpu_target,"native") == 0)
{
uint64_t saved_cpuid = *(uint64_t*)jl_dlsym(sysimg_handle, "jl_sysimg_cpu_cpuid");
Expand Down
12 changes: 3 additions & 9 deletions src/sys.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,11 +413,7 @@ JL_STREAM *jl_stderr_stream(void) { return (JL_STREAM*)JL_STDERR; }

#ifdef __SSE__

#ifdef _OS_WINDOWS_
#define cpuid __cpuid
#else

void cpuid(int32_t CPUInfo[4], int32_t InfoType)
void jl_cpuid(int32_t CPUInfo[4], int32_t InfoType)
{
__asm__ __volatile__ (
#if defined(__i386__) && defined(__PIC__)
Expand All @@ -436,16 +432,14 @@ void cpuid(int32_t CPUInfo[4], int32_t InfoType)
);
}

#endif

DLLEXPORT uint8_t jl_zero_subnormals(uint8_t isZero)
{
uint32_t flags = 0x00000000;
int32_t info[4];

cpuid(info, 0);
jl_cpuid(info, 0);
if (info[0] >= 1) {
cpuid(info, 0x00000001);
jl_cpuid(info, 0x00000001);
if ((info[3] & ((int)1 << 26)) != 0) {
// SSE2 supports both FZ and DAZ
flags = 0x00008040;
Expand Down

0 comments on commit aa76e58

Please sign in to comment.