From b24e4757176b0f0b110b6f726d92bbfb820924e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=BDiga=20=C5=BDeljko?= Date: Tue, 9 Nov 2021 20:15:39 +0100 Subject: [PATCH] stage1: fix type mapping for integers and c_longdouble on nvptx --- src/stage1/codegen.cpp | 4 ++++ src/stage1/target.cpp | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/stage1/codegen.cpp b/src/stage1/codegen.cpp index 047fb54b85..c3536a4c69 100644 --- a/src/stage1/codegen.cpp +++ b/src/stage1/codegen.cpp @@ -8901,6 +8901,10 @@ static void define_builtin_types(CodeGen *g) { case ZigLLVM_bpfeb: add_fp_entry(g, "c_longdouble", 64, LLVMDoubleType(), &g->builtin_types.entry_c_longdouble); break; + case ZigLLVM_nvptx: + case ZigLLVM_nvptx64: + add_fp_entry(g, "c_longdouble", 64, LLVMDoubleType(), &g->builtin_types.entry_c_longdouble); + break; default: zig_panic("TODO implement mapping for c_longdouble"); } diff --git a/src/stage1/target.cpp b/src/stage1/target.cpp index 9f851a7f6f..106c77854d 100644 --- a/src/stage1/target.cpp +++ b/src/stage1/target.cpp @@ -680,6 +680,8 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) { case OsSolaris: case OsEmscripten: case OsPlan9: + case OsCUDA: + case OsNVCL: switch (id) { case CIntTypeShort: case CIntTypeUShort: @@ -741,8 +743,6 @@ uint32_t target_c_type_size_in_bits(const ZigTarget *target, CIntType id) { case OsRTEMS: case OsNaCl: case OsAIX: - case OsCUDA: - case OsNVCL: case OsAMDHSA: case OsPS4: case OsELFIAMCU: