-
Notifications
You must be signed in to change notification settings - Fork 12.6k
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
Implement the fmod
HLSL Function
#99118
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
Comments
farzonl
added
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
labels
Jul 16, 2024
52 tasks
Note to implementer it is very likely we don't need to create |
I'll work on this task. |
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 16, 2024
This change implements the frontend for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - add the builtin to DirectX intrinsic mapping hlsl_intrinsics.h - add the fmod api SemaHLSL.cpp - add type checks for builtin IntrinsicsDirectX.td - add the fmod DirectX intrinsic
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 24, 2024
This change implements the frontend for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaHLSL.cpp - add type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins*
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 24, 2024
This change implements the frontend for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaHLSL.cpp - add type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins*
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 24, 2024
This change implements the frontend for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaHLSL.cpp - add type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 26, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 26, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 26, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
lizhengxing
added a commit
to lizhengxing/llvm-project
that referenced
this issue
Sep 27, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
farzonl
pushed a commit
that referenced
this issue
Sep 27, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for #99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
xgupta
pushed a commit
to xgupta/llvm-project
that referenced
this issue
Oct 4, 2024
This change add the elementwise fmod builtin to support HLSL function 'fmod' in clang for llvm#99118 Builtins.td - add the fmod builtin CGBuiltin.cpp - lower the builtin to llvm FRem instruction hlsl_intrinsics.h - add the fmod api SemaChecking.cpp - add type checks for builtin SemaHLSL.cpp - add HLSL type checks for builtin clang/docs/LanguageExtensions.rst - add the builtin in *Elementwise Builtins* clang/docs/ReleaseNotes.rst - announce the builtin
We want to decide llvm/wg-hlsl#86 before we continue with this. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
backend:DirectX
backend:SPIR-V
bot:HLSL
HLSL
HLSL Language Support
metabug
Issue to collect references to a group of similar or related issues.
fmod
clang builtin,fmod
clang builtin withhlsl_intrinsics.h
fmod
toCheckHLSLBuiltinFunctionCall
inSemaChecking.cpp
fmod
toEmitHLSLBuiltinExpr
inCGBuiltin.cpp
clang/test/CodeGenHLSL/builtins/fmod.hlsl
clang/test/SemaHLSL/BuiltIns/fmod-errors.hlsl
int_dx_fmod
intrinsic inIntrinsicsDirectX.td
DXILOpMapping
ofint_dx_fmod
to6
inDXIL.td
fmod.ll
andfmod_errors.ll
tests inllvm/test/CodeGen/DirectX/
int_spv_fmod
intrinsic inIntrinsicsSPIRV.td
fmod
lowering and map it toint_spv_fmod
inSPIRVInstructionSelector::selectIntrinsic
.llvm/test/CodeGen/SPIRV/hlsl-intrinsics/fmod.ll
DirectX
SPIR-V
OpFRem:
Description:
The floating-point remainder whose sign matches the sign
of Operand 1.
Result Type must be a scalar or vector of floating-point
type.
The types of Operand 1 and Operand 2 both must be the same as
Result Type.
Results are computed per component. The resulting value is undefined if
Operand 2 is 0. Otherwise, the result is the remainder
r of Operand 1 divided by Operand 2 where if r ≠ 0, the sign of
r is the same as the sign of Operand 1.
5
140
<id>
Result Type
Result <id>
<id>
Operand 1
<id>
Operand 2
Test Case(s)
Example 1
HLSL:
Returns the floating-point remainder of x/y.
Parameters
Return Value
The floating-point remainder of the x parameter divided by the y parameter.
Remarks
The floating-point remainder is calculated such that x = i * y + f, where i is an integer, f has the same sign as x, and the absolute value of f is less than the absolute value of y.
Type Description
Minimum Shader Model
This function is supported in the following shader models.
Requirements
See also
Intrinsic Functions (DirectX HLSL)
The text was updated successfully, but these errors were encountered: