-
Notifications
You must be signed in to change notification settings - Fork 16.3k
[libclc] Refine __clc_fp*_subnormals_supported #157633
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
wenju-he
wants to merge
19
commits into
llvm:main
Choose a base branch
from
wenju-he:refine-__clc_fp32_subnormals_supported
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
7e2d210
[libclc] Refine __clc_fp*_subnormals_supported and __clc_flush_denorm…
wenju-he 96ec9dc
Apply suggestions from code review
wenju-he d52fcdb
use __builtin_elementwise_canonicalize
wenju-he 4608f77
set -fdenormal-fp-math-f32=dynamic build flag globally
wenju-he 3f665ce
rename __clc_flush_denormal_if_not_supportedto __clc_soft_flush_deno…
wenju-he 7b290a2
delete clc_sw_fma
wenju-he 3da9705
-fdenormal-fp-math-f32 -> -fdenormal-fp-math
wenju-he 7d21a1a
remove -Xclang before -fdenormal-fp-math=dynamic
wenju-he b61e32b
Revert "delete clc_sw_fma"
wenju-he ccf7a6e
support SPIR-V: implement __clc_fp32_subnormals_supported without usi…
wenju-he 23d0ff7
revert change to __clc_soft_flush_denormal
wenju-he ddb79ae
Merge branch 'main' into refine-__clc_fp32_subnormals_supported
wenju-he 3e2ac98
Merge branch 'main' into refine-__clc_fp32_subnormals_supported
wenju-he 34cd062
revert name __clc_soft_flush_denormal to __clc_flush_denormal_if_not_…
wenju-he b14455b
clang-format clc_subnormal_config.cl
wenju-he 7757ba0
update comment: Should be -> Expected
wenju-he fe2d4f6
fix build: include clc_subnormal_config.h
wenju-he 7ff4dcf
__clc_fp32_subnormals_supported: use __clc_fabs for SPIR-V and canoni…
wenju-he 5eb6990
__clc_flush_denormal_if_not_supported: use __builtin_elementwise_cano…
wenju-he File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Some comments aren't visible on the classic Files Changed page.
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
| //===----------------------------------------------------------------------===// | ||
| // | ||
| // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions. | ||
| // See https://llvm.org/LICENSE.txt for license information. | ||
| // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception | ||
| // | ||
| //===----------------------------------------------------------------------===// | ||
|
|
||
| #include <clc/internal/clc.h> | ||
| #include <clc/math/clc_fabs.h> | ||
| #include <clc/math/clc_subnormal_config.h> | ||
|
|
||
| #ifdef cl_khr_fp16 | ||
| #pragma OPENCL EXTENSION cl_khr_fp16 : enable | ||
| _CLC_DEF bool __clc_fp16_subnormals_supported() { | ||
| #ifdef CLC_SPIRV | ||
| half x = __clc_fabs(0x1p-24h); | ||
| #else | ||
| half x = __builtin_elementwise_canonicalize(0x1p-24h); | ||
| #endif | ||
| return !__builtin_isfpclass(x, __FPCLASS_POSZERO); | ||
| } | ||
| #endif // cl_khr_fp16 | ||
|
|
||
| _CLC_DEF bool __clc_fp32_subnormals_supported() { | ||
| #ifdef CLC_SPIRV | ||
| float x = __clc_fabs(0x1p-149f); | ||
| #else | ||
| float x = __builtin_elementwise_canonicalize(0x1p-149f); | ||
| #endif | ||
| return !__builtin_isfpclass(x, __FPCLASS_POSZERO); | ||
| } | ||
|
|
||
| #ifdef cl_khr_fp64 | ||
| #pragma OPENCL EXTENSION cl_khr_fp64 : enable | ||
| _CLC_DEF bool __clc_fp64_subnormals_supported() { | ||
| #ifdef CLC_SPIRV | ||
| double x = __clc_fabs(0x1p-1074); | ||
| #else | ||
| double x = __builtin_elementwise_canonicalize(0x1p-1074); | ||
| #endif | ||
| return !__builtin_isfpclass(x, __FPCLASS_POSZERO); | ||
| } | ||
| #endif // cl_khr_fp64 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.