-
Notifications
You must be signed in to change notification settings - Fork 14.3k
[AArch64] Implement FP8 floating-point mode helper intrinsics #100608
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
Merged
Merged
Changes from all commits
Commits
Show all changes
2 commits
Select commit
Hold shift + click to select a range
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,165 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py UTC_ARGS: --version 5 | ||
|
||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c -DUSE_NEON_H %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c -DUSE_SVE_H %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c -DUSE_SME_H %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c++ -DUSE_NEON_H %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c++ -DUSE_SVE_H %s -o - | FileCheck %s | ||
// RUN: %clang_cc1 -O2 -triple aarch64 -emit-llvm -x c++ -DUSE_SME_H %s -o - | FileCheck %s | ||
|
||
// REQUIRES: aarch64-registered-target | ||
|
||
#ifdef USE_NEON_H | ||
#include "arm_neon.h" | ||
#endif | ||
|
||
#ifdef USE_SVE_H | ||
#include "arm_sve.h" | ||
#endif | ||
|
||
#ifdef USE_SME_H | ||
#include "arm_sme.h" | ||
#endif | ||
|
||
#ifdef __cplusplus | ||
extern "C" { | ||
#endif | ||
|
||
#define INIT_ZERO 0 | ||
#define INIT_ONES 0xffffffffffffffffU | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_init( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0:[0-9]+]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 0 | ||
// | ||
fpm_t test_init() { return __arm_fpm_init(); } | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_src1_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 -8 | ||
// | ||
fpm_t test_src1_1() { | ||
return __arm_set_fpm_src1_format(INIT_ONES, __ARM_FPM_E5M2); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_src1_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 1 | ||
// | ||
fpm_t test_src1_2() { | ||
return __arm_set_fpm_src1_format(INIT_ZERO, __ARM_FPM_E4M3); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_src2_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 -57 | ||
// | ||
fpm_t test_src2_1() { | ||
return __arm_set_fpm_src2_format(INIT_ONES, __ARM_FPM_E5M2); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_src2_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 8 | ||
// | ||
fpm_t test_src2_2() { | ||
return __arm_set_fpm_src2_format(INIT_ZERO, __ARM_FPM_E4M3); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_dst1_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 -449 | ||
// | ||
fpm_t test_dst1_1() { | ||
return __arm_set_fpm_dst_format(INIT_ONES, __ARM_FPM_E5M2); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_dst2_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 64 | ||
// | ||
fpm_t test_dst2_2() { | ||
return __arm_set_fpm_dst_format(INIT_ZERO, __ARM_FPM_E4M3); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_of_mul_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 -16385 | ||
// | ||
fpm_t test_of_mul_1() { | ||
return __arm_set_fpm_overflow_mul(INIT_ONES, __ARM_FPM_INFNAN); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_of_mul_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 16384 | ||
// | ||
fpm_t test_of_mul_2() { | ||
return __arm_set_fpm_overflow_mul(INIT_ZERO, __ARM_FPM_SATURATE); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_of_cvt_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 -32769 | ||
// | ||
fpm_t test_of_cvt_1() { | ||
return __arm_set_fpm_overflow_cvt(INIT_ONES, __ARM_FPM_INFNAN); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_of_cvt_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 32768 | ||
// | ||
fpm_t test_of_cvt_2() { | ||
return __arm_set_fpm_overflow_cvt(INIT_ZERO, __ARM_FPM_SATURATE); | ||
} | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_lscale( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 8323072 | ||
// | ||
fpm_t test_lscale() { return __arm_set_fpm_lscale(INIT_ZERO, 127); } | ||
|
||
// CHECK-LABEL: define dso_local noundef i64 @test_lscale2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 270582939648 | ||
// | ||
fpm_t test_lscale2() { return __arm_set_fpm_lscale2(INIT_ZERO, 63); } | ||
|
||
// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_1( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 2147483648 | ||
// | ||
fpm_t test_nscale_1() { return __arm_set_fpm_nscale(INIT_ZERO, -128); } | ||
|
||
// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_2( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 2130706432 | ||
// | ||
fpm_t test_nscale_2() { return __arm_set_fpm_nscale(INIT_ZERO, 127); } | ||
|
||
// CHECK-LABEL: define dso_local noundef range(i64 0, 4294967296) i64 @test_nscale_3( | ||
// CHECK-SAME: ) local_unnamed_addr #[[ATTR0]] { | ||
// CHECK-NEXT: [[ENTRY:.*:]] | ||
// CHECK-NEXT: ret i64 4278190080 | ||
// | ||
fpm_t test_nscale_3() { return __arm_set_fpm_nscale(INIT_ZERO, -1); } | ||
|
||
#ifdef __cplusplus | ||
} | ||
#endif |
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
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.