Bug 915228 - part 2 - make DoubleEncoder's table statically defined; r=mjrosenb
authorNathan Froyd <froydnj@mozilla.com>
Wed, 11 Sep 2013 11:50:01 -0400
changeset 147164 c789a0ddda51c028d715bbd651ecd36695fd5b14
parent 147163 6a09266fa0edc0a587254d7e636761a5088f4ebe
child 147165 855f1df4acfba65b66621636256fbd1162ac0a3c
push id270
push userpvanderbeken@mozilla.com
push dateThu, 06 Mar 2014 09:24:21 +0000
reviewersmjrosenb
bugs915228
milestone26.0a1
Bug 915228 - part 2 - make DoubleEncoder's table statically defined; r=mjrosenb
js/src/jit/arm/Assembler-arm.cpp
js/src/jit/arm/Assembler-arm.h
js/src/jit/arm/DoubleEntryTable.inc
js/src/jit/arm/gen-double-encoder-table.py
--- a/js/src/jit/arm/Assembler-arm.cpp
+++ b/js/src/jit/arm/Assembler-arm.cpp
@@ -1212,17 +1212,19 @@ Instruction *
 BOffImm::getDest(Instruction *src)
 {
     // TODO: It is probably worthwhile to verify that src is actually a branch
     // NOTE: This does not explicitly shift the offset of the destination left by 2,
     // since it is indexing into an array of instruction sized objects.
     return &src[(((int32_t)data<<8)>>8) + 2];
 }
 
