[PATCH] D144309: [HLSL] add max/min library functions

2023-03-03 Thread Joshua Batista via Phabricator via cfe-commits
This revision was automatically updated to reflect the committed changes. Closed by commit rG7ac0551e77f4: [HLSL] add max/min library functions (authored by bob80905). Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.or

[PATCH] D144309: [HLSL] add max/min library functions

2023-03-02 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 502009. bob80905 added a comment. - only run tests if 16 bit is enabled Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/lib/Headers/hlsl/hlsl_intrinsi

[PATCH] D144309: [HLSL] add max/min library functions

2023-03-02 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added inline comments. Comment at: clang/test/CodeGenHLSL/builtins/max.hlsl:12 +// NO_HALF: call i16 @llvm.smax.i16( +int16_t test_max_short ( int16_t p0, int16_t p1 ) { + return max ( p0, p1 ); Just guard 16bit integer tests with #ifdef __HLSL_ENABL

[PATCH] D144309: [HLSL] add max/min library functions

2023-03-02 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 501963. bob80905 added a comment. - use already defined hlsl types Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/lib/Headers/hlsl/hlsl_intrinsics.h

[PATCH] D144309: [HLSL] add max/min library functions

2023-03-02 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. In D144309#4159431 , @bob80905 wrote: > - ushort is now unsigned Use uint16_t/int16_t/uint64_t/int64_t for 16/64 bit integers. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144

[PATCH] D144309: [HLSL] add max/min library functions

2023-03-02 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 501933. bob80905 added a comment. - format Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/lib/Headers/hlsl/hlsl_intrinsics.h clang/test/CodeGenHLSL

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-28 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 501250. bob80905 added a comment. - ushort is now unsigned Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/lib/Headers/hlsl/hlsl_intrinsics.h clang/

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-28 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 501248. bob80905 added a comment. - add support for these types: i16/u16/i32/u32/i64/u64/f16/f32/f64 Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/l

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-27 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. In D144309#4156971 , @bob80905 wrote: > add int support for max/min. Sorry didn't check more :(. Now i16/u16/i32/u32/i64/u64/f16/f32/f64 are all supported for min/max in hlsl. Repository: rG LLVM Github Monorepo CHANGES

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-27 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 updated this revision to Diff 500953. bob80905 added a comment. add int support for max/min. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309 Files: clang/lib/Headers/hlsl/hlsl_intrinsics.h cl

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-27 Thread Xiang Li via Phabricator via cfe-commits
python3kgae added a comment. max/min does work on integers in HLSL. And __builtin_elementwise_max/min support both integers and floats. Repository: rG LLVM Github Monorepo CHANGES SINCE LAST ACTION https://reviews.llvm.org/D144309/new/ https://reviews.llvm.org/D144309

[PATCH] D144309: [HLSL] add max/min library functions

2023-02-17 Thread Joshua Batista via Phabricator via cfe-commits
bob80905 added inline comments. Comment at: clang/test/CodeGenHLSL/builtins/min.hlsl:10 +// CHECK: call half @llvm.minnum.f16( +// NO_HALF: define noundef float @"?test_min_half@@YA$halff@$halff@0@Z"( +// NO_HALF: call float @llvm.minnum.f32( I had to add a 0 her