@@ -1898,12 +1898,12 @@ pub fn ptrBitWidth_cpu_abi(cpu: Cpu, abi: Abi) u16 {
1898
1898
.sparc ,
1899
1899
.spirv32 ,
1900
1900
.loongarch32 ,
1901
+ .dxil ,
1901
1902
.xtensa ,
1902
1903
= > 32 ,
1903
1904
1904
1905
.aarch64 ,
1905
1906
.aarch64_be ,
1906
- .dxil ,
1907
1907
.mips64 ,
1908
1908
.mips64el ,
1909
1909
.powerpc64 ,
@@ -2302,15 +2302,18 @@ pub fn c_type_bit_size(target: Target, c_type: CType) u16 {
2302
2302
.short , .ushort = > return 16 ,
2303
2303
.int , .uint , .float = > return 32 ,
2304
2304
.long , .ulong , .longlong , .ulonglong , .double = > return 64 ,
2305
- .longdouble = > return 64 ,
2305
+ .longdouble = > return 128 ,
2306
2306
},
2307
2307
2308
2308
.opencl , .vulkan = > switch (c_type ) {
2309
2309
.char = > return 8 ,
2310
2310
.short , .ushort = > return 16 ,
2311
2311
.int , .uint , .float = > return 32 ,
2312
- .long , .ulong , .longlong , .ulonglong , .double = > return 64 ,
2313
- .longdouble = > return 64 ,
2312
+ .long , .ulong , .double = > return 64 ,
2313
+ .longlong , .ulonglong = > return 128 ,
2314
+ // Note: The OpenCL specification does not guarantee a particular size for long double,
2315
+ // but clang uses 128 bits.
2316
+ .longdouble = > return 128 ,
2314
2317
},
2315
2318
2316
2319
.ps4 , .ps5 = > switch (c_type ) {
@@ -2385,6 +2388,7 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2385
2388
.csky ,
2386
2389
.x86 ,
2387
2390
.xcore ,
2391
+ .dxil ,
2388
2392
.loongarch32 ,
2389
2393
.kalimba ,
2390
2394
.spu_2 ,
@@ -2394,7 +2398,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2394
2398
.amdgcn ,
2395
2399
.bpfel ,
2396
2400
.bpfeb ,
2397
- .dxil ,
2398
2401
.hexagon ,
2399
2402
.m68k ,
2400
2403
.mips ,
@@ -2404,9 +2407,6 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2404
2407
.nvptx ,
2405
2408
.nvptx64 ,
2406
2409
.s390x ,
2407
- .spirv ,
2408
- .spirv32 ,
2409
- .spirv64 ,
2410
2410
= > 8 ,
2411
2411
2412
2412
.aarch64 ,
@@ -2421,6 +2421,9 @@ pub fn c_type_alignment(target: Target, c_type: CType) u16 {
2421
2421
.riscv32 ,
2422
2422
.riscv64 ,
2423
2423
.sparc64 ,
2424
+ .spirv ,
2425
+ .spirv32 ,
2426
+ .spirv64 ,
2424
2427
.x86_64 ,
2425
2428
.ve ,
2426
2429
.wasm32 ,
@@ -2489,6 +2492,7 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2489
2492
2490
2493
.csky ,
2491
2494
.xcore ,
2495
+ .dxil ,
2492
2496
.loongarch32 ,
2493
2497
.kalimba ,
2494
2498
.spu_2 ,
@@ -2504,7 +2508,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2504
2508
.amdgcn ,
2505
2509
.bpfel ,
2506
2510
.bpfeb ,
2507
- .dxil ,
2508
2511
.hexagon ,
2509
2512
.x86 ,
2510
2513
.m68k ,
@@ -2515,9 +2518,6 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2515
2518
.nvptx ,
2516
2519
.nvptx64 ,
2517
2520
.s390x ,
2518
- .spirv ,
2519
- .spirv32 ,
2520
- .spirv64 ,
2521
2521
= > 8 ,
2522
2522
2523
2523
.aarch64 ,
@@ -2532,6 +2532,9 @@ pub fn c_type_preferred_alignment(target: Target, c_type: CType) u16 {
2532
2532
.riscv32 ,
2533
2533
.riscv64 ,
2534
2534
.sparc64 ,
2535
+ .spirv ,
2536
+ .spirv32 ,
2537
+ .spirv64 ,
2535
2538
.x86_64 ,
2536
2539
.ve ,
2537
2540
.wasm32 ,
0 commit comments