detached 0789956

purego: refactor struct_amd64.go (#212)

commit
07899564f3c44b9b4f56b58d3a40e9711963e2b4
author
Hajime Hoshi · · 2024-02-20 13:46 UTC
committer
GitHub · · 2024-02-20 13:46 UTC
parent
29473c6
signature
GPG UnverifiedB5690EEEBB952194 The key is unknown
refs
tag: v0.7.0-alpha.1
1 file · +6 -5
M struct_amd64.go +6 -5
@@ -76,7 +76,10 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
7676 var shift byte // # of bits to shift
7777 var flushed bool
7878 class := _NO_CLASS
79- flush := func() {
79+ flushIfNeeded := func() {
80+ if flushed {
81+ return
82+ }
8083 flushed = true
8184 if class == _SSE {
8285 addFloat(uintptr(val))
@@ -167,7 +170,7 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
167170 }
168171
169172 if shift == 64 {
170- flush()
173+ flushIfNeeded()
171174 } else if shift > 64 {
172175 // Should never happen, but may if we forget to reset shift after flush (or forget to flush),
173176 // better fall apart here, than corrupt arguments.
@@ -177,9 +180,7 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
177180 }
178181
179182 place(v)
180- if !flushed {
181- flush()
182- }
183+ flushIfNeeded()
183184 return ok
184185 }
185186
@@ -76,7 +76,10 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
76 var shift byte // # of bits to shift76 var shift byte // # of bits to shift
77 var flushed bool77 var flushed bool
78 class := _NO_CLASS78 class := _NO_CLASS
79- flush := func() {79+ flushIfNeeded := func() {
80+ if flushed {
81+ return
82+ }
80 flushed = true83 flushed = true
81 if class == _SSE {84 if class == _SSE {
82 addFloat(uintptr(val))85 addFloat(uintptr(val))
@@ -167,7 +170,7 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
167 }170 }
168 171
169 if shift == 64 {172 if shift == 64 {
170- flush()173+ flushIfNeeded()
171 } else if shift > 64 {174 } else if shift > 64 {
172 // Should never happen, but may if we forget to reset shift after flush (or forget to flush),175 // Should never happen, but may if we forget to reset shift after flush (or forget to flush),
173 // better fall apart here, than corrupt arguments.176 // better fall apart here, than corrupt arguments.
@@ -177,9 +180,7 @@ func tryPlaceRegister(v reflect.Value, addFloat func(uintptr), addInt func(uintp
177 }180 }
178 181
179 place(v)182 place(v)
180- if !flushed {183+ flushIfNeeded()
181- flush()
182- }
183 return ok184 return ok
184 }185 }
185 186

Keyboard shortcuts

Single-key shortcuts are on. ctrl k and esc work whatever this says.

ctrl k :
go to a section, branch, tag, file or repository
?
this list
j k
move the row cursor down / up
enter
open the row under the cursor; on Files, a directory opens or closes in place
↑ ↓ ← → home end
in the file tree (focus on a row): previous / next row, close / open a directory or go to its parent / first entry, first / last row. They never open a file
l h
on Files: open a directory or a file / close a directory or go up to its parent, then to the parent page. Elsewhere: into the side panel (on a merge request, its files) / back to the content; there j k move between its controls
g g G
first / last row
/
filter the list; on Files, find a file anywhere in the repository (esc clears, enter opens the best match)
b
switch branch or tag
g s g f g c g b g m g i g r g a
tabs: summary, files, commits, branches & tags, merge requests, issues, releases, actions (when available)
g h
home
w
wide mode: use the whole width of the screen, or not (remembered)
y
copy a permalink pinned to the commit
d u x
diff: split / unified / collapse or expand all
e E
diff: the whole file in view / every file, with the lines the hunks hide
n
merge request: next note in the diff
esc
close a dialog, leave a field

Branches 1

Tags 102

↑↓ moveenter openesc close