⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 279107 in webkit


Ignore:
Timestamp:
Jun 22, 2021, 12:56:27 AM (5 years ago)
Author:
Angelos Oikonomopoulos
Message:

Properly set numFPRs on ARM with NEON/VFP_V3_D32
https://bugs.webkit.org/show_bug.cgi?id=227212

Reviewed by Filip Pizlo.

Don't hardcode the number of FP regs on ARMv7 to 16; when targetting a
CPU with NEON or VFP_V3_d32, the number of FP regs is 32.

This also reverts the recent change to add an extra word to RegisterSet
which essentially covered up for this mismatch. The reason this bug only
manifested on certain compiler versions was that GCC 8.4/8.5 where built using
our buildroot infrastructure, whereas the other GCC versions we tested with
were debian system toolchains, targetting a lowest common denominator.

  • assembler/MacroAssemblerARMv7.h:

(JSC::MacroAssemblerARMv7::std::initializer_list<int>):

  • jit/RegisterSet.h:
Location:
trunk/Source/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/JavaScriptCore/ChangeLog

    r279105 r279107  
     12021-06-22  Angelos Oikonomopoulos  <angelos@igalia.com>
     2
     3        Properly set numFPRs on ARM with NEON/VFP_V3_D32
     4        https://bugs.webkit.org/show_bug.cgi?id=227212
     5
     6        Reviewed by Filip Pizlo.
     7
     8        Don't hardcode the number of FP regs on ARMv7 to 16; when targetting a
     9        CPU with NEON or VFP_V3_d32, the number of FP regs is 32.
     10
     11        This also reverts the recent change to add an extra word to RegisterSet
     12        which essentially covered up for this mismatch. The reason this bug only
     13        manifested on certain compiler versions was that GCC 8.4/8.5 where built using
     14        our buildroot infrastructure, whereas the other GCC versions we tested with
     15        were debian system toolchains, targetting a lowest common denominator.
     16
     17        * assembler/MacroAssemblerARMv7.h:
     18        (JSC::MacroAssemblerARMv7::std::initializer_list<int>):
     19        * jit/RegisterSet.h:
     20
    1212021-06-21  Ross Kirsling  <ross.kirsling@sony.com>
    222
  • trunk/Source/JavaScriptCore/assembler/MacroAssemblerARMv7.h

    r279049 r279107  
    2929#if ENABLE(ASSEMBLER)
    3030
     31#include <initializer_list>
     32
    3133#include "ARMv7Assembler.h"
    3234#include "AbstractMacroAssembler.h"
     
    4446
    4547public:
    46     static constexpr unsigned numGPRs = 16;
    47     static constexpr unsigned numFPRs = 16;
    48    
     48#define DUMMY_REGISTER_VALUE(id, name, r, cs) 0,
     49    static constexpr unsigned numGPRs = std::initializer_list<int>({ FOR_EACH_GP_REGISTER(DUMMY_REGISTER_VALUE) }).size();
     50    static constexpr unsigned numFPRs = std::initializer_list<int>({ FOR_EACH_FP_REGISTER(DUMMY_REGISTER_VALUE) }).size();
     51#undef DUMMY_REGISTER_VALUE
    4952    RegisterID scratchRegister() { return dataTempRegister; }
    5053
  • trunk/Source/JavaScriptCore/jit/RegisterSet.h

    r278991 r279107  
    3333#include "TempRegisterSet.h"
    3434#include <wtf/Bitmap.h>
    35 #include <wtf/Compiler.h>
    3635
    3736namespace JSC {
    3837
    39 #if CPU(ARM) && COMPILER(GCC)
    40 
    41 #if GCC_VERSION_AT_LEAST(8, 4, 0) && !GCC_VERSION_AT_LEAST(9, 0, 0)
    42 // GCC 8.4.0 and 8.5.0 seem to miscompile WTF:Bitmap::count code on
    43 // ARM, something that apparently was covered up by the extra
    44 // word. The issue seems to not manifest with GCC 8.3.0 and >9.
    45 // Temporarily cover up by adding back the + 1.
    46 #define REGISTERSET_BITMAP_SLACK 1
    47 #else
    48 #define REGISTERSET_BITMAP_SLACK 0
    49 #endif
    50 
    51 #else
    52 #define REGISTERSET_BITMAP_SLACK 0
    53 #endif
    54 
    55 typedef Bitmap<MacroAssembler::numGPRs + MacroAssembler::numFPRs + REGISTERSET_BITMAP_SLACK> RegisterBitmap;
     38typedef Bitmap<MacroAssembler::numGPRs + MacroAssembler::numFPRs> RegisterBitmap;
    5639class RegisterAtOffsetList;
    5740
Note: See TracChangeset for help on using the changeset viewer.