{"action":"created","issue":{"url":"https://api.github.com/repos/runrev/livecode/issues/1826","labels_url":"https://api.github.com/repos/runrev/livecode/issues/1826/labels{/name}","comments_url":"https://api.github.com/repos/runrev/livecode/issues/1826/comments","events_url":"https://api.github.com/repos/runrev/livecode/issues/1826/events","html_url":"https://github.com/runrev/livecode/pull/1826","id":57329497,"number":1826,"title":"[[ WIP ]] Work on sorting out MCNumberRef.","user":{"login":"runrevmark","id":3985298,"avatar_url":"https://avatars.githubusercontent.com/u/3985298?v=3","gravatar_id":"","url":"https://api.github.com/users/runrevmark","html_url":"https://github.com/runrevmark","followers_url":"https://api.github.com/users/runrevmark/followers","following_url":"https://api.github.com/users/runrevmark/following{/other_user}","gists_url":"https://api.github.com/users/runrevmark/gists{/gist_id}","starred_url":"https://api.github.com/users/runrevmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runrevmark/subscriptions","organizations_url":"https://api.github.com/users/runrevmark/orgs","repos_url":"https://api.github.com/users/runrevmark/repos","events_url":"https://api.github.com/users/runrevmark/events{/privacy}","received_events_url":"https://api.github.com/users/runrevmark/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":5,"created_at":"2015-02-11T15:22:04Z","updated_at":"2015-02-12T18:35:32Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/runrev/livecode/pulls/1826","html_url":"https://github.com/runrev/livecode/pull/1826","diff_url":"https://github.com/runrev/livecode/pull/1826.diff","patch_url":"https://github.com/runrev/livecode/pull/1826.patch"},"body":""},"comment":{"url":"https://api.github.com/repos/runrev/livecode/issues/comments/74125557","html_url":"https://github.com/runrev/livecode/pull/1826#issuecomment-74125557","issue_url":"https://api.github.com/repos/runrev/livecode/issues/1826","id":74125557,"user":{"login":"runrevmark","id":3985298,"avatar_url":"https://avatars.githubusercontent.com/u/3985298?v=3","gravatar_id":"","url":"https://api.github.com/users/runrevmark","html_url":"https://github.com/runrevmark","followers_url":"https://api.github.com/users/runrevmark/followers","following_url":"https://api.github.com/users/runrevmark/following{/other_user}","gists_url":"https://api.github.com/users/runrevmark/gists{/gist_id}","starred_url":"https://api.github.com/users/runrevmark/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/runrevmark/subscriptions","organizations_url":"https://api.github.com/users/runrevmark/orgs","repos_url":"https://api.github.com/users/runrevmark/repos","events_url":"https://api.github.com/users/runrevmark/events{/privacy}","received_events_url":"https://api.github.com/users/runrevmark/received_events","type":"User","site_admin":false},"created_at":"2015-02-12T18:35:32Z","updated_at":"2015-02-12T18:35:32Z","body":"Heh - well the 'external sign' bit is a better way to express the split over +ve/-ve. Having thought about this, I don't think a split over zero makes sense as it would make any operation between + and - more expensive (e.g. counting down a large unsigned value with a small negative delta).\r\n\r\nAs posed the slow path only kicks in on the transition between INTEGER_MAX and INTEGER_MAX + 1 which I wouldn't imagine would be a particularly frequent case. If the range of INTEGER_MAX is taken up to 64-bit levels, then I can only imagine it would be even rarer.\r\n\r\nTo be fair, the current implementation with templates is far inferior to a hand-crafter per operation implementation which is what would really ensure things were as fast as possible. It also occurs to me that that in this case well-defined 'bit-twiddling' could be used to minimise branching in the mixed cases (unsigned op signed / signed op unsigned). Furthermore, it is only really addition and subtraction which are the key ones here - multiplication and division have very fast exit for signed/unsigned mixes.\r\n\r\nPerformance-wise, doing assembly-level implementations would be the ideal situation - particularly on 32-bit processors where we'd want to not pay for 64-bit operations until they are needed."}}