1 ; NOTE: Assertions have been autogenerated by utils/update_test_checks.py UTC_ARGS: --version 3
2 ; RUN: opt -S -passes=instsimplify < %s | FileCheck %s
4 ; All of these constant expressions should fold.
6 define <2 x float> @ga() {
7 ; CHECK-LABEL: define <2 x float> @ga() {
8 ; CHECK-NEXT: ret <2 x float> <float 0x4011333340000000, float 0x40099999A0000000>
10 %fptrunc = fptrunc <2 x double> <double 4.3, double 3.2> to <2 x float>
11 ret <2 x float> %fptrunc
13 define <2 x double> @gb() {
14 ; CHECK-LABEL: define <2 x double> @gb() {
15 ; CHECK-NEXT: ret <2 x double> <double 2.000000e+00, double 8.000000e+00>
17 %fpext = fpext <2 x float><float 2.0, float 8.0> to <2 x double>
18 ret <2 x double> %fpext
20 define <2 x i32> @gf() {
21 ; CHECK-LABEL: define <2 x i32> @gf() {
22 ; CHECK-NEXT: ret <2 x i32> <i32 3, i32 4>
24 ret <2 x i32> trunc (<2 x i64><i64 3, i64 4> to <2 x i32>)
26 define <2 x i32> @gh() {
27 ; CHECK-LABEL: define <2 x i32> @gh() {
28 ; CHECK-NEXT: ret <2 x i32> <i32 8, i32 7>
30 %fptoui = fptoui <2 x float><float 8.0, float 7.0> to <2 x i32>
33 define <2 x i32> @gi() {
34 ; CHECK-LABEL: define <2 x i32> @gi() {
35 ; CHECK-NEXT: ret <2 x i32> <i32 8, i32 7>
37 %fptosi = fptosi <2 x float><float 8.0, float 7.0> to <2 x i32>
40 define <2 x float> @gj() {
41 ; CHECK-LABEL: define <2 x float> @gj() {
42 ; CHECK-NEXT: ret <2 x float> <float 8.000000e+00, float 7.000000e+00>
44 %uitofp = uitofp <2 x i32><i32 8, i32 7> to <2 x float>
45 ret <2 x float> %uitofp
47 define <2 x float> @gk() {
48 ; CHECK-LABEL: define <2 x float> @gk() {
49 ; CHECK-NEXT: ret <2 x float> <float 8.000000e+00, float 7.000000e+00>
51 %sitofp = sitofp <2 x i32><i32 8, i32 7> to <2 x float>
52 ret <2 x float> %sitofp
54 define <2 x double> @gl() {
55 ; CHECK-LABEL: define <2 x double> @gl() {
56 ; CHECK-NEXT: ret <2 x double> <double 4.000000e+00, double 3.000000e+00>
58 ret <2 x double> bitcast (<2 x double><double 4.0, double 3.0> to <2 x double>)
60 define <2 x double> @gm() {
61 ; CHECK-LABEL: define <2 x double> @gm() {
62 ; CHECK-NEXT: ret <2 x double> <double 1.976260e-323, double 1.482200e-323>
64 ret <2 x double> bitcast (<2 x i64><i64 4, i64 3> to <2 x double>)