-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy path192+Negation.swift
50 lines (38 loc) · 1.49 KB
/
192+Negation.swift
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
//=----------------------------------------------------------------------------=
// This source file is part of the AwesomeNumbersKit open source project.
//
// Copyright (c) 2022 Oscar Byström Ericsson
// Licensed under Apache License, Version 2.0
//
// See http://www.apache.org/licenses/LICENSE-2.0 for license information.
//=----------------------------------------------------------------------------=
#if !DEBUG
import ANKCoreKit
import ANKFullWidthKit
import XCTest
private typealias X = ANK.U192X64
private typealias Y = ANK.U192X32
//*============================================================================*
// MARK: * ANK x Int192 x Negation
//*============================================================================*
final class Int192BenchmarksOnNegation: XCTestCase {
typealias T = Int192
//=------------------------------------------------------------------------=
// MARK: Tests
//=------------------------------------------------------------------------=
func testNegated() {
var abc = ANK.blackHoleIdentity(T(x64: X(0, 1, 2)))
for _ in 0 ..< 5_000_000 {
ANK.blackHole(-abc)
ANK.blackHoleInoutIdentity(&abc)
}
}
func testNegatedReportingOverflow() {
var abc = ANK.blackHoleIdentity(T(x64: X(0, 1, 2)))
for _ in 0 ..< 5_000_000 {
ANK.blackHole(abc.negatedReportingOverflow())
ANK.blackHoleInoutIdentity(&abc)
}
}
}
#endif