unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
blob 1996a1dfe6e865c403e626234a6f115656cb7a46 2330 bytes (raw)
name: gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch 	 # note: path name is non-authoritative(*)

 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
 
'Retpoline' mitigation technique for Spectre (branch target injection)
[CVE-2017-5715]:

https://security.googleblog.com/2018/01/more-details-about-mitigations-for-cpu_4.html
https://support.google.com/faqs/answer/7625886
https://spectreattack.com/
https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2017-5715

Patch copied from the 'retpoline-20180107' branch of upstream source repository
(please add new / update existing patches when new 'retpoline-xxxxxxxx' branch
appears):

http://git.infradead.org/users/dwmw2/gcc-retpoline.git

From f83391fb22471a2f1c330e2e78f64630d64f497d Mon Sep 17 00:00:00 2001
From: "H.J. Lu" <hjl.tools@gmail.com>
Date: Tue, 19 Dec 2017 08:28:36 -0800
Subject: [PATCH 16/17] i386: Add 'V' register operand modifier

For

void
bar (void (*func) (void))
{
  asm("call *%V0" : : "r"(func));
}

it generates:

bar:
	call *rdi
	ret
---
 gcc/config/i386/i386.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/gcc/config/i386/i386.c b/gcc/config/i386/i386.c
index 344cafe3dac..6cb0681233a 100644
--- a/gcc/config/i386/i386.c
+++ b/gcc/config/i386/i386.c
@@ -17886,6 +17886,7 @@ put_condition_code (enum rtx_code code, machine_mode mode, bool reverse,
    If CODE is 'h', pretend the reg is the 'high' byte register.
    If CODE is 'y', print "st(0)" instead of "st", if the reg is stack op.
    If CODE is 'd', duplicate the operand for AVX instruction.
+   If CODE is 'V', print naked register name without %.
  */
 
 void
@@ -17896,7 +17897,7 @@ print_reg (rtx x, int code, FILE *file)
   unsigned int regno;
   bool duplicated;
 
-  if (ASSEMBLER_DIALECT == ASM_ATT)
+  if (ASSEMBLER_DIALECT == ASM_ATT && code != 'V')
     putc ('%', file);
 
   if (x == pc_rtx)
@@ -18063,6 +18064,7 @@ print_reg (rtx x, int code, FILE *file)
    & -- print some in-use local-dynamic symbol name.
    H -- print a memory address offset by 8; used for sse high-parts
    Y -- print condition for XOP pcom* instruction.
+   V -- print naked register name without %.
    + -- print a branch hint as 'cs' or 'ds' prefix
    ; -- print a semicolon (after prefixes due to bug in older gas).
    ~ -- print "i" if TARGET_AVX2, "f" otherwise.
@@ -18287,6 +18289,7 @@ ix86_print_operand (FILE *file, rtx x, int code)
 	case 'X':
 	case 'P':
 	case 'p':
+	case 'V':
 	  break;
 
 	case 's':
-- 
2.15.1


debug log:

solving 1996a1dfe ...
found 1996a1dfe in https://yhetil.org/guix-patches/877esksi62.fsf@gmail.com/

applying [1/1] https://yhetil.org/guix-patches/877esksi62.fsf@gmail.com/
diff --git a/gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch b/gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch
new file mode 100644
index 000000000..1996a1dfe

1:53: trailing whitespace.
 
1:58: trailing whitespace.
 
1:62: trailing whitespace.
 
1:73: space before tab in indent.
 	case 'X':
1:74: space before tab in indent.
 	case 'P':
Checking patch gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch...
Applied patch gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch cleanly.
warning: squelched 6 whitespace errors
warning: 11 lines add whitespace errors.

index at:
100644 1996a1dfe6e865c403e626234a6f115656cb7a46	gnu/packages/patches/gcc-retpoline-i386-Add-V-register-operand-modifier.patch

(*) Git path names are given by the tree(s) the blob belongs to.
    Blobs themselves have no identifier aside from the hash of its contents.^

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).