[PATCH] D86461: [AIX][XCOFF] decode vector information and extent long table of the traceback table of the xcoff.

Digger via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Aug 24 07:36:10 PDT 2020


DiggerLin created this revision.
DiggerLin added reviewers: hubert.reinterpretcast, jasonliu, jhenderson.
Herald added subscribers: llvm-commits, hiraditya, kristof.beyls.
Herald added a project: LLVM.
DiggerLin requested review of this revision.

1. decode the Vector extension if has_vec is set
2. decode long table fields, if longtbtable is set.

for the convenient to review , I copy some related code from the /usr/include/sys/debug.h of aix os

-
- Vector extension portion of the optional table (if has_vec is set). */

struct vec_ext {

  unsigned vr_saved:6;    /* Number of non-volatile vector regs saved */
                          /* first register saved is assumed to be */
                          /* 32 - vr_saved                         */
  unsigned saves_vrsave:1;/* Set if vrsave is saved on the stack */
  unsigned has_varargs:1;
  unsigned vectorparms:7; /* number of vector parameters */
  unsigned vec_present:1; /* Set if routine performs vmx instructions */
  unsigned char vecparminfo[4];/* bitmask array for each vector parm in */
                           /* order as found in the original parminfo, */
                           /* describes the type of vector:            */
                           /*       b'00 = vector char                 */
                           /*       b'01 = vector short                */
                           /*       b'10 = vector int                  */
                           /*       b'11 = vector float                */

};

/*

- Optional portions of procedure-end table. *
- Optional portions exist in the following order independently, not as
- a structure or an union. Whether or not portions exist is determinable
- from bit-fields within the base procedure-end table. *
- parminfo      exists if fixedparms or floatparms != 0.
- tb_offset     exists if has_tboff bit is set.
- hand_mask     exists if int_hndl bit is set.
- ctl_info      exists if has_ctl bit is set.
- ctl_info_disp exists if ctl_info exists.
- name_len      exists if name_present bit is set.
- name          exists if name_len exists.
- alloca_reg    exists if uses_alloca bit is set.
- vec_ext       exists if has_vec bit is set. */

struct tbtable_ext {

  unsigned int parminfo;  /* Order and type encoding of parameters:
                           * Left-justified bit-encoding as follows:
                           * '0'  ==> fixed parameter
                           * '10' ==> single-precision float parameter
                           * '11' ==> double-precision float parameter
                           *
                           * if has_vec is set, encoded as follows:
                           * '00' ==> fixed parameter
                           * '01' ==> vector parameter
                           * '10' ==> single-precision float parameter
                           * '11' ==> double-precision float parameter
                           */
  unsigned int tb_offset; /* Offset from start of code to tb table */
  int hand_mask;          /* What interrupts are handled by */
  int ctl_info;           /* Number of CTL anchors, followed by */
  int ctl_info_disp[1];   /* Actually ctl_info_disp[ctl_info] */
                          /* Displacements into stack of each anchor */
  short name_len;         /* Length of procedure name */
  char name[1];           /* Actually char[name_len] (no NULL) */
  char alloca_reg;        /* Register for alloca automatic storage */
  struct vec_ext vec_ext; /* Vector extension (if has_vec is set) */
  unsigned char xtbtable; /* More tbtable fields, if longtbtable is set*/

};


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D86461

Files:
  llvm/include/llvm/BinaryFormat/XCOFF.h
  llvm/include/llvm/Object/XCOFFObjectFile.h
  llvm/lib/Object/XCOFFObjectFile.cpp
  llvm/unittests/Object/XCOFFObjectFileTest.cpp

-------------- next part --------------
A non-text attachment was scrubbed...
Name: D86461.287382.patch
Type: text/x-patch
Size: 14091 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20200824/1c2123bf/attachment.bin>


More information about the llvm-commits mailing list