-js::jit::DoubleEncoder js::jit::DoubleEncoder::_this;
+const js::jit::DoubleEncoder::DoubleEntry js::jit::DoubleEncoder::table[256] = {
+#include "DoubleEntryTable.inc"
+};
 
 //VFPRegister implementation
 VFPRegister
 VFPRegister::doubleOverlay()
 {
     JS_ASSERT(!_isInvalid);
     if (kind != Double)
         return VFPRegister(_code >> 1, Double);
--- a/js/src/jit/arm/Assembler-arm.h
+++ b/js/src/jit/arm/Assembler-arm.h
@@ -2177,65 +2177,32 @@ static inline uint32_t
 GetArgStackDisp(uint32_t arg)
 {
     JS_ASSERT(arg >= NumIntArgRegs);
     return (arg - NumIntArgRegs) * STACK_SLOT_SIZE;
 }
 
 #endif
 class DoubleEncoder {
-    uint32_t rep(bool b, uint32_t count) {
-        uint32_t ret = 0;
-        for (uint32_t i = 0; i < count; i++)
-            ret = (ret << 1) | b;
-        return ret;
-    }
-    uint32_t encode(uint8_t value) {
-        //ARM ARM "VFP modified immediate constants"
-        // aBbbbbbb bbcdefgh 000...
-        // we want to return the top 32 bits of the double
-        // the rest are 0.
-        bool a = value >> 7;
-        bool b = value >> 6 & 1;
-        bool B = !b;
-        uint32_t cdefgh = value & 0x3f;
-        return a << 31 |
-            B << 30 |
-            rep(b, 8) << 22 |
-            cdefgh << 16;
-    }
-
     struct DoubleEntry
     {
         uint32_t dblTop;
         datastore::Imm8VFPImmData data;
 
-        DoubleEntry()
-          : dblTop(-1)
-        { }
         MOZ_CONSTEXPR DoubleEntry(uint32_t dblTop_, datastore::Imm8VFPImmData data_)
           : dblTop(dblTop_), data(data_)
         { }
     };
-    DoubleEntry table [256];
-
-    // grumble singleton, grumble
-    static DoubleEncoder _this;
-    DoubleEncoder()
-    {
-        for (int i = 0; i < 256; i++) {
-            table[i] = DoubleEntry(encode(i), datastore::Imm8VFPImmData(i));
-        }
-    }
+    static const DoubleEntry table[256];
 
   public:
     static bool lookup(uint32_t top, datastore::Imm8VFPImmData *ret) {
         for (int i = 0; i < 256; i++) {
-            if (_this.table[i].dblTop == top) {
-                *ret = _this.table[i].data;
+            if (table[i].dblTop == top) {
+                *ret = table[i].data;
                 return true;
             }
         }
         return false;
     }
 };
 
 class AutoForbidPools {
new file mode 100644
--- /dev/null
+++ b/js/src/jit/arm/DoubleEntryTable.inc
@@ -0,0 +1,257 @@
+/* THIS FILE IS AUTOMATICALLY GENERATED BY gen-double-encode-table.py.  */
+  DoubleEntry(0x40000000, datastore::Imm8VFPImmData(0)),
+  DoubleEntry(0x40010000, datastore::Imm8VFPImmData(1)),
+  DoubleEntry(0x40020000, datastore::Imm8VFPImmData(2)),
+  DoubleEntry(0x40030000, datastore::Imm8VFPImmData(3)),
+  DoubleEntry(0x40040000, datastore::Imm8VFPImmData(4)),
+  DoubleEntry(0x40050000, datastore::Imm8VFPImmData(5)),
+  DoubleEntry(0x40060000, datastore::Imm8VFPImmData(6)),
+  DoubleEntry(0x40070000, datastore::Imm8VFPImmData(7)),
+  DoubleEntry(0x40080000, datastore::Imm8VFPImmData(8)),
+  DoubleEntry(0x40090000, datastore::Imm8VFPImmData(9)),
+  DoubleEntry(0x400a0000, datastore::Imm8VFPImmData(10)),
+  DoubleEntry(0x400b0000, datastore::Imm8VFPImmData(11)),
+  DoubleEntry(0x400c0000, datastore::Imm8VFPImmData(12)),
+  DoubleEntry(0x400d0000, datastore::Imm8VFPImmData(13)),
+  DoubleEntry(0x400e0000, datastore::Imm8VFPImmData(14)),
+  DoubleEntry(0x400f0000, datastore::Imm8VFPImmData(15)),
+  DoubleEntry(0x40100000, datastore::Imm8VFPImmData(16)),
+  DoubleEntry(0x40110000, datastore::Imm8VFPImmData(17)),
+  DoubleEntry(0x40120000, datastore::Imm8VFPImmData(18)),
+  DoubleEntry(0x40130000, datastore::Imm8VFPImmData(19)),
+  DoubleEntry(0x40140000, datastore::Imm8VFPImmData(20)),
+  DoubleEntry(0x40150000, datastore::Imm8VFPImmData(21)),
+  DoubleEntry(0x40160000, datastore::Imm8VFPImmData(22)),
+  DoubleEntry(0x40170000, datastore::Imm8VFPImmData(23)),
+  DoubleEntry(0x40180000, datastore::Imm8VFPImmData(24)),
+  DoubleEntry(0x40190000, datastore::Imm8VFPImmData(25)),
+  DoubleEntry(0x401a0000, datastore::Imm8VFPImmData(26)),
+  DoubleEntry(0x401b0000, datastore::Imm8VFPImmData(27)),
+  DoubleEntry(0x401c0000, datastore::Imm8VFPImmData(28)),
+  DoubleEntry(0x401d0000, datastore::Imm8VFPImmData(29)),
+  DoubleEntry(0x401e0000, datastore::Imm8VFPImmData(30)),
+  DoubleEntry(0x401f0000, datastore::Imm8VFPImmData(31)),
+  DoubleEntry(0x40200000, datastore::Imm8VFPImmData(32)),
+  DoubleEntry(0x40210000, datastore::Imm8VFPImmData(33)),
+  DoubleEntry(0x40220000, datastore::Imm8VFPImmData(34)),
+  DoubleEntry(0x40230000, datastore::Imm8VFPImmData(35)),
+  DoubleEntry(0x40240000, datastore::Imm8VFPImmData(36)),
+  DoubleEntry(0x40250000, datastore::Imm8VFPImmData(37)),
+  DoubleEntry(0x40260000, datastore::Imm8VFPImmData(38)),
+  DoubleEntry(0x40270000, datastore::Imm8VFPImmData(39)),
+  DoubleEntry(0x40280000, datastore::Imm8VFPImmData(40)),
+  DoubleEntry(0x40290000, datastore::Imm8VFPImmData(41)),
+  DoubleEntry(0x402a0000, datastore::Imm8VFPImmData(42)),
+  DoubleEntry(0x402b0000, datastore::Imm8VFPImmData(43)),
+  DoubleEntry(0x402c0000, datastore::Imm8VFPImmData(44)),
+  DoubleEntry(0x402d0000, datastore::Imm8VFPImmData(45)),
+  DoubleEntry(0x402e0000, datastore::Imm8VFPImmData(46)),
+  DoubleEntry(0x402f0000, datastore::Imm8VFPImmData(47)),
+  DoubleEntry(0x40300000, datastore::Imm8VFPImmData(48)),
+  DoubleEntry(0x40310000, datastore::Imm8VFPImmData(49)),
+  DoubleEntry(0x40320000, datastore::Imm8VFPImmData(50)),
+  DoubleEntry(0x40330000, datastore::Imm8VFPImmData(51)),
+  DoubleEntry(0x40340000, datastore::Imm8VFPImmData(52)),
+  DoubleEntry(0x40350000, datastore::Imm8VFPImmData(53)),
+  DoubleEntry(0x40360000, datastore::Imm8VFPImmData(54)),
+  DoubleEntry(0x40370000, datastore::Imm8VFPImmData(55)),
+  DoubleEntry(0x40380000, datastore::Imm8VFPImmData(56)),
+  DoubleEntry(0x40390000, datastore::Imm8VFPImmData(57)),
+  DoubleEntry(0x403a0000, datastore::Imm8VFPImmData(58)),
+  DoubleEntry(0x403b0000, datastore::Imm8VFPImmData(59)),
+  DoubleEntry(0x403c0000, datastore::Imm8VFPImmData(60)),
+  DoubleEntry(0x403d0000, datastore::Imm8VFPImmData(61)),
+  DoubleEntry(0x403e0000, datastore::Imm8VFPImmData(62)),
+  DoubleEntry(0x403f0000, datastore::Imm8VFPImmData(63)),
+  DoubleEntry(0x3fc00000, datastore::Imm8VFPImmData(64)),
+  DoubleEntry(0x3fc10000, datastore::Imm8VFPImmData(65)),
+  DoubleEntry(0x3fc20000, datastore::Imm8VFPImmData(66)),
+  DoubleEntry(0x3fc30000, datastore::Imm8VFPImmData(67)),
+  DoubleEntry(0x3fc40000, datastore::Imm8VFPImmData(68)),
+  DoubleEntry(0x3fc50000, datastore::Imm8VFPImmData(69)),
+  DoubleEntry(0x3fc60000, datastore::Imm8VFPImmData(70)),
+  DoubleEntry(0x3fc70000, datastore::Imm8VFPImmData(71)),
+  DoubleEntry(0x3fc80000, datastore::Imm8VFPImmData(72)),
+  DoubleEntry(0x3fc90000, datastore::Imm8VFPImmData(73)),
+  DoubleEntry(0x3fca0000, datastore::Imm8VFPImmData(74)),
+  DoubleEntry(0x3fcb0000, datastore::Imm8VFPImmData(75)),
+  DoubleEntry(0x3fcc0000, datastore::Imm8VFPImmData(76)),
+  DoubleEntry(0x3fcd0000, datastore::Imm8VFPImmData(77)),
+  DoubleEntry(0x3fce0000, datastore::Imm8VFPImmData(78)),
+  DoubleEntry(0x3fcf0000, datastore::Imm8VFPImmData(79)),
+  DoubleEntry(0x3fd00000, datastore::Imm8VFPImmData(80)),
+  DoubleEntry(0x3fd10000, datastore::Imm8VFPImmData(81)),
+  DoubleEntry(0x3fd20000, datastore::Imm8VFPImmData(82)),
+  DoubleEntry(0x3fd30000, datastore::Imm8VFPImmData(83)),
+  DoubleEntry(0x3fd40000, datastore::Imm8VFPImmData(84)),
+  DoubleEntry(0x3fd50000, datastore::Imm8VFPImmData(85)),
+  DoubleEntry(0x3fd60000, datastore::Imm8VFPImmData(86)),
+  DoubleEntry(0x3fd70000, datastore::Imm8VFPImmData(87)),
+  DoubleEntry(0x3fd80000, datastore::Imm8VFPImmData(88)),
+  DoubleEntry(0x3fd90000, datastore::Imm8VFPImmData(89)),
+  DoubleEntry(0x3fda0000, datastore::Imm8VFPImmData(90)),
+  DoubleEntry(0x3fdb0000, datastore::Imm8VFPImmData(91)),
+  DoubleEntry(0x3fdc0000, datastore::Imm8VFPImmData(92)),
+  DoubleEntry(0x3fdd0000, datastore::Imm8VFPImmData(93)),
+  DoubleEntry(0x3fde0000, datastore::Imm8VFPImmData(94)),
+  DoubleEntry(0x3fdf0000, datastore::Imm8VFPImmData(95)),
+  DoubleEntry(0x3fe00000, datastore::Imm8VFPImmData(96)),
+  DoubleEntry(0x3fe10000, datastore::Imm8VFPImmData(97)),
+  DoubleEntry(0x3fe20000, datastore::Imm8VFPImmData(98)),
+  DoubleEntry(0x3fe30000, datastore::Imm8VFPImmData(99)),
+  DoubleEntry(0x3fe40000, datastore::Imm8VFPImmData(100)),
+  DoubleEntry(0x3fe50000, datastore::Imm8VFPImmData(101)),
+  DoubleEntry(0x3fe60000, datastore::Imm8VFPImmData(102)),
+  DoubleEntry(0x3fe70000, datastore::Imm8VFPImmData(103)),
+  DoubleEntry(0x3fe80000, datastore::Imm8VFPImmData(104)),
+  DoubleEntry(0x3fe90000, datastore::Imm8VFPImmData(105)),
+  DoubleEntry(0x3fea0000, datastore::Imm8VFPImmData(106)),
+  DoubleEntry(0x3feb0000, datastore::Imm8VFPImmData(107)),
+  DoubleEntry(0x3fec0000, datastore::Imm8VFPImmData(108)),
+  DoubleEntry(0x3fed0000, datastore::Imm8VFPImmData(109)),
+  DoubleEntry(0x3fee0000, datastore::Imm8VFPImmData(110)),
+  DoubleEntry(0x3fef0000, datastore::Imm8VFPImmData(111)),
+  DoubleEntry(0x3ff00000, datastore::Imm8VFPImmData(112)),
+  DoubleEntry(0x3ff10000, datastore::Imm8VFPImmData(113)),
+  DoubleEntry(0x3ff20000, datastore::Imm8VFPImmData(114)),
+  DoubleEntry(0x3ff30000, datastore::Imm8VFPImmData(115)),
+  DoubleEntry(0x3ff40000, datastore::Imm8VFPImmData(116)),
+  DoubleEntry(0x3ff50000, datastore::Imm8VFPImmData(117)),
+  DoubleEntry(0x3ff60000, datastore::Imm8VFPImmData(118)),
+  DoubleEntry(0x3ff70000, datastore::Imm8VFPImmData(119)),
+  DoubleEntry(0x3ff80000, datastore::Imm8VFPImmData(120)),
+  DoubleEntry(0x3ff90000, datastore::Imm8VFPImmData(121)),
+  DoubleEntry(0x3ffa0000, datastore::Imm8VFPImmData(122)),
+  DoubleEntry(0x3ffb0000, datastore::Imm8VFPImmData(123)),
+  DoubleEntry(0x3ffc0000, datastore::Imm8VFPImmData(124)),
+  DoubleEntry(0x3ffd0000, datastore::Imm8VFPImmData(125)),
+  DoubleEntry(0x3ffe0000, datastore::Imm8VFPImmData(126)),
+  DoubleEntry(0x3fff0000, datastore::Imm8VFPImmData(127)),
+  DoubleEntry(0xc0000000, datastore::Imm8VFPImmData(128)),
+  DoubleEntry(0xc0010000, datastore::Imm8VFPImmData(129)),
+  DoubleEntry(0xc0020000, datastore::Imm8VFPImmData(130)),
+  DoubleEntry(0xc0030000, datastore::Imm8VFPImmData(131)),
+  DoubleEntry(0xc0040000, datastore::Imm8VFPImmData(132)),
+  DoubleEntry(0xc0050000, datastore::Imm8VFPImmData(133)),
+  DoubleEntry(0xc0060000, datastore::Imm8VFPImmData(134)),
+  DoubleEntry(0xc0070000, datastore::Imm8VFPImmData(135)),
+  DoubleEntry(0xc0080000, datastore::Imm8VFPImmData(136)),
+  DoubleEntry(0xc0090000, datastore::Imm8VFPImmData(137)),
+  DoubleEntry(0xc00a0000, datastore::Imm8VFPImmData(138)),
+  DoubleEntry(0xc00b0000, datastore::Imm8VFPImmData(139)),
+  DoubleEntry(0xc00c0000, datastore::Imm8VFPImmData(140)),
+  DoubleEntry(0xc00d0000, datastore::Imm8VFPImmData(141)),
+  DoubleEntry(0xc00e0000, datastore::Imm8VFPImmData(142)),
+  DoubleEntry(0xc00f0000, datastore::Imm8VFPImmData(143)),
+  DoubleEntry(0xc0100000, datastore::Imm8VFPImmData(144)),
+  DoubleEntry(0xc0110000, datastore::Imm8VFPImmData(145)),
+  DoubleEntry(0xc0120000, datastore::Imm8VFPImmData(146)),
+  DoubleEntry(0xc0130000, datastore::Imm8VFPImmData(147)),
+  DoubleEntry(0xc0140000, datastore::Imm8VFPImmData(148)),
+  DoubleEntry(0xc0150000, datastore::Imm8VFPImmData(149)),
+  DoubleEntry(0xc0160000, datastore::Imm8VFPImmData(150)),
+  DoubleEntry(0xc0170000, datastore::Imm8VFPImmData(151)),
+  DoubleEntry(0xc0180000, datastore::Imm8VFPImmData(152)),
+  DoubleEntry(0xc0190000, datastore::Imm8VFPImmData(153)),
+  DoubleEntry(0xc01a0000, datastore::Imm8VFPImmData(154)),
+  DoubleEntry(0xc01b0000, datastore::Imm8VFPImmData(155)),
+  DoubleEntry(0xc01c0000, datastore::Imm8VFPImmData(156)),
+  DoubleEntry(0xc01d0000, datastore::Imm8VFPImmData(157)),
+  DoubleEntry(0xc01e0000, datastore::Imm8VFPImmData(158)),
+  DoubleEntry(0xc01f0000, datastore::Imm8VFPImmData(159)),
+  DoubleEntry(0xc0200000, datastore::Imm8VFPImmData(160)),
+  DoubleEntry(0xc0210000, datastore::Imm8VFPImmData(161)),
+  DoubleEntry(0xc0220000, datastore::Imm8VFPImmData(162)),
+  DoubleEntry(0xc0230000, datastore::Imm8VFPImmData(163)),
+  DoubleEntry(0xc0240000, datastore::Imm8VFPImmData(164)),
+  DoubleEntry(0xc0250000, datastore::Imm8VFPImmData(165)),
+  DoubleEntry(0xc0260000, datastore::Imm8VFPImmData(166)),
+  DoubleEntry(0xc0270000, datastore::Imm8VFPImmData(167)),
+  DoubleEntry(0xc0280000, datastore::Imm8VFPImmData(168)),
+  DoubleEntry(0xc0290000, datastore::Imm8VFPImmData(169)),
+  DoubleEntry(0xc02a0000, datastore::Imm8VFPImmData(170)),
+  DoubleEntry(0xc02b0000, datastore::Imm8VFPImmData(171)),
+  DoubleEntry(0xc02c0000, datastore::Imm8VFPImmData(172)),
+  DoubleEntry(0xc02d0000, datastore::Imm8VFPImmData(173)),
+  DoubleEntry(0xc02e0000, datastore::Imm8VFPImmData(174)),
+  DoubleEntry(0xc02f0000, datastore::Imm8VFPImmData(175)),
+  DoubleEntry(0xc0300000, datastore::Imm8VFPImmData(176)),
+  DoubleEntry(0xc0310000, datastore::Imm8VFPImmData(177)),
+  DoubleEntry(0xc0320000, datastore::Imm8VFPImmData(178)),
+  DoubleEntry(0xc0330000, datastore::Imm8VFPImmData(179)),
+  DoubleEntry(0xc0340000, datastore::Imm8VFPImmData(180)),
+  DoubleEntry(0xc0350000, datastore::Imm8VFPImmData(181)),
+  DoubleEntry(0xc0360000, datastore::Imm8VFPImmData(182)),
+  DoubleEntry(0xc0370000, datastore::Imm8VFPImmData(183)),
+  DoubleEntry(0xc0380000, datastore::Imm8VFPImmData(184)),
+  DoubleEntry(0xc0390000, datastore::Imm8VFPImmData(185)),
+  DoubleEntry(0xc03a0000, datastore::Imm8VFPImmData(186)),
+  DoubleEntry(0xc03b0000, datastore::Imm8VFPImmData(187)),
+  DoubleEntry(0xc03c0000, datastore::Imm8VFPImmData(188)),
+  DoubleEntry(0xc03d0000, datastore::Imm8VFPImmData(189)),
+  DoubleEntry(0xc03e0000, datastore::Imm8VFPImmData(190)),
+  DoubleEntry(0xc03f0000, datastore::Imm8VFPImmData(191)),
+  DoubleEntry(0xbfc00000, datastore::Imm8VFPImmData(192)),
+  DoubleEntry(0xbfc10000, datastore::Imm8VFPImmData(193)),
+  DoubleEntry(0xbfc20000, datastore::Imm8VFPImmData(194)),
+  DoubleEntry(0xbfc30000, datastore::Imm8VFPImmData(195)),
+  DoubleEntry(0xbfc40000, datastore::Imm8VFPImmData(196)),
+  DoubleEntry(0xbfc50000, datastore::Imm8VFPImmData(197)),
+  DoubleEntry(0xbfc60000, datastore::Imm8VFPImmData(198)),
+  DoubleEntry(0xbfc70000, datastore::Imm8VFPImmData(199)),
+  DoubleEntry(0xbfc80000, datastore::Imm8VFPImmData(200)),
+  DoubleEntry(0xbfc90000, datastore::Imm8VFPImmData(201)),
+  DoubleEntry(0xbfca0000, datastore::Imm8VFPImmData(202)),
+  DoubleEntry(0xbfcb0000, datastore::Imm8VFPImmData(203)),
+  DoubleEntry(0xbfcc0000, datastore::Imm8VFPImmData(204)),
+  DoubleEntry(0xbfcd0000, datastore::Imm8VFPImmData(205)),
+  DoubleEntry(0xbfce0000, datastore::Imm8VFPImmData(206)),
+  DoubleEntry(0xbfcf0000, datastore::Imm8VFPImmData(207)),
+  DoubleEntry(0xbfd00000, datastore::Imm8VFPImmData(208)),
+  DoubleEntry(0xbfd10000, datastore::Imm8VFPImmData(209)),
+  DoubleEntry(0xbfd20000, datastore::Imm8VFPImmData(210)),
+  DoubleEntry(0xbfd30000, datastore::Imm8VFPImmData(211)),
+  DoubleEntry(0xbfd40000, datastore::Imm8VFPImmData(212)),
+  DoubleEntry(0xbfd50000, datastore::Imm8VFPImmData(213)),
+  DoubleEntry(0xbfd60000, datastore::Imm8VFPImmData(214)),
+  DoubleEntry(0xbfd70000, datastore::Imm8VFPImmData(215)),
+  DoubleEntry(0xbfd80000, datastore::Imm8VFPImmData(216)),
+  DoubleEntry(0xbfd90000, datastore::Imm8VFPImmData(217)),
+  DoubleEntry(0xbfda0000, datastore::Imm8VFPImmData(218)),
+  DoubleEntry(0xbfdb0000, datastore::Imm8VFPImmData(219)),
+  DoubleEntry(0xbfdc0000, datastore::Imm8VFPImmData(220)),
+  DoubleEntry(0xbfdd0000, datastore::Imm8VFPImmData(221)),
+  DoubleEntry(0xbfde0000, datastore::Imm8VFPImmData(222)),
+  DoubleEntry(0xbfdf0000, datastore::Imm8VFPImmData(223)),
+  DoubleEntry(0xbfe00000, datastore::Imm8VFPImmData(224)),
+  DoubleEntry(0xbfe10000, datastore::Imm8VFPImmData(225)),
+  DoubleEntry(0xbfe20000, datastore::Imm8VFPImmData(226)),
+  DoubleEntry(0xbfe30000, datastore::Imm8VFPImmData(227)),
+  DoubleEntry(0xbfe40000, datastore::Imm8VFPImmData(228)),
+  DoubleEntry(0xbfe50000, datastore::Imm8VFPImmData(229)),
+  DoubleEntry(0xbfe60000, datastore::Imm8VFPImmData(230)),
+  DoubleEntry(0xbfe70000, datastore::Imm8VFPImmData(231)),
+  DoubleEntry(0xbfe80000, datastore::Imm8VFPImmData(232)),
+  DoubleEntry(0xbfe90000, datastore::Imm8VFPImmData(233)),
+  DoubleEntry(0xbfea0000, datastore::Imm8VFPImmData(234)),
+  DoubleEntry(0xbfeb0000, datastore::Imm8VFPImmData(235)),
+  DoubleEntry(0xbfec0000, datastore::Imm8VFPImmData(236)),
+  DoubleEntry(0xbfed0000, datastore::Imm8VFPImmData(237)),
+  DoubleEntry(0xbfee0000, datastore::Imm8VFPImmData(238)),
+  DoubleEntry(0xbfef0000, datastore::Imm8VFPImmData(239)),
+  DoubleEntry(0xbff00000, datastore::Imm8VFPImmData(240)),
+  DoubleEntry(0xbff10000, datastore::Imm8VFPImmData(241)),
+  DoubleEntry(0xbff20000, datastore::Imm8VFPImmData(242)),
+  DoubleEntry(0xbff30000, datastore::Imm8VFPImmData(243)),
+  DoubleEntry(0xbff40000, datastore::Imm8VFPImmData(244)),
+  DoubleEntry(0xbff50000, datastore::Imm8VFPImmData(245)),
+  DoubleEntry(0xbff60000, datastore::Imm8VFPImmData(246)),
+  DoubleEntry(0xbff70000, datastore::Imm8VFPImmData(247)),
+  DoubleEntry(0xbff80000, datastore::Imm8VFPImmData(248)),
+  DoubleEntry(0xbff90000, datastore::Imm8VFPImmData(249)),
+  DoubleEntry(0xbffa0000, datastore::Imm8VFPImmData(250)),
+  DoubleEntry(0xbffb0000, datastore::Imm8VFPImmData(251)),
+  DoubleEntry(0xbffc0000, datastore::Imm8VFPImmData(252)),
+  DoubleEntry(0xbffd0000, datastore::Imm8VFPImmData(253)),
+  DoubleEntry(0xbffe0000, datastore::Imm8VFPImmData(254)),
+  DoubleEntry(0xbfff0000, datastore::Imm8VFPImmData(255)),
new file mode 100755
--- /dev/null
+++ b/js/src/jit/arm/gen-double-encoder-table.py
@@ -0,0 +1,32 @@
+#!/usr/bin/env python
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+"""Generate tables of immediately-encodable VFP doubles.
+
+DOES NOT get automatically run during the build process.  If you need to
+modify this file (which is unlikely), you must re-run this script:
+
+python gen-double-encode-table.py > $(topsrcdir)/path/to/DoubleEntryTable.inc
+"""
+
+import operator
+
+def rep(bit, count):
+    return reduce(operator.ior, [bit << c for c in range(count)])
+
+def encodeDouble(value):
+    """Generate an ARM ARM 'VFP modified immediate constant' with format:
+    aBbbbbbb bbcdefgh 000...
+
+    We will return the top 32 bits of the double; the rest are 0."""
+    assert (0 <= value) and (value <= 255)
+    a = value >> 7
+    b = (value >> 6) & 1
+    B = int(b == 0)
+    cdefgh = value & 0x3f
+    return (a << 31) | (B << 30) | (rep(b, 8) << 22) | cdefgh << 16
+
+print '/* THIS FILE IS AUTOMATICALLY GENERATED BY gen-double-encode-table.py.  */'
+for i in range(256):
+    print '  DoubleEntry(0x%08x, datastore::Imm8VFPImmData(%d)),' % (encodeDouble(i), i)