On Wed, 8 Nov 2023 16:51:48 GMT, Lothar Kimmeringer wrote:
> return (year & 3) == 0 && (year & 15 == 0 || year % 100 != 0);
I tried this and many other variants but the one in this PR came out on top -
and it even seemed the additional redundancy helped the JIT. This might be due
a deficiency
On Mon, 6 Nov 2023 00:50:22 GMT, Claes Redestad wrote:
> I suggest we go ahead and integrate this, file an RFE to re-examine the
> division-by-constant in C2, then re-evaluate these `isLeapYear` micros in
> that new environment.
These are good improvements and are beneficial with or without ot
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Mon, 6 Nov 2023 02:34:21 GMT, Quan Anh Mai wrote:
> >
>
> I have filed
> [JDK-8319451](https://bugs.openjdk.org/projects/JDK/issues/JDK-8319451). I
> would suggest waiting for this bug to be resolved before proceeding with this
> PR.
Nice analysis!
While I'm sure we need to re-evaluate
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Sun, 5 Nov 2023 22:14:50 GMT, Claes Redestad wrote:
>> Thanks for your interest in my work. I'd love to assist porting our
>> algorithms to Java. Notice, however, that I'm not a Java programmer and I
>> don't have the complete picture of what goes on in the JVM. What follows is
>> based on
On Sat, 4 Nov 2023 20:12:58 GMT, Cassio Neri wrote:
>> Claes Redestad has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Apply similar optimization to GregorianCalendar, sun.util.calendar
>
> Thanks for your interest in my work. I'd love to
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Sat, 4 Nov 2023 16:01:44 GMT, Claes Redestad wrote:
>> src/java.base/share/classes/java/time/Year.java line 321:
>>
>>> 319: // So for a year that's divisible by 4, checking that it's
>>> also divisible by 16
>>> 320: // is sufficient to determine it must be a leap year.
>>>
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Sat, 4 Nov 2023 04:57:11 GMT, Quan Anh Mai wrote:
>> Claes Redestad has updated the pull request incrementally with one
>> additional commit since the last revision:
>>
>> Apply similar optimization to GregorianCalendar, sun.util.calendar
>
> src/java.base/share/classes/java/time/Year.java
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Fri, 3 Nov 2023 23:22:27 GMT, Claes Redestad wrote:
>> https://github.com/cassioneri/eaf suggest this code for leap year
>> calculation:
>>
>> public static boolean isLeap(long year) {
>> int d = year % 100 != 0 ? 4 : 16;
>> return (year & (d - 1)) == 0;
>> }
>>
>> .
On Fri, 3 Nov 2023 23:34:49 GMT, Claes Redestad wrote:
> > @cl4es Could you please test
> > [this](https://github.com/plokhotnyuk/jsoniter-scala/blob/ba6f4f80deaf0e7a1a95787321de3cc2a232d66d/jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala#L3687)
On Fri, 3 Nov 2023 22:37:40 GMT, Andriy Plokhotnyuk wrote:
> @cl4es Could you please test
> [this](https://github.com/plokhotnyuk/jsoniter-scala/blob/ba6f4f80deaf0e7a1a95787321de3cc2a232d66d/jsoniter-scala-core/jvm/src/main/scala/com/github/plokhotnyuk/jsoniter_scala/core/JsonReader.scala#L3687)
> https://github.com/cassioneri/eaf suggest this code for leap year calculation:
>
> public static boolean isLeap(long year) {
> int d = year % 100 != 0 ? 4 : 16;
> return (year & (d - 1)) == 0;
> }
>
> .. with a claim this would compile down to branchless, easily pipeline
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote:
> https://github.com/cassioneri/eaf suggest this code for leap year calculation:
>
> public static boolean isLeap(long year) {
> int d = year % 100 != 0 ? 4 : 16;
> return (year & (d - 1)) == 0;
> }
>
> .. with a cla
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote:
> https://github.com/cassioneri/eaf suggest this code for leap year calculation:
>
> public static boolean isLeap(long year) {
> int d = year % 100 != 0 ? 4 : 16;
> return (year & (d - 1)) == 0;
> }
>
> .. with a cla
On Fri, 3 Nov 2023 12:03:24 GMT, Claes Redestad wrote:
> https://github.com/cassioneri/eaf suggest this code for leap year calculation:
>
> public static boolean isLeap(long year) {
> int d = year % 100 != 0 ? 4 : 16;
> return (year & (d - 1)) == 0;
> }
>
> .. with a cla
21 matches
Mail list logo