Some initial ARM patches

34 views
Skip to first unread message

Alex Rønne Petersen

unread,
Jul 7, 2012, 4:12:51 PM7/7/12
to ldc...@googlegroups.com
Hey,

Sending these here is a bit more convenient for me at the moment than
a GitHub pull request. I'd appreciate it if someone could apply these
patches.

* driver-arm-thumb.patch: The driver should define both ARM and Thumb
in Thumb mode.
* core-atomic-align.patch: core.atomic should not do alignment checks
when using LLVM intrinsics.
* setjmp-arm-ppc.patch: Adds __jmp_buf for ARM and PPC32/64.
* core-thread-reg-save-arm.patch: Implements register saving in core.thread.
* gc-gcx-reg-save-arm.patch: Implements register saving in gc.gcx.
* ldc-eh-arm.patch: Adds ARM declarations for EH in ldc.eh. I'm unsure
of the correctness of this one.

Regards,
Alex
driver-arm-thumb.patch
core-atomic-align.patch
setjmp-arm-ppc.patch
core-thread-reg-save-arm.patch
gc-gcx-reg-save-arm.patch
ldc-eh-arm.patch

Alex Rønne Petersen

unread,
Jul 7, 2012, 4:31:38 PM7/7/12
to ldc...@googlegroups.com
By the way, https://github.com/ldc-developers/ldc/issues/136 is
currently a blocker for further ARM progress.

Regards,
Alex

Alex Rønne Petersen

unread,
Jul 7, 2012, 5:45:55 PM7/7/12
to ldc...@googlegroups.com
On Sat, Jul 7, 2012 at 10:12 PM, Alex Rønne Petersen
<xtzg...@gmail.com> wrote:
More patches attached.

* gen-abi-structs-sarrays.patch: The gen/abi.cpp part of
https://github.com/ldc-developers/ldc/pull/120/files needed for
basically anything !x86. Please don't attribute this to me as it is
not my patch.
* rt-dmain2-hidden-func.patch: Makes _d_hidden_func() work on !x86.

Regards,
Alex
gen-abi-structs-sarrays.patch
rt-dmain2-hidden-func.patch

David Nadlinger

unread,
Jul 7, 2012, 5:47:46 PM7/7/12
to ldc...@googlegroups.com
Would it be possible to at least git format-patch them so I can apply
them directly with your author info and commit messages? You could also
point me to a Git branch to pull or cherry-pick from.

If your problem is that your GitHub clone is formally fork of the
D-Programming-Language repo and not the ldc-developers one, you can
change which repository a pull request is made to by clicking the
»Change Commits« button on the pull request creation page and then
selecting »ldc-developers/phobos @ ldc« in the left »Base branch«
box.

Applying them manually wouldn't be a problem of course, but this way
you'd get proper attribution (and it would be easier for me, of course).

David

Alex Rønne Petersen

unread,
Jul 7, 2012, 6:03:05 PM7/7/12
to ldc...@googlegroups.com
I'll see what I can do about bundling them into a branch. Can you
review the ones I send here, though?

Attached two more:

* rt-cmath2-disable.patch: Disables rt.cmath2 since the compiler no
longer seems to use it (and it was x86 only).
* rt-lifetime-array-new.patch: Hopefully fixes compilation of the
array allocation code correctly. This needs careful review.

Regards,
Alex
rt-cmath2-disable.patch
rt-lifetime-array-new.patch

David Nadlinger

unread,
Jul 7, 2012, 6:14:42 PM7/7/12
to ldc...@googlegroups.com
On 8 Jul 2012, at 0:03, Alex Rønne Petersen wrote:
> I'll see what I can do about bundling them into a branch. Can you
> review the ones I send here, though?

I would very much appreciate this since I'm extremely short on time
right now.

The patches you posted so far all seemed to be fine (as far as I can
tell from my limited ARM experience) – I didn't have a closer look at
the rt.lifetime patch, though. Seems like the current situation is an
artifact of just "find/replace-style" working around the DMD
__va_argsave oddities in druntime, but I need to have a closer look.

Thanks a lot for doing this,
David

Alex Rønne Petersen

unread,
Jul 7, 2012, 6:29:11 PM7/7/12
to ldc...@googlegroups.com
OK, last 3 patches before I put this up on GitHub somewhere.

* std-format-lp64.patch: Changes std.format to use D_LP64 instead of
X86/X86_64 in a couple of places.
* std-math-ieee-arm.patch: Versions some FPU control functionality so
that it only works on x86 (which is actually the case). This can be
unstubbed/filled out whenever we get around to it. I don't have any
current plans for this, though.
* std-math-exp-hack.patch: Adds a dirty workaround for exp() not being
@safe/@trusted. There's probably a better solution, I just didn't want
to look into it right now. Will include a better patch when I send a
pull request.

Regards,
Alex
std-format-lp64.patch
std-math-exp-hack.patch
std-math-ieee-arm.patch

Alex Rønne Petersen

unread,
Jul 7, 2012, 9:29:50 PM7/7/12
to ldc...@googlegroups.com
On Sat, Jul 7, 2012 at 10:12 PM, Alex Rønne Petersen
<xtzg...@gmail.com> wrote:
OK, first of all, this pull request should be merged:
https://github.com/ldc-developers/ldc/pull/137

Now, GitHub is really dodgy about this and doesn't let me send a pull
request to ldc-developers/druntime|phobos because my repos are forked
off the DPL ones. Even when I explicitly tell it to base on the
ldc-developers repos, it won't let me update the commit range.

So, please just pull these branches:

* https://github.com/alexrp/druntime/tree/ldc-master
* https://github.com/alexrp/phobos/tree/ldc-master

Regards,
Alex

David Nadlinger

unread,
Jul 11, 2012, 5:46:58 PM7/11/12
to ldc...@googlegroups.com
On 8 Jul 2012, at 3:29, Alex Rønne Petersen wrote:
> OK, first of all, this pull request should be merged:
> https://github.com/ldc-developers/ldc/pull/137

Done.

> Now, GitHub is really dodgy about this and doesn't let me send a pull
> request to ldc-developers/druntime|phobos because my repos are forked
> off the DPL ones. Even when I explicitly tell it to base on the
> ldc-developers repos, it won't let me update the commit range.

Did you change the branch on the left side to "ldc" (we have no master
branch in the ldc-developers fork to prevent confusion)? The user
experience for that page indeed leaves a lot to be desired – we should
bug the GitHub guys about this.
Merged most of the patches verbatim, removing the added .diff files from
the register popping patch [1].

I didn't merge the _d_newarrayOpT commit [2] though, because the code
would be broken on non-x86 afterwards anyway (ap2 is never set). After a
quick look at the code, I think right fix is to just take the X86 branch
for LCD all the time, although I'm not quite sure why ap2 is reset every
time in the loop on X86_64. Unfortunately, I can't look into verifying
that this is indeed the correct solution right now (i.e. that it works
on X86_64), but I didn't want to merge a patch which silently leaves
other platforms in a broken state.

Thanks again for your work,
David


[1]
https://github.com/alexrp/druntime/commit/6e61b4645ff3ad3f9b47988caa786be0892af9c9
[2]
https://github.com/alexrp/druntime/commit/717613ef2b42774fb2b40c360c80ad809d63c007
Reply all
Reply to author
Forward
0 new messages