Skip to content

  • Projects
  • Groups
  • Snippets
  • Help
  • This project
    • Loading...
  • Sign in / Register
S
swiftshader
  • Project
    • Overview
    • Details
    • Activity
    • Cycle Analytics
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Charts
  • Issues 0
    • Issues 0
    • List
    • Board
    • Labels
    • Milestones
  • Merge Requests 0
    • Merge Requests 0
  • CI / CD
    • CI / CD
    • Pipelines
    • Jobs
    • Schedules
    • Charts
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Members
    • Members
  • Collapse sidebar
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Chen Yisong
  • swiftshader
  • Repository

Switch branch/tag
  • swiftshader
  • third_party
  • subzero
  • src
  • IceInstX86Base.h
Find file
BlameHistoryPermalink
  • Antonio Maiorano's avatar
    Subzero: proper fix for assert(Dest->hasReg()) · 86dc7319
    Antonio Maiorano authored Dec 06, 2019
    Reverted the hack fix from bb222a10, and implemented a proper fix.
    
    The fix in TargetX86Base<TraitsType>::lowerCast
    (IceTargetLoweringX86BaseImpl.h) was suggested by Jim Stichnoth. The
    original problem is that we're trying movd an i32 to an i4i32, and since
    the target Variable is long-lived, it may not get a register allocated
    for it, and when that happens, we end up tripping the assert in
    InstX86Movd::emitIAS() that expects the destination to have been
    allocated a register. The solution that Jim suggested, and is
    implemented here, is to create a temporary, short-lived, variable to
    first movd into, which should guarantee a register target, since
    short-lived Variables usually get registers. Then we 'mov' the temporary
    register Variable to Dest, which *should* support moving the i4i32
    register operand to an i32 memory operand.
    
    I said *should* above, because with the above fix, we now trip another
    assert in InstX86Mov::emitIAS (Mov, not Movd). The reason being that it
    doesn't actually support moving an i4i32 reg -> i32 memory operand. I
    added support for this as well (IceInstX86BaseImpl.h). Note that this
    assert only tripped when building with Om1 optimization level, since O2
    ostensibly optimized out the mov call.
    
    Bug: b/145529686
    Change-Id: I3c998a3e308838123cb415fcbf9f277113ac7d28
    Reviewed-on: https://swiftshader-review.googlesource.com/c/SwiftShader/+/39068
    Kokoro-Presubmit: kokoro <noreply+kokoro@google.com>
    Reviewed-by: 's avatarNicolas Capens <nicolascapens@google.com>
    Tested-by: 's avatarAntonio Maiorano <amaiorano@google.com>
    86dc7319
IceInstX86Base.h 178 KB
EditWeb IDE
×

Replace IceInstX86Base.h

Attach a file by drag & drop or click to upload


Cancel
A new branch will be created in your fork and a new merge request will be started.