Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 85220 | Differences between
and this patch

Collapse All | Expand All

(-)src/HostCPU.cc.orig (-5 / +9 lines)
Lines 23-29 Link Here
23
			"pushfl;"
23
			"pushfl;"
24
			"popl	%%eax;"
24
			"popl	%%eax;"
25
			// Save current value.
25
			// Save current value.
26
			"movl	%%eax,%%ebx;"
26
			"movl	%%eax,%%ecx;"
27
			// Toggle bit 21.
27
			// Toggle bit 21.
28
			"xorl	$0x200000, %%eax;"
28
			"xorl	$0x200000, %%eax;"
29
			// Load EAX into EFLAGS.
29
			// Load EAX into EFLAGS.
Lines 33-61 Link Here
33
			"pushfl;"
33
			"pushfl;"
34
			"popl	%%eax;"
34
			"popl	%%eax;"
35
			// Did bit 21 change?
35
			// Did bit 21 change?
36
			"xor	%%ebx, %%eax;"
36
			"xor	%%ecx, %%eax;"
37
			"andl	$0x200000, %%eax;"
37
			"andl	$0x200000, %%eax;"
38
			: "=a" (hasCPUID) // 0
38
			: "=a" (hasCPUID) // 0
39
			: // no input
39
			: // no input
40
			: "ebx"
40
			: "ecx" // use ecx not ebx to avoid PIC abi clobber
41
			);
41
			);
42
		if (hasCPUID) {
42
		if (hasCPUID) {
43
			// Which CPUID calls are supported?
43
			// Which CPUID calls are supported?
44
			unsigned highest;
44
			unsigned highest;
45
			asm (
45
			asm (
46
				"pushl	%%ebx;"
46
				"cpuid;"
47
				"cpuid;"
48
				"popl	%%ebx;"
47
				: "=a" (highest) // 0
49
				: "=a" (highest) // 0
48
				: "0" (0) // 1: function
50
				: "0" (0) // 1: function
49
				: "ebx", "ecx", "edx"
51
				: "ecx", "edx" // ebx save/restored to avoid PIC abi clobber
50
				);
52
				);
51
			if (highest >= 1) {
53
			if (highest >= 1) {
52
				// Get features flags.
54
				// Get features flags.
53
				unsigned features;
55
				unsigned features;
54
				asm (
56
				asm (
57
					"pushl	%%ebx;"
55
					"cpuid;"
58
					"cpuid;"
59
					"pushl	%%ebx;"
56
					: "=d" (features) // 0
60
					: "=d" (features) // 0
57
					: "a" (1) // 1: function
61
					: "a" (1) // 1: function
58
					: "ebx", "ecx"
62
					: "ecx" // ebx save/restored to avoid PIC abi clobber
59
					);
63
					);
60
				PRT_DEBUG("CPU flags: " << std::hex << std::setw(8) << std::setfill('0') << std::uppercase << features);
64
				PRT_DEBUG("CPU flags: " << std::hex << std::setw(8) << std::setfill('0') << std::uppercase << features);
61
				mmxFlag = features & 0x800000;
65
				mmxFlag = features & 0x800000;
(-)src/video/SimpleScaler.cc.orig (-1 / +3 lines)
Lines 684-689 Link Here
684
			"paddw	%%mm4, %%mm0;"
684
			"paddw	%%mm4, %%mm0;"
685
			"paddw	%%mm5, %%mm1;"
685
			"paddw	%%mm5, %%mm1;"
686
			
686
			
687
			"movd	%%eax, %%mm6;" // save eax
687
			"pextrw	$0, %%mm0, %%eax;"
688
			"pextrw	$0, %%mm0, %%eax;"
688
			"movw	(%2,%%eax,2), %%ax;"
689
			"movw	(%2,%%eax,2), %%ax;"
689
			"pinsrw	$0, %%eax, %%mm0;"
690
			"pinsrw	$0, %%eax, %%mm0;"
Lines 711-716 Link Here
711
			"pextrw	$3, %%mm1, %%eax;"
712
			"pextrw	$3, %%mm1, %%eax;"
712
			"movw	(%2,%%eax,2), %%ax;"
713
			"movw	(%2,%%eax,2), %%ax;"
713
			"pinsrw	$3, %%eax, %%mm1;"
714
			"pinsrw	$3, %%eax, %%mm1;"
715
			"movd	%%mm6, %%eax;" // restore eax
714
			
716
			
715
			"movntq	%%mm0,   (%3,%%ecx,2);"
717
			"movntq	%%mm0,   (%3,%%ecx,2);"
716
			"movntq	%%mm1,  8(%3,%%ecx,2);"
718
			"movntq	%%mm1,  8(%3,%%ecx,2);"
Lines 726-732 Link Here
726
			, "r" (dst)   // 3
728
			, "r" (dst)   // 3
727
			, "m" (mask)   // 4
729
			, "m" (mask)   // 4
728
			: "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm7"
730
			: "mm0", "mm1", "mm2", "mm3", "mm4", "mm5", "mm7"
729
			, "eax", "ecx"
731
			, "ecx" // eax save/restored so available for 'r'
730
		);
732
		);
731
		return;
733
		return;
732
	}
734
	}

Return to bug 85220