Commit da9dded
committed
[libclc] Move sqrt to CLC library
This is fairly straightforward for most targets.
AMDGPU provides its own implementation of sqrt for double types. This
commit moves this into the implementation of CLC sqrt. It uses weak
linkage on the 'default' CLC sqrt to allow AMDGPU to only override the
builtin for the types it cares about.
Since we don't yet have CLC ldexp, and AMDGPU prefers the builtin
anyway, it also uses __builtin_ldexp.
There are no changes to the codegen for any AMDGPU target. There is some
minor code movement on NVIDIA targets.1 parent 8bea511 commit da9dded
File tree
12 files changed
+47
-55
lines changed- libclc
- amdgpu/lib
- clc
- include/clc
- float
- math
- lib
- amdgpu
- math
- generic
- math
- generic/lib
- math
12 files changed
+47
-55
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| 31 | + | |
31 | 32 | | |
32 | 33 | | |
33 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
10 | 10 | | |
11 | 11 | | |
12 | 12 | | |
13 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
13 | 12 | | |
14 | 13 | | |
15 | 14 | | |
| 15 | + | |
16 | 16 | | |
17 | 17 | | |
18 | 18 | | |
| |||
46 | 46 | | |
47 | 47 | | |
48 | 48 | | |
| 49 | + | |
49 | 50 | | |
50 | 51 | | |
51 | 52 | | |
| |||
80 | 81 | | |
81 | 82 | | |
82 | 83 | | |
| 84 | + | |
83 | 85 | | |
84 | 86 | | |
85 | 87 | | |
| |||
Lines changed: 7 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | | - | |
2 | | - | |
| 1 | + | |
| 2 | + | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
| 8 | + | |
7 | 9 | | |
8 | 10 | | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
Lines changed: 16 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
24 | | - | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
| 24 | + | |
| 25 | + | |
35 | 26 | | |
36 | 27 | | |
37 | 28 | | |
38 | 29 | | |
39 | 30 | | |
40 | 31 | | |
41 | | - | |
| 32 | + | |
42 | 33 | | |
43 | | - | |
| 34 | + | |
44 | 35 | | |
45 | 36 | | |
46 | | - | |
47 | | - | |
| 37 | + | |
48 | 38 | | |
49 | 39 | | |
50 | 40 | | |
51 | 41 | | |
52 | | - | |
| 42 | + | |
53 | 43 | | |
54 | 44 | | |
55 | 45 | | |
56 | 46 | | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
61 | | - | |
62 | | - | |
63 | | - | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
64 | 54 | | |
65 | | - | |
66 | | - | |
| 55 | + | |
| 56 | + | |
67 | 57 | | |
68 | 58 | | |
69 | | - | |
| 59 | + | |
70 | 60 | | |
71 | 61 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
35 | 36 | | |
36 | 37 | | |
37 | 38 | | |
| |||
Lines changed: 3 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
20 | 20 | | |
21 | 21 | | |
22 | 22 | | |
23 | | - | |
| 23 | + | |
| 24 | + | |
24 | 25 | | |
25 | | - | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
| 26 | + | |
33 | 27 | | |
Lines changed: 7 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
26 | 25 | | |
27 | | - | |
28 | | - | |
| 26 | + | |
29 | 27 | | |
30 | | - | |
31 | | - | |
| 28 | + | |
32 | 29 | | |
33 | 30 | | |
34 | | - | |
35 | | - | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
36 | 35 | | |
37 | 36 | | |
38 | 37 | | |
39 | | - | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
180 | 180 | | |
181 | 181 | | |
182 | 182 | | |
183 | | - | |
184 | 183 | | |
185 | 184 | | |
186 | 185 | | |
| |||
0 commit comments