RESOLVED FIXED Bug 31060
Use ARMv7 specific encoding for immediate constants on ARMv7 target
https://bugs.webkit.org/show_bug.cgi?id=31060
Summary Use ARMv7 specific encoding for immediate constants on ARMv7 target
Gabor Loki
Reported 2009-11-03 07:39:21 PST
ARMv7 provides a simple way to store 16bit wide immediate constants to a register. This is useful when JavaScriptCore is tuned to an ARMv7 processor.
Attachments
Use ARMv7 specific encoding for immediate constants on ARMv7 target (4.33 KB, patch)
2009-11-03 07:40 PST, Gabor Loki
barraclough: review-
Use ARMv7 specific encoding for immediate constants on ARMv7 target (take 2) (5.82 KB, patch)
2009-11-04 04:03 PST, Gabor Loki
barraclough: review+
Gabor Loki
Comment 1 2009-11-03 07:40:22 PST
Created attachment 42381 [details] Use ARMv7 specific encoding for immediate constants on ARMv7 target
Gavin Barraclough
Comment 2 2009-11-04 01:45:33 PST
Comment on attachment 42381 [details] Use ARMv7 specific encoding for immediate constants on ARMv7 target Having 0 as the "cannot encode" value for getImm16Op2 is probably not a good idea, since 0 is a common immediate, and could be encoded in one instruction. I guess this is not actively a problem in this patch, since you don't call encodeComplexImm on zero – but to guard against this mistake creeping in you should probably ASSERT(imm != 0) in this function, or use a value other than 0 to mean 'cannot encode'. We also prefer to avoid magic values in the code, so I'd suggest that you should define up a name for this (e.g. something like static const ARMWord INVALID_IMM16 0;), then return 0; should be return INVALID_IMM16;, if (tmp) should be if (tmp != INVALID_IMM16). It would also probably be a good idea to add guards to movw_r & movt_r that op2 is valid. r-, because I think some extra ASSERTs here are worthwhile, but the patch is otherwise all good.
Gabor Loki
Comment 3 2009-11-04 04:03:15 PST
Created attachment 42474 [details] Use ARMv7 specific encoding for immediate constants on ARMv7 target (take 2)
Zoltan Horvath
Comment 4 2009-11-05 00:28:54 PST
Note You need to log in before you can comment on or make changes to this bug.