Skip to content

Commit c34358d

Browse files
Remove an overly fragile test for armv7k (#19646)
We're not actually sure what this test is trying to validate, but it's quite fragile and probably not the best way to test it. Remove it rather than continuing to blindly update it. Also minor improvements for the generic converts on 32b platforms; there's still more to be done with these, but this keeps us on the HW path for the common case.
1 parent e5e61d4 commit c34358d

File tree

2 files changed

+5
-71
lines changed

2 files changed

+5
-71
lines changed

stdlib/public/core/FloatingPointTypes.swift.gyb

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,13 +1595,13 @@ extension ${Self} {
15951595
// falling back on the generic _convert operation otherwise.
15961596
@_transparent
15971597
public init<Source : BinaryInteger>(_ value: Source) {
1598-
if value.bitWidth <= 64 {
1598+
if value.bitWidth <= ${word_bits} {
15991599
if Source.isSigned {
1600-
let asI64 = Int64(truncatingIfNeeded: value)
1601-
_value = Builtin.sitofp_Int64_FPIEEE${bits}(asI64._value)
1600+
let asInt = Int(truncatingIfNeeded: value)
1601+
_value = Builtin.sitofp_Int${word_bits}_FPIEEE${bits}(asInt._value)
16021602
} else {
1603-
let asU64 = Int64(truncatingIfNeeded: value)
1604-
_value = Builtin.uitofp_Int64_FPIEEE${bits}(asU64._value)
1603+
let asUInt = Int(truncatingIfNeeded: value)
1604+
_value = Builtin.uitofp_Int${word_bits}_FPIEEE${bits}(asUInt._value)
16051605
}
16061606
} else {
16071607
self = ${Self}._convert(from: value).value

test/IRGen/abi_v7k.swift

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -337,69 +337,3 @@ func minMax3(x : Int, y : Int) -> Ret? {
337337
var r = Ret(min:currentMin, max:currentMax, min2:currentMin, max2:currentMax, min3:currentMin, max3:currentMax)
338338
return r
339339
}
340-
341-
// Passing struct: Int8, MyPoint x 10, MySize * 10
342-
// CHECK-LABEL: define hidden swiftcc double @"$s8test_v7k0A4Ret5{{.*}}"(%T8test_v7k7MyRect3V* noalias nocapture dereferenceable(328))
343-
// V7K-LABEL: _$s8test_v7k0A4Ret5
344-
// V7K: ldrb r1, [r0]
345-
// V7K: strb.w r1, [sp, #52]
346-
// V7K: ldrsb.w r1, [sp, #52]
347-
// V7K: vmov s0, r1
348-
// V7K: vcvt.f64.s32 d16, s0
349-
// V7K: ldr r1, [r0, #8]
350-
// V7K: str r1, [sp, #24]
351-
// V7K: ldr r1, [r0, #12]
352-
// V7K: str r1, [sp, #28]
353-
// V7K: ldr r1, [r0, #16]
354-
// V7K: str r1, [sp, #32]
355-
// V7K: ldr r1, [r0, #20]
356-
// V7K: str r1, [sp, #36]
357-
// V7K: ldr r1, [sp, #24]
358-
// V7K: str r1, [sp, #40]
359-
// V7K: ldr r1, [sp, #28]
360-
// V7K: str r1, [sp, #44]
361-
// V7K: vldr d18, [sp, #40]
362-
// V7K: vadd.f64 d16, d16, d18
363-
// V7K: ldr.w r1, [r0, #296]
364-
// V7K: str r1, [sp]
365-
// V7K: ldr.w r1, [r0, #300]
366-
// V7K: str r1, [sp, #4]
367-
// V7K: ldr.w r1, [r0, #304]
368-
// V7K: str r1, [sp, #8]
369-
// V7K: ldr.w r0, [r0, #308]
370-
// V7K: str r0, [sp, #12]
371-
// V7K: ldr r0, [sp]
372-
// V7K: str r0, [sp, #16]
373-
// V7K: ldr r0, [sp, #4]
374-
// V7K: str r0, [sp, #20]
375-
// V7K: vldr d18, [sp, #16]
376-
// V7K: vadd.f64 d0, d16, d18
377-
// V7K: add sp, #56
378-
// V7K: bx lr
379-
380-
struct MyRect3 {
381-
var t: Int8
382-
var p: MyPoint
383-
var p2: MyPoint
384-
var s: MySize
385-
var s2: MySize
386-
var p3: MyPoint
387-
var p4: MyPoint
388-
var s3: MySize
389-
var s4: MySize
390-
var p5: MyPoint
391-
var p6: MyPoint
392-
var s5: MySize
393-
var s6: MySize
394-
var p7: MyPoint
395-
var p8: MyPoint
396-
var s7: MySize
397-
var s8: MySize
398-
var p9: MyPoint
399-
var p10: MyPoint
400-
var s9: MySize
401-
var s10: MySize
402-
}
403-
func testRet5(r: MyRect3) -> Double {
404-
return Double(r.t) + r.p.x + r.s9.w
405-
}

0 commit comments

Comments
 (0)