Skip to content

Commit 2935c09

Browse files
committed
stdlib: rename x86_64 variables to be generic
Rename some of the variables in the VaListBuilder path to be agnostic to the architecture. SSE is x86 specific, by renaming the variables to hide the fact that the path is x86 specific, we will be able to share some of the code with arm64 (where the analogous hardware is the VFP).
1 parent f52085a commit 2935c09

File tree

2 files changed

+20
-20
lines changed

2 files changed

+20
-20
lines changed

stdlib/public/core/VarArgs.swift

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -80,11 +80,11 @@ internal let _countGPRegisters = 6
8080
// from 8 to 16 based on reading the spec, probably the bug you're looking for
8181
// is elsewhere.
8282
@usableFromInline
83-
internal let _countSSERegisters = 8
83+
internal let _countFPRegisters = 8
8484
@usableFromInline
85-
internal let _sseRegisterWords = 2
85+
internal let _fpRegisterWords = 2
8686
@usableFromInline
87-
internal let _registerSaveWords = _countGPRegisters + _countSSERegisters * _sseRegisterWords
87+
internal let _registerSaveWords = _countGPRegisters + _countFPRegisters * _fpRegisterWords
8888
#elseif arch(s390x)
8989
@usableFromInline
9090
internal let _countGPRegisters = 16
@@ -424,14 +424,14 @@ final internal class _VaListBuilder {
424424
#if arch(x86_64)
425425
let isDouble = arg is _CVarArgPassedAsDouble
426426

427-
if isDouble && sseRegistersUsed < _countSSERegisters {
427+
if isDouble && fpRegistersUsed < _countFPRegisters {
428428
var startIndex = _countGPRegisters
429-
+ (sseRegistersUsed * _sseRegisterWords)
429+
+ (fpRegistersUsed * _fpRegisterWords)
430430
for w in encoded {
431431
storage[startIndex] = w
432432
startIndex += 1
433433
}
434-
sseRegistersUsed += 1
434+
fpRegistersUsed += 1
435435
}
436436
else if encoded.count == 1
437437
&& !isDouble
@@ -472,7 +472,7 @@ final internal class _VaListBuilder {
472472
@usableFromInline // FIXME(sil-serialize-all)
473473
internal var gpRegistersUsed = 0
474474
@usableFromInline // FIXME(sil-serialize-all)
475-
internal var sseRegistersUsed = 0
475+
internal var fpRegistersUsed = 0
476476

477477
@usableFromInline // FIXME(sil-serialize-all)
478478
final // Property must be final since it is used by Builtin.addressof.

test/api-digester/Inputs/stdlib-stable-abi.json

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -242778,8 +242778,8 @@
242778242778
},
242779242779
{
242780242780
"kind": "Var",
242781-
"name": "_countSSERegisters",
242782-
"printedName": "_countSSERegisters",
242781+
"name": "_countFPRegisters",
242782+
"printedName": "_countFPRegisters",
242783242783
"children": [
242784242784
{
242785242785
"kind": "TypeNominal",
@@ -242800,13 +242800,13 @@
242800242800
}
242801242801
],
242802242802
"declKind": "Accessor",
242803-
"usr": "s:s18_countSSERegistersSivg",
242803+
"usr": "s:s17_countFPRegistersSivg",
242804242804
"moduleName": "Swift",
242805242805
"implicit": true
242806242806
}
242807242807
],
242808242808
"declKind": "Var",
242809-
"usr": "s:s18_countSSERegistersSivp",
242809+
"usr": "s:s17_countFPRegistersSivp",
242810242810
"moduleName": "Swift",
242811242811
"declAttributes": [
242812242812
"HasInitialValue",
@@ -242817,8 +242817,8 @@
242817242817
},
242818242818
{
242819242819
"kind": "Var",
242820-
"name": "_sseRegisterWords",
242821-
"printedName": "_sseRegisterWords",
242820+
"name": "_fpRegisterWords",
242821+
"printedName": "_fpRegisterWords",
242822242822
"children": [
242823242823
{
242824242824
"kind": "TypeNominal",
@@ -242839,13 +242839,13 @@
242839242839
}
242840242840
],
242841242841
"declKind": "Accessor",
242842-
"usr": "s:s17_sseRegisterWordsSivg",
242842+
"usr": "s:s16_fpRegisterWordsSivg",
242843242843
"moduleName": "Swift",
242844242844
"implicit": true
242845242845
}
242846242846
],
242847242847
"declKind": "Var",
242848-
"usr": "s:s17_sseRegisterWordsSivp",
242848+
"usr": "s:s16_fpRegisterWordsSivp",
242849242849
"moduleName": "Swift",
242850242850
"declAttributes": [
242851242851
"HasInitialValue",
@@ -243445,8 +243445,8 @@
243445243445
},
243446243446
{
243447243447
"kind": "Var",
243448-
"name": "sseRegistersUsed",
243449-
"printedName": "sseRegistersUsed",
243448+
"name": "fpRegistersUsed",
243449+
"printedName": "fpRegistersUsed",
243450243450
"children": [
243451243451
{
243452243452
"kind": "TypeNominal",
@@ -243467,7 +243467,7 @@
243467243467
}
243468243468
],
243469243469
"declKind": "Accessor",
243470-
"usr": "s:s14_VaListBuilderC16sseRegistersUsedSivg",
243470+
"usr": "s:s14_VaListBuilderC16fpRegistersUsedSivg",
243471243471
"moduleName": "Swift",
243472243472
"implicit": true,
243473243473
"declAttributes": [
@@ -243477,7 +243477,7 @@
243477243477
}
243478243478
],
243479243479
"declKind": "Var",
243480-
"usr": "s:s14_VaListBuilderC16sseRegistersUsedSivp",
243480+
"usr": "s:s14_VaListBuilderC15fpRegistersUsedSivp",
243481243481
"moduleName": "Swift",
243482243482
"declAttributes": [
243483243483
"Final",
@@ -244158,4 +244158,4 @@
244158244158
"isInternal": true
244159244159
}
244160244160
]
244161-
}
244161+
}

0 commit comments

Comments
 (0)