File: bitcast-const-floatvec.ll

package info (click to toggle)
intel-graphics-compiler2 2.16.0-2
  • links: PTS, VCS
  • area: main
  • in suites: sid
  • size: 106,644 kB
  • sloc: cpp: 805,640; lisp: 287,672; ansic: 16,414; python: 3,952; yacc: 2,588; lex: 1,666; pascal: 313; sh: 186; makefile: 35
file content (42 lines) | stat: -rw-r--r-- 1,863 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
;=========================== begin_copyright_notice ============================
;
; Copyright (C) 2024 Intel Corporation
;
; SPDX-License-Identifier: MIT
;
;============================ end_copyright_notice =============================
;
; RUN: igc_opt -igc-legalization -S < %s | FileCheck %s
; ------------------------------------------------
; Legalization: bitcast float vector to double
; ------------------------------------------------

; Test checks legalization for constant <2 x float> bitcast to double

define double @test_bitcast() {
; CHECK-LABEL: define double @test_bitcast() {
; CHECK:    ret double 0x7FF800007FF80000
;
  %1 = bitcast <2 x float> <float 0x7FFF000000000000, float 0x7FFF000000000000> to double
  ret double %1                                                                                                                                                                              }

define double @test_bitcast_not(<2 x float> %src1) {
; CHECK-LABEL: define double @test_bitcast_not(
; CHECK-SAME: <2 x float> [[SRC1:%.*]]) {
; CHECK:    [[TMP1:%.*]] = insertelement <2 x float> undef, float 0x7FFF000000000000, i32 0
; CHECK:    [[TMP2:%.*]] = insertelement <2 x float> [[TMP1]], float 0x7FFF000000000000, i32 1
; CHECK:    [[TMP3:%.*]] = insertelement <2 x float> [[TMP2]], float 1.000000e+00, i32 0
; CHECK:    [[TMP4:%.*]] = insertelement <2 x float> <float 0x7FFF000000000000, float 0x7FFF000000000000>, float 1.000000e+00, i32 0
; CHECK:    [[TMP5:%.*]] = bitcast <2 x float> [[TMP3]] to double
; CHECK:    ret double [[TMP5]]
;
  %1 = insertelement <2 x float> <float 0x7FFF000000000000, float 0x7FFF000000000000>, float 1.0, i32 0
  %2 = bitcast <2 x float> %1 to double
  ret double %2
}

!igc.functions = !{!0, !1}

!0 = !{double ()* @test_bitcast, !2}
!1 = !{double (<2 x float>)* @test_bitcast_not, !2}
!2 = !{}