Skip to content

Commit

Permalink
arm fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
vtjnash authored and staticfloat committed Jun 19, 2024
1 parent 889855f commit 25e57f1
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 18 deletions.
1 change: 1 addition & 0 deletions cli/trampolines/trampolines_armv7l.S
5 changes: 4 additions & 1 deletion src/crc32c.c
Original file line number Diff line number Diff line change
Expand Up @@ -360,7 +360,10 @@ JL_DLLEXPORT uint32_t jl_crc32c_sw(uint32_t crc, const char *buf, size_t len)
{
return jl_crc32c(crc, buf, len);
}
#define jl_crc32c_sw jl_crc32c
#ifdef jl_crc32c_sw
#undef jl_crc32c_sw // it might be redefined as ijl_crc32c_sw
#endif
#define jl_crc32c_sw jl_crc32c // for the rest of the file, rename it to ijl_crc32c instead
#endif

#ifdef crc32c_dispatch
Expand Down
20 changes: 7 additions & 13 deletions src/debuginfo.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -234,19 +234,13 @@ void JITDebugInfoRegistry::registerJITObject(const object::ObjectFile &Object,
uint64_t arm_text_addr = 0;
size_t arm_text_len = 0;
for (auto &section: Object.sections()) {
bool istext = false;
if (section.isText()) {
istext = true;
}
else {
auto sName = section.getName();
if (!sName)
continue;
if (sName.get() != ".ARM.exidx") {
continue;
}
}
uint64_t loadaddr = getLoadAddress(section.getName().get());
auto sName = section.getName();
if (!sName)
continue;
bool istext = section.isText();
if (!istext && sName.get() != ".ARM.exidx")
continue;
uint64_t loadaddr = getLoadAddress(sName.get());
size_t seclen = section.getSize();
if (istext) {
arm_text_addr = loadaddr;
Expand Down
1 change: 1 addition & 0 deletions src/features_aarch32.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,3 +34,4 @@ JL_FEATURE_DEF(v8_m_main, 32 * 2 + 8, 0)
JL_FEATURE_DEF(v8_4a, 32 * 2 + 9, 0)
JL_FEATURE_DEF(v8_5a, 32 * 2 + 10, 0)
JL_FEATURE_DEF(v8_6a, 32 * 2 + 11, 110000)
JL_FEATURE_DEF(vfp4sp, 32 * 2 + 12, 90000)
2 changes: 1 addition & 1 deletion src/processor_arm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1660,7 +1660,7 @@ static void ensure_jit_target(bool imaging)
// The most useful one in general...
t.en.flags |= JL_TARGET_CLONE_LOOP;
#elif defined(_CPU_ARM_)
static constexpr uint32_t clone_math[] = {Feature::vfp3, Feature::vfp4, Feature::neon};
static constexpr uint32_t clone_math[] = {Feature::vfp3, Feature::vfp4sp, Feature::vfp4, Feature::neon};
for (auto fe: clone_math) {
if (!test_nbit(features0, fe) && test_nbit(t.en.features, fe)) {
t.en.flags |= JL_TARGET_CLONE_MATH;
Expand Down
7 changes: 4 additions & 3 deletions src/runtime_intrinsics.c
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,7 @@ JL_DLLEXPORT float julia_half_to_float(uint16_t param) {
#if ((defined(__GNUC__) && __GNUC__ > 11) || \
(defined(__clang__) && __clang_major__ > 14)) && \
!defined(_CPU_PPC64_) && !defined(_CPU_PPC_) && \
!defined(_CPU_ARM_) && \
!defined(_OS_WINDOWS_)
#define FLOAT16_TYPE _Float16
#define FLOAT16_TO_UINT16(x) (*(uint16_t*)&(x))
Expand All @@ -267,9 +268,9 @@ JL_DLLEXPORT float julia_half_to_float(uint16_t param) {
#define FLOAT16_TYPE __m128
#define FLOAT16_TO_UINT16(x) take_from_xmm(x)
#define FLOAT16_FROM_UINT16(x) return_in_xmm(x)
#elif defined(_CPU_PPC64_) || defined(_CPU_PPC_)
// on PPC, pass Float16 as if it were an integer, similar to the old x86 ABI
// before _Float16
#elif defined(_CPU_PPC64_) || defined(_CPU_PPC_) || defined(_CPU_ARM_)
// on PPC and ARM, pass Float16 as if it were an integer, similar to the
// old x86 ABI before _Float16
#define FLOAT16_TYPE uint16_t
#define FLOAT16_TO_UINT16(x) (x)
#define FLOAT16_FROM_UINT16(x) (x)
Expand Down

0 comments on commit 25e57f1

Please sign in to comment.