Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • M mu-impl-fast
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 40
    • Issues 40
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 1
    • Merge requests 1
  • Deployments
    • Deployments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • Repository
  • Activity
  • Graph
  • Create a new issue
  • Commits
  • Issue Boards
Collapse sidebar

GitLab will continue to be upgraded on 7 Feb 2023 from 2.00 pm (AEDT) to 3.00 pm (AEDT). During the update, GitLab and Mattermost services will not be available. If you have any concerns with this, please talk to us at N110 (b) CSIT building.

  • mumu
  • mu-impl-fast
  • Issues
  • #22
Closed
Open
Issue created Apr 28, 2017 by Yi Lin@u4776528Owner

[x86_64] Status flags undefined for mul/div/idiv

The following table summerizes how Mu integer binops are mapped to x86_64 insts, and how x86_64 insts affect status flags.

Mu IR X86_64 Inst #N (signed) #Z (zero) #C (carry) #V (overflow)
ADD add ✓ ✓ ✓ ✓
SUB sub ✓ ✓ ✓ ✓
AND and ✓ ✓ - -
OR or ✓ ✓ - -
XOR xor ✓ ✓ - -
MUL mul ✗ ✗ ✓ ✓
UDIV div ✗ ✗ - -
SDIV idiv ✗ ✗ - -
UREM div ✗ ✗ - -
SREM idiv ✗ ✗ - -
SHL shl ✓ ✓ - -
LSHR shr ✓ ✓ - -
ASHR sar ✓ ✓ - -

mul, div and idiv generate undefined signed flag (#N), and zero flag(#Z). We will need to generate extra code to check, and set those flags.

Assignee
Assign to
Time tracking