[llvm] [IR] Add initial support for the byte type (PR #178666)

Yingwei Zheng via llvm-commits llvm-commits at lists.llvm.org
Thu Jan 29 11:49:12 PST 2026


================
@@ -13017,6 +13059,60 @@ Example:
       %Z = bitcast <2 x i32> %V to i64; ; yields i64: %V (depends on endianness)
       %Z = bitcast <2 x i32*> %V to <2 x i64*> ; yields <2 x i64*>
 
+.. _i_bytecast:
+
+'``bytecast .. to``' Instruction
+^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
+
+Syntax:
+"""""""
+
+::
+
+    <result> = bytecast <ty> <value> to <ty2>             ; yields ty2
+
+Overview:
+"""""""""
+
+The '``bytecast``' instruction converts ``value``, of the byte type, to type
+``ty2`` performing type punning.
+
+Arguments:
+""""""""""
+
+The '``bytecast``' instruction takes a value to cast, which must be of the
+:ref:`byte type <t_byte>`, and a type to cast it to, which must be a
+non-aggregate :ref:`first class <t_firstclass>` type. The bit sizes of ``value``
+and the destination type, ``ty2``, must be identical. This instruction supports
+conversions from vectors of bytes to vector of other types (as long as they
+have the same size).
----------------
dtcxzyw wrote:

Same bit size or same element count?



https://github.com/llvm/llvm-project/pull/178666


More information about the llvm-commits mailing list