Jump to page: 1 2 3
Thread overview
iOS progress
Feb 04, 2015
Dan Olson
Feb 04, 2015
David Nadlinger
Feb 15, 2015
Dan Olson
Feb 15, 2015
Joakim
Feb 15, 2015
Dan Olson
Feb 16, 2015
Jacob Carlborg
Feb 16, 2015
Dan Olson
Feb 16, 2015
Jacob Carlborg
Feb 16, 2015
Dan Olson
Feb 17, 2015
Jacob Carlborg
Feb 17, 2015
Dan Olson
Feb 18, 2015
Jacob Carlborg
Feb 18, 2015
Dan Olson
Feb 17, 2015
Joakim
Feb 18, 2015
Dan Olson
Feb 24, 2015
Joakim
Feb 16, 2015
Szymon Gatner
Feb 26, 2015
Dan Olson
Feb 17, 2015
Laeeth Isharc
Feb 18, 2015
Jacob Carlborg
Feb 18, 2015
Dan Olson
Feb 18, 2015
Jacob Carlborg
Feb 18, 2015
Laeeth Isharc
Feb 21, 2015
Kai Nacke
Feb 22, 2015
Dan Olson
February 04, 2015
Just a quick note.  I started again on LDC for iOS a month ago (new years resolution!).  I bogged down in floating point and optimizer problems.  I think I understand the major issues and have gotten all of phobos unittests to pass with optimizer disabled except for some math unittests that are written for 80-bit floats and some that are off by LSB.

This weekend I'll cleanup the math fixes and put up a new repo on https://github.com/smolt that helps glue it all together.
--
Dan
February 04, 2015
On Wednesday, 4 February 2015 at 16:37:05 UTC, Dan Olson wrote:
> This weekend I'll cleanup the math fixes and put up a new repo on https://github.com/smolt that helps glue it all together.

Nice, great to hear!

David
February 15, 2015
On Wednesday, 4 February 2015 at 17:24:06 UTC, David Nadlinger wrote:
> On Wednesday, 4 February 2015 at 16:37:05 UTC, Dan Olson wrote:
>> This weekend I'll cleanup the math fixes and put up a new repo on https://github.com/smolt that helps glue it all together.
>
> Nice, great to hear!
>
> David

https://github.com/smolt/ldc-iphone-dev

This pulls all the pieces together as submodules.  I still need to cleanup and add my sample Xcode apps and add some docs, but this should be enough to build LDC iPhoneOS cross compiler and Phobos.  Someone with OS X should see if my build works for them.
February 15, 2015
On Sunday, 15 February 2015 at 03:40:41 UTC, Dan Olson wrote:
>
> https://github.com/smolt/ldc-iphone-dev
>
> This pulls all the pieces together as submodules.  I still need to cleanup and add my sample Xcode apps and add some docs, but this should be enough to build LDC iPhoneOS cross compiler and Phobos.  Someone with OS X should see if my build works for them.

Nice work.  Skimming your commits, it looks like you have a bunch of code to disable TLS altogether.  I guess that is just older work and you got TLS working now?  If so, how many tests are failing for you on druntime and phobos now?
February 15, 2015
"Joakim" <dlang@joakim.fea.st> writes:

> On Sunday, 15 February 2015 at 03:40:41 UTC, Dan Olson wrote:
>>
>> https://github.com/smolt/ldc-iphone-dev
>>
>> This pulls all the pieces together as submodules.  I still need to cleanup and add my sample Xcode apps and add some docs, but this should be enough to build LDC iPhoneOS cross compiler and Phobos. Someone with OS X should see if my build works for them.
>
> Nice work.  Skimming your commits, it looks like you have a bunch of code to disable TLS altogether.  I guess that is just older work and you got TLS working now?  If so, how many tests are failing for you on druntime and phobos now?

Hi Joakim!

I added a -disable-tls option to help with bringing up D on other targets that don't have TLS.  My thought is if you don't have threads, say a bare-bones target, then you don't need TLS and should be allowed to use existing D code without changing all TLS vars to __gshared.

For iOS, TLS is working fine with the modification I made to LLVM last spring.  Newer arm64 devices are supposed to natively support TLS, but I don't have an arm64 device yet.  The iphonesim ironically does not support TLS because of a check in ld to make sure TLS doesn't slip in. Obviously it could support it.  I have ideas of how to get around the check.

Unittests failures are not too bad.  All except one are math related.

