[Lldb-commits] [lldb] r297880 - [debugserver] NFC. One more small cleanup to DNBArchImplX86_64::SetFPUState
Chris Bieneman via lldb-commits
lldb-commits at lists.llvm.org
Wed Mar 15 12:52:58 PDT 2017
Author: cbieneman
Date: Wed Mar 15 14:52:57 2017
New Revision: 297880
URL: http://llvm.org/viewvc/llvm-project?rev=297880&view=rev
Log:
[debugserver] NFC. One more small cleanup to DNBArchImplX86_64::SetFPUState
This is another similar cleanup to other changes I've been making to simplify the AVX code in debugserver.
Modified:
lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
Modified: lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp?rev=297880&r1=297879&r2=297880&view=diff
==============================================================================
--- lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp (original)
+++ lldb/trunk/tools/debugserver/source/MacOSX/x86_64/DNBArchImplX86_64.cpp Wed Mar 15 14:52:57 2017
@@ -411,21 +411,17 @@ kern_return_t DNBArchImplX86_64::SetFPUS
m_state.SetError(e_regSetFPU, Write, 0);
return m_state.GetError(e_regSetFPU, Write);
} else {
+ int flavor = __x86_64_FLOAT_STATE;
+ mach_msg_type_number_t count = e_regSetWordSizeFPU;
if (CPUHasAVX() || FORCE_AVX_REGS) {
- m_state.SetError(
- e_regSetFPU, Write,
- ::thread_set_state(m_thread->MachPortNumber(), __x86_64_AVX_STATE,
- (thread_state_t)&m_state.context.fpu.avx,
- e_regSetWordSizeAVX));
- return m_state.GetError(e_regSetFPU, Write);
- } else {
- m_state.SetError(
- e_regSetFPU, Write,
- ::thread_set_state(m_thread->MachPortNumber(), __x86_64_FLOAT_STATE,
- (thread_state_t)&m_state.context.fpu.no_avx,
- e_regSetWordSizeFPU));
- return m_state.GetError(e_regSetFPU, Write);
+ flavor = __x86_64_AVX_STATE;
+ count = e_regSetWordSizeAVX;
}
+ m_state.SetError(
+ e_regSetFPU, Write,
+ ::thread_set_state(m_thread->MachPortNumber(), flavor,
+ (thread_state_t)&m_state.context.fpu, count));
+ return m_state.GetError(e_regSetFPU, Write);
}
}
More information about the lldb-commits
mailing list