mirror of
https://github.com/tobast/libunwind-eh_elf.git
synced 2025-01-12 12:03:43 +01:00
[X86] Cleanup XMM handling for x86
* Use explicit types for XMM registers * Support full width (128 bits) access Signed-off-by: Andrew Cagney <cagney@redhat.com> Signed-off-by: Arun Sharma <aruns@google.com>
This commit is contained in:
parent
32145b680d
commit
a8be10e251
5 changed files with 47 additions and 4 deletions
|
@ -48,7 +48,11 @@ extern "C" {
|
|||
typedef uint32_t unw_word_t;
|
||||
typedef int32_t unw_sword_t;
|
||||
|
||||
typedef long double unw_tdep_fpreg_t;
|
||||
typedef union {
|
||||
struct { uint8_t b[4]; } val32;
|
||||
struct { uint8_t b[10]; } val80;
|
||||
struct { uint8_t b[16]; } val128;
|
||||
} unw_tdep_fpreg_t;
|
||||
|
||||
typedef enum
|
||||
{
|
||||
|
@ -131,7 +135,16 @@ typedef enum
|
|||
/* frame info (read-only) */
|
||||
UNW_X86_CFA,
|
||||
|
||||
UNW_TDEP_LAST_REG = UNW_X86_LDT,
|
||||
UNW_X86_XMM0, /* scratch */
|
||||
UNW_X86_XMM1, /* scratch */
|
||||
UNW_X86_XMM2, /* scratch */
|
||||
UNW_X86_XMM3, /* scratch */
|
||||
UNW_X86_XMM4, /* scratch */
|
||||
UNW_X86_XMM5, /* scratch */
|
||||
UNW_X86_XMM6, /* scratch */
|
||||
UNW_X86_XMM7, /* scratch */
|
||||
|
||||
UNW_TDEP_LAST_REG = UNW_X86_XMM7,
|
||||
|
||||
UNW_TDEP_IP = UNW_X86_EIP,
|
||||
UNW_TDEP_SP = UNW_X86_CFA,
|
||||
|
|
|
@ -94,6 +94,14 @@ unw_get_save_loc (unw_cursor_t *cursor, int reg, unw_save_loc_t *sloc)
|
|||
case UNW_X86_XMM6_hi:
|
||||
case UNW_X86_XMM7_lo:
|
||||
case UNW_X86_XMM7_hi:
|
||||
case UNW_X86_XMM0:
|
||||
case UNW_X86_XMM1:
|
||||
case UNW_X86_XMM2:
|
||||
case UNW_X86_XMM3:
|
||||
case UNW_X86_XMM4:
|
||||
case UNW_X86_XMM5:
|
||||
case UNW_X86_XMM6:
|
||||
case UNW_X86_XMM7:
|
||||
loc = x86_scratch_loc (c, reg);
|
||||
break;
|
||||
|
||||
|
|
|
@ -97,6 +97,17 @@ linux_scratch_loc (struct cursor *c, unw_regnum_t reg)
|
|||
is_fpstate = 1;
|
||||
off = LINUX_FPSTATE_XMM0_OFF + 8*(reg - UNW_X86_XMM0_lo);
|
||||
break;
|
||||
case UNW_X86_XMM0:
|
||||
case UNW_X86_XMM1:
|
||||
case UNW_X86_XMM2:
|
||||
case UNW_X86_XMM3:
|
||||
case UNW_X86_XMM4:
|
||||
case UNW_X86_XMM5:
|
||||
case UNW_X86_XMM6:
|
||||
case UNW_X86_XMM7:
|
||||
is_fpstate = 1;
|
||||
off = LINUX_FPSTATE_XMM0_OFF + 16*(reg - UNW_X86_XMM0);
|
||||
break;
|
||||
|
||||
case UNW_X86_FOP:
|
||||
case UNW_X86_TSS:
|
||||
|
@ -235,6 +246,14 @@ tdep_access_fpreg (struct cursor *c, unw_regnum_t reg, unw_fpreg_t *valp,
|
|||
case UNW_X86_ST6:
|
||||
case UNW_X86_ST7:
|
||||
/* SSE fp registers */
|
||||
case UNW_X86_XMM0:
|
||||
case UNW_X86_XMM1:
|
||||
case UNW_X86_XMM2:
|
||||
case UNW_X86_XMM3:
|
||||
case UNW_X86_XMM4:
|
||||
case UNW_X86_XMM5:
|
||||
case UNW_X86_XMM6:
|
||||
case UNW_X86_XMM7:
|
||||
case UNW_X86_XMM0_lo:
|
||||
case UNW_X86_XMM0_hi:
|
||||
case UNW_X86_XMM1_lo:
|
||||
|
|
|
@ -29,5 +29,6 @@ PROTECTED int
|
|||
unw_is_fpreg (int regnum)
|
||||
{
|
||||
return ((regnum >= UNW_X86_ST0 && regnum <= UNW_X86_ST7)
|
||||
|| (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi));
|
||||
|| (regnum >= UNW_X86_XMM0_lo && regnum <= UNW_X86_XMM7_hi)
|
||||
|| (regnum >= UNW_X86_XMM0 && regnum <= UNW_X86_XMM7));
|
||||
}
|
||||
|
|
|
@ -12,7 +12,9 @@ static const char *regname[] =
|
|||
"xmm6_lo", "xmm6_hi", "xmm7_lo", "xmm7_hi",
|
||||
"mxcsr",
|
||||
"gs", "fs", "es", "ds", "ss", "cs",
|
||||
"tss", "ldt"
|
||||
"tss", "ldt",
|
||||
"cfi",
|
||||
"xmm0", "xmm1", "xmm2", "xmm3", "xmm4", "xmm5", "xmm6", "xmm7",
|
||||
};
|
||||
|
||||
PROTECTED const char *
|
||||
|
|
Loading…
Reference in a new issue