LLVMBuilderRef builder = gallivm->builder;
LLVMValueRef res;
enum tgsi_opcode_type atype; // Actual type of the value
+ unsigned swizzle = swizzle_in & 0xffff;
assert(!reg->Register.Indirect);
atype = TGSI_TYPE_UNSIGNED;
break;
+ case TGSI_SEMANTIC_THREAD_ID:
+ res = LLVMBuildExtractValue(gallivm->builder, bld->system_values.thread_id, swizzle, "");
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
+ case TGSI_SEMANTIC_BLOCK_ID:
+ res = lp_build_extract_broadcast(gallivm, lp_type_int_vec(32, 96), bld_base->uint_bld.type, bld->system_values.block_id, lp_build_const_int32(gallivm, swizzle));
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
+ case TGSI_SEMANTIC_GRID_SIZE:
+ res = lp_build_extract_broadcast(gallivm, lp_type_int_vec(32, 96), bld_base->uint_bld.type, bld->system_values.grid_size, lp_build_const_int32(gallivm, swizzle));
+ atype = TGSI_TYPE_UNSIGNED;
+ break;
+
default:
assert(!"unexpected semantic in emit_fetch_system_value");
res = bld_base->base.zero;