Opened 14 months ago

Last modified 14 months ago

#15682 new bug

evolve / improve Native Gen Format in Format.hs (especially in context of post simd cleanup)

Reported by: carter Owned by:
Priority: normal Milestone: 8.6.1
Component: Compiler Version: 8.6.1
Keywords: Cc:
Operating System: Unknown/Multiple Architecture: Unknown/Multiple
Type of failure: None/Unknown Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

Currently GlobalReg represents the STG machine registers. However, some STG registers get aliased to the same machine registers (e.g. FloatReg 1 and DoubleReg 1; see Note [Overlapping global registers]). To make matters worse, we assume that we can always determine the CmmType of a GlobalReg. However, in the case of SIMD registers this isn't necessarily the case (e.g. a XMM register may contain 1 or 2 double-precision floats, or 1, 2, 4, 8, or 16 integers).

for ghc/compiler/nativeGen/Format.hs

data Format
        = II8
        | II16
        | II32
        | II64
        | FF32
        | FF64
        | FF80
        deriving (Show, Eq)

currently this is meant to "encode" both physical bit size AND which register class the value is. we also have the issue that this register class distinction stops being true once simd integer operations.

this gets worse with simd once we want to track (perhaps?) the size / number of elements used in the xmm/ymm/zmm / arm simd vectors.

perhaps also: signedness?

this actually also relates to how GlobalRegisters and Format are related! is GlobalRegisters meant for STG machine vs native Machine?

this intersects with ABI questions. Plus we currently have eg Float and Double which are different logically/semantically, BUT the same registers in most native machine architectures

Change History (1)

comment:1 Changed 14 months ago by simonpj

Yes, this is a bit of a mess. It would help to a clear problem statement, with goals and constraints; and perhaps possible solutions. Then we can have a well-informed design debate. I for one am quite at sea about what the difficulties are, and how hard/easy they are to fix. Thanks!

Note: See TracTickets for help on using tickets.