1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
// This file is part of x86_64-xsave. It is subject to the license terms in the COPYRIGHT file found in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/x86_64-xsave/master/COPYRIGHT. No part of x86_64-xsave, including this file, may be copied, modified, propagated, or distributed except according to the terms contained in the COPYRIGHT file.
// Copyright © 2019 The developers of x86_64-xsave. See the COPYRIGHT file in the top-level directory of this distribution and at https://raw.githubusercontent.com/lemonrock/x86_64-xsave/master/COPYRIGHT.


/// 32-bit mode or 64-bit mode without `REX.W` or `REX.W == 0` FPU instruction pointer (`FIP`).
#[derive(Default, Debug, Copy, Clone)]
#[repr(C)]
pub struct FloatingPointUnitDataPointerOffset32Bit
{
	/// x87 FPU Data Pointer Offset, `FDP`.
	pub data_pointer_offset: u32,

	/// x87 FPU Data Pointer Selector, `FDS` or `FPU DS`.
	///
	/// Value of a segmentation register.
	///
	/// If `CPUID.(EAX=07H,ECX=0H):EBX[bit 13] = 1`, the processor deprecates `FCS` and `FDS`, and this field is saved as 0x0000.
	pub data_pointer_selector: u16,

	reserved: u16,
}

impl PartialEq for FloatingPointUnitDataPointerOffset32Bit
{
	#[inline(always)]
	fn eq(&self, other: &Self) -> bool
	{
		self.data_pointer_selector == other.data_pointer_selector && self.data_pointer_offset == other.data_pointer_offset
	}
}

impl Eq for FloatingPointUnitDataPointerOffset32Bit
{
}

impl PartialOrd for FloatingPointUnitDataPointerOffset32Bit
{
	#[inline(always)]
	fn partial_cmp(&self, other: &Self) -> Option<Ordering>
	{
		Some(self.cmp(other))
	}
}

impl Ord for FloatingPointUnitDataPointerOffset32Bit
{
	#[inline(always)]
	fn cmp(&self, other: &Self) -> Ordering
	{
		self.data_pointer_selector.cmp(&other.data_pointer_selector).then_with(|| self.data_pointer_offset.cmp(&other.data_pointer_offset))
	}
}

impl Hash for FloatingPointUnitDataPointerOffset32Bit
{
	#[inline(always)]
	fn hash<H: Hasher>(&self, state: &mut H)
	{
		self.data_pointer_selector.hash(state);
		self.data_pointer_offset.hash(state)
	}
}