llvm.org GIT mirror llvm / a04532d
[AArch64] Implement __jcvt intrinsic from Armv8.3-A The jcvt intrinsic defined in ACLE [1] is available when ARM_FEATURE_JCVT is defined. This change introduces the AArch64 intrinsic, wires it up to the instruction and a new clang builtin function. The __ARM_FEATURE_JCVT macro is now defined when an Armv8.3-A or higher target is used. I've implemented the target detection logic in Clang so that this feature is enabled for architectures from armv8.3-a onwards (so -march=armv8.4-a also enables this, for example). make check-all didn't show any new failures. [1] https://developer.arm.com/docs/101028/latest/data-processing-intrinsics Differential Revision: https://reviews.llvm.org/D64495 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@366197 91177308-0d34-0410-b5e6-96231b3b80d8 Kyrylo Tkachov 2 months ago
4 changed file(s) with 16 addition(s) and 2 deletion(s). Raw diff Collapse all Expand all
2929 LLVMMatchType<0>], [IntrNoMem]>;
3030 def int_aarch64_udiv : Intrinsic<[llvm_anyint_ty], [LLVMMatchType<0>,
3131 LLVMMatchType<0>], [IntrNoMem]>;
32
33 def int_aarch64_fjcvtzs : Intrinsic<[llvm_i32_ty], [llvm_double_ty], [IntrNoMem]>;
3234
3335 //===----------------------------------------------------------------------===//
3436 // HINT
716716 // v8.3a floating point conversion for javascript
717717 let Predicates = [HasJS, HasFPARMv8] in
718718 def FJCVTZS : BaseFPToIntegerUnscaled<0b01, 0b11, 0b110, FPR64, GPR32,
719 "fjcvtzs", []> {
719 "fjcvtzs",
720 [(set GPR32:$Rd,
721 (int_aarch64_fjcvtzs FPR64:$Rn))]> {
720722 let Inst{31} = 0;
721723 } // HasJS, HasFPARMv8
722724
0 ; RUN: llc -mtriple=arm64-eabi -mattr=+jsconv -o - %s | FileCheck %s
1
2 define i32 @test_jcvt(double %v) {
3 ; CHECK-LABEL: test_jcvt:
4 ; CHECK: fjcvtzs w0, d0
5 %val = call i32 @llvm.aarch64.fjcvtzs(double %v)
6 ret i32 %val
7 }
8
9 declare i32 @llvm.aarch64.fjcvtzs(double)
371371 # Now we're ready to commit.
372372 commit_msg = git('show', '--pretty=%B', '--quiet', rev)
373373 if not dry_run:
374 commit_args = ['commit', '-m', commit_msg]
374 commit_args = ['commit', '-m', commit_msg, '--username', 'ktkachov']
375375 if '--force-interactive' in svn(svn_repo, 'commit', '--help'):
376376 commit_args.append('--force-interactive')
377377 log(svn(svn_repo, *commit_args))