[Webkit-unassigned] [Bug 94779] To reduce cost of converting type during modulo for integers

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Sep 17 23:52:35 PDT 2012


https://bugs.webkit.org/show_bug.cgi?id=94779





--- Comment #16 from hojong.han at samsung.com  2012-09-17 23:53:04 PST ---
(In reply to comment #14)
Really thank you for your review and comment, Filip

> Created an attachment (id=164488)
 --> (https://bugs.webkit.org/attachment.cgi?id=164488&action=review) [details]
> test case for C modulo
> 
> Run this on your compute:
> 
> cc -o test test.c
> ./test -2147483648 -1
> 
> You should get a SIGFPE on UNIX-like systems, or whatever the equivalent exception is on non-UNIX systems.
> 
> In general it is not safe to use C modulo for -2147483648/-1.

I did concern what you tested but my device, on linux, didn't throw any signal so I didn't add speculationCheck for (-2147483648).
Plus score was not good if the patch had have that check routine.

> 
> The reason why that code was written to call fmod() instead of using C modulo in the first place, was to ensure that we avoided this corner case.

During making this patch, I totally understood the reason why fmod() is called even if the cost is more expensive.

> 
> While I appreciate that there are things that can be done to optimize this code path, I don't think you have done so in a safe way.

I'm going to supplement the patch. Your interest will be necessary again.
Thanks again~

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the webkit-unassigned mailing list