Bug 210639 - offlineasm is generating the wrong load/store for the "orh" instruction.
Summary: offlineasm is generating the wrong load/store for the "orh" instruction.
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: JavaScriptCore (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Mark Lam
URL:
Keywords: InRadar
Depends on: 210665
Blocks: 207330
  Show dependency treegraph
 
Reported: 2020-04-16 23:40 PDT by Mark Lam
Modified: 2020-04-17 12:27 PDT (History)
12 users (show)

See Also:


Attachments
proposed patch. (3.43 KB, patch)
2020-04-16 23:49 PDT, Mark Lam
rmorisset: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Mark Lam 2020-04-16 23:40:27 PDT
For example, on ARM64E, it was generating the following:

    "\tldr w17, [x1, #0]\n"                                  // JavaScriptCore/llint/LowLevelInterpreter64.asm:919
    "\torr w17, w17, #64\n"                                  // JavaScriptCore/llint/LowLevelInterpreter64.asm:919
    "\tstr w17, [x1, #0]\n"                                  // JavaScriptCore/llint/LowLevelInterpreter64.asm:919

i.e. a 32-bit load, followed by a 32-bit OR, followed by a 32-bit store.

Instead, it should be generating the following:

    "\tldrh w17, [x1, #0]\n"                                 // JavaScriptCore/llint/LowLevelInterpreter64.asm:919
    "\torr w17, w17, #64\n"                                  // JavaScriptCore/llint/LowLevelInterpreter64.asm:919
    "\tstrh w17, [x1, #0]\n"                                 // JavaScriptCore/llint/LowLevelInterpreter64.asm:919

i.e. a 16-bit load, followed by a 32-bit OR, followed by a 16-bit store.

This bug also affects ARM64, ARMv7, and MIPS (basically any backend that uses riscLowerMisplacedAddresses() from rise.rb).
It does not affect x86, x86_64, and C_LOOP (which was written based on x86).

<rdar://problem/21501876>
Comment 1 Mark Lam 2020-04-16 23:49:48 PDT
Created attachment 396743 [details]
proposed patch.
Comment 2 Robin Morisset 2020-04-17 01:25:36 PDT
Comment on attachment 396743 [details]
proposed patch.

r=me
Comment 3 Mark Lam 2020-04-17 07:39:50 PDT
Thanks for the review.  Landed in r260246: <http://trac.webkit.org/r260246>.