std.csv - a couple double off-by-one LSB differences std.internal.math.gammafunction - needs update for 64-bit reals std.math - a real off-by-one LSB error in a few cases

Failures only with optimization on (-O1 or higher):

std.internal.math.errorfunction - erfc() NaN payload fails
std.math - acosh() not producing NaN in a couple cases
core.thread - a Fiber unittest crashes on multicore devices

I have all the failures marked in the druntime and phobos source with versions that begin with "WIP_" to workaround the failure so rest of test can run. Grep for "WIP_" to see all the details. It really is a bummer that unittests use assert because it makes it difficult get results for the rest of the unittest.
February 16, 2015
On 2015-02-15 20:19, Dan Olson wrote:

> For iOS, TLS is working fine with the modification I made to LLVM last
> spring.  Newer arm64 devices are supposed to natively support TLS, but I
> don't have an arm64 device yet.  The iphonesim ironically does not
> support TLS because of a check in ld to make sure TLS doesn't slip in.
> Obviously it could support it.  I have ideas of how to get around the
> check.

I had a look at the TLS commits as well. Is iOS using the "__tls_get_addr" symbol? On OS X "tlv_get_addr" is used.

-- 
/Jacob Carlborg
February 16, 2015
Jacob Carlborg <doob@me.com> writes:

> On 2015-02-15 20:19, Dan Olson wrote:
>
>> For iOS, TLS is working fine with the modification I made to LLVM last spring.  Newer arm64 devices are supposed to natively support TLS, but I don't have an arm64 device yet.  The iphonesim ironically does not support TLS because of a check in ld to make sure TLS doesn't slip in. Obviously it could support it.  I have ideas of how to get around the check.
>
> I had a look at the TLS commits as well. Is iOS using the "__tls_get_addr" symbol? On OS X "tlv_get_addr" is used.

Hi Jacob!  Yes, tlv_get_addr is used, but indirectly.  When I modified LLVM, I had it emit a call to __tls_get_addr instead of to the thunk which is initialized to tlv_get_addr.  It gave me a hook to work with until I felt TLS was working, and so far it appears to be working.  My __tls_get_addr just verifies the thunk and then calls tlv_get_addr().

https://github.com/smolt/iphoneos-apple-support/blob/master/threadLocalVariables.c#L487

It could be changed here,

https://github.com/smolt/llvm/blob/ios/lib/Target/ARM/ARMISelLowering.cpp#L2473

but I would need some help creating the correct LLVM code.
February 16, 2015
On Sunday, 15 February 2015 at 03:40:41 UTC, Dan Olson wrote:
> On Wednesday, 4 February 2015 at 17:24:06 UTC, David Nadlinger wrote:
>> On Wednesday, 4 February 2015 at 16:37:05 UTC, Dan Olson wrote:
>>> This weekend I'll cleanup the math fixes and put up a new repo on https://github.com/smolt that helps glue it all together.
>>
>> Nice, great to hear!
>>
>> David
>
> https://github.com/smolt/ldc-iphone-dev
>
> This pulls all the pieces together as submodules.  I still need to cleanup and add my sample Xcode apps and add some docs, but this should be enough to build LDC iPhoneOS cross compiler and Phobos.  Someone with OS X should see if my build works for them.

Fantastic news! When I am back from holidays next week I will definitely try it.
February 16, 2015
On 2015-02-16 17:28, Dan Olson wrote:


> It could be changed here,
>
> https://github.com/smolt/llvm/blob/ios/lib/Target/ARM/ARMISelLowering.cpp#L2473
>
> but I would need some help creating the correct LLVM code.

Is calling tlv_get_addr any different from calling __tls_get_addr?

-- 
/Jacob Carlborg
February 16, 2015
On Monday, 16 February 2015 at 19:57:15 UTC, Jacob Carlborg wrote:
> On 2015-02-16 17:28, Dan Olson wrote:
>
>
>> It could be changed here,
>>
>> https://github.com/smolt/llvm/blob/ios/lib/Target/ARM/ARMISelLowering.cpp#L2473
>>
>> but I would need some help creating the correct LLVM code.
>
> Is calling tlv_get_addr any different from calling __tls_get_addr?

I think directly using tlv_get_addr may lead to weird errors if thread local descriptors have not been initialized by runtime.  With __tls_get_addr there is a check that descriptor is initialized, and if I get around to changing llvm to call thunk directly, then uninitialized descriptor will have thunk set to _tlv_bootstrap and code will cleanly abort.
« First   ‹ Prev
1 2 3