forked from llvm/llvm-project
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[X86] Add clang codegen test coverage for llvm#104848
- Loading branch information
1 parent
4f620a5
commit 62b6628
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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,32 @@ | ||
// NOTE: Assertions have been autogenerated by utils/update_cc_test_checks.py | ||
// RUN: %clang_cc1 %s -O2 -emit-llvm -o - -triple x86_64-unknown-unknown -ffreestanding -ffp-exception-behavior=maytrap -Wall -Werror | FileCheck %s | ||
|
||
#include <immintrin.h> | ||
|
||
// TODO: PR104848 - ensure the _mm_set_ss/d headers don't implicity promote any integer/fp values. | ||
|
||
// CHECK-LABEL: @test_mm_set_ss( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <4 x float> poison, float [[NUM:%.*]], i64 0 | ||
// CHECK-NEXT: [[CONV_I:%.*]] = tail call float @llvm.experimental.constrained.sitofp.f32.i32(i32 0, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR2:[0-9]+]] | ||
// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <4 x float> [[VECINIT_I]], float [[CONV_I]], i64 1 | ||
// CHECK-NEXT: [[VECINIT3_I:%.*]] = insertelement <4 x float> [[VECINIT1_I]], float [[CONV_I]], i64 2 | ||
// CHECK-NEXT: [[VECINIT5_I:%.*]] = insertelement <4 x float> [[VECINIT3_I]], float [[CONV_I]], i64 3 | ||
// CHECK-NEXT: ret <4 x float> [[VECINIT5_I]] | ||
// | ||
__m128 test_mm_set_ss(float num) | ||
{ | ||
return _mm_set_ss(num); | ||
} | ||
|
||
// CHECK-LABEL: @test_mm_set_sd( | ||
// CHECK-NEXT: entry: | ||
// CHECK-NEXT: [[VECINIT_I:%.*]] = insertelement <2 x double> poison, double [[NUM:%.*]], i64 0 | ||
// CHECK-NEXT: [[CONV_I:%.*]] = tail call double @llvm.experimental.constrained.sitofp.f64.i32(i32 0, metadata !"round.tonearest", metadata !"fpexcept.maytrap") #[[ATTR2]] | ||
// CHECK-NEXT: [[VECINIT1_I:%.*]] = insertelement <2 x double> [[VECINIT_I]], double [[CONV_I]], i64 1 | ||
// CHECK-NEXT: ret <2 x double> [[VECINIT1_I]] | ||
// | ||
__m128d test_mm_set_sd(double num) | ||
{ | ||
return _mm_set_sd(num); | ||
} |