From aa71f5361b84650b93bd974abe36bb94fbed7580 Mon Sep 17 00:00:00 2001 From: Hans Wennborg Date: Mon, 18 Jul 2016 17:53:22 +0000 Subject: [PATCH] Creating release_39 branch off revision 275826 llvm-svn: 275841 llvm-svn: 275839 llvm-svn: 275838 llvm-svn: 275836 llvm-svn: 275835 llvm-svn: 275834 llvm-svn: 275833 llvm-svn: 275832 llvm-svn: 275831 llvm-svn: 275829 llvm-svn: 275828 --- debuginfo-tests/README.txt | 19 - debuginfo-tests/aggregate-indirect-arg.cpp | 32 - debuginfo-tests/block_var.m | 32 - debuginfo-tests/blocks.m | 43 - debuginfo-tests/ctor.cpp | 25 - debuginfo-tests/dbg-arg.c | 41 - debuginfo-tests/foreach.m | 31 - debuginfo-tests/forward-declare-class.cpp | 27 - debuginfo-tests/llgdb.py | 153 - debuginfo-tests/nested-struct.cpp | 21 - debuginfo-tests/sret.cpp | 71 - debuginfo-tests/static-member-2.cpp | 39 - debuginfo-tests/static-member.cpp | 36 - libclc/.gitignore | 14 - libclc/CREDITS.TXT | 2 - libclc/LICENSE.TXT | 64 - libclc/README.TXT | 52 - libclc/amdgcn-amdhsa/lib/OVERRIDES | 0 libclc/amdgcn-amdhsa/lib/SOURCES | 1 - .../lib/workitem/get_local_size.ll | 35 - libclc/amdgcn/lib/OVERRIDES | 0 libclc/amdgcn/lib/SOURCES | 4 - libclc/amdgcn/lib/math/ldexp.cl | 47 - .../lib/synchronization/barrier_impl.ll | 32 - libclc/amdgcn/lib/workitem/get_group_id.ll | 29 - libclc/amdgcn/lib/workitem/get_local_id.ll | 31 - libclc/amdgpu/lib/OVERRIDES | 2 - libclc/amdgpu/lib/SOURCES | 22 - libclc/amdgpu/lib/atomic/atomic.cl | 65 - .../lib/image/get_image_attributes_impl.ll | 87 - .../lib/image/get_image_channel_data_type.cl | 13 - .../lib/image/get_image_channel_order.cl | 13 - libclc/amdgpu/lib/image/get_image_depth.cl | 8 - libclc/amdgpu/lib/image/get_image_height.cl | 13 - libclc/amdgpu/lib/image/get_image_width.cl | 13 - libclc/amdgpu/lib/image/read_image_impl.ll | 46 - libclc/amdgpu/lib/image/read_imagef.cl | 14 - libclc/amdgpu/lib/image/read_imagei.cl | 23 - libclc/amdgpu/lib/image/read_imageui.cl | 23 - libclc/amdgpu/lib/image/write_image_impl.ll | 52 - libclc/amdgpu/lib/image/write_imagef.cl | 9 - libclc/amdgpu/lib/image/write_imagei.cl | 9 - libclc/amdgpu/lib/image/write_imageui.cl | 9 - libclc/amdgpu/lib/math/nextafter.cl | 4 - libclc/amdgpu/lib/math/sqrt.cl | 59 - libclc/amdgpu/lib/synchronization/barrier.cl | 10 - libclc/amdgpu/lib/workitem/get_global_size.ll | 18 - libclc/amdgpu/lib/workitem/get_local_size.ll | 18 - libclc/amdgpu/lib/workitem/get_num_groups.ll | 18 - libclc/amdgpu/lib/workitem/get_work_dim.ll | 8 - libclc/build/metabuild.py | 100 - libclc/build/ninja_syntax.py | 118 - libclc/compile-test.sh | 3 - libclc/configure.py | 282 - libclc/generic/include/clc/as_type.h | 68 - .../include/clc/async/async_work_group_copy.h | 15 - .../clc/async/async_work_group_copy.inc | 5 - .../clc/async/async_work_group_strided_copy.h | 15 - .../async/async_work_group_strided_copy.inc | 6 - libclc/generic/include/clc/async/gentype.inc | 204 - libclc/generic/include/clc/async/prefetch.h | 3 - libclc/generic/include/clc/async/prefetch.inc | 1 - .../include/clc/async/wait_group_events.h | 1 - .../generic/include/clc/atomic/atomic_add.h | 5 - .../generic/include/clc/atomic/atomic_and.h | 5 - .../include/clc/atomic/atomic_cmpxchg.h | 15 - .../generic/include/clc/atomic/atomic_dec.h | 1 - .../include/clc/atomic/atomic_decl.inc | 10 - .../generic/include/clc/atomic/atomic_inc.h | 1 - .../generic/include/clc/atomic/atomic_max.h | 5 - .../generic/include/clc/atomic/atomic_min.h | 5 - libclc/generic/include/clc/atomic/atomic_or.h | 5 - .../generic/include/clc/atomic/atomic_sub.h | 5 - .../generic/include/clc/atomic/atomic_xchg.h | 6 - .../generic/include/clc/atomic/atomic_xor.h | 5 - .../atom_add.h | 2 - .../atom_cmpxchg.h | 2 - .../atom_dec.h | 2 - .../atom_inc.h | 2 - .../atom_sub.h | 2 - .../atom_xchg.h | 2 - .../atom_and.h | 2 - .../atom_max.h | 2 - .../atom_min.h | 2 - .../atom_or.h | 2 - .../atom_xor.h | 2 - .../atom_add.h | 2 - .../atom_cmpxchg.h | 2 - .../atom_dec.h | 2 - .../atom_inc.h | 2 - .../atom_sub.h | 2 - .../atom_xchg.h | 2 - .../atom_and.h | 2 - .../atom_max.h | 2 - .../atom_min.h | 2 - .../atom_or.h | 2 - .../atom_xor.h | 2 - libclc/generic/include/clc/clc.h | 229 - libclc/generic/include/clc/clcfunc.h | 4 - libclc/generic/include/clc/clctypes.h | 89 - libclc/generic/include/clc/clcversion.h | 8 - libclc/generic/include/clc/common/degrees.h | 25 - libclc/generic/include/clc/common/degrees.inc | 23 - libclc/generic/include/clc/common/mix.h | 2 - libclc/generic/include/clc/common/mix.inc | 5 - libclc/generic/include/clc/common/radians.h | 25 - libclc/generic/include/clc/common/radians.inc | 23 - libclc/generic/include/clc/common/sign.h | 5 - .../generic/include/clc/common/smoothstep.h | 25 - .../generic/include/clc/common/smoothstep.inc | 28 - libclc/generic/include/clc/common/step.h | 25 - libclc/generic/include/clc/common/step.inc | 28 - libclc/generic/include/clc/convert.h | 60 - .../generic/include/clc/float/definitions.h | 77 - libclc/generic/include/clc/geometric/cross.h | 7 - .../generic/include/clc/geometric/distance.h | 2 - .../include/clc/geometric/distance.inc | 23 - libclc/generic/include/clc/geometric/dot.h | 2 - libclc/generic/include/clc/geometric/dot.inc | 1 - .../include/clc/geometric/fast_distance.h | 26 - .../include/clc/geometric/fast_distance.inc | 23 - .../include/clc/geometric/fast_length.h | 26 - .../include/clc/geometric/fast_length.inc | 23 - .../include/clc/geometric/fast_normalize.h | 26 - .../include/clc/geometric/fast_normalize.inc | 24 - .../generic/include/clc/geometric/floatn.inc | 55 - libclc/generic/include/clc/geometric/length.h | 2 - .../generic/include/clc/geometric/length.inc | 1 - .../generic/include/clc/geometric/normalize.h | 2 - .../include/clc/geometric/normalize.inc | 1 - libclc/generic/include/clc/image/image.h | 36 - .../generic/include/clc/image/image_defines.h | 49 - libclc/generic/include/clc/integer/abs.h | 2 - libclc/generic/include/clc/integer/abs.inc | 1 - libclc/generic/include/clc/integer/abs_diff.h | 2 - .../generic/include/clc/integer/abs_diff.inc | 1 - libclc/generic/include/clc/integer/add_sat.h | 2 - .../generic/include/clc/integer/add_sat.inc | 1 - libclc/generic/include/clc/integer/clz.h | 2 - libclc/generic/include/clc/integer/clz.inc | 1 - .../generic/include/clc/integer/definitions.h | 15 - .../generic/include/clc/integer/gentype.inc | 435 - libclc/generic/include/clc/integer/hadd.h | 2 - libclc/generic/include/clc/integer/hadd.inc | 1 - .../include/clc/integer/integer-gentype.inc | 47 - libclc/generic/include/clc/integer/mad24.h | 3 - libclc/generic/include/clc/integer/mad24.inc | 1 - libclc/generic/include/clc/integer/mad_hi.h | 1 - libclc/generic/include/clc/integer/mad_sat.h | 3 - .../generic/include/clc/integer/mad_sat.inc | 1 - libclc/generic/include/clc/integer/mul24.h | 3 - libclc/generic/include/clc/integer/mul24.inc | 1 - libclc/generic/include/clc/integer/mul_hi.h | 2 - libclc/generic/include/clc/integer/mul_hi.inc | 1 - libclc/generic/include/clc/integer/rhadd.h | 2 - libclc/generic/include/clc/integer/rhadd.inc | 1 - libclc/generic/include/clc/integer/rotate.h | 2 - libclc/generic/include/clc/integer/rotate.inc | 1 - libclc/generic/include/clc/integer/sub_sat.h | 2 - .../generic/include/clc/integer/sub_sat.inc | 1 - libclc/generic/include/clc/integer/upsample.h | 25 - libclc/generic/include/clc/math/acos.h | 2 - libclc/generic/include/clc/math/acos.inc | 1 - libclc/generic/include/clc/math/acosh.h | 24 - libclc/generic/include/clc/math/acosh.inc | 23 - libclc/generic/include/clc/math/acospi.h | 24 - libclc/generic/include/clc/math/acospi.inc | 23 - libclc/generic/include/clc/math/asin.h | 2 - libclc/generic/include/clc/math/asin.inc | 1 - libclc/generic/include/clc/math/asinh.h | 24 - libclc/generic/include/clc/math/asinh.inc | 23 - libclc/generic/include/clc/math/asinpi.h | 24 - libclc/generic/include/clc/math/asinpi.inc | 23 - libclc/generic/include/clc/math/atan.h | 24 - libclc/generic/include/clc/math/atan.inc | 23 - libclc/generic/include/clc/math/atan2.h | 24 - libclc/generic/include/clc/math/atan2.inc | 23 - libclc/generic/include/clc/math/atan2pi.h | 24 - libclc/generic/include/clc/math/atan2pi.inc | 23 - libclc/generic/include/clc/math/atanh.h | 24 - libclc/generic/include/clc/math/atanh.inc | 23 - libclc/generic/include/clc/math/atanpi.h | 24 - libclc/generic/include/clc/math/atanpi.inc | 23 - .../generic/include/clc/math/binary_decl.inc | 6 - .../include/clc/math/binary_intrin.inc | 18 - libclc/generic/include/clc/math/ceil.h | 6 - .../generic/include/clc/math/clc_nextafter.h | 11 - libclc/generic/include/clc/math/copysign.h | 2 - libclc/generic/include/clc/math/copysign.inc | 1 - libclc/generic/include/clc/math/cos.h | 3 - libclc/generic/include/clc/math/cos.inc | 1 - libclc/generic/include/clc/math/cospi.h | 3 - libclc/generic/include/clc/math/cospi.inc | 1 - libclc/generic/include/clc/math/erf.h | 9 - libclc/generic/include/clc/math/erfc.h | 9 - libclc/generic/include/clc/math/exp.h | 9 - libclc/generic/include/clc/math/exp10.h | 9 - libclc/generic/include/clc/math/exp2.h | 24 - libclc/generic/include/clc/math/exp2.inc | 23 - libclc/generic/include/clc/math/fabs.h | 6 - libclc/generic/include/clc/math/fdim.h | 2 - libclc/generic/include/clc/math/fdim.inc | 1 - libclc/generic/include/clc/math/floor.h | 6 - libclc/generic/include/clc/math/fma.h | 6 - libclc/generic/include/clc/math/fmax.h | 8 - libclc/generic/include/clc/math/fmin.h | 8 - libclc/generic/include/clc/math/fmod.h | 2 - libclc/generic/include/clc/math/fmod.inc | 1 - libclc/generic/include/clc/math/fract.h | 24 - libclc/generic/include/clc/math/fract.inc | 25 - libclc/generic/include/clc/math/frexp.h | 2 - libclc/generic/include/clc/math/frexp.inc | 3 - libclc/generic/include/clc/math/gentype.inc | 113 - libclc/generic/include/clc/math/half_rsqrt.h | 31 - libclc/generic/include/clc/math/half_sqrt.h | 31 - libclc/generic/include/clc/math/hypot.h | 2 - libclc/generic/include/clc/math/hypot.inc | 1 - libclc/generic/include/clc/math/ilogb.h | 5 - libclc/generic/include/clc/math/ilogb.inc | 1 - libclc/generic/include/clc/math/ldexp.h | 24 - libclc/generic/include/clc/math/ldexp.inc | 29 - libclc/generic/include/clc/math/log.h | 24 - libclc/generic/include/clc/math/log.inc | 23 - libclc/generic/include/clc/math/log10.h | 9 - libclc/generic/include/clc/math/log1p.h | 24 - libclc/generic/include/clc/math/log1p.inc | 23 - libclc/generic/include/clc/math/log2.h | 24 - libclc/generic/include/clc/math/log2.inc | 23 - libclc/generic/include/clc/math/mad.h | 2 - libclc/generic/include/clc/math/mad.inc | 1 - libclc/generic/include/clc/math/modf.h | 24 - libclc/generic/include/clc/math/modf.inc | 25 - libclc/generic/include/clc/math/native_cos.h | 1 - .../generic/include/clc/math/native_divide.h | 1 - libclc/generic/include/clc/math/native_exp.h | 1 - .../generic/include/clc/math/native_exp10.h | 1 - libclc/generic/include/clc/math/native_exp2.h | 1 - libclc/generic/include/clc/math/native_log.h | 27 - .../generic/include/clc/math/native_log.inc | 23 - libclc/generic/include/clc/math/native_log2.h | 27 - .../generic/include/clc/math/native_log2.inc | 23 - libclc/generic/include/clc/math/native_powr.h | 1 - libclc/generic/include/clc/math/native_sin.h | 1 - libclc/generic/include/clc/math/native_sqrt.h | 1 - libclc/generic/include/clc/math/nextafter.h | 5 - libclc/generic/include/clc/math/pow.h | 6 - libclc/generic/include/clc/math/pown.h | 24 - libclc/generic/include/clc/math/rint.h | 6 - libclc/generic/include/clc/math/round.h | 9 - libclc/generic/include/clc/math/rsqrt.h | 1 - libclc/generic/include/clc/math/sin.h | 3 - libclc/generic/include/clc/math/sin.inc | 1 - libclc/generic/include/clc/math/sincos.h | 2 - libclc/generic/include/clc/math/sincos.inc | 8 - libclc/generic/include/clc/math/sinpi.h | 3 - libclc/generic/include/clc/math/sinpi.inc | 1 - libclc/generic/include/clc/math/sqrt.h | 3 - libclc/generic/include/clc/math/sqrt.inc | 1 - libclc/generic/include/clc/math/tan.h | 2 - libclc/generic/include/clc/math/tan.inc | 1 - libclc/generic/include/clc/math/tanh.h | 24 - libclc/generic/include/clc/math/tanh.inc | 23 - .../include/clc/math/ternary_intrin.inc | 18 - libclc/generic/include/clc/math/trunc.h | 9 - .../generic/include/clc/math/unary_decl.inc | 1 - .../generic/include/clc/math/unary_intrin.inc | 18 - libclc/generic/include/clc/relational/all.h | 18 - libclc/generic/include/clc/relational/any.h | 16 - .../include/clc/relational/binary_decl.inc | 1 - .../include/clc/relational/bitselect.h | 28 - .../include/clc/relational/bitselect.inc | 23 - .../generic/include/clc/relational/floatn.inc | 81 - .../generic/include/clc/relational/isequal.h | 20 - .../generic/include/clc/relational/isfinite.h | 9 - .../include/clc/relational/isgreater.h | 9 - .../include/clc/relational/isgreaterequal.h | 9 - libclc/generic/include/clc/relational/isinf.h | 21 - .../generic/include/clc/relational/isless.h | 7 - .../include/clc/relational/islessequal.h | 7 - .../include/clc/relational/islessgreater.h | 7 - libclc/generic/include/clc/relational/isnan.h | 21 - .../generic/include/clc/relational/isnormal.h | 9 - .../include/clc/relational/isnotequal.h | 9 - .../include/clc/relational/isordered.h | 9 - .../include/clc/relational/isunordered.h | 9 - .../generic/include/clc/relational/select.h | 1 - .../generic/include/clc/relational/signbit.h | 9 - .../include/clc/relational/unary_decl.inc | 1 - libclc/generic/include/clc/shared/clamp.h | 5 - libclc/generic/include/clc/shared/clamp.inc | 5 - libclc/generic/include/clc/shared/max.h | 5 - libclc/generic/include/clc/shared/max.inc | 5 - libclc/generic/include/clc/shared/min.h | 5 - libclc/generic/include/clc/shared/min.inc | 5 - libclc/generic/include/clc/shared/vload.h | 37 - libclc/generic/include/clc/shared/vstore.h | 36 - .../include/clc/synchronization/barrier.h | 1 - .../clc/synchronization/cl_mem_fence_flags.h | 4 - .../include/clc/workitem/get_global_id.h | 1 - .../include/clc/workitem/get_global_size.h | 1 - .../include/clc/workitem/get_group_id.h | 1 - .../include/clc/workitem/get_local_id.h | 1 - .../include/clc/workitem/get_local_size.h | 1 - .../include/clc/workitem/get_num_groups.h | 1 - .../include/clc/workitem/get_work_dim.h | 1 - libclc/generic/include/config.h | 26 - libclc/generic/include/math/clc_ldexp.h | 6 - libclc/generic/include/math/clc_nextafter.h | 7 - libclc/generic/include/math/clc_sqrt.h | 29 - libclc/generic/include/math/clc_sqrt.inc | 23 - libclc/generic/lib/SOURCES | 142 - .../lib/async/async_work_group_copy.cl | 9 - .../lib/async/async_work_group_copy.inc | 17 - .../async/async_work_group_strided_copy.cl | 9 - .../async/async_work_group_strided_copy.inc | 34 - libclc/generic/lib/async/prefetch.cl | 9 - libclc/generic/lib/async/prefetch.inc | 1 - libclc/generic/lib/async/wait_group_events.cl | 5 - libclc/generic/lib/atomic/atomic_impl.ll | 133 - libclc/generic/lib/atomic/atomic_xchg.cl | 9 - .../atom_add.cl | 9 - .../atom_cmpxchg.cl | 9 - .../atom_dec.cl | 9 - .../atom_inc.cl | 9 - .../atom_sub.cl | 9 - .../atom_xchg.cl | 9 - .../atom_and.cl | 9 - .../atom_max.cl | 9 - .../atom_min.cl | 9 - .../atom_or.cl | 9 - .../atom_xor.cl | 9 - .../atom_add.cl | 9 - .../atom_cmpxchg.cl | 9 - .../atom_dec.cl | 9 - .../atom_inc.cl | 9 - .../atom_sub.cl | 9 - .../atom_xchg.cl | 9 - .../atom_and.cl | 9 - .../atom_max.cl | 9 - .../atom_min.cl | 9 - .../atom_or.cl | 9 - .../atom_xor.cl | 9 - libclc/generic/lib/clcmacro.h | 148 - libclc/generic/lib/common/degrees.cl | 45 - libclc/generic/lib/common/mix.cl | 8 - libclc/generic/lib/common/mix.inc | 9 - libclc/generic/lib/common/radians.cl | 45 - libclc/generic/lib/common/sign.cl | 28 - libclc/generic/lib/common/smoothstep.cl | 55 - libclc/generic/lib/common/step.cl | 54 - libclc/generic/lib/gen_convert.py | 395 - libclc/generic/lib/geometric/cross.cl | 25 - libclc/generic/lib/geometric/distance.cl | 30 - libclc/generic/lib/geometric/distance.inc | 25 - libclc/generic/lib/geometric/dot.cl | 39 - libclc/generic/lib/geometric/fast_distance.cl | 28 - .../generic/lib/geometric/fast_distance.inc | 25 - libclc/generic/lib/geometric/fast_length.cl | 39 - .../generic/lib/geometric/fast_normalize.cl | 32 - .../generic/lib/geometric/fast_normalize.inc | 31 - libclc/generic/lib/geometric/length.cl | 87 - libclc/generic/lib/geometric/normalize.cl | 157 - libclc/generic/lib/image/get_image_dim.cl | 9 - libclc/generic/lib/integer/abs.cl | 4 - libclc/generic/lib/integer/abs.inc | 3 - libclc/generic/lib/integer/abs_diff.cl | 4 - libclc/generic/lib/integer/abs_diff.inc | 3 - libclc/generic/lib/integer/add_sat.cl | 53 - libclc/generic/lib/integer/add_sat_if.ll | 55 - libclc/generic/lib/integer/add_sat_impl.ll | 83 - libclc/generic/lib/integer/clz.cl | 53 - libclc/generic/lib/integer/clz_if.ll | 55 - libclc/generic/lib/integer/clz_impl.ll | 44 - libclc/generic/lib/integer/hadd.cl | 4 - libclc/generic/lib/integer/hadd.inc | 6 - libclc/generic/lib/integer/mad24.cl | 4 - libclc/generic/lib/integer/mad24.inc | 3 - libclc/generic/lib/integer/mad_sat.cl | 72 - libclc/generic/lib/integer/mul24.cl | 4 - libclc/generic/lib/integer/mul24.inc | 11 - libclc/generic/lib/integer/mul_hi.cl | 109 - libclc/generic/lib/integer/rhadd.cl | 4 - libclc/generic/lib/integer/rhadd.inc | 6 - libclc/generic/lib/integer/rotate.cl | 4 - libclc/generic/lib/integer/rotate.inc | 42 - libclc/generic/lib/integer/sub_sat.cl | 53 - libclc/generic/lib/integer/sub_sat_if.ll | 55 - libclc/generic/lib/integer/sub_sat_impl.ll | 83 - libclc/generic/lib/integer/upsample.cl | 34 - libclc/generic/lib/math/acos.cl | 8 - libclc/generic/lib/math/acos.inc | 29 - libclc/generic/lib/math/acosh.cl | 127 - libclc/generic/lib/math/acospi.cl | 172 - libclc/generic/lib/math/asin.cl | 8 - libclc/generic/lib/math/asin.inc | 12 - libclc/generic/lib/math/asinh.cl | 293 - libclc/generic/lib/math/asinpi.cl | 170 - libclc/generic/lib/math/atan.cl | 183 - libclc/generic/lib/math/atan2.cl | 237 - libclc/generic/lib/math/atan2pi.cl | 221 - libclc/generic/lib/math/atanh.cl | 113 - libclc/generic/lib/math/atanpi.cl | 182 - libclc/generic/lib/math/binary_impl.inc | 22 - libclc/generic/lib/math/clc_ldexp.cl | 128 - libclc/generic/lib/math/clc_nextafter.cl | 43 - libclc/generic/lib/math/clc_sqrt.cl | 37 - libclc/generic/lib/math/clc_sqrt_impl.inc | 38 - libclc/generic/lib/math/copysign.cl | 12 - libclc/generic/lib/math/cos.cl | 77 - libclc/generic/lib/math/cospi.cl | 136 - libclc/generic/lib/math/ep_log.cl | 94 - libclc/generic/lib/math/ep_log.h | 29 - libclc/generic/lib/math/erf.cl | 402 - libclc/generic/lib/math/erfc.cl | 413 - libclc/generic/lib/math/exp.cl | 90 - libclc/generic/lib/math/exp10.cl | 8 - libclc/generic/lib/math/exp10.inc | 10 - libclc/generic/lib/math/exp2.cl | 86 - libclc/generic/lib/math/exp_helper.cl | 69 - libclc/generic/lib/math/exp_helper.h | 29 - libclc/generic/lib/math/fdim.cl | 10 - libclc/generic/lib/math/fdim.inc | 71 - libclc/generic/lib/math/fmax.cl | 16 - libclc/generic/lib/math/fmax.inc | 18 - libclc/generic/lib/math/fmin.cl | 16 - libclc/generic/lib/math/fmin.inc | 18 - libclc/generic/lib/math/fmod.cl | 12 - libclc/generic/lib/math/fract.cl | 30 - libclc/generic/lib/math/fract.inc | 49 - libclc/generic/lib/math/frexp.cl | 10 - libclc/generic/lib/math/frexp.inc | 110 - libclc/generic/lib/math/half_rsqrt.cl | 28 - libclc/generic/lib/math/half_rsqrt.inc | 25 - libclc/generic/lib/math/half_sqrt.cl | 28 - libclc/generic/lib/math/half_sqrt.inc | 25 - libclc/generic/lib/math/hypot.cl | 8 - libclc/generic/lib/math/hypot.inc | 3 - libclc/generic/lib/math/ilogb.cl | 57 - libclc/generic/lib/math/ldexp.cl | 41 - libclc/generic/lib/math/ldexp.inc | 29 - libclc/generic/lib/math/log.cl | 26 - libclc/generic/lib/math/log10.cl | 8 - libclc/generic/lib/math/log10.inc | 13 - libclc/generic/lib/math/log1p.cl | 177 - libclc/generic/lib/math/log2.cl | 39 - libclc/generic/lib/math/log_base.h | 299 - libclc/generic/lib/math/mad.cl | 8 - libclc/generic/lib/math/mad.inc | 3 - libclc/generic/lib/math/math.h | 90 - libclc/generic/lib/math/modf.cl | 32 - libclc/generic/lib/math/modf.inc | 37 - libclc/generic/lib/math/native_log.cl | 32 - libclc/generic/lib/math/native_log.inc | 25 - libclc/generic/lib/math/native_log2.cl | 32 - libclc/generic/lib/math/native_log2.inc | 25 - libclc/generic/lib/math/nextafter.cl | 12 - libclc/generic/lib/math/pown.cl | 10 - libclc/generic/lib/math/sin.cl | 79 - libclc/generic/lib/math/sincos.cl | 8 - libclc/generic/lib/math/sincos.inc | 11 - libclc/generic/lib/math/sincosD_piby4.h | 78 - libclc/generic/lib/math/sincos_helpers.cl | 545 - libclc/generic/lib/math/sincos_helpers.h | 35 - libclc/generic/lib/math/sincospiF_piby4.h | 56 - libclc/generic/lib/math/sinpi.cl | 131 - libclc/generic/lib/math/sqrt.cl | 35 - libclc/generic/lib/math/tables.cl | 841 - libclc/generic/lib/math/tables.h | 53 - libclc/generic/lib/math/tan.cl | 8 - libclc/generic/lib/math/tan.inc | 17 - libclc/generic/lib/math/tanh.cl | 146 - libclc/generic/lib/relational/all.cl | 29 - libclc/generic/lib/relational/any.cl | 30 - libclc/generic/lib/relational/bitselect.cl | 53 - libclc/generic/lib/relational/bitselect.inc | 25 - libclc/generic/lib/relational/isequal.cl | 30 - libclc/generic/lib/relational/isfinite.cl | 18 - libclc/generic/lib/relational/isgreater.cl | 22 - .../generic/lib/relational/isgreaterequal.cl | 22 - libclc/generic/lib/relational/isinf.cl | 18 - libclc/generic/lib/relational/isless.cl | 22 - libclc/generic/lib/relational/islessequal.cl | 22 - .../generic/lib/relational/islessgreater.cl | 22 - libclc/generic/lib/relational/isnan.cl | 18 - libclc/generic/lib/relational/isnormal.cl | 18 - libclc/generic/lib/relational/isnotequal.cl | 23 - libclc/generic/lib/relational/isordered.cl | 23 - libclc/generic/lib/relational/isunordered.cl | 22 - libclc/generic/lib/relational/relational.h | 117 - libclc/generic/lib/relational/signbit.cl | 19 - libclc/generic/lib/shared/clamp.cl | 11 - libclc/generic/lib/shared/clamp.inc | 9 - libclc/generic/lib/shared/max.cl | 11 - libclc/generic/lib/shared/max.inc | 9 - libclc/generic/lib/shared/min.cl | 11 - libclc/generic/lib/shared/min.inc | 9 - libclc/generic/lib/shared/vload.cl | 52 - libclc/generic/lib/shared/vstore.cl | 52 - libclc/generic/lib/subnormal_config.cl | 37 - libclc/generic/lib/subnormal_disable.ll | 1 - libclc/generic/lib/subnormal_helper_func.ll | 8 - libclc/generic/lib/subnormal_use_default.ll | 1 - libclc/generic/lib/workitem/get_global_id.cl | 5 - .../generic/lib/workitem/get_global_size.cl | 5 - libclc/ptx-nvidiacl/lib/SOURCES | 5 - .../lib/synchronization/barrier.cl | 8 - .../ptx-nvidiacl/lib/workitem/get_group_id.cl | 10 - .../ptx-nvidiacl/lib/workitem/get_local_id.cl | 10 - .../lib/workitem/get_local_size.cl | 10 - .../lib/workitem/get_num_groups.cl | 10 - libclc/ptx/lib/OVERRIDES | 2 - libclc/ptx/lib/SOURCES | 2 - libclc/ptx/lib/integer/add_sat.ll | 55 - libclc/ptx/lib/integer/sub_sat.ll | 55 - libclc/r600/lib/OVERRIDES | 0 libclc/r600/lib/SOURCES | 3 - .../r600/lib/synchronization/barrier_impl.ll | 33 - libclc/r600/lib/workitem/get_group_id.ll | 29 - libclc/r600/lib/workitem/get_local_id.ll | 31 - libclc/test/add_sat.cl | 3 - libclc/test/as_type.cl | 3 - libclc/test/convert.cl | 3 - libclc/test/cos.cl | 3 - libclc/test/cross.cl | 3 - libclc/test/fabs.cl | 3 - libclc/test/get_group_id.cl | 3 - libclc/test/rsqrt.cl | 6 - libclc/test/subsat.cl | 19 - libclc/utils/prepare-builtins.cpp | 91 - libclc/www/index.html | 55 - llgo/.arcconfig | 4 - llgo/CMakeLists.txt | 263 - llgo/LICENSE.TXT | 94 - llgo/README.TXT | 80 - llgo/autoconf/config.sub | 1770 -- llgo/build/context.go | 95 - llgo/buildslave-config.yaml | 31 - llgo/cmd/cc-wrapper/main.go | 71 - llgo/cmd/cgo/zdefaultcc.go | 46 - llgo/cmd/gllgo/config.h.cmake | 11 - llgo/cmd/gllgo/gllgo.go | 833 - llgo/cmd/go/zdefaultcc.go.in | 55 - llgo/cmd/llgoi/llgoi.go | 597 - llgo/debug/debug.go | 437 - llgo/docs/Makefile.sphinx | 177 - llgo/docs/conf.py | 258 - llgo/docs/index.rst | 23 - llgo/docs/llgoi.rst | 80 - llgo/docs/make.bat | 242 - llgo/driver/parser.go | 43 - llgo/include/dwarf2.h | 94 - llgo/include/filenames.h | 15 - llgo/include/unwind-pe.h | 201 - llgo/irgen/annotations.go | 64 - llgo/irgen/attribute.go | 177 - llgo/irgen/builtins.go | 118 - llgo/irgen/cabi.go | 679 - llgo/irgen/call.go | 44 - llgo/irgen/channels.go | 134 - llgo/irgen/closures.go | 37 - llgo/irgen/compiler.go | 395 - llgo/irgen/errors.go | 72 - llgo/irgen/indirect.go | 125 - llgo/irgen/interfaces.go | 196 - llgo/irgen/maps.go | 153 - llgo/irgen/predicates.go | 58 - llgo/irgen/println.go | 93 - llgo/irgen/runtime.go | 607 - llgo/irgen/slice.go | 106 - llgo/irgen/ssa.go | 1341 -- llgo/irgen/strings.go | 114 - llgo/irgen/switches.go | 145 - llgo/irgen/targets.go | 89 - llgo/irgen/typemap.go | 2053 -- llgo/irgen/types.go | 22 - llgo/irgen/utils.go | 40 - llgo/irgen/value.go | 638 - llgo/irgen/version.go | 23 - llgo/libgo-check-failures.diff | 49 - llgo/libgo-noext.diff | 1790 -- llgo/llgo-go.sh | 19 - llgo/ssaopt/esc.go | 94 - llgo/test/CMakeLists.txt | 16 - llgo/test/debuginfo/emptyname.go | 7 - llgo/test/driver/parse-arguments.go | 17 - llgo/test/execution/Inputs/init2.go | 5 - llgo/test/execution/arrays/compare.go | 18 - llgo/test/execution/arrays/index.go | 288 - llgo/test/execution/arrays/range.go | 23 - llgo/test/execution/arrays/slice.go | 14 - llgo/test/execution/assignment/arrays.go | 22 - llgo/test/execution/assignment/binop.go | 21 - .../execution/assignment/dereferencing.go | 13 - llgo/test/execution/assignment/multi.go | 40 - llgo/test/execution/assignment/namedresult.go | 42 - llgo/test/execution/branching/goto.go | 43 - llgo/test/execution/branching/labeled.go | 22 - llgo/test/execution/chan/buffered.go | 41 - llgo/test/execution/chan/range.go | 28 - llgo/test/execution/chan/select.go | 27 - llgo/test/execution/chan/self.go | 20 - llgo/test/execution/circulartype.go | 17 - llgo/test/execution/closures/basic.go | 15 - llgo/test/execution/closures/issue176.go | 15 - llgo/test/execution/complex.go | 24 - llgo/test/execution/const.go | 78 - llgo/test/execution/conversions/complex.go | 15 - llgo/test/execution/conversions/float.go | 103 - llgo/test/execution/conversions/int.go | 44 - .../execution/conversions/sameunderlying.go | 15 - llgo/test/execution/defer.go | 125 - llgo/test/execution/errors/recover.go | 11 - llgo/test/execution/for/branch.go | 41 - llgo/test/execution/fun.go | 28 - llgo/test/execution/functions/compare.go | 26 - llgo/test/execution/functions/multivalue.go | 28 - llgo/test/execution/functions/unreachable.go | 53 - llgo/test/execution/go.go | 34 - llgo/test/execution/if/lazy.go | 46 - llgo/test/execution/init.go | 17 - llgo/test/execution/interfaces/assert.go | 61 - llgo/test/execution/interfaces/basic.go | 43 - llgo/test/execution/interfaces/comparei2i.go | 30 - llgo/test/execution/interfaces/comparei2v.go | 13 - .../execution/interfaces/e2i_conversion.go | 22 - llgo/test/execution/interfaces/embedded.go | 32 - llgo/test/execution/interfaces/error.go | 43 - .../execution/interfaces/i2i_conversion.go | 33 - llgo/test/execution/interfaces/import.go | 16 - llgo/test/execution/interfaces/methods.go | 53 - .../execution/interfaces/static_conversion.go | 35 - llgo/test/execution/interfaces/wordsize.go | 40 - llgo/test/execution/literals/array.go | 78 - llgo/test/execution/literals/func.go | 15 - llgo/test/execution/literals/map.go | 24 - llgo/test/execution/literals/slice.go | 21 - llgo/test/execution/literals/struct.go | 62 - llgo/test/execution/maps/delete.go | 19 - llgo/test/execution/maps/insert.go | 29 - llgo/test/execution/maps/lookup.go | 30 - llgo/test/execution/maps/range.go | 48 - llgo/test/execution/methods/methodvalues.go | 64 - llgo/test/execution/methods/nilrecv.go | 31 - llgo/test/execution/methods/selectors.go | 45 - llgo/test/execution/new.go | 17 - llgo/test/execution/nil.go | 32 - llgo/test/execution/operators/basics.go | 133 - .../execution/operators/binary_untyped.go | 17 - llgo/test/execution/operators/shifts.go | 290 - llgo/test/execution/slices/append.go | 254 - llgo/test/execution/slices/cap.go | 50 - llgo/test/execution/slices/compare.go | 26 - llgo/test/execution/slices/copy.go | 17 - llgo/test/execution/slices/index.go | 14 - llgo/test/execution/slices/literal.go | 15 - llgo/test/execution/slices/make.go | 23 - llgo/test/execution/slices/sliceexpr.go | 39 - llgo/test/execution/strings/add.go | 15 - llgo/test/execution/strings/bytes.go | 41 - llgo/test/execution/strings/compare.go | 54 - llgo/test/execution/strings/index.go | 11 - llgo/test/execution/strings/range.go | 86 - llgo/test/execution/strings/runetostring.go | 74 - llgo/test/execution/strings/slice.go | 17 - llgo/test/execution/structs/compare.go | 52 - llgo/test/execution/structs/embed.go | 58 - llgo/test/execution/switch/branch.go | 23 - llgo/test/execution/switch/default.go | 21 - llgo/test/execution/switch/empty.go | 16 - llgo/test/execution/switch/scope.go | 20 - llgo/test/execution/switch/strings.go | 21 - llgo/test/execution/switch/type.go | 72 - llgo/test/execution/types/named.go | 37 - llgo/test/execution/types/recursive.go | 29 - llgo/test/execution/unsafe/const_sizeof.go | 18 - llgo/test/execution/unsafe/offsetof.go | 26 - llgo/test/execution/unsafe/pointer.go | 21 - llgo/test/execution/unsafe/sizeof_array.go | 18 - llgo/test/execution/unsafe/sizeof_basic.go | 102 - llgo/test/execution/unsafe/sizeof_struct.go | 19 - llgo/test/execution/var.go | 37 - llgo/test/execution/varargs.go | 31 - llgo/test/gllgo/dead.go | 6 - .../test/irgen/Inputs/mangling-synthetic-p.go | 4 - llgo/test/irgen/avoidload.go | 15 - llgo/test/irgen/cabi.go | 23 - llgo/test/irgen/go-panic.go | 10 - llgo/test/irgen/imports.go | 20 - llgo/test/irgen/mangling-dot.go | 7 - llgo/test/irgen/mangling-synthetic.go | 14 - llgo/test/irgen/select.go | 18 - llgo/test/irgen/switch.go | 62 - llgo/test/lit.cfg | 16 - llgo/test/lit.site.cfg.in | 4 - llgo/test/llgoi/Inputs/src/bar/answer.go | 8 - llgo/test/llgoi/Inputs/src/foo/answer.go | 7 - llgo/test/llgoi/Inputs/src/foo_cgo/answer.go | 8 - llgo/test/llgoi/arith.test | 4 - llgo/test/llgoi/import-binary.test | 5 - llgo/test/llgoi/import-source.test | 28 - llgo/test/llgoi/import-source2.test | 12 - llgo/test/llgoi/interfaces.test | 22 - llgo/test/llgoi/maps.test | 27 - llgo/test/llgoi/panic.test | 16 - llgo/test/llgoi/vars.test | 30 - llgo/third_party/gofrontend/LICENSE | 27 - llgo/third_party/gofrontend/config-ml.in | 885 - llgo/third_party/gofrontend/config.guess | 1532 -- llgo/third_party/gofrontend/config.sub | 1770 -- llgo/third_party/gofrontend/depcomp | 756 - .../third_party/gofrontend/include/dwarf2.def | 0 llgo/third_party/gofrontend/include/dwarf2.h | 94 - .../gofrontend/include/filenames.h | 15 - llgo/third_party/gofrontend/install-sh | 501 - .../gofrontend/libbacktrace/ChangeLog | 456 - .../gofrontend/libbacktrace/ChangeLog.jit | 14 - .../gofrontend/libbacktrace/Makefile.am | 132 - .../gofrontend/libbacktrace/Makefile.in | 739 - .../gofrontend/libbacktrace/README | 23 - .../gofrontend/libbacktrace/aclocal.m4 | 667 - .../gofrontend/libbacktrace/alloc.c | 152 - .../gofrontend/libbacktrace/atomic.c | 113 - .../libbacktrace/backtrace-supported.h.in | 61 - .../gofrontend/libbacktrace/backtrace.c | 108 - .../gofrontend/libbacktrace/backtrace.h | 199 - .../gofrontend/libbacktrace/btest.c | 715 - .../gofrontend/libbacktrace/config.h.in | 134 - .../gofrontend/libbacktrace/configure | 15156 ------------- .../gofrontend/libbacktrace/configure.ac | 391 - .../gofrontend/libbacktrace/dwarf.c | 3022 --- .../third_party/gofrontend/libbacktrace/elf.c | 976 - .../gofrontend/libbacktrace/fileline.c | 194 - .../gofrontend/libbacktrace/filetype.awk | 3 - .../gofrontend/libbacktrace/internal.h | 292 - .../gofrontend/libbacktrace/mmap.c | 295 - .../gofrontend/libbacktrace/mmapio.c | 100 - .../gofrontend/libbacktrace/nounwind.c | 66 - .../gofrontend/libbacktrace/posix.c | 100 - .../gofrontend/libbacktrace/print.c | 92 - .../gofrontend/libbacktrace/read.c | 96 - .../gofrontend/libbacktrace/simple.c | 108 - .../gofrontend/libbacktrace/sort.c | 108 - .../gofrontend/libbacktrace/state.c | 72 - .../gofrontend/libbacktrace/stest.c | 137 - .../gofrontend/libbacktrace/unknown.c | 64 - .../gofrontend/libffi/ChangeLog.libffi | 584 - .../gofrontend/libffi/ChangeLog.libgcj | 40 - .../gofrontend/libffi/ChangeLog.v1 | 764 - llgo/third_party/gofrontend/libffi/LICENSE | 21 - .../third_party/gofrontend/libffi/Makefile.am | 219 - .../third_party/gofrontend/libffi/Makefile.in | 1860 -- llgo/third_party/gofrontend/libffi/README | 450 - .../gofrontend/libffi/acinclude.m4 | 92 - llgo/third_party/gofrontend/libffi/aclocal.m4 | 1039 - llgo/third_party/gofrontend/libffi/configure | 18792 ---------------- .../gofrontend/libffi/configure.ac | 392 - .../gofrontend/libffi/configure.host | 265 - .../gofrontend/libffi/doc/libffi.texi | 0 .../gofrontend/libffi/doc/version.texi | 4 - .../gofrontend/libffi/fficonfig.h.in | 211 - .../generate-darwin-source-and-headers.py | 209 - .../gofrontend/libffi/include/Makefile.am | 13 - .../gofrontend/libffi/include/Makefile.in | 458 - .../gofrontend/libffi/include/ffi.h.in | 503 - .../gofrontend/libffi/include/ffi_cfi.h | 55 - .../gofrontend/libffi/include/ffi_common.h | 132 - .../gofrontend/libffi/libffi.pc.in | 11 - .../libffi/libffi.xcodeproj/project.pbxproj | 637 - .../gofrontend/libffi/libtool-version | 6 - .../gofrontend/libffi/man/Makefile.am | 8 - .../gofrontend/libffi/man/Makefile.in | 420 - llgo/third_party/gofrontend/libffi/man/ffi.3 | 41 - .../gofrontend/libffi/man/ffi_call.3 | 103 - .../gofrontend/libffi/man/ffi_prep_cif.3 | 68 - .../gofrontend/libffi/man/ffi_prep_cif_var.3 | 73 - llgo/third_party/gofrontend/libffi/mdate-sh | 205 - .../gofrontend/libffi/src/aarch64/ffi.c | 910 - .../gofrontend/libffi/src/aarch64/ffitarget.h | 61 - .../gofrontend/libffi/src/aarch64/internal.h | 67 - .../gofrontend/libffi/src/aarch64/sysv.S | 403 - .../gofrontend/libffi/src/alpha/ffi.c | 521 - .../gofrontend/libffi/src/alpha/ffitarget.h | 57 - .../gofrontend/libffi/src/alpha/internal.h | 23 - .../gofrontend/libffi/src/alpha/osf.S | 282 - .../gofrontend/libffi/src/arc/arcompact.S | 135 - .../gofrontend/libffi/src/arc/ffi.c | 268 - .../gofrontend/libffi/src/arc/ffitarget.h | 53 - .../gofrontend/libffi/src/arm/ffi.c | 1043 - .../gofrontend/libffi/src/arm/ffitarget.h | 69 - .../gofrontend/libffi/src/arm/internal.h | 7 - .../gofrontend/libffi/src/arm/sysv.S | 335 - .../gofrontend/libffi/src/avr32/ffi.c | 423 - .../gofrontend/libffi/src/avr32/ffitarget.h | 55 - .../gofrontend/libffi/src/avr32/sysv.S | 208 - .../gofrontend/libffi/src/bfin/ffi.c | 196 - .../gofrontend/libffi/src/bfin/ffitarget.h | 43 - .../gofrontend/libffi/src/bfin/sysv.S | 179 - .../gofrontend/libffi/src/closures.c | 688 - .../gofrontend/libffi/src/cris/ffi.c | 386 - .../gofrontend/libffi/src/cris/ffitarget.h | 56 - .../gofrontend/libffi/src/cris/sysv.S | 215 - .../third_party/gofrontend/libffi/src/debug.c | 64 - .../gofrontend/libffi/src/dlmalloc.c | 5161 ----- .../gofrontend/libffi/src/frv/eabi.S | 128 - .../gofrontend/libffi/src/frv/ffi.c | 292 - .../gofrontend/libffi/src/frv/ffitarget.h | 62 - .../gofrontend/libffi/src/ia64/ffi.c | 586 - .../gofrontend/libffi/src/ia64/ffitarget.h | 55 - .../gofrontend/libffi/src/ia64/ia64_flags.h | 40 - .../gofrontend/libffi/src/ia64/unix.S | 560 - .../gofrontend/libffi/src/java_raw_api.c | 374 - .../gofrontend/libffi/src/m32r/ffi.c | 232 - .../gofrontend/libffi/src/m32r/ffitarget.h | 53 - .../gofrontend/libffi/src/m32r/sysv.S | 121 - .../gofrontend/libffi/src/m68k/ffi.c | 362 - .../gofrontend/libffi/src/m68k/ffitarget.h | 54 - .../gofrontend/libffi/src/m68k/sysv.S | 330 - .../gofrontend/libffi/src/m88k/ffi.c | 400 - .../gofrontend/libffi/src/m88k/ffitarget.h | 49 - .../gofrontend/libffi/src/m88k/obsd.S | 209 - .../gofrontend/libffi/src/metag/ffi.c | 330 - .../gofrontend/libffi/src/metag/ffitarget.h | 53 - .../gofrontend/libffi/src/metag/sysv.S | 311 - .../gofrontend/libffi/src/microblaze/ffi.c | 321 - .../libffi/src/microblaze/ffitarget.h | 53 - .../gofrontend/libffi/src/microblaze/sysv.S | 302 - .../gofrontend/libffi/src/mips/ffi.c | 1050 - .../gofrontend/libffi/src/mips/ffitarget.h | 247 - .../gofrontend/libffi/src/mips/n32.S | 576 - .../gofrontend/libffi/src/mips/o32.S | 381 - .../gofrontend/libffi/src/moxie/eabi.S | 101 - .../gofrontend/libffi/src/moxie/ffi.c | 272 - .../gofrontend/libffi/src/moxie/ffitarget.h | 52 - .../gofrontend/libffi/src/nios2/ffi.c | 304 - .../gofrontend/libffi/src/nios2/ffitarget.h | 52 - .../gofrontend/libffi/src/nios2/sysv.S | 136 - .../gofrontend/libffi/src/or1k/ffi.c | 328 - .../gofrontend/libffi/src/or1k/ffitarget.h | 58 - .../gofrontend/libffi/src/or1k/sysv.S | 107 - .../gofrontend/libffi/src/pa/ffi.c | 719 - .../gofrontend/libffi/src/pa/ffitarget.h | 85 - .../gofrontend/libffi/src/pa/hpux32.S | 368 - .../gofrontend/libffi/src/pa/linux.S | 357 - .../gofrontend/libffi/src/powerpc/aix.S | 328 - .../libffi/src/powerpc/aix_closure.S | 447 - .../gofrontend/libffi/src/powerpc/asm.h | 125 - .../gofrontend/libffi/src/powerpc/darwin.S | 378 - .../libffi/src/powerpc/darwin_closure.S | 571 - .../gofrontend/libffi/src/powerpc/ffi.c | 173 - .../libffi/src/powerpc/ffi_darwin.c | 1359 -- .../libffi/src/powerpc/ffi_linux64.c | 945 - .../libffi/src/powerpc/ffi_powerpc.h | 94 - .../gofrontend/libffi/src/powerpc/ffi_sysv.c | 934 - .../gofrontend/libffi/src/powerpc/ffitarget.h | 195 - .../gofrontend/libffi/src/powerpc/linux64.S | 228 - .../libffi/src/powerpc/linux64_closure.S | 488 - .../libffi/src/powerpc/ppc_closure.S | 397 - .../gofrontend/libffi/src/powerpc/sysv.S | 175 - .../gofrontend/libffi/src/prep_cif.c | 242 - .../gofrontend/libffi/src/raw_api.c | 267 - .../gofrontend/libffi/src/s390/ffi.c | 756 - .../gofrontend/libffi/src/s390/ffitarget.h | 70 - .../gofrontend/libffi/src/s390/internal.h | 11 - .../gofrontend/libffi/src/s390/sysv.S | 325 - .../gofrontend/libffi/src/sh/ffi.c | 717 - .../gofrontend/libffi/src/sh/ffitarget.h | 54 - .../gofrontend/libffi/src/sh/sysv.S | 850 - .../gofrontend/libffi/src/sh64/ffi.c | 469 - .../gofrontend/libffi/src/sh64/ffitarget.h | 58 - .../gofrontend/libffi/src/sh64/sysv.S | 539 - .../gofrontend/libffi/src/sparc/ffi.c | 468 - .../gofrontend/libffi/src/sparc/ffi64.c | 608 - .../gofrontend/libffi/src/sparc/ffitarget.h | 81 - .../gofrontend/libffi/src/sparc/internal.h | 26 - .../gofrontend/libffi/src/sparc/v8.S | 361 - .../gofrontend/libffi/src/sparc/v9.S | 377 - .../gofrontend/libffi/src/tile/ffi.c | 355 - .../gofrontend/libffi/src/tile/ffitarget.h | 65 - .../gofrontend/libffi/src/tile/tile.S | 360 - .../third_party/gofrontend/libffi/src/types.c | 106 - .../gofrontend/libffi/src/vax/elfbsd.S | 195 - .../gofrontend/libffi/src/vax/ffi.c | 276 - .../gofrontend/libffi/src/vax/ffitarget.h | 49 - .../gofrontend/libffi/src/x86/darwin.S | 444 - .../gofrontend/libffi/src/x86/darwin64.S | 416 - .../gofrontend/libffi/src/x86/darwin64_c.c | 643 - .../gofrontend/libffi/src/x86/darwin_c.c | 843 - .../gofrontend/libffi/src/x86/ffi.c | 725 - .../gofrontend/libffi/src/x86/ffi64.c | 824 - .../gofrontend/libffi/src/x86/ffitarget.h | 139 - .../gofrontend/libffi/src/x86/ffiw64.c | 281 - .../gofrontend/libffi/src/x86/internal.h | 29 - .../gofrontend/libffi/src/x86/internal64.h | 22 - .../gofrontend/libffi/src/x86/sysv.S | 1038 - .../gofrontend/libffi/src/x86/unix64.S | 546 - .../gofrontend/libffi/src/x86/win64.S | 219 - .../gofrontend/libffi/src/xtensa/ffi.c | 298 - .../gofrontend/libffi/src/xtensa/ffitarget.h | 53 - .../gofrontend/libffi/src/xtensa/sysv.S | 253 - llgo/third_party/gofrontend/libffi/stamp-h.in | 1 - .../gofrontend/libffi/testsuite/Makefile.am | 94 - .../gofrontend/libffi/testsuite/Makefile.in | 481 - .../testsuite/libffi.call/closure_fn0.c | 89 - .../testsuite/libffi.call/closure_fn1.c | 81 - .../testsuite/libffi.call/closure_fn2.c | 81 - .../testsuite/libffi.call/closure_fn3.c | 82 - .../testsuite/libffi.call/closure_fn4.c | 89 - .../testsuite/libffi.call/closure_fn5.c | 92 - .../testsuite/libffi.call/closure_fn6.c | 90 - .../testsuite/libffi.call/closure_loc_fn0.c | 95 - .../testsuite/libffi.call/closure_simple.c | 55 - .../libffi/testsuite/libffi.call/cls_12byte.c | 94 - .../libffi/testsuite/libffi.call/cls_16byte.c | 95 - .../libffi/testsuite/libffi.call/cls_18byte.c | 96 - .../libffi/testsuite/libffi.call/cls_19byte.c | 102 - .../testsuite/libffi.call/cls_1_1byte.c | 89 - .../libffi/testsuite/libffi.call/cls_20byte.c | 91 - .../testsuite/libffi.call/cls_20byte1.c | 93 - .../libffi/testsuite/libffi.call/cls_24byte.c | 113 - .../libffi/testsuite/libffi.call/cls_2byte.c | 90 - .../testsuite/libffi.call/cls_3_1byte.c | 95 - .../libffi/testsuite/libffi.call/cls_3byte1.c | 90 - .../libffi/testsuite/libffi.call/cls_3byte2.c | 90 - .../testsuite/libffi.call/cls_4_1byte.c | 98 - .../libffi/testsuite/libffi.call/cls_4byte.c | 90 - .../testsuite/libffi.call/cls_5_1_byte.c | 109 - .../libffi/testsuite/libffi.call/cls_5byte.c | 98 - .../libffi/testsuite/libffi.call/cls_64byte.c | 124 - .../testsuite/libffi.call/cls_6_1_byte.c | 113 - .../libffi/testsuite/libffi.call/cls_6byte.c | 99 - .../testsuite/libffi.call/cls_7_1_byte.c | 117 - .../libffi/testsuite/libffi.call/cls_7byte.c | 97 - .../libffi/testsuite/libffi.call/cls_8byte.c | 88 - .../libffi/testsuite/libffi.call/cls_9byte1.c | 90 - .../libffi/testsuite/libffi.call/cls_9byte2.c | 91 - .../testsuite/libffi.call/cls_align_double.c | 93 - .../testsuite/libffi.call/cls_align_float.c | 91 - .../libffi.call/cls_align_longdouble.c | 92 - .../libffi.call/cls_align_longdouble_split.c | 132 - .../libffi.call/cls_align_longdouble_split2.c | 115 - .../testsuite/libffi.call/cls_align_pointer.c | 95 - .../testsuite/libffi.call/cls_align_sint16.c | 91 - .../testsuite/libffi.call/cls_align_sint32.c | 91 - .../testsuite/libffi.call/cls_align_sint64.c | 92 - .../testsuite/libffi.call/cls_align_uint16.c | 91 - .../testsuite/libffi.call/cls_align_uint32.c | 91 - .../testsuite/libffi.call/cls_align_uint64.c | 93 - .../testsuite/libffi.call/cls_dbls_struct.c | 66 - .../libffi/testsuite/libffi.call/cls_double.c | 43 - .../testsuite/libffi.call/cls_double_va.c | 61 - .../libffi/testsuite/libffi.call/cls_float.c | 42 - .../testsuite/libffi.call/cls_longdouble.c | 105 - .../testsuite/libffi.call/cls_longdouble_va.c | 61 - .../libffi.call/cls_many_mixed_args.c | 70 - .../libffi.call/cls_many_mixed_float_double.c | 55 - .../testsuite/libffi.call/cls_multi_schar.c | 74 - .../testsuite/libffi.call/cls_multi_sshort.c | 74 - .../libffi.call/cls_multi_sshortchar.c | 86 - .../testsuite/libffi.call/cls_multi_uchar.c | 91 - .../testsuite/libffi.call/cls_multi_ushort.c | 74 - .../libffi.call/cls_multi_ushortchar.c | 86 - .../testsuite/libffi.call/cls_pointer.c | 74 - .../testsuite/libffi.call/cls_pointer_stack.c | 142 - .../libffi/testsuite/libffi.call/cls_schar.c | 44 - .../libffi/testsuite/libffi.call/cls_sint.c | 42 - .../libffi/testsuite/libffi.call/cls_sshort.c | 42 - .../testsuite/libffi.call/cls_struct_va1.c | 114 - .../libffi/testsuite/libffi.call/cls_uchar.c | 42 - .../testsuite/libffi.call/cls_uchar_va.c | 44 - .../libffi/testsuite/libffi.call/cls_uint.c | 43 - .../testsuite/libffi.call/cls_uint_va.c | 45 - .../testsuite/libffi.call/cls_ulong_va.c | 45 - .../testsuite/libffi.call/cls_ulonglong.c | 47 - .../libffi/testsuite/libffi.call/cls_ushort.c | 43 - .../testsuite/libffi.call/cls_ushort_va.c | 44 - .../testsuite/libffi.call/err_bad_abi.c | 36 - .../testsuite/libffi.call/err_bad_typedef.c | 26 - .../libffi/testsuite/libffi.call/ffitest.h | 135 - .../libffi/testsuite/libffi.call/float.c | 59 - .../libffi/testsuite/libffi.call/float1.c | 60 - .../libffi/testsuite/libffi.call/float2.c | 58 - .../libffi/testsuite/libffi.call/float3.c | 74 - .../libffi/testsuite/libffi.call/float4.c | 62 - .../libffi/testsuite/libffi.call/float_va.c | 107 - .../testsuite/libffi.call/huge_struct.c | 341 - .../libffi/testsuite/libffi.call/many.c | 59 - .../libffi/testsuite/libffi.call/many2.c | 57 - .../testsuite/libffi.call/many_double.c | 70 - .../libffi/testsuite/libffi.call/many_mixed.c | 78 - .../libffi/testsuite/libffi.call/negint.c | 52 - .../testsuite/libffi.call/nested_struct.c | 152 - .../testsuite/libffi.call/nested_struct1.c | 161 - .../testsuite/libffi.call/nested_struct10.c | 133 - .../testsuite/libffi.call/nested_struct11.c | 121 - .../testsuite/libffi.call/nested_struct2.c | 110 - .../testsuite/libffi.call/nested_struct3.c | 111 - .../testsuite/libffi.call/nested_struct4.c | 111 - .../testsuite/libffi.call/nested_struct5.c | 112 - .../testsuite/libffi.call/nested_struct6.c | 131 - .../testsuite/libffi.call/nested_struct7.c | 111 - .../testsuite/libffi.call/nested_struct8.c | 131 - .../testsuite/libffi.call/nested_struct9.c | 131 - .../libffi/testsuite/libffi.call/problem1.c | 90 - .../libffi/testsuite/libffi.call/promotion.c | 59 - .../libffi/testsuite/libffi.call/pyobjc-tc.c | 114 - .../libffi/testsuite/libffi.call/return_dbl.c | 36 - .../testsuite/libffi.call/return_dbl1.c | 43 - .../testsuite/libffi.call/return_dbl2.c | 42 - .../libffi/testsuite/libffi.call/return_fl.c | 35 - .../libffi/testsuite/libffi.call/return_fl1.c | 36 - .../libffi/testsuite/libffi.call/return_fl2.c | 49 - .../libffi/testsuite/libffi.call/return_fl3.c | 42 - .../libffi/testsuite/libffi.call/return_ldl.c | 34 - .../libffi/testsuite/libffi.call/return_ll.c | 41 - .../libffi/testsuite/libffi.call/return_ll1.c | 43 - .../libffi/testsuite/libffi.call/return_sc.c | 36 - .../libffi/testsuite/libffi.call/return_sl.c | 38 - .../libffi/testsuite/libffi.call/return_uc.c | 38 - .../libffi/testsuite/libffi.call/return_ul.c | 38 - .../testsuite/libffi.call/stret_large.c | 145 - .../testsuite/libffi.call/stret_large2.c | 148 - .../testsuite/libffi.call/stret_medium.c | 124 - .../testsuite/libffi.call/stret_medium2.c | 125 - .../libffi/testsuite/libffi.call/strlen.c | 44 - .../libffi/testsuite/libffi.call/strlen2.c | 49 - .../libffi/testsuite/libffi.call/strlen3.c | 49 - .../libffi/testsuite/libffi.call/strlen4.c | 55 - .../libffi/testsuite/libffi.call/struct1.c | 67 - .../libffi/testsuite/libffi.call/struct2.c | 67 - .../libffi/testsuite/libffi.call/struct3.c | 60 - .../libffi/testsuite/libffi.call/struct4.c | 64 - .../libffi/testsuite/libffi.call/struct5.c | 66 - .../libffi/testsuite/libffi.call/struct6.c | 64 - .../libffi/testsuite/libffi.call/struct7.c | 74 - .../libffi/testsuite/libffi.call/struct8.c | 81 - .../libffi/testsuite/libffi.call/struct9.c | 68 - .../testsuite/libffi.call/testclosure.c | 70 - .../testsuite/libffi.call/uninitialized.c | 61 - .../libffi/testsuite/libffi.call/va_1.c | 196 - .../libffi/testsuite/libffi.call/va_struct1.c | 121 - .../libffi/testsuite/libffi.call/va_struct2.c | 123 - .../libffi/testsuite/libffi.call/va_struct3.c | 125 - .../libffi.complex/cls_align_complex.inc | 91 - .../libffi.complex/cls_align_complex_double.c | 10 - .../libffi.complex/cls_align_complex_float.c | 10 - .../cls_align_complex_longdouble.c | 10 - .../testsuite/libffi.complex/cls_complex.inc | 42 - .../libffi.complex/cls_complex_double.c | 10 - .../libffi.complex/cls_complex_float.c | 10 - .../libffi.complex/cls_complex_longdouble.c | 10 - .../libffi.complex/cls_complex_struct.inc | 71 - .../cls_complex_struct_double.c | 10 - .../libffi.complex/cls_complex_struct_float.c | 10 - .../cls_complex_struct_longdouble.c | 10 - .../libffi.complex/cls_complex_va.inc | 80 - .../libffi.complex/cls_complex_va_double.c | 10 - .../libffi.complex/cls_complex_va_float.c | 16 - .../cls_complex_va_longdouble.c | 10 - .../testsuite/libffi.complex/complex.inc | 51 - .../libffi.complex/complex_defs_double.inc | 7 - .../libffi.complex/complex_defs_float.inc | 7 - .../complex_defs_longdouble.inc | 7 - .../testsuite/libffi.complex/complex_double.c | 10 - .../testsuite/libffi.complex/complex_float.c | 10 - .../testsuite/libffi.complex/complex_int.c | 86 - .../libffi.complex/complex_longdouble.c | 10 - .../libffi/testsuite/libffi.complex/ffitest.h | 1 - .../testsuite/libffi.complex/many_complex.inc | 78 - .../libffi.complex/many_complex_double.c | 10 - .../libffi.complex/many_complex_float.c | 10 - .../libffi.complex/many_complex_longdouble.c | 10 - .../libffi.complex/return_complex.inc | 37 - .../libffi.complex/return_complex1.inc | 41 - .../libffi.complex/return_complex1_double.c | 10 - .../libffi.complex/return_complex1_float.c | 10 - .../return_complex1_longdouble.c | 10 - .../libffi.complex/return_complex2.inc | 44 - .../libffi.complex/return_complex2_double.c | 10 - .../libffi.complex/return_complex2_float.c | 10 - .../return_complex2_longdouble.c | 10 - .../libffi.complex/return_complex_double.c | 10 - .../libffi.complex/return_complex_float.c | 10 - .../return_complex_longdouble.c | 10 - .../libffi/testsuite/libffi.go/aa-direct.c | 34 - .../libffi/testsuite/libffi.go/closure1.c | 28 - .../libffi/testsuite/libffi.go/ffitest.h | 1 - .../libffi/testsuite/libffi.go/static-chain.h | 19 - .../testsuite/libffi.special/ffitestcxx.h | 96 - .../testsuite/libffi.special/unwindtest.cc | 124 - .../libffi.special/unwindtest_ffi_call.cc | 53 - .../third_party/gofrontend/libgcc/unwind-pe.h | 201 - llgo/third_party/gofrontend/libgo/LICENSE | 27 - llgo/third_party/gofrontend/libgo/MERGE | 4 - llgo/third_party/gofrontend/libgo/Makefile.am | 4372 ---- llgo/third_party/gofrontend/libgo/Makefile.in | 6621 ------ llgo/third_party/gofrontend/libgo/PATENTS | 22 - llgo/third_party/gofrontend/libgo/README | 44 - llgo/third_party/gofrontend/libgo/README.gcc | 7 - llgo/third_party/gofrontend/libgo/VERSION | 1 - llgo/third_party/gofrontend/libgo/aclocal.m4 | 1001 - llgo/third_party/gofrontend/libgo/config.h.in | 399 - .../gofrontend/libgo/config/README | 2 - .../third_party/gofrontend/libgo/config/go.m4 | 92 - .../gofrontend/libgo/config/libtool.m4 | 7518 ------- .../gofrontend/libgo/config/ltmain.sh | 8636 ------- .../gofrontend/libgo/config/ltoptions.m4 | 369 - .../gofrontend/libgo/config/ltsugar.m4 | 123 - .../gofrontend/libgo/config/ltversion.m4 | 23 - .../gofrontend/libgo/config/lt~obsolete.m4 | 98 - llgo/third_party/gofrontend/libgo/configure | 18345 --------------- .../third_party/gofrontend/libgo/configure.ac | 920 - .../gofrontend/libgo/go/archive/tar/common.go | 329 - .../gofrontend/libgo/go/archive/tar/reader.go | 835 - .../libgo/go/archive/tar/reader_test.go | 798 - .../libgo/go/archive/tar/stat_atim.go | 20 - .../libgo/go/archive/tar/stat_atimespec.go | 20 - .../libgo/go/archive/tar/stat_unix.go | 32 - .../libgo/go/archive/tar/tar_test.go | 325 - .../libgo/go/archive/tar/testdata/gnu.tar | Bin 3072 -> 0 bytes .../go/archive/tar/testdata/hardlink.tar | Bin 2560 -> 0 bytes .../go/archive/tar/testdata/issue10968.tar | Bin 512 -> 0 bytes .../go/archive/tar/testdata/issue11169.tar | Bin 602 -> 0 bytes .../go/archive/tar/testdata/neg-size.tar | Bin 512 -> 0 bytes .../libgo/go/archive/tar/testdata/nil-uid.tar | Bin 1024 -> 0 bytes .../libgo/go/archive/tar/testdata/pax.tar | Bin 10240 -> 0 bytes .../libgo/go/archive/tar/testdata/small.txt | 1 - .../libgo/go/archive/tar/testdata/small2.txt | 1 - .../archive/tar/testdata/sparse-formats.tar | Bin 17920 -> 0 bytes .../libgo/go/archive/tar/testdata/star.tar | Bin 3072 -> 0 bytes .../libgo/go/archive/tar/testdata/ustar.tar | Bin 2048 -> 0 bytes .../libgo/go/archive/tar/testdata/v7.tar | Bin 3584 -> 0 bytes .../archive/tar/testdata/writer-big-long.tar | Bin 4096 -> 0 bytes .../go/archive/tar/testdata/writer-big.tar | Bin 4096 -> 0 bytes .../libgo/go/archive/tar/testdata/writer.tar | Bin 3584 -> 0 bytes .../libgo/go/archive/tar/testdata/xattrs.tar | Bin 5120 -> 0 bytes .../gofrontend/libgo/go/archive/tar/writer.go | 396 - .../libgo/go/archive/tar/writer_test.go | 546 - .../gofrontend/libgo/go/archive/zip/reader.go | 471 - .../libgo/go/archive/zip/reader_test.go | 607 - .../libgo/go/archive/zip/register.go | 110 - .../gofrontend/libgo/go/archive/zip/struct.go | 313 - .../zip/testdata/crc32-not-streamed.zip | Bin 314 -> 0 bytes .../libgo/go/archive/zip/testdata/dd.zip | Bin 154 -> 0 bytes .../zip/testdata/go-no-datadesc-sig.zip | Bin 330 -> 0 bytes .../zip/testdata/go-with-datadesc-sig.zip | Bin 242 -> 0 bytes .../archive/zip/testdata/gophercolor16x16.png | Bin 785 -> 0 bytes .../go/archive/zip/testdata/readme.notzip | Bin 1906 -> 0 bytes .../libgo/go/archive/zip/testdata/readme.zip | Bin 1886 -> 0 bytes .../libgo/go/archive/zip/testdata/symlink.zip | Bin 173 -> 0 bytes .../zip/testdata/test-trailing-junk.zip | Bin 1184 -> 0 bytes .../libgo/go/archive/zip/testdata/test.zip | Bin 1170 -> 0 bytes .../libgo/go/archive/zip/testdata/unix.zip | Bin 620 -> 0 bytes .../libgo/go/archive/zip/testdata/winxp.zip | Bin 412 -> 0 bytes .../libgo/go/archive/zip/testdata/zip64-2.zip | Bin 266 -> 0 bytes .../libgo/go/archive/zip/testdata/zip64.zip | Bin 242 -> 0 bytes .../gofrontend/libgo/go/archive/zip/writer.go | 374 - .../libgo/go/archive/zip/writer_test.go | 199 - .../libgo/go/archive/zip/zip_test.go | 427 - .../gofrontend/libgo/go/bufio/bufio.go | 730 - .../gofrontend/libgo/go/bufio/bufio_test.go | 1572 -- .../gofrontend/libgo/go/bufio/example_test.go | 82 - .../gofrontend/libgo/go/bufio/export_test.go | 27 - .../gofrontend/libgo/go/bufio/scan.go | 359 - .../gofrontend/libgo/go/bufio/scan_test.go | 524 - .../gofrontend/libgo/go/builtin/builtin.go | 256 - .../gofrontend/libgo/go/bytes/buffer.go | 416 - .../gofrontend/libgo/go/bytes/buffer_test.go | 544 - .../gofrontend/libgo/go/bytes/bytes.go | 714 - .../gofrontend/libgo/go/bytes/bytes_decl.go | 24 - .../gofrontend/libgo/go/bytes/bytes_test.go | 1257 -- .../gofrontend/libgo/go/bytes/compare_test.go | 211 - .../gofrontend/libgo/go/bytes/equal_test.go | 47 - .../gofrontend/libgo/go/bytes/example_test.go | 85 - .../gofrontend/libgo/go/bytes/export_test.go | 9 - .../gofrontend/libgo/go/bytes/indexbyte.c | 73 - .../gofrontend/libgo/go/bytes/reader.go | 150 - .../gofrontend/libgo/go/bytes/reader_test.go | 258 - .../gofrontend/libgo/go/cmd/cgo/ast.go | 471 - .../gofrontend/libgo/go/cmd/cgo/doc.go | 771 - .../gofrontend/libgo/go/cmd/cgo/gcc.go | 1770 -- .../gofrontend/libgo/go/cmd/cgo/godefs.go | 127 - .../gofrontend/libgo/go/cmd/cgo/main.go | 380 - .../gofrontend/libgo/go/cmd/cgo/out.go | 1419 -- .../gofrontend/libgo/go/cmd/cgo/util.go | 84 - .../gofrontend/libgo/go/cmd/go/alldocs.go | 1481 -- .../gofrontend/libgo/go/cmd/go/bootstrap.go | 38 - .../gofrontend/libgo/go/cmd/go/build.go | 3370 --- .../gofrontend/libgo/go/cmd/go/clean.go | 248 - .../gofrontend/libgo/go/cmd/go/context.go | 36 - .../gofrontend/libgo/go/cmd/go/discovery.go | 83 - .../gofrontend/libgo/go/cmd/go/doc.go | 103 - .../gofrontend/libgo/go/cmd/go/env.go | 112 - .../gofrontend/libgo/go/cmd/go/fix.go | 30 - .../gofrontend/libgo/go/cmd/go/fmt.go | 64 - .../gofrontend/libgo/go/cmd/go/generate.go | 410 - .../libgo/go/cmd/go/generate_test.go | 55 - .../gofrontend/libgo/go/cmd/go/get.go | 535 - .../gofrontend/libgo/go/cmd/go/go11.go | 10 - .../gofrontend/libgo/go/cmd/go/go_test.go | 2389 -- .../libgo/go/cmd/go/go_windows_test.go | 55 - .../gofrontend/libgo/go/cmd/go/help.go | 574 - .../gofrontend/libgo/go/cmd/go/http.go | 109 - .../gofrontend/libgo/go/cmd/go/list.go | 216 - .../gofrontend/libgo/go/cmd/go/main.go | 761 - .../gofrontend/libgo/go/cmd/go/match_test.go | 88 - .../gofrontend/libgo/go/cmd/go/mkdoc.sh | 9 - .../gofrontend/libgo/go/cmd/go/note.go | 116 - .../gofrontend/libgo/go/cmd/go/note_test.go | 49 - .../gofrontend/libgo/go/cmd/go/pkg.go | 1861 -- .../gofrontend/libgo/go/cmd/go/pkg_test.go | 73 - .../gofrontend/libgo/go/cmd/go/run.go | 146 - .../gofrontend/libgo/go/cmd/go/script | 23 - .../gofrontend/libgo/go/cmd/go/script.txt | 352 - .../gofrontend/libgo/go/cmd/go/signal.go | 31 - .../libgo/go/cmd/go/signal_notunix.go | 17 - .../gofrontend/libgo/go/cmd/go/signal_unix.go | 18 - .../gofrontend/libgo/go/cmd/go/tag_test.go | 100 - .../gofrontend/libgo/go/cmd/go/test.bash | 820 - .../gofrontend/libgo/go/cmd/go/test.go | 1459 -- .../libgo/go/cmd/go/testdata/cgocover/p.go | 19 - .../go/cmd/go/testdata/cgocover/p_test.go | 7 - .../libgo/go/cmd/go/testdata/dep_test.go | 7 - .../libgo/go/cmd/go/testdata/example1_test.go | 23 - .../libgo/go/cmd/go/testdata/example2_test.go | 21 - .../go/cmd/go/testdata/generate/test1.go | 13 - .../go/cmd/go/testdata/generate/test2.go | 10 - .../go/cmd/go/testdata/generate/test3.go | 9 - .../go/cmd/go/testdata/generate/test4.go | 10 - .../libgo/go/cmd/go/testdata/importcom/bad.go | 3 - .../go/cmd/go/testdata/importcom/conflict.go | 3 - .../cmd/go/testdata/importcom/src/bad/bad.go | 1 - .../go/testdata/importcom/src/conflict/a.go | 1 - .../go/testdata/importcom/src/conflict/b.go | 1 - .../go/testdata/importcom/src/works/x/x.go | 1 - .../go/testdata/importcom/src/works/x/x1.go | 1 - .../go/testdata/importcom/src/wrongplace/x.go | 1 - .../go/cmd/go/testdata/importcom/works.go | 3 - .../cmd/go/testdata/importcom/wrongplace.go | 3 - .../libgo/go/cmd/go/testdata/local/easy.go | 7 - .../cmd/go/testdata/local/easysub/easysub.go | 7 - .../go/cmd/go/testdata/local/easysub/main.go | 9 - .../libgo/go/cmd/go/testdata/local/hard.go | 7 - .../libgo/go/cmd/go/testdata/local/sub/sub.go | 12 - .../cmd/go/testdata/local/sub/sub/subsub.go | 7 - .../go/testdata/norunexample/example_test.go | 11 - .../cmd/go/testdata/norunexample/test_test.go | 10 - .../go/cmd/go/testdata/rundir/sub/sub.go | 1 - .../libgo/go/cmd/go/testdata/rundir/x.go | 1 - .../go/testdata/shadow/root1/src/foo/foo.go | 1 - .../go/testdata/shadow/root1/src/math/math.go | 1 - .../go/testdata/shadow/root2/src/foo/foo.go | 1 - .../libgo/go/cmd/go/testdata/src/badc/x.go | 1 - .../libgo/go/cmd/go/testdata/src/badpkg/x.go | 1 - .../go/testdata/src/badtest/badexec/x_test.go | 5 - .../go/testdata/src/badtest/badsyntax/x.go | 1 - .../testdata/src/badtest/badsyntax/x_test.go | 3 - .../cmd/go/testdata/src/badtest/badvar/x.go | 1 - .../go/testdata/src/badtest/badvar/x_test.go | 5 - .../libgo/go/cmd/go/testdata/src/cgotest/m.go | 5 - .../go/testdata/src/go-cmd-test/helloworld.go | 5 - .../go/cmd/go/testdata/src/main_test/m.go | 4 - .../cmd/go/testdata/src/main_test/m_test.go | 10 - .../go/cmd/go/testdata/src/notest/hello.go | 6 - .../go/cmd/go/testdata/src/syntaxerror/x.go | 1 - .../cmd/go/testdata/src/syntaxerror/x_test.go | 4 - .../go/cmd/go/testdata/src/testcycle/p1/p1.go | 7 - .../go/testdata/src/testcycle/p1/p1_test.go | 6 - .../go/cmd/go/testdata/src/testcycle/p2/p2.go | 7 - .../go/cmd/go/testdata/src/testcycle/p3/p3.go | 5 - .../go/testdata/src/testcycle/p3/p3_test.go | 10 - .../go/cmd/go/testdata/src/testcycle/q1/q1.go | 1 - .../go/testdata/src/testcycle/q1/q1_test.go | 6 - .../go/cmd/go/testdata/src/testdep/p1/p1.go | 1 - .../cmd/go/testdata/src/testdep/p1/p1_test.go | 3 - .../go/cmd/go/testdata/src/testdep/p2/p2.go | 3 - .../go/cmd/go/testdata/src/testdep/p3/p3.go | 3 - .../libgo/go/cmd/go/testdata/src/vend/bad.go | 3 - .../libgo/go/cmd/go/testdata/src/vend/good.go | 3 - .../cmd/go/testdata/src/vend/hello/hello.go | 10 - .../go/testdata/src/vend/hello/hello_test.go | 12 - .../go/testdata/src/vend/hello/hellox_test.go | 12 - .../go/cmd/go/testdata/src/vend/subdir/bad.go | 3 - .../cmd/go/testdata/src/vend/subdir/good.go | 3 - .../go/cmd/go/testdata/src/vend/vendor/p/p.go | 1 - .../go/cmd/go/testdata/src/vend/vendor/q/q.go | 1 - .../testdata/src/vend/vendor/strings/msg.go | 3 - .../go/testdata/src/vend/x/invalid/invalid.go | 3 - .../cmd/go/testdata/src/vend/x/vendor/p/p.go | 1 - .../go/testdata/src/vend/x/vendor/p/p/p.go | 3 - .../cmd/go/testdata/src/vend/x/vendor/r/r.go | 1 - .../libgo/go/cmd/go/testdata/src/vend/x/x.go | 5 - .../go/cmd/go/testdata/src/vetpkg/a_test.go | 1 - .../libgo/go/cmd/go/testdata/src/vetpkg/b.go | 7 - .../libgo/go/cmd/go/testdata/src/vetpkg/c.go | 9 - .../go/cmd/go/testdata/src/xtestonly/f.go | 3 - .../cmd/go/testdata/src/xtestonly/f_test.go | 12 - .../go/cmd/go/testdata/standalone_test.go | 6 - .../libgo/go/cmd/go/testdata/testimport/p.go | 3 - .../go/cmd/go/testdata/testimport/p1/p1.go | 3 - .../go/cmd/go/testdata/testimport/p2/p2.go | 3 - .../go/cmd/go/testdata/testimport/p_test.go | 13 - .../go/cmd/go/testdata/testimport/x_test.go | 15 - .../go/cmd/go/testdata/testinternal/p.go | 3 - .../go/cmd/go/testdata/testinternal2/p.go | 3 - .../testinternal2/x/y/z/internal/w/w.go | 1 - .../go/cmd/go/testdata/testinternal3/t.go | 3 - .../cmd/go/testdata/testinternal4/src/p/p.go | 6 - .../testinternal4/src/q/internal/x/x.go | 1 - .../go/testdata/testinternal4/src/q/j/j.go | 3 - .../go/cmd/go/testdata/testonly/p_test.go | 1 - .../go/cmd/go/testdata/testvendor/src/p/p.go | 6 - .../testdata/testvendor/src/q/vendor/x/x.go | 1 - .../cmd/go/testdata/testvendor/src/q/y/y.go | 3 - .../cmd/go/testdata/testvendor/src/q/z/z.go | 3 - .../go/cmd/go/testdata/testvendor2/src/p/p.go | 3 - .../cmd/go/testdata/testvendor2/vendor/x/x.go | 1 - .../gofrontend/libgo/go/cmd/go/testflag.go | 281 - .../gofrontend/libgo/go/cmd/go/testgo.go | 21 - .../gofrontend/libgo/go/cmd/go/tool.go | 172 - .../gofrontend/libgo/go/cmd/go/vcs.go | 1037 - .../gofrontend/libgo/go/cmd/go/vcs_test.go | 175 - .../gofrontend/libgo/go/cmd/go/vendor_test.go | 258 - .../gofrontend/libgo/go/cmd/go/version.go | 25 - .../gofrontend/libgo/go/cmd/go/vet.go | 52 - .../gofrontend/libgo/go/cmd/gofmt/doc.go | 100 - .../gofrontend/libgo/go/cmd/gofmt/gofmt.go | 237 - .../libgo/go/cmd/gofmt/gofmt_test.go | 173 - .../libgo/go/cmd/gofmt/long_test.go | 160 - .../gofrontend/libgo/go/cmd/gofmt/rewrite.go | 303 - .../gofrontend/libgo/go/cmd/gofmt/simplify.go | 161 - .../go/cmd/gofmt/testdata/comments.golden | 9 - .../go/cmd/gofmt/testdata/comments.input | 9 - .../go/cmd/gofmt/testdata/composites.golden | 204 - .../go/cmd/gofmt/testdata/composites.input | 204 - .../libgo/go/cmd/gofmt/testdata/crlf.golden | 13 - .../libgo/go/cmd/gofmt/testdata/crlf.input | 13 - .../libgo/go/cmd/gofmt/testdata/import.golden | 126 - .../libgo/go/cmd/gofmt/testdata/import.input | 131 - .../libgo/go/cmd/gofmt/testdata/old.golden | 9 - .../libgo/go/cmd/gofmt/testdata/old.input | 8 - .../go/cmd/gofmt/testdata/rewrite1.golden | 14 - .../go/cmd/gofmt/testdata/rewrite1.input | 14 - .../go/cmd/gofmt/testdata/rewrite2.golden | 12 - .../go/cmd/gofmt/testdata/rewrite2.input | 12 - .../go/cmd/gofmt/testdata/rewrite3.golden | 14 - .../go/cmd/gofmt/testdata/rewrite3.input | 14 - .../go/cmd/gofmt/testdata/rewrite4.golden | 76 - .../go/cmd/gofmt/testdata/rewrite4.input | 76 - .../go/cmd/gofmt/testdata/rewrite5.golden | 17 - .../go/cmd/gofmt/testdata/rewrite5.input | 17 - .../go/cmd/gofmt/testdata/rewrite6.golden | 17 - .../go/cmd/gofmt/testdata/rewrite6.input | 17 - .../go/cmd/gofmt/testdata/rewrite7.golden | 17 - .../go/cmd/gofmt/testdata/rewrite7.input | 17 - .../go/cmd/gofmt/testdata/rewrite8.golden | 12 - .../go/cmd/gofmt/testdata/rewrite8.input | 12 - .../go/cmd/gofmt/testdata/slices1.golden | 66 - .../libgo/go/cmd/gofmt/testdata/slices1.input | 66 - .../go/cmd/gofmt/testdata/slices2.golden | 63 - .../libgo/go/cmd/gofmt/testdata/slices2.input | 63 - .../libgo/go/cmd/gofmt/testdata/stdin1.golden | 5 - .../libgo/go/cmd/gofmt/testdata/stdin1.input | 5 - .../libgo/go/cmd/gofmt/testdata/stdin2.golden | 11 - .../libgo/go/cmd/gofmt/testdata/stdin2.input | 11 - .../libgo/go/cmd/gofmt/testdata/stdin3.golden | 7 - .../libgo/go/cmd/gofmt/testdata/stdin3.input | 5 - .../libgo/go/cmd/gofmt/testdata/stdin4.golden | 5 - .../libgo/go/cmd/gofmt/testdata/stdin4.input | 5 - .../go/cmd/gofmt/testdata/typeswitch.golden | 60 - .../go/cmd/gofmt/testdata/typeswitch.input | 60 - .../libgo/go/compress/bzip2/bit_reader.go | 90 - .../libgo/go/compress/bzip2/bzip2.go | 503 - .../libgo/go/compress/bzip2/bzip2_test.go | 419 - .../libgo/go/compress/bzip2/huffman.go | 251 - .../libgo/go/compress/bzip2/move_to_front.go | 53 - .../testdata/Mark.Twain-Tom.Sawyer.txt.bz2 | Bin 124744 -> 0 bytes .../go/compress/bzip2/testdata/e.txt.bz2 | Bin 43149 -> 0 bytes .../libgo/go/compress/flate/copy.go | 32 - .../libgo/go/compress/flate/copy_test.go | 54 - .../libgo/go/compress/flate/deflate.go | 571 - .../libgo/go/compress/flate/deflate_test.go | 490 - .../libgo/go/compress/flate/fixedhuff.go | 78 - .../libgo/go/compress/flate/flate_test.go | 260 - .../gofrontend/libgo/go/compress/flate/gen.go | 265 - .../go/compress/flate/huffman_bit_writer.go | 517 - .../libgo/go/compress/flate/huffman_code.go | 323 - .../libgo/go/compress/flate/inflate.go | 811 - .../libgo/go/compress/flate/inflate_test.go | 39 - .../libgo/go/compress/flate/reader_test.go | 96 - .../libgo/go/compress/flate/reverse_bits.go | 48 - .../libgo/go/compress/flate/token.go | 102 - .../libgo/go/compress/flate/writer_test.go | 60 - .../libgo/go/compress/gzip/gunzip.go | 287 - .../libgo/go/compress/gzip/gunzip_test.go | 410 - .../gofrontend/libgo/go/compress/gzip/gzip.go | 272 - .../libgo/go/compress/gzip/gzip_test.go | 231 - .../go/compress/gzip/testdata/issue6550.gz | Bin 65536 -> 0 bytes .../libgo/go/compress/lzw/reader.go | 262 - .../libgo/go/compress/lzw/reader_test.go | 159 - .../libgo/go/compress/lzw/writer.go | 269 - .../libgo/go/compress/lzw/writer_test.go | 154 - .../testdata/Mark.Twain-Tom.Sawyer.txt | 8858 -------- .../libgo/go/compress/testdata/e.txt | 1 - .../libgo/go/compress/testdata/pi.txt | 1 - .../libgo/go/compress/zlib/reader.go | 161 - .../libgo/go/compress/zlib/reader_test.go | 127 - .../libgo/go/compress/zlib/writer.go | 198 - .../libgo/go/compress/zlib/writer_test.go | 205 - .../libgo/go/container/heap/heap.go | 117 - .../libgo/go/container/heap/heap_test.go | 213 - .../libgo/go/container/list/list.go | 216 - .../libgo/go/container/list/list_test.go | 343 - .../libgo/go/container/ring/ring.go | 141 - .../libgo/go/container/ring/ring_test.go | 228 - .../libgo/go/crypto/aes/aes_test.go | 421 - .../gofrontend/libgo/go/crypto/aes/block.go | 176 - .../gofrontend/libgo/go/crypto/aes/cipher.go | 66 - .../libgo/go/crypto/aes/cipher_asm.go | 48 - .../libgo/go/crypto/aes/cipher_generic.go | 19 - .../gofrontend/libgo/go/crypto/aes/const.go | 358 - .../libgo/go/crypto/cipher/benchmark_test.go | 139 - .../gofrontend/libgo/go/crypto/cipher/cbc.go | 133 - .../libgo/go/crypto/cipher/cbc_aes_test.go | 104 - .../gofrontend/libgo/go/crypto/cipher/cfb.go | 72 - .../libgo/go/crypto/cipher/cfb_test.go | 113 - .../libgo/go/crypto/cipher/cipher.go | 56 - .../libgo/go/crypto/cipher/cipher_test.go | 36 - .../libgo/go/crypto/cipher/common_test.go | 28 - .../gofrontend/libgo/go/crypto/cipher/ctr.go | 76 - .../libgo/go/crypto/cipher/ctr_aes_test.go | 102 - .../libgo/go/crypto/cipher/example_test.go | 283 - .../gofrontend/libgo/go/crypto/cipher/gcm.go | 373 - .../libgo/go/crypto/cipher/gcm_test.go | 188 - .../gofrontend/libgo/go/crypto/cipher/io.go | 55 - .../gofrontend/libgo/go/crypto/cipher/ofb.go | 66 - .../libgo/go/crypto/cipher/ofb_test.go | 102 - .../gofrontend/libgo/go/crypto/cipher/xor.go | 84 - .../libgo/go/crypto/cipher/xor_test.go | 28 - .../gofrontend/libgo/go/crypto/crypto.go | 146 - .../gofrontend/libgo/go/crypto/des/block.go | 223 - .../gofrontend/libgo/go/crypto/des/cipher.go | 73 - .../gofrontend/libgo/go/crypto/des/const.go | 139 - .../libgo/go/crypto/des/des_test.go | 1566 -- .../gofrontend/libgo/go/crypto/dsa/dsa.go | 278 - .../libgo/go/crypto/dsa/dsa_test.go | 85 - .../gofrontend/libgo/go/crypto/ecdsa/ecdsa.go | 246 - .../libgo/go/crypto/ecdsa/ecdsa_test.go | 263 - .../libgo/go/crypto/elliptic/elliptic.go | 378 - .../libgo/go/crypto/elliptic/elliptic_test.go | 471 - .../libgo/go/crypto/elliptic/p224.go | 765 - .../libgo/go/crypto/elliptic/p224_test.go | 47 - .../libgo/go/crypto/elliptic/p256.go | 1186 - .../gofrontend/libgo/go/crypto/hmac/hmac.go | 102 - .../libgo/go/crypto/hmac/hmac_test.go | 570 - .../gofrontend/libgo/go/crypto/md5/gen.go | 331 - .../gofrontend/libgo/go/crypto/md5/md5.go | 136 - .../libgo/go/crypto/md5/md5_test.go | 163 - .../libgo/go/crypto/md5/md5block.go | 265 - .../libgo/go/crypto/md5/md5block_decl.go | 11 - .../libgo/go/crypto/md5/md5block_generic.go | 9 - .../gofrontend/libgo/go/crypto/rand/eagain.go | 27 - .../gofrontend/libgo/go/crypto/rand/rand.go | 23 - .../libgo/go/crypto/rand/rand_linux.go | 39 - .../libgo/go/crypto/rand/rand_test.go | 43 - .../libgo/go/crypto/rand/rand_unix.go | 163 - .../libgo/go/crypto/rand/rand_windows.go | 47 - .../gofrontend/libgo/go/crypto/rand/util.go | 136 - .../libgo/go/crypto/rand/util_test.go | 65 - .../gofrontend/libgo/go/crypto/rc4/rc4.go | 69 - .../gofrontend/libgo/go/crypto/rc4/rc4_asm.go | 18 - .../gofrontend/libgo/go/crypto/rc4/rc4_ref.go | 13 - .../libgo/go/crypto/rc4/rc4_test.go | 173 - .../libgo/go/crypto/rsa/pkcs1v15.go | 302 - .../libgo/go/crypto/rsa/pkcs1v15_test.go | 298 - .../gofrontend/libgo/go/crypto/rsa/pss.go | 297 - .../libgo/go/crypto/rsa/pss_test.go | 258 - .../gofrontend/libgo/go/crypto/rsa/rsa.go | 592 - .../libgo/go/crypto/rsa/rsa_test.go | 392 - .../go/crypto/rsa/testdata/pss-vect.txt.bz2 | Bin 28526 -> 0 bytes .../gofrontend/libgo/go/crypto/sha1/sha1.go | 130 - .../libgo/go/crypto/sha1/sha1_test.go | 129 - .../libgo/go/crypto/sha1/sha1block.go | 90 - .../libgo/go/crypto/sha1/sha1block_decl.go | 11 - .../libgo/go/crypto/sha1/sha1block_generic.go | 9 - .../libgo/go/crypto/sha256/sha256.go | 193 - .../libgo/go/crypto/sha256/sha256_test.go | 176 - .../libgo/go/crypto/sha256/sha256block.go | 128 - .../go/crypto/sha256/sha256block_decl.go | 11 - .../libgo/go/crypto/sha512/sha512.go | 288 - .../libgo/go/crypto/sha512/sha512_test.go | 330 - .../libgo/go/crypto/sha512/sha512block.go | 144 - .../go/crypto/sha512/sha512block_decl.go | 11 - .../libgo/go/crypto/subtle/constant_time.go | 73 - .../go/crypto/subtle/constant_time_test.go | 127 - .../gofrontend/libgo/go/crypto/tls/alert.go | 79 - .../libgo/go/crypto/tls/cipher_suites.go | 285 - .../gofrontend/libgo/go/crypto/tls/common.go | 712 - .../gofrontend/libgo/go/crypto/tls/conn.go | 1032 - .../libgo/go/crypto/tls/conn_test.go | 118 - .../libgo/go/crypto/tls/generate_cert.go | 161 - .../libgo/go/crypto/tls/handshake_client.go | 660 - .../go/crypto/tls/handshake_client_test.go | 602 - .../libgo/go/crypto/tls/handshake_messages.go | 1524 -- .../go/crypto/tls/handshake_messages_test.go | 262 - .../libgo/go/crypto/tls/handshake_server.go | 750 - .../go/crypto/tls/handshake_server_test.go | 1059 - .../libgo/go/crypto/tls/handshake_test.go | 167 - .../libgo/go/crypto/tls/key_agreement.go | 405 - .../gofrontend/libgo/go/crypto/tls/prf.go | 367 - .../libgo/go/crypto/tls/prf_test.go | 140 - .../Client-TLSv10-ClientCert-ECDSA-ECDSA | 130 - .../Client-TLSv10-ClientCert-ECDSA-RSA | 126 - .../Client-TLSv10-ClientCert-RSA-ECDSA | 129 - .../testdata/Client-TLSv10-ClientCert-RSA-RSA | 125 - .../testdata/Client-TLSv10-ECDHE-ECDSA-AES | 88 - .../tls/testdata/Client-TLSv10-ECDHE-RSA-AES | 98 - .../crypto/tls/testdata/Client-TLSv10-RSA-RC4 | 84 - .../testdata/Client-TLSv11-ECDHE-ECDSA-AES | 90 - .../tls/testdata/Client-TLSv11-ECDHE-RSA-AES | 100 - .../crypto/tls/testdata/Client-TLSv11-RSA-RC4 | 84 - .../go/crypto/tls/testdata/Client-TLSv12-ALPN | 97 - .../tls/testdata/Client-TLSv12-ALPN-NoMatch | 96 - .../Client-TLSv12-ClientCert-ECDSA-ECDSA | 134 - .../Client-TLSv12-ClientCert-ECDSA-RSA | 128 - ...nt-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 | 139 - .../Client-TLSv12-ClientCert-RSA-ECDSA | 133 - .../testdata/Client-TLSv12-ClientCert-RSA-RSA | 127 - .../testdata/Client-TLSv12-ECDHE-ECDSA-AES | 90 - .../Client-TLSv12-ECDHE-ECDSA-AES-GCM | 85 - ...lient-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 | 85 - .../tls/testdata/Client-TLSv12-ECDHE-RSA-AES | 100 - .../crypto/tls/testdata/Client-TLSv12-RSA-RC4 | 84 - .../go/crypto/tls/testdata/Client-TLSv12-SCT | 118 - .../crypto/tls/testdata/Server-SSLv3-RSA-3DES | 78 - .../crypto/tls/testdata/Server-SSLv3-RSA-AES | 79 - .../crypto/tls/testdata/Server-SSLv3-RSA-RC4 | 74 - .../testdata/Server-TLSv10-ECDHE-ECDSA-AES | 85 - .../tls/testdata/Server-TLSv10-RSA-3DES | 74 - .../crypto/tls/testdata/Server-TLSv10-RSA-AES | 77 - .../crypto/tls/testdata/Server-TLSv10-RSA-RC4 | 71 - .../tls/testdata/Server-TLSv11-FallbackSCSV | 17 - .../crypto/tls/testdata/Server-TLSv11-RSA-RC4 | 71 - .../go/crypto/tls/testdata/Server-TLSv12-ALPN | 109 - .../tls/testdata/Server-TLSv12-ALPN-NoMatch | 108 - ...rver-TLSv12-CipherSuiteCertPreferenceECDSA | 98 - ...Server-TLSv12-CipherSuiteCertPreferenceRSA | 104 - ...er-TLSv12-ClientAuthRequestedAndECDSAGiven | 117 - .../Server-TLSv12-ClientAuthRequestedAndGiven | 116 - .../Server-TLSv12-ClientAuthRequestedNotGiven | 76 - .../testdata/Server-TLSv12-ECDHE-ECDSA-AES | 89 - .../tls/testdata/Server-TLSv12-IssueTicket | 83 - .../Server-TLSv12-IssueTicketPreDisable | 83 - .../tls/testdata/Server-TLSv12-RSA-3DES | 77 - .../crypto/tls/testdata/Server-TLSv12-RSA-AES | 81 - .../tls/testdata/Server-TLSv12-RSA-AES-GCM | 87 - .../Server-TLSv12-RSA-AES256-GCM-SHA384 | 87 - .../crypto/tls/testdata/Server-TLSv12-RSA-RC4 | 73 - .../crypto/tls/testdata/Server-TLSv12-Resume | 37 - .../tls/testdata/Server-TLSv12-ResumeDisabled | 83 - .../go/crypto/tls/testdata/Server-TLSv12-SNI | 64 - .../testdata/Server-TLSv12-SNI-GetCertificate | 64 - .../Server-TLSv12-SNI-GetCertificateNotFound | 64 - .../gofrontend/libgo/go/crypto/tls/ticket.go | 204 - .../gofrontend/libgo/go/crypto/tls/tls.go | 271 - .../libgo/go/crypto/tls/tls_test.go | 334 - .../libgo/go/crypto/x509/cert_pool.go | 116 - .../libgo/go/crypto/x509/pem_decrypt.go | 240 - .../libgo/go/crypto/x509/pem_decrypt_test.go | 247 - .../gofrontend/libgo/go/crypto/x509/pkcs1.go | 122 - .../gofrontend/libgo/go/crypto/x509/pkcs8.go | 54 - .../libgo/go/crypto/x509/pkcs8_test.go | 28 - .../libgo/go/crypto/x509/pkix/pkix.go | 195 - .../gofrontend/libgo/go/crypto/x509/root.go | 17 - .../libgo/go/crypto/x509/root_bsd.go | 14 - .../libgo/go/crypto/x509/root_cgo_darwin.go | 79 - .../libgo/go/crypto/x509/root_darwin.go | 25 - .../go/crypto/x509/root_darwin_arm_gen.go | 191 - .../libgo/go/crypto/x509/root_darwin_armx.go | 4907 ---- .../libgo/go/crypto/x509/root_linux.go | 13 - .../libgo/go/crypto/x509/root_nacl.go | 8 - .../libgo/go/crypto/x509/root_nocgo_darwin.go | 11 - .../libgo/go/crypto/x509/root_plan9.go | 33 - .../libgo/go/crypto/x509/root_solaris.go | 12 - .../libgo/go/crypto/x509/root_unix.go | 52 - .../libgo/go/crypto/x509/root_windows.go | 229 - .../gofrontend/libgo/go/crypto/x509/sec1.go | 83 - .../libgo/go/crypto/x509/sec1_test.go | 30 - .../libgo/go/crypto/x509/sha2_windows_test.go | 19 - .../gofrontend/libgo/go/crypto/x509/verify.go | 483 - .../libgo/go/crypto/x509/verify_test.go | 1134 - .../gofrontend/libgo/go/crypto/x509/x509.go | 2028 -- .../libgo/go/crypto/x509/x509_test.go | 1178 - .../libgo/go/crypto/x509/x509_test_import.go | 53 - .../libgo/go/database/sql/convert.go | 299 - .../libgo/go/database/sql/convert_test.go | 348 - .../libgo/go/database/sql/driver/driver.go | 211 - .../libgo/go/database/sql/driver/types.go | 252 - .../go/database/sql/driver/types_test.go | 65 - .../libgo/go/database/sql/fakedb_test.go | 834 - .../gofrontend/libgo/go/database/sql/sql.go | 1817 -- .../libgo/go/database/sql/sql_test.go | 2109 -- .../gofrontend/libgo/go/debug/dwarf/buf.go | 192 - .../libgo/go/debug/dwarf/class_string.go | 17 - .../gofrontend/libgo/go/debug/dwarf/const.go | 482 - .../gofrontend/libgo/go/debug/dwarf/entry.go | 633 - .../gofrontend/libgo/go/debug/dwarf/line.go | 590 - .../libgo/go/debug/dwarf/line_test.go | 229 - .../gofrontend/libgo/go/debug/dwarf/open.go | 87 - .../go/debug/dwarf/testdata/line-clang.elf | Bin 10271 -> 0 bytes .../go/debug/dwarf/testdata/line-gcc.elf | Bin 10113 -> 0 bytes .../libgo/go/debug/dwarf/testdata/line1.c | 9 - .../libgo/go/debug/dwarf/testdata/line1.h | 7 - .../libgo/go/debug/dwarf/testdata/line2.c | 6 - .../libgo/go/debug/dwarf/testdata/typedef.c | 85 - .../libgo/go/debug/dwarf/testdata/typedef.elf | Bin 12448 -> 0 bytes .../go/debug/dwarf/testdata/typedef.elf4 | Bin 9496 -> 0 bytes .../go/debug/dwarf/testdata/typedef.macho | Bin 5024 -> 0 bytes .../gofrontend/libgo/go/debug/dwarf/type.go | 706 - .../libgo/go/debug/dwarf/type_test.go | 122 - .../libgo/go/debug/dwarf/typeunit.go | 165 - .../gofrontend/libgo/go/debug/dwarf/unit.go | 103 - .../gofrontend/libgo/go/debug/elf/elf.go | 2017 -- .../gofrontend/libgo/go/debug/elf/elf_test.go | 49 - .../gofrontend/libgo/go/debug/elf/file.go | 1107 - .../libgo/go/debug/elf/file_test.go | 369 - .../libgo/go/debug/elf/symbols_test.go | 834 - .../debug/elf/testdata/gcc-386-freebsd-exec | Bin 5742 -> 0 bytes .../debug/elf/testdata/gcc-amd64-linux-exec | Bin 8844 -> 0 bytes .../gcc-amd64-openbsd-debug-with-rela.obj | Bin 6544 -> 0 bytes .../testdata/go-relocation-test-clang-arm.obj | Bin 3092 -> 0 bytes .../testdata/go-relocation-test-clang-x86.obj | Bin 1900 -> 0 bytes .../go-relocation-test-gcc424-x86-64.obj | Bin 3088 -> 0 bytes .../go-relocation-test-gcc441-x86-64.obj | Bin 2936 -> 0 bytes .../go-relocation-test-gcc441-x86.obj | Bin 1884 -> 0 bytes .../go-relocation-test-gcc482-aarch64.obj | Bin 3392 -> 0 bytes .../go-relocation-test-gcc482-ppc64le.obj | Bin 3016 -> 0 bytes .../go-relocation-test-gcc492-arm.obj | Bin 2648 -> 0 bytes .../testdata/go-relocation-test-gcc5-ppc.obj | Bin 2356 -> 0 bytes .../go/debug/elf/testdata/hello-world-core.gz | Bin 12678 -> 0 bytes .../libgo/go/debug/elf/testdata/hello.c | 7 - .../libgo/go/debug/gosym/pclinetest.h | 7 - .../libgo/go/debug/gosym/pclinetest.s | 89 - .../libgo/go/debug/gosym/pclntab.go | 453 - .../libgo/go/debug/gosym/pclntab_test.go | 278 - .../gofrontend/libgo/go/debug/gosym/symtab.go | 710 - .../gofrontend/libgo/go/debug/macho/fat.go | 146 - .../gofrontend/libgo/go/debug/macho/file.go | 524 - .../libgo/go/debug/macho/file_test.go | 210 - .../gofrontend/libgo/go/debug/macho/macho.go | 316 - .../testdata/fat-gcc-386-amd64-darwin-exec | Bin 28992 -> 0 bytes .../debug/macho/testdata/gcc-386-darwin-exec | Bin 12588 -> 0 bytes .../macho/testdata/gcc-amd64-darwin-exec | Bin 8512 -> 0 bytes .../testdata/gcc-amd64-darwin-exec-debug | Bin 4540 -> 0 bytes .../libgo/go/debug/macho/testdata/hello.c | 8 - .../gofrontend/libgo/go/debug/pe/file.go | 397 - .../gofrontend/libgo/go/debug/pe/file_test.go | 309 - .../gofrontend/libgo/go/debug/pe/pe.go | 134 - .../go/debug/pe/testdata/gcc-386-mingw-exec | Bin 29941 -> 0 bytes .../go/debug/pe/testdata/gcc-386-mingw-obj | Bin 2372 -> 0 bytes .../go/debug/pe/testdata/gcc-amd64-mingw-exec | Bin 273083 -> 0 bytes .../go/debug/pe/testdata/gcc-amd64-mingw-obj | Bin 736 -> 0 bytes .../libgo/go/debug/pe/testdata/hello.c | 8 - .../libgo/go/debug/plan9obj/file.go | 328 - .../libgo/go/debug/plan9obj/file_test.go | 81 - .../libgo/go/debug/plan9obj/plan9obj.go | 36 - .../go/debug/plan9obj/testdata/386-plan9-exec | Bin 37232 -> 0 bytes .../debug/plan9obj/testdata/amd64-plan9-exec | Bin 34279 -> 0 bytes .../libgo/go/debug/plan9obj/testdata/hello.c | 8 - .../libgo/go/encoding/ascii85/ascii85.go | 310 - .../libgo/go/encoding/ascii85/ascii85_test.go | 210 - .../gofrontend/libgo/go/encoding/asn1/asn1.go | 962 - .../libgo/go/encoding/asn1/asn1_test.go | 942 - .../libgo/go/encoding/asn1/common.go | 168 - .../libgo/go/encoding/asn1/marshal.go | 652 - .../libgo/go/encoding/asn1/marshal_test.go | 175 - .../libgo/go/encoding/base32/base32.go | 426 - .../libgo/go/encoding/base32/base32_test.go | 302 - .../libgo/go/encoding/base64/base64.go | 448 - .../libgo/go/encoding/base64/base64_test.go | 408 - .../libgo/go/encoding/binary/binary.go | 618 - .../libgo/go/encoding/binary/binary_test.go | 416 - .../libgo/go/encoding/binary/varint.go | 133 - .../libgo/go/encoding/binary/varint_test.go | 168 - .../libgo/go/encoding/csv/example_test.go | 133 - .../libgo/go/encoding/csv/reader.go | 342 - .../libgo/go/encoding/csv/reader_test.go | 315 - .../libgo/go/encoding/csv/writer.go | 139 - .../libgo/go/encoding/csv/writer_test.go | 85 - .../gofrontend/libgo/go/encoding/encoding.go | 48 - .../libgo/go/encoding/gob/codec_test.go | 1494 -- .../gofrontend/libgo/go/encoding/gob/debug.go | 705 - .../libgo/go/encoding/gob/dec_helpers.go | 468 - .../libgo/go/encoding/gob/decgen.go | 240 - .../libgo/go/encoding/gob/decode.go | 1248 - .../libgo/go/encoding/gob/decoder.go | 218 - .../gofrontend/libgo/go/encoding/gob/doc.go | 386 - .../gofrontend/libgo/go/encoding/gob/dump.go | 29 - .../libgo/go/encoding/gob/enc_helpers.go | 414 - .../libgo/go/encoding/gob/encgen.go | 218 - .../libgo/go/encoding/gob/encode.go | 696 - .../libgo/go/encoding/gob/encoder.go | 254 - .../libgo/go/encoding/gob/encoder_test.go | 1020 - .../gofrontend/libgo/go/encoding/gob/error.go | 43 - .../libgo/go/encoding/gob/gobencdec_test.go | 798 - .../libgo/go/encoding/gob/timing_test.go | 325 - .../gofrontend/libgo/go/encoding/gob/type.go | 923 - .../libgo/go/encoding/gob/type_test.go | 222 - .../gofrontend/libgo/go/encoding/hex/hex.go | 216 - .../libgo/go/encoding/hex/hex_test.go | 153 - .../libgo/go/encoding/json/bench_test.go | 223 - .../libgo/go/encoding/json/decode.go | 1093 - .../libgo/go/encoding/json/decode_test.go | 1465 -- .../libgo/go/encoding/json/encode.go | 1194 - .../libgo/go/encoding/json/encode_test.go | 532 - .../gofrontend/libgo/go/encoding/json/fold.go | 143 - .../libgo/go/encoding/json/fold_test.go | 116 - .../libgo/go/encoding/json/indent.go | 137 - .../libgo/go/encoding/json/scanner.go | 630 - .../libgo/go/encoding/json/scanner_test.go | 316 - .../libgo/go/encoding/json/stream.go | 480 - .../libgo/go/encoding/json/stream_test.go | 354 - .../libgo/go/encoding/json/tagkey_test.go | 115 - .../gofrontend/libgo/go/encoding/json/tags.go | 44 - .../libgo/go/encoding/json/tags_test.go | 28 - .../go/encoding/json/testdata/code.json.gz | Bin 120432 -> 0 bytes .../gofrontend/libgo/go/encoding/pem/pem.go | 294 - .../libgo/go/encoding/pem/pem_test.go | 514 - .../libgo/go/encoding/xml/atom_test.go | 56 - .../libgo/go/encoding/xml/marshal.go | 989 - .../libgo/go/encoding/xml/marshal_test.go | 1776 -- .../gofrontend/libgo/go/encoding/xml/read.go | 692 - .../libgo/go/encoding/xml/read_test.go | 714 - .../libgo/go/encoding/xml/typeinfo.go | 363 - .../gofrontend/libgo/go/encoding/xml/xml.go | 1965 -- .../libgo/go/encoding/xml/xml_test.go | 752 - .../gofrontend/libgo/go/errors/errors.go | 20 - .../gofrontend/libgo/go/errors/errors_test.go | 53 - .../gofrontend/libgo/go/exp/README | 3 - .../gofrontend/libgo/go/exp/proxy/direct.go | 18 - .../gofrontend/libgo/go/exp/proxy/per_host.go | 140 - .../libgo/go/exp/proxy/per_host_test.go | 55 - .../gofrontend/libgo/go/exp/proxy/proxy.go | 94 - .../libgo/go/exp/proxy/proxy_test.go | 50 - .../gofrontend/libgo/go/exp/proxy/socks5.go | 207 - .../libgo/go/exp/terminal/terminal.go | 520 - .../libgo/go/exp/terminal/terminal_test.go | 110 - .../gofrontend/libgo/go/exp/terminal/util.go | 118 - .../gofrontend/libgo/go/expvar/expvar.go | 333 - .../gofrontend/libgo/go/expvar/expvar_test.go | 390 - .../gofrontend/libgo/go/flag/example_test.go | 83 - .../gofrontend/libgo/go/flag/export_test.go | 17 - .../gofrontend/libgo/go/flag/flag.go | 957 - .../gofrontend/libgo/go/flag/flag_test.go | 417 - .../gofrontend/libgo/go/fmt/doc.go | 314 - .../gofrontend/libgo/go/fmt/export_test.go | 7 - .../gofrontend/libgo/go/fmt/fmt_test.go | 1394 -- .../gofrontend/libgo/go/fmt/format.go | 535 - .../gofrontend/libgo/go/fmt/norace_test.go | 9 - .../gofrontend/libgo/go/fmt/print.go | 1259 -- .../gofrontend/libgo/go/fmt/race_test.go | 9 - .../gofrontend/libgo/go/fmt/scan.go | 1195 - .../gofrontend/libgo/go/fmt/scan_test.go | 1161 - .../gofrontend/libgo/go/fmt/stringer_test.go | 61 - .../gofrontend/libgo/go/go/ast/ast.go | 999 - .../gofrontend/libgo/go/go/ast/ast_test.go | 50 - .../gofrontend/libgo/go/go/ast/commentmap.go | 332 - .../libgo/go/go/ast/commentmap_test.go | 143 - .../gofrontend/libgo/go/go/ast/filter.go | 465 - .../gofrontend/libgo/go/go/ast/filter_test.go | 86 - .../gofrontend/libgo/go/go/ast/import.go | 196 - .../gofrontend/libgo/go/go/ast/print.go | 251 - .../gofrontend/libgo/go/go/ast/print_test.go | 97 - .../gofrontend/libgo/go/go/ast/resolve.go | 174 - .../gofrontend/libgo/go/go/ast/scope.go | 162 - .../gofrontend/libgo/go/go/ast/walk.go | 386 - .../gofrontend/libgo/go/go/build/build.go | 1419 -- .../libgo/go/go/build/build_test.go | 279 - .../gofrontend/libgo/go/go/build/deps_test.go | 520 - .../gofrontend/libgo/go/go/build/doc.go | 140 - .../gofrontend/libgo/go/go/build/read.go | 246 - .../gofrontend/libgo/go/go/build/read_test.go | 226 - .../gofrontend/libgo/go/go/build/syslist.go | 8 - .../libgo/go/go/build/syslist_test.go | 62 - .../libgo/go/go/build/testdata/empty/dummy | 0 .../libgo/go/go/build/testdata/multi/file.go | 5 - .../go/build/testdata/multi/file_appengine.go | 5 - .../go/go/build/testdata/other/file/file.go | 5 - .../libgo/go/go/build/testdata/other/main.go | 11 - .../gofrontend/libgo/go/go/constant/go13.go | 24 - .../gofrontend/libgo/go/go/constant/go14.go | 13 - .../gofrontend/libgo/go/go/constant/value.go | 925 - .../libgo/go/go/constant/value_test.go | 375 - .../gofrontend/libgo/go/go/doc/comment.go | 480 - .../libgo/go/go/doc/comment_test.go | 207 - .../gofrontend/libgo/go/go/doc/doc.go | 112 - .../gofrontend/libgo/go/go/doc/doc_test.go | 146 - .../gofrontend/libgo/go/go/doc/example.go | 355 - .../libgo/go/go/doc/example_test.go | 191 - .../gofrontend/libgo/go/go/doc/exports.go | 252 - .../gofrontend/libgo/go/go/doc/filter.go | 105 - .../gofrontend/libgo/go/go/doc/headscan.go | 114 - .../gofrontend/libgo/go/go/doc/reader.go | 853 - .../gofrontend/libgo/go/go/doc/synopsis.go | 82 - .../libgo/go/go/doc/synopsis_test.go | 51 - .../libgo/go/go/doc/testdata/a.0.golden | 52 - .../libgo/go/go/doc/testdata/a.1.golden | 52 - .../libgo/go/go/doc/testdata/a.2.golden | 52 - .../gofrontend/libgo/go/go/doc/testdata/a0.go | 40 - .../gofrontend/libgo/go/go/doc/testdata/a1.go | 12 - .../libgo/go/go/doc/testdata/b.0.golden | 71 - .../libgo/go/go/doc/testdata/b.1.golden | 83 - .../libgo/go/go/doc/testdata/b.2.golden | 71 - .../gofrontend/libgo/go/go/doc/testdata/b.go | 58 - .../libgo/go/go/doc/testdata/benchmark.go | 293 - .../libgo/go/go/doc/testdata/blank.0.golden | 55 - .../libgo/go/go/doc/testdata/blank.1.golden | 75 - .../libgo/go/go/doc/testdata/blank.2.golden | 55 - .../libgo/go/go/doc/testdata/blank.go | 67 - .../libgo/go/go/doc/testdata/bugpara.0.golden | 20 - .../libgo/go/go/doc/testdata/bugpara.1.golden | 20 - .../libgo/go/go/doc/testdata/bugpara.2.golden | 20 - .../libgo/go/go/doc/testdata/bugpara.go | 5 - .../libgo/go/go/doc/testdata/c.0.golden | 48 - .../libgo/go/go/doc/testdata/c.1.golden | 48 - .../libgo/go/go/doc/testdata/c.2.golden | 48 - .../gofrontend/libgo/go/go/doc/testdata/c.go | 62 - .../libgo/go/go/doc/testdata/d.0.golden | 104 - .../libgo/go/go/doc/testdata/d.1.golden | 104 - .../libgo/go/go/doc/testdata/d.2.golden | 104 - .../gofrontend/libgo/go/go/doc/testdata/d1.go | 57 - .../gofrontend/libgo/go/go/doc/testdata/d2.go | 45 - .../libgo/go/go/doc/testdata/e.0.golden | 109 - .../libgo/go/go/doc/testdata/e.1.golden | 144 - .../libgo/go/go/doc/testdata/e.2.golden | 130 - .../gofrontend/libgo/go/go/doc/testdata/e.go | 147 - .../libgo/go/go/doc/testdata/error1.0.golden | 30 - .../libgo/go/go/doc/testdata/error1.1.golden | 32 - .../libgo/go/go/doc/testdata/error1.2.golden | 30 - .../libgo/go/go/doc/testdata/error1.go | 24 - .../libgo/go/go/doc/testdata/error2.0.golden | 27 - .../libgo/go/go/doc/testdata/error2.1.golden | 37 - .../libgo/go/go/doc/testdata/error2.2.golden | 27 - .../libgo/go/go/doc/testdata/error2.go | 29 - .../libgo/go/go/doc/testdata/example.go | 81 - .../libgo/go/go/doc/testdata/f.0.golden | 13 - .../libgo/go/go/doc/testdata/f.1.golden | 16 - .../libgo/go/go/doc/testdata/f.2.golden | 13 - .../gofrontend/libgo/go/go/doc/testdata/f.go | 14 - .../libgo/go/go/doc/testdata/template.txt | 68 - .../libgo/go/go/doc/testdata/testing.0.golden | 156 - .../libgo/go/go/doc/testdata/testing.1.golden | 298 - .../libgo/go/go/doc/testdata/testing.2.golden | 156 - .../libgo/go/go/doc/testdata/testing.go | 404 - .../gofrontend/libgo/go/go/format/format.go | 115 - .../libgo/go/go/format/format_test.go | 132 - .../libgo/go/go/importer/importer.go | 69 - .../gccgoimporter/gccgoinstallation.go | 94 - .../gccgoimporter/gccgoinstallation_test.go | 197 - .../go/go/internal/gccgoimporter/importer.go | 212 - .../internal/gccgoimporter/importer_test.go | 171 - .../go/go/internal/gccgoimporter/parser.go | 855 - .../go/internal/gccgoimporter/parser_test.go | 72 - .../gccgoimporter/testdata/complexnums.go | 6 - .../gccgoimporter/testdata/imports.go | 5 - .../gccgoimporter/testdata/pointer.go | 3 - .../go/go/internal/gcimporter/exportdata.go | 108 - .../go/go/internal/gcimporter/gcimporter.go | 991 - .../go/internal/gcimporter/gcimporter_test.go | 225 - .../internal/gcimporter/testdata/exports.go | 89 - .../libgo/go/go/parser/error_test.go | 181 - .../libgo/go/go/parser/interface.go | 226 - .../gofrontend/libgo/go/go/parser/parser.go | 2502 -- .../libgo/go/go/parser/parser_test.go | 533 - .../libgo/go/go/parser/performance_test.go | 30 - .../libgo/go/go/parser/short_test.go | 115 - .../libgo/go/go/parser/testdata/commas.src | 19 - .../libgo/go/go/parser/testdata/issue3106.src | 46 - .../gofrontend/libgo/go/go/printer/nodes.go | 1652 -- .../libgo/go/go/printer/performance_test.go | 58 - .../gofrontend/libgo/go/go/printer/printer.go | 1296 -- .../libgo/go/go/printer/printer_test.go | 562 - .../go/go/printer/testdata/comments.golden | 705 - .../go/go/printer/testdata/comments.input | 710 - .../libgo/go/go/printer/testdata/comments.x | 56 - .../go/go/printer/testdata/comments2.golden | 105 - .../go/go/printer/testdata/comments2.input | 105 - .../go/printer/testdata/declarations.golden | 987 - .../go/go/printer/testdata/declarations.input | 1001 - .../libgo/go/go/printer/testdata/empty.golden | 5 - .../libgo/go/go/printer/testdata/empty.input | 5 - .../go/go/printer/testdata/expressions.golden | 686 - .../go/go/printer/testdata/expressions.input | 715 - .../go/go/printer/testdata/expressions.raw | 686 - .../go/go/printer/testdata/linebreaks.golden | 275 - .../go/go/printer/testdata/linebreaks.input | 271 - .../libgo/go/go/printer/testdata/parser.go | 2153 -- .../libgo/go/go/printer/testdata/slow.golden | 85 - .../libgo/go/go/printer/testdata/slow.input | 85 - .../go/go/printer/testdata/statements.golden | 644 - .../go/go/printer/testdata/statements.input | 555 - .../gofrontend/libgo/go/go/scanner/errors.go | 124 - .../gofrontend/libgo/go/go/scanner/scanner.go | 761 - .../libgo/go/go/scanner/scanner_test.go | 810 - .../gofrontend/libgo/go/go/token/position.go | 485 - .../libgo/go/go/token/position_test.go | 297 - .../gofrontend/libgo/go/go/token/serialize.go | 56 - .../libgo/go/go/token/serialize_test.go | 111 - .../gofrontend/libgo/go/go/token/token.go | 308 - .../gofrontend/libgo/go/go/types/api.go | 336 - .../gofrontend/libgo/go/go/types/api_test.go | 1044 - .../libgo/go/go/types/assignments.go | 328 - .../gofrontend/libgo/go/go/types/builtins.go | 627 - .../libgo/go/go/types/builtins_test.go | 204 - .../gofrontend/libgo/go/go/types/call.go | 441 - .../gofrontend/libgo/go/go/types/check.go | 358 - .../libgo/go/go/types/check_test.go | 298 - .../libgo/go/go/types/conversions.go | 146 - .../gofrontend/libgo/go/go/types/decl.go | 430 - .../gofrontend/libgo/go/go/types/errors.go | 103 - .../gofrontend/libgo/go/go/types/eval.go | 83 - .../gofrontend/libgo/go/go/types/eval_test.go | 188 - .../libgo/go/go/types/example_test.go | 312 - .../gofrontend/libgo/go/go/types/expr.go | 1496 -- .../libgo/go/go/types/exprstring.go | 220 - .../libgo/go/go/types/exprstring_test.go | 94 - .../gofrontend/libgo/go/go/types/go11.go | 17 - .../gofrontend/libgo/go/go/types/go12.go | 17 - .../libgo/go/go/types/hilbert_test.go | 234 - .../gofrontend/libgo/go/go/types/initorder.go | 222 - .../libgo/go/go/types/issues_test.go | 206 - .../gofrontend/libgo/go/go/types/labels.go | 268 - .../gofrontend/libgo/go/go/types/lookup.go | 341 - .../gofrontend/libgo/go/go/types/methodset.go | 268 - .../gofrontend/libgo/go/go/types/object.go | 360 - .../gofrontend/libgo/go/go/types/objset.go | 31 - .../gofrontend/libgo/go/go/types/operand.go | 287 - .../gofrontend/libgo/go/go/types/ordering.go | 127 - .../gofrontend/libgo/go/go/types/package.go | 65 - .../libgo/go/go/types/predicates.go | 309 - .../gofrontend/libgo/go/go/types/resolver.go | 445 - .../libgo/go/go/types/resolver_test.go | 209 - .../gofrontend/libgo/go/go/types/return.go | 185 - .../gofrontend/libgo/go/go/types/scope.go | 190 - .../gofrontend/libgo/go/go/types/selection.go | 143 - .../gofrontend/libgo/go/go/types/self_test.go | 102 - .../gofrontend/libgo/go/go/types/sizes.go | 211 - .../libgo/go/go/types/stdlib_test.go | 279 - .../gofrontend/libgo/go/go/types/stmt.go | 744 - .../libgo/go/go/types/token_test.go | 47 - .../gofrontend/libgo/go/go/types/type.go | 454 - .../libgo/go/go/types/typestring.go | 296 - .../libgo/go/go/types/typestring_test.go | 168 - .../gofrontend/libgo/go/go/types/typexpr.go | 712 - .../gofrontend/libgo/go/go/types/universe.go | 223 - .../libgo/go/hash/adler32/adler32.go | 78 - .../libgo/go/hash/adler32/adler32_test.go | 105 - .../gofrontend/libgo/go/hash/crc32/crc32.go | 182 - .../libgo/go/hash/crc32/crc32_amd64x.go | 27 - .../libgo/go/hash/crc32/crc32_generic.go | 14 - .../libgo/go/hash/crc32/crc32_test.go | 133 - .../libgo/go/hash/crc32/example_test.go | 30 - .../gofrontend/libgo/go/hash/crc64/crc64.go | 87 - .../libgo/go/hash/crc64/crc64_test.go | 81 - .../gofrontend/libgo/go/hash/fnv/fnv.go | 131 - .../gofrontend/libgo/go/hash/fnv/fnv_test.go | 165 - .../gofrontend/libgo/go/hash/hash.go | 43 - .../gofrontend/libgo/go/html/entity.go | 2253 -- .../gofrontend/libgo/go/html/entity_test.go | 29 - .../gofrontend/libgo/go/html/escape.go | 215 - .../gofrontend/libgo/go/html/escape_test.go | 153 - .../gofrontend/libgo/go/html/example_test.go | 24 - .../gofrontend/libgo/go/html/template/attr.go | 175 - .../libgo/go/html/template/clone_test.go | 188 - .../libgo/go/html/template/content.go | 136 - .../libgo/go/html/template/content_test.go | 280 - .../libgo/go/html/template/context.go | 339 - .../gofrontend/libgo/go/html/template/css.go | 256 - .../libgo/go/html/template/css_test.go | 281 - .../gofrontend/libgo/go/html/template/doc.go | 191 - .../libgo/go/html/template/error.go | 205 - .../libgo/go/html/template/escape.go | 809 - .../libgo/go/html/template/escape_test.go | 1756 -- .../libgo/go/html/template/example_test.go | 124 - .../gofrontend/libgo/go/html/template/html.go | 260 - .../libgo/go/html/template/html_test.go | 97 - .../gofrontend/libgo/go/html/template/js.go | 364 - .../libgo/go/html/template/js_test.go | 401 - .../libgo/go/html/template/template.go | 415 - .../libgo/go/html/template/transition.go | 580 - .../libgo/go/html/template/transition_test.go | 60 - .../gofrontend/libgo/go/html/template/url.go | 105 - .../libgo/go/html/template/url_test.go | 112 - .../gofrontend/libgo/go/image/color/color.go | 313 - .../libgo/go/image/color/palette/gen.go | 121 - .../libgo/go/image/color/palette/generate.go | 8 - .../libgo/go/image/color/palette/palette.go | 503 - .../gofrontend/libgo/go/image/color/ycbcr.go | 199 - .../libgo/go/image/color/ycbcr_test.go | 149 - .../libgo/go/image/decode_example_test.go | 140 - .../gofrontend/libgo/go/image/decode_test.go | 130 - .../libgo/go/image/draw/bench_test.go | 259 - .../libgo/go/image/draw/clip_test.go | 205 - .../gofrontend/libgo/go/image/draw/draw.go | 690 - .../libgo/go/image/draw/draw_test.go | 469 - .../gofrontend/libgo/go/image/format.go | 100 - .../gofrontend/libgo/go/image/geom.go | 266 - .../gofrontend/libgo/go/image/geom_test.go | 115 - .../gofrontend/libgo/go/image/gif/reader.go | 494 - .../libgo/go/image/gif/reader_test.go | 276 - .../gofrontend/libgo/go/image/gif/writer.go | 386 - .../libgo/go/image/gif/writer_test.go | 491 - .../gofrontend/libgo/go/image/image.go | 1022 - .../gofrontend/libgo/go/image/image_test.go | 113 - .../libgo/go/image/internal/imageutil/gen.go | 154 - .../go/image/internal/imageutil/imageutil.go | 8 - .../libgo/go/image/internal/imageutil/impl.go | 196 - .../libgo/go/image/jpeg/dct_test.go | 299 - .../gofrontend/libgo/go/image/jpeg/fdct.go | 190 - .../gofrontend/libgo/go/image/jpeg/huffman.go | 246 - .../gofrontend/libgo/go/image/jpeg/idct.go | 192 - .../gofrontend/libgo/go/image/jpeg/reader.go | 802 - .../libgo/go/image/jpeg/reader_test.go | 348 - .../gofrontend/libgo/go/image/jpeg/scan.go | 472 - .../gofrontend/libgo/go/image/jpeg/writer.go | 614 - .../libgo/go/image/jpeg/writer_test.go | 232 - .../gofrontend/libgo/go/image/names.go | 52 - .../gofrontend/libgo/go/image/png/paeth.go | 71 - .../libgo/go/image/png/paeth_test.go | 91 - .../gofrontend/libgo/go/image/png/reader.go | 846 - .../libgo/go/image/png/reader_test.go | 451 - .../libgo/go/image/png/testdata/benchGray.png | Bin 14709 -> 0 bytes .../png/testdata/benchNRGBA-gradient.png | Bin 58831 -> 0 bytes .../image/png/testdata/benchNRGBA-opaque.png | Bin 44237 -> 0 bytes .../go/image/png/testdata/benchPaletted.png | Bin 13397 -> 0 bytes .../image/png/testdata/benchRGB-interlace.png | Bin 47483 -> 0 bytes .../libgo/go/image/png/testdata/benchRGB.png | Bin 39571 -> 0 bytes .../png/testdata/gray-gradient.interlaced.png | Bin 247 -> 0 bytes .../go/image/png/testdata/gray-gradient.png | Bin 77 -> 0 bytes .../go/image/png/testdata/invalid-crc32.png | Bin 1289 -> 0 bytes .../go/image/png/testdata/invalid-noend.png | Bin 1277 -> 0 bytes .../go/image/png/testdata/invalid-trunc.png | Bin 1288 -> 0 bytes .../go/image/png/testdata/invalid-zlib.png | Bin 1289 -> 0 bytes .../go/image/png/testdata/pngsuite/README | 21 - .../png/testdata/pngsuite/README.original | 85 - .../png/testdata/pngsuite/basn0g01-30.png | Bin 162 -> 0 bytes .../png/testdata/pngsuite/basn0g01-30.sng | 39 - .../image/png/testdata/pngsuite/basn0g01.png | Bin 164 -> 0 bytes .../image/png/testdata/pngsuite/basn0g01.sng | 41 - .../png/testdata/pngsuite/basn0g02-29.png | Bin 110 -> 0 bytes .../png/testdata/pngsuite/basn0g02-29.sng | 38 - .../image/png/testdata/pngsuite/basn0g02.png | Bin 104 -> 0 bytes .../image/png/testdata/pngsuite/basn0g02.sng | 41 - .../png/testdata/pngsuite/basn0g04-31.png | Bin 153 -> 0 bytes .../png/testdata/pngsuite/basn0g04-31.sng | 40 - .../image/png/testdata/pngsuite/basn0g04.png | Bin 145 -> 0 bytes .../image/png/testdata/pngsuite/basn0g04.sng | 41 - .../image/png/testdata/pngsuite/basn0g08.png | Bin 138 -> 0 bytes .../image/png/testdata/pngsuite/basn0g08.sng | 41 - .../image/png/testdata/pngsuite/basn0g16.png | Bin 167 -> 0 bytes .../image/png/testdata/pngsuite/basn0g16.sng | 41 - .../image/png/testdata/pngsuite/basn2c08.png | Bin 145 -> 0 bytes .../image/png/testdata/pngsuite/basn2c08.sng | 41 - .../image/png/testdata/pngsuite/basn2c16.png | Bin 302 -> 0 bytes .../image/png/testdata/pngsuite/basn2c16.sng | 41 - .../image/png/testdata/pngsuite/basn3p01.png | Bin 112 -> 0 bytes .../image/png/testdata/pngsuite/basn3p01.sng | 45 - .../image/png/testdata/pngsuite/basn3p02.png | Bin 146 -> 0 bytes .../image/png/testdata/pngsuite/basn3p02.sng | 47 - .../png/testdata/pngsuite/basn3p04-31i.png | Bin 358 -> 0 bytes .../png/testdata/pngsuite/basn3p04-31i.sng | 57 - .../image/png/testdata/pngsuite/basn3p04.png | Bin 216 -> 0 bytes .../image/png/testdata/pngsuite/basn3p04.sng | 58 - .../png/testdata/pngsuite/basn3p08-trns.png | Bin 1538 -> 0 bytes .../png/testdata/pngsuite/basn3p08-trns.sng | 301 - .../image/png/testdata/pngsuite/basn3p08.png | Bin 1286 -> 0 bytes .../image/png/testdata/pngsuite/basn3p08.sng | 299 - .../image/png/testdata/pngsuite/basn4a08.png | Bin 126 -> 0 bytes .../image/png/testdata/pngsuite/basn4a08.sng | 41 - .../image/png/testdata/pngsuite/basn4a16.png | Bin 2206 -> 0 bytes .../image/png/testdata/pngsuite/basn4a16.sng | 41 - .../image/png/testdata/pngsuite/basn6a08.png | Bin 184 -> 0 bytes .../image/png/testdata/pngsuite/basn6a08.sng | 41 - .../image/png/testdata/pngsuite/basn6a16.png | Bin 3435 -> 0 bytes .../image/png/testdata/pngsuite/basn6a16.sng | 41 - .../gofrontend/libgo/go/image/png/writer.go | 530 - .../libgo/go/image/png/writer_test.go | 210 - .../go/image/testdata/video-001.221212.jpeg | Bin 19263 -> 0 bytes .../go/image/testdata/video-001.221212.png | Bin 29820 -> 0 bytes .../go/image/testdata/video-001.5bpp.gif | Bin 6214 -> 0 bytes .../go/image/testdata/video-001.cmyk.jpeg | Bin 19477 -> 0 bytes .../go/image/testdata/video-001.cmyk.png | Bin 25439 -> 0 bytes .../libgo/go/image/testdata/video-001.gif | Bin 13106 -> 0 bytes .../image/testdata/video-001.interlaced.gif | Bin 14142 -> 0 bytes .../libgo/go/image/testdata/video-001.jpeg | Bin 21459 -> 0 bytes .../libgo/go/image/testdata/video-001.png | Bin 29228 -> 0 bytes .../image/testdata/video-001.progressive.jpeg | Bin 20732 -> 0 bytes .../go/image/testdata/video-001.q50.410.jpeg | Bin 3259 -> 0 bytes .../video-001.q50.410.progressive.jpeg | Bin 3125 -> 0 bytes .../go/image/testdata/video-001.q50.411.jpeg | Bin 3362 -> 0 bytes .../video-001.q50.411.progressive.jpeg | Bin 3251 -> 0 bytes .../go/image/testdata/video-001.q50.420.jpeg | Bin 3407 -> 0 bytes .../video-001.q50.420.progressive.jpeg | Bin 3279 -> 0 bytes .../go/image/testdata/video-001.q50.422.jpeg | Bin 3608 -> 0 bytes .../video-001.q50.422.progressive.jpeg | Bin 3506 -> 0 bytes .../go/image/testdata/video-001.q50.440.jpeg | Bin 3662 -> 0 bytes .../video-001.q50.440.progressive.jpeg | Bin 3529 -> 0 bytes .../go/image/testdata/video-001.q50.444.jpeg | Bin 4032 -> 0 bytes .../video-001.q50.444.progressive.jpeg | Bin 3935 -> 0 bytes .../go/image/testdata/video-001.rgb.jpeg | Bin 6237 -> 0 bytes .../libgo/go/image/testdata/video-001.rgb.png | Bin 20414 -> 0 bytes .../video-001.separate.dc.progression.jpeg | Bin 14288 -> 0 bytes ...1.separate.dc.progression.progressive.jpeg | Bin 14312 -> 0 bytes .../go/image/testdata/video-005.gray.gif | Bin 14505 -> 0 bytes .../go/image/testdata/video-005.gray.jpeg | Bin 5618 -> 0 bytes .../go/image/testdata/video-005.gray.png | Bin 14974 -> 0 bytes .../testdata/video-005.gray.q50.2x2.jpeg | Bin 2782 -> 0 bytes .../video-005.gray.q50.2x2.progressive.jpeg | Bin 2699 -> 0 bytes .../go/image/testdata/video-005.gray.q50.jpeg | Bin 2782 -> 0 bytes .../video-005.gray.q50.progressive.jpeg | Bin 2699 -> 0 bytes .../gofrontend/libgo/go/image/ycbcr.go | 178 - .../gofrontend/libgo/go/image/ycbcr_test.go | 133 - .../libgo/go/index/suffixarray/qsufsort.go | 168 - .../libgo/go/index/suffixarray/suffixarray.go | 307 - .../go/index/suffixarray/suffixarray_test.go | 304 - .../libgo/go/internal/format/format.go | 163 - .../go/internal/singleflight/singleflight.go | 111 - .../singleflight/singleflight_test.go | 87 - .../libgo/go/internal/syscall/unix/dummy.go | 5 - .../internal/syscall/unix/getrandom_linux.go | 58 - .../syscall/windows/registry/export_test.go | 11 - .../internal/syscall/windows/registry/key.go | 175 - .../syscall/windows/registry/registry_test.go | 678 - .../syscall/windows/registry/syscall.go | 28 - .../syscall/windows/registry/value.go | 329 - .../windows/registry/zsyscall_windows.go | 73 - .../syscall/windows/syscall_windows.go | 130 - .../syscall/windows/zsyscall_windows.go | 49 - .../libgo/go/internal/testenv/testenv.go | 104 - .../libgo/go/internal/trace/goroutines.go | 180 - .../libgo/go/internal/trace/parser.go | 786 - .../libgo/go/internal/trace/parser_test.go | 30 - llgo/third_party/gofrontend/libgo/go/io/io.go | 521 - .../gofrontend/libgo/go/io/io_test.go | 389 - .../gofrontend/libgo/go/io/ioutil/ioutil.go | 165 - .../libgo/go/io/ioutil/ioutil_test.go | 97 - .../gofrontend/libgo/go/io/ioutil/tempfile.go | 99 - .../libgo/go/io/ioutil/tempfile_test.go | 53 - .../gofrontend/libgo/go/io/multi.go | 61 - .../gofrontend/libgo/go/io/multi_test.go | 115 - .../gofrontend/libgo/go/io/pipe.go | 196 - .../gofrontend/libgo/go/io/pipe_test.go | 302 - .../gofrontend/libgo/go/log/log.go | 346 - .../gofrontend/libgo/go/log/log_test.go | 184 - .../gofrontend/libgo/go/log/syslog/doc.go | 18 - .../gofrontend/libgo/go/log/syslog/syslog.go | 312 - .../gofrontend/libgo/go/log/syslog/syslog_c.c | 21 - .../libgo/go/log/syslog/syslog_libc.go | 41 - .../libgo/go/log/syslog/syslog_test.go | 381 - .../libgo/go/log/syslog/syslog_unix.go | 31 - .../gofrontend/libgo/go/math/abs.go | 28 - .../gofrontend/libgo/go/math/acosh.go | 60 - .../gofrontend/libgo/go/math/all_test.go | 3072 --- .../gofrontend/libgo/go/math/asin.go | 67 - .../gofrontend/libgo/go/math/asinh.go | 69 - .../gofrontend/libgo/go/math/atan.go | 111 - .../gofrontend/libgo/go/math/atan2.go | 77 - .../gofrontend/libgo/go/math/atanh.go | 77 - .../libgo/go/math/big/accuracy_string.go | 17 - .../gofrontend/libgo/go/math/big/arith.go | 305 - .../libgo/go/math/big/arith_decl.go | 21 - .../libgo/go/math/big/arith_decl_pure.go | 55 - .../libgo/go/math/big/arith_test.go | 457 - .../gofrontend/libgo/go/math/big/bits_test.go | 224 - .../libgo/go/math/big/calibrate_test.go | 88 - .../gofrontend/libgo/go/math/big/decimal.go | 264 - .../libgo/go/math/big/decimal_test.go | 106 - .../gofrontend/libgo/go/math/big/float.go | 1693 -- .../libgo/go/math/big/float_test.go | 1694 -- .../gofrontend/libgo/go/math/big/floatconv.go | 239 - .../libgo/go/math/big/floatconv_test.go | 573 - .../libgo/go/math/big/floatexample_test.go | 113 - .../gofrontend/libgo/go/math/big/ftoa.go | 393 - .../gofrontend/libgo/go/math/big/gcd_test.go | 47 - .../libgo/go/math/big/hilbert_test.go | 160 - .../gofrontend/libgo/go/math/big/int.go | 968 - .../gofrontend/libgo/go/math/big/int_test.go | 1540 -- .../gofrontend/libgo/go/math/big/intconv.go | 228 - .../libgo/go/math/big/intconv_test.go | 342 - .../gofrontend/libgo/go/math/big/nat.go | 1274 -- .../gofrontend/libgo/go/math/big/nat_test.go | 579 - .../gofrontend/libgo/go/math/big/natconv.go | 495 - .../libgo/go/math/big/natconv_test.go | 425 - .../gofrontend/libgo/go/math/big/rat.go | 570 - .../gofrontend/libgo/go/math/big/rat_test.go | 736 - .../gofrontend/libgo/go/math/big/ratconv.go | 252 - .../libgo/go/math/big/ratconv_test.go | 453 - .../libgo/go/math/big/roundingmode_string.go | 16 - .../gofrontend/libgo/go/math/bits.go | 59 - .../gofrontend/libgo/go/math/cbrt.go | 77 - .../gofrontend/libgo/go/math/cmplx/abs.go | 12 - .../gofrontend/libgo/go/math/cmplx/asin.go | 170 - .../libgo/go/math/cmplx/cmath_test.go | 866 - .../gofrontend/libgo/go/math/cmplx/conj.go | 8 - .../gofrontend/libgo/go/math/cmplx/exp.go | 55 - .../gofrontend/libgo/go/math/cmplx/isinf.go | 21 - .../gofrontend/libgo/go/math/cmplx/isnan.go | 25 - .../gofrontend/libgo/go/math/cmplx/log.go | 64 - .../gofrontend/libgo/go/math/cmplx/phase.go | 11 - .../gofrontend/libgo/go/math/cmplx/polar.go | 12 - .../gofrontend/libgo/go/math/cmplx/pow.go | 78 - .../gofrontend/libgo/go/math/cmplx/rect.go | 13 - .../gofrontend/libgo/go/math/cmplx/sin.go | 132 - .../gofrontend/libgo/go/math/cmplx/sqrt.go | 104 - .../gofrontend/libgo/go/math/cmplx/tan.go | 184 - .../gofrontend/libgo/go/math/const.go | 50 - .../gofrontend/libgo/go/math/copysign.go | 12 - .../gofrontend/libgo/go/math/dim.go | 78 - .../gofrontend/libgo/go/math/erf.go | 335 - .../gofrontend/libgo/go/math/exp.go | 199 - .../gofrontend/libgo/go/math/expm1.go | 243 - .../gofrontend/libgo/go/math/export_test.go | 11 - .../gofrontend/libgo/go/math/floor.go | 71 - .../gofrontend/libgo/go/math/frexp.go | 35 - .../gofrontend/libgo/go/math/gamma.go | 202 - .../gofrontend/libgo/go/math/hypot.go | 45 - .../gofrontend/libgo/go/math/j0.go | 429 - .../gofrontend/libgo/go/math/j1.go | 422 - .../gofrontend/libgo/go/math/jn.go | 306 - .../gofrontend/libgo/go/math/ldexp.go | 52 - .../gofrontend/libgo/go/math/lgamma.go | 365 - .../gofrontend/libgo/go/math/log.go | 129 - .../gofrontend/libgo/go/math/log10.go | 36 - .../gofrontend/libgo/go/math/log1p.go | 206 - .../gofrontend/libgo/go/math/logb.go | 50 - .../gofrontend/libgo/go/math/mod.go | 56 - .../gofrontend/libgo/go/math/modf.go | 36 - .../gofrontend/libgo/go/math/nextafter.go | 49 - .../gofrontend/libgo/go/math/pow.go | 137 - .../gofrontend/libgo/go/math/pow10.go | 40 - .../gofrontend/libgo/go/math/rand/exp.go | 222 - .../gofrontend/libgo/go/math/rand/normal.go | 157 - .../gofrontend/libgo/go/math/rand/rand.go | 249 - .../libgo/go/math/rand/rand_test.go | 407 - .../libgo/go/math/rand/regress_test.go | 355 - .../gofrontend/libgo/go/math/rand/rng.go | 246 - .../gofrontend/libgo/go/math/rand/zipf.go | 77 - .../gofrontend/libgo/go/math/remainder.go | 87 - .../gofrontend/libgo/go/math/signbit.go | 10 - .../gofrontend/libgo/go/math/sin.go | 236 - .../gofrontend/libgo/go/math/sincos.go | 71 - .../gofrontend/libgo/go/math/sinh.go | 77 - .../gofrontend/libgo/go/math/sqrt.go | 154 - .../gofrontend/libgo/go/math/tan.go | 136 - .../gofrontend/libgo/go/math/tanh.go | 97 - .../gofrontend/libgo/go/math/unsafe.go | 21 - .../gofrontend/libgo/go/mime/encodedword.go | 329 - .../libgo/go/mime/encodedword_test.go | 287 - .../gofrontend/libgo/go/mime/grammar.go | 32 - .../gofrontend/libgo/go/mime/mediatype.go | 358 - .../libgo/go/mime/mediatype_test.go | 306 - .../libgo/go/mime/multipart/formdata.go | 157 - .../libgo/go/mime/multipart/formdata_test.go | 90 - .../libgo/go/mime/multipart/multipart.go | 378 - .../libgo/go/mime/multipart/multipart_test.go | 686 - .../go/mime/multipart/testdata/nested-mime | 29 - .../libgo/go/mime/multipart/writer.go | 185 - .../libgo/go/mime/multipart/writer_test.go | 128 - .../libgo/go/mime/quotedprintable/reader.go | 124 - .../go/mime/quotedprintable/reader_test.go | 204 - .../libgo/go/mime/quotedprintable/writer.go | 172 - .../go/mime/quotedprintable/writer_test.go | 158 - .../gofrontend/libgo/go/mime/test.types | 8 - .../libgo/go/mime/testdata/test.types | 8 - .../gofrontend/libgo/go/mime/type.go | 187 - .../libgo/go/mime/type_dragonfly.go | 9 - .../gofrontend/libgo/go/mime/type_freebsd.go | 9 - .../gofrontend/libgo/go/mime/type_openbsd.go | 9 - .../gofrontend/libgo/go/mime/type_plan9.go | 57 - .../gofrontend/libgo/go/mime/type_test.go | 151 - .../gofrontend/libgo/go/mime/type_unix.go | 64 - .../gofrontend/libgo/go/mime/type_windows.go | 41 - .../gofrontend/libgo/go/net/addrselect.go | 388 - .../libgo/go/net/addrselect_test.go | 219 - .../gofrontend/libgo/go/net/cgo_android.go | 12 - .../gofrontend/libgo/go/net/cgo_bsd.go | 16 - .../gofrontend/libgo/go/net/cgo_linux.go | 21 - .../gofrontend/libgo/go/net/cgo_netbsd.go | 14 - .../gofrontend/libgo/go/net/cgo_openbsd.go | 14 - .../gofrontend/libgo/go/net/cgo_resnew.go | 36 - .../gofrontend/libgo/go/net/cgo_resold.go | 36 - .../gofrontend/libgo/go/net/cgo_socknew.go | 32 - .../gofrontend/libgo/go/net/cgo_sockold.go | 32 - .../gofrontend/libgo/go/net/cgo_solaris.go | 16 - .../gofrontend/libgo/go/net/cgo_stub.go | 35 - .../gofrontend/libgo/go/net/cgo_unix.go | 275 - .../gofrontend/libgo/go/net/cgo_unix_test.go | 24 - .../gofrontend/libgo/go/net/cgo_windows.go | 13 - .../gofrontend/libgo/go/net/conf.go | 308 - .../gofrontend/libgo/go/net/conf_netcgo.go | 17 - .../gofrontend/libgo/go/net/conf_test.go | 301 - .../gofrontend/libgo/go/net/conn_test.go | 65 - .../gofrontend/libgo/go/net/dial.go | 431 - .../gofrontend/libgo/go/net/dial_gen.go | 40 - .../gofrontend/libgo/go/net/dial_test.go | 715 - .../gofrontend/libgo/go/net/dnsclient.go | 238 - .../gofrontend/libgo/go/net/dnsclient_test.go | 69 - .../gofrontend/libgo/go/net/dnsclient_unix.go | 524 - .../libgo/go/net/dnsclient_unix_test.go | 417 - .../gofrontend/libgo/go/net/dnsconfig_unix.go | 120 - .../libgo/go/net/dnsconfig_unix_test.go | 100 - .../gofrontend/libgo/go/net/dnsmsg.go | 903 - .../gofrontend/libgo/go/net/dnsmsg_test.go | 266 - .../gofrontend/libgo/go/net/dnsname_test.go | 84 - .../libgo/go/net/error_plan9_test.go | 17 - .../libgo/go/net/error_posix_test.go | 44 - .../gofrontend/libgo/go/net/error_test.go | 673 - .../gofrontend/libgo/go/net/external_test.go | 167 - .../gofrontend/libgo/go/net/fd_mutex.go | 184 - .../gofrontend/libgo/go/net/fd_mutex_test.go | 195 - .../gofrontend/libgo/go/net/fd_plan9.go | 228 - .../gofrontend/libgo/go/net/fd_poll_nacl.go | 87 - .../libgo/go/net/fd_poll_runtime.go | 133 - .../gofrontend/libgo/go/net/fd_posix.go | 21 - .../gofrontend/libgo/go/net/fd_posix_test.go | 57 - .../gofrontend/libgo/go/net/fd_select.go | 182 - .../gofrontend/libgo/go/net/fd_unix.go | 506 - .../gofrontend/libgo/go/net/fd_windows.go | 644 - .../gofrontend/libgo/go/net/file.go | 48 - .../gofrontend/libgo/go/net/file_plan9.go | 137 - .../gofrontend/libgo/go/net/file_stub.go | 16 - .../gofrontend/libgo/go/net/file_test.go | 193 - .../gofrontend/libgo/go/net/file_unix.go | 115 - .../gofrontend/libgo/go/net/file_windows.go | 25 - .../gofrontend/libgo/go/net/hook.go | 12 - .../gofrontend/libgo/go/net/hook_cloexec.go | 14 - .../gofrontend/libgo/go/net/hook_plan9.go | 9 - .../gofrontend/libgo/go/net/hook_unix.go | 21 - .../gofrontend/libgo/go/net/hook_windows.go | 21 - .../gofrontend/libgo/go/net/hosts.go | 105 - .../gofrontend/libgo/go/net/hosts_test.go | 120 - .../gofrontend/libgo/go/net/hosts_testdata | 12 - .../gofrontend/libgo/go/net/http/cgi/child.go | 206 - .../libgo/go/net/http/cgi/child_test.go | 150 - .../gofrontend/libgo/go/net/http/cgi/host.go | 383 - .../libgo/go/net/http/cgi/host_test.go | 499 - .../libgo/go/net/http/cgi/matryoshka_test.go | 223 - .../libgo/go/net/http/cgi/posix_test.go | 21 - .../libgo/go/net/http/cgi/testdata/test.cgi | 91 - .../gofrontend/libgo/go/net/http/client.go | 557 - .../libgo/go/net/http/client_test.go | 1155 - .../gofrontend/libgo/go/net/http/cookie.go | 373 - .../libgo/go/net/http/cookie_test.go | 428 - .../libgo/go/net/http/cookiejar/jar.go | 497 - .../libgo/go/net/http/cookiejar/jar_test.go | 1267 -- .../libgo/go/net/http/cookiejar/punycode.go | 159 - .../go/net/http/cookiejar/punycode_test.go | 161 - .../gofrontend/libgo/go/net/http/doc.go | 80 - .../libgo/go/net/http/example_test.go | 111 - .../libgo/go/net/http/export_test.go | 132 - .../libgo/go/net/http/fcgi/child.go | 328 - .../gofrontend/libgo/go/net/http/fcgi/fcgi.go | 274 - .../libgo/go/net/http/fcgi/fcgi_test.go | 256 - .../libgo/go/net/http/filetransport.go | 123 - .../libgo/go/net/http/filetransport_test.go | 65 - .../gofrontend/libgo/go/net/http/fs.go | 587 - .../gofrontend/libgo/go/net/http/fs_test.go | 965 - .../gofrontend/libgo/go/net/http/header.go | 213 - .../libgo/go/net/http/header_test.go | 213 - .../gofrontend/libgo/go/net/http/http_test.go | 58 - .../libgo/go/net/http/httptest/recorder.go | 72 - .../go/net/http/httptest/recorder_test.go | 90 - .../libgo/go/net/http/httptest/server.go | 238 - .../libgo/go/net/http/httptest/server_test.go | 29 - .../libgo/go/net/http/httputil/dump.go | 285 - .../libgo/go/net/http/httputil/dump_test.go | 291 - .../libgo/go/net/http/httputil/httputil.go | 39 - .../libgo/go/net/http/httputil/persist.go | 429 - .../go/net/http/httputil/reverseproxy.go | 293 - .../go/net/http/httputil/reverseproxy_test.go | 322 - .../libgo/go/net/http/internal/chunked.go | 215 - .../go/net/http/internal/chunked_test.go | 156 - .../gofrontend/libgo/go/net/http/jar.go | 27 - .../gofrontend/libgo/go/net/http/lex.go | 169 - .../gofrontend/libgo/go/net/http/lex_test.go | 101 - .../gofrontend/libgo/go/net/http/main_test.go | 113 - .../gofrontend/libgo/go/net/http/npn_test.go | 126 - .../libgo/go/net/http/pprof/pprof.go | 241 - .../libgo/go/net/http/proxy_test.go | 81 - .../gofrontend/libgo/go/net/http/race.go | 11 - .../libgo/go/net/http/range_test.go | 79 - .../libgo/go/net/http/readrequest_test.go | 446 - .../gofrontend/libgo/go/net/http/request.go | 1008 - .../libgo/go/net/http/request_test.go | 773 - .../libgo/go/net/http/requestwrite_test.go | 654 - .../gofrontend/libgo/go/net/http/response.go | 298 - .../libgo/go/net/http/response_test.go | 725 - .../libgo/go/net/http/responsewrite_test.go | 241 - .../libgo/go/net/http/serve_test.go | 3687 --- .../gofrontend/libgo/go/net/http/server.go | 2267 -- .../gofrontend/libgo/go/net/http/sniff.go | 220 - .../libgo/go/net/http/sniff_test.go | 171 - .../gofrontend/libgo/go/net/http/status.go | 120 - .../libgo/go/net/http/testdata/file | 1 - .../libgo/go/net/http/testdata/index.html | 1 - .../libgo/go/net/http/testdata/style.css | 1 - .../gofrontend/libgo/go/net/http/transfer.go | 829 - .../libgo/go/net/http/transfer_test.go | 64 - .../gofrontend/libgo/go/net/http/transport.go | 1461 -- .../libgo/go/net/http/transport_test.go | 2810 --- .../gofrontend/libgo/go/net/http/triv.go | 141 - .../gofrontend/libgo/go/net/interface.go | 146 - .../gofrontend/libgo/go/net/interface_bsd.go | 175 - .../libgo/go/net/interface_darwin.go | 62 - .../libgo/go/net/interface_dragonfly.go | 12 - .../libgo/go/net/interface_freebsd.go | 62 - .../libgo/go/net/interface_linux.go | 269 - .../libgo/go/net/interface_netbsd.go | 12 - .../libgo/go/net/interface_openbsd.go | 12 - .../gofrontend/libgo/go/net/interface_stub.go | 27 - .../gofrontend/libgo/go/net/interface_test.go | 305 - .../libgo/go/net/interface_windows.go | 232 - .../go/net/internal/socktest/main_test.go | 56 - .../net/internal/socktest/main_unix_test.go | 24 - .../internal/socktest/main_windows_test.go | 22 - .../libgo/go/net/internal/socktest/switch.go | 169 - .../go/net/internal/socktest/switch_posix.go | 58 - .../go/net/internal/socktest/switch_stub.go | 16 - .../go/net/internal/socktest/switch_unix.go | 29 - .../net/internal/socktest/switch_windows.go | 29 - .../go/net/internal/socktest/sys_cloexec.go | 42 - .../go/net/internal/socktest/sys_unix.go | 193 - .../go/net/internal/socktest/sys_windows.go | 156 - .../third_party/gofrontend/libgo/go/net/ip.go | 676 - .../gofrontend/libgo/go/net/ip_test.go | 542 - .../gofrontend/libgo/go/net/ipraw_test.go | 116 - .../gofrontend/libgo/go/net/iprawsock.go | 62 - .../libgo/go/net/iprawsock_plan9.go | 82 - .../libgo/go/net/iprawsock_posix.go | 249 - .../gofrontend/libgo/go/net/ipsock.go | 285 - .../gofrontend/libgo/go/net/ipsock_plan9.go | 245 - .../gofrontend/libgo/go/net/ipsock_posix.go | 200 - .../gofrontend/libgo/go/net/ipsock_test.go | 282 - .../gofrontend/libgo/go/net/listen_test.go | 685 - .../gofrontend/libgo/go/net/lookup.go | 172 - .../gofrontend/libgo/go/net/lookup_plan9.go | 298 - .../gofrontend/libgo/go/net/lookup_stub.go | 49 - .../gofrontend/libgo/go/net/lookup_test.go | 503 - .../gofrontend/libgo/go/net/lookup_unix.go | 159 - .../gofrontend/libgo/go/net/lookup_windows.go | 389 - .../gofrontend/libgo/go/net/mac.go | 82 - .../gofrontend/libgo/go/net/mac_test.go | 65 - .../libgo/go/net/mail/example_test.go | 79 - .../gofrontend/libgo/go/net/mail/message.go | 576 - .../libgo/go/net/mail/message_test.go | 588 - .../libgo/go/net/main_cloexec_test.go | 25 - .../libgo/go/net/main_plan9_test.go | 15 - .../libgo/go/net/main_posix_test.go | 50 - .../gofrontend/libgo/go/net/main_test.go | 204 - .../gofrontend/libgo/go/net/main_unix_test.go | 52 - .../libgo/go/net/main_windows_test.go | 36 - .../libgo/go/net/mockserver_test.go | 516 - .../gofrontend/libgo/go/net/net.go | 576 - .../gofrontend/libgo/go/net/net_test.go | 256 - .../libgo/go/net/newpollserver_rtems.go | 78 - .../gofrontend/libgo/go/net/non_unix_test.go | 11 - .../gofrontend/libgo/go/net/nss.go | 159 - .../gofrontend/libgo/go/net/nss_test.go | 169 - .../libgo/go/net/packetconn_test.go | 153 - .../gofrontend/libgo/go/net/parse.go | 386 - .../gofrontend/libgo/go/net/parse_test.go | 79 - .../gofrontend/libgo/go/net/pipe.go | 67 - .../gofrontend/libgo/go/net/pipe_test.go | 55 - .../gofrontend/libgo/go/net/platform_test.go | 159 - .../gofrontend/libgo/go/net/port.go | 24 - .../gofrontend/libgo/go/net/port_test.go | 57 - .../gofrontend/libgo/go/net/port_unix.go | 73 - .../gofrontend/libgo/go/net/protoconn_test.go | 350 - .../gofrontend/libgo/go/net/race.go | 31 - .../gofrontend/libgo/go/net/race0.go | 26 - .../gofrontend/libgo/go/net/rpc/client.go | 317 - .../libgo/go/net/rpc/client_test.go | 91 - .../gofrontend/libgo/go/net/rpc/debug.go | 93 - .../libgo/go/net/rpc/jsonrpc/all_test.go | 296 - .../libgo/go/net/rpc/jsonrpc/client.go | 123 - .../libgo/go/net/rpc/jsonrpc/server.go | 134 - .../gofrontend/libgo/go/net/rpc/server.go | 710 - .../libgo/go/net/rpc/server_test.go | 683 - .../libgo/go/net/sendfile_dragonfly.go | 106 - .../libgo/go/net/sendfile_freebsd.go | 106 - .../gofrontend/libgo/go/net/sendfile_linux.go | 79 - .../libgo/go/net/sendfile_solaris.go | 110 - .../gofrontend/libgo/go/net/sendfile_stub.go | 13 - .../libgo/go/net/sendfile_windows.go | 55 - .../gofrontend/libgo/go/net/server_test.go | 388 - .../gofrontend/libgo/go/net/smtp/auth.go | 107 - .../gofrontend/libgo/go/net/smtp/smtp.go | 384 - .../gofrontend/libgo/go/net/smtp/smtp_test.go | 738 - .../gofrontend/libgo/go/net/sock_bsd.go | 37 - .../gofrontend/libgo/go/net/sock_cloexec.go | 87 - .../gofrontend/libgo/go/net/sock_linux.go | 31 - .../gofrontend/libgo/go/net/sock_plan9.go | 10 - .../gofrontend/libgo/go/net/sock_posix.go | 214 - .../gofrontend/libgo/go/net/sock_stub.go | 15 - .../gofrontend/libgo/go/net/sock_windows.go | 30 - .../gofrontend/libgo/go/net/sockopt_bsd.go | 57 - .../gofrontend/libgo/go/net/sockopt_linux.go | 32 - .../gofrontend/libgo/go/net/sockopt_plan9.go | 13 - .../gofrontend/libgo/go/net/sockopt_posix.go | 141 - .../libgo/go/net/sockopt_solaris.go | 32 - .../gofrontend/libgo/go/net/sockopt_stub.go | 37 - .../libgo/go/net/sockopt_windows.go | 38 - .../gofrontend/libgo/go/net/sockoptip_bsd.go | 34 - .../libgo/go/net/sockoptip_linux.go | 31 - .../libgo/go/net/sockoptip_posix.go | 57 - .../gofrontend/libgo/go/net/sockoptip_stub.go | 39 - .../libgo/go/net/sockoptip_windows.go | 33 - .../gofrontend/libgo/go/net/sys_cloexec.go | 57 - .../gofrontend/libgo/go/net/tcp_test.go | 587 - .../gofrontend/libgo/go/net/tcpsock.go | 61 - .../gofrontend/libgo/go/net/tcpsock_plan9.go | 231 - .../gofrontend/libgo/go/net/tcpsock_posix.go | 334 - .../libgo/go/net/tcpsockopt_darwin.go | 29 - .../libgo/go/net/tcpsockopt_dragonfly.go | 26 - .../libgo/go/net/tcpsockopt_openbsd.go | 16 - .../libgo/go/net/tcpsockopt_plan9.go | 19 - .../libgo/go/net/tcpsockopt_posix.go | 20 - .../libgo/go/net/tcpsockopt_solaris.go | 27 - .../libgo/go/net/tcpsockopt_stub.go | 20 - .../libgo/go/net/tcpsockopt_unix.go | 27 - .../libgo/go/net/tcpsockopt_windows.go | 32 - .../libgo/go/net/testdata/domain-resolv.conf | 5 - .../libgo/go/net/testdata/empty-resolv.conf | 1 - .../gofrontend/libgo/go/net/testdata/hosts | 12 - .../gofrontend/libgo/go/net/testdata/igmp | 24 - .../gofrontend/libgo/go/net/testdata/igmp6 | 18 - .../libgo/go/net/testdata/ipv4-hosts | 12 - .../libgo/go/net/testdata/ipv6-hosts | 11 - .../libgo/go/net/testdata/openbsd-resolv.conf | 5 - .../libgo/go/net/testdata/resolv.conf | 8 - .../libgo/go/net/testdata/search-resolv.conf | 5 - .../libgo/go/net/testdata/singleline-hosts | 1 - .../libgo/go/net/textproto/header.go | 43 - .../libgo/go/net/textproto/pipeline.go | 117 - .../libgo/go/net/textproto/reader.go | 674 - .../libgo/go/net/textproto/reader_test.go | 350 - .../libgo/go/net/textproto/textproto.go | 154 - .../libgo/go/net/textproto/writer.go | 118 - .../libgo/go/net/textproto/writer_test.go | 35 - .../gofrontend/libgo/go/net/timeout_test.go | 1010 - .../gofrontend/libgo/go/net/udp_test.go | 364 - .../gofrontend/libgo/go/net/udpsock.go | 61 - .../gofrontend/libgo/go/net/udpsock_plan9.go | 215 - .../gofrontend/libgo/go/net/udpsock_posix.go | 289 - .../gofrontend/libgo/go/net/unix_test.go | 431 - .../gofrontend/libgo/go/net/unixsock.go | 47 - .../gofrontend/libgo/go/net/unixsock_plan9.go | 147 - .../gofrontend/libgo/go/net/unixsock_posix.go | 398 - .../gofrontend/libgo/go/net/url/url.go | 869 - .../gofrontend/libgo/go/net/url/url_test.go | 1231 - .../libgo/go/old/regexp/all_test.go | 421 - .../libgo/go/old/regexp/find_test.go | 472 - .../gofrontend/libgo/go/old/regexp/regexp.go | 1488 -- .../gofrontend/libgo/go/old/template/doc.go | 91 - .../libgo/go/old/template/execute.go | 346 - .../libgo/go/old/template/format.go | 77 - .../gofrontend/libgo/go/old/template/parse.go | 742 - .../libgo/go/old/template/template_test.go | 810 - .../third_party/gofrontend/libgo/go/os/dir.go | 102 - .../gofrontend/libgo/go/os/dir_largefile.go | 13 - .../gofrontend/libgo/go/os/dir_plan9.go | 73 - .../gofrontend/libgo/go/os/dir_regfile.go | 13 - .../gofrontend/libgo/go/os/dir_unix.go | 58 - .../third_party/gofrontend/libgo/go/os/doc.go | 135 - .../third_party/gofrontend/libgo/go/os/env.go | 117 - .../gofrontend/libgo/go/os/env_test.go | 113 - .../gofrontend/libgo/go/os/env_unix_test.go | 30 - .../gofrontend/libgo/go/os/error.go | 65 - .../gofrontend/libgo/go/os/error_plan9.go | 54 - .../gofrontend/libgo/go/os/error_test.go | 132 - .../gofrontend/libgo/go/os/error_unix.go | 45 - .../gofrontend/libgo/go/os/error_windows.go | 45 - .../gofrontend/libgo/go/os/exec.go | 70 - .../gofrontend/libgo/go/os/exec/exec.go | 516 - .../gofrontend/libgo/go/os/exec/exec_posix.go | 24 - .../gofrontend/libgo/go/os/exec/exec_test.go | 822 - .../gofrontend/libgo/go/os/exec/lp_plan9.go | 53 - .../gofrontend/libgo/go/os/exec/lp_test.go | 33 - .../gofrontend/libgo/go/os/exec/lp_unix.go | 60 - .../libgo/go/os/exec/lp_unix_test.go | 55 - .../gofrontend/libgo/go/os/exec/lp_windows.go | 123 - .../gofrontend/libgo/go/os/exec_plan9.go | 137 - .../gofrontend/libgo/go/os/exec_posix.go | 107 - .../gofrontend/libgo/go/os/exec_unix.go | 81 - .../gofrontend/libgo/go/os/exec_windows.go | 122 - .../gofrontend/libgo/go/os/export_test.go | 10 - .../gofrontend/libgo/go/os/file.go | 274 - .../gofrontend/libgo/go/os/file_plan9.go | 469 - .../gofrontend/libgo/go/os/file_posix.go | 141 - .../gofrontend/libgo/go/os/file_unix.go | 370 - .../gofrontend/libgo/go/os/getwd.go | 123 - .../gofrontend/libgo/go/os/getwd_darwin.go | 15 - .../gofrontend/libgo/go/os/os_test.go | 1709 -- .../gofrontend/libgo/go/os/os_unix_test.go | 186 - .../gofrontend/libgo/go/os/path.go | 131 - .../gofrontend/libgo/go/os/path_plan9.go | 15 - .../gofrontend/libgo/go/os/path_test.go | 228 - .../gofrontend/libgo/go/os/path_unix.go | 17 - .../gofrontend/libgo/go/os/path_windows.go | 16 - .../gofrontend/libgo/go/os/pipe_bsd.go | 28 - .../gofrontend/libgo/go/os/pipe_linux.go | 33 - .../gofrontend/libgo/go/os/proc.go | 57 - .../gofrontend/libgo/go/os/signal/signal.go | 182 - .../libgo/go/os/signal/signal_plan9.go | 60 - .../libgo/go/os/signal/signal_plan9_test.go | 181 - .../libgo/go/os/signal/signal_test.go | 274 - .../libgo/go/os/signal/signal_unix.go | 58 - .../gofrontend/libgo/go/os/stat.go | 56 - .../gofrontend/libgo/go/os/stat_atim.go | 61 - .../gofrontend/libgo/go/os/stat_atimespec.go | 61 - .../gofrontend/libgo/go/os/stat_dragonfly.go | 61 - .../gofrontend/libgo/go/os/stat_nacl.go | 62 - .../gofrontend/libgo/go/os/stat_plan9.go | 112 - .../gofrontend/libgo/go/os/stat_solaris.go | 61 - .../gofrontend/libgo/go/os/sticky_bsd.go | 11 - .../gofrontend/libgo/go/os/sticky_notbsd.go | 14 - .../third_party/gofrontend/libgo/go/os/str.go | 33 - .../gofrontend/libgo/go/os/sys_bsd.go | 20 - .../gofrontend/libgo/go/os/sys_darwin.go | 31 - .../gofrontend/libgo/go/os/sys_freebsd.go | 23 - .../gofrontend/libgo/go/os/sys_linux.go | 26 - .../gofrontend/libgo/go/os/sys_nacl.go | 9 - .../gofrontend/libgo/go/os/sys_plan9.go | 26 - .../gofrontend/libgo/go/os/sys_uname.go | 25 - .../gofrontend/libgo/go/os/sys_unix.go | 11 - .../gofrontend/libgo/go/os/types.go | 118 - .../gofrontend/libgo/go/os/types_notwin.go | 25 - .../gofrontend/libgo/go/os/types_windows.go | 107 - .../libgo/go/os/user/decls_solaris.go | 18 - .../gofrontend/libgo/go/os/user/decls_unix.go | 18 - .../gofrontend/libgo/go/os/user/lookup.go | 22 - .../libgo/go/os/user/lookup_plan9.go | 46 - .../libgo/go/os/user/lookup_stubs.go | 28 - .../libgo/go/os/user/lookup_unix.go | 115 - .../libgo/go/os/user/lookup_windows.go | 149 - .../gofrontend/libgo/go/os/user/user.go | 43 - .../gofrontend/libgo/go/os/user/user_test.go | 89 - .../gofrontend/libgo/go/path/example_test.go | 67 - .../go/path/filepath/example_unix_test.go | 67 - .../libgo/go/path/filepath/export_test.go | 7 - .../libgo/go/path/filepath/match.go | 309 - .../libgo/go/path/filepath/match_test.go | 212 - .../gofrontend/libgo/go/path/filepath/path.go | 466 - .../libgo/go/path/filepath/path_plan9.go | 44 - .../libgo/go/path/filepath/path_test.go | 1106 - .../libgo/go/path/filepath/path_unix.go | 46 - .../libgo/go/path/filepath/path_windows.go | 147 - .../libgo/go/path/filepath/symlink.go | 72 - .../libgo/go/path/filepath/symlink_unix.go | 7 - .../libgo/go/path/filepath/symlink_windows.go | 71 - .../gofrontend/libgo/go/path/match.go | 209 - .../gofrontend/libgo/go/path/match_test.go | 79 - .../gofrontend/libgo/go/path/path.go | 210 - .../gofrontend/libgo/go/path/path_test.go | 244 - .../gofrontend/libgo/go/reflect/all_test.go | 4788 ---- .../gofrontend/libgo/go/reflect/deepequal.go | 145 - .../libgo/go/reflect/example_test.go | 81 - .../libgo/go/reflect/export_test.go | 43 - .../gofrontend/libgo/go/reflect/makefunc.go | 154 - .../libgo/go/reflect/makefunc_ffi.go | 63 - .../libgo/go/reflect/makefunc_ffi_c.c | 93 - .../gofrontend/libgo/go/reflect/set_test.go | 211 - .../libgo/go/reflect/tostring_test.go | 95 - .../gofrontend/libgo/go/reflect/type.go | 2175 -- .../gofrontend/libgo/go/reflect/value.go | 2380 -- .../gofrontend/libgo/go/regexp/all_test.go | 667 - .../gofrontend/libgo/go/regexp/backtrack.go | 366 - .../gofrontend/libgo/go/regexp/exec.go | 468 - .../gofrontend/libgo/go/regexp/exec2_test.go | 20 - .../gofrontend/libgo/go/regexp/exec_test.go | 727 - .../gofrontend/libgo/go/regexp/find_test.go | 498 - .../gofrontend/libgo/go/regexp/onepass.go | 581 - .../libgo/go/regexp/onepass_test.go | 208 - .../gofrontend/libgo/go/regexp/regexp.go | 1120 - .../libgo/go/regexp/syntax/compile.go | 289 - .../gofrontend/libgo/go/regexp/syntax/doc.go | 131 - .../libgo/go/regexp/syntax/parse.go | 1902 -- .../libgo/go/regexp/syntax/parse_test.go | 572 - .../libgo/go/regexp/syntax/perl_groups.go | 134 - .../gofrontend/libgo/go/regexp/syntax/prog.go | 345 - .../libgo/go/regexp/syntax/prog_test.go | 114 - .../libgo/go/regexp/syntax/regexp.go | 319 - .../libgo/go/regexp/syntax/simplify.go | 151 - .../libgo/go/regexp/syntax/simplify_test.go | 151 - .../libgo/go/regexp/testdata/README | 24 - .../libgo/go/regexp/testdata/basic.dat | 221 - .../libgo/go/regexp/testdata/nullsubexpr.dat | 79 - .../go/regexp/testdata/re2-exhaustive.txt.bz2 | Bin 394016 -> 0 bytes .../libgo/go/regexp/testdata/re2-search.txt | 3667 --- .../libgo/go/regexp/testdata/repetition.dat | 163 - .../libgo/go/regexp/testdata/testregex.c | 2286 -- .../libgo/go/runtime/append_test.go | 190 - .../gofrontend/libgo/go/runtime/chan_test.go | 927 - .../libgo/go/runtime/chanbarrier_test.go | 83 - .../libgo/go/runtime/closure_test.go | 53 - .../gofrontend/libgo/go/runtime/compiler.go | 13 - .../libgo/go/runtime/complex_test.go | 67 - .../libgo/go/runtime/crash_cgo_test.go | 481 - .../gofrontend/libgo/go/runtime/crash_test.go | 589 - .../libgo/go/runtime/crash_unix_test.go | 135 - .../gofrontend/libgo/go/runtime/debug.go | 179 - .../libgo/go/runtime/debug/garbage.go | 153 - .../libgo/go/runtime/debug/garbage_test.go | 106 - .../libgo/go/runtime/debug/heapdump_test.go | 69 - .../libgo/go/runtime/debug/stack.go | 98 - .../libgo/go/runtime/debug/stack_test.go | 62 - .../gofrontend/libgo/go/runtime/env_test.go | 47 - .../gofrontend/libgo/go/runtime/error.go | 156 - .../libgo/go/runtime/export_arm_test.go | 9 - .../libgo/go/runtime/export_linux_test.go | 9 - .../libgo/go/runtime/export_test.go | 174 - .../libgo/go/runtime/export_windows_test.go | 9 - .../gofrontend/libgo/go/runtime/extern.go | 258 - .../gofrontend/libgo/go/runtime/gc_test.go | 491 - .../libgo/go/runtime/gcinfo_test.go | 188 - .../gofrontend/libgo/go/runtime/iface_test.go | 263 - .../libgo/go/runtime/lfstack_test.go | 140 - .../libgo/go/runtime/malloc_test.go | 213 - .../gofrontend/libgo/go/runtime/map_test.go | 625 - .../libgo/go/runtime/mapspeed_test.go | 328 - .../gofrontend/libgo/go/runtime/mem.go | 77 - .../libgo/go/runtime/mfinal_test.go | 257 - .../libgo/go/runtime/norace_test.go | 46 - .../libgo/go/runtime/parfor_test.go | 128 - .../libgo/go/runtime/pprof/mprof_test.go | 101 - .../libgo/go/runtime/pprof/pprof.go | 690 - .../libgo/go/runtime/pprof/pprof_test.go | 484 - .../gofrontend/libgo/go/runtime/proc_test.go | 616 - .../libgo/go/runtime/runtime_test.go | 305 - .../libgo/go/runtime/runtime_unix_test.go | 56 - .../libgo/go/runtime/string_test.go | 240 - .../libgo/go/runtime/symtab_test.go | 158 - .../gofrontend/libgo/go/runtime/vlrt.go | 258 - .../libgo/go/sort/example_interface_test.go | 44 - .../libgo/go/sort/example_keys_test.go | 96 - .../libgo/go/sort/example_multi_test.go | 131 - .../gofrontend/libgo/go/sort/example_test.go | 24 - .../libgo/go/sort/example_wrapper_test.go | 77 - .../gofrontend/libgo/go/sort/export_test.go | 9 - .../gofrontend/libgo/go/sort/search.go | 112 - .../gofrontend/libgo/go/sort/search_test.go | 162 - .../gofrontend/libgo/go/sort/sort.go | 514 - .../gofrontend/libgo/go/sort/sort_test.go | 553 - .../gofrontend/libgo/go/strconv/atob.go | 35 - .../gofrontend/libgo/go/strconv/atob_test.go | 91 - .../gofrontend/libgo/go/strconv/atof.go | 544 - .../gofrontend/libgo/go/strconv/atof_test.go | 430 - .../gofrontend/libgo/go/strconv/atoi.go | 202 - .../gofrontend/libgo/go/strconv/atoi_test.go | 363 - .../gofrontend/libgo/go/strconv/decimal.go | 413 - .../libgo/go/strconv/decimal_test.go | 127 - .../gofrontend/libgo/go/strconv/doc.go | 57 - .../libgo/go/strconv/example_test.go | 338 - .../gofrontend/libgo/go/strconv/extfloat.go | 668 - .../gofrontend/libgo/go/strconv/fp_test.go | 144 - .../gofrontend/libgo/go/strconv/ftoa.go | 455 - .../gofrontend/libgo/go/strconv/ftoa_test.go | 241 - .../libgo/go/strconv/internal_test.go | 19 - .../gofrontend/libgo/go/strconv/isprint.go | 637 - .../gofrontend/libgo/go/strconv/itoa.go | 143 - .../gofrontend/libgo/go/strconv/itoa_test.go | 161 - .../libgo/go/strconv/makeisprint.go | 187 - .../gofrontend/libgo/go/strconv/quote.go | 455 - .../gofrontend/libgo/go/strconv/quote_test.go | 266 - .../libgo/go/strconv/strconv_test.go | 63 - .../libgo/go/strconv/testdata/testfp.txt | 181 - .../gofrontend/libgo/go/strconv/testfp.txt | 181 - .../gofrontend/libgo/go/strings/compare.go | 28 - .../libgo/go/strings/compare_test.go | 98 - .../libgo/go/strings/example_test.go | 225 - .../libgo/go/strings/export_test.go | 45 - .../gofrontend/libgo/go/strings/indexbyte.c | 29 - .../gofrontend/libgo/go/strings/reader.go | 150 - .../libgo/go/strings/reader_test.go | 172 - .../gofrontend/libgo/go/strings/replace.go | 518 - .../libgo/go/strings/replace_test.go | 542 - .../gofrontend/libgo/go/strings/search.go | 124 - .../libgo/go/strings/search_test.go | 90 - .../gofrontend/libgo/go/strings/strings.go | 768 - .../libgo/go/strings/strings_decl.go | 8 - .../libgo/go/strings/strings_test.go | 1250 - .../libgo/go/sync/atomic/64bit_arm.go | 58 - .../gofrontend/libgo/go/sync/atomic/atomic.c | 353 - .../libgo/go/sync/atomic/atomic_test.go | 1448 -- .../gofrontend/libgo/go/sync/atomic/doc.go | 149 - .../gofrontend/libgo/go/sync/atomic/value.go | 85 - .../libgo/go/sync/atomic/value_test.go | 195 - .../gofrontend/libgo/go/sync/cas.c | 17 - .../gofrontend/libgo/go/sync/cond.go | 118 - .../gofrontend/libgo/go/sync/cond_test.go | 255 - .../gofrontend/libgo/go/sync/example_test.go | 59 - .../gofrontend/libgo/go/sync/export_test.go | 11 - .../gofrontend/libgo/go/sync/mutex.go | 126 - .../gofrontend/libgo/go/sync/mutex_test.go | 191 - .../gofrontend/libgo/go/sync/once.go | 46 - .../gofrontend/libgo/go/sync/once_test.go | 68 - .../gofrontend/libgo/go/sync/pool.go | 225 - .../gofrontend/libgo/go/sync/pool_test.go | 164 - .../gofrontend/libgo/go/sync/race.go | 42 - .../gofrontend/libgo/go/sync/race0.go | 34 - .../gofrontend/libgo/go/sync/runtime.go | 47 - .../libgo/go/sync/runtime_sema_test.go | 72 - .../gofrontend/libgo/go/sync/rwmutex.go | 136 - .../gofrontend/libgo/go/sync/rwmutex_test.go | 254 - .../gofrontend/libgo/go/sync/waitgroup.go | 137 - .../libgo/go/sync/waitgroup_test.go | 271 - .../gofrontend/libgo/go/syscall/bpf_bsd.go | 169 - .../libgo/go/syscall/const_plan9.go | 59 - .../gofrontend/libgo/go/syscall/creds_test.go | 119 - .../gofrontend/libgo/go/syscall/dir_plan9.go | 212 - .../gofrontend/libgo/go/syscall/env_plan9.go | 108 - .../gofrontend/libgo/go/syscall/env_unix.go | 149 - .../libgo/go/syscall/env_windows.go | 88 - .../gofrontend/libgo/go/syscall/errno.c | 27 - .../libgo/go/syscall/errors_plan9.go | 48 - .../gofrontend/libgo/go/syscall/errstr.go | 32 - .../libgo/go/syscall/errstr_linux.go | 28 - .../gofrontend/libgo/go/syscall/errstr_nor.go | 41 - .../gofrontend/libgo/go/syscall/exec_bsd.go | 266 - .../gofrontend/libgo/go/syscall/exec_linux.go | 421 - .../libgo/go/syscall/exec_linux_test.go | 111 - .../libgo/go/syscall/exec_solaris_test.go | 37 - .../gofrontend/libgo/go/syscall/exec_stubs.go | 33 - .../gofrontend/libgo/go/syscall/exec_unix.go | 317 - .../libgo/go/syscall/exec_unix_test.go | 215 - .../libgo/go/syscall/exec_windows.go | 337 - .../libgo/go/syscall/export_test.go | 7 - .../libgo/go/syscall/export_unix_test.go | 12 - .../libgo/go/syscall/libcall_bsd.go | 28 - .../libgo/go/syscall/libcall_irix.go | 8 - .../libgo/go/syscall/libcall_linux.go | 411 - .../libgo/go/syscall/libcall_linux_386.go | 13 - .../libgo/go/syscall/libcall_linux_alpha.go | 13 - .../libgo/go/syscall/libcall_linux_amd64.go | 13 - .../libgo/go/syscall/libcall_linux_s390.go | 7 - .../libgo/go/syscall/libcall_linux_s390x.go | 7 - .../libgo/go/syscall/libcall_linux_ustat.go | 11 - .../go/syscall/libcall_linux_utimesnano.go | 29 - .../libgo/go/syscall/libcall_posix.go | 401 - .../go/syscall/libcall_posix_largefile.go | 43 - .../libgo/go/syscall/libcall_posix_regfile.go | 44 - .../go/syscall/libcall_posix_utimesnano.go | 24 - .../libgo/go/syscall/libcall_solaris_386.go | 12 - .../libgo/go/syscall/libcall_solaris_amd64.go | 10 - .../libgo/go/syscall/libcall_solaris_sparc.go | 8 - .../go/syscall/libcall_solaris_sparc64.go | 10 - .../libgo/go/syscall/libcall_support.go | 18 - .../libgo/go/syscall/libcall_uname.go | 8 - .../libgo/go/syscall/libcall_wait4.go | 20 - .../libgo/go/syscall/libcall_waitpid.go | 20 - .../gofrontend/libgo/go/syscall/lsf_linux.go | 78 - .../gofrontend/libgo/go/syscall/mksyscall.awk | 300 - .../libgo/go/syscall/mmap_unix_test.go | 22 - .../libgo/go/syscall/netlink_linux.go | 178 - .../gofrontend/libgo/go/syscall/pwd_plan9.go | 83 - .../gofrontend/libgo/go/syscall/race0.go | 25 - .../gofrontend/libgo/go/syscall/route_bsd.go | 347 - .../libgo/go/syscall/route_bsd_test.go | 225 - .../libgo/go/syscall/route_darwin.go | 67 - .../libgo/go/syscall/route_dragonfly.go | 80 - .../libgo/go/syscall/route_freebsd.go | 102 - .../libgo/go/syscall/route_freebsd_32bit.go | 33 - .../libgo/go/syscall/route_freebsd_64bit.go | 19 - .../libgo/go/syscall/route_ifma_test.go | 74 - .../libgo/go/syscall/route_netbsd.go | 35 - .../libgo/go/syscall/route_noifma_test.go | 63 - .../libgo/go/syscall/route_openbsd.go | 35 - .../libgo/go/syscall/security_windows.go | 376 - .../gofrontend/libgo/go/syscall/signame.c | 39 - .../libgo/go/syscall/sleep_rtems.go | 13 - .../libgo/go/syscall/sleep_select.go | 13 - .../libgo/go/syscall/sockcmsg_linux.go | 36 - .../libgo/go/syscall/sockcmsg_unix.go | 111 - .../gofrontend/libgo/go/syscall/socket.go | 421 - .../gofrontend/libgo/go/syscall/socket_bsd.go | 82 - .../libgo/go/syscall/socket_irix.go | 134 - .../libgo/go/syscall/socket_linux.go | 181 - .../go/syscall/socket_linux_ppc64x_type.go | 14 - .../libgo/go/syscall/socket_linux_type.go | 14 - .../libgo/go/syscall/socket_posix.go | 31 - .../libgo/go/syscall/socket_solaris.go | 69 - .../libgo/go/syscall/socket_xnet.go | 32 - .../gofrontend/libgo/go/syscall/str.go | 24 - .../gofrontend/libgo/go/syscall/syscall.go | 103 - .../libgo/go/syscall/syscall_errno.go | 26 - .../libgo/go/syscall/syscall_linux_386.go | 24 - .../libgo/go/syscall/syscall_linux_alpha.go | 57 - .../libgo/go/syscall/syscall_linux_amd64.go | 25 - .../libgo/go/syscall/syscall_linux_s390.go | 21 - .../libgo/go/syscall/syscall_linux_s390x.go | 21 - .../libgo/go/syscall/syscall_linux_test.go | 140 - .../libgo/go/syscall/syscall_solaris.go | 13 - .../libgo/go/syscall/syscall_stubs.go | 27 - .../libgo/go/syscall/syscall_test.go | 47 - .../libgo/go/syscall/syscall_unix.go | 235 - .../libgo/go/syscall/syscall_unix_test.go | 356 - .../gofrontend/libgo/go/syscall/wait.c | 106 - .../gofrontend/libgo/go/testing/allocs.go | 45 - .../libgo/go/testing/allocs_test.go | 29 - .../gofrontend/libgo/go/testing/benchmark.go | 466 - .../libgo/go/testing/benchmark_test.go | 113 - .../gofrontend/libgo/go/testing/cover.go | 112 - .../gofrontend/libgo/go/testing/example.go | 100 - .../libgo/go/testing/export_test.go | 10 - .../libgo/go/testing/iotest/logger.go | 54 - .../libgo/go/testing/iotest/reader.go | 88 - .../libgo/go/testing/iotest/writer.go | 35 - .../libgo/go/testing/quick/quick.go | 370 - .../libgo/go/testing/quick/quick_test.go | 274 - .../gofrontend/libgo/go/testing/testing.go | 739 - .../libgo/go/testing/testing_test.go | 18 - .../libgo/go/text/scanner/example_test.go | 40 - .../libgo/go/text/scanner/scanner.go | 686 - .../libgo/go/text/scanner/scanner_test.go | 667 - .../libgo/go/text/tabwriter/example_test.go | 38 - .../libgo/go/text/tabwriter/tabwriter.go | 558 - .../libgo/go/text/tabwriter/tabwriter_test.go | 652 - .../gofrontend/libgo/go/text/template/doc.go | 406 - .../gofrontend/libgo/go/text/template/exec.go | 879 - .../libgo/go/text/template/exec_test.go | 1143 - .../libgo/go/text/template/funcs.go | 600 - .../libgo/go/text/template/helper.go | 115 - .../libgo/go/text/template/multi_test.go | 365 - .../libgo/go/text/template/option.go | 74 - .../libgo/go/text/template/parse/lex.go | 558 - .../libgo/go/text/template/parse/lex_test.go | 496 - .../libgo/go/text/template/parse/node.go | 839 - .../libgo/go/text/template/parse/parse.go | 696 - .../go/text/template/parse/parse_test.go | 452 - .../libgo/go/text/template/template.go | 231 - .../go/text/template/testdata/file1.tmpl | 2 - .../go/text/template/testdata/file2.tmpl | 2 - .../go/text/template/testdata/tmpl1.tmpl | 3 - .../go/text/template/testdata/tmpl2.tmpl | 3 - .../gofrontend/libgo/go/time/example_test.go | 270 - .../gofrontend/libgo/go/time/export_test.go | 24 - .../gofrontend/libgo/go/time/format.go | 1261 -- .../gofrontend/libgo/go/time/format_test.go | 520 - .../gofrontend/libgo/go/time/genzabbrs.go | 159 - .../gofrontend/libgo/go/time/internal_test.go | 59 - .../gofrontend/libgo/go/time/sleep.go | 130 - .../gofrontend/libgo/go/time/sleep_test.go | 438 - .../gofrontend/libgo/go/time/sys_plan9.go | 76 - .../gofrontend/libgo/go/time/sys_unix.go | 78 - .../gofrontend/libgo/go/time/sys_windows.go | 73 - .../gofrontend/libgo/go/time/tick.go | 58 - .../gofrontend/libgo/go/time/tick_test.go | 78 - .../gofrontend/libgo/go/time/time.go | 1205 - .../gofrontend/libgo/go/time/time_test.go | 1102 - .../gofrontend/libgo/go/time/zoneinfo.go | 287 - .../libgo/go/time/zoneinfo_abbrs_windows.go | 116 - .../gofrontend/libgo/go/time/zoneinfo_ios.go | 51 - .../libgo/go/time/zoneinfo_plan9.go | 160 - .../gofrontend/libgo/go/time/zoneinfo_read.go | 343 - .../gofrontend/libgo/go/time/zoneinfo_test.go | 66 - .../gofrontend/libgo/go/time/zoneinfo_unix.go | 86 - .../libgo/go/time/zoneinfo_windows.go | 249 - .../gofrontend/libgo/go/unicode/casetables.go | 20 - .../gofrontend/libgo/go/unicode/digit.go | 13 - .../gofrontend/libgo/go/unicode/digit_test.go | 126 - .../gofrontend/libgo/go/unicode/graphic.go | 144 - .../libgo/go/unicode/graphic_test.go | 122 - .../gofrontend/libgo/go/unicode/letter.go | 357 - .../libgo/go/unicode/letter_test.go | 549 - .../libgo/go/unicode/script_test.go | 293 - .../gofrontend/libgo/go/unicode/tables.go | 7207 ------ .../libgo/go/unicode/utf16/export_test.go | 11 - .../libgo/go/unicode/utf16/utf16.go | 108 - .../libgo/go/unicode/utf16/utf16_test.go | 149 - .../libgo/go/unicode/utf8/example_test.go | 196 - .../gofrontend/libgo/go/unicode/utf8/utf8.go | 445 - .../libgo/go/unicode/utf8/utf8_test.go | 444 - llgo/third_party/gofrontend/libgo/godeps.sh | 32 - llgo/third_party/gofrontend/libgo/merge.sh | 201 - .../third_party/gofrontend/libgo/mksysinfo.sh | 1511 -- llgo/third_party/gofrontend/libgo/mvifdiff.sh | 15 - .../gofrontend/libgo/runtime/arch.h | 8 - .../gofrontend/libgo/runtime/array.h | 28 - .../gofrontend/libgo/runtime/chan.goc | 1136 - .../gofrontend/libgo/runtime/chan.h | 75 - .../gofrontend/libgo/runtime/cpuprof.goc | 442 - .../gofrontend/libgo/runtime/defs.h | 12 - .../gofrontend/libgo/runtime/env_posix.c | 45 - .../gofrontend/libgo/runtime/getncpu-bsd.c | 24 - .../gofrontend/libgo/runtime/getncpu-irix.c | 16 - .../gofrontend/libgo/runtime/getncpu-linux.c | 36 - .../gofrontend/libgo/runtime/getncpu-none.c | 12 - .../libgo/runtime/getncpu-solaris.c | 16 - .../gofrontend/libgo/runtime/go-alloc.h | 11 - .../gofrontend/libgo/runtime/go-append.c | 74 - .../libgo/runtime/go-assert-interface.c | 45 - .../gofrontend/libgo/runtime/go-assert.c | 19 - .../gofrontend/libgo/runtime/go-assert.h | 18 - .../gofrontend/libgo/runtime/go-breakpoint.c | 17 - .../libgo/runtime/go-byte-array-to-string.c | 24 - .../gofrontend/libgo/runtime/go-caller.c | 247 - .../gofrontend/libgo/runtime/go-callers.c | 196 - .../libgo/runtime/go-can-convert-interface.c | 78 - .../gofrontend/libgo/runtime/go-cdiv.c | 49 - .../gofrontend/libgo/runtime/go-cgo.c | 253 - .../libgo/runtime/go-check-interface.c | 46 - .../libgo/runtime/go-construct-map.c | 35 - .../libgo/runtime/go-convert-interface.c | 132 - .../gofrontend/libgo/runtime/go-copy.c | 22 - .../gofrontend/libgo/runtime/go-defer.c | 85 - .../gofrontend/libgo/runtime/go-defer.h | 47 - .../libgo/runtime/go-deferred-recover.c | 94 - .../libgo/runtime/go-eface-compare.c | 35 - .../libgo/runtime/go-eface-val-compare.c | 33 - .../gofrontend/libgo/runtime/go-ffi.c | 346 - .../gofrontend/libgo/runtime/go-ffi.h | 16 - .../gofrontend/libgo/runtime/go-fieldtrack.c | 101 - .../gofrontend/libgo/runtime/go-iface.goc | 130 - .../libgo/runtime/go-int-array-to-string.c | 89 - .../libgo/runtime/go-int-to-string.c | 69 - .../libgo/runtime/go-interface-compare.c | 35 - .../runtime/go-interface-eface-compare.c | 34 - .../libgo/runtime/go-interface-val-compare.c | 33 - .../gofrontend/libgo/runtime/go-libmain.c | 114 - .../gofrontend/libgo/runtime/go-main.c | 51 - .../gofrontend/libgo/runtime/go-make-slice.c | 99 - .../gofrontend/libgo/runtime/go-map-delete.c | 61 - .../gofrontend/libgo/runtime/go-map-index.c | 137 - .../gofrontend/libgo/runtime/go-map-len.c | 25 - .../gofrontend/libgo/runtime/go-map-range.c | 103 - .../gofrontend/libgo/runtime/go-matherr.c | 88 - .../gofrontend/libgo/runtime/go-memcmp.c | 13 - .../gofrontend/libgo/runtime/go-nanotime.c | 21 - .../gofrontend/libgo/runtime/go-new-map.c | 142 - .../gofrontend/libgo/runtime/go-new.c | 19 - .../gofrontend/libgo/runtime/go-nosys.c | 450 - .../gofrontend/libgo/runtime/go-now.c | 23 - .../gofrontend/libgo/runtime/go-panic.c | 112 - .../gofrontend/libgo/runtime/go-panic.h | 52 - .../gofrontend/libgo/runtime/go-print.c | 36 - .../gofrontend/libgo/runtime/go-recover.c | 275 - .../libgo/runtime/go-reflect-call.c | 250 - .../gofrontend/libgo/runtime/go-reflect-map.c | 156 - .../gofrontend/libgo/runtime/go-rune.c | 97 - .../libgo/runtime/go-runtime-error.c | 90 - .../gofrontend/libgo/runtime/go-setenv.c | 84 - .../gofrontend/libgo/runtime/go-signal.c | 546 - .../gofrontend/libgo/runtime/go-strcmp.c | 25 - .../libgo/runtime/go-string-to-byte-array.c | 28 - .../libgo/runtime/go-string-to-int-array.c | 56 - .../gofrontend/libgo/runtime/go-string.h | 31 - .../gofrontend/libgo/runtime/go-strplus.c | 30 - .../gofrontend/libgo/runtime/go-strslice.c | 26 - .../gofrontend/libgo/runtime/go-traceback.c | 37 - .../libgo/runtime/go-type-complex.c | 120 - .../gofrontend/libgo/runtime/go-type-eface.c | 62 - .../gofrontend/libgo/runtime/go-type-error.c | 34 - .../gofrontend/libgo/runtime/go-type-float.c | 92 - .../libgo/runtime/go-type-identity.c | 62 - .../libgo/runtime/go-type-interface.c | 62 - .../gofrontend/libgo/runtime/go-type-string.c | 49 - .../gofrontend/libgo/runtime/go-type.h | 362 - .../libgo/runtime/go-typedesc-equal.c | 28 - .../gofrontend/libgo/runtime/go-unsafe-new.c | 25 - .../libgo/runtime/go-unsafe-newarray.c | 25 - .../libgo/runtime/go-unsafe-pointer.c | 111 - .../gofrontend/libgo/runtime/go-unsetenv.c | 54 - .../gofrontend/libgo/runtime/go-unwind.c | 443 - .../gofrontend/libgo/runtime/go-varargs.c | 91 - .../gofrontend/libgo/runtime/goc2c.c | 689 - .../gofrontend/libgo/runtime/heapdump.c | 776 - .../gofrontend/libgo/runtime/interface.h | 57 - .../gofrontend/libgo/runtime/lfstack.goc | 95 - .../gofrontend/libgo/runtime/lock_futex.c | 204 - .../gofrontend/libgo/runtime/lock_sema.c | 281 - .../gofrontend/libgo/runtime/malloc.goc | 992 - .../gofrontend/libgo/runtime/malloc.h | 660 - .../gofrontend/libgo/runtime/map.goc | 72 - .../gofrontend/libgo/runtime/map.h | 87 - .../gofrontend/libgo/runtime/mcache.c | 131 - .../gofrontend/libgo/runtime/mcentral.c | 307 - .../gofrontend/libgo/runtime/mem.c | 230 - .../libgo/runtime/mem_posix_memalign.c | 48 - .../gofrontend/libgo/runtime/mfixalloc.c | 64 - .../gofrontend/libgo/runtime/mgc0.c | 2791 --- .../gofrontend/libgo/runtime/mgc0.h | 87 - .../gofrontend/libgo/runtime/mheap.c | 950 - .../gofrontend/libgo/runtime/mprof.goc | 562 - .../gofrontend/libgo/runtime/msize.c | 175 - .../gofrontend/libgo/runtime/netpoll.goc | 472 - .../gofrontend/libgo/runtime/netpoll_epoll.c | 174 - .../gofrontend/libgo/runtime/netpoll_kqueue.c | 118 - .../gofrontend/libgo/runtime/netpoll_select.c | 256 - .../gofrontend/libgo/runtime/netpoll_stub.c | 26 - .../gofrontend/libgo/runtime/panic.c | 232 - .../gofrontend/libgo/runtime/parfor.c | 201 - .../gofrontend/libgo/runtime/print.c | 372 - .../gofrontend/libgo/runtime/proc.c | 3497 --- .../gofrontend/libgo/runtime/rdebug.goc | 26 - .../gofrontend/libgo/runtime/reflect.goc | 25 - .../libgo/runtime/rtems-task-variable-add.c | 24 - .../gofrontend/libgo/runtime/runtime.c | 420 - .../gofrontend/libgo/runtime/runtime.h | 854 - .../gofrontend/libgo/runtime/runtime1.goc | 96 - .../gofrontend/libgo/runtime/sema.goc | 299 - .../gofrontend/libgo/runtime/signal_unix.c | 183 - .../gofrontend/libgo/runtime/signal_unix.h | 22 - .../gofrontend/libgo/runtime/sigqueue.goc | 172 - .../gofrontend/libgo/runtime/string.goc | 123 - .../gofrontend/libgo/runtime/thread-linux.c | 83 - .../gofrontend/libgo/runtime/thread-sema.c | 148 - .../gofrontend/libgo/runtime/thread.c | 161 - .../gofrontend/libgo/runtime/time.goc | 353 - .../gofrontend/libgo/runtime/yield.c | 56 - .../gofrontend/libgo/testsuite/Makefile.am | 21 - .../gofrontend/libgo/testsuite/Makefile.in | 458 - .../gofrontend/libgo/testsuite/gotest | 664 - llgo/third_party/gofrontend/ltmain.sh | 8636 ------- llgo/third_party/gofrontend/missing | 215 - llgo/third_party/gotools/LICENSE | 27 - .../gotools/go/ast/astutil/enclosing.go | 625 - .../gotools/go/ast/astutil/enclosing_test.go | 195 - .../gotools/go/ast/astutil/imports.go | 356 - .../gotools/go/ast/astutil/imports_test.go | 930 - .../gotools/go/ast/astutil/util.go | 14 - .../gotools/go/buildutil/allpackages.go | 123 - .../gotools/go/buildutil/allpackages_test.go | 32 - .../gotools/go/buildutil/fakecontext.go | 108 - llgo/third_party/gotools/go/buildutil/util.go | 158 - .../gotools/go/buildutil/util_test.go | 41 - .../gotools/go/callgraph/callgraph.go | 123 - .../gotools/go/callgraph/cha/cha.go | 120 - .../gotools/go/callgraph/cha/cha_test.go | 106 - .../gotools/go/callgraph/cha/testdata/func.go | 23 - .../go/callgraph/cha/testdata/iface.go | 65 - .../gotools/go/callgraph/cha/testdata/recv.go | 37 - .../gotools/go/callgraph/rta/rta.go | 459 - .../gotools/go/callgraph/rta/rta_test.go | 134 - .../gotools/go/callgraph/rta/testdata/func.go | 37 - .../go/callgraph/rta/testdata/iface.go | 79 - .../go/callgraph/rta/testdata/rtype.go | 35 - .../gotools/go/callgraph/static/static.go | 33 - .../go/callgraph/static/static_test.go | 88 - llgo/third_party/gotools/go/callgraph/util.go | 181 - llgo/third_party/gotools/go/exact/exact.go | 920 - .../gotools/go/exact/exact_test.go | 375 - llgo/third_party/gotools/go/exact/go13.go | 24 - llgo/third_party/gotools/go/exact/go14.go | 13 - .../go/gccgoimporter/gccgoinstallation.go | 95 - .../gccgoimporter/gccgoinstallation_test.go | 194 - .../gotools/go/gccgoimporter/importer.go | 199 - .../gotools/go/gccgoimporter/importer_test.go | 167 - .../gotools/go/gccgoimporter/parser.go | 856 - .../gotools/go/gccgoimporter/parser_test.go | 73 - .../go/gccgoimporter/testdata/complexnums.go | 6 - .../go/gccgoimporter/testdata/complexnums.gox | 8 - .../go/gccgoimporter/testdata/imports.go | 5 - .../go/gccgoimporter/testdata/imports.gox | 7 - .../go/gccgoimporter/testdata/pointer.go | 3 - .../go/gccgoimporter/testdata/pointer.gox | 4 - .../gotools/go/gcimporter/exportdata.go | 108 - .../gotools/go/gcimporter/gcimporter.go | 961 - .../gotools/go/gcimporter/gcimporter_test.go | 216 - .../gotools/go/gcimporter/testdata/exports.go | 89 - .../third_party/gotools/go/importer/export.go | 462 - .../third_party/gotools/go/importer/import.go | 456 - .../gotools/go/importer/import_test.go | 382 - .../gotools/go/importer/predefined.go | 83 - llgo/third_party/gotools/go/loader/cgo.go | 199 - llgo/third_party/gotools/go/loader/loader.go | 1180 - .../gotools/go/loader/loader_test.go | 669 - .../gotools/go/loader/source_test.go | 126 - .../gotools/go/loader/stdlib_test.go | 191 - .../gotools/go/loader/testdata/a.go | 1 - .../gotools/go/loader/testdata/b.go | 1 - .../gotools/go/loader/testdata/badpkgdecl.go | 1 - llgo/third_party/gotools/go/loader/util.go | 116 - llgo/third_party/gotools/go/pointer/TODO | 33 - .../gotools/go/pointer/analysis.go | 447 - llgo/third_party/gotools/go/pointer/api.go | 245 - .../gotools/go/pointer/callgraph.go | 61 - .../gotools/go/pointer/constraint.go | 151 - llgo/third_party/gotools/go/pointer/doc.go | 610 - .../gotools/go/pointer/example_test.go | 125 - llgo/third_party/gotools/go/pointer/gen.go | 1292 -- llgo/third_party/gotools/go/pointer/hvn.go | 969 - .../gotools/go/pointer/intrinsics.go | 380 - llgo/third_party/gotools/go/pointer/labels.go | 152 - llgo/third_party/gotools/go/pointer/opt.go | 125 - .../gotools/go/pointer/pointer_test.go | 581 - llgo/third_party/gotools/go/pointer/print.go | 43 - .../third_party/gotools/go/pointer/reflect.go | 1971 -- llgo/third_party/gotools/go/pointer/solve.go | 371 - .../gotools/go/pointer/stdlib_test.go | 105 - .../gotools/go/pointer/testdata/a_test.go | 42 - .../gotools/go/pointer/testdata/another.go | 36 - .../go/pointer/testdata/arrayreflect.go | 191 - .../gotools/go/pointer/testdata/arrays.go | 97 - .../gotools/go/pointer/testdata/channels.go | 118 - .../go/pointer/testdata/chanreflect.go | 85 - .../go/pointer/testdata/chanreflect1.go | 35 - .../gotools/go/pointer/testdata/context.go | 48 - .../gotools/go/pointer/testdata/conv.go | 63 - .../gotools/go/pointer/testdata/finalizer.go | 89 - .../gotools/go/pointer/testdata/flow.go | 63 - .../gotools/go/pointer/testdata/fmtexcerpt.go | 42 - .../gotools/go/pointer/testdata/func.go | 205 - .../go/pointer/testdata/funcreflect.go | 130 - .../gotools/go/pointer/testdata/hello.go | 27 - .../gotools/go/pointer/testdata/interfaces.go | 152 - .../gotools/go/pointer/testdata/issue9002.go | 17 - .../gotools/go/pointer/testdata/mapreflect.go | 117 - .../gotools/go/pointer/testdata/maps.go | 51 - .../gotools/go/pointer/testdata/panic.go | 36 - .../gotools/go/pointer/testdata/recur.go | 11 - .../gotools/go/pointer/testdata/reflect.go | 115 - .../gotools/go/pointer/testdata/rtti.go | 29 - .../go/pointer/testdata/structreflect.go | 45 - .../gotools/go/pointer/testdata/structs.go | 100 - .../gotools/go/pointer/testdata/timer.go | 24 - llgo/third_party/gotools/go/pointer/util.go | 314 - llgo/third_party/gotools/go/ssa/blockopt.go | 187 - llgo/third_party/gotools/go/ssa/builder.go | 2365 -- .../gotools/go/ssa/builder_test.go | 415 - llgo/third_party/gotools/go/ssa/const.go | 168 - llgo/third_party/gotools/go/ssa/create.go | 272 - llgo/third_party/gotools/go/ssa/doc.go | 123 - llgo/third_party/gotools/go/ssa/dom.go | 341 - llgo/third_party/gotools/go/ssa/emit.go | 469 - .../gotools/go/ssa/example_test.go | 110 - llgo/third_party/gotools/go/ssa/func.go | 690 - .../gotools/go/ssa/interp/external.go | 483 - .../gotools/go/ssa/interp/external_darwin.go | 18 - .../gotools/go/ssa/interp/external_freebsd.go | 24 - .../gotools/go/ssa/interp/external_plan9.go | 47 - .../gotools/go/ssa/interp/external_unix.go | 132 - .../gotools/go/ssa/interp/external_windows.go | 44 - .../gotools/go/ssa/interp/interp.go | 750 - .../gotools/go/ssa/interp/interp_test.go | 356 - llgo/third_party/gotools/go/ssa/interp/map.go | 113 - llgo/third_party/gotools/go/ssa/interp/ops.go | 1394 -- .../gotools/go/ssa/interp/reflect.go | 548 - .../gotools/go/ssa/interp/testdata/a_test.go | 17 - .../gotools/go/ssa/interp/testdata/b_test.go | 11 - .../go/ssa/interp/testdata/boundmeth.go | 144 - .../go/ssa/interp/testdata/callstack.go | 52 - .../gotools/go/ssa/interp/testdata/complit.go | 168 - .../go/ssa/interp/testdata/coverage.go | 534 - .../gotools/go/ssa/interp/testdata/defer.go | 53 - .../go/ssa/interp/testdata/fieldprom.go | 114 - .../go/ssa/interp/testdata/ifaceconv.go | 83 - .../go/ssa/interp/testdata/ifaceprom.go | 58 - .../go/ssa/interp/testdata/initorder.go | 67 - .../go/ssa/interp/testdata/methprom.go | 93 - .../go/ssa/interp/testdata/mrvchain.go | 75 - .../gotools/go/ssa/interp/testdata/range.go | 55 - .../gotools/go/ssa/interp/testdata/recover.go | 34 - .../gotools/go/ssa/interp/testdata/reflect.go | 11 - .../gotools/go/ssa/interp/testdata/static.go | 58 - .../gotools/go/ssa/interp/value.go | 497 - llgo/third_party/gotools/go/ssa/lift.go | 599 - llgo/third_party/gotools/go/ssa/lvalue.go | 121 - llgo/third_party/gotools/go/ssa/methods.go | 243 - llgo/third_party/gotools/go/ssa/mode.go | 107 - llgo/third_party/gotools/go/ssa/print.go | 427 - llgo/third_party/gotools/go/ssa/sanity.go | 520 - llgo/third_party/gotools/go/ssa/source.go | 294 - .../third_party/gotools/go/ssa/source_test.go | 276 - llgo/third_party/gotools/go/ssa/ssa.go | 1700 -- .../gotools/go/ssa/ssautil/switch.go | 234 - .../gotools/go/ssa/ssautil/switch_test.go | 70 - .../go/ssa/ssautil/testdata/switches.go | 357 - .../gotools/go/ssa/ssautil/visit.go | 66 - .../third_party/gotools/go/ssa/stdlib_test.go | 130 - .../gotools/go/ssa/testdata/objlookup.go | 160 - .../gotools/go/ssa/testdata/valueforexpr.go | 148 - llgo/third_party/gotools/go/ssa/testmain.go | 296 - .../gotools/go/ssa/testmain_test.go | 122 - llgo/third_party/gotools/go/ssa/util.go | 119 - llgo/third_party/gotools/go/ssa/wrappers.go | 294 - llgo/third_party/gotools/go/types/api.go | 365 - llgo/third_party/gotools/go/types/api_test.go | 936 - .../gotools/go/types/assignments.go | 323 - llgo/third_party/gotools/go/types/builtins.go | 620 - .../gotools/go/types/builtins_test.go | 204 - llgo/third_party/gotools/go/types/call.go | 441 - llgo/third_party/gotools/go/types/check.go | 363 - .../gotools/go/types/check_test.go | 294 - .../gotools/go/types/conversions.go | 146 - llgo/third_party/gotools/go/types/decl.go | 419 - llgo/third_party/gotools/go/types/errors.go | 96 - llgo/third_party/gotools/go/types/eval.go | 95 - .../third_party/gotools/go/types/eval_test.go | 148 - llgo/third_party/gotools/go/types/expr.go | 1483 -- .../gotools/go/types/exprstring.go | 220 - .../gotools/go/types/exprstring_test.go | 94 - llgo/third_party/gotools/go/types/go11.go | 17 - llgo/third_party/gotools/go/types/go12.go | 17 - .../gotools/go/types/hilbert_test.go | 232 - .../third_party/gotools/go/types/initorder.go | 222 - .../gotools/go/types/issues_test.go | 205 - llgo/third_party/gotools/go/types/labels.go | 268 - llgo/third_party/gotools/go/types/lookup.go | 341 - .../third_party/gotools/go/types/methodset.go | 271 - .../gotools/go/types/methodsetcache.go | 69 - llgo/third_party/gotools/go/types/object.go | 340 - llgo/third_party/gotools/go/types/objset.go | 31 - llgo/third_party/gotools/go/types/operand.go | 287 - llgo/third_party/gotools/go/types/ordering.go | 127 - llgo/third_party/gotools/go/types/package.go | 58 - .../gotools/go/types/predicates.go | 309 - llgo/third_party/gotools/go/types/resolver.go | 446 - .../gotools/go/types/resolver_test.go | 187 - llgo/third_party/gotools/go/types/return.go | 185 - llgo/third_party/gotools/go/types/scope.go | 145 - .../third_party/gotools/go/types/selection.go | 143 - .../third_party/gotools/go/types/self_test.go | 101 - llgo/third_party/gotools/go/types/sizes.go | 211 - .../gotools/go/types/stdlib_test.go | 254 - llgo/third_party/gotools/go/types/stmt.go | 732 - .../gotools/go/types/testdata/blank.src | 5 - .../gotools/go/types/testdata/builtins.src | 881 - .../gotools/go/types/testdata/const0.src | 282 - .../gotools/go/types/testdata/const1.src | 314 - .../gotools/go/types/testdata/constdecl.src | 97 - .../gotools/go/types/testdata/conversions.src | 88 - .../gotools/go/types/testdata/cycles.src | 143 - .../gotools/go/types/testdata/cycles1.src | 77 - .../gotools/go/types/testdata/cycles2.src | 118 - .../gotools/go/types/testdata/cycles3.src | 60 - .../gotools/go/types/testdata/cycles4.src | 110 - .../gotools/go/types/testdata/decls0.src | 206 - .../gotools/go/types/testdata/decls1.src | 144 - .../gotools/go/types/testdata/decls2a.src | 111 - .../gotools/go/types/testdata/decls2b.src | 65 - .../gotools/go/types/testdata/decls3.src | 309 - .../gotools/go/types/testdata/errors.src | 55 - .../gotools/go/types/testdata/expr0.src | 168 - .../gotools/go/types/testdata/expr1.src | 7 - .../gotools/go/types/testdata/expr2.src | 247 - .../gotools/go/types/testdata/expr3.src | 534 - .../gotools/go/types/testdata/gotos.src | 560 - .../go/types/testdata/importdecl0a.src | 53 - .../go/types/testdata/importdecl0b.src | 33 - .../go/types/testdata/importdecl1a.src | 11 - .../go/types/testdata/importdecl1b.src | 7 - .../gotools/go/types/testdata/init0.src | 106 - .../gotools/go/types/testdata/init1.src | 97 - .../gotools/go/types/testdata/init2.src | 139 - .../gotools/go/types/testdata/issues.src | 73 - .../gotools/go/types/testdata/labels.src | 207 - .../gotools/go/types/testdata/methodsets.src | 214 - .../gotools/go/types/testdata/shifts.src | 321 - .../gotools/go/types/testdata/stmt0.src | 833 - .../gotools/go/types/testdata/stmt1.src | 165 - .../gotools/go/types/testdata/vardecl.src | 186 - .../gotools/go/types/token_test.go | 47 - llgo/third_party/gotools/go/types/type.go | 452 - .../gotools/go/types/typestring.go | 266 - .../gotools/go/types/typestring_test.go | 158 - .../gotools/go/types/typeutil/example_test.go | 64 - .../gotools/go/types/typeutil/imports.go | 27 - .../gotools/go/types/typeutil/imports_test.go | 75 - .../gotools/go/types/typeutil/map.go | 314 - .../gotools/go/types/typeutil/map_test.go | 174 - .../gotools/go/types/typeutil/ui.go | 38 - llgo/third_party/gotools/go/types/typexpr.go | 721 - llgo/third_party/gotools/go/types/universe.go | 224 - llgo/third_party/gotools/go/vcs/discovery.go | 76 - llgo/third_party/gotools/go/vcs/env.go | 39 - llgo/third_party/gotools/go/vcs/http.go | 80 - llgo/third_party/gotools/go/vcs/vcs.go | 754 - llgo/third_party/gotools/go/vcs/vcs_test.go | 130 - llgo/third_party/liner/COPYING | 21 - llgo/third_party/liner/README.md | 100 - llgo/third_party/liner/bsdinput.go | 39 - llgo/third_party/liner/common.go | 227 - llgo/third_party/liner/fallbackinput.go | 57 - llgo/third_party/liner/input.go | 368 - llgo/third_party/liner/input_darwin.go | 39 - llgo/third_party/liner/input_linux.go | 26 - llgo/third_party/liner/input_test.go | 61 - llgo/third_party/liner/input_windows.go | 321 - llgo/third_party/liner/line.go | 1003 - llgo/third_party/liner/line_test.go | 137 - llgo/third_party/liner/output.go | 75 - llgo/third_party/liner/output_windows.go | 72 - llgo/third_party/liner/prefix_test.go | 37 - llgo/third_party/liner/race_test.go | 44 - llgo/third_party/liner/signal.go | 12 - llgo/third_party/liner/signal_legacy.go | 11 - llgo/third_party/liner/unixmode.go | 37 - llgo/third_party/liner/width.go | 79 - llgo/third_party/liner/width_test.go | 102 - llgo/update_third_party.sh | 135 - llgo/utils/benchcomp/README | 20 - llgo/utils/benchcomp/analyze.R | 15 - llgo/utils/benchcomp/main.go | 172 - parallel-libs/.arcconfig | 4 - parallel-libs/README.rst | 90 - parallel-libs/streamexecutor/README.txt | 1 - 3405 files changed, 746518 deletions(-) delete mode 100644 debuginfo-tests/README.txt delete mode 100644 debuginfo-tests/aggregate-indirect-arg.cpp delete mode 100644 debuginfo-tests/block_var.m delete mode 100644 debuginfo-tests/blocks.m delete mode 100644 debuginfo-tests/ctor.cpp delete mode 100644 debuginfo-tests/dbg-arg.c delete mode 100644 debuginfo-tests/foreach.m delete mode 100644 debuginfo-tests/forward-declare-class.cpp delete mode 100644 debuginfo-tests/llgdb.py delete mode 100644 debuginfo-tests/nested-struct.cpp delete mode 100644 debuginfo-tests/sret.cpp delete mode 100644 debuginfo-tests/static-member-2.cpp delete mode 100644 debuginfo-tests/static-member.cpp delete mode 100644 libclc/.gitignore delete mode 100644 libclc/CREDITS.TXT delete mode 100644 libclc/LICENSE.TXT delete mode 100644 libclc/README.TXT delete mode 100644 libclc/amdgcn-amdhsa/lib/OVERRIDES delete mode 100644 libclc/amdgcn-amdhsa/lib/SOURCES delete mode 100644 libclc/amdgcn-amdhsa/lib/workitem/get_local_size.ll delete mode 100644 libclc/amdgcn/lib/OVERRIDES delete mode 100644 libclc/amdgcn/lib/SOURCES delete mode 100644 libclc/amdgcn/lib/math/ldexp.cl delete mode 100644 libclc/amdgcn/lib/synchronization/barrier_impl.ll delete mode 100644 libclc/amdgcn/lib/workitem/get_group_id.ll delete mode 100644 libclc/amdgcn/lib/workitem/get_local_id.ll delete mode 100644 libclc/amdgpu/lib/OVERRIDES delete mode 100644 libclc/amdgpu/lib/SOURCES delete mode 100644 libclc/amdgpu/lib/atomic/atomic.cl delete mode 100644 libclc/amdgpu/lib/image/get_image_attributes_impl.ll delete mode 100644 libclc/amdgpu/lib/image/get_image_channel_data_type.cl delete mode 100644 libclc/amdgpu/lib/image/get_image_channel_order.cl delete mode 100644 libclc/amdgpu/lib/image/get_image_depth.cl delete mode 100644 libclc/amdgpu/lib/image/get_image_height.cl delete mode 100644 libclc/amdgpu/lib/image/get_image_width.cl delete mode 100644 libclc/amdgpu/lib/image/read_image_impl.ll delete mode 100644 libclc/amdgpu/lib/image/read_imagef.cl delete mode 100644 libclc/amdgpu/lib/image/read_imagei.cl delete mode 100644 libclc/amdgpu/lib/image/read_imageui.cl delete mode 100644 libclc/amdgpu/lib/image/write_image_impl.ll delete mode 100644 libclc/amdgpu/lib/image/write_imagef.cl delete mode 100644 libclc/amdgpu/lib/image/write_imagei.cl delete mode 100644 libclc/amdgpu/lib/image/write_imageui.cl delete mode 100644 libclc/amdgpu/lib/math/nextafter.cl delete mode 100644 libclc/amdgpu/lib/math/sqrt.cl delete mode 100644 libclc/amdgpu/lib/synchronization/barrier.cl delete mode 100644 libclc/amdgpu/lib/workitem/get_global_size.ll delete mode 100644 libclc/amdgpu/lib/workitem/get_local_size.ll delete mode 100644 libclc/amdgpu/lib/workitem/get_num_groups.ll delete mode 100644 libclc/amdgpu/lib/workitem/get_work_dim.ll delete mode 100644 libclc/build/metabuild.py delete mode 100644 libclc/build/ninja_syntax.py delete mode 100755 libclc/compile-test.sh delete mode 100755 libclc/configure.py delete mode 100644 libclc/generic/include/clc/as_type.h delete mode 100644 libclc/generic/include/clc/async/async_work_group_copy.h delete mode 100644 libclc/generic/include/clc/async/async_work_group_copy.inc delete mode 100644 libclc/generic/include/clc/async/async_work_group_strided_copy.h delete mode 100644 libclc/generic/include/clc/async/async_work_group_strided_copy.inc delete mode 100644 libclc/generic/include/clc/async/gentype.inc delete mode 100644 libclc/generic/include/clc/async/prefetch.h delete mode 100644 libclc/generic/include/clc/async/prefetch.inc delete mode 100644 libclc/generic/include/clc/async/wait_group_events.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_add.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_and.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_cmpxchg.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_dec.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_decl.inc delete mode 100644 libclc/generic/include/clc/atomic/atomic_inc.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_max.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_min.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_or.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_sub.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_xchg.h delete mode 100644 libclc/generic/include/clc/atomic/atomic_xor.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h delete mode 100644 libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h delete mode 100644 libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h delete mode 100644 libclc/generic/include/clc/clc.h delete mode 100644 libclc/generic/include/clc/clcfunc.h delete mode 100644 libclc/generic/include/clc/clctypes.h delete mode 100644 libclc/generic/include/clc/clcversion.h delete mode 100644 libclc/generic/include/clc/common/degrees.h delete mode 100644 libclc/generic/include/clc/common/degrees.inc delete mode 100644 libclc/generic/include/clc/common/mix.h delete mode 100644 libclc/generic/include/clc/common/mix.inc delete mode 100644 libclc/generic/include/clc/common/radians.h delete mode 100644 libclc/generic/include/clc/common/radians.inc delete mode 100644 libclc/generic/include/clc/common/sign.h delete mode 100644 libclc/generic/include/clc/common/smoothstep.h delete mode 100644 libclc/generic/include/clc/common/smoothstep.inc delete mode 100644 libclc/generic/include/clc/common/step.h delete mode 100644 libclc/generic/include/clc/common/step.inc delete mode 100644 libclc/generic/include/clc/convert.h delete mode 100644 libclc/generic/include/clc/float/definitions.h delete mode 100644 libclc/generic/include/clc/geometric/cross.h delete mode 100644 libclc/generic/include/clc/geometric/distance.h delete mode 100644 libclc/generic/include/clc/geometric/distance.inc delete mode 100644 libclc/generic/include/clc/geometric/dot.h delete mode 100644 libclc/generic/include/clc/geometric/dot.inc delete mode 100644 libclc/generic/include/clc/geometric/fast_distance.h delete mode 100644 libclc/generic/include/clc/geometric/fast_distance.inc delete mode 100644 libclc/generic/include/clc/geometric/fast_length.h delete mode 100644 libclc/generic/include/clc/geometric/fast_length.inc delete mode 100644 libclc/generic/include/clc/geometric/fast_normalize.h delete mode 100644 libclc/generic/include/clc/geometric/fast_normalize.inc delete mode 100644 libclc/generic/include/clc/geometric/floatn.inc delete mode 100644 libclc/generic/include/clc/geometric/length.h delete mode 100644 libclc/generic/include/clc/geometric/length.inc delete mode 100644 libclc/generic/include/clc/geometric/normalize.h delete mode 100644 libclc/generic/include/clc/geometric/normalize.inc delete mode 100644 libclc/generic/include/clc/image/image.h delete mode 100644 libclc/generic/include/clc/image/image_defines.h delete mode 100644 libclc/generic/include/clc/integer/abs.h delete mode 100644 libclc/generic/include/clc/integer/abs.inc delete mode 100644 libclc/generic/include/clc/integer/abs_diff.h delete mode 100644 libclc/generic/include/clc/integer/abs_diff.inc delete mode 100644 libclc/generic/include/clc/integer/add_sat.h delete mode 100644 libclc/generic/include/clc/integer/add_sat.inc delete mode 100644 libclc/generic/include/clc/integer/clz.h delete mode 100644 libclc/generic/include/clc/integer/clz.inc delete mode 100644 libclc/generic/include/clc/integer/definitions.h delete mode 100644 libclc/generic/include/clc/integer/gentype.inc delete mode 100644 libclc/generic/include/clc/integer/hadd.h delete mode 100644 libclc/generic/include/clc/integer/hadd.inc delete mode 100644 libclc/generic/include/clc/integer/integer-gentype.inc delete mode 100644 libclc/generic/include/clc/integer/mad24.h delete mode 100644 libclc/generic/include/clc/integer/mad24.inc delete mode 100644 libclc/generic/include/clc/integer/mad_hi.h delete mode 100644 libclc/generic/include/clc/integer/mad_sat.h delete mode 100644 libclc/generic/include/clc/integer/mad_sat.inc delete mode 100644 libclc/generic/include/clc/integer/mul24.h delete mode 100644 libclc/generic/include/clc/integer/mul24.inc delete mode 100644 libclc/generic/include/clc/integer/mul_hi.h delete mode 100644 libclc/generic/include/clc/integer/mul_hi.inc delete mode 100644 libclc/generic/include/clc/integer/rhadd.h delete mode 100644 libclc/generic/include/clc/integer/rhadd.inc delete mode 100644 libclc/generic/include/clc/integer/rotate.h delete mode 100644 libclc/generic/include/clc/integer/rotate.inc delete mode 100644 libclc/generic/include/clc/integer/sub_sat.h delete mode 100644 libclc/generic/include/clc/integer/sub_sat.inc delete mode 100644 libclc/generic/include/clc/integer/upsample.h delete mode 100644 libclc/generic/include/clc/math/acos.h delete mode 100644 libclc/generic/include/clc/math/acos.inc delete mode 100644 libclc/generic/include/clc/math/acosh.h delete mode 100644 libclc/generic/include/clc/math/acosh.inc delete mode 100644 libclc/generic/include/clc/math/acospi.h delete mode 100644 libclc/generic/include/clc/math/acospi.inc delete mode 100644 libclc/generic/include/clc/math/asin.h delete mode 100644 libclc/generic/include/clc/math/asin.inc delete mode 100644 libclc/generic/include/clc/math/asinh.h delete mode 100644 libclc/generic/include/clc/math/asinh.inc delete mode 100644 libclc/generic/include/clc/math/asinpi.h delete mode 100644 libclc/generic/include/clc/math/asinpi.inc delete mode 100644 libclc/generic/include/clc/math/atan.h delete mode 100644 libclc/generic/include/clc/math/atan.inc delete mode 100644 libclc/generic/include/clc/math/atan2.h delete mode 100644 libclc/generic/include/clc/math/atan2.inc delete mode 100644 libclc/generic/include/clc/math/atan2pi.h delete mode 100644 libclc/generic/include/clc/math/atan2pi.inc delete mode 100644 libclc/generic/include/clc/math/atanh.h delete mode 100644 libclc/generic/include/clc/math/atanh.inc delete mode 100644 libclc/generic/include/clc/math/atanpi.h delete mode 100644 libclc/generic/include/clc/math/atanpi.inc delete mode 100644 libclc/generic/include/clc/math/binary_decl.inc delete mode 100644 libclc/generic/include/clc/math/binary_intrin.inc delete mode 100644 libclc/generic/include/clc/math/ceil.h delete mode 100644 libclc/generic/include/clc/math/clc_nextafter.h delete mode 100644 libclc/generic/include/clc/math/copysign.h delete mode 100644 libclc/generic/include/clc/math/copysign.inc delete mode 100644 libclc/generic/include/clc/math/cos.h delete mode 100644 libclc/generic/include/clc/math/cos.inc delete mode 100644 libclc/generic/include/clc/math/cospi.h delete mode 100644 libclc/generic/include/clc/math/cospi.inc delete mode 100644 libclc/generic/include/clc/math/erf.h delete mode 100644 libclc/generic/include/clc/math/erfc.h delete mode 100644 libclc/generic/include/clc/math/exp.h delete mode 100644 libclc/generic/include/clc/math/exp10.h delete mode 100644 libclc/generic/include/clc/math/exp2.h delete mode 100644 libclc/generic/include/clc/math/exp2.inc delete mode 100644 libclc/generic/include/clc/math/fabs.h delete mode 100644 libclc/generic/include/clc/math/fdim.h delete mode 100644 libclc/generic/include/clc/math/fdim.inc delete mode 100644 libclc/generic/include/clc/math/floor.h delete mode 100644 libclc/generic/include/clc/math/fma.h delete mode 100644 libclc/generic/include/clc/math/fmax.h delete mode 100644 libclc/generic/include/clc/math/fmin.h delete mode 100644 libclc/generic/include/clc/math/fmod.h delete mode 100644 libclc/generic/include/clc/math/fmod.inc delete mode 100644 libclc/generic/include/clc/math/fract.h delete mode 100644 libclc/generic/include/clc/math/fract.inc delete mode 100644 libclc/generic/include/clc/math/frexp.h delete mode 100644 libclc/generic/include/clc/math/frexp.inc delete mode 100644 libclc/generic/include/clc/math/gentype.inc delete mode 100644 libclc/generic/include/clc/math/half_rsqrt.h delete mode 100644 libclc/generic/include/clc/math/half_sqrt.h delete mode 100644 libclc/generic/include/clc/math/hypot.h delete mode 100644 libclc/generic/include/clc/math/hypot.inc delete mode 100644 libclc/generic/include/clc/math/ilogb.h delete mode 100644 libclc/generic/include/clc/math/ilogb.inc delete mode 100644 libclc/generic/include/clc/math/ldexp.h delete mode 100644 libclc/generic/include/clc/math/ldexp.inc delete mode 100644 libclc/generic/include/clc/math/log.h delete mode 100644 libclc/generic/include/clc/math/log.inc delete mode 100644 libclc/generic/include/clc/math/log10.h delete mode 100644 libclc/generic/include/clc/math/log1p.h delete mode 100644 libclc/generic/include/clc/math/log1p.inc delete mode 100644 libclc/generic/include/clc/math/log2.h delete mode 100644 libclc/generic/include/clc/math/log2.inc delete mode 100644 libclc/generic/include/clc/math/mad.h delete mode 100644 libclc/generic/include/clc/math/mad.inc delete mode 100644 libclc/generic/include/clc/math/modf.h delete mode 100644 libclc/generic/include/clc/math/modf.inc delete mode 100644 libclc/generic/include/clc/math/native_cos.h delete mode 100644 libclc/generic/include/clc/math/native_divide.h delete mode 100644 libclc/generic/include/clc/math/native_exp.h delete mode 100644 libclc/generic/include/clc/math/native_exp10.h delete mode 100644 libclc/generic/include/clc/math/native_exp2.h delete mode 100644 libclc/generic/include/clc/math/native_log.h delete mode 100644 libclc/generic/include/clc/math/native_log.inc delete mode 100644 libclc/generic/include/clc/math/native_log2.h delete mode 100644 libclc/generic/include/clc/math/native_log2.inc delete mode 100644 libclc/generic/include/clc/math/native_powr.h delete mode 100644 libclc/generic/include/clc/math/native_sin.h delete mode 100644 libclc/generic/include/clc/math/native_sqrt.h delete mode 100644 libclc/generic/include/clc/math/nextafter.h delete mode 100644 libclc/generic/include/clc/math/pow.h delete mode 100644 libclc/generic/include/clc/math/pown.h delete mode 100644 libclc/generic/include/clc/math/rint.h delete mode 100644 libclc/generic/include/clc/math/round.h delete mode 100644 libclc/generic/include/clc/math/rsqrt.h delete mode 100644 libclc/generic/include/clc/math/sin.h delete mode 100644 libclc/generic/include/clc/math/sin.inc delete mode 100644 libclc/generic/include/clc/math/sincos.h delete mode 100644 libclc/generic/include/clc/math/sincos.inc delete mode 100644 libclc/generic/include/clc/math/sinpi.h delete mode 100644 libclc/generic/include/clc/math/sinpi.inc delete mode 100644 libclc/generic/include/clc/math/sqrt.h delete mode 100644 libclc/generic/include/clc/math/sqrt.inc delete mode 100644 libclc/generic/include/clc/math/tan.h delete mode 100644 libclc/generic/include/clc/math/tan.inc delete mode 100644 libclc/generic/include/clc/math/tanh.h delete mode 100644 libclc/generic/include/clc/math/tanh.inc delete mode 100644 libclc/generic/include/clc/math/ternary_intrin.inc delete mode 100644 libclc/generic/include/clc/math/trunc.h delete mode 100644 libclc/generic/include/clc/math/unary_decl.inc delete mode 100644 libclc/generic/include/clc/math/unary_intrin.inc delete mode 100644 libclc/generic/include/clc/relational/all.h delete mode 100644 libclc/generic/include/clc/relational/any.h delete mode 100644 libclc/generic/include/clc/relational/binary_decl.inc delete mode 100644 libclc/generic/include/clc/relational/bitselect.h delete mode 100644 libclc/generic/include/clc/relational/bitselect.inc delete mode 100644 libclc/generic/include/clc/relational/floatn.inc delete mode 100644 libclc/generic/include/clc/relational/isequal.h delete mode 100644 libclc/generic/include/clc/relational/isfinite.h delete mode 100644 libclc/generic/include/clc/relational/isgreater.h delete mode 100644 libclc/generic/include/clc/relational/isgreaterequal.h delete mode 100644 libclc/generic/include/clc/relational/isinf.h delete mode 100644 libclc/generic/include/clc/relational/isless.h delete mode 100644 libclc/generic/include/clc/relational/islessequal.h delete mode 100644 libclc/generic/include/clc/relational/islessgreater.h delete mode 100644 libclc/generic/include/clc/relational/isnan.h delete mode 100644 libclc/generic/include/clc/relational/isnormal.h delete mode 100644 libclc/generic/include/clc/relational/isnotequal.h delete mode 100644 libclc/generic/include/clc/relational/isordered.h delete mode 100644 libclc/generic/include/clc/relational/isunordered.h delete mode 100644 libclc/generic/include/clc/relational/select.h delete mode 100644 libclc/generic/include/clc/relational/signbit.h delete mode 100644 libclc/generic/include/clc/relational/unary_decl.inc delete mode 100644 libclc/generic/include/clc/shared/clamp.h delete mode 100644 libclc/generic/include/clc/shared/clamp.inc delete mode 100644 libclc/generic/include/clc/shared/max.h delete mode 100644 libclc/generic/include/clc/shared/max.inc delete mode 100644 libclc/generic/include/clc/shared/min.h delete mode 100644 libclc/generic/include/clc/shared/min.inc delete mode 100644 libclc/generic/include/clc/shared/vload.h delete mode 100644 libclc/generic/include/clc/shared/vstore.h delete mode 100644 libclc/generic/include/clc/synchronization/barrier.h delete mode 100644 libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h delete mode 100644 libclc/generic/include/clc/workitem/get_global_id.h delete mode 100644 libclc/generic/include/clc/workitem/get_global_size.h delete mode 100644 libclc/generic/include/clc/workitem/get_group_id.h delete mode 100644 libclc/generic/include/clc/workitem/get_local_id.h delete mode 100644 libclc/generic/include/clc/workitem/get_local_size.h delete mode 100644 libclc/generic/include/clc/workitem/get_num_groups.h delete mode 100644 libclc/generic/include/clc/workitem/get_work_dim.h delete mode 100644 libclc/generic/include/config.h delete mode 100644 libclc/generic/include/math/clc_ldexp.h delete mode 100644 libclc/generic/include/math/clc_nextafter.h delete mode 100644 libclc/generic/include/math/clc_sqrt.h delete mode 100644 libclc/generic/include/math/clc_sqrt.inc delete mode 100644 libclc/generic/lib/SOURCES delete mode 100644 libclc/generic/lib/async/async_work_group_copy.cl delete mode 100644 libclc/generic/lib/async/async_work_group_copy.inc delete mode 100644 libclc/generic/lib/async/async_work_group_strided_copy.cl delete mode 100644 libclc/generic/lib/async/async_work_group_strided_copy.inc delete mode 100644 libclc/generic/lib/async/prefetch.cl delete mode 100644 libclc/generic/lib/async/prefetch.inc delete mode 100644 libclc/generic/lib/async/wait_group_events.cl delete mode 100644 libclc/generic/lib/atomic/atomic_impl.ll delete mode 100644 libclc/generic/lib/atomic/atomic_xchg.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_xchg.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_and.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_max.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_min.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_or.cl delete mode 100644 libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_xor.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_xchg.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_and.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_max.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_min.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_or.cl delete mode 100644 libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_xor.cl delete mode 100644 libclc/generic/lib/clcmacro.h delete mode 100644 libclc/generic/lib/common/degrees.cl delete mode 100644 libclc/generic/lib/common/mix.cl delete mode 100644 libclc/generic/lib/common/mix.inc delete mode 100644 libclc/generic/lib/common/radians.cl delete mode 100644 libclc/generic/lib/common/sign.cl delete mode 100644 libclc/generic/lib/common/smoothstep.cl delete mode 100644 libclc/generic/lib/common/step.cl delete mode 100644 libclc/generic/lib/gen_convert.py delete mode 100644 libclc/generic/lib/geometric/cross.cl delete mode 100644 libclc/generic/lib/geometric/distance.cl delete mode 100644 libclc/generic/lib/geometric/distance.inc delete mode 100644 libclc/generic/lib/geometric/dot.cl delete mode 100644 libclc/generic/lib/geometric/fast_distance.cl delete mode 100644 libclc/generic/lib/geometric/fast_distance.inc delete mode 100644 libclc/generic/lib/geometric/fast_length.cl delete mode 100644 libclc/generic/lib/geometric/fast_normalize.cl delete mode 100644 libclc/generic/lib/geometric/fast_normalize.inc delete mode 100644 libclc/generic/lib/geometric/length.cl delete mode 100644 libclc/generic/lib/geometric/normalize.cl delete mode 100644 libclc/generic/lib/image/get_image_dim.cl delete mode 100644 libclc/generic/lib/integer/abs.cl delete mode 100644 libclc/generic/lib/integer/abs.inc delete mode 100644 libclc/generic/lib/integer/abs_diff.cl delete mode 100644 libclc/generic/lib/integer/abs_diff.inc delete mode 100644 libclc/generic/lib/integer/add_sat.cl delete mode 100644 libclc/generic/lib/integer/add_sat_if.ll delete mode 100644 libclc/generic/lib/integer/add_sat_impl.ll delete mode 100644 libclc/generic/lib/integer/clz.cl delete mode 100644 libclc/generic/lib/integer/clz_if.ll delete mode 100644 libclc/generic/lib/integer/clz_impl.ll delete mode 100644 libclc/generic/lib/integer/hadd.cl delete mode 100644 libclc/generic/lib/integer/hadd.inc delete mode 100644 libclc/generic/lib/integer/mad24.cl delete mode 100644 libclc/generic/lib/integer/mad24.inc delete mode 100644 libclc/generic/lib/integer/mad_sat.cl delete mode 100644 libclc/generic/lib/integer/mul24.cl delete mode 100644 libclc/generic/lib/integer/mul24.inc delete mode 100644 libclc/generic/lib/integer/mul_hi.cl delete mode 100644 libclc/generic/lib/integer/rhadd.cl delete mode 100644 libclc/generic/lib/integer/rhadd.inc delete mode 100644 libclc/generic/lib/integer/rotate.cl delete mode 100644 libclc/generic/lib/integer/rotate.inc delete mode 100644 libclc/generic/lib/integer/sub_sat.cl delete mode 100644 libclc/generic/lib/integer/sub_sat_if.ll delete mode 100644 libclc/generic/lib/integer/sub_sat_impl.ll delete mode 100644 libclc/generic/lib/integer/upsample.cl delete mode 100644 libclc/generic/lib/math/acos.cl delete mode 100644 libclc/generic/lib/math/acos.inc delete mode 100644 libclc/generic/lib/math/acosh.cl delete mode 100644 libclc/generic/lib/math/acospi.cl delete mode 100644 libclc/generic/lib/math/asin.cl delete mode 100644 libclc/generic/lib/math/asin.inc delete mode 100644 libclc/generic/lib/math/asinh.cl delete mode 100644 libclc/generic/lib/math/asinpi.cl delete mode 100644 libclc/generic/lib/math/atan.cl delete mode 100644 libclc/generic/lib/math/atan2.cl delete mode 100644 libclc/generic/lib/math/atan2pi.cl delete mode 100644 libclc/generic/lib/math/atanh.cl delete mode 100644 libclc/generic/lib/math/atanpi.cl delete mode 100644 libclc/generic/lib/math/binary_impl.inc delete mode 100644 libclc/generic/lib/math/clc_ldexp.cl delete mode 100644 libclc/generic/lib/math/clc_nextafter.cl delete mode 100644 libclc/generic/lib/math/clc_sqrt.cl delete mode 100644 libclc/generic/lib/math/clc_sqrt_impl.inc delete mode 100644 libclc/generic/lib/math/copysign.cl delete mode 100644 libclc/generic/lib/math/cos.cl delete mode 100644 libclc/generic/lib/math/cospi.cl delete mode 100644 libclc/generic/lib/math/ep_log.cl delete mode 100644 libclc/generic/lib/math/ep_log.h delete mode 100644 libclc/generic/lib/math/erf.cl delete mode 100644 libclc/generic/lib/math/erfc.cl delete mode 100644 libclc/generic/lib/math/exp.cl delete mode 100644 libclc/generic/lib/math/exp10.cl delete mode 100644 libclc/generic/lib/math/exp10.inc delete mode 100644 libclc/generic/lib/math/exp2.cl delete mode 100644 libclc/generic/lib/math/exp_helper.cl delete mode 100644 libclc/generic/lib/math/exp_helper.h delete mode 100644 libclc/generic/lib/math/fdim.cl delete mode 100644 libclc/generic/lib/math/fdim.inc delete mode 100644 libclc/generic/lib/math/fmax.cl delete mode 100644 libclc/generic/lib/math/fmax.inc delete mode 100644 libclc/generic/lib/math/fmin.cl delete mode 100644 libclc/generic/lib/math/fmin.inc delete mode 100644 libclc/generic/lib/math/fmod.cl delete mode 100644 libclc/generic/lib/math/fract.cl delete mode 100644 libclc/generic/lib/math/fract.inc delete mode 100644 libclc/generic/lib/math/frexp.cl delete mode 100644 libclc/generic/lib/math/frexp.inc delete mode 100644 libclc/generic/lib/math/half_rsqrt.cl delete mode 100644 libclc/generic/lib/math/half_rsqrt.inc delete mode 100644 libclc/generic/lib/math/half_sqrt.cl delete mode 100644 libclc/generic/lib/math/half_sqrt.inc delete mode 100644 libclc/generic/lib/math/hypot.cl delete mode 100644 libclc/generic/lib/math/hypot.inc delete mode 100644 libclc/generic/lib/math/ilogb.cl delete mode 100644 libclc/generic/lib/math/ldexp.cl delete mode 100644 libclc/generic/lib/math/ldexp.inc delete mode 100644 libclc/generic/lib/math/log.cl delete mode 100644 libclc/generic/lib/math/log10.cl delete mode 100644 libclc/generic/lib/math/log10.inc delete mode 100644 libclc/generic/lib/math/log1p.cl delete mode 100644 libclc/generic/lib/math/log2.cl delete mode 100644 libclc/generic/lib/math/log_base.h delete mode 100644 libclc/generic/lib/math/mad.cl delete mode 100644 libclc/generic/lib/math/mad.inc delete mode 100644 libclc/generic/lib/math/math.h delete mode 100644 libclc/generic/lib/math/modf.cl delete mode 100644 libclc/generic/lib/math/modf.inc delete mode 100644 libclc/generic/lib/math/native_log.cl delete mode 100644 libclc/generic/lib/math/native_log.inc delete mode 100644 libclc/generic/lib/math/native_log2.cl delete mode 100644 libclc/generic/lib/math/native_log2.inc delete mode 100644 libclc/generic/lib/math/nextafter.cl delete mode 100644 libclc/generic/lib/math/pown.cl delete mode 100644 libclc/generic/lib/math/sin.cl delete mode 100644 libclc/generic/lib/math/sincos.cl delete mode 100644 libclc/generic/lib/math/sincos.inc delete mode 100644 libclc/generic/lib/math/sincosD_piby4.h delete mode 100644 libclc/generic/lib/math/sincos_helpers.cl delete mode 100644 libclc/generic/lib/math/sincos_helpers.h delete mode 100644 libclc/generic/lib/math/sincospiF_piby4.h delete mode 100644 libclc/generic/lib/math/sinpi.cl delete mode 100644 libclc/generic/lib/math/sqrt.cl delete mode 100644 libclc/generic/lib/math/tables.cl delete mode 100644 libclc/generic/lib/math/tables.h delete mode 100644 libclc/generic/lib/math/tan.cl delete mode 100644 libclc/generic/lib/math/tan.inc delete mode 100644 libclc/generic/lib/math/tanh.cl delete mode 100644 libclc/generic/lib/relational/all.cl delete mode 100644 libclc/generic/lib/relational/any.cl delete mode 100644 libclc/generic/lib/relational/bitselect.cl delete mode 100644 libclc/generic/lib/relational/bitselect.inc delete mode 100644 libclc/generic/lib/relational/isequal.cl delete mode 100644 libclc/generic/lib/relational/isfinite.cl delete mode 100644 libclc/generic/lib/relational/isgreater.cl delete mode 100644 libclc/generic/lib/relational/isgreaterequal.cl delete mode 100644 libclc/generic/lib/relational/isinf.cl delete mode 100644 libclc/generic/lib/relational/isless.cl delete mode 100644 libclc/generic/lib/relational/islessequal.cl delete mode 100644 libclc/generic/lib/relational/islessgreater.cl delete mode 100644 libclc/generic/lib/relational/isnan.cl delete mode 100644 libclc/generic/lib/relational/isnormal.cl delete mode 100644 libclc/generic/lib/relational/isnotequal.cl delete mode 100644 libclc/generic/lib/relational/isordered.cl delete mode 100644 libclc/generic/lib/relational/isunordered.cl delete mode 100644 libclc/generic/lib/relational/relational.h delete mode 100644 libclc/generic/lib/relational/signbit.cl delete mode 100644 libclc/generic/lib/shared/clamp.cl delete mode 100644 libclc/generic/lib/shared/clamp.inc delete mode 100644 libclc/generic/lib/shared/max.cl delete mode 100644 libclc/generic/lib/shared/max.inc delete mode 100644 libclc/generic/lib/shared/min.cl delete mode 100644 libclc/generic/lib/shared/min.inc delete mode 100644 libclc/generic/lib/shared/vload.cl delete mode 100644 libclc/generic/lib/shared/vstore.cl delete mode 100644 libclc/generic/lib/subnormal_config.cl delete mode 100644 libclc/generic/lib/subnormal_disable.ll delete mode 100644 libclc/generic/lib/subnormal_helper_func.ll delete mode 100644 libclc/generic/lib/subnormal_use_default.ll delete mode 100644 libclc/generic/lib/workitem/get_global_id.cl delete mode 100644 libclc/generic/lib/workitem/get_global_size.cl delete mode 100644 libclc/ptx-nvidiacl/lib/SOURCES delete mode 100644 libclc/ptx-nvidiacl/lib/synchronization/barrier.cl delete mode 100644 libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl delete mode 100644 libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl delete mode 100644 libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl delete mode 100644 libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl delete mode 100644 libclc/ptx/lib/OVERRIDES delete mode 100644 libclc/ptx/lib/SOURCES delete mode 100644 libclc/ptx/lib/integer/add_sat.ll delete mode 100644 libclc/ptx/lib/integer/sub_sat.ll delete mode 100644 libclc/r600/lib/OVERRIDES delete mode 100644 libclc/r600/lib/SOURCES delete mode 100644 libclc/r600/lib/synchronization/barrier_impl.ll delete mode 100644 libclc/r600/lib/workitem/get_group_id.ll delete mode 100644 libclc/r600/lib/workitem/get_local_id.ll delete mode 100644 libclc/test/add_sat.cl delete mode 100644 libclc/test/as_type.cl delete mode 100644 libclc/test/convert.cl delete mode 100644 libclc/test/cos.cl delete mode 100644 libclc/test/cross.cl delete mode 100644 libclc/test/fabs.cl delete mode 100644 libclc/test/get_group_id.cl delete mode 100644 libclc/test/rsqrt.cl delete mode 100644 libclc/test/subsat.cl delete mode 100644 libclc/utils/prepare-builtins.cpp delete mode 100644 libclc/www/index.html delete mode 100644 llgo/.arcconfig delete mode 100644 llgo/CMakeLists.txt delete mode 100644 llgo/LICENSE.TXT delete mode 100644 llgo/README.TXT delete mode 100644 llgo/autoconf/config.sub delete mode 100644 llgo/build/context.go delete mode 100644 llgo/buildslave-config.yaml delete mode 100644 llgo/cmd/cc-wrapper/main.go delete mode 100644 llgo/cmd/cgo/zdefaultcc.go delete mode 100644 llgo/cmd/gllgo/config.h.cmake delete mode 100644 llgo/cmd/gllgo/gllgo.go delete mode 100644 llgo/cmd/go/zdefaultcc.go.in delete mode 100644 llgo/cmd/llgoi/llgoi.go delete mode 100644 llgo/debug/debug.go delete mode 100644 llgo/docs/Makefile.sphinx delete mode 100644 llgo/docs/conf.py delete mode 100644 llgo/docs/index.rst delete mode 100644 llgo/docs/llgoi.rst delete mode 100644 llgo/docs/make.bat delete mode 100644 llgo/driver/parser.go delete mode 100644 llgo/include/dwarf2.h delete mode 100644 llgo/include/filenames.h delete mode 100644 llgo/include/unwind-pe.h delete mode 100644 llgo/irgen/annotations.go delete mode 100644 llgo/irgen/attribute.go delete mode 100644 llgo/irgen/builtins.go delete mode 100644 llgo/irgen/cabi.go delete mode 100644 llgo/irgen/call.go delete mode 100644 llgo/irgen/channels.go delete mode 100644 llgo/irgen/closures.go delete mode 100644 llgo/irgen/compiler.go delete mode 100644 llgo/irgen/errors.go delete mode 100644 llgo/irgen/indirect.go delete mode 100644 llgo/irgen/interfaces.go delete mode 100644 llgo/irgen/maps.go delete mode 100644 llgo/irgen/predicates.go delete mode 100644 llgo/irgen/println.go delete mode 100644 llgo/irgen/runtime.go delete mode 100644 llgo/irgen/slice.go delete mode 100644 llgo/irgen/ssa.go delete mode 100644 llgo/irgen/strings.go delete mode 100644 llgo/irgen/switches.go delete mode 100644 llgo/irgen/targets.go delete mode 100644 llgo/irgen/typemap.go delete mode 100644 llgo/irgen/types.go delete mode 100644 llgo/irgen/utils.go delete mode 100644 llgo/irgen/value.go delete mode 100644 llgo/irgen/version.go delete mode 100644 llgo/libgo-check-failures.diff delete mode 100644 llgo/libgo-noext.diff delete mode 100644 llgo/llgo-go.sh delete mode 100644 llgo/ssaopt/esc.go delete mode 100644 llgo/test/CMakeLists.txt delete mode 100644 llgo/test/debuginfo/emptyname.go delete mode 100644 llgo/test/driver/parse-arguments.go delete mode 100644 llgo/test/execution/Inputs/init2.go delete mode 100644 llgo/test/execution/arrays/compare.go delete mode 100644 llgo/test/execution/arrays/index.go delete mode 100644 llgo/test/execution/arrays/range.go delete mode 100644 llgo/test/execution/arrays/slice.go delete mode 100644 llgo/test/execution/assignment/arrays.go delete mode 100644 llgo/test/execution/assignment/binop.go delete mode 100644 llgo/test/execution/assignment/dereferencing.go delete mode 100644 llgo/test/execution/assignment/multi.go delete mode 100644 llgo/test/execution/assignment/namedresult.go delete mode 100644 llgo/test/execution/branching/goto.go delete mode 100644 llgo/test/execution/branching/labeled.go delete mode 100644 llgo/test/execution/chan/buffered.go delete mode 100644 llgo/test/execution/chan/range.go delete mode 100644 llgo/test/execution/chan/select.go delete mode 100644 llgo/test/execution/chan/self.go delete mode 100644 llgo/test/execution/circulartype.go delete mode 100644 llgo/test/execution/closures/basic.go delete mode 100644 llgo/test/execution/closures/issue176.go delete mode 100644 llgo/test/execution/complex.go delete mode 100644 llgo/test/execution/const.go delete mode 100644 llgo/test/execution/conversions/complex.go delete mode 100644 llgo/test/execution/conversions/float.go delete mode 100644 llgo/test/execution/conversions/int.go delete mode 100644 llgo/test/execution/conversions/sameunderlying.go delete mode 100644 llgo/test/execution/defer.go delete mode 100644 llgo/test/execution/errors/recover.go delete mode 100644 llgo/test/execution/for/branch.go delete mode 100644 llgo/test/execution/fun.go delete mode 100644 llgo/test/execution/functions/compare.go delete mode 100644 llgo/test/execution/functions/multivalue.go delete mode 100644 llgo/test/execution/functions/unreachable.go delete mode 100644 llgo/test/execution/go.go delete mode 100644 llgo/test/execution/if/lazy.go delete mode 100644 llgo/test/execution/init.go delete mode 100644 llgo/test/execution/interfaces/assert.go delete mode 100644 llgo/test/execution/interfaces/basic.go delete mode 100644 llgo/test/execution/interfaces/comparei2i.go delete mode 100644 llgo/test/execution/interfaces/comparei2v.go delete mode 100644 llgo/test/execution/interfaces/e2i_conversion.go delete mode 100644 llgo/test/execution/interfaces/embedded.go delete mode 100644 llgo/test/execution/interfaces/error.go delete mode 100644 llgo/test/execution/interfaces/i2i_conversion.go delete mode 100644 llgo/test/execution/interfaces/import.go delete mode 100644 llgo/test/execution/interfaces/methods.go delete mode 100644 llgo/test/execution/interfaces/static_conversion.go delete mode 100644 llgo/test/execution/interfaces/wordsize.go delete mode 100644 llgo/test/execution/literals/array.go delete mode 100644 llgo/test/execution/literals/func.go delete mode 100644 llgo/test/execution/literals/map.go delete mode 100644 llgo/test/execution/literals/slice.go delete mode 100644 llgo/test/execution/literals/struct.go delete mode 100644 llgo/test/execution/maps/delete.go delete mode 100644 llgo/test/execution/maps/insert.go delete mode 100644 llgo/test/execution/maps/lookup.go delete mode 100644 llgo/test/execution/maps/range.go delete mode 100644 llgo/test/execution/methods/methodvalues.go delete mode 100644 llgo/test/execution/methods/nilrecv.go delete mode 100644 llgo/test/execution/methods/selectors.go delete mode 100644 llgo/test/execution/new.go delete mode 100644 llgo/test/execution/nil.go delete mode 100644 llgo/test/execution/operators/basics.go delete mode 100644 llgo/test/execution/operators/binary_untyped.go delete mode 100644 llgo/test/execution/operators/shifts.go delete mode 100644 llgo/test/execution/slices/append.go delete mode 100644 llgo/test/execution/slices/cap.go delete mode 100644 llgo/test/execution/slices/compare.go delete mode 100644 llgo/test/execution/slices/copy.go delete mode 100644 llgo/test/execution/slices/index.go delete mode 100644 llgo/test/execution/slices/literal.go delete mode 100644 llgo/test/execution/slices/make.go delete mode 100644 llgo/test/execution/slices/sliceexpr.go delete mode 100644 llgo/test/execution/strings/add.go delete mode 100644 llgo/test/execution/strings/bytes.go delete mode 100644 llgo/test/execution/strings/compare.go delete mode 100644 llgo/test/execution/strings/index.go delete mode 100644 llgo/test/execution/strings/range.go delete mode 100644 llgo/test/execution/strings/runetostring.go delete mode 100644 llgo/test/execution/strings/slice.go delete mode 100644 llgo/test/execution/structs/compare.go delete mode 100644 llgo/test/execution/structs/embed.go delete mode 100644 llgo/test/execution/switch/branch.go delete mode 100644 llgo/test/execution/switch/default.go delete mode 100644 llgo/test/execution/switch/empty.go delete mode 100644 llgo/test/execution/switch/scope.go delete mode 100644 llgo/test/execution/switch/strings.go delete mode 100644 llgo/test/execution/switch/type.go delete mode 100644 llgo/test/execution/types/named.go delete mode 100644 llgo/test/execution/types/recursive.go delete mode 100644 llgo/test/execution/unsafe/const_sizeof.go delete mode 100644 llgo/test/execution/unsafe/offsetof.go delete mode 100644 llgo/test/execution/unsafe/pointer.go delete mode 100644 llgo/test/execution/unsafe/sizeof_array.go delete mode 100644 llgo/test/execution/unsafe/sizeof_basic.go delete mode 100644 llgo/test/execution/unsafe/sizeof_struct.go delete mode 100644 llgo/test/execution/var.go delete mode 100644 llgo/test/execution/varargs.go delete mode 100644 llgo/test/gllgo/dead.go delete mode 100644 llgo/test/irgen/Inputs/mangling-synthetic-p.go delete mode 100644 llgo/test/irgen/avoidload.go delete mode 100644 llgo/test/irgen/cabi.go delete mode 100644 llgo/test/irgen/go-panic.go delete mode 100644 llgo/test/irgen/imports.go delete mode 100644 llgo/test/irgen/mangling-dot.go delete mode 100644 llgo/test/irgen/mangling-synthetic.go delete mode 100644 llgo/test/irgen/select.go delete mode 100644 llgo/test/irgen/switch.go delete mode 100644 llgo/test/lit.cfg delete mode 100644 llgo/test/lit.site.cfg.in delete mode 100644 llgo/test/llgoi/Inputs/src/bar/answer.go delete mode 100644 llgo/test/llgoi/Inputs/src/foo/answer.go delete mode 100644 llgo/test/llgoi/Inputs/src/foo_cgo/answer.go delete mode 100644 llgo/test/llgoi/arith.test delete mode 100644 llgo/test/llgoi/import-binary.test delete mode 100644 llgo/test/llgoi/import-source.test delete mode 100644 llgo/test/llgoi/import-source2.test delete mode 100644 llgo/test/llgoi/interfaces.test delete mode 100644 llgo/test/llgoi/maps.test delete mode 100644 llgo/test/llgoi/panic.test delete mode 100644 llgo/test/llgoi/vars.test delete mode 100644 llgo/third_party/gofrontend/LICENSE delete mode 100644 llgo/third_party/gofrontend/config-ml.in delete mode 100755 llgo/third_party/gofrontend/config.guess delete mode 100755 llgo/third_party/gofrontend/config.sub delete mode 100644 llgo/third_party/gofrontend/depcomp delete mode 100644 llgo/third_party/gofrontend/include/dwarf2.def delete mode 100644 llgo/third_party/gofrontend/include/dwarf2.h delete mode 100644 llgo/third_party/gofrontend/include/filenames.h delete mode 100644 llgo/third_party/gofrontend/install-sh delete mode 100644 llgo/third_party/gofrontend/libbacktrace/ChangeLog delete mode 100644 llgo/third_party/gofrontend/libbacktrace/ChangeLog.jit delete mode 100644 llgo/third_party/gofrontend/libbacktrace/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libbacktrace/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libbacktrace/README delete mode 100644 llgo/third_party/gofrontend/libbacktrace/aclocal.m4 delete mode 100644 llgo/third_party/gofrontend/libbacktrace/alloc.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/atomic.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/backtrace-supported.h.in delete mode 100644 llgo/third_party/gofrontend/libbacktrace/backtrace.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/backtrace.h delete mode 100644 llgo/third_party/gofrontend/libbacktrace/btest.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/config.h.in delete mode 100755 llgo/third_party/gofrontend/libbacktrace/configure delete mode 100644 llgo/third_party/gofrontend/libbacktrace/configure.ac delete mode 100644 llgo/third_party/gofrontend/libbacktrace/dwarf.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/elf.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/fileline.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/filetype.awk delete mode 100644 llgo/third_party/gofrontend/libbacktrace/internal.h delete mode 100644 llgo/third_party/gofrontend/libbacktrace/mmap.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/mmapio.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/nounwind.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/posix.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/print.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/read.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/simple.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/sort.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/state.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/stest.c delete mode 100644 llgo/third_party/gofrontend/libbacktrace/unknown.c delete mode 100644 llgo/third_party/gofrontend/libffi/ChangeLog.libffi delete mode 100644 llgo/third_party/gofrontend/libffi/ChangeLog.libgcj delete mode 100644 llgo/third_party/gofrontend/libffi/ChangeLog.v1 delete mode 100644 llgo/third_party/gofrontend/libffi/LICENSE delete mode 100644 llgo/third_party/gofrontend/libffi/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libffi/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libffi/README delete mode 100644 llgo/third_party/gofrontend/libffi/acinclude.m4 delete mode 100644 llgo/third_party/gofrontend/libffi/aclocal.m4 delete mode 100755 llgo/third_party/gofrontend/libffi/configure delete mode 100644 llgo/third_party/gofrontend/libffi/configure.ac delete mode 100644 llgo/third_party/gofrontend/libffi/configure.host delete mode 100644 llgo/third_party/gofrontend/libffi/doc/libffi.texi delete mode 100644 llgo/third_party/gofrontend/libffi/doc/version.texi delete mode 100644 llgo/third_party/gofrontend/libffi/fficonfig.h.in delete mode 100644 llgo/third_party/gofrontend/libffi/generate-darwin-source-and-headers.py delete mode 100644 llgo/third_party/gofrontend/libffi/include/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libffi/include/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libffi/include/ffi.h.in delete mode 100644 llgo/third_party/gofrontend/libffi/include/ffi_cfi.h delete mode 100644 llgo/third_party/gofrontend/libffi/include/ffi_common.h delete mode 100644 llgo/third_party/gofrontend/libffi/libffi.pc.in delete mode 100644 llgo/third_party/gofrontend/libffi/libffi.xcodeproj/project.pbxproj delete mode 100644 llgo/third_party/gofrontend/libffi/libtool-version delete mode 100644 llgo/third_party/gofrontend/libffi/man/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libffi/man/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libffi/man/ffi.3 delete mode 100644 llgo/third_party/gofrontend/libffi/man/ffi_call.3 delete mode 100644 llgo/third_party/gofrontend/libffi/man/ffi_prep_cif.3 delete mode 100644 llgo/third_party/gofrontend/libffi/man/ffi_prep_cif_var.3 delete mode 100644 llgo/third_party/gofrontend/libffi/mdate-sh delete mode 100644 llgo/third_party/gofrontend/libffi/src/aarch64/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/aarch64/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/aarch64/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/aarch64/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/alpha/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/alpha/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/alpha/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/alpha/osf.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/arc/arcompact.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/arc/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/arc/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/arm/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/arm/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/arm/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/arm/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/avr32/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/avr32/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/avr32/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/bfin/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/bfin/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/bfin/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/closures.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/cris/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/cris/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/cris/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/debug.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/dlmalloc.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/frv/eabi.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/frv/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/frv/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/ia64/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/ia64/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/ia64/ia64_flags.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/ia64/unix.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/java_raw_api.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/m32r/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/m32r/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/m32r/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/m68k/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/m68k/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/m68k/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/m88k/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/m88k/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/m88k/obsd.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/metag/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/metag/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/metag/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/microblaze/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/microblaze/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/microblaze/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/mips/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/mips/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/mips/n32.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/mips/o32.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/moxie/eabi.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/moxie/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/moxie/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/nios2/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/nios2/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/nios2/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/or1k/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/or1k/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/or1k/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/pa/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/pa/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/pa/hpux32.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/pa/linux.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/aix.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/aix_closure.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/asm.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/darwin.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/darwin_closure.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffi_darwin.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffi_linux64.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffi_powerpc.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffi_sysv.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/linux64.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/linux64_closure.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/ppc_closure.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/powerpc/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/prep_cif.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/raw_api.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/s390/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/s390/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/s390/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/s390/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh64/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh64/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/sh64/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/ffi64.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/v8.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/sparc/v9.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/tile/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/tile/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/tile/tile.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/types.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/vax/elfbsd.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/vax/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/vax/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/darwin.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/darwin64.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/darwin64_c.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/darwin_c.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/ffi64.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/ffiw64.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/internal.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/internal64.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/unix64.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/x86/win64.S delete mode 100644 llgo/third_party/gofrontend/libffi/src/xtensa/ffi.c delete mode 100644 llgo/third_party/gofrontend/libffi/src/xtensa/ffitarget.h delete mode 100644 llgo/third_party/gofrontend/libffi/src/xtensa/sysv.S delete mode 100644 llgo/third_party/gofrontend/libffi/stamp-h.in delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn0.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn4.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn5.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_fn6.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_loc_fn0.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/closure_simple.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_12byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_16byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_18byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_19byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_1_1byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_20byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_20byte1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_24byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_2byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_3_1byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_3byte1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_3byte2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_4_1byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_4byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_5_1_byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_5byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_64byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_6_1_byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_6byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_7_1_byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_7byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_8byte.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_9byte1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_9byte2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_longdouble_split.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_longdouble_split2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_pointer.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_sint16.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_sint32.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_sint64.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_uint16.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_uint32.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_align_uint64.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_dbls_struct.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_double_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_longdouble_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_many_mixed_args.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_many_mixed_float_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_schar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_sshort.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_sshortchar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_uchar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_ushort.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_multi_ushortchar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_pointer.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_pointer_stack.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_schar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_sint.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_sshort.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_struct_va1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_uchar.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_uchar_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_uint.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_uint_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_ulong_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_ulonglong.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_ushort.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/cls_ushort_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/err_bad_abi.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/err_bad_typedef.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/ffitest.h delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float4.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/float_va.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/huge_struct.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/many.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/many2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/many_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/many_mixed.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/negint.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct10.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct11.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct4.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct5.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct6.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct7.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct8.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/nested_struct9.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/problem1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/promotion.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/pyobjc-tc.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_dbl.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_dbl1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_dbl2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_fl.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_fl1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_fl2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_fl3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_ldl.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_ll.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_ll1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_sc.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_sl.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_uc.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/return_ul.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/stret_large.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/stret_large2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/stret_medium.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/stret_medium2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/strlen.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/strlen2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/strlen3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/strlen4.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct4.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct5.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct6.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct7.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct8.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/struct9.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/testclosure.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/uninitialized.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/va_1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/va_struct1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/va_struct2.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.call/va_struct3.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_align_complex.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_align_complex_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_align_complex_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_align_complex_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_struct.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_struct_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_struct_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_struct_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_va.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_va_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_va_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/cls_complex_va_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_defs_double.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_defs_float.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_defs_longdouble.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_int.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/complex_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/ffitest.h delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/many_complex.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/many_complex_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/many_complex_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/many_complex_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex1.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex1_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex1_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex1_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex2.inc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex2_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex2_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex2_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex_double.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex_float.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.complex/return_complex_longdouble.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.go/aa-direct.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.go/closure1.c delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.go/ffitest.h delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.go/static-chain.h delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.special/ffitestcxx.h delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.special/unwindtest.cc delete mode 100644 llgo/third_party/gofrontend/libffi/testsuite/libffi.special/unwindtest_ffi_call.cc delete mode 100644 llgo/third_party/gofrontend/libgcc/unwind-pe.h delete mode 100644 llgo/third_party/gofrontend/libgo/LICENSE delete mode 100644 llgo/third_party/gofrontend/libgo/MERGE delete mode 100644 llgo/third_party/gofrontend/libgo/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libgo/Makefile.in delete mode 100644 llgo/third_party/gofrontend/libgo/PATENTS delete mode 100644 llgo/third_party/gofrontend/libgo/README delete mode 100644 llgo/third_party/gofrontend/libgo/README.gcc delete mode 100644 llgo/third_party/gofrontend/libgo/VERSION delete mode 100644 llgo/third_party/gofrontend/libgo/aclocal.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config.h.in delete mode 100644 llgo/third_party/gofrontend/libgo/config/README delete mode 100644 llgo/third_party/gofrontend/libgo/config/go.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config/libtool.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config/ltmain.sh delete mode 100644 llgo/third_party/gofrontend/libgo/config/ltoptions.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config/ltsugar.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config/ltversion.m4 delete mode 100644 llgo/third_party/gofrontend/libgo/config/lt~obsolete.m4 delete mode 100755 llgo/third_party/gofrontend/libgo/configure delete mode 100644 llgo/third_party/gofrontend/libgo/configure.ac delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/common.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/stat_atim.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/stat_atimespec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/stat_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/tar_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/gnu.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/hardlink.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/issue10968.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/issue11169.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/neg-size.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/nil-uid.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/pax.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/small.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/small2.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/sparse-formats.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/star.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/ustar.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/v7.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/writer-big-long.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/writer-big.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/writer.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/testdata/xattrs.tar delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/tar/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/register.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/struct.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/crc32-not-streamed.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/dd.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/go-no-datadesc-sig.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/go-with-datadesc-sig.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/gophercolor16x16.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/readme.notzip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/readme.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/symlink.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/test-trailing-junk.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/test.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/unix.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/winxp.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/zip64-2.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/testdata/zip64.zip delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/archive/zip/zip_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/bufio.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/bufio_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/scan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bufio/scan_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/builtin/builtin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/buffer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/buffer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/bytes.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/bytes_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/bytes_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/compare_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/equal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/indexbyte.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/bytes/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/ast.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/gcc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/godefs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/main.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/out.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/cgo/util.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/alldocs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/bootstrap.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/build.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/clean.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/context.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/discovery.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/env.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/fix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/fmt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/generate.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/generate_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/get.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/go11.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/go_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/go_windows_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/help.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/http.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/list.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/main.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/match_test.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/cmd/go/mkdoc.sh delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/note.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/note_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/pkg.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/pkg_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/run.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/cmd/go/script delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/script.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/signal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/signal_notunix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/signal_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/tag_test.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/cmd/go/test.bash delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/cgocover/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/cgocover/p_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/dep_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/example1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/example2_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/generate/test1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/generate/test2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/generate/test3.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/generate/test4.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/bad.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/conflict.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/bad/bad.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/conflict/a.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/conflict/b.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/works/x/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/works/x/x1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/src/wrongplace/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/works.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/importcom/wrongplace.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/easy.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/easysub/easysub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/easysub/main.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/hard.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/sub/sub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/local/sub/sub/subsub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/norunexample/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/norunexample/test_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/rundir/sub/sub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/rundir/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/shadow/root1/src/foo/foo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/shadow/root1/src/math/math.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/shadow/root2/src/foo/foo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badc/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badpkg/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badtest/badexec/x_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badtest/badsyntax/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badtest/badsyntax/x_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badtest/badvar/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/badtest/badvar/x_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/cgotest/m.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/go-cmd-test/helloworld.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/main_test/m.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/main_test/m_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/notest/hello.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/syntaxerror/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/syntaxerror/x_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/p1/p1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/p1/p1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/p2/p2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/p3/p3.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/p3/p3_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/q1/q1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testcycle/q1/q1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testdep/p1/p1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testdep/p1/p1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testdep/p2/p2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/testdep/p3/p3.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/bad.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/good.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/hello/hello.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/hello/hello_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/hello/hellox_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/subdir/bad.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/subdir/good.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/vendor/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/vendor/q/q.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/vendor/strings/msg.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/x/invalid/invalid.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/x/vendor/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/x/vendor/p/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/x/vendor/r/r.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vend/x/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vetpkg/a_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vetpkg/b.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/vetpkg/c.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/xtestonly/f.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/src/xtestonly/f_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/standalone_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testimport/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testimport/p1/p1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testimport/p2/p2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testimport/p_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testimport/x_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal2/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal2/x/y/z/internal/w/w.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal3/t.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal4/src/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal4/src/q/internal/x/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testinternal4/src/q/j/j.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testonly/p_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor/src/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor/src/q/vendor/x/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor/src/q/y/y.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor/src/q/z/z.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor2/src/p/p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testdata/testvendor2/vendor/x/x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testflag.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/testgo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/tool.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/vcs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/vcs_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/vendor_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/version.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/go/vet.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/gofmt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/gofmt_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/long_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/rewrite.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/simplify.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/comments.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/comments.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/composites.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/composites.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/crlf.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/crlf.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/import.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/import.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/old.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/old.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite1.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite2.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite3.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite3.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite4.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite4.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite5.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite5.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite6.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite6.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite7.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite7.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite8.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/rewrite8.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/slices1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/slices1.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/slices2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/slices2.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin1.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin2.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin3.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin3.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin4.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/stdin4.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/typeswitch.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/cmd/gofmt/testdata/typeswitch.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/bit_reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/bzip2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/bzip2_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/huffman.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/move_to_front.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/testdata/Mark.Twain-Tom.Sawyer.txt.bz2 delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/bzip2/testdata/e.txt.bz2 delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/copy.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/copy_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/deflate.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/deflate_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/fixedhuff.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/flate_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/huffman_bit_writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/huffman_code.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/inflate.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/inflate_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/reverse_bits.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/token.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/flate/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/gzip/gunzip.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/gzip/gunzip_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/gzip/gzip.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/gzip/gzip_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/gzip/testdata/issue6550.gz delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/lzw/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/lzw/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/lzw/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/lzw/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/testdata/Mark.Twain-Tom.Sawyer.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/testdata/e.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/testdata/pi.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/zlib/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/zlib/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/zlib/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/compress/zlib/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/heap/heap.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/heap/heap_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/list/list.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/list/list_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/ring/ring.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/container/ring/ring_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/aes_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/cipher.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/cipher_asm.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/cipher_generic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/aes/const.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/benchmark_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cbc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cbc_aes_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cfb.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cfb_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cipher.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/cipher_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/common_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/ctr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/ctr_aes_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/gcm.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/gcm_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/io.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/ofb.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/ofb_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/xor.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/cipher/xor_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/crypto.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/des/block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/des/cipher.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/des/const.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/des/des_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/dsa/dsa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/dsa/dsa_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/ecdsa/ecdsa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/ecdsa/ecdsa_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/elliptic/elliptic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/elliptic/elliptic_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/elliptic/p224.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/elliptic/p224_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/elliptic/p256.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/hmac/hmac.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/hmac/hmac_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/md5.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/md5_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/md5block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/md5block_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/md5/md5block_generic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/eagain.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/rand.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/rand_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/rand_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/rand_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/rand_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/util.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rand/util_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rc4/rc4.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rc4/rc4_asm.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rc4/rc4_ref.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rc4/rc4_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/pkcs1v15.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/pkcs1v15_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/pss.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/pss_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/rsa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/rsa_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/rsa/testdata/pss-vect.txt.bz2 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha1/sha1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha1/sha1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha1/sha1block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha1/sha1block_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha1/sha1block_generic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha256/sha256.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha256/sha256_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha256/sha256block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha256/sha256block_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha512/sha512.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha512/sha512_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha512/sha512block.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/sha512/sha512block_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/subtle/constant_time.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/subtle/constant_time_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/alert.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/cipher_suites.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/common.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/conn.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/conn_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/generate_cert.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_client.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_client_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_messages.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_messages_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_server.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_server_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/handshake_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/key_agreement.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/prf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/prf_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-ECDSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-ECDSA-RSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-ECDSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ClientCert-RSA-RSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-ECDSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-ECDHE-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv10-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-ECDSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv11-ECDHE-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv11-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ALPN-NoMatch delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-ECDSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-ECDSA-RSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-AES256-GCM-SHA384 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-ECDSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ClientCert-RSA-RSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES-GCM delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-ECDSA-AES256-GCM-SHA384 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-ECDHE-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Client-TLSv12-SCT delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-3DES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-SSLv3-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv10-ECDHE-ECDSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-3DES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv10-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv11-FallbackSCSV delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv11-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ALPN-NoMatch delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceECDSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-CipherSuiteCertPreferenceRSA delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndECDSAGiven delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedAndGiven delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ClientAuthRequestedNotGiven delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ECDHE-ECDSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicket delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-IssueTicketPreDisable delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-3DES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES-GCM delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-AES256-GCM-SHA384 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-RSA-RC4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-Resume delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-ResumeDisabled delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificate delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/testdata/Server-TLSv12-SNI-GetCertificateNotFound delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/ticket.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/tls.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/tls/tls_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/cert_pool.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pem_decrypt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pem_decrypt_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pkcs1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pkcs8.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pkcs8_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/pkix/pkix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_cgo_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_darwin_arm_gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_darwin_armx.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_nacl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_nocgo_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/root_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/sec1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/sec1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/sha2_windows_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/verify.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/verify_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/x509.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/x509_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/crypto/x509/x509_test_import.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/convert.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/convert_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/driver/driver.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/driver/types.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/driver/types_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/fakedb_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/sql.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/database/sql/sql_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/buf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/class_string.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/const.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/entry.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/line.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/line_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/open.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/line-clang.elf delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/line-gcc.elf delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/line1.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/line1.h delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/line2.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/typedef.c delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/typedef.elf delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/typedef.elf4 delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/testdata/typedef.macho delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/type_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/typeunit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/dwarf/unit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/elf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/elf_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/file_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/symbols_test.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/gcc-386-freebsd-exec delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/gcc-amd64-linux-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/gcc-amd64-openbsd-debug-with-rela.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-clang-arm.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-clang-x86.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc424-x86-64.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc441-x86-64.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc441-x86.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc482-aarch64.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc482-ppc64le.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc492-arm.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/go-relocation-test-gcc5-ppc.obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/hello-world-core.gz delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/elf/testdata/hello.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/gosym/pclinetest.h delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/gosym/pclinetest.s delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/gosym/pclntab.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/gosym/pclntab_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/gosym/symtab.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/fat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/file_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/macho.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/testdata/fat-gcc-386-amd64-darwin-exec delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/macho/testdata/gcc-386-darwin-exec delete mode 100755 llgo/third_party/gofrontend/libgo/go/debug/macho/testdata/gcc-amd64-darwin-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/testdata/gcc-amd64-darwin-exec-debug delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/macho/testdata/hello.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/file_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/pe.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/testdata/gcc-386-mingw-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/testdata/gcc-386-mingw-obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/testdata/gcc-amd64-mingw-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/testdata/gcc-amd64-mingw-obj delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/pe/testdata/hello.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/file_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/plan9obj.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/testdata/386-plan9-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/testdata/amd64-plan9-exec delete mode 100644 llgo/third_party/gofrontend/libgo/go/debug/plan9obj/testdata/hello.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/ascii85/ascii85.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/ascii85/ascii85_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/asn1/asn1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/asn1/asn1_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/asn1/common.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/asn1/marshal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/asn1/marshal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/base32/base32.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/base32/base32_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/base64/base64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/base64/base64_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/binary/binary.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/binary/binary_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/binary/varint.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/binary/varint_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/csv/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/csv/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/csv/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/csv/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/csv/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/encoding.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/codec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/debug.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/dec_helpers.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/decgen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/decode.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/decoder.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/dump.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/enc_helpers.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/encgen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/encode.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/encoder.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/encoder_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/error.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/gobencdec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/timing_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/gob/type_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/hex/hex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/hex/hex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/bench_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/decode.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/decode_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/encode.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/encode_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/fold.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/fold_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/indent.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/scanner.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/scanner_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/stream.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/stream_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/tagkey_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/tags.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/tags_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/json/testdata/code.json.gz delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/pem/pem.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/pem/pem_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/atom_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/marshal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/marshal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/read.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/read_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/typeinfo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/xml.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/encoding/xml/xml_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/errors/errors.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/errors/errors_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/README delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/direct.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/per_host.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/per_host_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/proxy.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/proxy_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/proxy/socks5.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/terminal/terminal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/terminal/terminal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/exp/terminal/util.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/expvar/expvar.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/expvar/expvar_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/flag/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/flag/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/flag/flag.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/flag/flag_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/fmt_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/norace_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/print.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/race_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/scan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/scan_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/fmt/stringer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/ast.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/ast_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/commentmap.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/commentmap_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/filter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/filter_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/import.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/print.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/print_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/resolve.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/scope.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/ast/walk.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/build.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/build_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/deps_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/read.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/read_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/syslist.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/syslist_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/testdata/empty/dummy delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/testdata/multi/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/testdata/multi/file_appengine.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/testdata/other/file/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/build/testdata/other/main.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/constant/go13.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/constant/go14.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/constant/value.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/constant/value_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/comment.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/comment_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/doc_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/example.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/exports.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/filter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/headscan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/synopsis.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/synopsis_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/a.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/a.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/a.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/a0.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/a1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/b.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/b.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/b.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/b.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/benchmark.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/blank.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/blank.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/blank.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/blank.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/bugpara.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/bugpara.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/bugpara.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/bugpara.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/c.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/c.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/c.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/c.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/d.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/d.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/d.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/d1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/d2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/e.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/e.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/e.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/e.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error1.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error1.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error1.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error2.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error2.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error2.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/error2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/example.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/f.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/f.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/f.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/f.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/template.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/testing.0.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/testing.1.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/testing.2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/doc/testdata/testing.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/format/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/format/format_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/importer/importer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/gccgoinstallation.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/gccgoinstallation_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/importer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/importer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/parser.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/parser_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/testdata/complexnums.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/testdata/imports.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gccgoimporter/testdata/pointer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gcimporter/exportdata.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gcimporter/gcimporter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gcimporter/gcimporter_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/internal/gcimporter/testdata/exports.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/error_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/interface.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/parser.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/parser_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/performance_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/short_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/testdata/commas.src delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/parser/testdata/issue3106.src delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/nodes.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/performance_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/printer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/printer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/comments.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/comments.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/comments.x delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/comments2.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/comments2.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/declarations.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/declarations.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/empty.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/empty.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/expressions.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/expressions.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/expressions.raw delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/linebreaks.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/linebreaks.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/parser.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/slow.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/slow.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/statements.golden delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/printer/testdata/statements.input delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/scanner/errors.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/scanner/scanner.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/scanner/scanner_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/token/position.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/token/position_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/token/serialize.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/token/serialize_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/token/token.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/api.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/api_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/assignments.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/builtins.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/builtins_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/call.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/check.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/check_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/conversions.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/errors.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/eval.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/eval_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/expr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/exprstring.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/exprstring_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/go11.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/go12.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/hilbert_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/initorder.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/issues_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/labels.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/lookup.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/methodset.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/object.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/objset.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/operand.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/ordering.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/package.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/predicates.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/resolver.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/resolver_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/return.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/scope.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/selection.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/self_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/sizes.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/stdlib_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/stmt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/token_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/typestring.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/typestring_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/typexpr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/go/types/universe.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/adler32/adler32.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/adler32/adler32_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc32/crc32.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc32/crc32_amd64x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc32/crc32_generic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc32/crc32_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc32/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc64/crc64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/crc64/crc64_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/fnv/fnv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/fnv/fnv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/hash/hash.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/entity.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/entity_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/escape.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/escape_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/attr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/clone_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/content.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/content_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/context.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/css.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/css_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/error.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/escape.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/escape_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/html.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/html_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/js.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/js_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/template.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/transition.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/transition_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/url.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/html/template/url_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/color.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/palette/gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/palette/generate.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/palette/palette.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/ycbcr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/color/ycbcr_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/decode_example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/decode_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/draw/bench_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/draw/clip_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/draw/draw.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/draw/draw_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/geom.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/geom_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/gif/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/gif/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/gif/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/gif/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/image.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/image_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/internal/imageutil/gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/internal/imageutil/imageutil.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/internal/imageutil/impl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/dct_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/fdct.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/huffman.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/idct.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/scan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/jpeg/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/names.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/paeth.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/paeth_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchGray.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchNRGBA-gradient.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchNRGBA-opaque.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchPaletted.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchRGB-interlace.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/benchRGB.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/gray-gradient.interlaced.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/gray-gradient.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/invalid-crc32.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/invalid-noend.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/invalid-trunc.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/invalid-zlib.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/README delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/README.original delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g01-30.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g01-30.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g01.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g01.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g02-29.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g02-29.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g02.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g02.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g04-31.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g04-31.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g04.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g04.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g08.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g08.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g16.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn0g16.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn2c08.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn2c08.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn2c16.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn2c16.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p01.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p01.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p02.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p02.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p04-31i.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p04-31i.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p04.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p04.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p08-trns.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p08.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn3p08.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn4a08.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn4a08.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn4a16.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn4a16.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn6a08.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn6a08.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn6a16.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/testdata/pngsuite/basn6a16.sng delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/png/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.221212.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.221212.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.5bpp.gif delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.cmyk.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.cmyk.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.gif delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.interlaced.gif delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.410.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.410.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.411.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.411.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.420.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.420.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.422.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.422.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.440.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.440.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.444.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.q50.444.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.rgb.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.rgb.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.separate.dc.progression.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-001.separate.dc.progression.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.gif delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.png delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.q50.2x2.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.q50.2x2.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.q50.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/testdata/video-005.gray.q50.progressive.jpeg delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/ycbcr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/image/ycbcr_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/index/suffixarray/qsufsort.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/index/suffixarray/suffixarray.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/index/suffixarray/suffixarray_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/format/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/singleflight/singleflight.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/singleflight/singleflight_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/unix/dummy.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/unix/getrandom_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/key.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/registry_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/syscall.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/value.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/registry/zsyscall_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/syscall_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/syscall/windows/zsyscall_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/testenv/testenv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/trace/goroutines.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/trace/parser.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/internal/trace/parser_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/io.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/io_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/ioutil/ioutil.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/ioutil/ioutil_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/ioutil/tempfile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/ioutil/tempfile_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/multi.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/multi_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/pipe.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/io/pipe_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/log.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/log_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/syslog.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/syslog_c.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/syslog_libc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/syslog_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/log/syslog/syslog_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/abs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/acosh.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/all_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/asin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/asinh.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/atan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/atan2.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/atanh.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/accuracy_string.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/arith.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/arith_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/arith_decl_pure.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/arith_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/bits_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/calibrate_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/decimal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/decimal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/float.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/float_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/floatconv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/floatconv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/floatexample_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/ftoa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/gcd_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/hilbert_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/int.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/int_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/intconv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/intconv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/nat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/nat_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/natconv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/natconv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/rat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/rat_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/ratconv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/ratconv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/big/roundingmode_string.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/bits.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cbrt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/abs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/asin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/cmath_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/conj.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/exp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/isinf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/isnan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/log.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/phase.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/polar.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/pow.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/rect.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/sin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/sqrt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/cmplx/tan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/const.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/copysign.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/dim.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/erf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/exp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/expm1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/floor.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/frexp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/gamma.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/hypot.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/j0.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/j1.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/jn.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/ldexp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/lgamma.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/log.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/log10.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/log1p.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/logb.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/mod.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/modf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/nextafter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/pow.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/pow10.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/exp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/normal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/rand.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/rand_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/regress_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/rng.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/rand/zipf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/remainder.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/signbit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/sin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/sincos.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/sinh.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/sqrt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/tan.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/tanh.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/math/unsafe.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/encodedword.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/encodedword_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/grammar.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/mediatype.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/mediatype_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/formdata.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/formdata_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/multipart.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/multipart_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/testdata/nested-mime delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/multipart/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/quotedprintable/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/quotedprintable/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/quotedprintable/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/quotedprintable/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/test.types delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/testdata/test.types delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_freebsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_openbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/mime/type_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/addrselect.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/addrselect_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_android.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_netbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_openbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_resnew.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_resold.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_socknew.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_sockold.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/cgo_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/conf.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/conf_netcgo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/conf_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/conn_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dial.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dial_gen.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dial_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsclient.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsclient_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsclient_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsclient_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsconfig_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsconfig_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsmsg.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsmsg_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/dnsname_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/error_plan9_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/error_posix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/error_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/external_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_mutex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_mutex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_poll_nacl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_poll_runtime.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_posix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_select.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/fd_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/file_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hook.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hook_cloexec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hook_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hook_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hook_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hosts.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hosts_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/hosts_testdata delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/child.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/child_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/host.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/host_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/matryoshka_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cgi/posix_test.go delete mode 100755 llgo/third_party/gofrontend/libgo/go/net/http/cgi/testdata/test.cgi delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/client.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/client_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookie.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookie_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookiejar/jar.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookiejar/jar_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookiejar/punycode.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/cookiejar/punycode_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/fcgi/child.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/fcgi/fcgi.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/fcgi/fcgi_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/filetransport.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/filetransport_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/fs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/fs_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/header.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/header_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/http_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httptest/recorder.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httptest/recorder_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httptest/server.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httptest/server_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/dump.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/dump_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/httputil.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/persist.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/reverseproxy.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/httputil/reverseproxy_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/internal/chunked.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/internal/chunked_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/jar.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/lex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/lex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/main_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/npn_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/pprof/pprof.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/proxy_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/race.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/range_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/readrequest_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/request.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/request_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/requestwrite_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/response.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/response_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/responsewrite_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/serve_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/server.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/sniff.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/sniff_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/status.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/testdata/file delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/testdata/index.html delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/testdata/style.css delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/transfer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/transfer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/transport.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/transport_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/http/triv.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_freebsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_netbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_openbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/interface_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/main_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/main_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/main_windows_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/switch.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/switch_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/switch_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/switch_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/switch_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/sys_cloexec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/sys_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/internal/socktest/sys_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ip.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ip_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ipraw_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/iprawsock.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/iprawsock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/iprawsock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ipsock.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ipsock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ipsock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/ipsock_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/listen_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/lookup_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mac.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mac_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mail/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mail/message.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mail/message_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_cloexec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_plan9_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_posix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/main_windows_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/mockserver_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/net.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/net_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/newpollserver_rtems.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/non_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/nss.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/nss_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/packetconn_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/parse.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/parse_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/pipe.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/pipe_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/platform_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/port.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/port_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/port_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/protoconn_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/race.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/race0.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/client.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/client_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/debug.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/jsonrpc/all_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/jsonrpc/client.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/jsonrpc/server.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/server.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/rpc/server_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_freebsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sendfile_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/server_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/smtp/auth.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/smtp/smtp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/smtp/smtp_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_cloexec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sock_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockopt_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockoptip_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockoptip_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockoptip_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockoptip_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sockoptip_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/sys_cloexec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcp_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsock.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_openbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_stub.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/tcpsockopt_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/domain-resolv.conf delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/empty-resolv.conf delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/hosts delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/igmp delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/igmp6 delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/ipv4-hosts delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/ipv6-hosts delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/openbsd-resolv.conf delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/resolv.conf delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/search-resolv.conf delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/testdata/singleline-hosts delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/header.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/pipeline.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/textproto.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/textproto/writer_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/timeout_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/udp_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/udpsock.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/udpsock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/udpsock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/unixsock.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/unixsock_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/unixsock_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/url/url.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/net/url/url_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/regexp/all_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/regexp/find_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/regexp/regexp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/template/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/template/execute.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/template/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/template/parse.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/old/template/template_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/dir.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/dir_largefile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/dir_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/dir_regfile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/dir_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/env.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/env_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/env_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/error.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/error_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/error_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/error_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/error_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/exec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/exec_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/exec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/lp_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/lp_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/lp_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/lp_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec/lp_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/exec_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/file.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/file_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/file_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/file_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/getwd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/getwd_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/os_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/os_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/path.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/path_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/path_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/path_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/path_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/pipe_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/pipe_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/proc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/signal/signal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/signal/signal_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/signal/signal_plan9_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/signal/signal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/signal/signal_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_atim.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_atimespec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_nacl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/stat_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sticky_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sticky_notbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/str.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_freebsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_nacl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_uname.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/sys_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/types.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/types_notwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/types_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/decls_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/decls_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/lookup.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/lookup_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/lookup_stubs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/lookup_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/lookup_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/user.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/os/user/user_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/example_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/match.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/match_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/path.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/path_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/path_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/path_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/path_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/symlink.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/symlink_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/filepath/symlink_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/match.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/match_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/path.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/path/path_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/all_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/deepequal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/makefunc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/makefunc_ffi.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/makefunc_ffi_c.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/set_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/tostring_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/reflect/value.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/all_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/backtrack.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/exec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/exec2_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/exec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/find_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/onepass.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/onepass_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/regexp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/compile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/parse.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/parse_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/perl_groups.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/prog.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/prog_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/regexp.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/simplify.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/syntax/simplify_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/README delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/basic.dat delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/nullsubexpr.dat delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/re2-exhaustive.txt.bz2 delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/re2-search.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/repetition.dat delete mode 100644 llgo/third_party/gofrontend/libgo/go/regexp/testdata/testregex.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/append_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/chan_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/chanbarrier_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/closure_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/compiler.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/complex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/crash_cgo_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/crash_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/crash_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug/garbage_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug/heapdump_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug/stack.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/debug/stack_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/env_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/error.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/export_arm_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/export_linux_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/export_windows_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/extern.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/gc_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/gcinfo_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/iface_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/lfstack_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/malloc_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/map_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/mapspeed_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/mem.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/mfinal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/norace_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/parfor_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/pprof/mprof_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/pprof/pprof.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/pprof/pprof_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/proc_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/runtime_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/runtime_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/string_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/symtab_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/runtime/vlrt.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/example_interface_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/example_keys_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/example_multi_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/example_wrapper_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/search.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/search_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/sort.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sort/sort_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atob.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atob_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atof.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atof_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atoi.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/atoi_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/decimal.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/decimal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/extfloat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/fp_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/ftoa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/ftoa_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/internal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/isprint.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/itoa.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/itoa_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/makeisprint.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/quote.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/quote_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/strconv_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/testdata/testfp.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/strconv/testfp.txt delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/compare.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/compare_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/indexbyte.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/reader_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/replace.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/replace_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/search.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/search_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/strings.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/strings_decl.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/strings/strings_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/64bit_arm.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/atomic.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/atomic_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/value.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/atomic/value_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/cas.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/cond.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/cond_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/mutex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/mutex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/once.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/once_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/pool.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/pool_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/race.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/race0.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/runtime.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/runtime_sema_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/rwmutex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/rwmutex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/waitgroup.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/sync/waitgroup_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/bpf_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/const_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/creds_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/dir_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/env_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/env_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/env_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/errno.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/errors_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/errstr.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/errstr_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/errstr_nor.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_linux_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_solaris_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_stubs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/exec_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/export_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_irix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_386.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_alpha.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_amd64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_s390.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_s390x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_ustat.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_linux_utimesnano.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_posix_largefile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_posix_regfile.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_posix_utimesnano.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_solaris_386.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_solaris_amd64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_solaris_sparc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_solaris_sparc64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_support.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_uname.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_wait4.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/libcall_waitpid.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/lsf_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/mksyscall.awk delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/mmap_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/netlink_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/pwd_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/race0.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_bsd_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_darwin.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_dragonfly.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_freebsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_freebsd_32bit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_freebsd_64bit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_ifma_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_netbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_noifma_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/route_openbsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/security_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/signame.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/sleep_rtems.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/sleep_select.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/sockcmsg_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/sockcmsg_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_bsd.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_irix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_linux.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_linux_ppc64x_type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_linux_type.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_posix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/socket_xnet.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/str.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_errno.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_386.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_alpha.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_amd64.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_s390.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_s390x.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_linux_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_solaris.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_stubs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/syscall_unix_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/syscall/wait.c delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/allocs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/allocs_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/benchmark.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/benchmark_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/cover.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/example.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/iotest/logger.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/iotest/reader.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/iotest/writer.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/quick/quick.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/quick/quick_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/testing.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/testing/testing_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/scanner/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/scanner/scanner.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/scanner/scanner_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/tabwriter/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/tabwriter/tabwriter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/tabwriter/tabwriter_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/doc.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/exec.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/exec_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/funcs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/helper.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/multi_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/option.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/parse/lex.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/parse/lex_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/parse/node.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/parse/parse.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/parse/parse_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/template.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/testdata/file1.tmpl delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/testdata/file2.tmpl delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/testdata/tmpl1.tmpl delete mode 100644 llgo/third_party/gofrontend/libgo/go/text/template/testdata/tmpl2.tmpl delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/format.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/format_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/genzabbrs.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/internal_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/sleep.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/sleep_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/sys_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/sys_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/sys_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/tick.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/tick_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/time.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/time_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_abbrs_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_ios.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_plan9.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_read.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_unix.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/time/zoneinfo_windows.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/casetables.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/digit.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/digit_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/graphic.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/graphic_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/letter.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/letter_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/script_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/tables.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf16/export_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf16/utf16.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf16/utf16_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf8/example_test.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf8/utf8.go delete mode 100644 llgo/third_party/gofrontend/libgo/go/unicode/utf8/utf8_test.go delete mode 100755 llgo/third_party/gofrontend/libgo/godeps.sh delete mode 100755 llgo/third_party/gofrontend/libgo/merge.sh delete mode 100755 llgo/third_party/gofrontend/libgo/mksysinfo.sh delete mode 100755 llgo/third_party/gofrontend/libgo/mvifdiff.sh delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/arch.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/array.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/chan.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/chan.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/cpuprof.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/defs.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/env_posix.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/getncpu-bsd.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/getncpu-irix.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/getncpu-linux.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/getncpu-none.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/getncpu-solaris.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-alloc.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-append.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-assert-interface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-assert.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-assert.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-breakpoint.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-byte-array-to-string.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-caller.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-callers.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-can-convert-interface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-cdiv.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-cgo.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-check-interface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-construct-map.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-convert-interface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-copy.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-defer.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-defer.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-deferred-recover.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-eface-compare.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-eface-val-compare.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-ffi.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-ffi.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-fieldtrack.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-iface.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-int-array-to-string.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-int-to-string.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-interface-compare.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-interface-eface-compare.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-interface-val-compare.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-libmain.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-main.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-make-slice.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-map-delete.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-map-index.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-map-len.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-map-range.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-matherr.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-memcmp.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-nanotime.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-new-map.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-new.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-nosys.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-now.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-panic.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-panic.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-print.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-recover.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-reflect-call.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-reflect-map.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-rune.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-runtime-error.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-setenv.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-signal.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-strcmp.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-string-to-byte-array.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-string-to-int-array.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-string.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-strplus.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-strslice.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-traceback.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-complex.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-eface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-error.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-float.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-identity.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-interface.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type-string.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-type.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-typedesc-equal.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-unsafe-new.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-unsafe-newarray.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-unsafe-pointer.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-unsetenv.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-unwind.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/go-varargs.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/goc2c.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/heapdump.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/interface.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/lfstack.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/lock_futex.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/lock_sema.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/malloc.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/malloc.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/map.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/map.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mcache.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mcentral.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mem.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mem_posix_memalign.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mfixalloc.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mgc0.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mgc0.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mheap.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/mprof.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/msize.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/netpoll.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/netpoll_epoll.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/netpoll_kqueue.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/netpoll_select.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/netpoll_stub.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/panic.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/parfor.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/print.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/proc.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/rdebug.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/reflect.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/rtems-task-variable-add.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/runtime.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/runtime.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/runtime1.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/sema.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/signal_unix.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/signal_unix.h delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/sigqueue.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/string.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/thread-linux.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/thread-sema.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/thread.c delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/time.goc delete mode 100644 llgo/third_party/gofrontend/libgo/runtime/yield.c delete mode 100644 llgo/third_party/gofrontend/libgo/testsuite/Makefile.am delete mode 100644 llgo/third_party/gofrontend/libgo/testsuite/Makefile.in delete mode 100755 llgo/third_party/gofrontend/libgo/testsuite/gotest delete mode 100644 llgo/third_party/gofrontend/ltmain.sh delete mode 100644 llgo/third_party/gofrontend/missing delete mode 100644 llgo/third_party/gotools/LICENSE delete mode 100644 llgo/third_party/gotools/go/ast/astutil/enclosing.go delete mode 100644 llgo/third_party/gotools/go/ast/astutil/enclosing_test.go delete mode 100644 llgo/third_party/gotools/go/ast/astutil/imports.go delete mode 100644 llgo/third_party/gotools/go/ast/astutil/imports_test.go delete mode 100644 llgo/third_party/gotools/go/ast/astutil/util.go delete mode 100644 llgo/third_party/gotools/go/buildutil/allpackages.go delete mode 100644 llgo/third_party/gotools/go/buildutil/allpackages_test.go delete mode 100644 llgo/third_party/gotools/go/buildutil/fakecontext.go delete mode 100644 llgo/third_party/gotools/go/buildutil/util.go delete mode 100644 llgo/third_party/gotools/go/buildutil/util_test.go delete mode 100644 llgo/third_party/gotools/go/callgraph/callgraph.go delete mode 100644 llgo/third_party/gotools/go/callgraph/cha/cha.go delete mode 100644 llgo/third_party/gotools/go/callgraph/cha/cha_test.go delete mode 100644 llgo/third_party/gotools/go/callgraph/cha/testdata/func.go delete mode 100644 llgo/third_party/gotools/go/callgraph/cha/testdata/iface.go delete mode 100644 llgo/third_party/gotools/go/callgraph/cha/testdata/recv.go delete mode 100644 llgo/third_party/gotools/go/callgraph/rta/rta.go delete mode 100644 llgo/third_party/gotools/go/callgraph/rta/rta_test.go delete mode 100644 llgo/third_party/gotools/go/callgraph/rta/testdata/func.go delete mode 100644 llgo/third_party/gotools/go/callgraph/rta/testdata/iface.go delete mode 100644 llgo/third_party/gotools/go/callgraph/rta/testdata/rtype.go delete mode 100644 llgo/third_party/gotools/go/callgraph/static/static.go delete mode 100644 llgo/third_party/gotools/go/callgraph/static/static_test.go delete mode 100644 llgo/third_party/gotools/go/callgraph/util.go delete mode 100644 llgo/third_party/gotools/go/exact/exact.go delete mode 100644 llgo/third_party/gotools/go/exact/exact_test.go delete mode 100644 llgo/third_party/gotools/go/exact/go13.go delete mode 100644 llgo/third_party/gotools/go/exact/go14.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/gccgoinstallation.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/gccgoinstallation_test.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/importer.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/importer_test.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/parser.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/parser_test.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/complexnums.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/complexnums.gox delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/imports.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/imports.gox delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/pointer.go delete mode 100644 llgo/third_party/gotools/go/gccgoimporter/testdata/pointer.gox delete mode 100644 llgo/third_party/gotools/go/gcimporter/exportdata.go delete mode 100644 llgo/third_party/gotools/go/gcimporter/gcimporter.go delete mode 100644 llgo/third_party/gotools/go/gcimporter/gcimporter_test.go delete mode 100644 llgo/third_party/gotools/go/gcimporter/testdata/exports.go delete mode 100644 llgo/third_party/gotools/go/importer/export.go delete mode 100644 llgo/third_party/gotools/go/importer/import.go delete mode 100644 llgo/third_party/gotools/go/importer/import_test.go delete mode 100644 llgo/third_party/gotools/go/importer/predefined.go delete mode 100644 llgo/third_party/gotools/go/loader/cgo.go delete mode 100644 llgo/third_party/gotools/go/loader/loader.go delete mode 100644 llgo/third_party/gotools/go/loader/loader_test.go delete mode 100644 llgo/third_party/gotools/go/loader/source_test.go delete mode 100644 llgo/third_party/gotools/go/loader/stdlib_test.go delete mode 100644 llgo/third_party/gotools/go/loader/testdata/a.go delete mode 100644 llgo/third_party/gotools/go/loader/testdata/b.go delete mode 100644 llgo/third_party/gotools/go/loader/testdata/badpkgdecl.go delete mode 100644 llgo/third_party/gotools/go/loader/util.go delete mode 100644 llgo/third_party/gotools/go/pointer/TODO delete mode 100644 llgo/third_party/gotools/go/pointer/analysis.go delete mode 100644 llgo/third_party/gotools/go/pointer/api.go delete mode 100644 llgo/third_party/gotools/go/pointer/callgraph.go delete mode 100644 llgo/third_party/gotools/go/pointer/constraint.go delete mode 100644 llgo/third_party/gotools/go/pointer/doc.go delete mode 100644 llgo/third_party/gotools/go/pointer/example_test.go delete mode 100644 llgo/third_party/gotools/go/pointer/gen.go delete mode 100644 llgo/third_party/gotools/go/pointer/hvn.go delete mode 100644 llgo/third_party/gotools/go/pointer/intrinsics.go delete mode 100644 llgo/third_party/gotools/go/pointer/labels.go delete mode 100644 llgo/third_party/gotools/go/pointer/opt.go delete mode 100644 llgo/third_party/gotools/go/pointer/pointer_test.go delete mode 100644 llgo/third_party/gotools/go/pointer/print.go delete mode 100644 llgo/third_party/gotools/go/pointer/reflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/solve.go delete mode 100644 llgo/third_party/gotools/go/pointer/stdlib_test.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/a_test.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/another.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/arrayreflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/arrays.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/channels.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/chanreflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/chanreflect1.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/context.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/conv.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/finalizer.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/flow.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/fmtexcerpt.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/func.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/funcreflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/hello.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/interfaces.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/issue9002.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/mapreflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/maps.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/panic.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/recur.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/reflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/rtti.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/structreflect.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/structs.go delete mode 100644 llgo/third_party/gotools/go/pointer/testdata/timer.go delete mode 100644 llgo/third_party/gotools/go/pointer/util.go delete mode 100644 llgo/third_party/gotools/go/ssa/blockopt.go delete mode 100644 llgo/third_party/gotools/go/ssa/builder.go delete mode 100644 llgo/third_party/gotools/go/ssa/builder_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/const.go delete mode 100644 llgo/third_party/gotools/go/ssa/create.go delete mode 100644 llgo/third_party/gotools/go/ssa/doc.go delete mode 100644 llgo/third_party/gotools/go/ssa/dom.go delete mode 100644 llgo/third_party/gotools/go/ssa/emit.go delete mode 100644 llgo/third_party/gotools/go/ssa/example_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/func.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external_darwin.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external_freebsd.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external_plan9.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external_unix.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/external_windows.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/interp.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/interp_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/map.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/ops.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/reflect.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/a_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/b_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/boundmeth.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/callstack.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/complit.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/coverage.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/defer.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/fieldprom.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/ifaceconv.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/ifaceprom.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/initorder.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/methprom.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/mrvchain.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/range.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/recover.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/reflect.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/testdata/static.go delete mode 100644 llgo/third_party/gotools/go/ssa/interp/value.go delete mode 100644 llgo/third_party/gotools/go/ssa/lift.go delete mode 100644 llgo/third_party/gotools/go/ssa/lvalue.go delete mode 100644 llgo/third_party/gotools/go/ssa/methods.go delete mode 100644 llgo/third_party/gotools/go/ssa/mode.go delete mode 100644 llgo/third_party/gotools/go/ssa/print.go delete mode 100644 llgo/third_party/gotools/go/ssa/sanity.go delete mode 100644 llgo/third_party/gotools/go/ssa/source.go delete mode 100644 llgo/third_party/gotools/go/ssa/source_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/ssa.go delete mode 100644 llgo/third_party/gotools/go/ssa/ssautil/switch.go delete mode 100644 llgo/third_party/gotools/go/ssa/ssautil/switch_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/ssautil/testdata/switches.go delete mode 100644 llgo/third_party/gotools/go/ssa/ssautil/visit.go delete mode 100644 llgo/third_party/gotools/go/ssa/stdlib_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/testdata/objlookup.go delete mode 100644 llgo/third_party/gotools/go/ssa/testdata/valueforexpr.go delete mode 100644 llgo/third_party/gotools/go/ssa/testmain.go delete mode 100644 llgo/third_party/gotools/go/ssa/testmain_test.go delete mode 100644 llgo/third_party/gotools/go/ssa/util.go delete mode 100644 llgo/third_party/gotools/go/ssa/wrappers.go delete mode 100644 llgo/third_party/gotools/go/types/api.go delete mode 100644 llgo/third_party/gotools/go/types/api_test.go delete mode 100644 llgo/third_party/gotools/go/types/assignments.go delete mode 100644 llgo/third_party/gotools/go/types/builtins.go delete mode 100644 llgo/third_party/gotools/go/types/builtins_test.go delete mode 100644 llgo/third_party/gotools/go/types/call.go delete mode 100644 llgo/third_party/gotools/go/types/check.go delete mode 100644 llgo/third_party/gotools/go/types/check_test.go delete mode 100644 llgo/third_party/gotools/go/types/conversions.go delete mode 100644 llgo/third_party/gotools/go/types/decl.go delete mode 100644 llgo/third_party/gotools/go/types/errors.go delete mode 100644 llgo/third_party/gotools/go/types/eval.go delete mode 100644 llgo/third_party/gotools/go/types/eval_test.go delete mode 100644 llgo/third_party/gotools/go/types/expr.go delete mode 100644 llgo/third_party/gotools/go/types/exprstring.go delete mode 100644 llgo/third_party/gotools/go/types/exprstring_test.go delete mode 100644 llgo/third_party/gotools/go/types/go11.go delete mode 100644 llgo/third_party/gotools/go/types/go12.go delete mode 100644 llgo/third_party/gotools/go/types/hilbert_test.go delete mode 100644 llgo/third_party/gotools/go/types/initorder.go delete mode 100644 llgo/third_party/gotools/go/types/issues_test.go delete mode 100644 llgo/third_party/gotools/go/types/labels.go delete mode 100644 llgo/third_party/gotools/go/types/lookup.go delete mode 100644 llgo/third_party/gotools/go/types/methodset.go delete mode 100644 llgo/third_party/gotools/go/types/methodsetcache.go delete mode 100644 llgo/third_party/gotools/go/types/object.go delete mode 100644 llgo/third_party/gotools/go/types/objset.go delete mode 100644 llgo/third_party/gotools/go/types/operand.go delete mode 100644 llgo/third_party/gotools/go/types/ordering.go delete mode 100644 llgo/third_party/gotools/go/types/package.go delete mode 100644 llgo/third_party/gotools/go/types/predicates.go delete mode 100644 llgo/third_party/gotools/go/types/resolver.go delete mode 100644 llgo/third_party/gotools/go/types/resolver_test.go delete mode 100644 llgo/third_party/gotools/go/types/return.go delete mode 100644 llgo/third_party/gotools/go/types/scope.go delete mode 100644 llgo/third_party/gotools/go/types/selection.go delete mode 100644 llgo/third_party/gotools/go/types/self_test.go delete mode 100644 llgo/third_party/gotools/go/types/sizes.go delete mode 100644 llgo/third_party/gotools/go/types/stdlib_test.go delete mode 100644 llgo/third_party/gotools/go/types/stmt.go delete mode 100644 llgo/third_party/gotools/go/types/testdata/blank.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/builtins.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/const0.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/const1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/constdecl.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/conversions.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/cycles.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/cycles1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/cycles2.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/cycles3.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/cycles4.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/decls0.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/decls1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/decls2a.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/decls2b.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/decls3.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/errors.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/expr0.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/expr1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/expr2.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/expr3.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/gotos.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/importdecl0a.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/importdecl0b.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/importdecl1a.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/importdecl1b.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/init0.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/init1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/init2.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/issues.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/labels.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/methodsets.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/shifts.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/stmt0.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/stmt1.src delete mode 100644 llgo/third_party/gotools/go/types/testdata/vardecl.src delete mode 100644 llgo/third_party/gotools/go/types/token_test.go delete mode 100644 llgo/third_party/gotools/go/types/type.go delete mode 100644 llgo/third_party/gotools/go/types/typestring.go delete mode 100644 llgo/third_party/gotools/go/types/typestring_test.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/example_test.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/imports.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/imports_test.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/map.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/map_test.go delete mode 100644 llgo/third_party/gotools/go/types/typeutil/ui.go delete mode 100644 llgo/third_party/gotools/go/types/typexpr.go delete mode 100644 llgo/third_party/gotools/go/types/universe.go delete mode 100644 llgo/third_party/gotools/go/vcs/discovery.go delete mode 100644 llgo/third_party/gotools/go/vcs/env.go delete mode 100644 llgo/third_party/gotools/go/vcs/http.go delete mode 100644 llgo/third_party/gotools/go/vcs/vcs.go delete mode 100644 llgo/third_party/gotools/go/vcs/vcs_test.go delete mode 100644 llgo/third_party/liner/COPYING delete mode 100644 llgo/third_party/liner/README.md delete mode 100644 llgo/third_party/liner/bsdinput.go delete mode 100644 llgo/third_party/liner/common.go delete mode 100644 llgo/third_party/liner/fallbackinput.go delete mode 100644 llgo/third_party/liner/input.go delete mode 100644 llgo/third_party/liner/input_darwin.go delete mode 100644 llgo/third_party/liner/input_linux.go delete mode 100644 llgo/third_party/liner/input_test.go delete mode 100644 llgo/third_party/liner/input_windows.go delete mode 100644 llgo/third_party/liner/line.go delete mode 100644 llgo/third_party/liner/line_test.go delete mode 100644 llgo/third_party/liner/output.go delete mode 100644 llgo/third_party/liner/output_windows.go delete mode 100644 llgo/third_party/liner/prefix_test.go delete mode 100644 llgo/third_party/liner/race_test.go delete mode 100644 llgo/third_party/liner/signal.go delete mode 100644 llgo/third_party/liner/signal_legacy.go delete mode 100644 llgo/third_party/liner/unixmode.go delete mode 100644 llgo/third_party/liner/width.go delete mode 100644 llgo/third_party/liner/width_test.go delete mode 100755 llgo/update_third_party.sh delete mode 100644 llgo/utils/benchcomp/README delete mode 100644 llgo/utils/benchcomp/analyze.R delete mode 100644 llgo/utils/benchcomp/main.go delete mode 100644 parallel-libs/.arcconfig delete mode 100644 parallel-libs/README.rst delete mode 100644 parallel-libs/streamexecutor/README.txt diff --git a/debuginfo-tests/README.txt b/debuginfo-tests/README.txt deleted file mode 100644 index 0c56d297d750..000000000000 --- a/debuginfo-tests/README.txt +++ /dev/null @@ -1,19 +0,0 @@ - -*- rst -*- -This is a collection of tests to check debugging information generated by -compiler. This test suite can be checked out inside clang/test folder. This -will enable 'make test' for clang to pick up these tests. Typically, test -cases included here includes debugger commands and intended debugger output -as comments in source file using DEBUGGER: and CHECK: as prefixes respectively. - -For example:: - - define i32 @f1(i32 %i) nounwind ssp { - ; DEBUGGER: break f1 - ; DEBUGGER: r - ; DEBUGGER: p i - ; CHECK: $1 = 42 - entry: - } - -is a testcase where the debugger is asked to break at function 'f1' and -print value of argument 'i'. The expected value of 'i' is 42 in this case. diff --git a/debuginfo-tests/aggregate-indirect-arg.cpp b/debuginfo-tests/aggregate-indirect-arg.cpp deleted file mode 100644 index 86c7caf96184..000000000000 --- a/debuginfo-tests/aggregate-indirect-arg.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out -// RUN: %test_debuginfo %s %t.out -// Radar 8945514 -// DEBUGGER: break 22 -// DEBUGGER: r -// DEBUGGER: p v -// CHECK: ${{[0-9]+}} = -// CHECK: Data ={{.*}} 0x0{{(0*)}} -// CHECK: Kind = 2142 - -class SVal { -public: - ~SVal() {} - const void* Data; - unsigned Kind; -}; - -void bar(SVal &v) {} -class A { -public: - void foo(SVal v) { bar(v); } -}; - -int main() { - SVal v; - v.Data = 0; - v.Kind = 2142; - A a; - a.foo(v); - return 0; -} diff --git a/debuginfo-tests/block_var.m b/debuginfo-tests/block_var.m deleted file mode 100644 index 7ec786f17987..000000000000 --- a/debuginfo-tests/block_var.m +++ /dev/null @@ -1,32 +0,0 @@ -// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation -// RUN: %test_debuginfo %s %t.out - -// REQUIRES: system-darwin - -// DEBUGGER: break 24 -// DEBUGGER: r -// DEBUGGER: p result -// CHECK: ${{[0-9]}} = 42 - -void doBlock(void (^block)(void)) -{ - block(); -} - -int I(int n) -{ - __block int result; - int i = 2; - doBlock(^{ - result = n; - }); - return result + i; /* Check value of 'result' */ -} - - -int main (int argc, const char * argv[]) { - return I(42); -} - - diff --git a/debuginfo-tests/blocks.m b/debuginfo-tests/blocks.m deleted file mode 100644 index 8e5a21213200..000000000000 --- a/debuginfo-tests/blocks.m +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation -// RUN: %test_debuginfo %s %t.out - -// REQUIRES: system-darwin -// Radar 9279956 - -// DEBUGGER: break 31 -// DEBUGGER: r -// DEBUGGER: p m2 -// CHECK: ${{[0-9]}} = 1 -// DEBUGGER: p dbTransaction -// CHECK: ${{[0-9]}} = 0 -// DEBUGGER: p master -// CHECK: ${{[0-9]}} = 0 - -#include - -extern void foo(void(^)(void)); - -@interface A:NSObject @end -@implementation A -- (void) helper { - int master = 0; - __block int m2 = 0; - __block int dbTransaction = 0; - int (^x)(void) = ^(void) { (void) self; - (void) master; - (void) dbTransaction; - m2++; - return m2; - }; - master = x(); -} -@end - -void foo(void(^x)(void)) {} - -int main() { - A *a = [A alloc]; - [a helper]; - return 0; -} diff --git a/debuginfo-tests/ctor.cpp b/debuginfo-tests/ctor.cpp deleted file mode 100644 index 92cdbcd7e0b1..000000000000 --- a/debuginfo-tests/ctor.cpp +++ /dev/null @@ -1,25 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out -// RUN: %test_debuginfo %s %t.out - - -// DEBUGGER: break 14 -// DEBUGGER: r -// DEBUGGER: p *this -// CHECK-NEXT-NOT: Cannot access memory at address - -class A { -public: - A() : zero(0), data(42) - { - } -private: - int zero; - int data; -}; - -int main() { - A a; - return 0; -} - diff --git a/debuginfo-tests/dbg-arg.c b/debuginfo-tests/dbg-arg.c deleted file mode 100644 index 26de4e5732c2..000000000000 --- a/debuginfo-tests/dbg-arg.c +++ /dev/null @@ -1,41 +0,0 @@ -// This test case checks debug info during register moves for an argument. -// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 -mllvm -fast-isel=false %s -c -o %t.o -// RUN: %clang %target_itanium_abi_host_triple -arch x86_64 %t.o -o %t.out -// RUN: %test_debuginfo %s %t.out -// -// Radar 8412415 - -struct _mtx -{ - long unsigned int ptr; - int waiters; - struct { - int tag; - int pad; - } mtxi; -}; - - -int foobar(struct _mtx *mutex) { - int r = 1; - int l = 0; - int j = 0; - do { - if (mutex->waiters) { - r = 2; - } - j = bar(r, l); - ++l; - } while (l < j); - return r + j; -} - -int bar(int i, int j) { - return i + j; -} - -int main() { - struct _mtx m; - m.waiters = 0; - return foobar(&m); -} diff --git a/debuginfo-tests/foreach.m b/debuginfo-tests/foreach.m deleted file mode 100644 index 2e3c312c877c..000000000000 --- a/debuginfo-tests/foreach.m +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: %clang %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clang %target_itanium_abi_host_triple %t.o -o %t.out -framework Foundation -// RUN: %test_debuginfo %s %t.out -// -// REQUIRES: system-darwin -// Radar 8757124 - -// DEBUGGER: break 25 -// DEBUGGER: r -// DEBUGGER: po thing -// CHECK: aaa - -#import - -int main (int argc, const char * argv[]) { - - NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init]; - NSArray *things = [NSArray arrayWithObjects:@"one", @"two", @"three" , nil]; - for (NSString *thing in things) { - NSLog (@"%@", thing); - } - - things = [NSArray arrayWithObjects:@"aaa", @"bbb", @"ccc" , nil]; - for (NSString *thing in things) { - NSLog (@"%@", thing); - } - [pool release]; - return 0; -} - - diff --git a/debuginfo-tests/forward-declare-class.cpp b/debuginfo-tests/forward-declare-class.cpp deleted file mode 100644 index 132420009bd1..000000000000 --- a/debuginfo-tests/forward-declare-class.cpp +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %test_debuginfo %s %t.o -// Radar 9168773 - -// DEBUGGER: ptype A -// Work around a gdb bug where it believes that a class is a -// struct if there aren't any methods - even though it's tagged -// as a class. -// CHECK: type = {{struct|class}} A { -// CHECK-NEXT: {{(public:){0,1}}} -// CHECK-NEXT: int MyData; -// CHECK-NEXT: } -class A; -class B { -public: - void foo(const A *p); -}; - -B iEntry; - -class A { -public: - int MyData; -}; - -A irp; - diff --git a/debuginfo-tests/llgdb.py b/debuginfo-tests/llgdb.py deleted file mode 100644 index ce8346259e24..000000000000 --- a/debuginfo-tests/llgdb.py +++ /dev/null @@ -1,153 +0,0 @@ -#!/bin/env python -""" -A gdb-compatible frontend for lldb that implements just enough -commands to run the tests in the debuginfo-tests repository with lldb. -""" - -# ---------------------------------------------------------------------- -# Auto-detect lldb python module. -import commands, platform, os, sys -try: - # Just try for LLDB in case PYTHONPATH is already correctly setup. - import lldb -except ImportError: - lldb_python_dirs = list() - # lldb is not in the PYTHONPATH, try some defaults for the current platform. - platform_system = platform.system() - if platform_system == 'Darwin': - # On Darwin, try the currently selected Xcode directory - xcode_dir = commands.getoutput("xcode-select --print-path") - if xcode_dir: - lldb_python_dirs.append(os.path.realpath(xcode_dir + -'/../SharedFrameworks/LLDB.framework/Resources/Python')) - lldb_python_dirs.append(xcode_dir + -'/Library/PrivateFrameworks/LLDB.framework/Resources/Python') - lldb_python_dirs.append( -'/System/Library/PrivateFrameworks/LLDB.framework/Resources/Python') - success = False - for lldb_python_dir in lldb_python_dirs: - if os.path.exists(lldb_python_dir): - if not (sys.path.__contains__(lldb_python_dir)): - sys.path.append(lldb_python_dir) - try: - import lldb - except ImportError: - pass - else: - print 'imported lldb from: "%s"' % (lldb_python_dir) - success = True - break - if not success: - print "error: couldn't locate the 'lldb' module, please set PYTHONPATH correctly" - sys.exit(1) -# ---------------------------------------------------------------------- - -# Command line option handling. -import argparse -parser = argparse.ArgumentParser(description=__doc__) -parser.add_argument('--quiet', '-q', action="store_true", help='ignored') -parser.add_argument('-batch', action="store_true", - help='exit after processing comand line') -parser.add_argument('-n', action="store_true", help='ignore .lldb file') -parser.add_argument('-x', dest='script', type=file, help='execute commands from file') -parser.add_argument("target", help="the program to debug") -args = parser.parse_args() - - -# Create a new debugger instance. -debugger = lldb.SBDebugger.Create() -debugger.SkipLLDBInitFiles(args.n) - -# Don't return from lldb function calls until the process stops. -debugger.SetAsync(False) - -# Create a target from a file and arch. -arch = os.popen("file "+args.target).read().split()[-1] -target = debugger.CreateTargetWithFileAndArch(args.target, arch) - -if not target: - print "Could not create target", args.target - sys.exit(1) - -if not args.script: - print "Interactive mode is not implemented." - sys.exit(1) - -import re -for command in args.script: - # Strip newline and whitespaces and split into words. - cmd = command[:-1].strip().split() - if not cmd: - continue - - print '> %s'% command[:-1] - - try: - if re.match('^r|(run)$', cmd[0]): - error = lldb.SBError() - launchinfo = lldb.SBLaunchInfo([]) - launchinfo.SetWorkingDirectory(os.getcwd()) - process = target.Launch(launchinfo, error) - print error - if not process or error.fail: - state = process.GetState() - print "State = %d" % state - print """ -ERROR: Could not launch process. -NOTE: There are several reasons why this may happen: - * Root needs to run "DevToolsSecurity --enable". - * Older versions of lldb cannot launch more than one process simultaneously. -""" - sys.exit(1) - - elif re.match('^b|(break)$', cmd[0]) and len(cmd) == 2: - if re.match('[0-9]+', cmd[1]): - # b line - mainfile = target.FindFunctions('main')[0].compile_unit.file - print target.BreakpointCreateByLocation(mainfile, int(cmd[1])) - else: - # b file:line - file, line = cmd[1].split(':') - print target.BreakpointCreateByLocation(file, int(line)) - - elif re.match('^ptype$', cmd[0]) and len(cmd) == 2: - # GDB's ptype has multiple incarnations depending on its - # argument (global variable, function, type). The definition - # here is for looking up the signature of a function and only - # if that fails it looks for a type with that name. - # Type lookup in LLDB would be "image lookup --type". - for elem in target.FindFunctions(cmd[1]): - print elem.function.type - continue - print target.FindFirstType(cmd[1]) - - elif re.match('^po$', cmd[0]) and len(cmd) > 1: - try: - opts = lldb.SBExpressionOptions() - opts.SetFetchDynamicValue(True) - opts.SetCoerceResultToId(True) - print target.EvaluateExpression(' '.join(cmd[1:]), opts) - except: - # FIXME: This is a fallback path for the lab.llvm.org - # buildbot running OS X 10.7; it should be removed. - thread = process.GetThreadAtIndex(0) - frame = thread.GetFrameAtIndex(0) - print frame.EvaluateExpression(' '.join(cmd[1:])) - - elif re.match('^p|(print)$', cmd[0]) and len(cmd) > 1: - thread = process.GetThreadAtIndex(0) - frame = thread.GetFrameAtIndex(0) - print frame.EvaluateExpression(' '.join(cmd[1:])) - - elif re.match('^q|(quit)$', cmd[0]): - sys.exit(0) - - else: - print debugger.HandleCommand(' '.join(cmd)) - - except SystemExit: - lldb.SBDebugger_Terminate() - raise - except: - print 'Could not handle the command "%s"' % ' '.join(cmd) - diff --git a/debuginfo-tests/nested-struct.cpp b/debuginfo-tests/nested-struct.cpp deleted file mode 100644 index 7533e6a81518..000000000000 --- a/debuginfo-tests/nested-struct.cpp +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %test_debuginfo %s %t.o -// Radar 9440721 -// If debug info for my_number() is emitted outside function foo's scope -// then a debugger may not be able to handle it. At least one version of -// gdb crashes in such cases. - -// DEBUGGER: ptype foo -// CHECK: int (void) - -int foo() { - struct Local { - static int my_number() { - return 42; - } - }; - - int i = 0; - i = Local::my_number(); - return i + 1; -} diff --git a/debuginfo-tests/sret.cpp b/debuginfo-tests/sret.cpp deleted file mode 100644 index 3c304e2f04a5..000000000000 --- a/debuginfo-tests/sret.cpp +++ /dev/null @@ -1,71 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -c -o %t.o -// RUN: %clangxx %target_itanium_abi_host_triple %t.o -o %t.out -// RUN: %test_debuginfo %s %t.out -// Radar 8775834 -// DEBUGGER: break 62 -// DEBUGGER: r -// DEBUGGER: p a -// CHECK: ${{[0-9]+}} = -// LLDB does not print artificial members. -// CHECK: {{(_vptr\$A =)?.*}}m_int = 12 - -class A -{ -public: - A (int i=0); - A (const A& rhs); - const A& - operator= (const A& rhs); - virtual ~A() {} - - int get_int(); - -protected: - int m_int; -}; - -A::A (int i) : - m_int(i) -{ -} - -A::A (const A& rhs) : - m_int (rhs.m_int) -{ -} - -const A & -A::operator =(const A& rhs) -{ - m_int = rhs.m_int; - return *this; -} - -int A::get_int() -{ - return m_int; -} - -class B -{ -public: - B () {} - - A AInstance(); -}; - -A -B::AInstance() -{ - A a(12); - return a; -} - -int main (int argc, char const *argv[]) -{ - B b; - int return_val = b.AInstance().get_int(); - - A a(b.AInstance()); - return return_val; -} diff --git a/debuginfo-tests/static-member-2.cpp b/debuginfo-tests/static-member-2.cpp deleted file mode 100644 index 4edb2b060f1a..000000000000 --- a/debuginfo-tests/static-member-2.cpp +++ /dev/null @@ -1,39 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c -// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out -// RUN: %test_debuginfo %s %t.out - -// FIXME: LLDB finds the wrong symbol for "C". rdar://problem/14933867 -// XFAIL: darwin - -// DEBUGGER: delete breakpoints -// DEBUGGER: break static-member.cpp:33 -// DEBUGGER: r -// DEBUGGER: ptype C -// CHECK: {{struct|class}} C { -// CHECK: static const int a; -// CHECK-NEXT: static int b; -// CHECK-NEXT: static int c; -// CHECK-NEXT: int d; -// CHECK-NEXT: } -// DEBUGGER: p C::a -// CHECK: ${{[0-9]}} = 4 -// DEBUGGER: p C::c -// CHECK: ${{[0-9]}} = 15 - -// PR14471, PR14734 - -class C { -public: - const static int a = 4; - static int b; - static int c; - int d; -}; - -int C::c = 15; -const int C::a; - -int main() { - C instance_C; - return C::a; -} diff --git a/debuginfo-tests/static-member.cpp b/debuginfo-tests/static-member.cpp deleted file mode 100644 index 1d8ad62c5b88..000000000000 --- a/debuginfo-tests/static-member.cpp +++ /dev/null @@ -1,36 +0,0 @@ -// RUN: %clangxx %target_itanium_abi_host_triple -O0 -g %s -o %t -c -// RUN: %clangxx %target_itanium_abi_host_triple %t -o %t.out -// RUN: %test_debuginfo %s %t.out - -// DEBUGGER: delete breakpoints -// DEBUGGER: break static-member.cpp:33 -// DEBUGGER: r -// DEBUGGER: ptype MyClass -// CHECK: {{struct|class}} MyClass { -// CHECK: static const int a; -// CHECK-NEXT: static int b; -// CHECK-NEXT: static int c; -// CHECK-NEXT: int d; -// CHECK-NEXT: } -// DEBUGGER: p MyClass::a -// CHECK: ${{[0-9]}} = 4 -// DEBUGGER: p MyClass::c -// CHECK: ${{[0-9]}} = 15 - -// PR14471, PR14734 - -class MyClass { -public: - const static int a = 4; - static int b; - static int c; - int d; -}; - -int MyClass::c = 15; -const int MyClass::a; - -int main() { - MyClass instance_MyClass; - return MyClass::a; -} diff --git a/libclc/.gitignore b/libclc/.gitignore deleted file mode 100644 index d0f6856c29b8..000000000000 --- a/libclc/.gitignore +++ /dev/null @@ -1,14 +0,0 @@ -Makefile -amdgcn-- -amdgcn--amdhsa -build/*.pyc -built_libs/ -generic-- -generic/lib/convert.cl -libclc.pc -nvptx--nvidiacl -nvptx64--nvidiacl -r600-- -utils/prepare-builtins -utils/prepare-builtins.o -utils/prepare-builtins.o.d diff --git a/libclc/CREDITS.TXT b/libclc/CREDITS.TXT deleted file mode 100644 index b18d40bd7339..000000000000 --- a/libclc/CREDITS.TXT +++ /dev/null @@ -1,2 +0,0 @@ -N: Peter Collingbourne -E: peter@pcc.me.uk diff --git a/libclc/LICENSE.TXT b/libclc/LICENSE.TXT deleted file mode 100644 index 666ec55c5d60..000000000000 --- a/libclc/LICENSE.TXT +++ /dev/null @@ -1,64 +0,0 @@ -============================================================================== -libclc License -============================================================================== - -The libclc library is dual licensed under both the University of Illinois -"BSD-Like" license and the MIT license. As a user of this code you may choose -to use it under either license. As a contributor, you agree to allow your code -to be used under both. - -Full text of the relevant licenses is included below. - -============================================================================== - -Copyright (c) 2011-2016 by the contributors listed in CREDITS.TXT - -All rights reserved. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal with -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * The names of the contributors may not be used to endorse or promote - products derived from this Software without specific prior written - permission. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -SOFTWARE. - -============================================================================== - -Copyright (c) 2011-2014 by the contributors listed in CREDITS.TXT - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. diff --git a/libclc/README.TXT b/libclc/README.TXT deleted file mode 100644 index 00ae6bfa40a1..000000000000 --- a/libclc/README.TXT +++ /dev/null @@ -1,52 +0,0 @@ -libclc ------- - -libclc is an open source, BSD licensed implementation of the library -requirements of the OpenCL C programming language, as specified by the -OpenCL 1.1 Specification. The following sections of the specification -impose library requirements: - - * 6.1: Supported Data Types - * 6.2.3: Explicit Conversions - * 6.2.4.2: Reinterpreting Types Using as_type() and as_typen() - * 6.9: Preprocessor Directives and Macros - * 6.11: Built-in Functions - * 9.3: Double Precision Floating-Point - * 9.4: 64-bit Atomics - * 9.5: Writing to 3D image memory objects - * 9.6: Half Precision Floating-Point - -libclc is intended to be used with the Clang compiler's OpenCL frontend. - -libclc is designed to be portable and extensible. To this end, it provides -generic implementations of most library requirements, allowing the target -to override the generic implementation at the granularity of individual -functions. - -libclc currently only supports the PTX target, but support for more -targets is welcome. - -Compiling and installing with Make ----------------------------------- - -$ ./configure.py --with-llvm-config=/path/to/llvm-config && make -$ make install - -Note you can use the DESTDIR Makefile variable to do staged installs. - -$ make install DESTDIR=/path/for/staged/install - -Compiling and installing with Ninja ------------------------------------ - -$ ./configure.py -g ninja --with-llvm-config=/path/to/llvm-config && ninja -$ ninja install - -Note you can use the DESTDIR environment variable to do staged installs. - -$ DESTDIR=/path/for/staged/install ninja install - -Website -------- - -http://www.pcc.me.uk/~peter/libclc/ diff --git a/libclc/amdgcn-amdhsa/lib/OVERRIDES b/libclc/amdgcn-amdhsa/lib/OVERRIDES deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libclc/amdgcn-amdhsa/lib/SOURCES b/libclc/amdgcn-amdhsa/lib/SOURCES deleted file mode 100644 index b33368de9e0b..000000000000 --- a/libclc/amdgcn-amdhsa/lib/SOURCES +++ /dev/null @@ -1 +0,0 @@ -workitem/get_local_size.ll diff --git a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.ll b/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.ll deleted file mode 100644 index c4df02792667..000000000000 --- a/libclc/amdgcn-amdhsa/lib/workitem/get_local_size.ll +++ /dev/null @@ -1,35 +0,0 @@ -declare i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() #0 - -define i32 @get_local_size(i32 %dim) #1 { - %dispatch_ptr = call noalias nonnull dereferenceable(64) i8 addrspace(2)* @llvm.amdgcn.dispatch.ptr() - %dispatch_ptr_i32 = bitcast i8 addrspace(2)* %dispatch_ptr to i32 addrspace(2)* - %xy_size_ptr = getelementptr inbounds i32, i32 addrspace(2)* %dispatch_ptr_i32, i64 1 - %xy_size = load i32, i32 addrspace(2)* %xy_size_ptr, align 4, !invariant.load !0 - switch i32 %dim, label %default [ - i32 0, label %x_dim - i32 1, label %y_dim - i32 2, label %z_dim - ] - -x_dim: - %x_size = and i32 %xy_size, 65535 - ret i32 %x_size - -y_dim: - %y_size = lshr i32 %xy_size, 16 - ret i32 %y_size - -z_dim: - %z_size_ptr = getelementptr inbounds i32, i32 addrspace(2)* %dispatch_ptr_i32, i64 2 - %z_size = load i32, i32 addrspace(2)* %z_size_ptr, align 4, !invariant.load !0, !range !1 - ret i32 %z_size - -default: - ret i32 1 -} - -attributes #0 = { nounwind readnone } -attributes #1 = { alwaysinline norecurse nounwind readonly } - -!0 = !{} -!1 = !{ i32 0, i32 257 } diff --git a/libclc/amdgcn/lib/OVERRIDES b/libclc/amdgcn/lib/OVERRIDES deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libclc/amdgcn/lib/SOURCES b/libclc/amdgcn/lib/SOURCES deleted file mode 100644 index ada06d2a2966..000000000000 --- a/libclc/amdgcn/lib/SOURCES +++ /dev/null @@ -1,4 +0,0 @@ -math/ldexp.cl -synchronization/barrier_impl.ll -workitem/get_group_id.ll -workitem/get_local_id.ll diff --git a/libclc/amdgcn/lib/math/ldexp.cl b/libclc/amdgcn/lib/math/ldexp.cl deleted file mode 100644 index 9713e4daee0e..000000000000 --- a/libclc/amdgcn/lib/math/ldexp.cl +++ /dev/null @@ -1,47 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../../../generic/lib/clcmacro.h" - -#ifdef __HAS_LDEXPF__ -#define BUILTINF __builtin_amdgcn_ldexpf -#else -#include "math/clc_ldexp.h" -#define BUILTINF __clc_ldexp -#endif - -// This defines all the ldexp(floatN, intN) variants. -_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, BUILTINF, float, int); - -#ifdef cl_khr_fp64 - #pragma OPENCL EXTENSION cl_khr_fp64 : enable - // This defines all the ldexp(doubleN, intN) variants. - _CLC_DEFINE_BINARY_BUILTIN(double, ldexp, __builtin_amdgcn_ldexp, double, int); -#endif - -// This defines all the ldexp(GENTYPE, int); -#define __CLC_BODY <../../../generic/lib/math/ldexp.inc> -#include - -#undef BUILTINF diff --git a/libclc/amdgcn/lib/synchronization/barrier_impl.ll b/libclc/amdgcn/lib/synchronization/barrier_impl.ll deleted file mode 100644 index 1809eddf695b..000000000000 --- a/libclc/amdgcn/lib/synchronization/barrier_impl.ll +++ /dev/null @@ -1,32 +0,0 @@ -declare i32 @__clc_clk_local_mem_fence() #1 -declare i32 @__clc_clk_global_mem_fence() #1 -declare void @llvm.amdgcn.s.barrier() #0 - -define void @barrier(i32 %flags) #2 { -barrier_local_test: - %CLK_LOCAL_MEM_FENCE = call i32 @__clc_clk_local_mem_fence() - %0 = and i32 %flags, %CLK_LOCAL_MEM_FENCE - %1 = icmp ne i32 %0, 0 - br i1 %1, label %barrier_local, label %barrier_global_test - -barrier_local: - call void @llvm.amdgcn.s.barrier() - br label %barrier_global_test - -barrier_global_test: - %CLK_GLOBAL_MEM_FENCE = call i32 @__clc_clk_global_mem_fence() - %2 = and i32 %flags, %CLK_GLOBAL_MEM_FENCE - %3 = icmp ne i32 %2, 0 - br i1 %3, label %barrier_global, label %done - -barrier_global: - call void @llvm.amdgcn.s.barrier() - br label %done - -done: - ret void -} - -attributes #0 = { nounwind convergent } -attributes #1 = { nounwind alwaysinline } -attributes #2 = { nounwind convergent alwaysinline } diff --git a/libclc/amdgcn/lib/workitem/get_group_id.ll b/libclc/amdgcn/lib/workitem/get_group_id.ll deleted file mode 100644 index 9d820e0b3e48..000000000000 --- a/libclc/amdgcn/lib/workitem/get_group_id.ll +++ /dev/null @@ -1,29 +0,0 @@ -declare i32 @llvm.amdgcn.workgroup.id.x() #0 -declare i32 @llvm.amdgcn.workgroup.id.y() #0 -declare i32 @llvm.amdgcn.workgroup.id.z() #0 - -define i32 @get_group_id(i32 %dim) #1 { - switch i32 %dim, label %default [ - i32 0, label %x_dim - i32 1, label %y_dim - i32 2, label %z_dim - ] - -x_dim: - %x = tail call i32 @llvm.amdgcn.workgroup.id.x() - ret i32 %x - -y_dim: - %y = tail call i32 @llvm.amdgcn.workgroup.id.y() - ret i32 %y - -z_dim: - %z = tail call i32 @llvm.amdgcn.workgroup.id.z() - ret i32 %z - -default: - ret i32 0 -} - -attributes #0 = { nounwind readnone } -attributes #1 = { alwaysinline norecurse nounwind readnone } diff --git a/libclc/amdgcn/lib/workitem/get_local_id.ll b/libclc/amdgcn/lib/workitem/get_local_id.ll deleted file mode 100644 index c54291c0b8f2..000000000000 --- a/libclc/amdgcn/lib/workitem/get_local_id.ll +++ /dev/null @@ -1,31 +0,0 @@ -declare i32 @llvm.amdgcn.workitem.id.x() #0 -declare i32 @llvm.amdgcn.workitem.id.y() #0 -declare i32 @llvm.amdgcn.workitem.id.z() #0 - -define i32 @get_local_id(i32 %dim) #1 { - switch i32 %dim, label %default [ - i32 0, label %x_dim - i32 1, label %y_dim - i32 2, label %z_dim - ] - -x_dim: - %x = tail call i32 @llvm.amdgcn.workitem.id.x(), !range !0 - ret i32 %x - -y_dim: - %y = tail call i32 @llvm.amdgcn.workitem.id.y(), !range !0 - ret i32 %y - -z_dim: - %z = tail call i32 @llvm.amdgcn.workitem.id.z(), !range !0 - ret i32 %z - -default: - ret i32 0 -} - -attributes #0 = { nounwind readnone } -attributes #1 = { alwaysinline norecurse nounwind readnone } - -!0 = !{ i32 0, i32 2048 } diff --git a/libclc/amdgpu/lib/OVERRIDES b/libclc/amdgpu/lib/OVERRIDES deleted file mode 100644 index 3f941d890be7..000000000000 --- a/libclc/amdgpu/lib/OVERRIDES +++ /dev/null @@ -1,2 +0,0 @@ -workitem/get_group_id.cl -workitem/get_global_size.cl diff --git a/libclc/amdgpu/lib/SOURCES b/libclc/amdgpu/lib/SOURCES deleted file mode 100644 index 39287bf23cbe..000000000000 --- a/libclc/amdgpu/lib/SOURCES +++ /dev/null @@ -1,22 +0,0 @@ -atomic/atomic.cl -math/nextafter.cl -math/sqrt.cl -workitem/get_num_groups.ll -workitem/get_local_size.ll -workitem/get_global_size.ll -workitem/get_work_dim.ll -synchronization/barrier.cl -image/get_image_width.cl -image/get_image_height.cl -image/get_image_depth.cl -image/get_image_channel_data_type.cl -image/get_image_channel_order.cl -image/get_image_attributes_impl.ll -image/read_imagef.cl -image/read_imagei.cl -image/read_imageui.cl -image/read_image_impl.ll -image/write_imagef.cl -image/write_imagei.cl -image/write_imageui.cl -image/write_image_impl.ll diff --git a/libclc/amdgpu/lib/atomic/atomic.cl b/libclc/amdgpu/lib/atomic/atomic.cl deleted file mode 100644 index 5bfe07b94bfd..000000000000 --- a/libclc/amdgpu/lib/atomic/atomic.cl +++ /dev/null @@ -1,65 +0,0 @@ -#include - -#define ATOMIC_FUNC_DEFINE(RET_SIGN, ARG_SIGN, TYPE, CL_FUNCTION, CLC_FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ -_CLC_OVERLOAD _CLC_DEF RET_SIGN TYPE CL_FUNCTION (volatile CL_ADDRSPACE RET_SIGN TYPE *p, RET_SIGN TYPE val) { \ - return (RET_SIGN TYPE)__clc_##CLC_FUNCTION##_addr##LLVM_ADDRSPACE((volatile CL_ADDRSPACE ARG_SIGN TYPE*)p, (ARG_SIGN TYPE)val); \ -} - -/* For atomic functions that don't need different bitcode dependending on argument signedness */ -#define ATOMIC_FUNC_SIGN(TYPE, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ - _CLC_DECL signed TYPE __clc_##FUNCTION##_addr##LLVM_ADDRSPACE(volatile CL_ADDRSPACE signed TYPE*, signed TYPE); \ - ATOMIC_FUNC_DEFINE(signed, signed, TYPE, FUNCTION, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ - ATOMIC_FUNC_DEFINE(unsigned, signed, TYPE, FUNCTION, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) - -#define ATOMIC_FUNC_ADDRSPACE(TYPE, FUNCTION) \ - ATOMIC_FUNC_SIGN(TYPE, FUNCTION, global, 1) \ - ATOMIC_FUNC_SIGN(TYPE, FUNCTION, local, 3) - -#define ATOMIC_FUNC(FUNCTION) \ - ATOMIC_FUNC_ADDRSPACE(int, FUNCTION) - -#define ATOMIC_FUNC_DEFINE_3_ARG(RET_SIGN, ARG_SIGN, TYPE, CL_FUNCTION, CLC_FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ -_CLC_OVERLOAD _CLC_DEF RET_SIGN TYPE CL_FUNCTION (volatile CL_ADDRSPACE RET_SIGN TYPE *p, RET_SIGN TYPE cmp, RET_SIGN TYPE val) { \ - return (RET_SIGN TYPE)__clc_##CLC_FUNCTION##_addr##LLVM_ADDRSPACE((volatile CL_ADDRSPACE ARG_SIGN TYPE*)p, (ARG_SIGN TYPE)cmp, (ARG_SIGN TYPE)val); \ -} - -/* For atomic functions that don't need different bitcode dependending on argument signedness */ -#define ATOMIC_FUNC_SIGN_3_ARG(TYPE, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ - _CLC_DECL signed TYPE __clc_##FUNCTION##_addr##LLVM_ADDRSPACE(volatile CL_ADDRSPACE signed TYPE*, signed TYPE, signed TYPE); \ - ATOMIC_FUNC_DEFINE_3_ARG(signed, signed, TYPE, FUNCTION, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) \ - ATOMIC_FUNC_DEFINE_3_ARG(unsigned, signed, TYPE, FUNCTION, FUNCTION, CL_ADDRSPACE, LLVM_ADDRSPACE) - -#define ATOMIC_FUNC_ADDRSPACE_3_ARG(TYPE, FUNCTION) \ - ATOMIC_FUNC_SIGN_3_ARG(TYPE, FUNCTION, global, 1) \ - ATOMIC_FUNC_SIGN_3_ARG(TYPE, FUNCTION, local, 3) - -#define ATOMIC_FUNC_3_ARG(FUNCTION) \ - ATOMIC_FUNC_ADDRSPACE_3_ARG(int, FUNCTION) - -ATOMIC_FUNC(atomic_add) -ATOMIC_FUNC(atomic_and) -ATOMIC_FUNC(atomic_or) -ATOMIC_FUNC(atomic_sub) -ATOMIC_FUNC(atomic_xchg) -ATOMIC_FUNC(atomic_xor) -ATOMIC_FUNC_3_ARG(atomic_cmpxchg) - -_CLC_DECL signed int __clc_atomic_max_addr1(volatile global signed int*, signed int); -_CLC_DECL signed int __clc_atomic_max_addr3(volatile local signed int*, signed int); -_CLC_DECL uint __clc_atomic_umax_addr1(volatile global uint*, uint); -_CLC_DECL uint __clc_atomic_umax_addr3(volatile local uint*, uint); - -ATOMIC_FUNC_DEFINE(signed, signed, int, atomic_max, atomic_max, global, 1) -ATOMIC_FUNC_DEFINE(signed, signed, int, atomic_max, atomic_max, local, 3) -ATOMIC_FUNC_DEFINE(unsigned, unsigned, int, atomic_max, atomic_umax, global, 1) -ATOMIC_FUNC_DEFINE(unsigned, unsigned, int, atomic_max, atomic_umax, local, 3) - -_CLC_DECL signed int __clc_atomic_min_addr1(volatile global signed int*, signed int); -_CLC_DECL signed int __clc_atomic_min_addr3(volatile local signed int*, signed int); -_CLC_DECL uint __clc_atomic_umin_addr1(volatile global uint*, uint); -_CLC_DECL uint __clc_atomic_umin_addr3(volatile local uint*, uint); - -ATOMIC_FUNC_DEFINE(signed, signed, int, atomic_min, atomic_min, global, 1) -ATOMIC_FUNC_DEFINE(signed, signed, int, atomic_min, atomic_min, local, 3) -ATOMIC_FUNC_DEFINE(unsigned, unsigned, int, atomic_min, atomic_umin, global, 1) -ATOMIC_FUNC_DEFINE(unsigned, unsigned, int, atomic_min, atomic_umin, local, 3) diff --git a/libclc/amdgpu/lib/image/get_image_attributes_impl.ll b/libclc/amdgpu/lib/image/get_image_attributes_impl.ll deleted file mode 100644 index 7f1965de7602..000000000000 --- a/libclc/amdgpu/lib/image/get_image_attributes_impl.ll +++ /dev/null @@ -1,87 +0,0 @@ -%opencl.image2d_t = type opaque -%opencl.image3d_t = type opaque - -declare i32 @llvm.OpenCL.image.get.resource.id.2d( - %opencl.image2d_t addrspace(1)*) nounwind readnone -declare i32 @llvm.OpenCL.image.get.resource.id.3d( - %opencl.image3d_t addrspace(1)*) nounwind readnone - -declare [3 x i32] @llvm.OpenCL.image.get.size.2d( - %opencl.image2d_t addrspace(1)*) nounwind readnone -declare [3 x i32] @llvm.OpenCL.image.get.size.3d( - %opencl.image3d_t addrspace(1)*) nounwind readnone - -declare [2 x i32] @llvm.OpenCL.image.get.format.2d( - %opencl.image2d_t addrspace(1)*) nounwind readnone -declare [2 x i32] @llvm.OpenCL.image.get.format.3d( - %opencl.image3d_t addrspace(1)*) nounwind readnone - -define i32 @__clc_get_image_width_2d( - %opencl.image2d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.2d( - %opencl.image2d_t addrspace(1)* %img) - %2 = extractvalue [3 x i32] %1, 0 - ret i32 %2 -} -define i32 @__clc_get_image_width_3d( - %opencl.image3d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( - %opencl.image3d_t addrspace(1)* %img) - %2 = extractvalue [3 x i32] %1, 0 - ret i32 %2 -} - -define i32 @__clc_get_image_height_2d( - %opencl.image2d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.2d( - %opencl.image2d_t addrspace(1)* %img) - %2 = extractvalue [3 x i32] %1, 1 - ret i32 %2 -} -define i32 @__clc_get_image_height_3d( - %opencl.image3d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( - %opencl.image3d_t addrspace(1)* %img) - %2 = extractvalue [3 x i32] %1, 1 - ret i32 %2 -} - -define i32 @__clc_get_image_depth_3d( - %opencl.image3d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [3 x i32] @llvm.OpenCL.image.get.size.3d( - %opencl.image3d_t addrspace(1)* %img) - %2 = extractvalue [3 x i32] %1, 2 - ret i32 %2 -} - -define i32 @__clc_get_image_channel_data_type_2d( - %opencl.image2d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.2d( - %opencl.image2d_t addrspace(1)* %img) - %2 = extractvalue [2 x i32] %1, 0 - ret i32 %2 -} -define i32 @__clc_get_image_channel_data_type_3d( - %opencl.image3d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.3d( - %opencl.image3d_t addrspace(1)* %img) - %2 = extractvalue [2 x i32] %1, 0 - ret i32 %2 -} - -define i32 @__clc_get_image_channel_order_2d( - %opencl.image2d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.2d( - %opencl.image2d_t addrspace(1)* %img) - %2 = extractvalue [2 x i32] %1, 1 - ret i32 %2 -} -define i32 @__clc_get_image_channel_order_3d( - %opencl.image3d_t addrspace(1)* nocapture %img) #0 { - %1 = tail call [2 x i32] @llvm.OpenCL.image.get.format.3d( - %opencl.image3d_t addrspace(1)* %img) - %2 = extractvalue [2 x i32] %1, 1 - ret i32 %2 -} - -attributes #0 = { nounwind readnone alwaysinline } diff --git a/libclc/amdgpu/lib/image/get_image_channel_data_type.cl b/libclc/amdgpu/lib/image/get_image_channel_data_type.cl deleted file mode 100644 index 2a2478f73a73..000000000000 --- a/libclc/amdgpu/lib/image/get_image_channel_data_type.cl +++ /dev/null @@ -1,13 +0,0 @@ -#include - -_CLC_DECL int __clc_get_image_channel_data_type_2d(image2d_t); -_CLC_DECL int __clc_get_image_channel_data_type_3d(image3d_t); - -_CLC_OVERLOAD _CLC_DEF int -get_image_channel_data_type(image2d_t image) { - return __clc_get_image_channel_data_type_2d(image); -} -_CLC_OVERLOAD _CLC_DEF int -get_image_channel_data_type(image3d_t image) { - return __clc_get_image_channel_data_type_3d(image); -} diff --git a/libclc/amdgpu/lib/image/get_image_channel_order.cl b/libclc/amdgpu/lib/image/get_image_channel_order.cl deleted file mode 100644 index 91e9b89e17e6..000000000000 --- a/libclc/amdgpu/lib/image/get_image_channel_order.cl +++ /dev/null @@ -1,13 +0,0 @@ -#include - -_CLC_DECL int __clc_get_image_channel_order_2d(image2d_t); -_CLC_DECL int __clc_get_image_channel_order_3d(image3d_t); - -_CLC_OVERLOAD _CLC_DEF int -get_image_channel_order(image2d_t image) { - return __clc_get_image_channel_order_2d(image); -} -_CLC_OVERLOAD _CLC_DEF int -get_image_channel_order(image3d_t image) { - return __clc_get_image_channel_order_3d(image); -} diff --git a/libclc/amdgpu/lib/image/get_image_depth.cl b/libclc/amdgpu/lib/image/get_image_depth.cl deleted file mode 100644 index 18646458e9ad..000000000000 --- a/libclc/amdgpu/lib/image/get_image_depth.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -_CLC_DECL int __clc_get_image_depth_3d(image3d_t); - -_CLC_OVERLOAD _CLC_DEF int -get_image_depth(image3d_t image) { - return __clc_get_image_depth_3d(image); -} diff --git a/libclc/amdgpu/lib/image/get_image_height.cl b/libclc/amdgpu/lib/image/get_image_height.cl deleted file mode 100644 index 80b364090c31..000000000000 --- a/libclc/amdgpu/lib/image/get_image_height.cl +++ /dev/null @@ -1,13 +0,0 @@ -#include - -_CLC_DECL int __clc_get_image_height_2d(image2d_t); -_CLC_DECL int __clc_get_image_height_3d(image3d_t); - -_CLC_OVERLOAD _CLC_DEF int -get_image_height(image2d_t image) { - return __clc_get_image_height_2d(image); -} -_CLC_OVERLOAD _CLC_DEF int -get_image_height(image3d_t image) { - return __clc_get_image_height_3d(image); -} diff --git a/libclc/amdgpu/lib/image/get_image_width.cl b/libclc/amdgpu/lib/image/get_image_width.cl deleted file mode 100644 index 29e4e9468ba8..000000000000 --- a/libclc/amdgpu/lib/image/get_image_width.cl +++ /dev/null @@ -1,13 +0,0 @@ -#include - -_CLC_DECL int __clc_get_image_width_2d(image2d_t); -_CLC_DECL int __clc_get_image_width_3d(image3d_t); - -_CLC_OVERLOAD _CLC_DEF int -get_image_width(image2d_t image) { - return __clc_get_image_width_2d(image); -} -_CLC_OVERLOAD _CLC_DEF int -get_image_width(image3d_t image) { - return __clc_get_image_width_3d(image); -} diff --git a/libclc/amdgpu/lib/image/read_image_impl.ll b/libclc/amdgpu/lib/image/read_image_impl.ll deleted file mode 100644 index 229a2526c374..000000000000 --- a/libclc/amdgpu/lib/image/read_image_impl.ll +++ /dev/null @@ -1,46 +0,0 @@ -%opencl.image2d_t = type opaque - -declare <4 x float> @llvm.R600.tex(<4 x float>, i32, i32, i32, i32, i32, i32, - i32, i32, i32) readnone -declare i32 @llvm.OpenCL.image.get.resource.id.2d( - %opencl.image2d_t addrspace(1)*) nounwind readnone -declare i32 @llvm.OpenCL.sampler.get.resource.id(i32) readnone - -define <4 x float> @__clc_v4f_from_v2f(<2 x float> %v) alwaysinline { - %e0 = extractelement <2 x float> %v, i32 0 - %e1 = extractelement <2 x float> %v, i32 1 - %res.0 = insertelement <4 x float> undef, float %e0, i32 0 - %res.1 = insertelement <4 x float> %res.0, float %e1, i32 1 - %res.2 = insertelement <4 x float> %res.1, float 0.0, i32 2 - %res.3 = insertelement <4 x float> %res.2, float 0.0, i32 3 - ret <4 x float> %res.3 -} - -define <4 x float> @__clc_read_imagef_tex( - %opencl.image2d_t addrspace(1)* nocapture %img, - i32 %sampler, <2 x float> %coord) alwaysinline { -entry: - %coord_v4 = call <4 x float> @__clc_v4f_from_v2f(<2 x float> %coord) - %smp_id = call i32 @llvm.OpenCL.sampler.get.resource.id(i32 %sampler) - %img_id = call i32 @llvm.OpenCL.image.get.resource.id.2d( - %opencl.image2d_t addrspace(1)* %img) - %tex_id = add i32 %img_id, 2 ; First 2 IDs are reserved. - - %coord_norm = and i32 %sampler, 1 - %is_norm = icmp eq i32 %coord_norm, 1 - br i1 %is_norm, label %NormCoord, label %UnnormCoord -NormCoord: - %data.norm = call <4 x float> @llvm.R600.tex( - <4 x float> %coord_v4, - i32 0, i32 0, i32 0, ; Offset. - i32 2, i32 %smp_id, - i32 1, i32 1, i32 1, i32 1) ; Normalized coords. - ret <4 x float> %data.norm -UnnormCoord: - %data.unnorm = call <4 x float> @llvm.R600.tex( - <4 x float> %coord_v4, - i32 0, i32 0, i32 0, ; Offset. - i32 %tex_id, i32 %smp_id, - i32 0, i32 0, i32 0, i32 0) ; Unnormalized coords. - ret <4 x float> %data.unnorm -} diff --git a/libclc/amdgpu/lib/image/read_imagef.cl b/libclc/amdgpu/lib/image/read_imagef.cl deleted file mode 100644 index af80adad189d..000000000000 --- a/libclc/amdgpu/lib/image/read_imagef.cl +++ /dev/null @@ -1,14 +0,0 @@ -#include - -_CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2); - -_CLC_OVERLOAD _CLC_DEF float4 read_imagef(image2d_t image, sampler_t sampler, - int2 coord) { - float2 coord_float = (float2)(coord.x, coord.y); - return __clc_read_imagef_tex(image, sampler, coord_float); -} - -_CLC_OVERLOAD _CLC_DEF float4 read_imagef(image2d_t image, sampler_t sampler, - float2 coord) { - return __clc_read_imagef_tex(image, sampler, coord); -} diff --git a/libclc/amdgpu/lib/image/read_imagei.cl b/libclc/amdgpu/lib/image/read_imagei.cl deleted file mode 100644 index b973aae94a07..000000000000 --- a/libclc/amdgpu/lib/image/read_imagei.cl +++ /dev/null @@ -1,23 +0,0 @@ -#include - -_CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2); - -int4 __clc_reinterpret_v4f_to_v4i(float4 v) { - union { - int4 v4i; - float4 v4f; - } res = { .v4f = v}; - return res.v4i; -} - -_CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler, - int2 coord) { - float2 coord_float = (float2)(coord.x, coord.y); - return __clc_reinterpret_v4f_to_v4i( - __clc_read_imagef_tex(image, sampler, coord_float)); -} -_CLC_OVERLOAD _CLC_DEF int4 read_imagei(image2d_t image, sampler_t sampler, - float2 coord) { - return __clc_reinterpret_v4f_to_v4i( - __clc_read_imagef_tex(image, sampler, coord)); -} diff --git a/libclc/amdgpu/lib/image/read_imageui.cl b/libclc/amdgpu/lib/image/read_imageui.cl deleted file mode 100644 index ec9836e7ec2a..000000000000 --- a/libclc/amdgpu/lib/image/read_imageui.cl +++ /dev/null @@ -1,23 +0,0 @@ -#include - -_CLC_DECL float4 __clc_read_imagef_tex(image2d_t, sampler_t, float2); - -uint4 __clc_reinterpret_v4f_to_v4ui(float4 v) { - union { - uint4 v4ui; - float4 v4f; - } res = { .v4f = v}; - return res.v4ui; -} - -_CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler, - int2 coord) { - float2 coord_float = (float2)(coord.x, coord.y); - return __clc_reinterpret_v4f_to_v4ui( - __clc_read_imagef_tex(image, sampler, coord_float)); -} -_CLC_OVERLOAD _CLC_DEF uint4 read_imageui(image2d_t image, sampler_t sampler, - float2 coord) { - return __clc_reinterpret_v4f_to_v4ui( - __clc_read_imagef_tex(image, sampler, coord)); -} diff --git a/libclc/amdgpu/lib/image/write_image_impl.ll b/libclc/amdgpu/lib/image/write_image_impl.ll deleted file mode 100644 index 265f5d6045e4..000000000000 --- a/libclc/amdgpu/lib/image/write_image_impl.ll +++ /dev/null @@ -1,52 +0,0 @@ -%opencl.image2d_t = type opaque -%opencl.image3d_t = type opaque - -declare i32 @llvm.OpenCL.image.get.resource.id.2d( - %opencl.image2d_t addrspace(1)*) nounwind readnone -declare i32 @llvm.OpenCL.image.get.resource.id.3d( - %opencl.image3d_t addrspace(1)*) nounwind readnone - -declare void @llvm.r600.rat.store.typed(<4 x i32> %color, <4 x i32> %coord, i32 %rat_id) - -define void @__clc_write_imageui_2d( - %opencl.image2d_t addrspace(1)* nocapture %img, - <2 x i32> %coord, <4 x i32> %color) #0 { - - ; Coordinate int2 -> int4. - %e0 = extractelement <2 x i32> %coord, i32 0 - %e1 = extractelement <2 x i32> %coord, i32 1 - %coord.0 = insertelement <4 x i32> undef, i32 %e0, i32 0 - %coord.1 = insertelement <4 x i32> %coord.0, i32 %e1, i32 1 - %coord.2 = insertelement <4 x i32> %coord.1, i32 0, i32 2 - %coord.3 = insertelement <4 x i32> %coord.2, i32 0, i32 3 - - ; Get RAT ID. - %img_id = call i32 @llvm.OpenCL.image.get.resource.id.2d( - %opencl.image2d_t addrspace(1)* %img) - %rat_id = add i32 %img_id, 1 - - ; Call store intrinsic. - call void @llvm.r600.rat.store.typed(<4 x i32> %color, <4 x i32> %coord.3, i32 %rat_id) - ret void -} - -define void @__clc_write_imagei_2d( - %opencl.image2d_t addrspace(1)* nocapture %img, - <2 x i32> %coord, <4 x i32> %color) #0 { - call void @__clc_write_imageui_2d( - %opencl.image2d_t addrspace(1)* nocapture %img, - <2 x i32> %coord, <4 x i32> %color) - ret void -} - -define void @__clc_write_imagef_2d( - %opencl.image2d_t addrspace(1)* nocapture %img, - <2 x i32> %coord, <4 x float> %color) #0 { - %color.i32 = bitcast <4 x float> %color to <4 x i32> - call void @__clc_write_imageui_2d( - %opencl.image2d_t addrspace(1)* nocapture %img, - <2 x i32> %coord, <4 x i32> %color.i32) - ret void -} - -attributes #0 = { alwaysinline } diff --git a/libclc/amdgpu/lib/image/write_imagef.cl b/libclc/amdgpu/lib/image/write_imagef.cl deleted file mode 100644 index 4483fcf68dbe..000000000000 --- a/libclc/amdgpu/lib/image/write_imagef.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -_CLC_DECL void __clc_write_imagef_2d(image2d_t image, int2 coord, float4 color); - -_CLC_OVERLOAD _CLC_DEF void -write_imagef(image2d_t image, int2 coord, float4 color) -{ - __clc_write_imagef_2d(image, coord, color); -} diff --git a/libclc/amdgpu/lib/image/write_imagei.cl b/libclc/amdgpu/lib/image/write_imagei.cl deleted file mode 100644 index 394a223d0a8c..000000000000 --- a/libclc/amdgpu/lib/image/write_imagei.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -_CLC_DECL void __clc_write_imagei_2d(image2d_t image, int2 coord, int4 color); - -_CLC_OVERLOAD _CLC_DEF void -write_imagei(image2d_t image, int2 coord, int4 color) -{ - __clc_write_imagei_2d(image, coord, color); -} diff --git a/libclc/amdgpu/lib/image/write_imageui.cl b/libclc/amdgpu/lib/image/write_imageui.cl deleted file mode 100644 index 91344de8a1df..000000000000 --- a/libclc/amdgpu/lib/image/write_imageui.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -_CLC_DECL void __clc_write_imageui_2d(image2d_t image, int2 coord, uint4 color); - -_CLC_OVERLOAD _CLC_DEF void -write_imageui(image2d_t image, int2 coord, uint4 color) -{ - __clc_write_imageui_2d(image, coord, color); -} diff --git a/libclc/amdgpu/lib/math/nextafter.cl b/libclc/amdgpu/lib/math/nextafter.cl deleted file mode 100644 index 4611c81ae91e..000000000000 --- a/libclc/amdgpu/lib/math/nextafter.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include -#include "../lib/clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, nextafter, __clc_nextafter, float, float) diff --git a/libclc/amdgpu/lib/math/sqrt.cl b/libclc/amdgpu/lib/math/sqrt.cl deleted file mode 100644 index 3e5b17c5db05..000000000000 --- a/libclc/amdgpu/lib/math/sqrt.cl +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "../../../generic/lib/clcmacro.h" -#include "math/clc_sqrt.h" - -_CLC_DEFINE_UNARY_BUILTIN(float, sqrt, __clc_sqrt, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - - -_CLC_OVERLOAD _CLC_DEF double sqrt(double x) { - - uint vcc = x < 0x1p-767; - uint exp0 = vcc ? 0x100 : 0; - unsigned exp1 = vcc ? 0xffffff80 : 0; - - double v01 = ldexp(x, exp0); - double v23 = __builtin_amdgpu_rsq(v01); - double v45 = v01 * v23; - v23 = v23 * 0.5; - - double v67 = fma(-v23, v45, 0.5); - v45 = fma(v45, v67, v45); - double v89 = fma(-v45, v45, v01); - v23 = fma(v23, v67, v23); - v45 = fma(v89, v23, v45); - v67 = fma(-v45, v45, v01); - v23 = fma(v67, v23, v45); - - v23 = ldexp(v23, exp1); - return ((x == __builtin_inf()) || (x == 0.0)) ? v01 : v23; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, sqrt, double); - -#endif diff --git a/libclc/amdgpu/lib/synchronization/barrier.cl b/libclc/amdgpu/lib/synchronization/barrier.cl deleted file mode 100644 index 6f2900b06eef..000000000000 --- a/libclc/amdgpu/lib/synchronization/barrier.cl +++ /dev/null @@ -1,10 +0,0 @@ - -#include - -_CLC_DEF int __clc_clk_local_mem_fence() { - return CLK_LOCAL_MEM_FENCE; -} - -_CLC_DEF int __clc_clk_global_mem_fence() { - return CLK_GLOBAL_MEM_FENCE; -} diff --git a/libclc/amdgpu/lib/workitem/get_global_size.ll b/libclc/amdgpu/lib/workitem/get_global_size.ll deleted file mode 100644 index ac2d08d8ee19..000000000000 --- a/libclc/amdgpu/lib/workitem/get_global_size.ll +++ /dev/null @@ -1,18 +0,0 @@ -declare i32 @llvm.r600.read.global.size.x() nounwind readnone -declare i32 @llvm.r600.read.global.size.y() nounwind readnone -declare i32 @llvm.r600.read.global.size.z() nounwind readnone - -define i32 @get_global_size(i32 %dim) nounwind readnone alwaysinline { - switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim] -x_dim: - %x = call i32 @llvm.r600.read.global.size.x() nounwind readnone - ret i32 %x -y_dim: - %y = call i32 @llvm.r600.read.global.size.y() nounwind readnone - ret i32 %y -z_dim: - %z = call i32 @llvm.r600.read.global.size.z() nounwind readnone - ret i32 %z -default: - ret i32 0 -} diff --git a/libclc/amdgpu/lib/workitem/get_local_size.ll b/libclc/amdgpu/lib/workitem/get_local_size.ll deleted file mode 100644 index 0a98de683ae4..000000000000 --- a/libclc/amdgpu/lib/workitem/get_local_size.ll +++ /dev/null @@ -1,18 +0,0 @@ -declare i32 @llvm.r600.read.local.size.x() nounwind readnone -declare i32 @llvm.r600.read.local.size.y() nounwind readnone -declare i32 @llvm.r600.read.local.size.z() nounwind readnone - -define i32 @get_local_size(i32 %dim) nounwind readnone alwaysinline { - switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim] -x_dim: - %x = call i32 @llvm.r600.read.local.size.x() nounwind readnone - ret i32 %x -y_dim: - %y = call i32 @llvm.r600.read.local.size.y() nounwind readnone - ret i32 %y -z_dim: - %z = call i32 @llvm.r600.read.local.size.z() nounwind readnone - ret i32 %z -default: - ret i32 0 -} diff --git a/libclc/amdgpu/lib/workitem/get_num_groups.ll b/libclc/amdgpu/lib/workitem/get_num_groups.ll deleted file mode 100644 index a708f422c27e..000000000000 --- a/libclc/amdgpu/lib/workitem/get_num_groups.ll +++ /dev/null @@ -1,18 +0,0 @@ -declare i32 @llvm.r600.read.ngroups.x() nounwind readnone -declare i32 @llvm.r600.read.ngroups.y() nounwind readnone -declare i32 @llvm.r600.read.ngroups.z() nounwind readnone - -define i32 @get_num_groups(i32 %dim) nounwind readnone alwaysinline { - switch i32 %dim, label %default [i32 0, label %x_dim i32 1, label %y_dim i32 2, label %z_dim] -x_dim: - %x = call i32 @llvm.r600.read.ngroups.x() nounwind readnone - ret i32 %x -y_dim: - %y = call i32 @llvm.r600.read.ngroups.y() nounwind readnone - ret i32 %y -z_dim: - %z = call i32 @llvm.r600.read.ngroups.z() nounwind readnone - ret i32 %z -default: - ret i32 0 -} diff --git a/libclc/amdgpu/lib/workitem/get_work_dim.ll b/libclc/amdgpu/lib/workitem/get_work_dim.ll deleted file mode 100644 index 1f86b5e05f5d..000000000000 --- a/libclc/amdgpu/lib/workitem/get_work_dim.ll +++ /dev/null @@ -1,8 +0,0 @@ -declare i32 @llvm.AMDGPU.read.workdim() nounwind readnone - -define i32 @get_work_dim() nounwind readnone alwaysinline { - %x = call i32 @llvm.AMDGPU.read.workdim() nounwind readnone , !range !0 - ret i32 %x -} - -!0 = !{ i32 1, i32 4 } diff --git a/libclc/build/metabuild.py b/libclc/build/metabuild.py deleted file mode 100644 index 4ab5db58e06e..000000000000 --- a/libclc/build/metabuild.py +++ /dev/null @@ -1,100 +0,0 @@ -import ninja_syntax -import os - -# Simple meta-build system. - -class Make(object): - def __init__(self): - self.output = open(self.output_filename(), 'w') - self.rules = {} - self.rule_text = '' - self.all_targets = [] - self.default_targets = [] - self.clean_files = [] - self.distclean_files = [] - self.output.write("""all:: - -ifndef VERBOSE - Verb = @ -endif - -""") - - def output_filename(self): - return 'Makefile' - - def rule(self, name, command, description=None, depfile=None, - generator=False): - self.rules[name] = {'command': command, 'description': description, - 'depfile': depfile, 'generator': generator} - - def build(self, output, rule, inputs=[], implicit=[], order_only=[]): - inputs = self._as_list(inputs) - implicit = self._as_list(implicit) - order_only = self._as_list(order_only) - - output_dir = os.path.dirname(output) - if output_dir != '' and not os.path.isdir(output_dir): - os.makedirs(output_dir) - - dollar_in = ' '.join(inputs) - subst = lambda text: text.replace('$in', dollar_in).replace('$out', output) - - deps = ' '.join(inputs + implicit) - if order_only: - deps += ' | ' - deps += ' '.join(order_only) - self.output.write('%s: %s\n' % (output, deps)) - - r = self.rules[rule] - command = subst(r['command']) - if r['description']: - desc = subst(r['description']) - self.output.write('\t@echo %s\n\t$(Verb) %s\n' % (desc, command)) - else: - self.output.write('\t%s\n' % command) - if r['depfile']: - depfile = subst(r['depfile']) - self.output.write('-include '+depfile+'\n') - self.output.write('\n') - - self.all_targets.append(output) - if r['generator']: - self.distclean_files.append(output) - if r['depfile']: - self.distclean_files.append(depfile) - else: - self.clean_files.append(output) - if r['depfile']: - self.distclean_files.append(depfile) - - - def _as_list(self, input): - if isinstance(input, list): - return input - return [input] - - def default(self, paths): - self.default_targets += self._as_list(paths) - - def finish(self): - self.output.write('all:: %s\n\n' % ' '.join(self.default_targets or self.all_targets)) - self.output.write('clean: \n\trm -f %s\n\n' % ' '.join(self.clean_files)) - self.output.write('distclean: clean\n\trm -f %s\n' % ' '.join(self.distclean_files)) - -class Ninja(ninja_syntax.Writer): - def __init__(self): - ninja_syntax.Writer.__init__(self, open(self.output_filename(), 'w')) - - def output_filename(self): - return 'build.ninja' - - def finish(self): - pass - -def from_name(name): - if name == 'make': - return Make() - if name == 'ninja': - return Ninja() - raise LookupError, 'unknown generator: %s; supported generators are make and ninja' % name diff --git a/libclc/build/ninja_syntax.py b/libclc/build/ninja_syntax.py deleted file mode 100644 index 7d9f592dfadf..000000000000 --- a/libclc/build/ninja_syntax.py +++ /dev/null @@ -1,118 +0,0 @@ -#!/usr/bin/python - -"""Python module for generating .ninja files. - -Note that this is emphatically not a required piece of Ninja; it's -just a helpful utility for build-file-generation systems that already -use Python. -""" - -import textwrap -import re - -class Writer(object): - def __init__(self, output, width=78): - self.output = output - self.width = width - - def newline(self): - self.output.write('\n') - - def comment(self, text): - for line in textwrap.wrap(text, self.width - 2): - self.output.write('# ' + line + '\n') - - def variable(self, key, value, indent=0): - if value is None: - return - if isinstance(value, list): - value = ' '.join(value) - self._line('%s = %s' % (key, value), indent) - - def rule(self, name, command, description=None, depfile=None, - generator=False): - self._line('rule %s' % name) - self.variable('command', escape(command), indent=1) - if description: - self.variable('description', description, indent=1) - if depfile: - self.variable('depfile', depfile, indent=1) - if generator: - self.variable('generator', '1', indent=1) - - def build(self, outputs, rule, inputs=None, implicit=None, order_only=None, - variables=None): - outputs = self._as_list(outputs) - all_inputs = self._as_list(inputs)[:] - - if implicit: - all_inputs.append('|') - all_inputs.extend(self._as_list(implicit)) - if order_only: - all_inputs.append('||') - all_inputs.extend(self._as_list(order_only)) - - self._line('build %s: %s %s' % (' '.join(outputs), - rule, - ' '.join(all_inputs))) - - if variables: - for key, val in variables: - self.variable(key, val, indent=1) - - return outputs - - def include(self, path): - self._line('include %s' % path) - - def subninja(self, path): - self._line('subninja %s' % path) - - def default(self, paths): - self._line('default %s' % ' '.join(self._as_list(paths))) - - def _line(self, text, indent=0): - """Write 'text' word-wrapped at self.width characters.""" - leading_space = ' ' * indent - while len(text) > self.width: - # The text is too wide; wrap if possible. - - # Find the rightmost space that would obey our width constraint. - available_space = self.width - len(leading_space) - len(' $') - space = text.rfind(' ', 0, available_space) - if space < 0: - # No such space; just use the first space we can find. - space = text.find(' ', available_space) - if space < 0: - # Give up on breaking. - break - - self.output.write(leading_space + text[0:space] + ' $\n') - text = text[space+1:] - - # Subsequent lines are continuations, so indent them. - leading_space = ' ' * (indent+2) - - self.output.write(leading_space + text + '\n') - - def _as_list(self, input): - if input is None: - return [] - if isinstance(input, list): - return input - return [input] - - -def escape(string): - """Escape a string such that Makefile and shell variables are - correctly escaped for use in a Ninja file. - """ - assert '\n' not in string, 'Ninja syntax does not allow newlines' - # We only have one special metacharacter: '$'. - - # We should leave $in and $out untouched. - # Just look for makefile/shell style substitutions - return re.sub(r'(\$[{(][a-z_]+[})])', - r'$\1', - string, - flags=re.IGNORECASE) diff --git a/libclc/compile-test.sh b/libclc/compile-test.sh deleted file mode 100755 index 47c7f385bb92..000000000000 --- a/libclc/compile-test.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh - -clang -target nvptx--nvidiacl -Iptx-nvidiacl/include -Igeneric/include -Xclang -mlink-bitcode-file -Xclang nvptx--nvidiacl/lib/builtins.bc -include clc/clc.h -Dcl_clang_storage_class_specifiers -Dcl_khr_fp64 "$@" diff --git a/libclc/configure.py b/libclc/configure.py deleted file mode 100755 index b96faee78f65..000000000000 --- a/libclc/configure.py +++ /dev/null @@ -1,282 +0,0 @@ -#!/usr/bin/python - -def c_compiler_rule(b, name, description, compiler, flags): - command = "%s -MMD -MF $out.d %s -c -o $out $in" % (compiler, flags) - b.rule(name, command, description + " $out", depfile="$out.d") - -version_major = 0; -version_minor = 2; -version_patch = 0; - -from optparse import OptionParser -import os -import string -from subprocess import * -import sys - -srcdir = os.path.dirname(sys.argv[0]) - -sys.path.insert(0, os.path.join(srcdir, 'build')) -import metabuild - -p = OptionParser() -p.add_option('--with-llvm-config', metavar='PATH', - help='use given llvm-config script') -p.add_option('--with-cxx-compiler', metavar='PATH', - help='use given C++ compiler') -p.add_option('--prefix', metavar='PATH', - help='install to given prefix') -p.add_option('--libexecdir', metavar='PATH', - help='install *.bc to given dir') -p.add_option('--includedir', metavar='PATH', - help='install include files to given dir') -p.add_option('--pkgconfigdir', metavar='PATH', - help='install clc.pc to given dir') -p.add_option('-g', metavar='GENERATOR', default='make', - help='use given generator (default: make)') -p.add_option('--enable-runtime-subnormal', action="store_true", default=False, - help='Allow runtimes to choose subnormal support') -(options, args) = p.parse_args() - -llvm_config_exe = options.with_llvm_config or "llvm-config" - -prefix = options.prefix -if not prefix: - prefix = '/usr/local' - -libexecdir = options.libexecdir -if not libexecdir: - libexecdir = os.path.join(prefix, 'lib/clc') - -includedir = options.includedir -if not includedir: - includedir = os.path.join(prefix, 'include') - -pkgconfigdir = options.pkgconfigdir -if not pkgconfigdir: - pkgconfigdir = os.path.join(prefix, 'share/pkgconfig') - -def llvm_config(args): - try: - proc = Popen([llvm_config_exe] + args, stdout=PIPE) - return proc.communicate()[0].rstrip().replace('\n', ' ') - except OSError: - print "Error executing llvm-config." - print "Please ensure that llvm-config is in your $PATH, or use --with-llvm-config." - sys.exit(1) - -llvm_version = string.split(string.replace(llvm_config(['--version']), 'svn', ''), '.') -llvm_int_version = int(llvm_version[0]) * 100 + int(llvm_version[1]) * 10 -llvm_string_version = 'LLVM' + llvm_version[0] + '.' + llvm_version[1] - -if llvm_int_version < 390: - print "libclc requires LLVM >= 3.9" - sys.exit(1) - -llvm_system_libs = llvm_config(['--system-libs']) -llvm_bindir = llvm_config(['--bindir']) -llvm_core_libs = llvm_config(['--libs', 'core', 'bitreader', 'bitwriter']) + ' ' + \ - llvm_system_libs + ' ' + \ - llvm_config(['--ldflags']) -llvm_cxxflags = llvm_config(['--cxxflags']) + ' -fno-exceptions -fno-rtti' -llvm_libdir = llvm_config(['--libdir']) - -llvm_clang = os.path.join(llvm_bindir, 'clang') -llvm_link = os.path.join(llvm_bindir, 'llvm-link') -llvm_opt = os.path.join(llvm_bindir, 'opt') - -cxx_compiler = options.with_cxx_compiler -if not cxx_compiler: - cxx_compiler = os.path.join(llvm_bindir, 'clang++') - -available_targets = { - 'r600--' : { 'devices' : - [{'gpu' : 'cedar', 'aliases' : ['palm', 'sumo', 'sumo2', 'redwood', 'juniper']}, - {'gpu' : 'cypress', 'aliases' : ['hemlock'] }, - {'gpu' : 'barts', 'aliases' : ['turks', 'caicos'] }, - {'gpu' : 'cayman', 'aliases' : ['aruba']} ]}, - 'amdgcn--': { 'devices' : - [{'gpu' : 'tahiti', 'aliases' : ['pitcairn', 'verde', 'oland', 'hainan', 'bonaire', 'kabini', 'kaveri', 'hawaii','mullins','tonga','carrizo','iceland','fiji','stoney']} ]}, - 'amdgcn--amdhsa': { 'devices' : - [{'gpu' : '', 'aliases' : ['bonaire', 'hawaii', 'kabini', 'kaveri', 'mullins', 'carrizo', 'stoney', 'fiji', 'iceland', 'tonga']} ]}, - 'nvptx--' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]}, - 'nvptx64--' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]}, - 'nvptx--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]}, - 'nvptx64--nvidiacl' : { 'devices' : [{'gpu' : '', 'aliases' : []} ]}, -} - -default_targets = ['nvptx--nvidiacl', 'nvptx64--nvidiacl', 'r600--', 'amdgcn--', 'amdgcn--amdhsa'] - -targets = args -if not targets: - targets = default_targets - -b = metabuild.from_name(options.g) - -b.rule("LLVM_AS", "%s -o $out $in" % os.path.join(llvm_bindir, "llvm-as"), - 'LLVM-AS $out') -b.rule("LLVM_LINK", command = llvm_link + " -o $out $in", - description = 'LLVM-LINK $out') -b.rule("OPT", command = llvm_opt + " -O3 -o $out $in", - description = 'OPT $out') - -c_compiler_rule(b, "LLVM_TOOL_CXX", 'CXX', cxx_compiler, llvm_cxxflags) -b.rule("LLVM_TOOL_LINK", cxx_compiler + " -o $out $in %s" % llvm_core_libs + " -Wl,-rpath %s" % llvm_libdir, 'LINK $out') - -prepare_builtins = os.path.join('utils', 'prepare-builtins') -b.build(os.path.join('utils', 'prepare-builtins.o'), "LLVM_TOOL_CXX", - os.path.join(srcdir, 'utils', 'prepare-builtins.cpp')) -b.build(prepare_builtins, "LLVM_TOOL_LINK", - os.path.join('utils', 'prepare-builtins.o')) - -b.rule("PREPARE_BUILTINS", "%s -o $out $in" % prepare_builtins, - 'PREPARE-BUILTINS $out') -b.rule("PYTHON_GEN", "python < $in > $out", "PYTHON_GEN $out") -b.build('generic/lib/convert.cl', "PYTHON_GEN", ['generic/lib/gen_convert.py']) - -manifest_deps = set([sys.argv[0], os.path.join(srcdir, 'build', 'metabuild.py'), - os.path.join(srcdir, 'build', 'ninja_syntax.py')]) - -install_files_bc = [] -install_deps = [] - -# Create rules for subnormal helper objects -for src in ['subnormal_disable.ll', 'subnormal_use_default.ll']: - obj_name = src[:-2] + 'bc' - obj = os.path.join('generic--', 'lib', obj_name) - src_file = os.path.join('generic', 'lib', src) - b.build(obj, 'LLVM_AS', src_file) - b.default(obj) - install_files_bc.append((obj, obj)) - install_deps.append(obj) - -# Create libclc.pc -clc = open('libclc.pc', 'w') -clc.write('includedir=%(inc)s\nlibexecdir=%(lib)s\n\nName: libclc\nDescription: Library requirements of the OpenCL C programming language\nVersion: %(maj)s.%(min)s.%(pat)s\nCflags: -I${includedir}\nLibs: -L${libexecdir}' % -{'inc': includedir, 'lib': libexecdir, 'maj': version_major, 'min': version_minor, 'pat': version_patch}) -clc.close() - -for target in targets: - (t_arch, t_vendor, t_os) = target.split('-') - archs = [t_arch] - if t_arch == 'nvptx' or t_arch == 'nvptx64': - archs.append('ptx') - archs.append('generic') - - subdirs = [] - for arch in archs: - subdirs.append("%s-%s-%s" % (arch, t_vendor, t_os)) - subdirs.append("%s-%s" % (arch, t_os)) - subdirs.append(arch) - if arch == 'amdgcn' or arch == 'r600': - subdirs.append('amdgpu') - - incdirs = filter(os.path.isdir, - [os.path.join(srcdir, subdir, 'include') for subdir in subdirs]) - libdirs = filter(lambda d: os.path.isfile(os.path.join(d, 'SOURCES')), - [os.path.join(srcdir, subdir, 'lib') for subdir in subdirs]) - - clang_cl_includes = ' '.join(["-I%s" % incdir for incdir in incdirs]) - - for device in available_targets[target]['devices']: - # The rule for building a .bc file for the specified architecture using clang. - clang_bc_flags = "-target %s -I`dirname $in` %s " \ - "-fno-builtin " \ - "-D__CLC_INTERNAL " \ - "-emit-llvm" % (target, clang_cl_includes) - if device['gpu'] != '': - clang_bc_flags += ' -mcpu=' + device['gpu'] - clang_bc_rule = "CLANG_CL_BC_" + target + "_" + device['gpu'] - c_compiler_rule(b, clang_bc_rule, "LLVM-CC", llvm_clang, clang_bc_flags) - - objects = [] - sources_seen = set() - compats_seen = set() - - if device['gpu'] == '': - full_target_name = target - obj_suffix = '' - else: - full_target_name = device['gpu'] + '-' + target - obj_suffix = '.' + device['gpu'] - - for libdir in libdirs: - subdir_list_file = os.path.join(libdir, 'SOURCES') - manifest_deps.add(subdir_list_file) - override_list_file = os.path.join(libdir, 'OVERRIDES') - compat_list_file = os.path.join(libdir, - 'SOURCES_' + llvm_string_version) - - # Build compat list - if os.path.exists(compat_list_file): - for compat in open(compat_list_file).readlines(): - compat = compat.rstrip() - compats_seen.add(compat) - - # Add target overrides - if os.path.exists(override_list_file): - for override in open(override_list_file).readlines(): - override = override.rstrip() - sources_seen.add(override) - - for src in open(subdir_list_file).readlines(): - src = src.rstrip() - if src not in sources_seen: - sources_seen.add(src) - obj = os.path.join(target, 'lib', src + obj_suffix + '.bc') - objects.append(obj) - src_path = libdir - if src in compats_seen: - src_path = os.path.join(libdir, llvm_string_version) - src_file = os.path.join(src_path, src) - ext = os.path.splitext(src)[1] - if ext == '.ll': - b.build(obj, 'LLVM_AS', src_file) - else: - b.build(obj, clang_bc_rule, src_file) - - obj = os.path.join('generic--', 'lib', 'subnormal_use_default.bc') - if not options.enable_runtime_subnormal: - objects.append(obj) - - builtins_link_bc = os.path.join(target, 'lib', 'builtins.link' + obj_suffix + '.bc') - builtins_opt_bc = os.path.join(target, 'lib', 'builtins.opt' + obj_suffix + '.bc') - builtins_bc = os.path.join('built_libs', full_target_name + '.bc') - b.build(builtins_link_bc, "LLVM_LINK", objects) - b.build(builtins_opt_bc, "OPT", builtins_link_bc) - b.build(builtins_bc, "PREPARE_BUILTINS", builtins_opt_bc, prepare_builtins) - install_files_bc.append((builtins_bc, builtins_bc)) - install_deps.append(builtins_bc) - for alias in device['aliases']: - # Ninja cannot have multiple rules with same name so append suffix - ruleName = "CREATE_ALIAS_{0}_for_{1}".format(alias, device['gpu']) - b.rule(ruleName, "ln -fs %s $out" % os.path.basename(builtins_bc) - ,"CREATE-ALIAS $out") - - alias_file = os.path.join('built_libs', alias + '-' + target + '.bc') - b.build(alias_file, ruleName, builtins_bc) - install_files_bc.append((alias_file, alias_file)) - install_deps.append(alias_file) - b.default(builtins_bc) - - -install_cmd = ' && '.join(['mkdir -p ${DESTDIR}/%(dst)s && cp -r %(src)s ${DESTDIR}/%(dst)s' % - {'src': file, - 'dst': libexecdir} - for (file, dest) in install_files_bc]) -install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r %(srcdir)s/generic/include/clc ${DESTDIR}/%(dst)s' % - {'old': install_cmd, - 'dst': includedir, - 'srcdir': srcdir}]) -install_cmd = ' && '.join(['%(old)s && mkdir -p ${DESTDIR}/%(dst)s && cp -r libclc.pc ${DESTDIR}/%(dst)s' % - {'old': install_cmd, - 'dst': pkgconfigdir}]) - -b.rule('install', command = install_cmd, description = 'INSTALL') -b.build('install', 'install', install_deps) - -b.rule("configure", command = ' '.join(sys.argv), description = 'CONFIGURE', - generator = True) -b.build(b.output_filename(), 'configure', list(manifest_deps)) - -b.finish() diff --git a/libclc/generic/include/clc/as_type.h b/libclc/generic/include/clc/as_type.h deleted file mode 100644 index 0bb9ee2e8313..000000000000 --- a/libclc/generic/include/clc/as_type.h +++ /dev/null @@ -1,68 +0,0 @@ -#define as_char(x) __builtin_astype(x, char) -#define as_uchar(x) __builtin_astype(x, uchar) -#define as_short(x) __builtin_astype(x, short) -#define as_ushort(x) __builtin_astype(x, ushort) -#define as_int(x) __builtin_astype(x, int) -#define as_uint(x) __builtin_astype(x, uint) -#define as_long(x) __builtin_astype(x, long) -#define as_ulong(x) __builtin_astype(x, ulong) -#define as_float(x) __builtin_astype(x, float) - -#define as_char2(x) __builtin_astype(x, char2) -#define as_uchar2(x) __builtin_astype(x, uchar2) -#define as_short2(x) __builtin_astype(x, short2) -#define as_ushort2(x) __builtin_astype(x, ushort2) -#define as_int2(x) __builtin_astype(x, int2) -#define as_uint2(x) __builtin_astype(x, uint2) -#define as_long2(x) __builtin_astype(x, long2) -#define as_ulong2(x) __builtin_astype(x, ulong2) -#define as_float2(x) __builtin_astype(x, float2) - -#define as_char3(x) __builtin_astype(x, char3) -#define as_uchar3(x) __builtin_astype(x, uchar3) -#define as_short3(x) __builtin_astype(x, short3) -#define as_ushort3(x) __builtin_astype(x, ushort3) -#define as_int3(x) __builtin_astype(x, int3) -#define as_uint3(x) __builtin_astype(x, uint3) -#define as_long3(x) __builtin_astype(x, long3) -#define as_ulong3(x) __builtin_astype(x, ulong3) -#define as_float3(x) __builtin_astype(x, float3) - -#define as_char4(x) __builtin_astype(x, char4) -#define as_uchar4(x) __builtin_astype(x, uchar4) -#define as_short4(x) __builtin_astype(x, short4) -#define as_ushort4(x) __builtin_astype(x, ushort4) -#define as_int4(x) __builtin_astype(x, int4) -#define as_uint4(x) __builtin_astype(x, uint4) -#define as_long4(x) __builtin_astype(x, long4) -#define as_ulong4(x) __builtin_astype(x, ulong4) -#define as_float4(x) __builtin_astype(x, float4) - -#define as_char8(x) __builtin_astype(x, char8) -#define as_uchar8(x) __builtin_astype(x, uchar8) -#define as_short8(x) __builtin_astype(x, short8) -#define as_ushort8(x) __builtin_astype(x, ushort8) -#define as_int8(x) __builtin_astype(x, int8) -#define as_uint8(x) __builtin_astype(x, uint8) -#define as_long8(x) __builtin_astype(x, long8) -#define as_ulong8(x) __builtin_astype(x, ulong8) -#define as_float8(x) __builtin_astype(x, float8) - -#define as_char16(x) __builtin_astype(x, char16) -#define as_uchar16(x) __builtin_astype(x, uchar16) -#define as_short16(x) __builtin_astype(x, short16) -#define as_ushort16(x) __builtin_astype(x, ushort16) -#define as_int16(x) __builtin_astype(x, int16) -#define as_uint16(x) __builtin_astype(x, uint16) -#define as_long16(x) __builtin_astype(x, long16) -#define as_ulong16(x) __builtin_astype(x, ulong16) -#define as_float16(x) __builtin_astype(x, float16) - -#ifdef cl_khr_fp64 -#define as_double(x) __builtin_astype(x, double) -#define as_double2(x) __builtin_astype(x, double2) -#define as_double3(x) __builtin_astype(x, double3) -#define as_double4(x) __builtin_astype(x, double4) -#define as_double8(x) __builtin_astype(x, double8) -#define as_double16(x) __builtin_astype(x, double16) -#endif diff --git a/libclc/generic/include/clc/async/async_work_group_copy.h b/libclc/generic/include/clc/async/async_work_group_copy.h deleted file mode 100644 index 39c637b0e265..000000000000 --- a/libclc/generic/include/clc/async/async_work_group_copy.h +++ /dev/null @@ -1,15 +0,0 @@ -#define __CLC_DST_ADDR_SPACE local -#define __CLC_SRC_ADDR_SPACE global -#define __CLC_BODY -#include -#undef __CLC_DST_ADDR_SPACE -#undef __CLC_SRC_ADDR_SPACE -#undef __CLC_BODY - -#define __CLC_DST_ADDR_SPACE global -#define __CLC_SRC_ADDR_SPACE local -#define __CLC_BODY -#include -#undef __CLC_DST_ADDR_SPACE -#undef __CLC_SRC_ADDR_SPACE -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/async/async_work_group_copy.inc b/libclc/generic/include/clc/async/async_work_group_copy.inc deleted file mode 100644 index d85df6c8fadd..000000000000 --- a/libclc/generic/include/clc/async/async_work_group_copy.inc +++ /dev/null @@ -1,5 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL event_t async_work_group_copy( - __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst, - const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src, - size_t num_gentypes, - event_t event); diff --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.h b/libclc/generic/include/clc/async/async_work_group_strided_copy.h deleted file mode 100644 index bfa6f31faca8..000000000000 --- a/libclc/generic/include/clc/async/async_work_group_strided_copy.h +++ /dev/null @@ -1,15 +0,0 @@ -#define __CLC_DST_ADDR_SPACE local -#define __CLC_SRC_ADDR_SPACE global -#define __CLC_BODY -#include -#undef __CLC_DST_ADDR_SPACE -#undef __CLC_SRC_ADDR_SPACE -#undef __CLC_BODY - -#define __CLC_DST_ADDR_SPACE global -#define __CLC_SRC_ADDR_SPACE local -#define __CLC_BODY -#include -#undef __CLC_DST_ADDR_SPACE -#undef __CLC_SRC_ADDR_SPACE -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/async/async_work_group_strided_copy.inc b/libclc/generic/include/clc/async/async_work_group_strided_copy.inc deleted file mode 100644 index bdbea3aa4a16..000000000000 --- a/libclc/generic/include/clc/async/async_work_group_strided_copy.inc +++ /dev/null @@ -1,6 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL event_t async_work_group_strided_copy( - __CLC_DST_ADDR_SPACE __CLC_GENTYPE *dst, - const __CLC_SRC_ADDR_SPACE __CLC_GENTYPE *src, - size_t num_gentypes, - size_t stride, - event_t event); diff --git a/libclc/generic/include/clc/async/gentype.inc b/libclc/generic/include/clc/async/gentype.inc deleted file mode 100644 index 6b79acdff171..000000000000 --- a/libclc/generic/include/clc/async/gentype.inc +++ /dev/null @@ -1,204 +0,0 @@ - -#define __CLC_GENTYPE char -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE char2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE char4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE char8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE char16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uchar -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uchar2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uchar4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uchar8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uchar16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE short -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE short2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE short4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE short8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE short16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ushort -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ushort2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ushort4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ushort8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ushort16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE float -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE float2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE float4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE float8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE float16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE long -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE long2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE long4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE long8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE long16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ulong -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ulong2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ulong4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ulong8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE ulong16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#ifdef cl_khr_fp64 - -#define __CLC_GENTYPE double -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE double2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE double4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE double8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE double16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#endif diff --git a/libclc/generic/include/clc/async/prefetch.h b/libclc/generic/include/clc/async/prefetch.h deleted file mode 100644 index f64bc2045de9..000000000000 --- a/libclc/generic/include/clc/async/prefetch.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/async/prefetch.inc b/libclc/generic/include/clc/async/prefetch.inc deleted file mode 100644 index f817a66c249c..000000000000 --- a/libclc/generic/include/clc/async/prefetch.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes); diff --git a/libclc/generic/include/clc/async/wait_group_events.h b/libclc/generic/include/clc/async/wait_group_events.h deleted file mode 100644 index 799efa0a791c..000000000000 --- a/libclc/generic/include/clc/async/wait_group_events.h +++ /dev/null @@ -1 +0,0 @@ -void wait_group_events(int num_events, event_t *event_list); diff --git a/libclc/generic/include/clc/atomic/atomic_add.h b/libclc/generic/include/clc/atomic/atomic_add.h deleted file mode 100644 index 7dd4fd3c682e..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_add.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_add -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_and.h b/libclc/generic/include/clc/atomic/atomic_and.h deleted file mode 100644 index a198c46b7ee9..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_and.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_and -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_cmpxchg.h b/libclc/generic/include/clc/atomic/atomic_cmpxchg.h deleted file mode 100644 index 2e4f1c21dcc2..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_cmpxchg.h +++ /dev/null @@ -1,15 +0,0 @@ -#define __CLC_FUNCTION atomic_cmpxchg - -#define __CLC_DECLARE_ATOMIC_3_ARG(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE, TYPE); - -#define __CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(TYPE) \ - __CLC_DECLARE_ATOMIC_3_ARG(global, TYPE) \ - __CLC_DECLARE_ATOMIC_3_ARG(local, TYPE) - -__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(int) -__CLC_DECLARE_ATOMIC_ADDRSPACE_3_ARG(uint) - -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC_3_ARG -#undef __CLC_DECLARE_ATOMIC_ADDRESS_SPACE_3_ARG diff --git a/libclc/generic/include/clc/atomic/atomic_dec.h b/libclc/generic/include/clc/atomic/atomic_dec.h deleted file mode 100644 index 15d05884aeb4..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_dec.h +++ /dev/null @@ -1 +0,0 @@ -#define atomic_dec(p) atomic_sub(p, 1) diff --git a/libclc/generic/include/clc/atomic/atomic_decl.inc b/libclc/generic/include/clc/atomic/atomic_decl.inc deleted file mode 100644 index 49ccde2bae52..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_decl.inc +++ /dev/null @@ -1,10 +0,0 @@ - -#define __CLC_DECLARE_ATOMIC(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE __CLC_FUNCTION (volatile ADDRSPACE TYPE *, TYPE); - -#define __CLC_DECLARE_ATOMIC_ADDRSPACE(TYPE) \ - __CLC_DECLARE_ATOMIC(global, TYPE) \ - __CLC_DECLARE_ATOMIC(local, TYPE) - -__CLC_DECLARE_ATOMIC_ADDRSPACE(int) -__CLC_DECLARE_ATOMIC_ADDRSPACE(uint) diff --git a/libclc/generic/include/clc/atomic/atomic_inc.h b/libclc/generic/include/clc/atomic/atomic_inc.h deleted file mode 100644 index d8bc342aa5f6..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_inc.h +++ /dev/null @@ -1 +0,0 @@ -#define atomic_inc(p) atomic_add(p, 1) diff --git a/libclc/generic/include/clc/atomic/atomic_max.h b/libclc/generic/include/clc/atomic/atomic_max.h deleted file mode 100644 index ed09ec9caef2..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_max.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_max -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_min.h b/libclc/generic/include/clc/atomic/atomic_min.h deleted file mode 100644 index 6a46af403d06..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_min.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_min -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_or.h b/libclc/generic/include/clc/atomic/atomic_or.h deleted file mode 100644 index 2369d81a3a06..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_or.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_or -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_sub.h b/libclc/generic/include/clc/atomic/atomic_sub.h deleted file mode 100644 index 993e995001fa..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_sub.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_sub -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_xchg.h b/libclc/generic/include/clc/atomic/atomic_xchg.h deleted file mode 100644 index ebe0d9af8098..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_xchg.h +++ /dev/null @@ -1,6 +0,0 @@ -#define __CLC_FUNCTION atomic_xchg -#include -__CLC_DECLARE_ATOMIC_ADDRSPACE(float); -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/atomic/atomic_xor.h b/libclc/generic/include/clc/atomic/atomic_xor.h deleted file mode 100644 index 2cb74803ca92..000000000000 --- a/libclc/generic/include/clc/atomic/atomic_xor.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION atomic_xor -#include -#undef __CLC_FUNCTION -#undef __CLC_DECLARE_ATOMIC -#undef __CLC_DECLARE_ATOMIC_ADDRSPACE diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h deleted file mode 100644 index 9740b3ddab63..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_add.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_add(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h deleted file mode 100644 index 168f423396a6..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_cmpxchg.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(global int *p, int cmp, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(global unsigned int *p, unsigned int cmp, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h deleted file mode 100644 index bbc872ce0527..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_dec.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_dec(global int *p); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(global unsigned int *p); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h deleted file mode 100644 index 050747c79403..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_inc.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_inc(global int *p); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(global unsigned int *p); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h deleted file mode 100644 index c435c726798c..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_sub.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_sub(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h b/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h deleted file mode 100644 index 6a18e9e8e1b1..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_base_atomics/atom_xchg.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xchg(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h deleted file mode 100644 index 19df7d6ed6ea..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_and.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_and(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h deleted file mode 100644 index b46ce29c40c5..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_max.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_max(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h deleted file mode 100644 index 0e458eb60eae..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_min.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_min(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h deleted file mode 100644 index 91cde56a4d7b..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_or.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_or(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h b/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h deleted file mode 100644 index f787849cff00..000000000000 --- a/libclc/generic/include/clc/cl_khr_global_int32_extended_atomics/atom_xor.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xor(global int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(global unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h deleted file mode 100644 index 096d01107d89..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_add.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_add(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_add(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h deleted file mode 100644 index e10a84f2cb47..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_cmpxchg.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_cmpxchg(local int *p, int cmp, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_cmpxchg(local unsigned int *p, unsigned int cmp, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h deleted file mode 100644 index e74d8fc12b92..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_dec.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_dec(local int *p); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_dec(local unsigned int *p); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h deleted file mode 100644 index 718f1f2b8041..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_inc.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_inc(local int *p); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_inc(local unsigned int *p); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h deleted file mode 100644 index 6363780e9dec..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_sub.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_sub(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_sub(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h b/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h deleted file mode 100644 index c5a1f09b0849..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_base_atomics/atom_xchg.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xchg(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xchg(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h deleted file mode 100644 index 96d7b1a89b6e..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_and.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_and(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_and(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h deleted file mode 100644 index 7d6b17df2a55..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_max.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_max(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_max(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h deleted file mode 100644 index ddb6cf379284..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_min.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_min(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_min(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h deleted file mode 100644 index 518c256dfbb8..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_or.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_or(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_or(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h b/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h deleted file mode 100644 index e6c9f2f57521..000000000000 --- a/libclc/generic/include/clc/cl_khr_local_int32_extended_atomics/atom_xor.h +++ /dev/null @@ -1,2 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int atom_xor(local int *p, int val); -_CLC_OVERLOAD _CLC_DECL unsigned int atom_xor(local unsigned int *p, unsigned int val); diff --git a/libclc/generic/include/clc/clc.h b/libclc/generic/include/clc/clc.h deleted file mode 100644 index 61f9b3571e31..000000000000 --- a/libclc/generic/include/clc/clc.h +++ /dev/null @@ -1,229 +0,0 @@ -#ifndef cl_clang_storage_class_specifiers -#error Implementation requires cl_clang_storage_class_specifiers extension! -#endif - -#pragma OPENCL EXTENSION cl_clang_storage_class_specifiers : enable - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -/* Function Attributes */ -#include - -/* 6.1 Supported Data Types */ -#include - -/* 6.2.3 Explicit Conversions */ -#include - -/* 6.2.4.2 Reinterpreting Types Using as_type() and as_typen() */ -#include - -/* 6.9 Preprocessor Directives and Macros */ -#include - -/* 6.11.1 Work-Item Functions */ -#include -#include -#include -#include -#include -#include - -/* 6.11.2 Math Functions */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* 6.11.2.1 Floating-point macros */ -#include - -/* 6.11.3 Integer Functions */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* 6.11.3 Integer Definitions */ -#include - -/* 6.11.2 and 6.11.3 Shared Integer/Math Functions */ -#include -#include -#include -#include -#include - -/* 6.11.4 Common Functions */ -#include -#include -#include -#include -#include -#include - -/* 6.11.5 Geometric Functions */ -#include -#include -#include -#include -#include -#include -#include -#include - -/* 6.11.6 Relational Functions */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* 6.11.8 Synchronization Functions */ -#include -#include - -/* 6.11.10 Async Copy and Prefetch Functions */ -#include -#include -#include -#include - -/* 6.11.11 Atomic Functions */ -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include - -/* cl_khr_global_int32_base_atomics Extension Functions */ -#include -#include -#include -#include -#include -#include - -/* cl_khr_global_int32_extended_atomics Extension Functions */ -#include -#include -#include -#include -#include - -/* cl_khr_local_int32_base_atomics Extension Functions */ -#include -#include -#include -#include -#include -#include - -/* cl_khr_local_int32_extended_atomics Extension Functions */ -#include -#include -#include -#include -#include - -/* 6.11.13 Image Read and Write Functions */ - -#include -#include - -/* libclc internal defintions */ -#ifdef __CLC_INTERNAL -#include -#endif - -#pragma OPENCL EXTENSION all : disable diff --git a/libclc/generic/include/clc/clcfunc.h b/libclc/generic/include/clc/clcfunc.h deleted file mode 100644 index 5f166c5a4143..000000000000 --- a/libclc/generic/include/clc/clcfunc.h +++ /dev/null @@ -1,4 +0,0 @@ -#define _CLC_OVERLOAD __attribute__((overloadable)) -#define _CLC_DECL -#define _CLC_DEF __attribute__((always_inline)) -#define _CLC_INLINE __attribute__((always_inline)) inline diff --git a/libclc/generic/include/clc/clctypes.h b/libclc/generic/include/clc/clctypes.h deleted file mode 100644 index 2e3db60dbdfe..000000000000 --- a/libclc/generic/include/clc/clctypes.h +++ /dev/null @@ -1,89 +0,0 @@ -/* 6.1.1 Built-in Scalar Data Types */ - -typedef unsigned char uchar; -typedef unsigned short ushort; -typedef unsigned int uint; -typedef unsigned long ulong; - -typedef __SIZE_TYPE__ size_t; -typedef __PTRDIFF_TYPE__ ptrdiff_t; - -#define __stdint_join3(a,b,c) a ## b ## c - -#define __intn_t(n) __stdint_join3(__INT, n, _TYPE__) -#define __uintn_t(n) __stdint_join3(unsigned __INT, n, _TYPE__) - -typedef __intn_t(__INTPTR_WIDTH__) intptr_t; -typedef __uintn_t(__INTPTR_WIDTH__) uintptr_t; - -#undef __uintn_t -#undef __intn_t -#undef __stdint_join3 - -/* 6.1.2 Built-in Vector Data Types */ - -typedef __attribute__((ext_vector_type(2))) char char2; -typedef __attribute__((ext_vector_type(3))) char char3; -typedef __attribute__((ext_vector_type(4))) char char4; -typedef __attribute__((ext_vector_type(8))) char char8; -typedef __attribute__((ext_vector_type(16))) char char16; - -typedef __attribute__((ext_vector_type(2))) uchar uchar2; -typedef __attribute__((ext_vector_type(3))) uchar uchar3; -typedef __attribute__((ext_vector_type(4))) uchar uchar4; -typedef __attribute__((ext_vector_type(8))) uchar uchar8; -typedef __attribute__((ext_vector_type(16))) uchar uchar16; - -typedef __attribute__((ext_vector_type(2))) short short2; -typedef __attribute__((ext_vector_type(3))) short short3; -typedef __attribute__((ext_vector_type(4))) short short4; -typedef __attribute__((ext_vector_type(8))) short short8; -typedef __attribute__((ext_vector_type(16))) short short16; - -typedef __attribute__((ext_vector_type(2))) ushort ushort2; -typedef __attribute__((ext_vector_type(3))) ushort ushort3; -typedef __attribute__((ext_vector_type(4))) ushort ushort4; -typedef __attribute__((ext_vector_type(8))) ushort ushort8; -typedef __attribute__((ext_vector_type(16))) ushort ushort16; - -typedef __attribute__((ext_vector_type(2))) int int2; -typedef __attribute__((ext_vector_type(3))) int int3; -typedef __attribute__((ext_vector_type(4))) int int4; -typedef __attribute__((ext_vector_type(8))) int int8; -typedef __attribute__((ext_vector_type(16))) int int16; - -typedef __attribute__((ext_vector_type(2))) uint uint2; -typedef __attribute__((ext_vector_type(3))) uint uint3; -typedef __attribute__((ext_vector_type(4))) uint uint4; -typedef __attribute__((ext_vector_type(8))) uint uint8; -typedef __attribute__((ext_vector_type(16))) uint uint16; - -typedef __attribute__((ext_vector_type(2))) long long2; -typedef __attribute__((ext_vector_type(3))) long long3; -typedef __attribute__((ext_vector_type(4))) long long4; -typedef __attribute__((ext_vector_type(8))) long long8; -typedef __attribute__((ext_vector_type(16))) long long16; - -typedef __attribute__((ext_vector_type(2))) ulong ulong2; -typedef __attribute__((ext_vector_type(3))) ulong ulong3; -typedef __attribute__((ext_vector_type(4))) ulong ulong4; -typedef __attribute__((ext_vector_type(8))) ulong ulong8; -typedef __attribute__((ext_vector_type(16))) ulong ulong16; - -typedef __attribute__((ext_vector_type(2))) float float2; -typedef __attribute__((ext_vector_type(3))) float float3; -typedef __attribute__((ext_vector_type(4))) float float4; -typedef __attribute__((ext_vector_type(8))) float float8; -typedef __attribute__((ext_vector_type(16))) float float16; - -/* 9.3 Double Precision Floating-Point */ - -#ifdef cl_khr_fp64 -typedef __attribute__((ext_vector_type(2))) double double2; -typedef __attribute__((ext_vector_type(3))) double double3; -typedef __attribute__((ext_vector_type(4))) double double4; -typedef __attribute__((ext_vector_type(8))) double double8; -typedef __attribute__((ext_vector_type(16))) double double16; -#endif - -#define NULL ((void *)0) diff --git a/libclc/generic/include/clc/clcversion.h b/libclc/generic/include/clc/clcversion.h deleted file mode 100644 index 57c989e3b713..000000000000 --- a/libclc/generic/include/clc/clcversion.h +++ /dev/null @@ -1,8 +0,0 @@ -#if __OPENCL_VERSION__ >= 110 -#define CLC_VERSION_1_0 100 -#define CLC_VERSION_1_1 110 -#endif - -#if __OPENCL_VERSION__ >= 120 -#define CLC_VERSION_1_2 120 -#endif diff --git a/libclc/generic/include/clc/common/degrees.h b/libclc/generic/include/clc/common/degrees.h deleted file mode 100644 index 44c47fc8f603..000000000000 --- a/libclc/generic/include/clc/common/degrees.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/degrees.inc b/libclc/generic/include/clc/common/degrees.inc deleted file mode 100644 index 2284403a6b07..000000000000 --- a/libclc/generic/include/clc/common/degrees.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE degrees(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/common/mix.h b/libclc/generic/include/clc/common/mix.h deleted file mode 100644 index 262861c687b5..000000000000 --- a/libclc/generic/include/clc/common/mix.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/common/mix.inc b/libclc/generic/include/clc/common/mix.inc deleted file mode 100644 index 52cb10ad9027..000000000000 --- a/libclc/generic/include/clc/common/mix.inc +++ /dev/null @@ -1,5 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c); - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mix(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_SCALAR_GENTYPE c); -#endif diff --git a/libclc/generic/include/clc/common/radians.h b/libclc/generic/include/clc/common/radians.h deleted file mode 100644 index 6bec9d475716..000000000000 --- a/libclc/generic/include/clc/common/radians.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/radians.inc b/libclc/generic/include/clc/common/radians.inc deleted file mode 100644 index ae4393942be2..000000000000 --- a/libclc/generic/include/clc/common/radians.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE radians(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/common/sign.h b/libclc/generic/include/clc/common/sign.h deleted file mode 100644 index fa9aa096541f..000000000000 --- a/libclc/generic/include/clc/common/sign.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_FUNCTION sign -#define __CLC_BODY -#include -#undef __CLC_FUNCTION -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/smoothstep.h b/libclc/generic/include/clc/common/smoothstep.h deleted file mode 100644 index 7a270dce89b1..000000000000 --- a/libclc/generic/include/clc/common/smoothstep.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/smoothstep.inc b/libclc/generic/include/clc/common/smoothstep.inc deleted file mode 100644 index 286eeac47d42..000000000000 --- a/libclc/generic/include/clc/common/smoothstep.inc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(__CLC_GENTYPE edge0, __CLC_GENTYPE edge1, __CLC_GENTYPE x); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(float edge0, float edge1, __CLC_GENTYPE x); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE smoothstep(double edge0, double edge1, __CLC_GENTYPE x); -#endif diff --git a/libclc/generic/include/clc/common/step.h b/libclc/generic/include/clc/common/step.h deleted file mode 100644 index 9c0bee458f96..000000000000 --- a/libclc/generic/include/clc/common/step.h +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/common/step.inc b/libclc/generic/include/clc/common/step.inc deleted file mode 100644 index f606b7cb513e..000000000000 --- a/libclc/generic/include/clc/common/step.inc +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(__CLC_GENTYPE edge, __CLC_GENTYPE x); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(float edge, __CLC_GENTYPE x); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE step(double edge, __CLC_GENTYPE x); -#endif diff --git a/libclc/generic/include/clc/convert.h b/libclc/generic/include/clc/convert.h deleted file mode 100644 index f0ba796864d4..000000000000 --- a/libclc/generic/include/clc/convert.h +++ /dev/null @@ -1,60 +0,0 @@ -#define _CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \ - _CLC_OVERLOAD _CLC_DECL TO_TYPE convert_##TO_TYPE##SUFFIX(FROM_TYPE x); - -#define _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE, TO_TYPE, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE##2, TO_TYPE##2, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE##3, TO_TYPE##3, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE##4, TO_TYPE##4, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE##8, TO_TYPE##8, SUFFIX) \ - _CLC_CONVERT_DECL(FROM_TYPE##16, TO_TYPE##16, SUFFIX) - -#define _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, char, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uchar, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, int, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, uint, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, short, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ushort, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, long, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, ulong, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, float, SUFFIX) - -#ifdef cl_khr_fp64 -#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) \ - _CLC_VECTOR_CONVERT_DECL(FROM_TYPE, double, SUFFIX) -#else -#define _CLC_VECTOR_CONVERT_FROM(FROM_TYPE, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM1(FROM_TYPE, SUFFIX) -#endif - -#define _CLC_VECTOR_CONVERT_TO1(SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(char, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(uchar, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(int, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(uint, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(short, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(ushort, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(long, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(ulong, SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(float, SUFFIX) - -#ifdef cl_khr_fp64 -#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \ - _CLC_VECTOR_CONVERT_TO1(SUFFIX) \ - _CLC_VECTOR_CONVERT_FROM(double, SUFFIX) -#else -#define _CLC_VECTOR_CONVERT_TO(SUFFIX) \ - _CLC_VECTOR_CONVERT_TO1(SUFFIX) -#endif - -#define _CLC_VECTOR_CONVERT_TO_SUFFIX(ROUND) \ - _CLC_VECTOR_CONVERT_TO(_sat##ROUND) \ - _CLC_VECTOR_CONVERT_TO(ROUND) - -_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtn) -_CLC_VECTOR_CONVERT_TO_SUFFIX(_rte) -_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtz) -_CLC_VECTOR_CONVERT_TO_SUFFIX(_rtp) -_CLC_VECTOR_CONVERT_TO_SUFFIX() diff --git a/libclc/generic/include/clc/float/definitions.h b/libclc/generic/include/clc/float/definitions.h deleted file mode 100644 index 6010ed2c015a..000000000000 --- a/libclc/generic/include/clc/float/definitions.h +++ /dev/null @@ -1,77 +0,0 @@ -#define MAXFLOAT 0x1.fffffep127f -#define HUGE_VALF __builtin_huge_valf() -#define INFINITY __builtin_inff() -#define NAN __builtin_nanf("") - -#define FLT_DIG 6 -#define FLT_MANT_DIG 24 -#define FLT_MAX_10_EXP +38 -#define FLT_MAX_EXP +128 -#define FLT_MIN_10_EXP -37 -#define FLT_MIN_EXP -125 -#define FLT_RADIX 2 -#define FLT_MAX MAXFLOAT -#define FLT_MIN 0x1.0p-126f -#define FLT_EPSILON 0x1.0p-23f - -#define FP_ILOGB0 (-2147483647 - 1) -#define FP_ILOGBNAN (-2147483647 - 1) - -#define M_E_F 0x1.5bf0a8p+1f -#define M_LOG2E_F 0x1.715476p+0f -#define M_LOG10E_F 0x1.bcb7b2p-2f -#define M_LN2_F 0x1.62e430p-1f -#define M_LN10_F 0x1.26bb1cp+1f -#define M_PI_F 0x1.921fb6p+1f -#define M_PI_2_F 0x1.921fb6p+0f -#define M_PI_4_F 0x1.921fb6p-1f -#define M_1_PI_F 0x1.45f306p-2f -#define M_2_PI_F 0x1.45f306p-1f -#define M_2_SQRTPI_F 0x1.20dd76p+0f -#define M_SQRT2_F 0x1.6a09e6p+0f -#define M_SQRT1_2_F 0x1.6a09e6p-1f - -#ifdef cl_khr_fp64 - -#define HUGE_VAL __builtin_huge_val() - -#define DBL_DIG 15 -#define DBL_MANT_DIG 53 -#define DBL_MAX_10_EXP +308 -#define DBL_MAX_EXP +1024 -#define DBL_MIN_10_EXP -307 -#define DBL_MIN_EXP -1021 -#define DBL_MAX 0x1.fffffffffffffp1023 -#define DBL_MIN 0x1.0p-1022 -#define DBL_EPSILON 0x1.0p-52 - -#define M_E 0x1.5bf0a8b145769p+1 -#define M_LOG2E 0x1.71547652b82fep+0 -#define M_LOG10E 0x1.bcb7b1526e50ep-2 -#define M_LN2 0x1.62e42fefa39efp-1 -#define M_LN10 0x1.26bb1bbb55516p+1 -#define M_PI 0x1.921fb54442d18p+1 -#define M_PI_2 0x1.921fb54442d18p+0 -#define M_PI_4 0x1.921fb54442d18p-1 -#define M_1_PI 0x1.45f306dc9c883p-2 -#define M_2_PI 0x1.45f306dc9c883p-1 -#define M_2_SQRTPI 0x1.20dd750429b6dp+0 -#define M_SQRT2 0x1.6a09e667f3bcdp+0 -#define M_SQRT1_2 0x1.6a09e667f3bcdp-1 - -#endif - -#ifdef cl_khr_fp16 - -#if __OPENCL_VERSION__ >= 120 - -#define HALF_DIG 3 -#define HALF_MANT_DIG 11 -#define HALF_MAX_10_EXP +4 -#define HALF_MAX_EXP +16 -#define HALF_MIN_10_EXP -4 -#define HALF_MIN_EXP -13 - -#endif - -#endif diff --git a/libclc/generic/include/clc/geometric/cross.h b/libclc/generic/include/clc/geometric/cross.h deleted file mode 100644 index eee0cc81bb92..000000000000 --- a/libclc/generic/include/clc/geometric/cross.h +++ /dev/null @@ -1,7 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL float3 cross(float3 p0, float3 p1); -_CLC_OVERLOAD _CLC_DECL float4 cross(float4 p0, float4 p1); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD _CLC_DECL double3 cross(double3 p0, double3 p1); -_CLC_OVERLOAD _CLC_DECL double4 cross(double4 p0, double4 p1); -#endif diff --git a/libclc/generic/include/clc/geometric/distance.h b/libclc/generic/include/clc/geometric/distance.h deleted file mode 100644 index 3e91332d7838..000000000000 --- a/libclc/generic/include/clc/geometric/distance.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/geometric/distance.inc b/libclc/generic/include/clc/geometric/distance.inc deleted file mode 100644 index 6babbdc30d5d..000000000000 --- a/libclc/generic/include/clc/geometric/distance.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT distance(__CLC_FLOATN p0, __CLC_FLOATN p1); diff --git a/libclc/generic/include/clc/geometric/dot.h b/libclc/generic/include/clc/geometric/dot.h deleted file mode 100644 index 7f65fed9760d..000000000000 --- a/libclc/generic/include/clc/geometric/dot.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/geometric/dot.inc b/libclc/generic/include/clc/geometric/dot.inc deleted file mode 100644 index 34245e2935a4..000000000000 --- a/libclc/generic/include/clc/geometric/dot.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT dot(__CLC_FLOATN p0, __CLC_FLOATN p1); diff --git a/libclc/generic/include/clc/geometric/fast_distance.h b/libclc/generic/include/clc/geometric/fast_distance.h deleted file mode 100644 index a84f70b791bb..000000000000 --- a/libclc/generic/include/clc/geometric/fast_distance.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/include/clc/geometric/fast_distance.inc b/libclc/generic/include/clc/geometric/fast_distance.inc deleted file mode 100644 index 1ed7c6970af2..000000000000 --- a/libclc/generic/include/clc/geometric/fast_distance.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT fast_distance(__CLC_FLOATN p0, __CLC_FLOATN p1); diff --git a/libclc/generic/include/clc/geometric/fast_length.h b/libclc/generic/include/clc/geometric/fast_length.h deleted file mode 100644 index 1d894b692b7e..000000000000 --- a/libclc/generic/include/clc/geometric/fast_length.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/include/clc/geometric/fast_length.inc b/libclc/generic/include/clc/geometric/fast_length.inc deleted file mode 100644 index 5a7c275fa5f1..000000000000 --- a/libclc/generic/include/clc/geometric/fast_length.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT fast_length(__CLC_FLOATN p0); diff --git a/libclc/generic/include/clc/geometric/fast_normalize.h b/libclc/generic/include/clc/geometric/fast_normalize.h deleted file mode 100644 index c50b1c6661ec..000000000000 --- a/libclc/generic/include/clc/geometric/fast_normalize.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/include/clc/geometric/fast_normalize.inc b/libclc/generic/include/clc/geometric/fast_normalize.inc deleted file mode 100644 index 3ef8f8670a62..000000000000 --- a/libclc/generic/include/clc/geometric/fast_normalize.inc +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -_CLC_OVERLOAD _CLC_DECL __CLC_FLOATN fast_normalize(__CLC_FLOATN p); diff --git a/libclc/generic/include/clc/geometric/floatn.inc b/libclc/generic/include/clc/geometric/floatn.inc deleted file mode 100644 index fe5fba69ab40..000000000000 --- a/libclc/generic/include/clc/geometric/floatn.inc +++ /dev/null @@ -1,55 +0,0 @@ -#define __CLC_FLOAT float -#define __CLC_FPSIZE 32 - -#define __CLC_FLOATN float -#define __CLC_SCALAR -#include __CLC_BODY -#undef __CLC_FLOATN -#undef __CLC_SCALAR - -#define __CLC_FLOATN float2 -#include __CLC_BODY -#undef __CLC_FLOATN - -#define __CLC_FLOATN float3 -#include __CLC_BODY -#undef __CLC_FLOATN - -#define __CLC_FLOATN float4 -#include __CLC_BODY -#undef __CLC_FLOATN - -#undef __CLC_FLOAT -#undef __CLC_FPSIZE - -#ifndef __FLOAT_ONLY -#ifdef cl_khr_fp64 - -#define __CLC_FLOAT double -#define __CLC_FPSIZE 64 - -#define __CLC_FLOATN double -#define __CLC_SCALAR -#include __CLC_BODY -#undef __CLC_FLOATN -#undef __CLC_SCALAR - -#define __CLC_FLOATN double2 -#include __CLC_BODY -#undef __CLC_FLOATN - -#define __CLC_FLOATN double3 -#include __CLC_BODY -#undef __CLC_FLOATN - -#define __CLC_FLOATN double4 -#include __CLC_BODY -#undef __CLC_FLOATN - -#undef __CLC_FLOAT -#undef __CLC_FPSIZE - -#endif -#endif - -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/geometric/length.h b/libclc/generic/include/clc/geometric/length.h deleted file mode 100644 index cb992b9bc72e..000000000000 --- a/libclc/generic/include/clc/geometric/length.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/geometric/length.inc b/libclc/generic/include/clc/geometric/length.inc deleted file mode 100644 index c2d95e876831..000000000000 --- a/libclc/generic/include/clc/geometric/length.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_FLOAT length(__CLC_FLOATN p0); diff --git a/libclc/generic/include/clc/geometric/normalize.h b/libclc/generic/include/clc/geometric/normalize.h deleted file mode 100644 index dccff9b4e041..000000000000 --- a/libclc/generic/include/clc/geometric/normalize.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/geometric/normalize.inc b/libclc/generic/include/clc/geometric/normalize.inc deleted file mode 100644 index 6eb13150603e..000000000000 --- a/libclc/generic/include/clc/geometric/normalize.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_FLOATN normalize(__CLC_FLOATN p); diff --git a/libclc/generic/include/clc/image/image.h b/libclc/generic/include/clc/image/image.h deleted file mode 100644 index 0a3707468bbf..000000000000 --- a/libclc/generic/include/clc/image/image.h +++ /dev/null @@ -1,36 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL int get_image_width (image2d_t image); -_CLC_OVERLOAD _CLC_DECL int get_image_width (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL int get_image_height (image2d_t image); -_CLC_OVERLOAD _CLC_DECL int get_image_height (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL int get_image_depth (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image2d_t image); -_CLC_OVERLOAD _CLC_DECL int get_image_channel_data_type (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image2d_t image); -_CLC_OVERLOAD _CLC_DECL int get_image_channel_order (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL int2 get_image_dim (image2d_t image); -_CLC_OVERLOAD _CLC_DECL int4 get_image_dim (image3d_t image); - -_CLC_OVERLOAD _CLC_DECL void -write_imagef(image2d_t image, int2 coord, float4 color); -_CLC_OVERLOAD _CLC_DECL void -write_imagei(image2d_t image, int2 coord, int4 color); -_CLC_OVERLOAD _CLC_DECL void -write_imageui(image2d_t image, int2 coord, uint4 color); - -_CLC_OVERLOAD _CLC_DECL float4 -read_imagef(image2d_t image, sampler_t sampler, int2 coord); -_CLC_OVERLOAD _CLC_DECL float4 -read_imagef(image2d_t image, sampler_t sampler, float2 coord); -_CLC_OVERLOAD _CLC_DECL int4 -read_imagei(image2d_t image, sampler_t sampler, int2 coord); -_CLC_OVERLOAD _CLC_DECL int4 -read_imagei(image2d_t image, sampler_t sampler, float2 coord); -_CLC_OVERLOAD _CLC_DECL uint4 -read_imageui(image2d_t image, sampler_t sampler, int2 coord); -_CLC_OVERLOAD _CLC_DECL uint4 -read_imageui(image2d_t image, sampler_t sampler, float2 coord); diff --git a/libclc/generic/include/clc/image/image_defines.h b/libclc/generic/include/clc/image/image_defines.h deleted file mode 100644 index 0b3350b7694d..000000000000 --- a/libclc/generic/include/clc/image/image_defines.h +++ /dev/null @@ -1,49 +0,0 @@ -/* get_image_channel_data_type flags */ -#define CLK_SNORM_INT8 0x10D0 -#define CLK_SNORM_INT16 0x10D1 -#define CLK_UNORM_INT8 0x10D2 -#define CLK_UNORM_INT16 0x10D3 -#define CLK_UNORM_SHORT_565 0x10D4 -#define CLK_UNORM_SHORT_555 0x10D5 -#define CLK_UNORM_SHORT_101010 0x10D6 -#define CLK_SIGNED_INT8 0x10D7 -#define CLK_SIGNED_INT16 0x10D8 -#define CLK_SIGNED_INT32 0x10D9 -#define CLK_UNSIGNED_INT8 0x10DA -#define CLK_UNSIGNED_INT16 0x10DB -#define CLK_UNSIGNED_INT32 0x10DC -#define CLK_HALF_FLOAT 0x10DD -#define CLK_FLOAT 0x10DE - -/* get_image_channel_order flags */ -#define CLK_R 0x10B0 -#define CLK_A 0x10B1 -#define CLK_RG 0x10B2 -#define CLK_RA 0x10B3 -#define CLK_RGB 0x10B4 -#define CLK_RGBA 0x10B5 -#define CLK_BGRA 0x10B6 -#define CLK_ARGB 0x10B7 -#define CLK_INTENSITY 0x10B8 -#define CLK_LUMINANCE 0x10B9 -#define CLK_Rx 0x10BA -#define CLK_RGx 0x10BB -#define CLK_RGBx 0x10BC - -/* sampler normalized coords */ -#define CLK_NORMALIZED_COORDS_FALSE 0x0000 -#define CLK_NORMALIZED_COORDS_TRUE 0x0001 -#define __CLC_NORMALIZED_COORDS_MASK 0x0001 - -/* sampler addressing mode */ -#define CLK_ADDRESS_NONE 0x0000 -#define CLK_ADDRESS_CLAMP_TO_EDGE 0x0002 -#define CLK_ADDRESS_CLAMP 0x0004 -#define CLK_ADDRESS_REPEAT 0x0006 -#define CLK_ADDRESS_MIRRORED_REPEAT 0x0008 -#define __CLC_ADDRESS_MASK 0x000E - -/* sampler filter mode */ -#define CLK_FILTER_NEAREST 0x0000 -#define CLK_FILTER_LINEAR 0x0010 -#define __CLC_FILTER_MASK 0x0010 diff --git a/libclc/generic/include/clc/integer/abs.h b/libclc/generic/include/clc/integer/abs.h deleted file mode 100644 index 77a4cbeb4fe3..000000000000 --- a/libclc/generic/include/clc/integer/abs.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/abs.inc b/libclc/generic/include/clc/integer/abs.inc deleted file mode 100644 index 952bce7e29e3..000000000000 --- a/libclc/generic/include/clc/integer/abs.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/integer/abs_diff.h b/libclc/generic/include/clc/integer/abs_diff.h deleted file mode 100644 index 3f3b4b43c5d7..000000000000 --- a/libclc/generic/include/clc/integer/abs_diff.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/abs_diff.inc b/libclc/generic/include/clc/integer/abs_diff.inc deleted file mode 100644 index e844d46e808b..000000000000 --- a/libclc/generic/include/clc/integer/abs_diff.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/add_sat.h b/libclc/generic/include/clc/integer/add_sat.h deleted file mode 100644 index 2e5e69851442..000000000000 --- a/libclc/generic/include/clc/integer/add_sat.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/add_sat.inc b/libclc/generic/include/clc/integer/add_sat.inc deleted file mode 100644 index 913841a1dada..000000000000 --- a/libclc/generic/include/clc/integer/add_sat.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE add_sat(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/clz.h b/libclc/generic/include/clc/integer/clz.h deleted file mode 100644 index f7cdbf78ec06..000000000000 --- a/libclc/generic/include/clc/integer/clz.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/clz.inc b/libclc/generic/include/clc/integer/clz.inc deleted file mode 100644 index 45826d10c9fa..000000000000 --- a/libclc/generic/include/clc/integer/clz.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clz(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/integer/definitions.h b/libclc/generic/include/clc/integer/definitions.h deleted file mode 100644 index 0079c30123db..000000000000 --- a/libclc/generic/include/clc/integer/definitions.h +++ /dev/null @@ -1,15 +0,0 @@ -#define CHAR_BIT 8 -#define INT_MAX 2147483647 -#define INT_MIN (-2147483647 - 1) -#define LONG_MAX 0x7fffffffffffffffL -#define LONG_MIN (-0x7fffffffffffffffL - 1) -#define CHAR_MAX SCHAR_MAX -#define CHAR_MIN SCHAR_MIN -#define SCHAR_MAX 127 -#define SCHAR_MIN (-127 - 1) -#define SHRT_MAX 32767 -#define SHRT_MIN (-32767 - 1) -#define UCHAR_MAX 255 -#define USHRT_MAX 65535 -#define UINT_MAX 0xffffffff -#define ULONG_MAX 0xffffffffffffffffUL diff --git a/libclc/generic/include/clc/integer/gentype.inc b/libclc/generic/include/clc/integer/gentype.inc deleted file mode 100644 index 6f4d6996d8f5..000000000000 --- a/libclc/generic/include/clc/integer/gentype.inc +++ /dev/null @@ -1,435 +0,0 @@ -//These 2 defines only change when switching between data sizes or base types to -//keep this file manageable. -#define __CLC_GENSIZE 8 -#define __CLC_SCALAR_GENTYPE char - -#define __CLC_GENTYPE char -#define __CLC_U_GENTYPE uchar -#define __CLC_S_GENTYPE char -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE char2 -#define __CLC_U_GENTYPE uchar2 -#define __CLC_S_GENTYPE char2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE char3 -#define __CLC_U_GENTYPE uchar3 -#define __CLC_S_GENTYPE char3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE char4 -#define __CLC_U_GENTYPE uchar4 -#define __CLC_S_GENTYPE char4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE char8 -#define __CLC_U_GENTYPE uchar8 -#define __CLC_S_GENTYPE char8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE char16 -#define __CLC_U_GENTYPE uchar16 -#define __CLC_S_GENTYPE char16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE uchar - -#define __CLC_GENTYPE uchar -#define __CLC_U_GENTYPE uchar -#define __CLC_S_GENTYPE char -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uchar2 -#define __CLC_U_GENTYPE uchar2 -#define __CLC_S_GENTYPE char2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uchar3 -#define __CLC_U_GENTYPE uchar3 -#define __CLC_S_GENTYPE char3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uchar4 -#define __CLC_U_GENTYPE uchar4 -#define __CLC_S_GENTYPE char4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uchar8 -#define __CLC_U_GENTYPE uchar8 -#define __CLC_S_GENTYPE char8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uchar16 -#define __CLC_U_GENTYPE uchar16 -#define __CLC_S_GENTYPE char16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_GENSIZE -#define __CLC_GENSIZE 16 -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE short - -#define __CLC_GENTYPE short -#define __CLC_U_GENTYPE ushort -#define __CLC_S_GENTYPE short -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE short2 -#define __CLC_U_GENTYPE ushort2 -#define __CLC_S_GENTYPE short2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE short3 -#define __CLC_U_GENTYPE ushort3 -#define __CLC_S_GENTYPE short3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE short4 -#define __CLC_U_GENTYPE ushort4 -#define __CLC_S_GENTYPE short4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE short8 -#define __CLC_U_GENTYPE ushort8 -#define __CLC_S_GENTYPE short8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE short16 -#define __CLC_U_GENTYPE ushort16 -#define __CLC_S_GENTYPE short16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE ushort - -#define __CLC_GENTYPE ushort -#define __CLC_U_GENTYPE ushort -#define __CLC_S_GENTYPE short -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ushort2 -#define __CLC_U_GENTYPE ushort2 -#define __CLC_S_GENTYPE short2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ushort3 -#define __CLC_U_GENTYPE ushort3 -#define __CLC_S_GENTYPE short3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ushort4 -#define __CLC_U_GENTYPE ushort4 -#define __CLC_S_GENTYPE short4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ushort8 -#define __CLC_U_GENTYPE ushort8 -#define __CLC_S_GENTYPE short8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ushort16 -#define __CLC_U_GENTYPE ushort16 -#define __CLC_S_GENTYPE short16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_GENSIZE -#define __CLC_GENSIZE 32 -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE int - -#define __CLC_GENTYPE int -#define __CLC_U_GENTYPE uint -#define __CLC_S_GENTYPE int -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE int2 -#define __CLC_U_GENTYPE uint2 -#define __CLC_S_GENTYPE int2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE int3 -#define __CLC_U_GENTYPE uint3 -#define __CLC_S_GENTYPE int3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE int4 -#define __CLC_U_GENTYPE uint4 -#define __CLC_S_GENTYPE int4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE int8 -#define __CLC_U_GENTYPE uint8 -#define __CLC_S_GENTYPE int8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE int16 -#define __CLC_U_GENTYPE uint16 -#define __CLC_S_GENTYPE int16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE uint - -#define __CLC_GENTYPE uint -#define __CLC_U_GENTYPE uint -#define __CLC_S_GENTYPE int -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uint2 -#define __CLC_U_GENTYPE uint2 -#define __CLC_S_GENTYPE int2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uint3 -#define __CLC_U_GENTYPE uint3 -#define __CLC_S_GENTYPE int3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uint4 -#define __CLC_U_GENTYPE uint4 -#define __CLC_S_GENTYPE int4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uint8 -#define __CLC_U_GENTYPE uint8 -#define __CLC_S_GENTYPE int8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE uint16 -#define __CLC_U_GENTYPE uint16 -#define __CLC_S_GENTYPE int16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_GENSIZE -#define __CLC_GENSIZE 64 -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE long - -#define __CLC_GENTYPE long -#define __CLC_U_GENTYPE ulong -#define __CLC_S_GENTYPE long -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE long2 -#define __CLC_U_GENTYPE ulong2 -#define __CLC_S_GENTYPE long2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE long3 -#define __CLC_U_GENTYPE ulong3 -#define __CLC_S_GENTYPE long3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE long4 -#define __CLC_U_GENTYPE ulong4 -#define __CLC_S_GENTYPE long4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE long8 -#define __CLC_U_GENTYPE ulong8 -#define __CLC_S_GENTYPE long8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE long16 -#define __CLC_U_GENTYPE ulong16 -#define __CLC_S_GENTYPE long16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_SCALAR_GENTYPE -#define __CLC_SCALAR_GENTYPE ulong - -#define __CLC_GENTYPE ulong -#define __CLC_U_GENTYPE ulong -#define __CLC_S_GENTYPE long -#define __CLC_SCALAR 1 -#include __CLC_BODY -#undef __CLC_SCALAR -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ulong2 -#define __CLC_U_GENTYPE ulong2 -#define __CLC_S_GENTYPE long2 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ulong3 -#define __CLC_U_GENTYPE ulong3 -#define __CLC_S_GENTYPE long3 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ulong4 -#define __CLC_U_GENTYPE ulong4 -#define __CLC_S_GENTYPE long4 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ulong8 -#define __CLC_U_GENTYPE ulong8 -#define __CLC_S_GENTYPE long8 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#define __CLC_GENTYPE ulong16 -#define __CLC_U_GENTYPE ulong16 -#define __CLC_S_GENTYPE long16 -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_U_GENTYPE -#undef __CLC_S_GENTYPE - -#undef __CLC_GENSIZE -#undef __CLC_SCALAR_GENTYPE -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/integer/hadd.h b/libclc/generic/include/clc/integer/hadd.h deleted file mode 100644 index 37304e26cc2d..000000000000 --- a/libclc/generic/include/clc/integer/hadd.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/hadd.inc b/libclc/generic/include/clc/integer/hadd.inc deleted file mode 100644 index f698989cef20..000000000000 --- a/libclc/generic/include/clc/integer/hadd.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE hadd(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/integer-gentype.inc b/libclc/generic/include/clc/integer/integer-gentype.inc deleted file mode 100644 index e4115cf45ebb..000000000000 --- a/libclc/generic/include/clc/integer/integer-gentype.inc +++ /dev/null @@ -1,47 +0,0 @@ -#define __CLC_GENTYPE int -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int3 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE int16 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint2 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint3 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint4 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint8 -#include __CLC_BODY -#undef __CLC_GENTYPE - -#define __CLC_GENTYPE uint16 -#include __CLC_BODY -#undef __CLC_GENTYPE diff --git a/libclc/generic/include/clc/integer/mad24.h b/libclc/generic/include/clc/integer/mad24.h deleted file mode 100644 index 0c120faac2b1..000000000000 --- a/libclc/generic/include/clc/integer/mad24.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/integer/mad24.inc b/libclc/generic/include/clc/integer/mad24.inc deleted file mode 100644 index 81fe0c2a8926..000000000000 --- a/libclc/generic/include/clc/integer/mad24.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad24(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z); diff --git a/libclc/generic/include/clc/integer/mad_hi.h b/libclc/generic/include/clc/integer/mad_hi.h deleted file mode 100644 index 863ce92d9f2d..000000000000 --- a/libclc/generic/include/clc/integer/mad_hi.h +++ /dev/null @@ -1 +0,0 @@ -#define mad_hi(a, b, c) (mul_hi((a),(b))+(c)) diff --git a/libclc/generic/include/clc/integer/mad_sat.h b/libclc/generic/include/clc/integer/mad_sat.h deleted file mode 100644 index 3e92372a27d0..000000000000 --- a/libclc/generic/include/clc/integer/mad_sat.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/integer/mad_sat.inc b/libclc/generic/include/clc/integer/mad_sat.inc deleted file mode 100644 index 5da2bdf8908d..000000000000 --- a/libclc/generic/include/clc/integer/mad_sat.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad_sat(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z); diff --git a/libclc/generic/include/clc/integer/mul24.h b/libclc/generic/include/clc/integer/mul24.h deleted file mode 100644 index 4f97098d70f0..000000000000 --- a/libclc/generic/include/clc/integer/mul24.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/integer/mul24.inc b/libclc/generic/include/clc/integer/mul24.inc deleted file mode 100644 index 8cbf7c10ac44..000000000000 --- a/libclc/generic/include/clc/integer/mul24.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mul24(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/mul_hi.h b/libclc/generic/include/clc/integer/mul_hi.h deleted file mode 100644 index 27b95d83442f..000000000000 --- a/libclc/generic/include/clc/integer/mul_hi.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/mul_hi.inc b/libclc/generic/include/clc/integer/mul_hi.inc deleted file mode 100644 index ce9e5c0b2c18..000000000000 --- a/libclc/generic/include/clc/integer/mul_hi.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mul_hi(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/rhadd.h b/libclc/generic/include/clc/integer/rhadd.h deleted file mode 100644 index 69b43faeebd2..000000000000 --- a/libclc/generic/include/clc/integer/rhadd.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/rhadd.inc b/libclc/generic/include/clc/integer/rhadd.inc deleted file mode 100644 index 88ccaf09fd5e..000000000000 --- a/libclc/generic/include/clc/integer/rhadd.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE rhadd(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/rotate.h b/libclc/generic/include/clc/integer/rotate.h deleted file mode 100644 index 6320223e7cf2..000000000000 --- a/libclc/generic/include/clc/integer/rotate.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/rotate.inc b/libclc/generic/include/clc/integer/rotate.inc deleted file mode 100644 index c97711ecf882..000000000000 --- a/libclc/generic/include/clc/integer/rotate.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE rotate(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/sub_sat.h b/libclc/generic/include/clc/integer/sub_sat.h deleted file mode 100644 index f84152944817..000000000000 --- a/libclc/generic/include/clc/integer/sub_sat.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/integer/sub_sat.inc b/libclc/generic/include/clc/integer/sub_sat.inc deleted file mode 100644 index 425df2e4b696..000000000000 --- a/libclc/generic/include/clc/integer/sub_sat.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sub_sat(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/integer/upsample.h b/libclc/generic/include/clc/integer/upsample.h deleted file mode 100644 index 0b36b692a2c8..000000000000 --- a/libclc/generic/include/clc/integer/upsample.h +++ /dev/null @@ -1,25 +0,0 @@ -#define __CLC_UPSAMPLE_DECL(BGENTYPE, GENTYPE, UGENTYPE) \ - _CLC_OVERLOAD _CLC_DECL BGENTYPE upsample(GENTYPE hi, UGENTYPE lo); - -#define __CLC_UPSAMPLE_VEC(BGENTYPE, GENTYPE, UGENTYPE) \ - __CLC_UPSAMPLE_DECL(BGENTYPE, GENTYPE, UGENTYPE) \ - __CLC_UPSAMPLE_DECL(BGENTYPE##2, GENTYPE##2, UGENTYPE##2) \ - __CLC_UPSAMPLE_DECL(BGENTYPE##3, GENTYPE##3, UGENTYPE##3) \ - __CLC_UPSAMPLE_DECL(BGENTYPE##4, GENTYPE##4, UGENTYPE##4) \ - __CLC_UPSAMPLE_DECL(BGENTYPE##8, GENTYPE##8, UGENTYPE##8) \ - __CLC_UPSAMPLE_DECL(BGENTYPE##16, GENTYPE##16, UGENTYPE##16) \ - -#define __CLC_UPSAMPLE_TYPES() \ - __CLC_UPSAMPLE_VEC(short, char, uchar) \ - __CLC_UPSAMPLE_VEC(ushort, uchar, uchar) \ - __CLC_UPSAMPLE_VEC(int, short, ushort) \ - __CLC_UPSAMPLE_VEC(uint, ushort, ushort) \ - __CLC_UPSAMPLE_VEC(long, int, uint) \ - __CLC_UPSAMPLE_VEC(ulong, uint, uint) \ - -__CLC_UPSAMPLE_TYPES() - -#undef __CLC_UPSAMPLE_TYPES -#undef __CLC_UPSAMPLE_DECL -#undef __CLC_UPSAMPLE_VEC - diff --git a/libclc/generic/include/clc/math/acos.h b/libclc/generic/include/clc/math/acos.h deleted file mode 100644 index e753dee36aa5..000000000000 --- a/libclc/generic/include/clc/math/acos.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/acos.inc b/libclc/generic/include/clc/math/acos.inc deleted file mode 100644 index 4ca8c7538aef..000000000000 --- a/libclc/generic/include/clc/math/acos.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acos(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/acosh.h b/libclc/generic/include/clc/math/acosh.h deleted file mode 100644 index f1bb0a5baac5..000000000000 --- a/libclc/generic/include/clc/math/acosh.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/acosh.inc b/libclc/generic/include/clc/math/acosh.inc deleted file mode 100644 index 41ec429b9b5d..000000000000 --- a/libclc/generic/include/clc/math/acosh.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acosh(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/acospi.h b/libclc/generic/include/clc/math/acospi.h deleted file mode 100644 index 987657c6adbc..000000000000 --- a/libclc/generic/include/clc/math/acospi.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/acospi.inc b/libclc/generic/include/clc/math/acospi.inc deleted file mode 100644 index 265e6a82cc37..000000000000 --- a/libclc/generic/include/clc/math/acospi.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE acospi(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/asin.h b/libclc/generic/include/clc/math/asin.h deleted file mode 100644 index 2a858721e952..000000000000 --- a/libclc/generic/include/clc/math/asin.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/asin.inc b/libclc/generic/include/clc/math/asin.inc deleted file mode 100644 index b4ad8ff1231d..000000000000 --- a/libclc/generic/include/clc/math/asin.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asin(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/asinh.h b/libclc/generic/include/clc/math/asinh.h deleted file mode 100644 index 64417b8a9778..000000000000 --- a/libclc/generic/include/clc/math/asinh.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/asinh.inc b/libclc/generic/include/clc/math/asinh.inc deleted file mode 100644 index a544008daf30..000000000000 --- a/libclc/generic/include/clc/math/asinh.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asinh(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/asinpi.h b/libclc/generic/include/clc/math/asinpi.h deleted file mode 100644 index 781f8500f603..000000000000 --- a/libclc/generic/include/clc/math/asinpi.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/asinpi.inc b/libclc/generic/include/clc/math/asinpi.inc deleted file mode 100644 index 0b088f038d56..000000000000 --- a/libclc/generic/include/clc/math/asinpi.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE asinpi(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/atan.h b/libclc/generic/include/clc/math/atan.h deleted file mode 100644 index d9697194ee8a..000000000000 --- a/libclc/generic/include/clc/math/atan.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/atan.inc b/libclc/generic/include/clc/math/atan.inc deleted file mode 100644 index d217c955593f..000000000000 --- a/libclc/generic/include/clc/math/atan.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/atan2.h b/libclc/generic/include/clc/math/atan2.h deleted file mode 100644 index 9c082a082f0a..000000000000 --- a/libclc/generic/include/clc/math/atan2.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/atan2.inc b/libclc/generic/include/clc/math/atan2.inc deleted file mode 100644 index ce273da53346..000000000000 --- a/libclc/generic/include/clc/math/atan2.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan2(__CLC_GENTYPE a, __CLC_GENTYPE b); diff --git a/libclc/generic/include/clc/math/atan2pi.h b/libclc/generic/include/clc/math/atan2pi.h deleted file mode 100644 index 2cf4c53c22d3..000000000000 --- a/libclc/generic/include/clc/math/atan2pi.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/atan2pi.inc b/libclc/generic/include/clc/math/atan2pi.inc deleted file mode 100644 index 47a9d443e6f4..000000000000 --- a/libclc/generic/include/clc/math/atan2pi.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atan2pi(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/math/atanh.h b/libclc/generic/include/clc/math/atanh.h deleted file mode 100644 index 1a3173fd75c5..000000000000 --- a/libclc/generic/include/clc/math/atanh.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/atanh.inc b/libclc/generic/include/clc/math/atanh.inc deleted file mode 100644 index 216e78ac8f44..000000000000 --- a/libclc/generic/include/clc/math/atanh.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atanh(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/atanpi.h b/libclc/generic/include/clc/math/atanpi.h deleted file mode 100644 index ada3fbee7af9..000000000000 --- a/libclc/generic/include/clc/math/atanpi.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/atanpi.inc b/libclc/generic/include/clc/math/atanpi.inc deleted file mode 100644 index e97c8067a59d..000000000000 --- a/libclc/generic/include/clc/math/atanpi.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE atanpi(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/binary_decl.inc b/libclc/generic/include/clc/math/binary_decl.inc deleted file mode 100644 index 70a711477704..000000000000 --- a/libclc/generic/include/clc/math/binary_decl.inc +++ /dev/null @@ -1,6 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, __CLC_GENTYPE b); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, float b); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE a, double b); -#endif diff --git a/libclc/generic/include/clc/math/binary_intrin.inc b/libclc/generic/include/clc/math/binary_intrin.inc deleted file mode 100644 index cfbe74159ec2..000000000000 --- a/libclc/generic/include/clc/math/binary_intrin.inc +++ /dev/null @@ -1,18 +0,0 @@ -_CLC_OVERLOAD float __CLC_FUNCTION(float, float) __asm(__CLC_INTRINSIC ".f32"); -_CLC_OVERLOAD float2 __CLC_FUNCTION(float2, float2) __asm(__CLC_INTRINSIC ".v2f32"); -_CLC_OVERLOAD float3 __CLC_FUNCTION(float3, float3) __asm(__CLC_INTRINSIC ".v3f32"); -_CLC_OVERLOAD float4 __CLC_FUNCTION(float4, float4) __asm(__CLC_INTRINSIC ".v4f32"); -_CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8) __asm(__CLC_INTRINSIC ".v8f32"); -_CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16) __asm(__CLC_INTRINSIC ".v16f32"); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD double __CLC_FUNCTION(double, double) __asm(__CLC_INTRINSIC ".f64"); -_CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2) __asm(__CLC_INTRINSIC ".v2f64"); -_CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3) __asm(__CLC_INTRINSIC ".v3f64"); -_CLC_OVERLOAD double4 __CLC_FUNCTION(double4, double4) __asm(__CLC_INTRINSIC ".v4f64"); -_CLC_OVERLOAD double8 __CLC_FUNCTION(double8, double8) __asm(__CLC_INTRINSIC ".v8f64"); -_CLC_OVERLOAD double16 __CLC_FUNCTION(double16, double16) __asm(__CLC_INTRINSIC ".v16f64"); -#endif - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/include/clc/math/ceil.h b/libclc/generic/include/clc/math/ceil.h deleted file mode 100644 index 5b40abf97c20..000000000000 --- a/libclc/generic/include/clc/math/ceil.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef ceil -#define ceil __clc_ceil - -#define __CLC_FUNCTION __clc_ceil -#define __CLC_INTRINSIC "llvm.ceil" -#include diff --git a/libclc/generic/include/clc/math/clc_nextafter.h b/libclc/generic/include/clc/math/clc_nextafter.h deleted file mode 100644 index 81c8f369c3bd..000000000000 --- a/libclc/generic/include/clc/math/clc_nextafter.h +++ /dev/null @@ -1,11 +0,0 @@ -#define __CLC_BODY - -#define __CLC_FUNCTION nextafter -#include -#undef __CLC_FUNCTION - -#define __CLC_FUNCTION __clc_nextafter -#include -#undef __CLC_FUNCTION - -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/copysign.h b/libclc/generic/include/clc/math/copysign.h deleted file mode 100644 index 8f0742e451fd..000000000000 --- a/libclc/generic/include/clc/math/copysign.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/copysign.inc b/libclc/generic/include/clc/math/copysign.inc deleted file mode 100644 index 6091abcc1fc5..000000000000 --- a/libclc/generic/include/clc/math/copysign.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE copysign(__CLC_GENTYPE a, __CLC_GENTYPE b); diff --git a/libclc/generic/include/clc/math/cos.h b/libclc/generic/include/clc/math/cos.h deleted file mode 100644 index 3d4cf39a0f80..000000000000 --- a/libclc/generic/include/clc/math/cos.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/cos.inc b/libclc/generic/include/clc/math/cos.inc deleted file mode 100644 index 160e625c6912..000000000000 --- a/libclc/generic/include/clc/math/cos.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cos(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/cospi.h b/libclc/generic/include/clc/math/cospi.h deleted file mode 100644 index 427733bccda4..000000000000 --- a/libclc/generic/include/clc/math/cospi.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/cospi.inc b/libclc/generic/include/clc/math/cospi.inc deleted file mode 100644 index 1e786cfda6b5..000000000000 --- a/libclc/generic/include/clc/math/cospi.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE cospi(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/erf.h b/libclc/generic/include/clc/math/erf.h deleted file mode 100644 index 1aaf689c54b9..000000000000 --- a/libclc/generic/include/clc/math/erf.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef erfc - -#define __CLC_BODY -#define __CLC_FUNCTION erf - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/erfc.h b/libclc/generic/include/clc/math/erfc.h deleted file mode 100644 index b365a1079888..000000000000 --- a/libclc/generic/include/clc/math/erfc.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef erfc - -#define __CLC_BODY -#define __CLC_FUNCTION erfc - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/exp.h b/libclc/generic/include/clc/math/exp.h deleted file mode 100644 index 986652476295..000000000000 --- a/libclc/generic/include/clc/math/exp.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef exp - -#define __CLC_BODY -#define __CLC_FUNCTION exp - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/exp10.h b/libclc/generic/include/clc/math/exp10.h deleted file mode 100644 index a1d426a20ab0..000000000000 --- a/libclc/generic/include/clc/math/exp10.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef exp10 - -#define __CLC_BODY -#define __CLC_FUNCTION exp10 - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/exp2.h b/libclc/generic/include/clc/math/exp2.h deleted file mode 100644 index 14167e87f7d9..000000000000 --- a/libclc/generic/include/clc/math/exp2.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/exp2.inc b/libclc/generic/include/clc/math/exp2.inc deleted file mode 100644 index 3ecaae621b30..000000000000 --- a/libclc/generic/include/clc/math/exp2.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE exp2(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/fabs.h b/libclc/generic/include/clc/math/fabs.h deleted file mode 100644 index ee2f8932a94d..000000000000 --- a/libclc/generic/include/clc/math/fabs.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef fabs -#define fabs __clc_fabs - -#define __CLC_FUNCTION __clc_fabs -#define __CLC_INTRINSIC "llvm.fabs" -#include diff --git a/libclc/generic/include/clc/math/fdim.h b/libclc/generic/include/clc/math/fdim.h deleted file mode 100644 index 45115b0275a2..000000000000 --- a/libclc/generic/include/clc/math/fdim.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/fdim.inc b/libclc/generic/include/clc/math/fdim.inc deleted file mode 100644 index ca3467e1706d..000000000000 --- a/libclc/generic/include/clc/math/fdim.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fdim(__CLC_GENTYPE a, __CLC_GENTYPE b); diff --git a/libclc/generic/include/clc/math/floor.h b/libclc/generic/include/clc/math/floor.h deleted file mode 100644 index 2337d35caae6..000000000000 --- a/libclc/generic/include/clc/math/floor.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef floor -#define floor __clc_floor - -#define __CLC_FUNCTION __clc_floor -#define __CLC_INTRINSIC "llvm.floor" -#include diff --git a/libclc/generic/include/clc/math/fma.h b/libclc/generic/include/clc/math/fma.h deleted file mode 100644 index 02d39f681675..000000000000 --- a/libclc/generic/include/clc/math/fma.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef fma -#define fma __clc_fma - -#define __CLC_FUNCTION __clc_fma -#define __CLC_INTRINSIC "llvm.fma" -#include diff --git a/libclc/generic/include/clc/math/fmax.h b/libclc/generic/include/clc/math/fmax.h deleted file mode 100644 index 71ee859be4f9..000000000000 --- a/libclc/generic/include/clc/math/fmax.h +++ /dev/null @@ -1,8 +0,0 @@ -#define __CLC_BODY -#define __CLC_FUNCTION fmax - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION - diff --git a/libclc/generic/include/clc/math/fmin.h b/libclc/generic/include/clc/math/fmin.h deleted file mode 100644 index d45f572e08b0..000000000000 --- a/libclc/generic/include/clc/math/fmin.h +++ /dev/null @@ -1,8 +0,0 @@ -#define __CLC_BODY -#define __CLC_FUNCTION fmin - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION - diff --git a/libclc/generic/include/clc/math/fmod.h b/libclc/generic/include/clc/math/fmod.h deleted file mode 100644 index 49068675b0ef..000000000000 --- a/libclc/generic/include/clc/math/fmod.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/fmod.inc b/libclc/generic/include/clc/math/fmod.inc deleted file mode 100644 index 39d915365c25..000000000000 --- a/libclc/generic/include/clc/math/fmod.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fmod(__CLC_GENTYPE a, __CLC_GENTYPE b); diff --git a/libclc/generic/include/clc/math/fract.h b/libclc/generic/include/clc/math/fract.h deleted file mode 100644 index f2c887288b2d..000000000000 --- a/libclc/generic/include/clc/math/fract.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/fract.inc b/libclc/generic/include/clc/math/fract.inc deleted file mode 100644 index 71e6e8a92112..000000000000 --- a/libclc/generic/include/clc/math/fract.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr); diff --git a/libclc/generic/include/clc/math/frexp.h b/libclc/generic/include/clc/math/frexp.h deleted file mode 100644 index dda23da3f7fd..000000000000 --- a/libclc/generic/include/clc/math/frexp.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/frexp.inc b/libclc/generic/include/clc/math/frexp.inc deleted file mode 100644 index 2a6f7f582396..000000000000 --- a/libclc/generic/include/clc/math/frexp.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, global __CLC_INTN *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, local __CLC_INTN *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *iptr); diff --git a/libclc/generic/include/clc/math/gentype.inc b/libclc/generic/include/clc/math/gentype.inc deleted file mode 100644 index e6ffad104b5b..000000000000 --- a/libclc/generic/include/clc/math/gentype.inc +++ /dev/null @@ -1,113 +0,0 @@ -#define __CLC_SCALAR_GENTYPE float -#define __CLC_FPSIZE 32 - -#define __CLC_GENTYPE float -#define __CLC_INTN int -#define __CLC_SCALAR -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_INTN -#undef __CLC_SCALAR - -#define __CLC_GENTYPE float2 -#define __CLC_INTN int2 -#define __CLC_VECSIZE 2 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE float3 -#define __CLC_INTN int3 -#define __CLC_VECSIZE 3 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE float4 -#define __CLC_INTN int4 -#define __CLC_VECSIZE 4 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE float8 -#define __CLC_INTN int8 -#define __CLC_VECSIZE 8 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE float16 -#define __CLC_INTN int16 -#define __CLC_VECSIZE 16 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#undef __CLC_FPSIZE -#undef __CLC_SCALAR_GENTYPE - -#ifndef __FLOAT_ONLY -#ifdef cl_khr_fp64 -#define __CLC_SCALAR_GENTYPE double -#define __CLC_FPSIZE 64 - -#define __CLC_SCALAR -#define __CLC_GENTYPE double -#define __CLC_INTN int -#include __CLC_BODY -#undef __CLC_GENTYPE -#undef __CLC_INTN -#undef __CLC_SCALAR - -#define __CLC_GENTYPE double2 -#define __CLC_INTN int2 -#define __CLC_VECSIZE 2 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE double3 -#define __CLC_INTN int3 -#define __CLC_VECSIZE 3 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE double4 -#define __CLC_INTN int4 -#define __CLC_VECSIZE 4 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE double8 -#define __CLC_INTN int8 -#define __CLC_VECSIZE 8 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#define __CLC_GENTYPE double16 -#define __CLC_INTN int16 -#define __CLC_VECSIZE 16 -#include __CLC_BODY -#undef __CLC_VECSIZE -#undef __CLC_GENTYPE -#undef __CLC_INTN - -#undef __CLC_FPSIZE -#undef __CLC_SCALAR_GENTYPE -#endif - -#undef __CLC_BODY -#endif diff --git a/libclc/generic/include/clc/math/half_rsqrt.h b/libclc/generic/include/clc/math/half_rsqrt.h deleted file mode 100644 index 0c1f5088c0f8..000000000000 --- a/libclc/generic/include/clc/math/half_rsqrt.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#undef half_rsqrt - -#define __CLC_BODY -#define __CLC_FUNCTION half_rsqrt -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/half_sqrt.h b/libclc/generic/include/clc/math/half_sqrt.h deleted file mode 100644 index cec80f54c365..000000000000 --- a/libclc/generic/include/clc/math/half_sqrt.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#undef half_sqrt - -#define __CLC_BODY -#define __CLC_FUNCTION half_sqrt -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/hypot.h b/libclc/generic/include/clc/math/hypot.h deleted file mode 100644 index c00eb4532461..000000000000 --- a/libclc/generic/include/clc/math/hypot.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/hypot.inc b/libclc/generic/include/clc/math/hypot.inc deleted file mode 100644 index 08b46058b0aa..000000000000 --- a/libclc/generic/include/clc/math/hypot.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE hypot(__CLC_GENTYPE x, __CLC_GENTYPE y); diff --git a/libclc/generic/include/clc/math/ilogb.h b/libclc/generic/include/clc/math/ilogb.h deleted file mode 100644 index 2bb9e9c3a49f..000000000000 --- a/libclc/generic/include/clc/math/ilogb.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_BODY - -#include - -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/ilogb.inc b/libclc/generic/include/clc/math/ilogb.inc deleted file mode 100644 index 7f99fb44a754..000000000000 --- a/libclc/generic/include/clc/math/ilogb.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_INTN ilogb(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/ldexp.h b/libclc/generic/include/clc/math/ldexp.h deleted file mode 100644 index f87df88bcf0b..000000000000 --- a/libclc/generic/include/clc/math/ldexp.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/ldexp.inc b/libclc/generic/include/clc/math/ldexp.inc deleted file mode 100644 index 67a22b252436..000000000000 --- a/libclc/generic/include/clc/math/ldexp.inc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE ldexp(__CLC_GENTYPE x, int n); - -#ifndef __CLC_SCALAR - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE ldexp(__CLC_GENTYPE x, __CLC_INTN n); - -#endif diff --git a/libclc/generic/include/clc/math/log.h b/libclc/generic/include/clc/math/log.h deleted file mode 100644 index 5680de2c1e02..000000000000 --- a/libclc/generic/include/clc/math/log.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/log.inc b/libclc/generic/include/clc/math/log.inc deleted file mode 100644 index 621dd0831b46..000000000000 --- a/libclc/generic/include/clc/math/log.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/log10.h b/libclc/generic/include/clc/math/log10.h deleted file mode 100644 index ec4e4ae9362d..000000000000 --- a/libclc/generic/include/clc/math/log10.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef log10 - -#define __CLC_BODY -#define __CLC_FUNCTION log10 - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/math/log1p.h b/libclc/generic/include/clc/math/log1p.h deleted file mode 100644 index 4d716dd18d9c..000000000000 --- a/libclc/generic/include/clc/math/log1p.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/log1p.inc b/libclc/generic/include/clc/math/log1p.inc deleted file mode 100644 index 4cbfbf38fc11..000000000000 --- a/libclc/generic/include/clc/math/log1p.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log1p(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/log2.h b/libclc/generic/include/clc/math/log2.h deleted file mode 100644 index 7bd813f1dc2e..000000000000 --- a/libclc/generic/include/clc/math/log2.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/log2.inc b/libclc/generic/include/clc/math/log2.inc deleted file mode 100644 index 1d27c8ae33c0..000000000000 --- a/libclc/generic/include/clc/math/log2.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE log2(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/mad.h b/libclc/generic/include/clc/math/mad.h deleted file mode 100644 index c4e50840ced0..000000000000 --- a/libclc/generic/include/clc/math/mad.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/mad.inc b/libclc/generic/include/clc/math/mad.inc deleted file mode 100644 index 61194b6ca4a7..000000000000 --- a/libclc/generic/include/clc/math/mad.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE mad(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c); diff --git a/libclc/generic/include/clc/math/modf.h b/libclc/generic/include/clc/math/modf.h deleted file mode 100644 index f0fb6ca81920..000000000000 --- a/libclc/generic/include/clc/math/modf.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/modf.inc b/libclc/generic/include/clc/math/modf.inc deleted file mode 100644 index 42bcf625686d..000000000000 --- a/libclc/generic/include/clc/math/modf.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, global __CLC_GENTYPE *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, local __CLC_GENTYPE *iptr); -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE modf(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr); diff --git a/libclc/generic/include/clc/math/native_cos.h b/libclc/generic/include/clc/math/native_cos.h deleted file mode 100644 index c7212cc4b663..000000000000 --- a/libclc/generic/include/clc/math/native_cos.h +++ /dev/null @@ -1 +0,0 @@ -#define native_cos cos diff --git a/libclc/generic/include/clc/math/native_divide.h b/libclc/generic/include/clc/math/native_divide.h deleted file mode 100644 index 5c52167fd3e7..000000000000 --- a/libclc/generic/include/clc/math/native_divide.h +++ /dev/null @@ -1 +0,0 @@ -#define native_divide(x, y) ((x) / (y)) diff --git a/libclc/generic/include/clc/math/native_exp.h b/libclc/generic/include/clc/math/native_exp.h deleted file mode 100644 index e206de66926d..000000000000 --- a/libclc/generic/include/clc/math/native_exp.h +++ /dev/null @@ -1 +0,0 @@ -#define native_exp exp diff --git a/libclc/generic/include/clc/math/native_exp10.h b/libclc/generic/include/clc/math/native_exp10.h deleted file mode 100644 index 1156f58c53a5..000000000000 --- a/libclc/generic/include/clc/math/native_exp10.h +++ /dev/null @@ -1 +0,0 @@ -#define native_exp10 exp10 diff --git a/libclc/generic/include/clc/math/native_exp2.h b/libclc/generic/include/clc/math/native_exp2.h deleted file mode 100644 index b6759390ee43..000000000000 --- a/libclc/generic/include/clc/math/native_exp2.h +++ /dev/null @@ -1 +0,0 @@ -#define native_exp2 exp2 diff --git a/libclc/generic/include/clc/math/native_log.h b/libclc/generic/include/clc/math/native_log.h deleted file mode 100644 index ed3398b9f9f8..000000000000 --- a/libclc/generic/include/clc/math/native_log.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __CLC_BODY -#undef __FLOAT_ONLY diff --git a/libclc/generic/include/clc/math/native_log.inc b/libclc/generic/include/clc/math/native_log.inc deleted file mode 100644 index b6b3d1f90591..000000000000 --- a/libclc/generic/include/clc/math/native_log.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/native_log2.h b/libclc/generic/include/clc/math/native_log2.h deleted file mode 100644 index 99fd7e353829..000000000000 --- a/libclc/generic/include/clc/math/native_log2.h +++ /dev/null @@ -1,27 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __CLC_BODY -#undef __FLOAT_ONLY diff --git a/libclc/generic/include/clc/math/native_log2.inc b/libclc/generic/include/clc/math/native_log2.inc deleted file mode 100644 index 99ff9d667cd7..000000000000 --- a/libclc/generic/include/clc/math/native_log2.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE native_log2(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/native_powr.h b/libclc/generic/include/clc/math/native_powr.h deleted file mode 100644 index e8a37d9cb066..000000000000 --- a/libclc/generic/include/clc/math/native_powr.h +++ /dev/null @@ -1 +0,0 @@ -#define native_powr pow diff --git a/libclc/generic/include/clc/math/native_sin.h b/libclc/generic/include/clc/math/native_sin.h deleted file mode 100644 index 569a051ccc75..000000000000 --- a/libclc/generic/include/clc/math/native_sin.h +++ /dev/null @@ -1 +0,0 @@ -#define native_sin sin diff --git a/libclc/generic/include/clc/math/native_sqrt.h b/libclc/generic/include/clc/math/native_sqrt.h deleted file mode 100644 index a9525fccb7c1..000000000000 --- a/libclc/generic/include/clc/math/native_sqrt.h +++ /dev/null @@ -1 +0,0 @@ -#define native_sqrt sqrt diff --git a/libclc/generic/include/clc/math/nextafter.h b/libclc/generic/include/clc/math/nextafter.h deleted file mode 100644 index 06e1b2a53c52..000000000000 --- a/libclc/generic/include/clc/math/nextafter.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_BODY -#define __CLC_FUNCTION nextafter -#include -#undef __CLC_FUNCTION -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/pow.h b/libclc/generic/include/clc/math/pow.h deleted file mode 100644 index 320d341a6830..000000000000 --- a/libclc/generic/include/clc/math/pow.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef pow -#define pow __clc_pow - -#define __CLC_FUNCTION __clc_pow -#define __CLC_INTRINSIC "llvm.pow" -#include diff --git a/libclc/generic/include/clc/math/pown.h b/libclc/generic/include/clc/math/pown.h deleted file mode 100644 index bdbf50c1de6f..000000000000 --- a/libclc/generic/include/clc/math/pown.h +++ /dev/null @@ -1,24 +0,0 @@ -#define _CLC_POWN_INTRINSIC "llvm.powi" - -#define _CLC_POWN_DECL(GENTYPE, INTTYPE) \ - _CLC_OVERLOAD _CLC_DECL GENTYPE pown(GENTYPE x, INTTYPE y); - -#define _CLC_VECTOR_POWN_DECL(GENTYPE, INTTYPE) \ - _CLC_POWN_DECL(GENTYPE##2, INTTYPE##2) \ - _CLC_POWN_DECL(GENTYPE##3, INTTYPE##3) \ - _CLC_POWN_DECL(GENTYPE##4, INTTYPE##4) \ - _CLC_POWN_DECL(GENTYPE##8, INTTYPE##8) \ - _CLC_POWN_DECL(GENTYPE##16, INTTYPE##16) - -_CLC_OVERLOAD float pown(float x, int y) __asm(_CLC_POWN_INTRINSIC ".f32"); - -_CLC_VECTOR_POWN_DECL(float, int) - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD double pown(double x, int y) __asm(_CLC_POWN_INTRINSIC ".f64"); -_CLC_VECTOR_POWN_DECL(double, int) -#endif - -#undef _CLC_POWN_INTRINSIC -#undef _CLC_POWN_DECL -#undef _CLC_VECTOR_POWN_DECL diff --git a/libclc/generic/include/clc/math/rint.h b/libclc/generic/include/clc/math/rint.h deleted file mode 100644 index d257634a6f95..000000000000 --- a/libclc/generic/include/clc/math/rint.h +++ /dev/null @@ -1,6 +0,0 @@ -#undef rint -#define rint __clc_rint - -#define __CLC_FUNCTION __clc_rint -#define __CLC_INTRINSIC "llvm.rint" -#include diff --git a/libclc/generic/include/clc/math/round.h b/libclc/generic/include/clc/math/round.h deleted file mode 100644 index 43e16aed028f..000000000000 --- a/libclc/generic/include/clc/math/round.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef round -#define round __clc_round - -#define __CLC_FUNCTION __clc_round -#define __CLC_INTRINSIC "llvm.round" -#include - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/include/clc/math/rsqrt.h b/libclc/generic/include/clc/math/rsqrt.h deleted file mode 100644 index 9d49ee652262..000000000000 --- a/libclc/generic/include/clc/math/rsqrt.h +++ /dev/null @@ -1 +0,0 @@ -#define rsqrt(x) (1.f/sqrt(x)) diff --git a/libclc/generic/include/clc/math/sin.h b/libclc/generic/include/clc/math/sin.h deleted file mode 100644 index 6d4cf5a3142c..000000000000 --- a/libclc/generic/include/clc/math/sin.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/sin.inc b/libclc/generic/include/clc/math/sin.inc deleted file mode 100644 index e722fa352731..000000000000 --- a/libclc/generic/include/clc/math/sin.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sin(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/sincos.h b/libclc/generic/include/clc/math/sincos.h deleted file mode 100644 index fbb9b55cd1f7..000000000000 --- a/libclc/generic/include/clc/math/sincos.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/sincos.inc b/libclc/generic/include/clc/math/sincos.inc deleted file mode 100644 index 444ac82a5204..000000000000 --- a/libclc/generic/include/clc/math/sincos.inc +++ /dev/null @@ -1,8 +0,0 @@ -#define __CLC_DECLARE_SINCOS(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DECL TYPE sincos (TYPE x, ADDRSPACE TYPE * cosval); - -__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE) -__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE) -__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE) - -#undef __CLC_DECLARE_SINCOS diff --git a/libclc/generic/include/clc/math/sinpi.h b/libclc/generic/include/clc/math/sinpi.h deleted file mode 100644 index 390897673a42..000000000000 --- a/libclc/generic/include/clc/math/sinpi.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/sinpi.inc b/libclc/generic/include/clc/math/sinpi.inc deleted file mode 100644 index f0c872a287d1..000000000000 --- a/libclc/generic/include/clc/math/sinpi.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sinpi(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/sqrt.h b/libclc/generic/include/clc/math/sqrt.h deleted file mode 100644 index ccde9748adb7..000000000000 --- a/libclc/generic/include/clc/math/sqrt.h +++ /dev/null @@ -1,3 +0,0 @@ -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/math/sqrt.inc b/libclc/generic/include/clc/math/sqrt.inc deleted file mode 100644 index f629fac761bb..000000000000 --- a/libclc/generic/include/clc/math/sqrt.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE sqrt(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/tan.h b/libclc/generic/include/clc/math/tan.h deleted file mode 100644 index d2d52a9459d0..000000000000 --- a/libclc/generic/include/clc/math/tan.h +++ /dev/null @@ -1,2 +0,0 @@ -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/tan.inc b/libclc/generic/include/clc/math/tan.inc deleted file mode 100644 index 50c5b1d160c8..000000000000 --- a/libclc/generic/include/clc/math/tan.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE tan(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/tanh.h b/libclc/generic/include/clc/math/tanh.h deleted file mode 100644 index e895ee414092..000000000000 --- a/libclc/generic/include/clc/math/tanh.h +++ /dev/null @@ -1,24 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/math/tanh.inc b/libclc/generic/include/clc/math/tanh.inc deleted file mode 100644 index f0735e96222b..000000000000 --- a/libclc/generic/include/clc/math/tanh.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE tanh(__CLC_GENTYPE a); diff --git a/libclc/generic/include/clc/math/ternary_intrin.inc b/libclc/generic/include/clc/math/ternary_intrin.inc deleted file mode 100644 index 9633696ed9c4..000000000000 --- a/libclc/generic/include/clc/math/ternary_intrin.inc +++ /dev/null @@ -1,18 +0,0 @@ -_CLC_OVERLOAD float __CLC_FUNCTION(float, float, float) __asm(__CLC_INTRINSIC ".f32"); -_CLC_OVERLOAD float2 __CLC_FUNCTION(float2, float2, float2) __asm(__CLC_INTRINSIC ".v2f32"); -_CLC_OVERLOAD float3 __CLC_FUNCTION(float3, float3, float3) __asm(__CLC_INTRINSIC ".v3f32"); -_CLC_OVERLOAD float4 __CLC_FUNCTION(float4, float4, float4) __asm(__CLC_INTRINSIC ".v4f32"); -_CLC_OVERLOAD float8 __CLC_FUNCTION(float8, float8, float8) __asm(__CLC_INTRINSIC ".v8f32"); -_CLC_OVERLOAD float16 __CLC_FUNCTION(float16, float16, float16) __asm(__CLC_INTRINSIC ".v16f32"); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD double __CLC_FUNCTION(double, double, double) __asm(__CLC_INTRINSIC ".f64"); -_CLC_OVERLOAD double2 __CLC_FUNCTION(double2, double2, double2) __asm(__CLC_INTRINSIC ".v2f64"); -_CLC_OVERLOAD double3 __CLC_FUNCTION(double3, double3, double3) __asm(__CLC_INTRINSIC ".v3f64"); -_CLC_OVERLOAD double4 __CLC_FUNCTION(double4, double4, double4) __asm(__CLC_INTRINSIC ".v4f64"); -_CLC_OVERLOAD double8 __CLC_FUNCTION(double8, double8, double8) __asm(__CLC_INTRINSIC ".v8f64"); -_CLC_OVERLOAD double16 __CLC_FUNCTION(double16, double16, double16) __asm(__CLC_INTRINSIC ".v16f64"); -#endif - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/include/clc/math/trunc.h b/libclc/generic/include/clc/math/trunc.h deleted file mode 100644 index d34f66190433..000000000000 --- a/libclc/generic/include/clc/math/trunc.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef trunc -#define trunc __clc_trunc - -#define __CLC_FUNCTION __clc_trunc -#define __CLC_INTRINSIC "llvm.trunc" -#include - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/include/clc/math/unary_decl.inc b/libclc/generic/include/clc/math/unary_decl.inc deleted file mode 100644 index 9858d908da09..000000000000 --- a/libclc/generic/include/clc/math/unary_decl.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __CLC_FUNCTION(__CLC_GENTYPE x); diff --git a/libclc/generic/include/clc/math/unary_intrin.inc b/libclc/generic/include/clc/math/unary_intrin.inc deleted file mode 100644 index 8c62d8827fe7..000000000000 --- a/libclc/generic/include/clc/math/unary_intrin.inc +++ /dev/null @@ -1,18 +0,0 @@ -_CLC_OVERLOAD float __CLC_FUNCTION(float f) __asm(__CLC_INTRINSIC ".f32"); -_CLC_OVERLOAD float2 __CLC_FUNCTION(float2 f) __asm(__CLC_INTRINSIC ".v2f32"); -_CLC_OVERLOAD float3 __CLC_FUNCTION(float3 f) __asm(__CLC_INTRINSIC ".v3f32"); -_CLC_OVERLOAD float4 __CLC_FUNCTION(float4 f) __asm(__CLC_INTRINSIC ".v4f32"); -_CLC_OVERLOAD float8 __CLC_FUNCTION(float8 f) __asm(__CLC_INTRINSIC ".v8f32"); -_CLC_OVERLOAD float16 __CLC_FUNCTION(float16 f) __asm(__CLC_INTRINSIC ".v16f32"); - -#ifdef cl_khr_fp64 -_CLC_OVERLOAD double __CLC_FUNCTION(double d) __asm(__CLC_INTRINSIC ".f64"); -_CLC_OVERLOAD double2 __CLC_FUNCTION(double2 d) __asm(__CLC_INTRINSIC ".v2f64"); -_CLC_OVERLOAD double3 __CLC_FUNCTION(double3 d) __asm(__CLC_INTRINSIC ".v3f64"); -_CLC_OVERLOAD double4 __CLC_FUNCTION(double4 d) __asm(__CLC_INTRINSIC ".v4f64"); -_CLC_OVERLOAD double8 __CLC_FUNCTION(double8 d) __asm(__CLC_INTRINSIC ".v8f64"); -_CLC_OVERLOAD double16 __CLC_FUNCTION(double16 d) __asm(__CLC_INTRINSIC ".v16f64"); -#endif - -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC diff --git a/libclc/generic/include/clc/relational/all.h b/libclc/generic/include/clc/relational/all.h deleted file mode 100644 index f8b0942444a2..000000000000 --- a/libclc/generic/include/clc/relational/all.h +++ /dev/null @@ -1,18 +0,0 @@ -#define _CLC_ALL_DECL(TYPE) \ - _CLC_OVERLOAD _CLC_DECL int all(TYPE v); - -#define _CLC_VECTOR_ALL_DECL(TYPE) \ - _CLC_ALL_DECL(TYPE) \ - _CLC_ALL_DECL(TYPE##2) \ - _CLC_ALL_DECL(TYPE##3) \ - _CLC_ALL_DECL(TYPE##4) \ - _CLC_ALL_DECL(TYPE##8) \ - _CLC_ALL_DECL(TYPE##16) - -_CLC_VECTOR_ALL_DECL(char) -_CLC_VECTOR_ALL_DECL(short) -_CLC_VECTOR_ALL_DECL(int) -_CLC_VECTOR_ALL_DECL(long) - -#undef _CLC_ALL_DECL -#undef _CLC_VECTOR_ALL_DECL diff --git a/libclc/generic/include/clc/relational/any.h b/libclc/generic/include/clc/relational/any.h deleted file mode 100644 index 4687ed263793..000000000000 --- a/libclc/generic/include/clc/relational/any.h +++ /dev/null @@ -1,16 +0,0 @@ - -#define _CLC_ANY_DECL(TYPE) \ - _CLC_OVERLOAD _CLC_DECL int any(TYPE v); - -#define _CLC_VECTOR_ANY_DECL(TYPE) \ - _CLC_ANY_DECL(TYPE) \ - _CLC_ANY_DECL(TYPE##2) \ - _CLC_ANY_DECL(TYPE##3) \ - _CLC_ANY_DECL(TYPE##4) \ - _CLC_ANY_DECL(TYPE##8) \ - _CLC_ANY_DECL(TYPE##16) - -_CLC_VECTOR_ANY_DECL(char) -_CLC_VECTOR_ANY_DECL(short) -_CLC_VECTOR_ANY_DECL(int) -_CLC_VECTOR_ANY_DECL(long) diff --git a/libclc/generic/include/clc/relational/binary_decl.inc b/libclc/generic/include/clc/relational/binary_decl.inc deleted file mode 100644 index c9e4aee839a1..000000000000 --- a/libclc/generic/include/clc/relational/binary_decl.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_INTN __CLC_FUNCTION(__CLC_FLOATN a, __CLC_FLOATN b); diff --git a/libclc/generic/include/clc/relational/bitselect.h b/libclc/generic/include/clc/relational/bitselect.h deleted file mode 100644 index 0c7b2f7b0c60..000000000000 --- a/libclc/generic/include/clc/relational/bitselect.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define __CLC_BODY -#include -#define __CLC_BODY -#include - -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/relational/bitselect.inc b/libclc/generic/include/clc/relational/bitselect.inc deleted file mode 100644 index 364d6493667f..000000000000 --- a/libclc/generic/include/clc/relational/bitselect.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE bitselect(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z); diff --git a/libclc/generic/include/clc/relational/floatn.inc b/libclc/generic/include/clc/relational/floatn.inc deleted file mode 100644 index 8d7fd52cc7da..000000000000 --- a/libclc/generic/include/clc/relational/floatn.inc +++ /dev/null @@ -1,81 +0,0 @@ - -#define __CLC_FLOATN float -#define __CLC_INTN int -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN float2 -#define __CLC_INTN int2 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN float3 -#define __CLC_INTN int3 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN float4 -#define __CLC_INTN int4 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN float8 -#define __CLC_INTN int8 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN float16 -#define __CLC_INTN int16 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#undef __CLC_FLOAT -#undef __CLC_INT - -#ifdef cl_khr_fp64 - -#define __CLC_FLOATN double -#define __CLC_INTN int -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN double2 -#define __CLC_INTN long2 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN double3 -#define __CLC_INTN long3 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN double4 -#define __CLC_INTN long4 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN double8 -#define __CLC_INTN long8 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#define __CLC_FLOATN double16 -#define __CLC_INTN long16 -#include __CLC_BODY -#undef __CLC_INTN -#undef __CLC_FLOATN - -#endif - -#undef __CLC_BODY diff --git a/libclc/generic/include/clc/relational/isequal.h b/libclc/generic/include/clc/relational/isequal.h deleted file mode 100644 index c28a98565ee3..000000000000 --- a/libclc/generic/include/clc/relational/isequal.h +++ /dev/null @@ -1,20 +0,0 @@ -#define _CLC_ISEQUAL_DECL(TYPE, RETTYPE) \ - _CLC_OVERLOAD _CLC_DECL RETTYPE isequal(TYPE x, TYPE y); - -#define _CLC_VECTOR_ISEQUAL_DECL(TYPE, RETTYPE) \ - _CLC_ISEQUAL_DECL(TYPE##2, RETTYPE##2) \ - _CLC_ISEQUAL_DECL(TYPE##3, RETTYPE##3) \ - _CLC_ISEQUAL_DECL(TYPE##4, RETTYPE##4) \ - _CLC_ISEQUAL_DECL(TYPE##8, RETTYPE##8) \ - _CLC_ISEQUAL_DECL(TYPE##16, RETTYPE##16) - -_CLC_ISEQUAL_DECL(float, int) -_CLC_VECTOR_ISEQUAL_DECL(float, int) - -#ifdef cl_khr_fp64 -_CLC_ISEQUAL_DECL(double, int) -_CLC_VECTOR_ISEQUAL_DECL(double, long) -#endif - -#undef _CLC_ISEQUAL_DECL -#undef _CLC_VECTOR_ISEQUAL_DEC diff --git a/libclc/generic/include/clc/relational/isfinite.h b/libclc/generic/include/clc/relational/isfinite.h deleted file mode 100644 index 48e261a54ff7..000000000000 --- a/libclc/generic/include/clc/relational/isfinite.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isfinite - -#define __CLC_FUNCTION isfinite -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isgreater.h b/libclc/generic/include/clc/relational/isgreater.h deleted file mode 100644 index d17ae0c00c82..000000000000 --- a/libclc/generic/include/clc/relational/isgreater.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isgreater - -#define __CLC_FUNCTION isgreater -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isgreaterequal.h b/libclc/generic/include/clc/relational/isgreaterequal.h deleted file mode 100644 index 835332858d29..000000000000 --- a/libclc/generic/include/clc/relational/isgreaterequal.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isgreaterequal - -#define __CLC_FUNCTION isgreaterequal -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isinf.h b/libclc/generic/include/clc/relational/isinf.h deleted file mode 100644 index 869f0c8a9ac4..000000000000 --- a/libclc/generic/include/clc/relational/isinf.h +++ /dev/null @@ -1,21 +0,0 @@ - -#define _CLC_ISINF_DECL(RET_TYPE, ARG_TYPE) \ - _CLC_OVERLOAD _CLC_DECL RET_TYPE isinf(ARG_TYPE); - -#define _CLC_VECTOR_ISINF_DECL(RET_TYPE, ARG_TYPE) \ - _CLC_ISINF_DECL(RET_TYPE##2, ARG_TYPE##2) \ - _CLC_ISINF_DECL(RET_TYPE##3, ARG_TYPE##3) \ - _CLC_ISINF_DECL(RET_TYPE##4, ARG_TYPE##4) \ - _CLC_ISINF_DECL(RET_TYPE##8, ARG_TYPE##8) \ - _CLC_ISINF_DECL(RET_TYPE##16, ARG_TYPE##16) - -_CLC_ISINF_DECL(int, float) -_CLC_VECTOR_ISINF_DECL(int, float) - -#ifdef cl_khr_fp64 -_CLC_ISINF_DECL(int, double) -_CLC_VECTOR_ISINF_DECL(long, double) -#endif - -#undef _CLC_ISINF_DECL -#undef _CLC_VECTOR_ISINF_DECL diff --git a/libclc/generic/include/clc/relational/isless.h b/libclc/generic/include/clc/relational/isless.h deleted file mode 100644 index 1debd87f386e..000000000000 --- a/libclc/generic/include/clc/relational/isless.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __CLC_FUNCTION isless -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/islessequal.h b/libclc/generic/include/clc/relational/islessequal.h deleted file mode 100644 index e6a99d7f21c8..000000000000 --- a/libclc/generic/include/clc/relational/islessequal.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __CLC_FUNCTION islessequal -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/islessgreater.h b/libclc/generic/include/clc/relational/islessgreater.h deleted file mode 100644 index 005ba1090789..000000000000 --- a/libclc/generic/include/clc/relational/islessgreater.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __CLC_FUNCTION islessgreater -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isnan.h b/libclc/generic/include/clc/relational/isnan.h deleted file mode 100644 index 93eb9dffb424..000000000000 --- a/libclc/generic/include/clc/relational/isnan.h +++ /dev/null @@ -1,21 +0,0 @@ - -#define _CLC_ISNAN_DECL(RET_TYPE, ARG_TYPE) \ - _CLC_OVERLOAD _CLC_DECL RET_TYPE isnan(ARG_TYPE); - -#define _CLC_VECTOR_ISNAN_DECL(RET_TYPE, ARG_TYPE) \ - _CLC_ISNAN_DECL(RET_TYPE##2, ARG_TYPE##2) \ - _CLC_ISNAN_DECL(RET_TYPE##3, ARG_TYPE##3) \ - _CLC_ISNAN_DECL(RET_TYPE##4, ARG_TYPE##4) \ - _CLC_ISNAN_DECL(RET_TYPE##8, ARG_TYPE##8) \ - _CLC_ISNAN_DECL(RET_TYPE##16, ARG_TYPE##16) - -_CLC_ISNAN_DECL(int, float) -_CLC_VECTOR_ISNAN_DECL(int, float) - -#ifdef cl_khr_fp64 -_CLC_ISNAN_DECL(int, double) -_CLC_VECTOR_ISNAN_DECL(long, double) -#endif - -#undef _CLC_ISNAN_DECL -#undef _CLC_VECTOR_ISNAN_DECL diff --git a/libclc/generic/include/clc/relational/isnormal.h b/libclc/generic/include/clc/relational/isnormal.h deleted file mode 100644 index f568c56f8e6e..000000000000 --- a/libclc/generic/include/clc/relational/isnormal.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isnormal - -#define __CLC_FUNCTION isnormal -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isnotequal.h b/libclc/generic/include/clc/relational/isnotequal.h deleted file mode 100644 index f2ceea211046..000000000000 --- a/libclc/generic/include/clc/relational/isnotequal.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isnotequal - -#define __CLC_FUNCTION isnotequal -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isordered.h b/libclc/generic/include/clc/relational/isordered.h deleted file mode 100644 index 89e9620a4600..000000000000 --- a/libclc/generic/include/clc/relational/isordered.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isordered - -#define __CLC_FUNCTION isordered -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/isunordered.h b/libclc/generic/include/clc/relational/isunordered.h deleted file mode 100644 index a6b8e2557d23..000000000000 --- a/libclc/generic/include/clc/relational/isunordered.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef isunordered - -#define __CLC_FUNCTION isunordered -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/select.h b/libclc/generic/include/clc/relational/select.h deleted file mode 100644 index 33a6909fb929..000000000000 --- a/libclc/generic/include/clc/relational/select.h +++ /dev/null @@ -1 +0,0 @@ -#define select(a, b, c) ((c) ? (b) : (a)) diff --git a/libclc/generic/include/clc/relational/signbit.h b/libclc/generic/include/clc/relational/signbit.h deleted file mode 100644 index 41e5284bb34c..000000000000 --- a/libclc/generic/include/clc/relational/signbit.h +++ /dev/null @@ -1,9 +0,0 @@ -#undef signbit - -#define __CLC_FUNCTION signbit -#define __CLC_BODY - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/clc/relational/unary_decl.inc b/libclc/generic/include/clc/relational/unary_decl.inc deleted file mode 100644 index ab9b776a46ec..000000000000 --- a/libclc/generic/include/clc/relational/unary_decl.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_INTN __CLC_FUNCTION(__CLC_FLOATN x); diff --git a/libclc/generic/include/clc/shared/clamp.h b/libclc/generic/include/clc/shared/clamp.h deleted file mode 100644 index a389b85d2666..000000000000 --- a/libclc/generic/include/clc/shared/clamp.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_BODY -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/shared/clamp.inc b/libclc/generic/include/clc/shared/clamp.inc deleted file mode 100644 index aaff9d0ff07f..000000000000 --- a/libclc/generic/include/clc/shared/clamp.inc +++ /dev/null @@ -1,5 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z); - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z); -#endif diff --git a/libclc/generic/include/clc/shared/max.h b/libclc/generic/include/clc/shared/max.h deleted file mode 100644 index ee20b9e64df7..000000000000 --- a/libclc/generic/include/clc/shared/max.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_BODY -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/shared/max.inc b/libclc/generic/include/clc/shared/max.inc deleted file mode 100644 index 590107435e66..000000000000 --- a/libclc/generic/include/clc/shared/max.inc +++ /dev/null @@ -1,5 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_GENTYPE b); - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b); -#endif diff --git a/libclc/generic/include/clc/shared/min.h b/libclc/generic/include/clc/shared/min.h deleted file mode 100644 index e11d9f9551ff..000000000000 --- a/libclc/generic/include/clc/shared/min.h +++ /dev/null @@ -1,5 +0,0 @@ -#define __CLC_BODY -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/include/clc/shared/min.inc b/libclc/generic/include/clc/shared/min.inc deleted file mode 100644 index d8c1568a590c..000000000000 --- a/libclc/generic/include/clc/shared/min.inc +++ /dev/null @@ -1,5 +0,0 @@ -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b); - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b); -#endif diff --git a/libclc/generic/include/clc/shared/vload.h b/libclc/generic/include/clc/shared/vload.h deleted file mode 100644 index 93d07501d4a1..000000000000 --- a/libclc/generic/include/clc/shared/vload.h +++ /dev/null @@ -1,37 +0,0 @@ -#define _CLC_VLOAD_DECL(PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \ - _CLC_OVERLOAD _CLC_DECL VEC_TYPE vload##WIDTH(size_t offset, const ADDR_SPACE PRIM_TYPE *x); - -#define _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, ADDR_SPACE) \ - _CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \ - _CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE) \ - _CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE) \ - _CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \ - _CLC_VLOAD_DECL(PRIM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE) - -#define _CLC_VECTOR_VLOAD_PRIM1(PRIM_TYPE) \ - _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, __private) \ - _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, __local) \ - _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, __constant) \ - _CLC_VECTOR_VLOAD_DECL(PRIM_TYPE, __global) \ - -#define _CLC_VECTOR_VLOAD_PRIM() \ - _CLC_VECTOR_VLOAD_PRIM1(char) \ - _CLC_VECTOR_VLOAD_PRIM1(uchar) \ - _CLC_VECTOR_VLOAD_PRIM1(short) \ - _CLC_VECTOR_VLOAD_PRIM1(ushort) \ - _CLC_VECTOR_VLOAD_PRIM1(int) \ - _CLC_VECTOR_VLOAD_PRIM1(uint) \ - _CLC_VECTOR_VLOAD_PRIM1(long) \ - _CLC_VECTOR_VLOAD_PRIM1(ulong) \ - _CLC_VECTOR_VLOAD_PRIM1(float) \ - -#ifdef cl_khr_fp64 -#define _CLC_VECTOR_VLOAD() \ - _CLC_VECTOR_VLOAD_PRIM1(double) \ - _CLC_VECTOR_VLOAD_PRIM() -#else -#define _CLC_VECTOR_VLOAD() \ - _CLC_VECTOR_VLOAD_PRIM() -#endif - -_CLC_VECTOR_VLOAD() diff --git a/libclc/generic/include/clc/shared/vstore.h b/libclc/generic/include/clc/shared/vstore.h deleted file mode 100644 index 1f784f82fec0..000000000000 --- a/libclc/generic/include/clc/shared/vstore.h +++ /dev/null @@ -1,36 +0,0 @@ -#define _CLC_VSTORE_DECL(PRIM_TYPE, VEC_TYPE, WIDTH, ADDR_SPACE) \ - _CLC_OVERLOAD _CLC_DECL void vstore##WIDTH(VEC_TYPE vec, size_t offset, ADDR_SPACE PRIM_TYPE *out); - -#define _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, ADDR_SPACE) \ - _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##2, 2, ADDR_SPACE) \ - _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##3, 3, ADDR_SPACE) \ - _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##4, 4, ADDR_SPACE) \ - _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##8, 8, ADDR_SPACE) \ - _CLC_VSTORE_DECL(PRIM_TYPE, PRIM_TYPE##16, 16, ADDR_SPACE) - -#define _CLC_VECTOR_VSTORE_PRIM1(PRIM_TYPE) \ - _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __private) \ - _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __local) \ - _CLC_VECTOR_VSTORE_DECL(PRIM_TYPE, __global) \ - -#define _CLC_VECTOR_VSTORE_PRIM() \ - _CLC_VECTOR_VSTORE_PRIM1(char) \ - _CLC_VECTOR_VSTORE_PRIM1(uchar) \ - _CLC_VECTOR_VSTORE_PRIM1(short) \ - _CLC_VECTOR_VSTORE_PRIM1(ushort) \ - _CLC_VECTOR_VSTORE_PRIM1(int) \ - _CLC_VECTOR_VSTORE_PRIM1(uint) \ - _CLC_VECTOR_VSTORE_PRIM1(long) \ - _CLC_VECTOR_VSTORE_PRIM1(ulong) \ - _CLC_VECTOR_VSTORE_PRIM1(float) \ - -#ifdef cl_khr_fp64 -#define _CLC_VECTOR_VSTORE() \ - _CLC_VECTOR_VSTORE_PRIM1(double) \ - _CLC_VECTOR_VSTORE_PRIM() -#else -#define _CLC_VECTOR_VSTORE() \ - _CLC_VECTOR_VSTORE_PRIM() -#endif - -_CLC_VECTOR_VSTORE() diff --git a/libclc/generic/include/clc/synchronization/barrier.h b/libclc/generic/include/clc/synchronization/barrier.h deleted file mode 100644 index 7167a3d3f093..000000000000 --- a/libclc/generic/include/clc/synchronization/barrier.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL void barrier(cl_mem_fence_flags flags); diff --git a/libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h b/libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h deleted file mode 100644 index c57eb4249a41..000000000000 --- a/libclc/generic/include/clc/synchronization/cl_mem_fence_flags.h +++ /dev/null @@ -1,4 +0,0 @@ -typedef uint cl_mem_fence_flags; - -#define CLK_LOCAL_MEM_FENCE 1 -#define CLK_GLOBAL_MEM_FENCE 2 diff --git a/libclc/generic/include/clc/workitem/get_global_id.h b/libclc/generic/include/clc/workitem/get_global_id.h deleted file mode 100644 index 92759f146894..000000000000 --- a/libclc/generic/include/clc/workitem/get_global_id.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_global_id(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_global_size.h b/libclc/generic/include/clc/workitem/get_global_size.h deleted file mode 100644 index 2f8370585397..000000000000 --- a/libclc/generic/include/clc/workitem/get_global_size.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_global_size(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_group_id.h b/libclc/generic/include/clc/workitem/get_group_id.h deleted file mode 100644 index 346c82c6c316..000000000000 --- a/libclc/generic/include/clc/workitem/get_group_id.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_group_id(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_local_id.h b/libclc/generic/include/clc/workitem/get_local_id.h deleted file mode 100644 index 169aeed86786..000000000000 --- a/libclc/generic/include/clc/workitem/get_local_id.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_local_id(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_local_size.h b/libclc/generic/include/clc/workitem/get_local_size.h deleted file mode 100644 index 040ec58a3d8b..000000000000 --- a/libclc/generic/include/clc/workitem/get_local_size.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_local_size(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_num_groups.h b/libclc/generic/include/clc/workitem/get_num_groups.h deleted file mode 100644 index e555c7efc2d2..000000000000 --- a/libclc/generic/include/clc/workitem/get_num_groups.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL size_t get_num_groups(uint dim); diff --git a/libclc/generic/include/clc/workitem/get_work_dim.h b/libclc/generic/include/clc/workitem/get_work_dim.h deleted file mode 100644 index 6d1982567063..000000000000 --- a/libclc/generic/include/clc/workitem/get_work_dim.h +++ /dev/null @@ -1 +0,0 @@ -_CLC_DECL uint get_work_dim(); diff --git a/libclc/generic/include/config.h b/libclc/generic/include/config.h deleted file mode 100644 index 2994199b02c5..000000000000 --- a/libclc/generic/include/config.h +++ /dev/null @@ -1,26 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_DECL bool __clc_subnormals_disabled(); -_CLC_DECL bool __clc_fp16_subnormals_supported(); -_CLC_DECL bool __clc_fp32_subnormals_supported(); -_CLC_DECL bool __clc_fp64_subnormals_supported(); diff --git a/libclc/generic/include/math/clc_ldexp.h b/libclc/generic/include/math/clc_ldexp.h deleted file mode 100644 index 477dbb22c3cc..000000000000 --- a/libclc/generic/include/math/clc_ldexp.h +++ /dev/null @@ -1,6 +0,0 @@ -_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float, int); - -#ifdef cl_khr_fp64 - #pragma OPENCL EXTENSION cl_khr_fp64 : enable - _CLC_DEF _CLC_OVERLOAD float __clc_ldexp(double, int); -#endif diff --git a/libclc/generic/include/math/clc_nextafter.h b/libclc/generic/include/math/clc_nextafter.h deleted file mode 100644 index 2b674b707956..000000000000 --- a/libclc/generic/include/math/clc_nextafter.h +++ /dev/null @@ -1,7 +0,0 @@ -#define __CLC_BODY -#define __CLC_FUNCTION __clc_nextafter - -#include - -#undef __CLC_BODY -#undef __CLC_FUNCTION diff --git a/libclc/generic/include/math/clc_sqrt.h b/libclc/generic/include/math/clc_sqrt.h deleted file mode 100644 index 8fbf9ebed6a2..000000000000 --- a/libclc/generic/include/math/clc_sqrt.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/include/math/clc_sqrt.inc b/libclc/generic/include/math/clc_sqrt.inc deleted file mode 100644 index d27243cb49a6..000000000000 --- a/libclc/generic/include/math/clc_sqrt.inc +++ /dev/null @@ -1,23 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DECL __CLC_GENTYPE __clc_sqrt(__CLC_GENTYPE a); diff --git a/libclc/generic/lib/SOURCES b/libclc/generic/lib/SOURCES deleted file mode 100644 index c099553d1686..000000000000 --- a/libclc/generic/lib/SOURCES +++ /dev/null @@ -1,142 +0,0 @@ -subnormal_config.cl -subnormal_helper_func.ll -async/async_work_group_copy.cl -async/async_work_group_strided_copy.cl -async/prefetch.cl -async/wait_group_events.cl -atomic/atomic_xchg.cl -atomic/atomic_impl.ll -cl_khr_global_int32_base_atomics/atom_add.cl -cl_khr_global_int32_base_atomics/atom_cmpxchg.cl -cl_khr_global_int32_base_atomics/atom_dec.cl -cl_khr_global_int32_base_atomics/atom_inc.cl -cl_khr_global_int32_base_atomics/atom_sub.cl -cl_khr_global_int32_base_atomics/atom_xchg.cl -cl_khr_global_int32_extended_atomics/atom_and.cl -cl_khr_global_int32_extended_atomics/atom_max.cl -cl_khr_global_int32_extended_atomics/atom_min.cl -cl_khr_global_int32_extended_atomics/atom_or.cl -cl_khr_global_int32_extended_atomics/atom_xor.cl -cl_khr_local_int32_base_atomics/atom_add.cl -cl_khr_local_int32_base_atomics/atom_cmpxchg.cl -cl_khr_local_int32_base_atomics/atom_dec.cl -cl_khr_local_int32_base_atomics/atom_inc.cl -cl_khr_local_int32_base_atomics/atom_sub.cl -cl_khr_local_int32_base_atomics/atom_xchg.cl -cl_khr_local_int32_extended_atomics/atom_and.cl -cl_khr_local_int32_extended_atomics/atom_max.cl -cl_khr_local_int32_extended_atomics/atom_min.cl -cl_khr_local_int32_extended_atomics/atom_or.cl -cl_khr_local_int32_extended_atomics/atom_xor.cl -convert.cl -common/degrees.cl -common/mix.cl -common/radians.cl -common/sign.cl -common/smoothstep.cl -common/step.cl -geometric/cross.cl -geometric/distance.cl -geometric/dot.cl -geometric/fast_distance.cl -geometric/fast_length.cl -geometric/fast_normalize.cl -geometric/length.cl -geometric/normalize.cl -integer/abs.cl -integer/abs_diff.cl -integer/add_sat.cl -integer/add_sat_if.ll -integer/add_sat_impl.ll -integer/clz.cl -integer/clz_if.ll -integer/clz_impl.ll -integer/hadd.cl -integer/mad24.cl -integer/mad_sat.cl -integer/mul24.cl -integer/mul_hi.cl -integer/rhadd.cl -integer/rotate.cl -integer/sub_sat.cl -integer/sub_sat_if.ll -integer/sub_sat_impl.ll -integer/upsample.cl -math/acos.cl -math/acosh.cl -math/acospi.cl -math/asin.cl -math/asinh.cl -math/asinpi.cl -math/atan.cl -math/atan2.cl -math/atan2pi.cl -math/atanh.cl -math/atanpi.cl -math/copysign.cl -math/cos.cl -math/cospi.cl -math/ep_log.cl -math/erf.cl -math/erfc.cl -math/exp.cl -math/exp_helper.cl -math/exp2.cl -math/exp10.cl -math/fdim.cl -math/fmax.cl -math/fmin.cl -math/fmod.cl -math/fract.cl -math/frexp.cl -math/half_rsqrt.cl -math/half_sqrt.cl -math/hypot.cl -math/ilogb.cl -math/clc_ldexp.cl -math/ldexp.cl -math/log.cl -math/log10.cl -math/log1p.cl -math/log2.cl -math/mad.cl -math/modf.cl -math/native_log.cl -math/native_log2.cl -math/tables.cl -math/clc_nextafter.cl -math/nextafter.cl -math/pown.cl -math/sin.cl -math/sincos.cl -math/sincos_helpers.cl -math/sinpi.cl -math/clc_sqrt.cl -math/sqrt.cl -math/tan.cl -math/tanh.cl -relational/all.cl -relational/any.cl -relational/bitselect.cl -relational/isequal.cl -relational/isfinite.cl -relational/isgreater.cl -relational/isgreaterequal.cl -relational/isinf.cl -relational/isless.cl -relational/islessequal.cl -relational/islessgreater.cl -relational/isnan.cl -relational/isnormal.cl -relational/isnotequal.cl -relational/isordered.cl -relational/isunordered.cl -relational/signbit.cl -shared/clamp.cl -shared/max.cl -shared/min.cl -shared/vload.cl -shared/vstore.cl -workitem/get_global_id.cl -workitem/get_global_size.cl -image/get_image_dim.cl diff --git a/libclc/generic/lib/async/async_work_group_copy.cl b/libclc/generic/lib/async/async_work_group_copy.cl deleted file mode 100644 index fe20ecfd9bba..000000000000 --- a/libclc/generic/lib/async/async_work_group_copy.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/lib/async/async_work_group_copy.inc b/libclc/generic/lib/async/async_work_group_copy.inc deleted file mode 100644 index a143ddfb9f6c..000000000000 --- a/libclc/generic/lib/async/async_work_group_copy.inc +++ /dev/null @@ -1,17 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy( - local __CLC_GENTYPE *dst, - const global __CLC_GENTYPE *src, - size_t num_gentypes, - event_t event) { - - return async_work_group_strided_copy(dst, src, num_gentypes, 1, event); -} - -_CLC_OVERLOAD _CLC_DEF event_t async_work_group_copy( - global __CLC_GENTYPE *dst, - const local __CLC_GENTYPE *src, - size_t num_gentypes, - event_t event) { - - return async_work_group_strided_copy(dst, src, num_gentypes, 1, event); -} diff --git a/libclc/generic/lib/async/async_work_group_strided_copy.cl b/libclc/generic/lib/async/async_work_group_strided_copy.cl deleted file mode 100644 index 61b88986fe47..000000000000 --- a/libclc/generic/lib/async/async_work_group_strided_copy.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/lib/async/async_work_group_strided_copy.inc b/libclc/generic/lib/async/async_work_group_strided_copy.inc deleted file mode 100644 index d81a8b79430d..000000000000 --- a/libclc/generic/lib/async/async_work_group_strided_copy.inc +++ /dev/null @@ -1,34 +0,0 @@ - -#define STRIDED_COPY(dst, src, num_gentypes, dst_stride, src_stride) \ - size_t size = get_local_size(0) * get_local_size(1) * get_local_size(2); \ - size_t id = (get_local_size(1) * get_local_size(2) * get_local_id(0)) + \ - (get_local_size(2) * get_local_id(1)) + \ - get_local_id(2); \ - size_t i; \ - \ - for (i = id; i < num_gentypes; i += size) { \ - dst[i * dst_stride] = src[i * src_stride]; \ - } - - -_CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy( - local __CLC_GENTYPE *dst, - const global __CLC_GENTYPE *src, - size_t num_gentypes, - size_t src_stride, - event_t event) { - - STRIDED_COPY(dst, src, num_gentypes, 1, src_stride); - return event; -} - -_CLC_OVERLOAD _CLC_DEF event_t async_work_group_strided_copy( - global __CLC_GENTYPE *dst, - const local __CLC_GENTYPE *src, - size_t num_gentypes, - size_t dst_stride, - event_t event) { - - STRIDED_COPY(dst, src, num_gentypes, dst_stride, 1); - return event; -} diff --git a/libclc/generic/lib/async/prefetch.cl b/libclc/generic/lib/async/prefetch.cl deleted file mode 100644 index 45af21b4d9ff..000000000000 --- a/libclc/generic/lib/async/prefetch.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include -#undef __CLC_BODY diff --git a/libclc/generic/lib/async/prefetch.inc b/libclc/generic/lib/async/prefetch.inc deleted file mode 100644 index 6747e4cf5819..000000000000 --- a/libclc/generic/lib/async/prefetch.inc +++ /dev/null @@ -1 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF void prefetch(const global __CLC_GENTYPE *p, size_t num_gentypes) { } diff --git a/libclc/generic/lib/async/wait_group_events.cl b/libclc/generic/lib/async/wait_group_events.cl deleted file mode 100644 index 05c9d58db45e..000000000000 --- a/libclc/generic/lib/async/wait_group_events.cl +++ /dev/null @@ -1,5 +0,0 @@ -#include - -_CLC_DEF void wait_group_events(int num_events, event_t *event_list) { - barrier(CLK_LOCAL_MEM_FENCE | CLK_GLOBAL_MEM_FENCE); -} diff --git a/libclc/generic/lib/atomic/atomic_impl.ll b/libclc/generic/lib/atomic/atomic_impl.ll deleted file mode 100644 index 019147f8c509..000000000000 --- a/libclc/generic/lib/atomic/atomic_impl.ll +++ /dev/null @@ -1,133 +0,0 @@ -define i32 @__clc_atomic_add_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile add i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_add_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile add i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_and_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile and i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_and_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile and i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_cmpxchg_addr1(i32 addrspace(1)* nocapture %ptr, i32 %compare, i32 %value) nounwind alwaysinline { -entry: - %0 = cmpxchg volatile i32 addrspace(1)* %ptr, i32 %compare, i32 %value seq_cst seq_cst - %1 = extractvalue { i32, i1 } %0, 0 - ret i32 %1 -} - -define i32 @__clc_atomic_cmpxchg_addr3(i32 addrspace(3)* nocapture %ptr, i32 %compare, i32 %value) nounwind alwaysinline { -entry: - %0 = cmpxchg volatile i32 addrspace(3)* %ptr, i32 %compare, i32 %value seq_cst seq_cst - %1 = extractvalue { i32, i1 } %0, 0 - ret i32 %1 -} - -define i32 @__clc_atomic_max_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile max i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_max_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile max i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_min_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile min i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_min_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile min i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_or_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile or i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_or_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile or i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_umax_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile umax i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_umax_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile umax i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_umin_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile umin i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_umin_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile umin i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_sub_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile sub i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_sub_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile sub i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_xchg_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile xchg i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_xchg_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile xchg i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_xor_addr1(i32 addrspace(1)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile xor i32 addrspace(1)* %ptr, i32 %value seq_cst - ret i32 %0 -} - -define i32 @__clc_atomic_xor_addr3(i32 addrspace(3)* nocapture %ptr, i32 %value) nounwind alwaysinline { -entry: - %0 = atomicrmw volatile xor i32 addrspace(3)* %ptr, i32 %value seq_cst - ret i32 %0 -} diff --git a/libclc/generic/lib/atomic/atomic_xchg.cl b/libclc/generic/lib/atomic/atomic_xchg.cl deleted file mode 100644 index 9aee5950141c..000000000000 --- a/libclc/generic/lib/atomic/atomic_xchg.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -_CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile global float *p, float val) { - return as_float(atomic_xchg((volatile global int *)p, as_int(val))); -} - -_CLC_OVERLOAD _CLC_DEF float atomic_xchg(volatile local float *p, float val) { - return as_float(atomic_xchg((volatile local int *)p, as_int(val))); -} diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl deleted file mode 100644 index 9151b0ccf8d9..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_add.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_add(global TYPE *p, TYPE val) { \ - return atomic_add(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl deleted file mode 100644 index 76477406c7f1..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_cmpxchg.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(global TYPE *p, TYPE cmp, TYPE val) { \ - return atomic_cmpxchg(p, cmp, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl deleted file mode 100644 index a74158d45fc8..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_dec.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(global TYPE *p) { \ - return atom_sub(p, 1); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl deleted file mode 100644 index 1404b5aa4477..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_inc.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(global TYPE *p) { \ - return atom_add(p, 1); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl deleted file mode 100644 index 7faa3cc040f0..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_sub.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_sub(global TYPE *p, TYPE val) { \ - return atomic_sub(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_xchg.cl b/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_xchg.cl deleted file mode 100644 index 9c77db13f309..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_base_atomics/atom_xchg.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(global TYPE *p, TYPE val) { \ - return atomic_xchg(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_and.cl b/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_and.cl deleted file mode 100644 index e58796961b98..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_and.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_and(global TYPE *p, TYPE val) { \ - return atomic_and(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) \ No newline at end of file diff --git a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_max.cl b/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_max.cl deleted file mode 100644 index 09177ed8eef4..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_max.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_max(global TYPE *p, TYPE val) { \ - return atomic_max(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_min.cl b/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_min.cl deleted file mode 100644 index 277c41ba90dc..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_min.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_min(global TYPE *p, TYPE val) { \ - return atomic_min(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_or.cl b/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_or.cl deleted file mode 100644 index a936a8ea7d31..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_or.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_or(global TYPE *p, TYPE val) { \ - return atomic_or(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_xor.cl b/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_xor.cl deleted file mode 100644 index 1a8e35004cd5..000000000000 --- a/libclc/generic/lib/cl_khr_global_int32_extended_atomics/atom_xor.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_xor(global TYPE *p, TYPE val) { \ - return atomic_xor(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl deleted file mode 100644 index a5dea1824a16..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_add.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_add(local TYPE *p, TYPE val) { \ - return atomic_add(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl deleted file mode 100644 index 16e957964dbb..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_cmpxchg.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_cmpxchg(local TYPE *p, TYPE cmp, TYPE val) { \ - return atomic_cmpxchg(p, cmp, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl deleted file mode 100644 index d22c333f5d56..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_dec.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_dec(local TYPE *p) { \ - return atom_sub(p, 1); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl deleted file mode 100644 index 4ba0d062997c..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_inc.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_inc(local TYPE *p) { \ - return atom_add(p, 1); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl deleted file mode 100644 index c96696ac2084..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_sub.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_sub(local TYPE *p, TYPE val) { \ - return atomic_sub(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_xchg.cl b/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_xchg.cl deleted file mode 100644 index 7d4bcca3fe7a..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_base_atomics/atom_xchg.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_xchg(local TYPE *p, TYPE val) { \ - return atomic_xchg(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_and.cl b/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_and.cl deleted file mode 100644 index 180103acc01e..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_and.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_and(local TYPE *p, TYPE val) { \ - return atomic_and(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) \ No newline at end of file diff --git a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_max.cl b/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_max.cl deleted file mode 100644 index b90301ba0f76..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_max.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_max(local TYPE *p, TYPE val) { \ - return atomic_max(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_min.cl b/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_min.cl deleted file mode 100644 index 3acedd8350fc..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_min.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_min(local TYPE *p, TYPE val) { \ - return atomic_min(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_or.cl b/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_or.cl deleted file mode 100644 index 338ff2c01088..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_or.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_or(local TYPE *p, TYPE val) { \ - return atomic_or(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_xor.cl b/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_xor.cl deleted file mode 100644 index 51ae3c0e9194..000000000000 --- a/libclc/generic/lib/cl_khr_local_int32_extended_atomics/atom_xor.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -#define IMPL(TYPE) \ -_CLC_OVERLOAD _CLC_DEF TYPE atom_xor(local TYPE *p, TYPE val) { \ - return atomic_xor(p, val); \ -} - -IMPL(int) -IMPL(unsigned int) diff --git a/libclc/generic/lib/clcmacro.h b/libclc/generic/lib/clcmacro.h deleted file mode 100644 index 88f3b2a163ce..000000000000 --- a/libclc/generic/lib/clcmacro.h +++ /dev/null @@ -1,148 +0,0 @@ -#define _CLC_UNARY_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE##2 x) { \ - return (RET_TYPE##2)(FUNCTION(x.x), FUNCTION(x.y)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE##3 x) { \ - return (RET_TYPE##3)(FUNCTION(x.x), FUNCTION(x.y), FUNCTION(x.z)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE##4 x) { \ - return (RET_TYPE##4)(FUNCTION(x.lo), FUNCTION(x.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE##8 x) { \ - return (RET_TYPE##8)(FUNCTION(x.lo), FUNCTION(x.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE##16 x) { \ - return (RET_TYPE##16)(FUNCTION(x.lo), FUNCTION(x.hi)); \ - } - -#define _CLC_BINARY_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE##2 x, ARG2_TYPE##2 y) { \ - return (RET_TYPE##2)(FUNCTION(x.x, y.x), FUNCTION(x.y, y.y)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE##3 x, ARG2_TYPE##3 y) { \ - return (RET_TYPE##3)(FUNCTION(x.x, y.x), FUNCTION(x.y, y.y), \ - FUNCTION(x.z, y.z)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE##4 x, ARG2_TYPE##4 y) { \ - return (RET_TYPE##4)(FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE##8 x, ARG2_TYPE##8 y) { \ - return (RET_TYPE##8)(FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE##16 x, ARG2_TYPE##16 y) { \ - return (RET_TYPE##16)(FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)); \ - } - -#define _CLC_V_S_V_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE x, ARG2_TYPE##2 y) { \ - return (RET_TYPE##2)(FUNCTION(x, y.lo), FUNCTION(x, y.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE x, ARG2_TYPE##3 y) { \ - return (RET_TYPE##3)(FUNCTION(x, y.x), FUNCTION(x, y.y), \ - FUNCTION(x, y.z)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE x, ARG2_TYPE##4 y) { \ - return (RET_TYPE##4)(FUNCTION(x, y.lo), FUNCTION(x, y.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE x, ARG2_TYPE##8 y) { \ - return (RET_TYPE##8)(FUNCTION(x, y.lo), FUNCTION(x, y.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE x, ARG2_TYPE##16 y) { \ - return (RET_TYPE##16)(FUNCTION(x, y.lo), FUNCTION(x, y.hi)); \ - } \ -\ - -#define _CLC_TERNARY_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE##2 x, ARG2_TYPE##2 y, ARG3_TYPE##2 z) { \ - return (RET_TYPE##2)(FUNCTION(x.x, y.x, z.x), FUNCTION(x.y, y.y, z.y)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE##3 x, ARG2_TYPE##3 y, ARG3_TYPE##3 z) { \ - return (RET_TYPE##3)(FUNCTION(x.x, y.x, z.x), FUNCTION(x.y, y.y, z.y), \ - FUNCTION(x.z, y.z, z.z)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE##4 x, ARG2_TYPE##4 y, ARG3_TYPE##4 z) { \ - return (RET_TYPE##4)(FUNCTION(x.lo, y.lo, z.lo), FUNCTION(x.hi, y.hi, z.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE##8 x, ARG2_TYPE##8 y, ARG3_TYPE##8 z) { \ - return (RET_TYPE##8)(FUNCTION(x.lo, y.lo, z.lo), FUNCTION(x.hi, y.hi, z.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE##16 x, ARG2_TYPE##16 y, ARG3_TYPE##16 z) { \ - return (RET_TYPE##16)(FUNCTION(x.lo, y.lo, z.lo), FUNCTION(x.hi, y.hi, z.hi)); \ - } - -#define _CLC_V_S_S_V_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE, ARG3_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE x, ARG2_TYPE y, ARG3_TYPE##2 z) { \ - return (RET_TYPE##2)(FUNCTION(x, y, z.lo), FUNCTION(x, y, z.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE x, ARG2_TYPE y, ARG3_TYPE##3 z) { \ - return (RET_TYPE##3)(FUNCTION(x, y, z.x), FUNCTION(x, y, z.y), \ - FUNCTION(x, y, z.z)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE x, ARG2_TYPE y, ARG3_TYPE##4 z) { \ - return (RET_TYPE##4)(FUNCTION(x, y, z.lo), FUNCTION(x, y, z.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE x, ARG2_TYPE y, ARG3_TYPE##8 z) { \ - return (RET_TYPE##8)(FUNCTION(x, y, z.lo), FUNCTION(x, y, z.hi)); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE x, ARG2_TYPE y, ARG3_TYPE##16 z) { \ - return (RET_TYPE##16)(FUNCTION(x, y, z.lo), FUNCTION(x, y, z.hi)); \ - } \ -\ - -#define _CLC_V_V_VP_VECTORIZE(DECLSPEC, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ - DECLSPEC RET_TYPE##2 FUNCTION(ARG1_TYPE##2 x, ARG2_TYPE##2 *y) { \ - return (RET_TYPE##2)(FUNCTION(x.x, (ARG2_TYPE*)y), FUNCTION(x.y, (ARG2_TYPE*)y+1)); \ - } \ -\ - DECLSPEC RET_TYPE##3 FUNCTION(ARG1_TYPE##3 x, ARG2_TYPE##3 *y) { \ - return (RET_TYPE##3)(FUNCTION(x.x, (ARG2_TYPE*)y), FUNCTION(x.y, (ARG2_TYPE*)y+1), \ - FUNCTION(x.z, (ARG2_TYPE*)y+2)); \ - } \ -\ - DECLSPEC RET_TYPE##4 FUNCTION(ARG1_TYPE##4 x, ARG2_TYPE##4 *y) { \ - return (RET_TYPE##4)(FUNCTION(x.lo, (ARG2_TYPE##2*)y), FUNCTION(x.hi, (ARG2_TYPE##2*)((ARG2_TYPE*)y+2))); \ - } \ -\ - DECLSPEC RET_TYPE##8 FUNCTION(ARG1_TYPE##8 x, ARG2_TYPE##8 *y) { \ - return (RET_TYPE##8)(FUNCTION(x.lo, (ARG2_TYPE##4*)y), FUNCTION(x.hi, (ARG2_TYPE##4*)((ARG2_TYPE*)y+4))); \ - } \ -\ - DECLSPEC RET_TYPE##16 FUNCTION(ARG1_TYPE##16 x, ARG2_TYPE##16 *y) { \ - return (RET_TYPE##16)(FUNCTION(x.lo, (ARG2_TYPE##8*)y), FUNCTION(x.hi, (ARG2_TYPE##8*)((ARG2_TYPE*)y+8))); \ - } - -#define _CLC_DEFINE_BINARY_BUILTIN(RET_TYPE, FUNCTION, BUILTIN, ARG1_TYPE, ARG2_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ - return BUILTIN(x, y); \ -} \ -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) - -#define _CLC_DEFINE_BINARY_BUILTIN_WITH_SCALAR_SECOND_ARG(RET_TYPE, FUNCTION, BUILTIN, ARG1_TYPE, ARG2_TYPE) \ -_CLC_DEFINE_BINARY_BUILTIN(RET_TYPE, FUNCTION, BUILTIN, ARG1_TYPE, ARG2_TYPE) \ -_CLC_BINARY_VECTORIZE_SCALAR_SECOND_ARG(_CLC_OVERLOAD _CLC_DEF, RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) - -#define _CLC_DEFINE_UNARY_BUILTIN(RET_TYPE, FUNCTION, BUILTIN, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x) { \ - return BUILTIN(x); \ -} \ -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, RET_TYPE, FUNCTION, ARG1_TYPE) diff --git a/libclc/generic/lib/common/degrees.cl b/libclc/generic/lib/common/degrees.cl deleted file mode 100644 index 5de56f86c4ca..000000000000 --- a/libclc/generic/lib/common/degrees.cl +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float degrees(float radians) { - // 180/pi = ~57.29577951308232087685 or 0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F - return 0x1.ca5dc2p+5F * radians; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, degrees, float); - - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double degrees(double radians) { - // 180/pi = ~57.29577951308232087685 or 0x1.ca5dc1a63c1f8p+5 or 0x1.ca5dc2p+5F - return 0x1.ca5dc1a63c1f8p+5 * radians; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, degrees, double); - -#endif diff --git a/libclc/generic/lib/common/mix.cl b/libclc/generic/lib/common/mix.cl deleted file mode 100644 index 294f332e67f2..000000000000 --- a/libclc/generic/lib/common/mix.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/common/mix.inc b/libclc/generic/lib/common/mix.inc deleted file mode 100644 index 1e8b936149bb..000000000000 --- a/libclc/generic/lib/common/mix.inc +++ /dev/null @@ -1,9 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE a) { - return mad( y - x, a, x ); -} - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mix(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_SCALAR_GENTYPE a) { - return mix(x, y, (__CLC_GENTYPE)a); -} -#endif diff --git a/libclc/generic/lib/common/radians.cl b/libclc/generic/lib/common/radians.cl deleted file mode 100644 index 3838dd6cde60..000000000000 --- a/libclc/generic/lib/common/radians.cl +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float radians(float degrees) { - // pi/180 = ~0.01745329251994329577 or 0x1.1df46a2529d39p-6 or 0x1.1df46ap-6F - return 0x1.1df46ap-6F * degrees; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, radians, float); - - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double radians(double degrees) { - // pi/180 = ~0.01745329251994329577 or 0x1.1df46a2529d39p-6 or 0x1.1df46ap-6F - return 0x1.1df46a2529d39p-6 * degrees; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, radians, double); - -#endif diff --git a/libclc/generic/lib/common/sign.cl b/libclc/generic/lib/common/sign.cl deleted file mode 100644 index 25832e0b4f8b..000000000000 --- a/libclc/generic/lib/common/sign.cl +++ /dev/null @@ -1,28 +0,0 @@ -#include -#include "../clcmacro.h" - -#define SIGN(TYPE, F) \ -_CLC_DEF _CLC_OVERLOAD TYPE sign(TYPE x) { \ - if (isnan(x)) { \ - return 0.0F; \ - } \ - if (x > 0.0F) { \ - return 1.0F; \ - } \ - if (x < 0.0F) { \ - return -1.0F; \ - } \ - return x; /* -0.0 or +0.0 */ \ -} - -SIGN(float, f) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, sign, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -SIGN(double, ) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, sign, double) - -#endif diff --git a/libclc/generic/lib/common/smoothstep.cl b/libclc/generic/lib/common/smoothstep.cl deleted file mode 100644 index 68d1a13ab397..000000000000 --- a/libclc/generic/lib/common/smoothstep.cl +++ /dev/null @@ -1,55 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float smoothstep(float edge0, float edge1, float x) { - float t = clamp((x - edge0) / (edge1 - edge0), 0.0f, 1.0f); - return t * t * (3.0f - 2.0f * t); -} - -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, smoothstep, float, float, float); - -_CLC_V_S_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, smoothstep, float, float, float); - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -#define SMOOTH_STEP_DEF(edge_type, x_type, impl) \ - _CLC_OVERLOAD _CLC_DEF x_type smoothstep(edge_type edge0, edge_type edge1, x_type x) { \ - double t = clamp((x - edge0) / (edge1 - edge0), 0.0, 1.0); \ - return t * t * (3.0 - 2.0 * t); \ - } - -SMOOTH_STEP_DEF(double, double, SMOOTH_STEP_IMPL_D); - -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, smoothstep, double, double, double); - -SMOOTH_STEP_DEF(float, double, SMOOTH_STEP_IMPL_D); -SMOOTH_STEP_DEF(double, float, SMOOTH_STEP_IMPL_D); - -_CLC_V_S_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, smoothstep, float, float, double); -_CLC_V_S_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, smoothstep, double, double, float); - -#endif diff --git a/libclc/generic/lib/common/step.cl b/libclc/generic/lib/common/step.cl deleted file mode 100644 index 4b022f1316cb..000000000000 --- a/libclc/generic/lib/common/step.cl +++ /dev/null @@ -1,54 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float step(float edge, float x) { - return x < edge ? 0.0f : 1.0f; -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, float, float); - -_CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, float, float); - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -#define STEP_DEF(edge_type, x_type) \ - _CLC_OVERLOAD _CLC_DEF x_type step(edge_type edge, x_type x) { \ - return x < edge ? 0.0 : 1.0; \ - } - -STEP_DEF(double, double); - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, double, double); -_CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, double, double); - -STEP_DEF(float, double); -STEP_DEF(double, float); - -_CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, step, float, double); -_CLC_V_S_V_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, step, double, float); - -#endif diff --git a/libclc/generic/lib/gen_convert.py b/libclc/generic/lib/gen_convert.py deleted file mode 100644 index 5c87fcbe1aba..000000000000 --- a/libclc/generic/lib/gen_convert.py +++ /dev/null @@ -1,395 +0,0 @@ -#!/usr/bin/env python3 - -# OpenCL built-in library: type conversion functions -# -# Copyright (c) 2013 Victor Oliveira -# Copyright (c) 2013 Jesse Towner -# -# Permission is hereby granted, free of charge, to any person obtaining a copy -# of this software and associated documentation files (the "Software"), to deal -# in the Software without restriction, including without limitation the rights -# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -# copies of the Software, and to permit persons to whom the Software is -# furnished to do so, subject to the following conditions: -# -# The above copyright notice and this permission notice shall be included in -# all copies or substantial portions of the Software. -# -# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -# THE SOFTWARE. - -# This script generates the file convert_type.cl, which contains all of the -# OpenCL functions in the form: -# -# convert_<_sat><_roundingMode>() - -types = ['char', 'uchar', 'short', 'ushort', 'int', 'uint', 'long', 'ulong', 'float', 'double'] -int_types = ['char', 'uchar', 'short', 'ushort', 'int', 'uint', 'long', 'ulong'] -unsigned_types = ['uchar', 'ushort', 'uint', 'ulong'] -float_types = ['float', 'double'] -int64_types = ['long', 'ulong'] -float64_types = ['double'] -vector_sizes = ['', '2', '3', '4', '8', '16'] -half_sizes = [('2',''), ('4','2'), ('8','4'), ('16','8')] - -saturation = ['','_sat'] -rounding_modes = ['_rtz','_rte','_rtp','_rtn'] -float_prefix = {'float':'FLT_', 'double':'DBL_'} -float_suffix = {'float':'f', 'double':''} - -bool_type = {'char' : 'char', - 'uchar' : 'char', - 'short' : 'short', - 'ushort': 'short', - 'int' : 'int', - 'uint' : 'int', - 'long' : 'long', - 'ulong' : 'long', - 'float' : 'int', - 'double' : 'long'} - -unsigned_type = {'char' : 'uchar', - 'uchar' : 'uchar', - 'short' : 'ushort', - 'ushort': 'ushort', - 'int' : 'uint', - 'uint' : 'uint', - 'long' : 'ulong', - 'ulong' : 'ulong'} - -sizeof_type = {'char' : 1, 'uchar' : 1, - 'short' : 2, 'ushort' : 2, - 'int' : 4, 'uint' : 4, - 'long' : 8, 'ulong' : 8, - 'float' : 4, 'double' : 8} - -limit_max = {'char' : 'CHAR_MAX', - 'uchar' : 'UCHAR_MAX', - 'short' : 'SHRT_MAX', - 'ushort': 'USHRT_MAX', - 'int' : 'INT_MAX', - 'uint' : 'UINT_MAX', - 'long' : 'LONG_MAX', - 'ulong' : 'ULONG_MAX'} - -limit_min = {'char' : 'CHAR_MIN', - 'uchar' : '0', - 'short' : 'SHRT_MIN', - 'ushort': '0', - 'int' : 'INT_MIN', - 'uint' : '0', - 'long' : 'LONG_MIN', - 'ulong' : '0'} - -def conditional_guard(src, dst): - int64_count = 0 - float64_count = 0 - if src in int64_types: - int64_count = int64_count +1 - elif src in float64_types: - float64_count = float64_count + 1 - if dst in int64_types: - int64_count = int64_count +1 - elif dst in float64_types: - float64_count = float64_count + 1 - if float64_count > 0: - #In embedded profile, if cl_khr_fp64 is supported cles_khr_int64 has to be - print("#ifdef cl_khr_fp64") - return True - elif int64_count > 0: - print("#if defined cles_khr_int64 || !defined(__EMBEDDED_PROFILE__)") - return True - return False - - -print("""/* !!!! AUTOGENERATED FILE generated by convert_type.py !!!!! - - DON'T CHANGE THIS FILE. MAKE YOUR CHANGES TO convert_type.py AND RUN: - $ ./generate-conversion-type-cl.sh - - OpenCL type conversion functions - - Copyright (c) 2013 Victor Oliveira - Copyright (c) 2013 Jesse Towner - - Permission is hereby granted, free of charge, to any person obtaining a copy - of this software and associated documentation files (the "Software"), to deal - in the Software without restriction, including without limitation the rights - to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - copies of the Software, and to permit persons to whom the Software is - furnished to do so, subject to the following conditions: - - The above copyright notice and this permission notice shall be included in - all copies or substantial portions of the Software. - - THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - THE SOFTWARE. -*/ - -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -#if defined(__EMBEDDED_PROFILE__) && !defined(cles_khr_int64) -#error Embedded profile that supports cl_khr_fp64 also has to support cles_khr_int64 -#endif - -#endif - -#ifdef cles_khr_int64 -#pragma OPENCL EXTENSION cles_khr_int64 : enable -#endif - -""") - -# -# Default Conversions -# -# All conversions are in accordance with the OpenCL specification, -# which cites the C99 conversion rules. -# -# Casting from floating point to integer results in conversions -# with truncation, so it should be suitable for the default convert -# functions. -# -# Conversions from integer to floating-point, and floating-point to -# floating-point through casting is done with the default rounding -# mode. While C99 allows dynamically changing the rounding mode -# during runtime, it is not a supported feature in OpenCL according -# to Section 7.1 - Rounding Modes in the OpenCL 1.2 specification. -# -# Therefore, we can assume for optimization purposes that the -# rounding mode is fixed to round-to-nearest-even. Platform target -# authors should ensure that the rounding-control registers remain -# in this state, and that this invariant holds. -# -# Also note, even though the OpenCL specification isn't entirely -# clear on this matter, we implement all rounding mode combinations -# even for integer-to-integer conversions. When such a conversion -# is used, the rounding mode is ignored. -# - -def generate_default_conversion(src, dst, mode): - close_conditional = conditional_guard(src, dst) - - # scalar conversions - print("""_CLC_DEF _CLC_OVERLOAD -{DST} convert_{DST}{M}({SRC} x) -{{ - return ({DST})x; -}} -""".format(SRC=src, DST=dst, M=mode)) - - # vector conversions, done through decomposition to components - for size, half_size in half_sizes: - print("""_CLC_DEF _CLC_OVERLOAD -{DST}{N} convert_{DST}{N}{M}({SRC}{N} x) -{{ - return ({DST}{N})(convert_{DST}{H}(x.lo), convert_{DST}{H}(x.hi)); -}} -""".format(SRC=src, DST=dst, N=size, H=half_size, M=mode)) - - # 3-component vector conversions - print("""_CLC_DEF _CLC_OVERLOAD -{DST}3 convert_{DST}3{M}({SRC}3 x) -{{ - return ({DST}3)(convert_{DST}2(x.s01), convert_{DST}(x.s2)); -}}""".format(SRC=src, DST=dst, M=mode)) - - if close_conditional: - print("#endif") - - -for src in types: - for dst in types: - generate_default_conversion(src, dst, '') - -for src in int_types: - for dst in int_types: - for mode in rounding_modes: - generate_default_conversion(src, dst, mode) - -# -# Saturated Conversions To Integers -# -# These functions are dependent on the unsaturated conversion functions -# generated above, and use clamp, max, min, and select to eliminate -# branching and vectorize the conversions. -# -# Again, as above, we allow all rounding modes for integer-to-integer -# conversions with saturation. -# - -def generate_saturated_conversion(src, dst, size): - # Header - close_conditional = conditional_guard(src, dst) - print("""_CLC_DEF _CLC_OVERLOAD -{DST}{N} convert_{DST}{N}_sat({SRC}{N} x) -{{""".format(DST=dst, SRC=src, N=size)) - - # FIXME: This is a work around for lack of select function with - # signed third argument when the first two arguments are unsigned types. - # We cast to the signed type for sign-extension, then do a bitcast to - # the unsigned type. - if dst in unsigned_types: - bool_prefix = "as_{DST}{N}(convert_{BOOL}{N}".format(DST=dst, BOOL=bool_type[dst], N=size); - bool_suffix = ")" - else: - bool_prefix = "convert_{BOOL}{N}".format(BOOL=bool_type[dst], N=size); - bool_suffix = "" - - # Body - if src == dst: - - # Conversion between same types - print(" return x;") - - elif src in float_types: - - # Conversion from float to int - print(""" {DST}{N} y = convert_{DST}{N}(x); - y = select(y, ({DST}{N}){DST_MIN}, {BP}(x < ({SRC}{N}){DST_MIN}){BS}); - y = select(y, ({DST}{N}){DST_MAX}, {BP}(x > ({SRC}{N}){DST_MAX}){BS}); - return y;""".format(SRC=src, DST=dst, N=size, - DST_MIN=limit_min[dst], DST_MAX=limit_max[dst], - BP=bool_prefix, BS=bool_suffix)) - - else: - - # Integer to integer convesion with sizeof(src) == sizeof(dst) - if sizeof_type[src] == sizeof_type[dst]: - if src in unsigned_types: - print(" x = min(x, ({SRC}){DST_MAX});".format(SRC=src, DST_MAX=limit_max[dst])) - else: - print(" x = max(x, ({SRC})0);".format(SRC=src)) - - # Integer to integer conversion where sizeof(src) > sizeof(dst) - elif sizeof_type[src] > sizeof_type[dst]: - if src in unsigned_types: - print(" x = min(x, ({SRC}){DST_MAX});".format(SRC=src, DST_MAX=limit_max[dst])) - else: - print(" x = clamp(x, ({SRC}){DST_MIN}, ({SRC}){DST_MAX});" - .format(SRC=src, DST_MIN=limit_min[dst], DST_MAX=limit_max[dst])) - - # Integer to integer conversion where sizeof(src) < sizeof(dst) - elif src not in unsigned_types and dst in unsigned_types: - print(" x = max(x, ({SRC})0);".format(SRC=src)) - - print(" return convert_{DST}{N}(x);".format(DST=dst, N=size)) - - # Footer - print("}") - if close_conditional: - print("#endif") - - -for src in types: - for dst in int_types: - for size in vector_sizes: - generate_saturated_conversion(src, dst, size) - - -def generate_saturated_conversion_with_rounding(src, dst, size, mode): - # Header - close_conditional = conditional_guard(src, dst) - - # Body - print("""_CLC_DEF _CLC_OVERLOAD -{DST}{N} convert_{DST}{N}_sat{M}({SRC}{N} x) -{{ - return convert_{DST}{N}_sat(x); -}} -""".format(DST=dst, SRC=src, N=size, M=mode)) - - # Footer - if close_conditional: - print("#endif") - - -for src in int_types: - for dst in int_types: - for size in vector_sizes: - for mode in rounding_modes: - generate_saturated_conversion_with_rounding(src, dst, size, mode) - -# -# Conversions To/From Floating-Point With Rounding -# -# Note that we assume as above that casts from floating-point to -# integer are done with truncation, and that the default rounding -# mode is fixed to round-to-nearest-even, as per C99 and OpenCL -# rounding rules. -# -# These functions rely on the use of abs, ceil, fabs, floor, -# nextafter, sign, rint and the above generated conversion functions. -# -# Only conversions to integers can have saturation. -# - -def generate_float_conversion(src, dst, size, mode, sat): - # Header - close_conditional = conditional_guard(src, dst) - print("""_CLC_DEF _CLC_OVERLOAD -{DST}{N} convert_{DST}{N}{S}{M}({SRC}{N} x) -{{""".format(SRC=src, DST=dst, N=size, M=mode, S=sat)) - - # Perform conversion - if dst in int_types: - if mode == '_rte': - print(" x = rint(x);"); - elif mode == '_rtp': - print(" x = ceil(x);"); - elif mode == '_rtn': - print(" x = floor(x);"); - print(" return convert_{DST}{N}{S}(x);".format(DST=dst, N=size, S=sat)) - elif mode == '_rte': - print(" return convert_{DST}{N}(x);".format(DST=dst, N=size)) - else: - print(" {DST}{N} r = convert_{DST}{N}(x);".format(DST=dst, N=size)) - print(" {SRC}{N} y = convert_{SRC}{N}(y);".format(SRC=src, N=size)) - if mode == '_rtz': - if src in int_types: - print(" {USRC}{N} abs_x = abs(x);".format(USRC=unsigned_type[src], N=size)) - print(" {USRC}{N} abs_y = abs(y);".format(USRC=unsigned_type[src], N=size)) - else: - print(" {SRC}{N} abs_x = fabs(x);".format(SRC=src, N=size)) - print(" {SRC}{N} abs_y = fabs(y);".format(SRC=src, N=size)) - print(" return select(r, nextafter(r, sign(r) * ({DST}{N})-INFINITY), convert_{BOOL}{N}(abs_y > abs_x));" - .format(DST=dst, N=size, BOOL=bool_type[dst])) - if mode == '_rtp': - print(" return select(r, nextafter(r, ({DST}{N})INFINITY), convert_{BOOL}{N}(y < x));" - .format(DST=dst, N=size, BOOL=bool_type[dst])) - if mode == '_rtn': - print(" return select(r, nextafter(r, ({DST}{N})-INFINITY), convert_{BOOL}{N}(y > x));" - .format(DST=dst, N=size, BOOL=bool_type[dst])) - - # Footer - print("}") - if close_conditional: - print("#endif") - - -for src in float_types: - for dst in int_types: - for size in vector_sizes: - for mode in rounding_modes: - for sat in saturation: - generate_float_conversion(src, dst, size, mode, sat) - - -for src in types: - for dst in float_types: - for size in vector_sizes: - for mode in rounding_modes: - generate_float_conversion(src, dst, size, mode, '') diff --git a/libclc/generic/lib/geometric/cross.cl b/libclc/generic/lib/geometric/cross.cl deleted file mode 100644 index 3b4ca6cafae9..000000000000 --- a/libclc/generic/lib/geometric/cross.cl +++ /dev/null @@ -1,25 +0,0 @@ -#include - -_CLC_OVERLOAD _CLC_DEF float3 cross(float3 p0, float3 p1) { - return (float3)(p0.y*p1.z - p0.z*p1.y, p0.z*p1.x - p0.x*p1.z, - p0.x*p1.y - p0.y*p1.x); -} - -_CLC_OVERLOAD _CLC_DEF float4 cross(float4 p0, float4 p1) { - return (float4)(p0.y*p1.z - p0.z*p1.y, p0.z*p1.x - p0.x*p1.z, - p0.x*p1.y - p0.y*p1.x, 0.f); -} - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double3 cross(double3 p0, double3 p1) { - return (double3)(p0.y*p1.z - p0.z*p1.y, p0.z*p1.x - p0.x*p1.z, - p0.x*p1.y - p0.y*p1.x); -} - -_CLC_OVERLOAD _CLC_DEF double4 cross(double4 p0, double4 p1) { - return (double4)(p0.y*p1.z - p0.z*p1.y, p0.z*p1.x - p0.x*p1.z, - p0.x*p1.y - p0.y*p1.x, 0.f); -} -#endif diff --git a/libclc/generic/lib/geometric/distance.cl b/libclc/generic/lib/geometric/distance.cl deleted file mode 100644 index 4a5b8e258790..000000000000 --- a/libclc/generic/lib/geometric/distance.cl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/geometric/distance.inc b/libclc/generic/lib/geometric/distance.inc deleted file mode 100644 index 193665ed2e2e..000000000000 --- a/libclc/generic/lib/geometric/distance.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_FLOAT distance(__CLC_FLOATN p0, __CLC_FLOATN p1) { - return length(p0 - p1); -} diff --git a/libclc/generic/lib/geometric/dot.cl b/libclc/generic/lib/geometric/dot.cl deleted file mode 100644 index 0d6fe6c9a4e8..000000000000 --- a/libclc/generic/lib/geometric/dot.cl +++ /dev/null @@ -1,39 +0,0 @@ -#include - -_CLC_OVERLOAD _CLC_DEF float dot(float p0, float p1) { - return p0*p1; -} - -_CLC_OVERLOAD _CLC_DEF float dot(float2 p0, float2 p1) { - return p0.x*p1.x + p0.y*p1.y; -} - -_CLC_OVERLOAD _CLC_DEF float dot(float3 p0, float3 p1) { - return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z; -} - -_CLC_OVERLOAD _CLC_DEF float dot(float4 p0, float4 p1) { - return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z + p0.w*p1.w; -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double dot(double p0, double p1) { - return p0*p1; -} - -_CLC_OVERLOAD _CLC_DEF double dot(double2 p0, double2 p1) { - return p0.x*p1.x + p0.y*p1.y; -} - -_CLC_OVERLOAD _CLC_DEF double dot(double3 p0, double3 p1) { - return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z; -} - -_CLC_OVERLOAD _CLC_DEF double dot(double4 p0, double4 p1) { - return p0.x*p1.x + p0.y*p1.y + p0.z*p1.z + p0.w*p1.w; -} - -#endif diff --git a/libclc/generic/lib/geometric/fast_distance.cl b/libclc/generic/lib/geometric/fast_distance.cl deleted file mode 100644 index 0a4f82c3296d..000000000000 --- a/libclc/generic/lib/geometric/fast_distance.cl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/lib/geometric/fast_distance.inc b/libclc/generic/lib/geometric/fast_distance.inc deleted file mode 100644 index d8fe3e0f78da..000000000000 --- a/libclc/generic/lib/geometric/fast_distance.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_FLOAT fast_distance(__CLC_FLOATN p0, __CLC_FLOATN p1) { - return fast_length(p0 - p1); -} diff --git a/libclc/generic/lib/geometric/fast_length.cl b/libclc/generic/lib/geometric/fast_length.cl deleted file mode 100644 index 8f6ffc687abe..000000000000 --- a/libclc/generic/lib/geometric/fast_length.cl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -_CLC_OVERLOAD _CLC_DEF float fast_length(float p) { - return fabs(p); -} - -_CLC_OVERLOAD _CLC_DEF float fast_length(float2 p) { - return half_sqrt(dot(p, p)); -} - -_CLC_OVERLOAD _CLC_DEF float fast_length(float3 p) { - return half_sqrt(dot(p, p)); -} - -_CLC_OVERLOAD _CLC_DEF float fast_length(float4 p) { - return half_sqrt(dot(p, p)); -} diff --git a/libclc/generic/lib/geometric/fast_normalize.cl b/libclc/generic/lib/geometric/fast_normalize.cl deleted file mode 100644 index af5f99434f70..000000000000 --- a/libclc/generic/lib/geometric/fast_normalize.cl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -_CLC_OVERLOAD _CLC_DEF float fast_normalize(float p) { - return normalize(p); -} - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/lib/geometric/fast_normalize.inc b/libclc/generic/lib/geometric/fast_normalize.inc deleted file mode 100644 index c1be2b8b9422..000000000000 --- a/libclc/generic/lib/geometric/fast_normalize.inc +++ /dev/null @@ -1,31 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef __CLC_SCALAR - -// Only handle vector implementations -_CLC_OVERLOAD _CLC_DEF __CLC_FLOATN fast_normalize(__CLC_FLOATN p) { - __CLC_FLOAT l2 = dot(p, p); - return l2 == 0.0f ? p : p * half_rsqrt(l2); -} - -#endif diff --git a/libclc/generic/lib/geometric/length.cl b/libclc/generic/lib/geometric/length.cl deleted file mode 100644 index e7f31b43ae1f..000000000000 --- a/libclc/generic/lib/geometric/length.cl +++ /dev/null @@ -1,87 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -_CLC_OVERLOAD _CLC_DEF float length(float p) { - return fabs(p); -} - -#define V_FLENGTH(p) \ - float l2 = dot(p, p); \ - \ - if (l2 < FLT_MIN) { \ - p *= 0x1.0p+86F; \ - return sqrt(dot(p, p)) * 0x1.0p-86F; \ - } else if (l2 == INFINITY) { \ - p *= 0x1.0p-65F; \ - return sqrt(dot(p, p)) * 0x1.0p+65F; \ - } \ - \ - return sqrt(l2); - -_CLC_OVERLOAD _CLC_DEF float length(float2 p) { - V_FLENGTH(p); -} - -_CLC_OVERLOAD _CLC_DEF float length(float3 p) { - V_FLENGTH(p); -} - -_CLC_OVERLOAD _CLC_DEF float length(float4 p) { - V_FLENGTH(p); -} - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double length(double p){ - return fabs(p); -} - -#define V_DLENGTH(p) \ - double l2 = dot(p, p); \ - \ - if (l2 < DBL_MIN) { \ - p *= 0x1.0p+563; \ - return sqrt(dot(p, p)) * 0x1.0p-563; \ - } else if (l2 == INFINITY) { \ - p *= 0x1.0p-513; \ - return sqrt(dot(p, p)) * 0x1.0p+513; \ - } \ - \ - return sqrt(l2); - -_CLC_OVERLOAD _CLC_DEF double length(double2 p) { - V_DLENGTH(p); -} - -_CLC_OVERLOAD _CLC_DEF double length(double3 p) { - V_DLENGTH(p); -} - -_CLC_OVERLOAD _CLC_DEF double -length(double4 p) { - V_DLENGTH(p); -} - -#endif diff --git a/libclc/generic/lib/geometric/normalize.cl b/libclc/generic/lib/geometric/normalize.cl deleted file mode 100644 index f61ac9444b00..000000000000 --- a/libclc/generic/lib/geometric/normalize.cl +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -_CLC_OVERLOAD _CLC_DEF float normalize(float p) { - return sign(p); -} - -_CLC_OVERLOAD _CLC_DEF float2 normalize(float2 p) { - if (all(p == (float2)0.0F)) - return p; - - float l2 = dot(p, p); - - if (l2 < FLT_MIN) { - p *= 0x1.0p+86F; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-65f; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((float2)0.0F, (float2)1.0F, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -_CLC_OVERLOAD _CLC_DEF float3 normalize(float3 p) { - if (all(p == (float3)0.0F)) - return p; - - float l2 = dot(p, p); - - if (l2 < FLT_MIN) { - p *= 0x1.0p+86F; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-66f; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((float3)0.0F, (float3)1.0F, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -_CLC_OVERLOAD _CLC_DEF float4 normalize(float4 p) { - if (all(p == (float4)0.0F)) - return p; - - float l2 = dot(p, p); - - if (l2 < FLT_MIN) { - p *= 0x1.0p+86F; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-66f; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((float4)0.0F, (float4)1.0F, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double normalize(double p) { - return sign(p); -} - -_CLC_OVERLOAD _CLC_DEF double2 normalize(double2 p) { - if (all(p == (double2)0.0)) - return p; - - double l2 = dot(p, p); - - if (l2 < DBL_MIN) { - p *= 0x1.0p+563; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-513; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((double2)0.0, (double2)1.0, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -_CLC_OVERLOAD _CLC_DEF double3 normalize(double3 p) { - if (all(p == (double3)0.0)) - return p; - - double l2 = dot(p, p); - - if (l2 < DBL_MIN) { - p *= 0x1.0p+563; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-514; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((double3)0.0, (double3)1.0, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -_CLC_OVERLOAD _CLC_DEF double4 normalize(double4 p) { - if (all(p == (double4)0.0)) - return p; - - double l2 = dot(p, p); - - if (l2 < DBL_MIN) { - p *= 0x1.0p+563; - l2 = dot(p, p); - } else if (l2 == INFINITY) { - p *= 0x1.0p-514; - l2 = dot(p, p); - if (l2 == INFINITY) { - p = copysign(select((double4)0.0, (double4)1.0, isinf(p)), p); - l2 = dot(p, p); - } - } - return p * rsqrt(l2); -} - -#endif diff --git a/libclc/generic/lib/image/get_image_dim.cl b/libclc/generic/lib/image/get_image_dim.cl deleted file mode 100644 index 26dbd006bb20..000000000000 --- a/libclc/generic/lib/image/get_image_dim.cl +++ /dev/null @@ -1,9 +0,0 @@ -#include - -_CLC_OVERLOAD _CLC_DEF int2 get_image_dim (image2d_t image) { - return (int2)(get_image_width(image), get_image_height(image)); -} -_CLC_OVERLOAD _CLC_DEF int4 get_image_dim (image3d_t image) { - return (int4)(get_image_width(image), get_image_height(image), - get_image_depth(image), 0); -} diff --git a/libclc/generic/lib/integer/abs.cl b/libclc/generic/lib/integer/abs.cl deleted file mode 100644 index faff8d05fefc..000000000000 --- a/libclc/generic/lib/integer/abs.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/abs.inc b/libclc/generic/lib/integer/abs.inc deleted file mode 100644 index cfe7bfecd294..000000000000 --- a/libclc/generic/lib/integer/abs.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs(__CLC_GENTYPE x) { - return __builtin_astype((__CLC_GENTYPE)(x > (__CLC_GENTYPE)(0) ? x : -x), __CLC_U_GENTYPE); -} diff --git a/libclc/generic/lib/integer/abs_diff.cl b/libclc/generic/lib/integer/abs_diff.cl deleted file mode 100644 index 3d751057819e..000000000000 --- a/libclc/generic/lib/integer/abs_diff.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/abs_diff.inc b/libclc/generic/lib/integer/abs_diff.inc deleted file mode 100644 index f39c3ff4d3e8..000000000000 --- a/libclc/generic/lib/integer/abs_diff.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_U_GENTYPE abs_diff(__CLC_GENTYPE x, __CLC_GENTYPE y) { - return __builtin_astype((__CLC_GENTYPE)(x > y ? x-y : y-x), __CLC_U_GENTYPE); -} diff --git a/libclc/generic/lib/integer/add_sat.cl b/libclc/generic/lib/integer/add_sat.cl deleted file mode 100644 index d4df66db3ede..000000000000 --- a/libclc/generic/lib/integer/add_sat.cl +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "../clcmacro.h" - -// From add_sat.ll -_CLC_DECL char __clc_add_sat_s8(char, char); -_CLC_DECL uchar __clc_add_sat_u8(uchar, uchar); -_CLC_DECL short __clc_add_sat_s16(short, short); -_CLC_DECL ushort __clc_add_sat_u16(ushort, ushort); -_CLC_DECL int __clc_add_sat_s32(int, int); -_CLC_DECL uint __clc_add_sat_u32(uint, uint); -_CLC_DECL long __clc_add_sat_s64(long, long); -_CLC_DECL ulong __clc_add_sat_u64(ulong, ulong); - -_CLC_OVERLOAD _CLC_DEF char add_sat(char x, char y) { - return __clc_add_sat_s8(x, y); -} - -_CLC_OVERLOAD _CLC_DEF uchar add_sat(uchar x, uchar y) { - return __clc_add_sat_u8(x, y); -} - -_CLC_OVERLOAD _CLC_DEF short add_sat(short x, short y) { - return __clc_add_sat_s16(x, y); -} - -_CLC_OVERLOAD _CLC_DEF ushort add_sat(ushort x, ushort y) { - return __clc_add_sat_u16(x, y); -} - -_CLC_OVERLOAD _CLC_DEF int add_sat(int x, int y) { - return __clc_add_sat_s32(x, y); -} - -_CLC_OVERLOAD _CLC_DEF uint add_sat(uint x, uint y) { - return __clc_add_sat_u32(x, y); -} - -_CLC_OVERLOAD _CLC_DEF long add_sat(long x, long y) { - return __clc_add_sat_s64(x, y); -} - -_CLC_OVERLOAD _CLC_DEF ulong add_sat(ulong x, ulong y) { - return __clc_add_sat_u64(x, y); -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, char, add_sat, char, char) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uchar, add_sat, uchar, uchar) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, short, add_sat, short, short) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ushort, add_sat, ushort, ushort) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, add_sat, int, int) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uint, add_sat, uint, uint) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, long, add_sat, long, long) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ulong, add_sat, ulong, ulong) diff --git a/libclc/generic/lib/integer/add_sat_if.ll b/libclc/generic/lib/integer/add_sat_if.ll deleted file mode 100644 index bcbe4c0dd348..000000000000 --- a/libclc/generic/lib/integer/add_sat_if.ll +++ /dev/null @@ -1,55 +0,0 @@ -declare i8 @__clc_add_sat_impl_s8(i8 %x, i8 %y) - -define i8 @__clc_add_sat_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_add_sat_impl_s8(i8 %x, i8 %y) - ret i8 %call -} - -declare i8 @__clc_add_sat_impl_u8(i8 %x, i8 %y) - -define i8 @__clc_add_sat_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_add_sat_impl_u8(i8 %x, i8 %y) - ret i8 %call -} - -declare i16 @__clc_add_sat_impl_s16(i16 %x, i16 %y) - -define i16 @__clc_add_sat_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_add_sat_impl_s16(i16 %x, i16 %y) - ret i16 %call -} - -declare i16 @__clc_add_sat_impl_u16(i16 %x, i16 %y) - -define i16 @__clc_add_sat_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_add_sat_impl_u16(i16 %x, i16 %y) - ret i16 %call -} - -declare i32 @__clc_add_sat_impl_s32(i32 %x, i32 %y) - -define i32 @__clc_add_sat_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_add_sat_impl_s32(i32 %x, i32 %y) - ret i32 %call -} - -declare i32 @__clc_add_sat_impl_u32(i32 %x, i32 %y) - -define i32 @__clc_add_sat_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_add_sat_impl_u32(i32 %x, i32 %y) - ret i32 %call -} - -declare i64 @__clc_add_sat_impl_s64(i64 %x, i64 %y) - -define i64 @__clc_add_sat_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_add_sat_impl_s64(i64 %x, i64 %y) - ret i64 %call -} - -declare i64 @__clc_add_sat_impl_u64(i64 %x, i64 %y) - -define i64 @__clc_add_sat_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_add_sat_impl_u64(i64 %x, i64 %y) - ret i64 %call -} diff --git a/libclc/generic/lib/integer/add_sat_impl.ll b/libclc/generic/lib/integer/add_sat_impl.ll deleted file mode 100644 index c150ecb56b8b..000000000000 --- a/libclc/generic/lib/integer/add_sat_impl.ll +++ /dev/null @@ -1,83 +0,0 @@ -declare {i8, i1} @llvm.sadd.with.overflow.i8(i8, i8) -declare {i8, i1} @llvm.uadd.with.overflow.i8(i8, i8) - -define i8 @__clc_add_sat_impl_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call {i8, i1} @llvm.sadd.with.overflow.i8(i8 %x, i8 %y) - %res = extractvalue {i8, i1} %call, 0 - %over = extractvalue {i8, i1} %call, 1 - %x.msb = ashr i8 %x, 7 - %x.limit = xor i8 %x.msb, 127 - %sat = select i1 %over, i8 %x.limit, i8 %res - ret i8 %sat -} - -define i8 @__clc_add_sat_impl_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call {i8, i1} @llvm.uadd.with.overflow.i8(i8 %x, i8 %y) - %res = extractvalue {i8, i1} %call, 0 - %over = extractvalue {i8, i1} %call, 1 - %sat = select i1 %over, i8 -1, i8 %res - ret i8 %sat -} - -declare {i16, i1} @llvm.sadd.with.overflow.i16(i16, i16) -declare {i16, i1} @llvm.uadd.with.overflow.i16(i16, i16) - -define i16 @__clc_add_sat_impl_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call {i16, i1} @llvm.sadd.with.overflow.i16(i16 %x, i16 %y) - %res = extractvalue {i16, i1} %call, 0 - %over = extractvalue {i16, i1} %call, 1 - %x.msb = ashr i16 %x, 15 - %x.limit = xor i16 %x.msb, 32767 - %sat = select i1 %over, i16 %x.limit, i16 %res - ret i16 %sat -} - -define i16 @__clc_add_sat_impl_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call {i16, i1} @llvm.uadd.with.overflow.i16(i16 %x, i16 %y) - %res = extractvalue {i16, i1} %call, 0 - %over = extractvalue {i16, i1} %call, 1 - %sat = select i1 %over, i16 -1, i16 %res - ret i16 %sat -} - -declare {i32, i1} @llvm.sadd.with.overflow.i32(i32, i32) -declare {i32, i1} @llvm.uadd.with.overflow.i32(i32, i32) - -define i32 @__clc_add_sat_impl_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call {i32, i1} @llvm.sadd.with.overflow.i32(i32 %x, i32 %y) - %res = extractvalue {i32, i1} %call, 0 - %over = extractvalue {i32, i1} %call, 1 - %x.msb = ashr i32 %x, 31 - %x.limit = xor i32 %x.msb, 2147483647 - %sat = select i1 %over, i32 %x.limit, i32 %res - ret i32 %sat -} - -define i32 @__clc_add_sat_impl_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call {i32, i1} @llvm.uadd.with.overflow.i32(i32 %x, i32 %y) - %res = extractvalue {i32, i1} %call, 0 - %over = extractvalue {i32, i1} %call, 1 - %sat = select i1 %over, i32 -1, i32 %res - ret i32 %sat -} - -declare {i64, i1} @llvm.sadd.with.overflow.i64(i64, i64) -declare {i64, i1} @llvm.uadd.with.overflow.i64(i64, i64) - -define i64 @__clc_add_sat_impl_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call {i64, i1} @llvm.sadd.with.overflow.i64(i64 %x, i64 %y) - %res = extractvalue {i64, i1} %call, 0 - %over = extractvalue {i64, i1} %call, 1 - %x.msb = ashr i64 %x, 63 - %x.limit = xor i64 %x.msb, 9223372036854775807 - %sat = select i1 %over, i64 %x.limit, i64 %res - ret i64 %sat -} - -define i64 @__clc_add_sat_impl_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call {i64, i1} @llvm.uadd.with.overflow.i64(i64 %x, i64 %y) - %res = extractvalue {i64, i1} %call, 0 - %over = extractvalue {i64, i1} %call, 1 - %sat = select i1 %over, i64 -1, i64 %res - ret i64 %sat -} diff --git a/libclc/generic/lib/integer/clz.cl b/libclc/generic/lib/integer/clz.cl deleted file mode 100644 index 17e3fe014741..000000000000 --- a/libclc/generic/lib/integer/clz.cl +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "../clcmacro.h" - -// From clz.ll -_CLC_DECL char __clc_clz_s8(char); -_CLC_DECL uchar __clc_clz_u8(uchar); -_CLC_DECL short __clc_clz_s16(short); -_CLC_DECL ushort __clc_clz_u16(ushort); -_CLC_DECL int __clc_clz_s32(int); -_CLC_DECL uint __clc_clz_u32(uint); -_CLC_DECL long __clc_clz_s64(long); -_CLC_DECL ulong __clc_clz_u64(ulong); - -_CLC_OVERLOAD _CLC_DEF char clz(char x) { - return __clc_clz_s8(x); -} - -_CLC_OVERLOAD _CLC_DEF uchar clz(uchar x) { - return __clc_clz_u8(x); -} - -_CLC_OVERLOAD _CLC_DEF short clz(short x) { - return __clc_clz_s16(x); -} - -_CLC_OVERLOAD _CLC_DEF ushort clz(ushort x) { - return __clc_clz_u16(x); -} - -_CLC_OVERLOAD _CLC_DEF int clz(int x) { - return __clc_clz_s32(x); -} - -_CLC_OVERLOAD _CLC_DEF uint clz(uint x) { - return __clc_clz_u32(x); -} - -_CLC_OVERLOAD _CLC_DEF long clz(long x) { - return __clc_clz_s64(x); -} - -_CLC_OVERLOAD _CLC_DEF ulong clz(ulong x) { - return __clc_clz_u64(x); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, char, clz, char) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uchar, clz, uchar) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, short, clz, short) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ushort, clz, ushort) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, clz, int) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uint, clz, uint) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, long, clz, long) -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ulong, clz, ulong) diff --git a/libclc/generic/lib/integer/clz_if.ll b/libclc/generic/lib/integer/clz_if.ll deleted file mode 100644 index 23dfc74a8a82..000000000000 --- a/libclc/generic/lib/integer/clz_if.ll +++ /dev/null @@ -1,55 +0,0 @@ -declare i8 @__clc_clz_impl_s8(i8 %x) - -define i8 @__clc_clz_s8(i8 %x) nounwind readnone alwaysinline { - %call = call i8 @__clc_clz_impl_s8(i8 %x) - ret i8 %call -} - -declare i8 @__clc_clz_impl_u8(i8 %x) - -define i8 @__clc_clz_u8(i8 %x) nounwind readnone alwaysinline { - %call = call i8 @__clc_clz_impl_u8(i8 %x) - ret i8 %call -} - -declare i16 @__clc_clz_impl_s16(i16 %x) - -define i16 @__clc_clz_s16(i16 %x) nounwind readnone alwaysinline { - %call = call i16 @__clc_clz_impl_s16(i16 %x) - ret i16 %call -} - -declare i16 @__clc_clz_impl_u16(i16 %x) - -define i16 @__clc_clz_u16(i16 %x) nounwind readnone alwaysinline { - %call = call i16 @__clc_clz_impl_u16(i16 %x) - ret i16 %call -} - -declare i32 @__clc_clz_impl_s32(i32 %x) - -define i32 @__clc_clz_s32(i32 %x) nounwind readnone alwaysinline { - %call = call i32 @__clc_clz_impl_s32(i32 %x) - ret i32 %call -} - -declare i32 @__clc_clz_impl_u32(i32 %x) - -define i32 @__clc_clz_u32(i32 %x) nounwind readnone alwaysinline { - %call = call i32 @__clc_clz_impl_u32(i32 %x) - ret i32 %call -} - -declare i64 @__clc_clz_impl_s64(i64 %x) - -define i64 @__clc_clz_s64(i64 %x) nounwind readnone alwaysinline { - %call = call i64 @__clc_clz_impl_s64(i64 %x) - ret i64 %call -} - -declare i64 @__clc_clz_impl_u64(i64 %x) - -define i64 @__clc_clz_u64(i64 %x) nounwind readnone alwaysinline { - %call = call i64 @__clc_clz_impl_u64(i64 %x) - ret i64 %call -} diff --git a/libclc/generic/lib/integer/clz_impl.ll b/libclc/generic/lib/integer/clz_impl.ll deleted file mode 100644 index b5c3d98ae418..000000000000 --- a/libclc/generic/lib/integer/clz_impl.ll +++ /dev/null @@ -1,44 +0,0 @@ -declare i8 @llvm.ctlz.i8(i8, i1) -declare i16 @llvm.ctlz.i16(i16, i1) -declare i32 @llvm.ctlz.i32(i32, i1) -declare i64 @llvm.ctlz.i64(i64, i1) - -define i8 @__clc_clz_impl_s8(i8 %x) nounwind readnone alwaysinline { - %call = call i8 @llvm.ctlz.i8(i8 %x, i1 0) - ret i8 %call -} - -define i8 @__clc_clz_impl_u8(i8 %x) nounwind readnone alwaysinline { - %call = call i8 @llvm.ctlz.i8(i8 %x, i1 0) - ret i8 %call -} - -define i16 @__clc_clz_impl_s16(i16 %x) nounwind readnone alwaysinline { - %call = call i16 @llvm.ctlz.i16(i16 %x, i1 0) - ret i16 %call -} - -define i16 @__clc_clz_impl_u16(i16 %x) nounwind readnone alwaysinline { - %call = call i16 @llvm.ctlz.i16(i16 %x, i1 0) - ret i16 %call -} - -define i32 @__clc_clz_impl_s32(i32 %x) nounwind readnone alwaysinline { - %call = call i32 @llvm.ctlz.i32(i32 %x, i1 0) - ret i32 %call -} - -define i32 @__clc_clz_impl_u32(i32 %x) nounwind readnone alwaysinline { - %call = call i32 @llvm.ctlz.i32(i32 %x, i1 0) - ret i32 %call -} - -define i64 @__clc_clz_impl_s64(i64 %x) nounwind readnone alwaysinline { - %call = call i64 @llvm.ctlz.i64(i64 %x, i1 0) - ret i64 %call -} - -define i64 @__clc_clz_impl_u64(i64 %x) nounwind readnone alwaysinline { - %call = call i64 @llvm.ctlz.i64(i64 %x, i1 0) - ret i64 %call -} diff --git a/libclc/generic/lib/integer/hadd.cl b/libclc/generic/lib/integer/hadd.cl deleted file mode 100644 index 749026e5a8ad..000000000000 --- a/libclc/generic/lib/integer/hadd.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/hadd.inc b/libclc/generic/lib/integer/hadd.inc deleted file mode 100644 index ea59d9bd7db5..000000000000 --- a/libclc/generic/lib/integer/hadd.inc +++ /dev/null @@ -1,6 +0,0 @@ -//hadd = (x+y)>>1 -//This can be simplified to x>>1 + y>>1 + (1 if both x and y have the 1s bit set) -//This saves us having to do any checks for overflow in the addition sum -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE hadd(__CLC_GENTYPE x, __CLC_GENTYPE y) { - return (x>>(__CLC_GENTYPE)1)+(y>>(__CLC_GENTYPE)1)+(x&y&(__CLC_GENTYPE)1); -} diff --git a/libclc/generic/lib/integer/mad24.cl b/libclc/generic/lib/integer/mad24.cl deleted file mode 100644 index e29e99f28b56..000000000000 --- a/libclc/generic/lib/integer/mad24.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/mad24.inc b/libclc/generic/lib/integer/mad24.inc deleted file mode 100644 index 902b0aafe4c8..000000000000 --- a/libclc/generic/lib/integer/mad24.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mad24(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z){ - return mul24(x, y) + z; -} diff --git a/libclc/generic/lib/integer/mad_sat.cl b/libclc/generic/lib/integer/mad_sat.cl deleted file mode 100644 index 1708b29efffc..000000000000 --- a/libclc/generic/lib/integer/mad_sat.cl +++ /dev/null @@ -1,72 +0,0 @@ -#include -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF char mad_sat(char x, char y, char z) { - return clamp((short)mad24((short)x, (short)y, (short)z), (short)CHAR_MIN, (short) CHAR_MAX); -} - -_CLC_OVERLOAD _CLC_DEF uchar mad_sat(uchar x, uchar y, uchar z) { - return clamp((ushort)mad24((ushort)x, (ushort)y, (ushort)z), (ushort)0, (ushort) UCHAR_MAX); -} - -_CLC_OVERLOAD _CLC_DEF short mad_sat(short x, short y, short z) { - return clamp((int)mad24((int)x, (int)y, (int)z), (int)SHRT_MIN, (int) SHRT_MAX); -} - -_CLC_OVERLOAD _CLC_DEF ushort mad_sat(ushort x, ushort y, ushort z) { - return clamp((uint)mad24((uint)x, (uint)y, (uint)z), (uint)0, (uint) USHRT_MAX); -} - -_CLC_OVERLOAD _CLC_DEF int mad_sat(int x, int y, int z) { - int mhi = mul_hi(x, y); - uint mlo = x * y; - long m = upsample(mhi, mlo); - m += z; - if (m > INT_MAX) - return INT_MAX; - if (m < INT_MIN) - return INT_MIN; - return m; -} - -_CLC_OVERLOAD _CLC_DEF uint mad_sat(uint x, uint y, uint z) { - if (mul_hi(x, y) != 0) - return UINT_MAX; - return add_sat(x * y, z); -} - -_CLC_OVERLOAD _CLC_DEF long mad_sat(long x, long y, long z) { - long hi = mul_hi(x, y); - ulong ulo = x * y; - long slo = x * y; - /* Big overflow of more than 2 bits, add can't fix this */ - if (((x < 0) == (y < 0)) && hi != 0) - return LONG_MAX; - /* Low overflow in mul and z not neg enough to correct it */ - if (hi == 0 && ulo >= LONG_MAX && (z > 0 || (ulo + z) > LONG_MAX)) - return LONG_MAX; - /* Big overflow of more than 2 bits, add can't fix this */ - if (((x < 0) != (y < 0)) && hi != -1) - return LONG_MIN; - /* Low overflow in mul and z not pos enough to correct it */ - if (hi == -1 && ulo <= ((ulong)LONG_MAX + 1UL) && (z < 0 || z < (LONG_MAX - ulo))) - return LONG_MIN; - /* We have checked all conditions, any overflow in addition returns - * the correct value */ - return ulo + z; -} - -_CLC_OVERLOAD _CLC_DEF ulong mad_sat(ulong x, ulong y, ulong z) { - if (mul_hi(x, y) != 0) - return ULONG_MAX; - return add_sat(x * y, z); -} - -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, char, mad_sat, char, char, char) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uchar, mad_sat, uchar, uchar, uchar) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, short, mad_sat, short, short, short) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ushort, mad_sat, ushort, ushort, ushort) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, mad_sat, int, int, int) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uint, mad_sat, uint, uint, uint) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, long, mad_sat, long, long, long) -_CLC_TERNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ulong, mad_sat, ulong, ulong, ulong) diff --git a/libclc/generic/lib/integer/mul24.cl b/libclc/generic/lib/integer/mul24.cl deleted file mode 100644 index 8aedca64b859..000000000000 --- a/libclc/generic/lib/integer/mul24.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/mul24.inc b/libclc/generic/lib/integer/mul24.inc deleted file mode 100644 index 95a2f1d6f31b..000000000000 --- a/libclc/generic/lib/integer/mul24.inc +++ /dev/null @@ -1,11 +0,0 @@ - -// We need to use shifts here in order to mantain the sign bit for signed -// integers. The compiler should optimize this to (x & 0x00FFFFFF) for -// unsigned integers. -#define CONVERT_TO_24BIT(x) (((x) << 8) >> 8) - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mul24(__CLC_GENTYPE x, __CLC_GENTYPE y){ - return CONVERT_TO_24BIT(x) * CONVERT_TO_24BIT(y); -} - -#undef CONVERT_TO_24BIT diff --git a/libclc/generic/lib/integer/mul_hi.cl b/libclc/generic/lib/integer/mul_hi.cl deleted file mode 100644 index 174d893afb14..000000000000 --- a/libclc/generic/lib/integer/mul_hi.cl +++ /dev/null @@ -1,109 +0,0 @@ -#include - -//For all types EXCEPT long, which is implemented separately -#define __CLC_MUL_HI_IMPL(BGENTYPE, GENTYPE, GENSIZE) \ - _CLC_OVERLOAD _CLC_DEF GENTYPE mul_hi(GENTYPE x, GENTYPE y){ \ - return (GENTYPE)(((BGENTYPE)x * (BGENTYPE)y) >> GENSIZE); \ - } \ - -//FOIL-based long mul_hi -// -// Summary: Treat mul_hi(long x, long y) as: -// (a+b) * (c+d) where a and c are the high-order parts of x and y respectively -// and b and d are the low-order parts of x and y. -// Thinking back to algebra, we use FOIL to do the work. - -_CLC_OVERLOAD _CLC_DEF long mul_hi(long x, long y){ - long f, o, i; - ulong l; - - //Move the high/low halves of x/y into the lower 32-bits of variables so - //that we can multiply them without worrying about overflow. - long x_hi = x >> 32; - long x_lo = x & UINT_MAX; - long y_hi = y >> 32; - long y_lo = y & UINT_MAX; - - //Multiply all of the components according to FOIL method - f = x_hi * y_hi; - o = x_hi * y_lo; - i = x_lo * y_hi; - l = x_lo * y_lo; - - //Now add the components back together in the following steps: - //F: doesn't need to be modified - //O/I: Need to be added together. - //L: Shift right by 32-bits, then add into the sum of O and I - //Once O/I/L are summed up, then shift the sum by 32-bits and add to F. - // - //We use hadd to give us a bit of extra precision for the intermediate sums - //but as a result, we shift by 31 bits instead of 32 - return (long)(f + (hadd(o, (i + (long)((ulong)l>>32))) >> 31)); -} - -_CLC_OVERLOAD _CLC_DEF ulong mul_hi(ulong x, ulong y){ - ulong f, o, i; - ulong l; - - //Move the high/low halves of x/y into the lower 32-bits of variables so - //that we can multiply them without worrying about overflow. - ulong x_hi = x >> 32; - ulong x_lo = x & UINT_MAX; - ulong y_hi = y >> 32; - ulong y_lo = y & UINT_MAX; - - //Multiply all of the components according to FOIL method - f = x_hi * y_hi; - o = x_hi * y_lo; - i = x_lo * y_hi; - l = x_lo * y_lo; - - //Now add the components back together, taking care to respect the fact that: - //F: doesn't need to be modified - //O/I: Need to be added together. - //L: Shift right by 32-bits, then add into the sum of O and I - //Once O/I/L are summed up, then shift the sum by 32-bits and add to F. - // - //We use hadd to give us a bit of extra precision for the intermediate sums - //but as a result, we shift by 31 bits instead of 32 - return (f + (hadd(o, (i + (l>>32))) >> 31)); -} - -#define __CLC_MUL_HI_VEC(GENTYPE) \ - _CLC_OVERLOAD _CLC_DEF GENTYPE##2 mul_hi(GENTYPE##2 x, GENTYPE##2 y){ \ - return (GENTYPE##2){mul_hi(x.s0, y.s0), mul_hi(x.s1, y.s1)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF GENTYPE##3 mul_hi(GENTYPE##3 x, GENTYPE##3 y){ \ - return (GENTYPE##3){mul_hi(x.s0, y.s0), mul_hi(x.s1, y.s1), mul_hi(x.s2, y.s2)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF GENTYPE##4 mul_hi(GENTYPE##4 x, GENTYPE##4 y){ \ - return (GENTYPE##4){mul_hi(x.lo, y.lo), mul_hi(x.hi, y.hi)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF GENTYPE##8 mul_hi(GENTYPE##8 x, GENTYPE##8 y){ \ - return (GENTYPE##8){mul_hi(x.lo, y.lo), mul_hi(x.hi, y.hi)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF GENTYPE##16 mul_hi(GENTYPE##16 x, GENTYPE##16 y){ \ - return (GENTYPE##16){mul_hi(x.lo, y.lo), mul_hi(x.hi, y.hi)}; \ - } \ - -#define __CLC_MUL_HI_DEC_IMPL(BTYPE, TYPE, BITS) \ - __CLC_MUL_HI_IMPL(BTYPE, TYPE, BITS) \ - __CLC_MUL_HI_VEC(TYPE) - -#define __CLC_MUL_HI_TYPES() \ - __CLC_MUL_HI_DEC_IMPL(short, char, 8) \ - __CLC_MUL_HI_DEC_IMPL(ushort, uchar, 8) \ - __CLC_MUL_HI_DEC_IMPL(int, short, 16) \ - __CLC_MUL_HI_DEC_IMPL(uint, ushort, 16) \ - __CLC_MUL_HI_DEC_IMPL(long, int, 32) \ - __CLC_MUL_HI_DEC_IMPL(ulong, uint, 32) \ - __CLC_MUL_HI_VEC(long) \ - __CLC_MUL_HI_VEC(ulong) - -__CLC_MUL_HI_TYPES() - -#undef __CLC_MUL_HI_TYPES -#undef __CLC_MUL_HI_DEC_IMPL -#undef __CLC_MUL_HI_IMPL -#undef __CLC_MUL_HI_VEC -#undef __CLC_B32 diff --git a/libclc/generic/lib/integer/rhadd.cl b/libclc/generic/lib/integer/rhadd.cl deleted file mode 100644 index c985870f7c7a..000000000000 --- a/libclc/generic/lib/integer/rhadd.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/rhadd.inc b/libclc/generic/lib/integer/rhadd.inc deleted file mode 100644 index 3d6076874808..000000000000 --- a/libclc/generic/lib/integer/rhadd.inc +++ /dev/null @@ -1,6 +0,0 @@ -//rhadd = (x+y+1)>>1 -//This can be simplified to x>>1 + y>>1 + (1 if either x or y have the 1s bit set) -//This saves us having to do any checks for overflow in the addition sums -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE rhadd(__CLC_GENTYPE x, __CLC_GENTYPE y) { - return (x>>(__CLC_GENTYPE)1)+(y>>(__CLC_GENTYPE)1)+((x&(__CLC_GENTYPE)1)|(y&(__CLC_GENTYPE)1)); -} diff --git a/libclc/generic/lib/integer/rotate.cl b/libclc/generic/lib/integer/rotate.cl deleted file mode 100644 index 27ce515c7293..000000000000 --- a/libclc/generic/lib/integer/rotate.cl +++ /dev/null @@ -1,4 +0,0 @@ -#include - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/integer/rotate.inc b/libclc/generic/lib/integer/rotate.inc deleted file mode 100644 index 33bb0a85241d..000000000000 --- a/libclc/generic/lib/integer/rotate.inc +++ /dev/null @@ -1,42 +0,0 @@ -/** - * Not necessarily optimal... but it produces correct results (at least for int) - * If we're lucky, LLVM will recognize the pattern and produce rotate - * instructions: - * http://llvm.1065342.n5.nabble.com/rotate-td47679.html - * - * Eventually, someone should feel free to implement an llvm-specific version - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE rotate(__CLC_GENTYPE x, __CLC_GENTYPE n){ - //Try to avoid extra work if someone's spinning the value through multiple - //full rotations - n = n % (__CLC_GENTYPE)__CLC_GENSIZE; - -#ifdef __CLC_SCALAR - if (n > 0){ - return (x << n) | (((__CLC_U_GENTYPE)x) >> (__CLC_GENSIZE - n)); - } else if (n == 0){ - return x; - } else { - return ( (((__CLC_U_GENTYPE)x) >> -n) | (x << (__CLC_GENSIZE + n)) ); - } -#else - //XXX: There's a lot of __builtin_astype calls to cast everything to - // unsigned ... This should be improved so that if __CLC_GENTYPE==__CLC_U_GENTYPE, no - // casts are required. - - __CLC_U_GENTYPE x_1 = __builtin_astype(x, __CLC_U_GENTYPE); - - //XXX: Is (__CLC_U_GENTYPE >> S__CLC_GENTYPE) | (__CLC_U_GENTYPE << S__CLC_GENTYPE) legal? - // If so, then combine the amt and shifts into a single set of statements - - __CLC_U_GENTYPE amt; - amt = (n < (__CLC_GENTYPE)0 ? __builtin_astype((__CLC_GENTYPE)0-n, __CLC_U_GENTYPE) : (__CLC_U_GENTYPE)0); - x_1 = (x_1 >> amt) | (x_1 << ((__CLC_U_GENTYPE)__CLC_GENSIZE - amt)); - - amt = (n < (__CLC_GENTYPE)0 ? (__CLC_U_GENTYPE)0 : __builtin_astype(n, __CLC_U_GENTYPE)); - x_1 = (x_1 << amt) | (x_1 >> ((__CLC_U_GENTYPE)__CLC_GENSIZE - amt)); - - return __builtin_astype(x_1, __CLC_GENTYPE); -#endif -} diff --git a/libclc/generic/lib/integer/sub_sat.cl b/libclc/generic/lib/integer/sub_sat.cl deleted file mode 100644 index 6b42cc86a74c..000000000000 --- a/libclc/generic/lib/integer/sub_sat.cl +++ /dev/null @@ -1,53 +0,0 @@ -#include -#include "../clcmacro.h" - -// From sub_sat.ll -_CLC_DECL char __clc_sub_sat_s8(char, char); -_CLC_DECL uchar __clc_sub_sat_u8(uchar, uchar); -_CLC_DECL short __clc_sub_sat_s16(short, short); -_CLC_DECL ushort __clc_sub_sat_u16(ushort, ushort); -_CLC_DECL int __clc_sub_sat_s32(int, int); -_CLC_DECL uint __clc_sub_sat_u32(uint, uint); -_CLC_DECL long __clc_sub_sat_s64(long, long); -_CLC_DECL ulong __clc_sub_sat_u64(ulong, ulong); - -_CLC_OVERLOAD _CLC_DEF char sub_sat(char x, char y) { - return __clc_sub_sat_s8(x, y); -} - -_CLC_OVERLOAD _CLC_DEF uchar sub_sat(uchar x, uchar y) { - return __clc_sub_sat_u8(x, y); -} - -_CLC_OVERLOAD _CLC_DEF short sub_sat(short x, short y) { - return __clc_sub_sat_s16(x, y); -} - -_CLC_OVERLOAD _CLC_DEF ushort sub_sat(ushort x, ushort y) { - return __clc_sub_sat_u16(x, y); -} - -_CLC_OVERLOAD _CLC_DEF int sub_sat(int x, int y) { - return __clc_sub_sat_s32(x, y); -} - -_CLC_OVERLOAD _CLC_DEF uint sub_sat(uint x, uint y) { - return __clc_sub_sat_u32(x, y); -} - -_CLC_OVERLOAD _CLC_DEF long sub_sat(long x, long y) { - return __clc_sub_sat_s64(x, y); -} - -_CLC_OVERLOAD _CLC_DEF ulong sub_sat(ulong x, ulong y) { - return __clc_sub_sat_u64(x, y); -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, char, sub_sat, char, char) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uchar, sub_sat, uchar, uchar) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, short, sub_sat, short, short) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ushort, sub_sat, ushort, ushort) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, sub_sat, int, int) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, uint, sub_sat, uint, uint) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, long, sub_sat, long, long) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, ulong, sub_sat, ulong, ulong) diff --git a/libclc/generic/lib/integer/sub_sat_if.ll b/libclc/generic/lib/integer/sub_sat_if.ll deleted file mode 100644 index 7252574b5b8e..000000000000 --- a/libclc/generic/lib/integer/sub_sat_if.ll +++ /dev/null @@ -1,55 +0,0 @@ -declare i8 @__clc_sub_sat_impl_s8(i8 %x, i8 %y) - -define i8 @__clc_sub_sat_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_sub_sat_impl_s8(i8 %x, i8 %y) - ret i8 %call -} - -declare i8 @__clc_sub_sat_impl_u8(i8 %x, i8 %y) - -define i8 @__clc_sub_sat_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_sub_sat_impl_u8(i8 %x, i8 %y) - ret i8 %call -} - -declare i16 @__clc_sub_sat_impl_s16(i16 %x, i16 %y) - -define i16 @__clc_sub_sat_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_sub_sat_impl_s16(i16 %x, i16 %y) - ret i16 %call -} - -declare i16 @__clc_sub_sat_impl_u16(i16 %x, i16 %y) - -define i16 @__clc_sub_sat_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_sub_sat_impl_u16(i16 %x, i16 %y) - ret i16 %call -} - -declare i32 @__clc_sub_sat_impl_s32(i32 %x, i32 %y) - -define i32 @__clc_sub_sat_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_sub_sat_impl_s32(i32 %x, i32 %y) - ret i32 %call -} - -declare i32 @__clc_sub_sat_impl_u32(i32 %x, i32 %y) - -define i32 @__clc_sub_sat_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_sub_sat_impl_u32(i32 %x, i32 %y) - ret i32 %call -} - -declare i64 @__clc_sub_sat_impl_s64(i64 %x, i64 %y) - -define i64 @__clc_sub_sat_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_sub_sat_impl_s64(i64 %x, i64 %y) - ret i64 %call -} - -declare i64 @__clc_sub_sat_impl_u64(i64 %x, i64 %y) - -define i64 @__clc_sub_sat_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_sub_sat_impl_u64(i64 %x, i64 %y) - ret i64 %call -} diff --git a/libclc/generic/lib/integer/sub_sat_impl.ll b/libclc/generic/lib/integer/sub_sat_impl.ll deleted file mode 100644 index e82b632f43b4..000000000000 --- a/libclc/generic/lib/integer/sub_sat_impl.ll +++ /dev/null @@ -1,83 +0,0 @@ -declare {i8, i1} @llvm.ssub.with.overflow.i8(i8, i8) -declare {i8, i1} @llvm.usub.with.overflow.i8(i8, i8) - -define i8 @__clc_sub_sat_impl_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call {i8, i1} @llvm.ssub.with.overflow.i8(i8 %x, i8 %y) - %res = extractvalue {i8, i1} %call, 0 - %over = extractvalue {i8, i1} %call, 1 - %x.msb = ashr i8 %x, 7 - %x.limit = xor i8 %x.msb, 127 - %sat = select i1 %over, i8 %x.limit, i8 %res - ret i8 %sat -} - -define i8 @__clc_sub_sat_impl_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call {i8, i1} @llvm.usub.with.overflow.i8(i8 %x, i8 %y) - %res = extractvalue {i8, i1} %call, 0 - %over = extractvalue {i8, i1} %call, 1 - %sat = select i1 %over, i8 0, i8 %res - ret i8 %sat -} - -declare {i16, i1} @llvm.ssub.with.overflow.i16(i16, i16) -declare {i16, i1} @llvm.usub.with.overflow.i16(i16, i16) - -define i16 @__clc_sub_sat_impl_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call {i16, i1} @llvm.ssub.with.overflow.i16(i16 %x, i16 %y) - %res = extractvalue {i16, i1} %call, 0 - %over = extractvalue {i16, i1} %call, 1 - %x.msb = ashr i16 %x, 15 - %x.limit = xor i16 %x.msb, 32767 - %sat = select i1 %over, i16 %x.limit, i16 %res - ret i16 %sat -} - -define i16 @__clc_sub_sat_impl_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call {i16, i1} @llvm.usub.with.overflow.i16(i16 %x, i16 %y) - %res = extractvalue {i16, i1} %call, 0 - %over = extractvalue {i16, i1} %call, 1 - %sat = select i1 %over, i16 0, i16 %res - ret i16 %sat -} - -declare {i32, i1} @llvm.ssub.with.overflow.i32(i32, i32) -declare {i32, i1} @llvm.usub.with.overflow.i32(i32, i32) - -define i32 @__clc_sub_sat_impl_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call {i32, i1} @llvm.ssub.with.overflow.i32(i32 %x, i32 %y) - %res = extractvalue {i32, i1} %call, 0 - %over = extractvalue {i32, i1} %call, 1 - %x.msb = ashr i32 %x, 31 - %x.limit = xor i32 %x.msb, 2147483647 - %sat = select i1 %over, i32 %x.limit, i32 %res - ret i32 %sat -} - -define i32 @__clc_sub_sat_impl_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call {i32, i1} @llvm.usub.with.overflow.i32(i32 %x, i32 %y) - %res = extractvalue {i32, i1} %call, 0 - %over = extractvalue {i32, i1} %call, 1 - %sat = select i1 %over, i32 0, i32 %res - ret i32 %sat -} - -declare {i64, i1} @llvm.ssub.with.overflow.i64(i64, i64) -declare {i64, i1} @llvm.usub.with.overflow.i64(i64, i64) - -define i64 @__clc_sub_sat_impl_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call {i64, i1} @llvm.ssub.with.overflow.i64(i64 %x, i64 %y) - %res = extractvalue {i64, i1} %call, 0 - %over = extractvalue {i64, i1} %call, 1 - %x.msb = ashr i64 %x, 63 - %x.limit = xor i64 %x.msb, 9223372036854775807 - %sat = select i1 %over, i64 %x.limit, i64 %res - ret i64 %sat -} - -define i64 @__clc_sub_sat_impl_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call {i64, i1} @llvm.usub.with.overflow.i64(i64 %x, i64 %y) - %res = extractvalue {i64, i1} %call, 0 - %over = extractvalue {i64, i1} %call, 1 - %sat = select i1 %over, i64 0, i64 %res - ret i64 %sat -} diff --git a/libclc/generic/lib/integer/upsample.cl b/libclc/generic/lib/integer/upsample.cl deleted file mode 100644 index da77315f8f93..000000000000 --- a/libclc/generic/lib/integer/upsample.cl +++ /dev/null @@ -1,34 +0,0 @@ -#include - -#define __CLC_UPSAMPLE_IMPL(BGENTYPE, GENTYPE, UGENTYPE, GENSIZE) \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE upsample(GENTYPE hi, UGENTYPE lo){ \ - return ((BGENTYPE)hi << GENSIZE) | lo; \ - } \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE##2 upsample(GENTYPE##2 hi, UGENTYPE##2 lo){ \ - return (BGENTYPE##2){upsample(hi.s0, lo.s0), upsample(hi.s1, lo.s1)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE##3 upsample(GENTYPE##3 hi, UGENTYPE##3 lo){ \ - return (BGENTYPE##3){upsample(hi.s0, lo.s0), upsample(hi.s1, lo.s1), upsample(hi.s2, lo.s2)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE##4 upsample(GENTYPE##4 hi, UGENTYPE##4 lo){ \ - return (BGENTYPE##4){upsample(hi.lo, lo.lo), upsample(hi.hi, lo.hi)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE##8 upsample(GENTYPE##8 hi, UGENTYPE##8 lo){ \ - return (BGENTYPE##8){upsample(hi.lo, lo.lo), upsample(hi.hi, lo.hi)}; \ - } \ - _CLC_OVERLOAD _CLC_DEF BGENTYPE##16 upsample(GENTYPE##16 hi, UGENTYPE##16 lo){ \ - return (BGENTYPE##16){upsample(hi.lo, lo.lo), upsample(hi.hi, lo.hi)}; \ - } \ - -#define __CLC_UPSAMPLE_TYPES() \ - __CLC_UPSAMPLE_IMPL(short, char, uchar, 8) \ - __CLC_UPSAMPLE_IMPL(ushort, uchar, uchar, 8) \ - __CLC_UPSAMPLE_IMPL(int, short, ushort, 16) \ - __CLC_UPSAMPLE_IMPL(uint, ushort, ushort, 16) \ - __CLC_UPSAMPLE_IMPL(long, int, uint, 32) \ - __CLC_UPSAMPLE_IMPL(ulong, uint, uint, 32) \ - -__CLC_UPSAMPLE_TYPES() - -#undef __CLC_UPSAMPLE_TYPES -#undef __CLC_UPSAMPLE_IMPL diff --git a/libclc/generic/lib/math/acos.cl b/libclc/generic/lib/math/acos.cl deleted file mode 100644 index 3ce96554fef3..000000000000 --- a/libclc/generic/lib/math/acos.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/acos.inc b/libclc/generic/lib/math/acos.inc deleted file mode 100644 index cac9499260f0..000000000000 --- a/libclc/generic/lib/math/acos.inc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * There are multiple formulas for calculating arccosine of x: - * 1) acos(x) = (1/2*pi) + i * ln(i*x + sqrt(1-x^2)) (notice the 'i'...) - * 2) acos(x) = pi/2 + asin(-x) (asin isn't implemented yet) - * 3) acos(x) = pi/2 - asin(x) (ditto) - * 4) acos(x) = 2*atan2(sqrt(1-x), sqrt(1+x)) - * 5) acos(x) = pi/2 - atan2(x, ( sqrt(1-x^2) ) ) - * - * Options 1-3 are not currently usable, #5 generates more concise radeonsi - * bitcode and assembly than #4 (134 vs 132 instructions on radeonsi), but - * precision of #4 may be better. - */ - -#if __CLC_FPSIZE == 32 -#define __CLC_CONST(x) x ## f -#else -#define __CLC_CONST(x) x -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE acos(__CLC_GENTYPE x) { - return ( - (__CLC_GENTYPE) __CLC_CONST(2.0) * atan2( - sqrt((__CLC_GENTYPE) __CLC_CONST(1.0) - x), - sqrt((__CLC_GENTYPE) __CLC_CONST(1.0) + x) - ) - ); -} - -#undef __CLC_CONST diff --git a/libclc/generic/lib/math/acosh.cl b/libclc/generic/lib/math/acosh.cl deleted file mode 100644 index cc10dd48fadb..000000000000 --- a/libclc/generic/lib/math/acosh.cl +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "ep_log.h" -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float acosh(float x) { - uint ux = as_uint(x); - - // Arguments greater than 1/sqrt(epsilon) in magnitude are - // approximated by acosh(x) = ln(2) + ln(x) - // For 2.0 <= x <= 1/sqrt(epsilon) the approximation is - // acosh(x) = ln(x + sqrt(x*x-1)) */ - int high = ux > 0x46000000U; - int med = ux > 0x40000000U; - - float w = x - 1.0f; - float s = w*w + 2.0f*w; - float t = x*x - 1.0f; - float r = sqrt(med ? t : s) + (med ? x : w); - float v = (high ? x : r) - (med ? 1.0f : 0.0f); - float z = log1p(v) + (high ? 0x1.62e430p-1f : 0.0f); - - z = ux >= PINFBITPATT_SP32 ? x : z; - z = x < 1.0f ? as_float(QNANBITPATT_SP32) : z; - - return z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, acosh, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double acosh(double x) { - const double recrteps = 0x1.6a09e667f3bcdp+26; // 1/sqrt(eps) = 9.49062656242515593767e+07 - //log2_lead and log2_tail sum to an extra-precise version of log(2) - const double log2_lead = 0x1.62e42ep-1; - const double log2_tail = 0x1.efa39ef35793cp-25; - - // Handle x >= 128 here - int xlarge = x > recrteps; - double r = x + sqrt(fma(x, x, -1.0)); - r = xlarge ? x : r; - - int xexp; - double r1, r2; - __clc_ep_log(r, &xexp, &r1, &r2); - - double dxexp = xexp + xlarge; - r1 = fma(dxexp, log2_lead, r1); - r2 = fma(dxexp, log2_tail, r2); - - double ret1 = r1 + r2; - - // Handle 1 < x < 128 here - // We compute the value - // t = x - 1.0 + sqrt(2.0*(x - 1.0) + (x - 1.0)*(x - 1.0)) - // using simulated quad precision. - double t = x - 1.0; - double u1 = t * 2.0; - - // (t,0) * (t,0) -> (v1, v2) - double v1 = t * t; - double v2 = fma(t, t, -v1); - - // (u1,0) + (v1,v2) -> (w1,w2) - r = u1 + v1; - double s = (((u1 - r) + v1) + v2); - double w1 = r + s; - double w2 = (r - w1) + s; - - // sqrt(w1,w2) -> (u1,u2) - double p1 = sqrt(w1); - double a1 = p1*p1; - double a2 = fma(p1, p1, -a1); - double temp = (((w1 - a1) - a2) + w2); - double p2 = MATH_DIVIDE(temp * 0.5, p1); - u1 = p1 + p2; - double u2 = (p1 - u1) + p2; - - // (u1,u2) + (t,0) -> (r1,r2) - r = u1 + t; - s = ((u1 - r) + t) + u2; - // r1 = r + s; - // r2 = (r - r1) + s; - // t = r1 + r2; - t = r + s; - - // For arguments 1.13 <= x <= 1.5 the log1p function is good enough - double ret2 = log1p(t); - - ulong ux = as_ulong(x); - double ret = x >= 128.0 ? ret1 : ret2; - - ret = ux >= 0x7FF0000000000000 ? x : ret; - ret = x == 1.0 ? 0.0 : ret; - ret = (ux & SIGNBIT_DP64) != 0UL | x < 1.0 ? as_double(QNANBITPATT_DP64) : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, acosh, double) - -#endif diff --git a/libclc/generic/lib/math/acospi.cl b/libclc/generic/lib/math/acospi.cl deleted file mode 100644 index c91fc4178964..000000000000 --- a/libclc/generic/lib/math/acospi.cl +++ /dev/null @@ -1,172 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float acospi(float x) { - // Computes arccos(x). - // The argument is first reduced by noting that arccos(x) - // is invalid for abs(x) > 1. For denormal and small - // arguments arccos(x) = pi/2 to machine accuracy. - // Remaining argument ranges are handled as follows. - // For abs(x) <= 0.5 use - // arccos(x) = pi/2 - arcsin(x) - // = pi/2 - (x + x^3*R(x^2)) - // where R(x^2) is a rational minimax approximation to - // (arcsin(x) - x)/x^3. - // For abs(x) > 0.5 exploit the identity: - // arccos(x) = pi - 2*arcsin(sqrt(1-x)/2) - // together with the above rational approximation, and - // reconstruct the terms carefully. - - - // Some constants and split constants. - const float pi = 3.1415926535897933e+00f; - const float piby2_head = 1.5707963267948965580e+00f; /* 0x3ff921fb54442d18 */ - const float piby2_tail = 6.12323399573676603587e-17f; /* 0x3c91a62633145c07 */ - - uint ux = as_uint(x); - uint aux = ux & ~SIGNBIT_SP32; - int xneg = ux != aux; - int xexp = (int)(aux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32; - - float y = as_float(aux); - - // transform if |x| >= 0.5 - int transform = xexp >= -1; - - float y2 = y * y; - float yt = 0.5f * (1.0f - y); - float r = transform ? yt : y2; - - // Use a rational approximation for [0.0, 0.5] - float a = mad(r, mad(r, mad(r, -0.00396137437848476485201154797087F, -0.0133819288943925804214011424456F), - -0.0565298683201845211985026327361F), - 0.184161606965100694821398249421F); - float b = mad(r, -0.836411276854206731913362287293F, 1.10496961524520294485512696706F); - float u = r * MATH_DIVIDE(a, b); - - float s = MATH_SQRT(r); - y = s; - float s1 = as_float(as_uint(s) & 0xffff0000); - float c = MATH_DIVIDE(r - s1 * s1, s + s1); - // float rettn = 1.0f - MATH_DIVIDE(2.0f * (s + (y * u - piby2_tail)), pi); - float rettn = 1.0f - MATH_DIVIDE(2.0f * (s + mad(y, u, -piby2_tail)), pi); - // float rettp = MATH_DIVIDE(2.0F * s1 + (2.0F * c + 2.0F * y * u), pi); - float rettp = MATH_DIVIDE(2.0f*(s1 + mad(y, u, c)), pi); - float rett = xneg ? rettn : rettp; - // float ret = MATH_DIVIDE(piby2_head - (x - (piby2_tail - x * u)), pi); - float ret = MATH_DIVIDE(piby2_head - (x - mad(x, -u, piby2_tail)), pi); - - ret = transform ? rett : ret; - ret = aux > 0x3f800000U ? as_float(QNANBITPATT_SP32) : ret; - ret = ux == 0x3f800000U ? 0.0f : ret; - ret = ux == 0xbf800000U ? 1.0f : ret; - ret = xexp < -26 ? 0.5f : ret; - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, acospi, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double acospi(double x) { - // Computes arccos(x). - // The argument is first reduced by noting that arccos(x) - // is invalid for abs(x) > 1. For denormal and small - // arguments arccos(x) = pi/2 to machine accuracy. - // Remaining argument ranges are handled as follows. - // For abs(x) <= 0.5 use - // arccos(x) = pi/2 - arcsin(x) - // = pi/2 - (x + x^3*R(x^2)) - // where R(x^2) is a rational minimax approximation to - // (arcsin(x) - x)/x^3. - // For abs(x) > 0.5 exploit the identity: - // arccos(x) = pi - 2*arcsin(sqrt(1-x)/2) - // together with the above rational approximation, and - // reconstruct the terms carefully. - - const double pi = 0x1.921fb54442d18p+1; - const double piby2_tail = 6.12323399573676603587e-17; /* 0x3c91a62633145c07 */ - - double y = fabs(x); - int xneg = as_int2(x).hi < 0; - int xexp = (as_int2(y).hi >> 20) - EXPBIAS_DP64; - - // abs(x) >= 0.5 - int transform = xexp >= -1; - - // Transform y into the range [0,0.5) - double r1 = 0.5 * (1.0 - y); - double s = sqrt(r1); - double r = y * y; - r = transform ? r1 : r; - y = transform ? s : y; - - // Use a rational approximation for [0.0, 0.5] - double un = fma(r, - fma(r, - fma(r, - fma(r, - fma(r, 0.0000482901920344786991880522822991, - 0.00109242697235074662306043804220), - -0.0549989809235685841612020091328), - 0.275558175256937652532686256258), - -0.445017216867635649900123110649), - 0.227485835556935010735943483075); - - double ud = fma(r, - fma(r, - fma(r, - fma(r, 0.105869422087204370341222318533, - -0.943639137032492685763471240072), - 2.76568859157270989520376345954), - -3.28431505720958658909889444194), - 1.36491501334161032038194214209); - - double u = r * MATH_DIVIDE(un, ud); - - // Reconstruct acos carefully in transformed region - double res1 = fma(-2.0, MATH_DIVIDE(s + fma(y, u, -piby2_tail), pi), 1.0); - double s1 = as_double(as_ulong(s) & 0xffffffff00000000UL); - double c = MATH_DIVIDE(fma(-s1, s1, r), s + s1); - double res2 = MATH_DIVIDE(fma(2.0, s1, fma(2.0, c, 2.0 * y * u)), pi); - res1 = xneg ? res1 : res2; - res2 = 0.5 - fma(x, u, x) / pi; - res1 = transform ? res1 : res2; - - const double qnan = as_double(QNANBITPATT_DP64); - res2 = x == 1.0 ? 0.0 : qnan; - res2 = x == -1.0 ? 1.0 : res2; - res1 = xexp >= 0 ? res2 : res1; - res1 = xexp < -56 ? 0.5 : res1; - - return res1; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, acospi, double) - -#endif diff --git a/libclc/generic/lib/math/asin.cl b/libclc/generic/lib/math/asin.cl deleted file mode 100644 index d56dbd780a7b..000000000000 --- a/libclc/generic/lib/math/asin.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/asin.inc b/libclc/generic/lib/math/asin.inc deleted file mode 100644 index 4643cf816ded..000000000000 --- a/libclc/generic/lib/math/asin.inc +++ /dev/null @@ -1,12 +0,0 @@ - -#if __CLC_FPSIZE == 32 -#define __CLC_CONST(x) x ## f -#else -#define __CLC_CONST(x) x -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE asin(__CLC_GENTYPE x) { - return atan2(x, sqrt( (__CLC_GENTYPE)__CLC_CONST(1.0) -(x*x) )); -} - -#undef __CLC_CONST diff --git a/libclc/generic/lib/math/asinh.cl b/libclc/generic/lib/math/asinh.cl deleted file mode 100644 index cfddb31c68c3..000000000000 --- a/libclc/generic/lib/math/asinh.cl +++ /dev/null @@ -1,293 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "ep_log.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float asinh(float x) { - uint ux = as_uint(x); - uint ax = ux & EXSIGNBIT_SP32; - uint xsgn = ax ^ ux; - - // |x| <= 2 - float t = x * x; - float a = mad(t, - mad(t, - mad(t, - mad(t, -1.177198915954942694e-4f, -4.162727710583425360e-2f), - -5.063201055468483248e-1f), - -1.480204186473758321f), - -1.152965835871758072f); - float b = mad(t, - mad(t, - mad(t, - mad(t, 6.284381367285534560e-2f, 1.260024978680227945f), - 6.582362487198468066f), - 11.99423176003939087f), - 6.917795026025976739f); - - float q = MATH_DIVIDE(a, b); - float z1 = mad(x*t, q, x); - - // |x| > 2 - - // Arguments greater than 1/sqrt(epsilon) in magnitude are - // approximated by asinh(x) = ln(2) + ln(abs(x)), with sign of x - // Arguments such that 4.0 <= abs(x) <= 1/sqrt(epsilon) are - // approximated by asinhf(x) = ln(abs(x) + sqrt(x*x+1)) - // with the sign of x (see Abramowitz and Stegun 4.6.20) - - float absx = as_float(ax); - int hi = ax > 0x46000000U; - float y = MATH_SQRT(absx * absx + 1.0f) + absx; - y = hi ? absx : y; - float r = log(y) + (hi ? 0x1.62e430p-1f : 0.0f); - float z2 = as_float(xsgn | as_uint(r)); - - float z = ax <= 0x40000000 ? z1 : z2; - z = ax < 0x39800000U | ax >= PINFBITPATT_SP32 ? x : z; - - return z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, asinh, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -#define NA0 -0.12845379283524906084997e0 -#define NA1 -0.21060688498409799700819e0 -#define NA2 -0.10188951822578188309186e0 -#define NA3 -0.13891765817243625541799e-1 -#define NA4 -0.10324604871728082428024e-3 - -#define DA0 0.77072275701149440164511e0 -#define DA1 0.16104665505597338100747e1 -#define DA2 0.11296034614816689554875e1 -#define DA3 0.30079351943799465092429e0 -#define DA4 0.235224464765951442265117e-1 - -#define NB0 -0.12186605129448852495563e0 -#define NB1 -0.19777978436593069928318e0 -#define NB2 -0.94379072395062374824320e-1 -#define NB3 -0.12620141363821680162036e-1 -#define NB4 -0.903396794842691998748349e-4 - -#define DB0 0.73119630776696495279434e0 -#define DB1 0.15157170446881616648338e1 -#define DB2 0.10524909506981282725413e1 -#define DB3 0.27663713103600182193817e0 -#define DB4 0.21263492900663656707646e-1 - -#define NC0 -0.81210026327726247622500e-1 -#define NC1 -0.12327355080668808750232e0 -#define NC2 -0.53704925162784720405664e-1 -#define NC3 -0.63106739048128554465450e-2 -#define NC4 -0.35326896180771371053534e-4 - -#define DC0 0.48726015805581794231182e0 -#define DC1 0.95890837357081041150936e0 -#define DC2 0.62322223426940387752480e0 -#define DC3 0.15028684818508081155141e0 -#define DC4 0.10302171620320141529445e-1 - -#define ND0 -0.4638179204422665073e-1 -#define ND1 -0.7162729496035415183e-1 -#define ND2 -0.3247795155696775148e-1 -#define ND3 -0.4225785421291932164e-2 -#define ND4 -0.3808984717603160127e-4 -#define ND5 0.8023464184964125826e-6 - -#define DD0 0.2782907534642231184e0 -#define DD1 0.5549945896829343308e0 -#define DD2 0.3700732511330698879e0 -#define DD3 0.9395783438240780722e-1 -#define DD4 0.7200057974217143034e-2 - -#define NE0 -0.121224194072430701e-4 -#define NE1 -0.273145455834305218e-3 -#define NE2 -0.152866982560895737e-2 -#define NE3 -0.292231744584913045e-2 -#define NE4 -0.174670900236060220e-2 -#define NE5 -0.891754209521081538e-12 - -#define DE0 0.499426632161317606e-4 -#define DE1 0.139591210395547054e-2 -#define DE2 0.107665231109108629e-1 -#define DE3 0.325809818749873406e-1 -#define DE4 0.415222526655158363e-1 -#define DE5 0.186315628774716763e-1 - -#define NF0 -0.195436610112717345e-4 -#define NF1 -0.233315515113382977e-3 -#define NF2 -0.645380957611087587e-3 -#define NF3 -0.478948863920281252e-3 -#define NF4 -0.805234112224091742e-12 -#define NF5 0.246428598194879283e-13 - -#define DF0 0.822166621698664729e-4 -#define DF1 0.135346265620413852e-2 -#define DF2 0.602739242861830658e-2 -#define DF3 0.972227795510722956e-2 -#define DF4 0.510878800983771167e-2 - -#define NG0 -0.209689451648100728e-6 -#define NG1 -0.219252358028695992e-5 -#define NG2 -0.551641756327550939e-5 -#define NG3 -0.382300259826830258e-5 -#define NG4 -0.421182121910667329e-17 -#define NG5 0.492236019998237684e-19 - -#define DG0 0.889178444424237735e-6 -#define DG1 0.131152171690011152e-4 -#define DG2 0.537955850185616847e-4 -#define DG3 0.814966175170941864e-4 -#define DG4 0.407786943832260752e-4 - -#define NH0 -0.178284193496441400e-6 -#define NH1 -0.928734186616614974e-6 -#define NH2 -0.923318925566302615e-6 -#define NH3 -0.776417026702577552e-19 -#define NH4 0.290845644810826014e-21 - -#define DH0 0.786694697277890964e-6 -#define DH1 0.685435665630965488e-5 -#define DH2 0.153780175436788329e-4 -#define DH3 0.984873520613417917e-5 - -#define NI0 -0.538003743384069117e-10 -#define NI1 -0.273698654196756169e-9 -#define NI2 -0.268129826956403568e-9 -#define NI3 -0.804163374628432850e-29 - -#define DI0 0.238083376363471960e-9 -#define DI1 0.203579344621125934e-8 -#define DI2 0.450836980450693209e-8 -#define DI3 0.286005148753497156e-8 - -_CLC_OVERLOAD _CLC_DEF double asinh(double x) { - const double rteps = 0x1.6a09e667f3bcdp-27; - const double recrteps = 0x1.6a09e667f3bcdp+26; - - // log2_lead and log2_tail sum to an extra-precise version of log(2) - const double log2_lead = 0x1.62e42ep-1; - const double log2_tail = 0x1.efa39ef35793cp-25; - - ulong ux = as_ulong(x); - ulong ax = ux & ~SIGNBIT_DP64; - double absx = as_double(ax); - - double t = x * x; - double pn, tn, pd, td; - - // XXX we are betting here that we can evaluate 8 pairs of - // polys faster than we can grab 12 coefficients from a table - // This also uses fewer registers - - // |x| >= 8 - pn = fma(t, fma(t, fma(t, NI3, NI2), NI1), NI0); - pd = fma(t, fma(t, fma(t, DI3, DI2), DI1), DI0); - - tn = fma(t, fma(t, fma(t, fma(t, NH4, NH3), NH2), NH1), NH0); - td = fma(t, fma(t, fma(t, DH3, DH2), DH1), DH0); - pn = absx < 8.0 ? tn : pn; - pd = absx < 8.0 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, fma(t, NG5, NG4), NG3), NG2), NG1), NG0); - td = fma(t, fma(t, fma(t, fma(t, DG4, DG3), DG2), DG1), DG0); - pn = absx < 4.0 ? tn : pn; - pd = absx < 4.0 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, fma(t, NF5, NF4), NF3), NF2), NF1), NF0); - td = fma(t, fma(t, fma(t, fma(t, DF4, DF3), DF2), DF1), DF0); - pn = absx < 2.0 ? tn : pn; - pd = absx < 2.0 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, fma(t, NE5, NE4), NE3), NE2), NE1), NE0); - td = fma(t, fma(t, fma(t, fma(t, fma(t, DE5, DE4), DE3), DE2), DE1), DE0); - pn = absx < 1.5 ? tn : pn; - pd = absx < 1.5 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, fma(t, ND5, ND4), ND3), ND2), ND1), ND0); - td = fma(t, fma(t, fma(t, fma(t, DD4, DD3), DD2), DD1), DD0); - pn = absx <= 1.0 ? tn : pn; - pd = absx <= 1.0 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, NC4, NC3), NC2), NC1), NC0); - td = fma(t, fma(t, fma(t, fma(t, DC4, DC3), DC2), DC1), DC0); - pn = absx < 0.75 ? tn : pn; - pd = absx < 0.75 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, NB4, NB3), NB2), NB1), NB0); - td = fma(t, fma(t, fma(t, fma(t, DB4, DB3), DB2), DB1), DB0); - pn = absx < 0.5 ? tn : pn; - pd = absx < 0.5 ? td : pd; - - tn = fma(t, fma(t, fma(t, fma(t, NA4, NA3), NA2), NA1), NA0); - td = fma(t, fma(t, fma(t, fma(t, DA4, DA3), DA2), DA1), DA0); - pn = absx < 0.25 ? tn : pn; - pd = absx < 0.25 ? td : pd; - - double pq = MATH_DIVIDE(pn, pd); - - // |x| <= 1 - double result1 = fma(absx*t, pq, absx); - - // Other ranges - int xout = absx <= 32.0 | absx > recrteps; - double y = absx + sqrt(fma(absx, absx, 1.0)); - y = xout ? absx : y; - - double r1, r2; - int xexp; - __clc_ep_log(y, &xexp, &r1, &r2); - - double dxexp = (double)(xexp + xout); - r1 = fma(dxexp, log2_lead, r1); - r2 = fma(dxexp, log2_tail, r2); - - // 1 < x <= 32 - double v2 = (pq + 0.25) / t; - double r = v2 + r1; - double s = ((r1 - r) + v2) + r2; - double v1 = r + s; - v2 = (r - v1) + s; - double result2 = v1 + v2; - - // x > 32 - double result3 = r1 + r2; - - double ret = absx > 1.0 ? result2 : result1; - ret = absx > 32.0 ? result3 : ret; - ret = x < 0.0 ? -ret : ret; - - // NaN, +-Inf, or x small enough that asinh(x) = x - ret = ax >= PINFBITPATT_DP64 | absx < rteps ? x : ret; - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, asinh, double) - -#endif diff --git a/libclc/generic/lib/math/asinpi.cl b/libclc/generic/lib/math/asinpi.cl deleted file mode 100644 index 511d74ec589f..000000000000 --- a/libclc/generic/lib/math/asinpi.cl +++ /dev/null @@ -1,170 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float asinpi(float x) { - // Computes arcsin(x). - // The argument is first reduced by noting that arcsin(x) - // is invalid for abs(x) > 1 and arcsin(-x) = -arcsin(x). - // For denormal and small arguments arcsin(x) = x to machine - // accuracy. Remaining argument ranges are handled as follows. - // For abs(x) <= 0.5 use - // arcsin(x) = x + x^3*R(x^2) - // where R(x^2) is a rational minimax approximation to - // (arcsin(x) - x)/x^3. - // For abs(x) > 0.5 exploit the identity: - // arcsin(x) = pi/2 - 2*arcsin(sqrt(1-x)/2) - // together with the above rational approximation, and - // reconstruct the terms carefully. - - - const float pi = 3.1415926535897933e+00f; - const float piby2_tail = 7.5497894159e-08F; /* 0x33a22168 */ - const float hpiby2_head = 7.8539812565e-01F; /* 0x3f490fda */ - - uint ux = as_uint(x); - uint aux = ux & EXSIGNBIT_SP32; - uint xs = ux ^ aux; - float shalf = as_float(xs | as_uint(0.5f)); - - int xexp = (int)(aux >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32; - - float y = as_float(aux); - - // abs(x) >= 0.5 - int transform = xexp >= -1; - - float y2 = y * y; - float rt = 0.5f * (1.0f - y); - float r = transform ? rt : y2; - - // Use a rational approximation for [0.0, 0.5] - float a = mad(r, - mad(r, - mad(r, -0.00396137437848476485201154797087F, -0.0133819288943925804214011424456F), - -0.0565298683201845211985026327361F), - 0.184161606965100694821398249421F); - float b = mad(r, -0.836411276854206731913362287293F, 1.10496961524520294485512696706F); - float u = r * MATH_DIVIDE(a, b); - - float s = MATH_SQRT(r); - float s1 = as_float(as_uint(s) & 0xffff0000); - float c = MATH_DIVIDE(mad(-s1, s1, r), s + s1); - float p = mad(2.0f*s, u, -mad(c, -2.0f, piby2_tail)); - float q = mad(s1, -2.0f, hpiby2_head); - float vt = hpiby2_head - (p - q); - float v = mad(y, u, y); - v = transform ? vt : v; - v = MATH_DIVIDE(v, pi); - float xbypi = MATH_DIVIDE(x, pi); - - float ret = as_float(xs | as_uint(v)); - ret = aux > 0x3f800000U ? as_float(QNANBITPATT_SP32) : ret; - ret = aux == 0x3f800000U ? shalf : ret; - ret = xexp < -14 ? xbypi : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, asinpi, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double asinpi(double x) { - // Computes arcsin(x). - // The argument is first reduced by noting that arcsin(x) - // is invalid for abs(x) > 1 and arcsin(-x) = -arcsin(x). - // For denormal and small arguments arcsin(x) = x to machine - // accuracy. Remaining argument ranges are handled as follows. - // For abs(x) <= 0.5 use - // arcsin(x) = x + x^3*R(x^2) - // where R(x^2) is a rational minimax approximation to - // (arcsin(x) - x)/x^3. - // For abs(x) > 0.5 exploit the identity: - // arcsin(x) = pi/2 - 2*arcsin(sqrt(1-x)/2) - // together with the above rational approximation, and - // reconstruct the terms carefully. - - const double pi = 0x1.921fb54442d18p+1; - const double piby2_tail = 6.1232339957367660e-17; /* 0x3c91a62633145c07 */ - const double hpiby2_head = 7.8539816339744831e-01; /* 0x3fe921fb54442d18 */ - - double y = fabs(x); - int xneg = as_int2(x).hi < 0; - int xexp = (as_int2(y).hi >> 20) - EXPBIAS_DP64; - - // abs(x) >= 0.5 - int transform = xexp >= -1; - - double rt = 0.5 * (1.0 - y); - double y2 = y * y; - double r = transform ? rt : y2; - - // Use a rational approximation for [0.0, 0.5] - double un = fma(r, - fma(r, - fma(r, - fma(r, - fma(r, 0.0000482901920344786991880522822991, - 0.00109242697235074662306043804220), - -0.0549989809235685841612020091328), - 0.275558175256937652532686256258), - -0.445017216867635649900123110649), - 0.227485835556935010735943483075); - - double ud = fma(r, - fma(r, - fma(r, - fma(r, 0.105869422087204370341222318533, - -0.943639137032492685763471240072), - 2.76568859157270989520376345954), - -3.28431505720958658909889444194), - 1.36491501334161032038194214209); - - double u = r * MATH_DIVIDE(un, ud); - - - // Reconstruct asin carefully in transformed region - double s = sqrt(r); - double sh = as_double(as_ulong(s) & 0xffffffff00000000UL); - double c = MATH_DIVIDE(fma(-sh, sh, r), s + sh); - double p = fma(2.0*s, u, -fma(-2.0, c, piby2_tail)); - double q = fma(-2.0, sh, hpiby2_head); - double vt = hpiby2_head - (p - q); - double v = fma(y, u, y); - v = transform ? vt : v; - - v = xexp < -28 ? y : v; - v = MATH_DIVIDE(v, pi); - v = xexp >= 0 ? as_double(QNANBITPATT_DP64) : v; - v = y == 1.0 ? 0.5 : v; - return xneg ? -v : v; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, asinpi, double) - -#endif diff --git a/libclc/generic/lib/math/atan.cl b/libclc/generic/lib/math/atan.cl deleted file mode 100644 index fa3633cef748..000000000000 --- a/libclc/generic/lib/math/atan.cl +++ /dev/null @@ -1,183 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "math.h" -#include "../clcmacro.h" - -#include - -_CLC_OVERLOAD _CLC_DEF float atan(float x) -{ - const float piby2 = 1.5707963267948966f; // 0x3ff921fb54442d18 - - uint ux = as_uint(x); - uint aux = ux & EXSIGNBIT_SP32; - uint sx = ux ^ aux; - - float spiby2 = as_float(sx | as_uint(piby2)); - - float v = as_float(aux); - - // Return for NaN - float ret = x; - - // 2^26 <= |x| <= Inf => atan(x) is close to piby2 - ret = aux <= PINFBITPATT_SP32 ? spiby2 : ret; - - // Reduce arguments 2^-19 <= |x| < 2^26 - - // 39/16 <= x < 2^26 - x = -MATH_RECIP(v); - float c = 1.57079632679489655800f; // atan(infinity) - - // 19/16 <= x < 39/16 - int l = aux < 0x401c0000; - float xx = MATH_DIVIDE(v - 1.5f, mad(v, 1.5f, 1.0f)); - x = l ? xx : x; - c = l ? 9.82793723247329054082e-01f : c; // atan(1.5) - - // 11/16 <= x < 19/16 - l = aux < 0x3f980000U; - xx = MATH_DIVIDE(v - 1.0f, 1.0f + v); - x = l ? xx : x; - c = l ? 7.85398163397448278999e-01f : c; // atan(1) - - // 7/16 <= x < 11/16 - l = aux < 0x3f300000; - xx = MATH_DIVIDE(mad(v, 2.0f, -1.0f), 2.0f + v); - x = l ? xx : x; - c = l ? 4.63647609000806093515e-01f : c; // atan(0.5) - - // 2^-19 <= x < 7/16 - l = aux < 0x3ee00000; - x = l ? v : x; - c = l ? 0.0f : c; - - // Core approximation: Remez(2,2) on [-7/16,7/16] - - float s = x * x; - float a = mad(s, - mad(s, 0.470677934286149214138357545549e-2f, 0.192324546402108583211697690500f), - 0.296528598819239217902158651186f); - - float b = mad(s, - mad(s, 0.299309699959659728404442796915f, 0.111072499995399550138837673349e1f), - 0.889585796862432286486651434570f); - - float q = x * s * MATH_DIVIDE(a, b); - - float z = c - (q - x); - float zs = as_float(sx | as_uint(z)); - - ret = aux < 0x4c800000 ? zs : ret; - - // |x| < 2^-19 - ret = aux < 0x36000000 ? as_float(ux) : ret; - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, atan, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - - -_CLC_OVERLOAD _CLC_DEF double atan(double x) -{ - const double piby2 = 1.5707963267948966e+00; // 0x3ff921fb54442d18 - - double v = fabs(x); - - // 2^56 > v > 39/16 - double a = -1.0; - double b = v; - // (chi + clo) = arctan(infinity) - double chi = 1.57079632679489655800e+00; - double clo = 6.12323399573676480327e-17; - - double ta = v - 1.5; - double tb = 1.0 + 1.5 * v; - int l = v <= 0x1.38p+1; // 39/16 > v > 19/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(1.5) - chi = l ? 9.82793723247329054082e-01 : chi; - clo = l ? 1.39033110312309953701e-17 : clo; - - ta = v - 1.0; - tb = 1.0 + v; - l = v <= 0x1.3p+0; // 19/16 > v > 11/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(1.) - chi = l ? 7.85398163397448278999e-01 : chi; - clo = l ? 3.06161699786838240164e-17 : clo; - - ta = 2.0 * v - 1.0; - tb = 2.0 + v; - l = v <= 0x1.6p-1; // 11/16 > v > 7/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(0.5) - chi = l ? 4.63647609000806093515e-01 : chi; - clo = l ? 2.26987774529616809294e-17 : clo; - - l = v <= 0x1.cp-2; // v < 7/16 - a = l ? v : a; - b = l ? 1.0 : b;; - chi = l ? 0.0 : chi; - clo = l ? 0.0 : clo; - - // Core approximation: Remez(4,4) on [-7/16,7/16] - double r = a / b; - double s = r * r; - double qn = fma(s, - fma(s, - fma(s, - fma(s, 0.142316903342317766e-3, - 0.304455919504853031e-1), - 0.220638780716667420e0), - 0.447677206805497472e0), - 0.268297920532545909e0); - - double qd = fma(s, - fma(s, - fma(s, - fma(s, 0.389525873944742195e-1, - 0.424602594203847109e0), - 0.141254259931958921e1), - 0.182596787737507063e1), - 0.804893761597637733e0); - - double q = r * s * qn / qd; - r = chi - ((q - clo) - r); - - double z = isnan(x) ? x : piby2; - z = v <= 0x1.0p+56 ? r : z; - z = v < 0x1.0p-26 ? v : z; - return x == v ? z : -z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atan, double); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/atan2.cl b/libclc/generic/lib/math/atan2.cl deleted file mode 100644 index a2f104fa185b..000000000000 --- a/libclc/generic/lib/math/atan2.cl +++ /dev/null @@ -1,237 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "tables.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float atan2(float y, float x) -{ - const float pi = 0x1.921fb6p+1f; - const float piby2 = 0x1.921fb6p+0f; - const float piby4 = 0x1.921fb6p-1f; - const float threepiby4 = 0x1.2d97c8p+1f; - - float ax = fabs(x); - float ay = fabs(y); - float v = min(ax, ay); - float u = max(ax, ay); - - // Scale since u could be large, as in "regular" divide - float s = u > 0x1.0p+96f ? 0x1.0p-32f : 1.0f; - float vbyu = s * MATH_DIVIDE(v, s*u); - - float vbyu2 = vbyu * vbyu; - -#define USE_2_2_APPROXIMATION -#if defined USE_2_2_APPROXIMATION - float p = mad(vbyu2, mad(vbyu2, -0x1.7e1f78p-9f, -0x1.7d1b98p-3f), -0x1.5554d0p-2f) * vbyu2 * vbyu; - float q = mad(vbyu2, mad(vbyu2, 0x1.1a714cp-2f, 0x1.287c56p+0f), 1.0f); -#else - float p = mad(vbyu2, mad(vbyu2, -0x1.55cd22p-5f, -0x1.26cf76p-2f), -0x1.55554ep-2f) * vbyu2 * vbyu; - float q = mad(vbyu2, mad(vbyu2, mad(vbyu2, 0x1.9f1304p-5f, 0x1.2656fap-1f), 0x1.76b4b8p+0f), 1.0f); -#endif - - // Octant 0 result - float a = mad(p, MATH_RECIP(q), vbyu); - - // Fix up 3 other octants - float at = piby2 - a; - a = ay > ax ? at : a; - at = pi - a; - a = x < 0.0F ? at : a; - - // y == 0 => 0 for x >= 0, pi for x < 0 - at = as_int(x) < 0 ? pi : 0.0f; - a = y == 0.0f ? at : a; - - // if (!FINITE_ONLY()) { - // x and y are +- Inf - at = x > 0.0f ? piby4 : threepiby4; - a = ax == INFINITY & ay == INFINITY ? at : a; - - // x or y is NaN - a = isnan(x) | isnan(y) ? as_float(QNANBITPATT_SP32) : a; - // } - - // Fixup sign and return - return copysign(a, y); -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, atan2, float, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double atan2(double y, double x) -{ - const double pi = 3.1415926535897932e+00; /* 0x400921fb54442d18 */ - const double piby2 = 1.5707963267948966e+00; /* 0x3ff921fb54442d18 */ - const double piby4 = 7.8539816339744831e-01; /* 0x3fe921fb54442d18 */ - const double three_piby4 = 2.3561944901923449e+00; /* 0x4002d97c7f3321d2 */ - const double pi_head = 3.1415926218032836e+00; /* 0x400921fb50000000 */ - const double pi_tail = 3.1786509547056392e-08; /* 0x3e6110b4611a6263 */ - const double piby2_head = 1.5707963267948965e+00; /* 0x3ff921fb54442d18 */ - const double piby2_tail = 6.1232339957367660e-17; /* 0x3c91a62633145c07 */ - - double x2 = x; - int xneg = as_int2(x).hi < 0; - int xexp = (as_int2(x).hi >> 20) & 0x7ff; - - double y2 = y; - int yneg = as_int2(y).hi < 0; - int yexp = (as_int2(y).hi >> 20) & 0x7ff; - - int cond2 = (xexp < 1021) & (yexp < 1021); - int diffexp = yexp - xexp; - - // Scale up both x and y if they are both below 1/4 - double x1 = ldexp(x, 1024); - int xexp1 = (as_int2(x1).hi >> 20) & 0x7ff; - double y1 = ldexp(y, 1024); - int yexp1 = (as_int2(y1).hi >> 20) & 0x7ff; - int diffexp1 = yexp1 - xexp1; - - diffexp = cond2 ? diffexp1 : diffexp; - x = cond2 ? x1 : x; - y = cond2 ? y1 : y; - - // General case: take absolute values of arguments - double u = fabs(x); - double v = fabs(y); - - // Swap u and v if necessary to obtain 0 < v < u. Compute v/u. - int swap_vu = u < v; - double uu = u; - u = swap_vu ? v : u; - v = swap_vu ? uu : v; - - double vbyu = v / u; - double q1, q2; - - // General values of v/u. Use a look-up table and series expansion. - - { - double val = vbyu > 0.0625 ? vbyu : 0.063; - int index = convert_int(fma(256.0, val, 0.5)); - double2 tv = USE_TABLE(atan_jby256_tbl, index - 16); - q1 = tv.s0; - q2 = tv.s1; - double c = (double)index * 0x1.0p-8; - - // We're going to scale u and v by 2^(-u_exponent) to bring them close to 1 - // u_exponent could be EMAX so we have to do it in 2 steps - int m = -((int)(as_ulong(u) >> EXPSHIFTBITS_DP64) - EXPBIAS_DP64); - //double um = __amdil_ldexp_f64(u, m); - //double vm = __amdil_ldexp_f64(v, m); - double um = ldexp(u, m); - double vm = ldexp(v, m); - - // 26 leading bits of u - double u1 = as_double(as_ulong(um) & 0xfffffffff8000000UL); - double u2 = um - u1; - - double r = MATH_DIVIDE(fma(-c, u2, fma(-c, u1, vm)), fma(c, vm, um)); - - // Polynomial approximation to atan(r) - double s = r * r; - q2 = q2 + fma((s * fma(-s, 0.19999918038989143496, 0.33333333333224095522)), -r, r); - } - - - double q3, q4; - { - q3 = 0.0; - q4 = vbyu; - } - - double q5, q6; - { - double u1 = as_double(as_ulong(u) & 0xffffffff00000000UL); - double u2 = u - u1; - double vu1 = as_double(as_ulong(vbyu) & 0xffffffff00000000UL); - double vu2 = vbyu - vu1; - - q5 = 0.0; - double s = vbyu * vbyu; - q6 = vbyu + fma(-vbyu * s, - fma(-s, - fma(-s, - fma(-s, - fma(-s, 0.90029810285449784439E-01, - 0.11110736283514525407), - 0.14285713561807169030), - 0.19999999999393223405), - 0.33333333333333170500), - MATH_DIVIDE(fma(-u, vu2, fma(-u2, vu1, fma(-u1, vu1, v))), u)); - } - - - q3 = vbyu < 0x1.d12ed0af1a27fp-27 ? q3 : q5; - q4 = vbyu < 0x1.d12ed0af1a27fp-27 ? q4 : q6; - - q1 = vbyu > 0.0625 ? q1 : q3; - q2 = vbyu > 0.0625 ? q2 : q4; - - // Tidy-up according to which quadrant the arguments lie in - double res1, res2, res3, res4; - q1 = swap_vu ? piby2_head - q1 : q1; - q2 = swap_vu ? piby2_tail - q2 : q2; - q1 = xneg ? pi_head - q1 : q1; - q2 = xneg ? pi_tail - q2 : q2; - q1 = q1 + q2; - res4 = yneg ? -q1 : q1; - - res1 = yneg ? -three_piby4 : three_piby4; - res2 = yneg ? -piby4 : piby4; - res3 = xneg ? res1 : res2; - - res3 = isinf(x2) & isinf(y2) ? res3 : res4; - res1 = yneg ? -pi : pi; - - // abs(x)/abs(y) > 2^56 and x < 0 - res3 = (diffexp < -56 && xneg) ? res1 : res3; - - res4 = MATH_DIVIDE(y, x); - // x positive and dominant over y by a factor of 2^28 - res3 = diffexp < -28 & xneg == 0 ? res4 : res3; - - // abs(y)/abs(x) > 2^56 - res4 = yneg ? -piby2 : piby2; // atan(y/x) is insignificant compared to piby2 - res3 = diffexp > 56 ? res4 : res3; - - res3 = x2 == 0.0 ? res4 : res3; // Zero x gives +- pi/2 depending on sign of y - res4 = xneg ? res1 : y2; - - res3 = y2 == 0.0 ? res4 : res3; // Zero y gives +-0 for positive x and +-pi for negative x - res3 = isnan(y2) ? y2 : res3; - res3 = isnan(x2) ? x2 : res3; - - return res3; -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atan2, double, double); - -#endif diff --git a/libclc/generic/lib/math/atan2pi.cl b/libclc/generic/lib/math/atan2pi.cl deleted file mode 100644 index a15b14fd319d..000000000000 --- a/libclc/generic/lib/math/atan2pi.cl +++ /dev/null @@ -1,221 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "tables.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float atan2pi(float y, float x) { - const float pi = 0x1.921fb6p+1f; - - float ax = fabs(x); - float ay = fabs(y); - float v = min(ax, ay); - float u = max(ax, ay); - - // Scale since u could be large, as in "regular" divide - float s = u > 0x1.0p+96f ? 0x1.0p-32f : 1.0f; - float vbyu = s * MATH_DIVIDE(v, s*u); - - float vbyu2 = vbyu * vbyu; - - float p = mad(vbyu2, mad(vbyu2, -0x1.7e1f78p-9f, -0x1.7d1b98p-3f), -0x1.5554d0p-2f) * vbyu2 * vbyu; - float q = mad(vbyu2, mad(vbyu2, 0x1.1a714cp-2f, 0x1.287c56p+0f), 1.0f); - - // Octant 0 result - float a = MATH_DIVIDE(mad(p, MATH_RECIP(q), vbyu), pi); - - // Fix up 3 other octants - float at = 0.5f - a; - a = ay > ax ? at : a; - at = 1.0f - a; - a = x < 0.0F ? at : a; - - // y == 0 => 0 for x >= 0, pi for x < 0 - at = as_int(x) < 0 ? 1.0f : 0.0f; - a = y == 0.0f ? at : a; - - // if (!FINITE_ONLY()) { - // x and y are +- Inf - at = x > 0.0f ? 0.25f : 0.75f; - a = ax == INFINITY & ay == INFINITY ? at : a; - - // x or y is NaN - a = isnan(x) | isnan(y) ? as_float(QNANBITPATT_SP32) : a; - // } - - // Fixup sign and return - return copysign(a, y); -} - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, atan2pi, float, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double atan2pi(double y, double x) { - const double pi = 3.1415926535897932e+00; /* 0x400921fb54442d18 */ - const double pi_head = 3.1415926218032836e+00; /* 0x400921fb50000000 */ - const double pi_tail = 3.1786509547056392e-08; /* 0x3e6110b4611a6263 */ - const double piby2_head = 1.5707963267948965e+00; /* 0x3ff921fb54442d18 */ - const double piby2_tail = 6.1232339957367660e-17; /* 0x3c91a62633145c07 */ - - double x2 = x; - int xneg = as_int2(x).hi < 0; - int xexp = (as_int2(x).hi >> 20) & 0x7ff; - - double y2 = y; - int yneg = as_int2(y).hi < 0; - int yexp = (as_int2(y).hi >> 20) & 0x7ff; - - int cond2 = (xexp < 1021) & (yexp < 1021); - int diffexp = yexp - xexp; - - // Scale up both x and y if they are both below 1/4 - double x1 = ldexp(x, 1024); - int xexp1 = (as_int2(x1).hi >> 20) & 0x7ff; - double y1 = ldexp(y, 1024); - int yexp1 = (as_int2(y1).hi >> 20) & 0x7ff; - int diffexp1 = yexp1 - xexp1; - - diffexp = cond2 ? diffexp1 : diffexp; - x = cond2 ? x1 : x; - y = cond2 ? y1 : y; - - // General case: take absolute values of arguments - double u = fabs(x); - double v = fabs(y); - - // Swap u and v if necessary to obtain 0 < v < u. Compute v/u. - int swap_vu = u < v; - double uu = u; - u = swap_vu ? v : u; - v = swap_vu ? uu : v; - - double vbyu = v / u; - double q1, q2; - - // General values of v/u. Use a look-up table and series expansion. - - { - double val = vbyu > 0.0625 ? vbyu : 0.063; - int index = convert_int(fma(256.0, val, 0.5)); - double2 tv = USE_TABLE(atan_jby256_tbl, (index - 16)); - q1 = tv.s0; - q2 = tv.s1; - double c = (double)index * 0x1.0p-8; - - // We're going to scale u and v by 2^(-u_exponent) to bring them close to 1 - // u_exponent could be EMAX so we have to do it in 2 steps - int m = -((int)(as_ulong(u) >> EXPSHIFTBITS_DP64) - EXPBIAS_DP64); - double um = ldexp(u, m); - double vm = ldexp(v, m); - - // 26 leading bits of u - double u1 = as_double(as_ulong(um) & 0xfffffffff8000000UL); - double u2 = um - u1; - - double r = MATH_DIVIDE(fma(-c, u2, fma(-c, u1, vm)), fma(c, vm, um)); - - // Polynomial approximation to atan(r) - double s = r * r; - q2 = q2 + fma((s * fma(-s, 0.19999918038989143496, 0.33333333333224095522)), -r, r); - } - - - double q3, q4; - { - q3 = 0.0; - q4 = vbyu; - } - - double q5, q6; - { - double u1 = as_double(as_ulong(u) & 0xffffffff00000000UL); - double u2 = u - u1; - double vu1 = as_double(as_ulong(vbyu) & 0xffffffff00000000UL); - double vu2 = vbyu - vu1; - - q5 = 0.0; - double s = vbyu * vbyu; - q6 = vbyu + fma(-vbyu * s, - fma(-s, - fma(-s, - fma(-s, - fma(-s, 0.90029810285449784439E-01, - 0.11110736283514525407), - 0.14285713561807169030), - 0.19999999999393223405), - 0.33333333333333170500), - MATH_DIVIDE(fma(-u, vu2, fma(-u2, vu1, fma(-u1, vu1, v))), u)); - } - - - q3 = vbyu < 0x1.d12ed0af1a27fp-27 ? q3 : q5; - q4 = vbyu < 0x1.d12ed0af1a27fp-27 ? q4 : q6; - - q1 = vbyu > 0.0625 ? q1 : q3; - q2 = vbyu > 0.0625 ? q2 : q4; - - // Tidy-up according to which quadrant the arguments lie in - double res1, res2, res3, res4; - q1 = swap_vu ? piby2_head - q1 : q1; - q2 = swap_vu ? piby2_tail - q2 : q2; - q1 = xneg ? pi_head - q1 : q1; - q2 = xneg ? pi_tail - q2 : q2; - q1 = MATH_DIVIDE(q1 + q2, pi); - res4 = yneg ? -q1 : q1; - - res1 = yneg ? -0.75 : 0.75; - res2 = yneg ? -0.25 : 0.25; - res3 = xneg ? res1 : res2; - - res3 = isinf(y2) & isinf(x2) ? res3 : res4; - res1 = yneg ? -1.0 : 1.0; - - // abs(x)/abs(y) > 2^56 and x < 0 - res3 = (diffexp < -56 && xneg) ? res1 : res3; - - res4 = MATH_DIVIDE(MATH_DIVIDE(y, x), pi); - // x positive and dominant over y by a factor of 2^28 - res3 = diffexp < -28 & xneg == 0 ? res4 : res3; - - // abs(y)/abs(x) > 2^56 - res4 = yneg ? -0.5 : 0.5; // atan(y/x) is insignificant compared to piby2 - res3 = diffexp > 56 ? res4 : res3; - - res3 = x2 == 0.0 ? res4 : res3; // Zero x gives +- pi/2 depending on sign of y - res4 = xneg ? res1 : y2; - - res3 = y2 == 0.0 ? res4 : res3; // Zero y gives +-0 for positive x and +-pi for negative x - res3 = isnan(y2) ? y2 : res3; - res3 = isnan(x2) ? x2 : res3; - - return res3; -} - - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atan2pi, double, double) - -#endif diff --git a/libclc/generic/lib/math/atanh.cl b/libclc/generic/lib/math/atanh.cl deleted file mode 100644 index 4af2f458536a..000000000000 --- a/libclc/generic/lib/math/atanh.cl +++ /dev/null @@ -1,113 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float atanh(float x) { - uint ux = as_uint(x); - uint ax = ux & EXSIGNBIT_SP32; - uint xs = ux ^ ax; - - // |x| > 1 or NaN - float z = as_float(QNANBITPATT_SP32); - - // |x| == 1 - float t = as_float(xs | PINFBITPATT_SP32); - z = ax == 0x3f800000U ? t : z; - - // 1/2 <= |x| < 1 - t = as_float(ax); - t = MATH_DIVIDE(2.0f*t, 1.0f - t); - t = 0.5f * log1p(t); - t = as_float(xs | as_uint(t)); - z = ax < 0x3f800000U ? t : z; - - // |x| < 1/2 - t = x * x; - float a = mad(mad(0.92834212715e-2f, t, -0.28120347286e0f), t, 0.39453629046e0f); - float b = mad(mad(0.45281890445e0f, t, -0.15537744551e1f), t, 0.11836088638e1f); - float p = MATH_DIVIDE(a, b); - t = mad(x*t, p, x); - z = ax < 0x3f000000 ? t : z; - - // |x| < 2^-13 - z = ax < 0x39000000U ? x : z; - - return z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, atanh, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double atanh(double x) { - double absx = fabs(x); - - double ret = absx == 1.0 ? as_double(PINFBITPATT_DP64) : as_double(QNANBITPATT_DP64); - - // |x| >= 0.5 - // Note that atanh(x) = 0.5 * ln((1+x)/(1-x)) - // For greater accuracy we use - // ln((1+x)/(1-x)) = ln(1 + 2x/(1-x)) = log1p(2x/(1-x)). - double r = 0.5 * log1p(2.0 * absx / (1.0 - absx)); - ret = absx < 1.0 ? r : ret; - - r = -ret; - ret = x < 0.0 ? r : ret; - - // Arguments up to 0.5 in magnitude are - // approximated by a [5,5] minimax polynomial - double t = x * x; - - double pn = fma(t, - fma(t, - fma(t, - fma(t, - fma(t, -0.10468158892753136958e-3, 0.28728638600548514553e-1), - -0.28180210961780814148e0), - 0.88468142536501647470e0), - -0.11028356797846341457e1), - 0.47482573589747356373e0); - - double pd = fma(t, - fma(t, - fma(t, - fma(t, - fma(t, -0.35861554370169537512e-1, 0.49561196555503101989e0), - -0.22608883748988489342e1), - 0.45414700626084508355e1), - -0.41631933639693546274e1), - 0.14244772076924206909e1); - - r = fma(x*t, pn/pd, x); - ret = absx < 0.5 ? r : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atanh, double) - -#endif diff --git a/libclc/generic/lib/math/atanpi.cl b/libclc/generic/lib/math/atanpi.cl deleted file mode 100644 index 2e2f032d8e6c..000000000000 --- a/libclc/generic/lib/math/atanpi.cl +++ /dev/null @@ -1,182 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float atanpi(float x) { - const float pi = 3.1415926535897932f; - - uint ux = as_uint(x); - uint aux = ux & EXSIGNBIT_SP32; - uint sx = ux ^ aux; - - float xbypi = MATH_DIVIDE(x, pi); - float shalf = as_float(sx | as_uint(0.5f)); - - float v = as_float(aux); - - // Return for NaN - float ret = x; - - // 2^26 <= |x| <= Inf => atan(x) is close to piby2 - ret = aux <= PINFBITPATT_SP32 ? shalf : ret; - - // Reduce arguments 2^-19 <= |x| < 2^26 - - // 39/16 <= x < 2^26 - x = -MATH_RECIP(v); - float c = 1.57079632679489655800f; // atan(infinity) - - // 19/16 <= x < 39/16 - int l = aux < 0x401c0000; - float xx = MATH_DIVIDE(v - 1.5f, mad(v, 1.5f, 1.0f)); - x = l ? xx : x; - c = l ? 9.82793723247329054082e-01f : c; // atan(1.5) - - // 11/16 <= x < 19/16 - l = aux < 0x3f980000U; - xx = MATH_DIVIDE(v - 1.0f, 1.0f + v); - x = l ? xx : x; - c = l ? 7.85398163397448278999e-01f : c; // atan(1) - - // 7/16 <= x < 11/16 - l = aux < 0x3f300000; - xx = MATH_DIVIDE(mad(v, 2.0f, -1.0f), 2.0f + v); - x = l ? xx : x; - c = l ? 4.63647609000806093515e-01f : c; // atan(0.5) - - // 2^-19 <= x < 7/16 - l = aux < 0x3ee00000; - x = l ? v : x; - c = l ? 0.0f : c; - - // Core approximation: Remez(2,2) on [-7/16,7/16] - - float s = x * x; - float a = mad(s, - mad(s, 0.470677934286149214138357545549e-2f, 0.192324546402108583211697690500f), - 0.296528598819239217902158651186f); - - float b = mad(s, - mad(s, 0.299309699959659728404442796915f, 0.111072499995399550138837673349e1f), - 0.889585796862432286486651434570f); - - float q = x * s * MATH_DIVIDE(a, b); - - float z = c - (q - x); - z = MATH_DIVIDE(z, pi); - float zs = as_float(sx | as_uint(z)); - - ret = aux < 0x4c800000 ? zs : ret; - - // |x| < 2^-19 - ret = aux < 0x36000000 ? xbypi : ret; - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, atanpi, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double atanpi(double x) { - const double pi = 0x1.921fb54442d18p+1; - - double v = fabs(x); - - // 2^56 > v > 39/16 - double a = -1.0; - double b = v; - // (chi + clo) = arctan(infinity) - double chi = 1.57079632679489655800e+00; - double clo = 6.12323399573676480327e-17; - - double ta = v - 1.5; - double tb = 1.0 + 1.5 * v; - int l = v <= 0x1.38p+1; // 39/16 > v > 19/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(1.5) - chi = l ? 9.82793723247329054082e-01 : chi; - clo = l ? 1.39033110312309953701e-17 : clo; - - ta = v - 1.0; - tb = 1.0 + v; - l = v <= 0x1.3p+0; // 19/16 > v > 11/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(1.) - chi = l ? 7.85398163397448278999e-01 : chi; - clo = l ? 3.06161699786838240164e-17 : clo; - - ta = 2.0 * v - 1.0; - tb = 2.0 + v; - l = v <= 0x1.6p-1; // 11/16 > v > 7/16 - a = l ? ta : a; - b = l ? tb : b; - // (chi + clo) = arctan(0.5) - chi = l ? 4.63647609000806093515e-01 : chi; - clo = l ? 2.26987774529616809294e-17 : clo; - - l = v <= 0x1.cp-2; // v < 7/16 - a = l ? v : a; - b = l ? 1.0 : b;; - chi = l ? 0.0 : chi; - clo = l ? 0.0 : clo; - - // Core approximation: Remez(4,4) on [-7/16,7/16] - double r = a / b; - double s = r * r; - double qn = fma(s, - fma(s, - fma(s, - fma(s, 0.142316903342317766e-3, - 0.304455919504853031e-1), - 0.220638780716667420e0), - 0.447677206805497472e0), - 0.268297920532545909e0); - - double qd = fma(s, - fma(s, - fma(s, - fma(s, 0.389525873944742195e-1, - 0.424602594203847109e0), - 0.141254259931958921e1), - 0.182596787737507063e1), - 0.804893761597637733e0); - - double q = r * s * qn / qd; - r = (chi - ((q - clo) - r)) / pi; - double vp = v / pi; - - double z = isnan(x) ? x : 0.5; - z = v <= 0x1.0p+56 ? r : z; - z = v < 0x1.0p-26 ? vp : z; - return x == v ? z : -z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, atanpi, double) - -#endif diff --git a/libclc/generic/lib/math/binary_impl.inc b/libclc/generic/lib/math/binary_impl.inc deleted file mode 100644 index c9bf97242672..000000000000 --- a/libclc/generic/lib/math/binary_impl.inc +++ /dev/null @@ -1,22 +0,0 @@ - -#ifndef __CLC_SCALAR - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, __CLC_GENTYPE y) { - return FUNCTION_IMPL(x, y); -} - -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, float y) { - __CLC_GENTYPE vec_y = (__CLC_GENTYPE) (y); - return FUNCTION_IMPL(x, vec_y); -} - -#ifdef cl_khr_fp64 - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE FUNCTION(__CLC_GENTYPE x, double y) { - __CLC_GENTYPE vec_y = (__CLC_GENTYPE) (y); - return FUNCTION_IMPL(x, vec_y); -} - -#endif diff --git a/libclc/generic/lib/math/clc_ldexp.cl b/libclc/generic/lib/math/clc_ldexp.cl deleted file mode 100644 index 61e34a521609..000000000000 --- a/libclc/generic/lib/math/clc_ldexp.cl +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "config.h" -#include "../clcmacro.h" -#include "math.h" - -_CLC_DEF _CLC_OVERLOAD float __clc_ldexp(float x, int n) { - - if (!__clc_fp32_subnormals_supported()) { - - // This treats subnormals as zeros - int i = as_int(x); - int e = (i >> 23) & 0xff; - int m = i & 0x007fffff; - int s = i & 0x80000000; - int v = add_sat(e, n); - v = clamp(v, 0, 0xff); - int mr = e == 0 | v == 0 | v == 0xff ? 0 : m; - int c = e == 0xff; - mr = c ? m : mr; - int er = c ? e : v; - er = e ? er : e; - return as_float( s | (er << 23) | mr ); - } - - /* supports denormal values */ - const int multiplier = 24; - float val_f; - uint val_ui; - uint sign; - int exponent; - val_ui = as_uint(x); - sign = val_ui & 0x80000000; - val_ui = val_ui & 0x7fffffff;/* remove the sign bit */ - int val_x = val_ui; - - exponent = val_ui >> 23; /* get the exponent */ - int dexp = exponent; - - /* denormal support */ - int fbh = 127 - (as_uint((float)(as_float(val_ui | 0x3f800000) - 1.0f)) >> 23); - int dexponent = 25 - fbh; - uint dval_ui = (( (val_ui << fbh) & 0x007fffff) | (dexponent << 23)); - int ex = dexponent + n - multiplier; - dexponent = ex; - uint val = sign | (ex << 23) | (dval_ui & 0x007fffff); - int ex1 = dexponent + multiplier; - ex1 = -ex1 +25; - dval_ui = (((dval_ui & 0x007fffff )| 0x800000) >> ex1); - dval_ui = dexponent > 0 ? val :dval_ui; - dval_ui = dexponent > 254 ? 0x7f800000 :dval_ui; /*overflow*/ - dval_ui = dexponent < -multiplier ? 0 : dval_ui; /*underflow*/ - dval_ui = dval_ui | sign; - val_f = as_float(dval_ui); - - exponent += n; - - val = sign | (exponent << 23) | (val_ui & 0x007fffff); - ex1 = exponent + multiplier; - ex1 = -ex1 +25; - val_ui = (((val_ui & 0x007fffff )| 0x800000) >> ex1); - val_ui = exponent > 0 ? val :val_ui; - val_ui = exponent > 254 ? 0x7f800000 :val_ui; /*overflow*/ - val_ui = exponent < -multiplier ? 0 : val_ui; /*underflow*/ - val_ui = val_ui | sign; - - val_ui = dexp == 0? dval_ui : val_ui; - val_f = as_float(val_ui); - - val_f = isnan(x) | isinf(x) | val_x == 0 ? x : val_f; - return val_f; -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEF _CLC_OVERLOAD double __clc_ldexp(double x, int n) { - long l = as_ulong(x); - int e = (l >> 52) & 0x7ff; - long s = l & 0x8000000000000000; - - ulong ux = as_ulong(x * 0x1.0p+53); - int de = ((int)(ux >> 52) & 0x7ff) - 53; - int c = e == 0; - e = c ? de: e; - - ux = c ? ux : l; - - int v = e + n; - v = clamp(v, -0x7ff, 0x7ff); - - ux &= ~EXPBITS_DP64; - - double mr = as_double(ux | ((ulong)(v+53) << 52)); - mr = mr * 0x1.0p-53; - - mr = v > 0 ? as_double(ux | ((ulong)v << 52)) : mr; - - mr = v == 0x7ff ? as_double(s | PINFBITPATT_DP64) : mr; - mr = v < -53 ? as_double(s) : mr; - - mr = ((n == 0) | isinf(x) | (x == 0) ) ? x : mr; - return mr; -} - -#endif diff --git a/libclc/generic/lib/math/clc_nextafter.cl b/libclc/generic/lib/math/clc_nextafter.cl deleted file mode 100644 index e53837d179fb..000000000000 --- a/libclc/generic/lib/math/clc_nextafter.cl +++ /dev/null @@ -1,43 +0,0 @@ -#include -#include "../clcmacro.h" - -// This file provides OpenCL C implementations of nextafter for targets that -// don't support the clang builtin. - -#define FLT_NAN 0.0f/0.0f - -#define NEXTAFTER(FLOAT_TYPE, UINT_TYPE, NAN, ZERO, NEXTAFTER_ZERO) \ -_CLC_OVERLOAD _CLC_DEF FLOAT_TYPE __clc_nextafter(FLOAT_TYPE x, FLOAT_TYPE y) { \ - union { \ - FLOAT_TYPE f; \ - UINT_TYPE i; \ - } next; \ - if (isnan(x) || isnan(y)) { \ - return NAN; \ - } \ - if (x == y) { \ - return y; \ - } \ - next.f = x; \ - if (x < y) { \ - next.i++; \ - } else { \ - if (next.f == ZERO) { \ - next.i = NEXTAFTER_ZERO; \ - } else { \ - next.i--; \ - } \ - } \ - return next.f; \ -} - -NEXTAFTER(float, uint, FLT_NAN, 0.0f, 0x80000001) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, __clc_nextafter, float, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#define DBL_NAN 0.0/0.0 - -NEXTAFTER(double, ulong, DBL_NAN, 0.0, 0x8000000000000001) -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, __clc_nextafter, double, double) -#endif diff --git a/libclc/generic/lib/math/clc_sqrt.cl b/libclc/generic/lib/math/clc_sqrt.cl deleted file mode 100644 index 86a874d0c31c..000000000000 --- a/libclc/generic/lib/math/clc_sqrt.cl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -// Map the llvm sqrt intrinsic to an OpenCL function. -#define __CLC_FUNCTION __clc_llvm_intr_sqrt -#define __CLC_INTRINSIC "llvm.sqrt" -#include -#undef __CLC_FUNCTION -#undef __CLC_INTRINSIC - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/clc_sqrt_impl.inc b/libclc/generic/lib/math/clc_sqrt_impl.inc deleted file mode 100644 index e97b5403db0b..000000000000 --- a/libclc/generic/lib/math/clc_sqrt_impl.inc +++ /dev/null @@ -1,38 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#if __CLC_FPSIZE == 32 -#define __CLC_NAN NAN -#define ZERO 0.0f -#elif __CLC_FPSIZE == 64 -#define __CLC_NAN __builtin_nan("") -#define ZERO 0.0 -#else -#error "Invalid value for __CLC_FPSIZE" -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE __clc_sqrt(__CLC_GENTYPE val) { - return val < ZERO ? __CLC_NAN : __clc_llvm_intr_sqrt(val); -} - -#undef __CLC_NAN -#undef ZERO diff --git a/libclc/generic/lib/math/copysign.cl b/libclc/generic/lib/math/copysign.cl deleted file mode 100644 index 4e0c51b09373..000000000000 --- a/libclc/generic/lib/math/copysign.cl +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "../clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, copysign, __builtin_copysignf, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, copysign, __builtin_copysign, double, double) - -#endif diff --git a/libclc/generic/lib/math/cos.cl b/libclc/generic/lib/math/cos.cl deleted file mode 100644 index 157447f9cd7c..000000000000 --- a/libclc/generic/lib/math/cos.cl +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "sincos_helpers.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float cos(float x) -{ - int ix = as_int(x); - int ax = ix & 0x7fffffff; - float dx = as_float(ax); - - float r0, r1; - int regn = __clc_argReductionS(&r0, &r1, dx); - - float ss = -__clc_sinf_piby4(r0, r1); - float cc = __clc_cosf_piby4(r0, r1); - - float c = (regn & 1) != 0 ? ss : cc; - c = as_float(as_int(c) ^ ((regn > 1) << 31)); - - c = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : c; - - return c; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, cos, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double cos(double x) { - x = fabs(x); - - double r, rr; - int regn; - - if (x < 0x1.0p+47) - __clc_remainder_piby2_medium(x, &r, &rr, ®n); - else - __clc_remainder_piby2_large(x, &r, &rr, ®n); - - double2 sc = __clc_sincos_piby4(r, rr); - sc.lo = -sc.lo; - - int2 c = as_int2(regn & 1 ? sc.lo : sc.hi); - c.hi ^= (regn > 1) << 31; - - return isnan(x) | isinf(x) ? as_double(QNANBITPATT_DP64) : as_double(c); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, cos, double); - -#endif diff --git a/libclc/generic/lib/math/cospi.cl b/libclc/generic/lib/math/cospi.cl deleted file mode 100644 index 108b637c9abb..000000000000 --- a/libclc/generic/lib/math/cospi.cl +++ /dev/null @@ -1,136 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "sincos_helpers.h" -#include "sincospiF_piby4.h" -#include "../clcmacro.h" -#ifdef cl_khr_fp64 -#include "sincosD_piby4.h" -#endif - -_CLC_OVERLOAD _CLC_DEF float cospi(float x) -{ - int ix = as_int(x) & 0x7fffffff; - float ax = as_float(ix); - int iax = (int)ax; - float r = ax - iax; - int xodd = iax & 0x1 ? 0x80000000 : 0; - - // Initialize with return for +-Inf and NaN - int ir = 0x7fc00000; - - // 2^24 <= |x| < Inf, the result is always even integer - ir = ix < 0x7f800000 ? 0x3f800000 : ir; - - // 2^23 <= |x| < 2^24, the result is always integer - ir = ix < 0x4b800000 ? xodd | 0x3f800000 : ir; - - // 0x1.0p-7 <= |x| < 2^23, result depends on which 0.25 interval - - // r < 1.0 - float a = 1.0f - r; - int e = 1; - int s = xodd ^ 0x80000000; - - // r <= 0.75 - int c = r <= 0.75f; - a = c ? r - 0.5f : a; - e = c ? 0 : e; - - // r < 0.5 - c = r < 0.5f; - a = c ? 0.5f - r : a; - s = c ? xodd : s; - - // r <= 0.25 - c = r <= 0.25f; - a = c ? r : a; - e = c ? 1 : e; - - float2 t = __libclc__sincosf_piby4(a * M_PI_F); - int jr = s ^ as_int(e ? t.hi : t.lo); - - ir = ix < 0x4b000000 ? jr : ir; - - return as_float(ir); -} - - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, cospi, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double cospi(double x) { - - long ix = as_long(x) & 0x7fffffffffffffffL; - double ax = as_double(ix); - long iax = (long)ax; - double r = ax - (double)iax; - long xodd = iax & 0x1L ? 0x8000000000000000L : 0L; - - // Initialize with return for +-Inf and NaN - long ir = 0x7ff8000000000000L; - - // 2^53 <= |x| < Inf, the result is always even integer - ir = ix < 0x7ff0000000000000 ? 0x3ff0000000000000L : ir; - - // 2^52 <= |x| < 2^53, the result is always integer - ir = ax < 0x1.0p+53 ? xodd | 0x3ff0000000000000L : ir; - - // 0x1.0p-7 <= |x| < 2^52, result depends on which 0.25 interval - - // r < 1.0 - double a = 1.0 - r; - int e = 1; - long s = xodd ^ 0x8000000000000000L; - - // r <= 0.75 - int c = r <= 0.75; - double t = r - 0.5; - a = c ? t : a; - e = c ? 0 : e; - - // r < 0.5 - c = r < 0.5; - t = 0.5 - r; - a = c ? t : a; - s = c ? xodd : s; - - // r <= 0.25 - c = r <= 0.25; - a = c ? r : a; - e = c ? 1 : e; - - double2 sc = __libclc__sincos_piby4(a * M_PI, 0.0); - long jr = s ^ as_long(e ? sc.hi : sc.lo); - - ir = ax < 0x1.0p+52 ? jr : ir; - - return as_double(ir); -} -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, cospi, double); -#endif diff --git a/libclc/generic/lib/math/ep_log.cl b/libclc/generic/lib/math/ep_log.cl deleted file mode 100644 index 3c2c62c3d305..000000000000 --- a/libclc/generic/lib/math/ep_log.cl +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifdef cl_khr_fp64 - -#include -#include "ep_log.h" -#include "math.h" -#include "tables.h" - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -#define LN0 8.33333333333317923934e-02 -#define LN1 1.25000000037717509602e-02 -#define LN2 2.23213998791944806202e-03 -#define LN3 4.34887777707614552256e-04 - -#define LF0 8.33333333333333593622e-02 -#define LF1 1.24999999978138668903e-02 -#define LF2 2.23219810758559851206e-03 - -_CLC_DEF void __clc_ep_log(double x, int *xexp, double *r1, double *r2) -{ - // Computes natural log(x). Algorithm based on: - // Ping-Tak Peter Tang - // "Table-driven implementation of the logarithm function in IEEE - // floating-point arithmetic" - // ACM Transactions on Mathematical Software (TOMS) - // Volume 16, Issue 4 (December 1990) - int near_one = x >= 0x1.e0faap-1 & x <= 0x1.1082cp+0; - - ulong ux = as_ulong(x); - ulong uxs = as_ulong(as_double(0x03d0000000000000UL | ux) - 0x1.0p-962); - int c = ux < IMPBIT_DP64; - ux = c ? uxs : ux; - int expadjust = c ? 60 : 0; - - // Store the exponent of x in xexp and put f into the range [0.5,1) - int xexp1 = ((as_int2(ux).hi >> 20) & 0x7ff) - EXPBIAS_DP64 - expadjust; - double f = as_double(HALFEXPBITS_DP64 | (ux & MANTBITS_DP64)); - *xexp = near_one ? 0 : xexp1; - - double r = x - 1.0; - double u1 = MATH_DIVIDE(r, 2.0 + r); - double ru1 = -r * u1; - u1 = u1 + u1; - - int index = as_int2(ux).hi >> 13; - index = ((0x80 | (index & 0x7e)) >> 1) + (index & 0x1); - - double f1 = index * 0x1.0p-7; - double f2 = f - f1; - double u2 = MATH_DIVIDE(f2, fma(0.5, f2, f1)); - - double2 tv = USE_TABLE(ln_tbl, (index - 64)); - double z1 = tv.s0; - double q = tv.s1; - - z1 = near_one ? r : z1; - q = near_one ? 0.0 : q; - double u = near_one ? u1 : u2; - double v = u*u; - - double cc = near_one ? ru1 : u2; - - double z21 = fma(v, fma(v, fma(v, LN3, LN2), LN1), LN0); - double z22 = fma(v, fma(v, LF2, LF1), LF0); - double z2 = near_one ? z21 : z22; - z2 = fma(u*v, z2, cc) + q; - - *r1 = z1; - *r2 = z2; -} - -#endif diff --git a/libclc/generic/lib/math/ep_log.h b/libclc/generic/lib/math/ep_log.h deleted file mode 100644 index 7f99ac60b72f..000000000000 --- a/libclc/generic/lib/math/ep_log.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DECL void __clc_ep_log(double x, int *xexp, double *r1, double *r2); - -#endif diff --git a/libclc/generic/lib/math/erf.cl b/libclc/generic/lib/math/erf.cl deleted file mode 100644 index 3dc82d926e86..000000000000 --- a/libclc/generic/lib/math/erf.cl +++ /dev/null @@ -1,402 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== -*/ - -#define erx 8.4506291151e-01f /* 0x3f58560b */ - -// Coefficients for approximation to erf on [00.84375] - -#define efx 1.2837916613e-01f /* 0x3e0375d4 */ -#define efx8 1.0270333290e+00f /* 0x3f8375d4 */ - -#define pp0 1.2837916613e-01f /* 0x3e0375d4 */ -#define pp1 -3.2504209876e-01f /* 0xbea66beb */ -#define pp2 -2.8481749818e-02f /* 0xbce9528f */ -#define pp3 -5.7702702470e-03f /* 0xbbbd1489 */ -#define pp4 -2.3763017452e-05f /* 0xb7c756b1 */ -#define qq1 3.9791721106e-01f /* 0x3ecbbbce */ -#define qq2 6.5022252500e-02f /* 0x3d852a63 */ -#define qq3 5.0813062117e-03f /* 0x3ba68116 */ -#define qq4 1.3249473704e-04f /* 0x390aee49 */ -#define qq5 -3.9602282413e-06f /* 0xb684e21a */ - -// Coefficients for approximation to erf in [0.843751.25] - -#define pa0 -2.3621185683e-03f /* 0xbb1acdc6 */ -#define pa1 4.1485610604e-01f /* 0x3ed46805 */ -#define pa2 -3.7220788002e-01f /* 0xbebe9208 */ -#define pa3 3.1834661961e-01f /* 0x3ea2fe54 */ -#define pa4 -1.1089469492e-01f /* 0xbde31cc2 */ -#define pa5 3.5478305072e-02f /* 0x3d1151b3 */ -#define pa6 -2.1663755178e-03f /* 0xbb0df9c0 */ -#define qa1 1.0642088205e-01f /* 0x3dd9f331 */ -#define qa2 5.4039794207e-01f /* 0x3f0a5785 */ -#define qa3 7.1828655899e-02f /* 0x3d931ae7 */ -#define qa4 1.2617121637e-01f /* 0x3e013307 */ -#define qa5 1.3637083583e-02f /* 0x3c5f6e13 */ -#define qa6 1.1984500103e-02f /* 0x3c445aa3 */ - -// Coefficients for approximation to erfc in [1.251/0.35] - -#define ra0 -9.8649440333e-03f /* 0xbc21a093 */ -#define ra1 -6.9385856390e-01f /* 0xbf31a0b7 */ -#define ra2 -1.0558626175e+01f /* 0xc128f022 */ -#define ra3 -6.2375331879e+01f /* 0xc2798057 */ -#define ra4 -1.6239666748e+02f /* 0xc322658c */ -#define ra5 -1.8460508728e+02f /* 0xc3389ae7 */ -#define ra6 -8.1287437439e+01f /* 0xc2a2932b */ -#define ra7 -9.8143291473e+00f /* 0xc11d077e */ -#define sa1 1.9651271820e+01f /* 0x419d35ce */ -#define sa2 1.3765776062e+02f /* 0x4309a863 */ -#define sa3 4.3456588745e+02f /* 0x43d9486f */ -#define sa4 6.4538726807e+02f /* 0x442158c9 */ -#define sa5 4.2900814819e+02f /* 0x43d6810b */ -#define sa6 1.0863500214e+02f /* 0x42d9451f */ -#define sa7 6.5702495575e+00f /* 0x40d23f7c */ -#define sa8 -6.0424413532e-02f /* 0xbd777f97 */ - -// Coefficients for approximation to erfc in [1/.3528] - -#define rb0 -9.8649431020e-03f /* 0xbc21a092 */ -#define rb1 -7.9928326607e-01f /* 0xbf4c9dd4 */ -#define rb2 -1.7757955551e+01f /* 0xc18e104b */ -#define rb3 -1.6063638306e+02f /* 0xc320a2ea */ -#define rb4 -6.3756646729e+02f /* 0xc41f6441 */ -#define rb5 -1.0250950928e+03f /* 0xc480230b */ -#define rb6 -4.8351919556e+02f /* 0xc3f1c275 */ -#define sb1 3.0338060379e+01f /* 0x41f2b459 */ -#define sb2 3.2579251099e+02f /* 0x43a2e571 */ -#define sb3 1.5367296143e+03f /* 0x44c01759 */ -#define sb4 3.1998581543e+03f /* 0x4547fdbb */ -#define sb5 2.5530502930e+03f /* 0x451f90ce */ -#define sb6 4.7452853394e+02f /* 0x43ed43a7 */ -#define sb7 -2.2440952301e+01f /* 0xc1b38712 */ - -_CLC_OVERLOAD _CLC_DEF float erf(float x) { - int hx = as_uint(x); - int ix = hx & 0x7fffffff; - float absx = as_float(ix); - - float x2 = absx * absx; - float t = 1.0f / x2; - float tt = absx - 1.0f; - t = absx < 1.25f ? tt : t; - t = absx < 0.84375f ? x2 : t; - - float u, v, tu, tv; - - // |x| < 6 - u = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, rb6, rb5), rb4), rb3), rb2), rb1), rb0); - v = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, sb7, sb6), sb5), sb4), sb3), sb2), sb1); - - tu = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, ra7, ra6), ra5), ra4), ra3), ra2), ra1), ra0); - tv = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, sa8, sa7), sa6), sa5), sa4), sa3), sa2), sa1); - u = absx < 0x1.6db6dcp+1f ? tu : u; - v = absx < 0x1.6db6dcp+1f ? tv : v; - - tu = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, pa6, pa5), pa4), pa3), pa2), pa1), pa0); - tv = mad(t, mad(t, mad(t, mad(t, mad(t, qa6, qa5), qa4), qa3), qa2), qa1); - u = absx < 1.25f ? tu : u; - v = absx < 1.25f ? tv : v; - - tu = mad(t, mad(t, mad(t, mad(t, pp4, pp3), pp2), pp1), pp0); - tv = mad(t, mad(t, mad(t, mad(t, qq5, qq4), qq3), qq2), qq1); - u = absx < 0.84375f ? tu : u; - v = absx < 0.84375f ? tv : v; - - v = mad(t, v, 1.0f); - float q = MATH_DIVIDE(u, v); - - float ret = 1.0f; - - // |x| < 6 - float z = as_float(ix & 0xfffff000); - float r = exp(mad(-z, z, -0.5625f)) * exp(mad(z-absx, z+absx, q)); - r = 1.0f - MATH_DIVIDE(r, absx); - ret = absx < 6.0f ? r : ret; - - r = erx + q; - ret = absx < 1.25f ? r : ret; - - ret = as_float((hx & 0x80000000) | as_int(ret)); - - r = mad(x, q, x); - ret = absx < 0.84375f ? r : ret; - - // Prevent underflow - r = 0.125f * mad(8.0f, x, efx8 * x); - ret = absx < 0x1.0p-28f ? r : ret; - - ret = isnan(x) ? x : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, erf, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* double erf(double x) - * double erfc(double x) - * x - * 2 |\ - * erf(x) = --------- | exp(-t*t)dt - * sqrt(pi) \| - * 0 - * - * erfc(x) = 1-erf(x) - * Note that - * erf(-x) = -erf(x) - * erfc(-x) = 2 - erfc(x) - * - * Method: - * 1. For |x| in [0, 0.84375] - * erf(x) = x + x*R(x^2) - * erfc(x) = 1 - erf(x) if x in [-.84375,0.25] - * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375] - * where R = P/Q where P is an odd poly of degree 8 and - * Q is an odd poly of degree 10. - * -57.90 - * | R - (erf(x)-x)/x | <= 2 - * - * - * Remark. The formula is derived by noting - * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....) - * and that - * 2/sqrt(pi) = 1.128379167095512573896158903121545171688 - * is close to one. The interval is chosen because the fix - * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is - * near 0.6174), and by some experiment, 0.84375 is chosen to - * guarantee the error is less than one ulp for erf. - * - * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and - * c = 0.84506291151 rounded to single (24 bits) - * erf(x) = sign(x) * (c + P1(s)/Q1(s)) - * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0 - * 1+(c+P1(s)/Q1(s)) if x < 0 - * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06 - * Remark: here we use the taylor series expansion at x=1. - * erf(1+s) = erf(1) + s*Poly(s) - * = 0.845.. + P1(s)/Q1(s) - * That is, we use rational approximation to approximate - * erf(1+s) - (c = (single)0.84506291151) - * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] - * where - * P1(s) = degree 6 poly in s - * Q1(s) = degree 6 poly in s - * - * 3. For x in [1.25,1/0.35(~2.857143)], - * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1) - * erf(x) = 1 - erfc(x) - * where - * R1(z) = degree 7 poly in z, (z=1/x^2) - * S1(z) = degree 8 poly in z - * - * 4. For x in [1/0.35,28] - * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0 - * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6 x >= 28 - * erf(x) = sign(x) *(1 - tiny) (raise inexact) - * erfc(x) = tiny*tiny (raise underflow) if x > 0 - * = 2 - tiny if x<0 - * - * 7. Special case: - * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, - * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, - * erfc/erf(NaN) is NaN - */ - -#define AU0 -9.86494292470009928597e-03 -#define AU1 -7.99283237680523006574e-01 -#define AU2 -1.77579549177547519889e+01 -#define AU3 -1.60636384855821916062e+02 -#define AU4 -6.37566443368389627722e+02 -#define AU5 -1.02509513161107724954e+03 -#define AU6 -4.83519191608651397019e+02 - -#define AV1 3.03380607434824582924e+01 -#define AV2 3.25792512996573918826e+02 -#define AV3 1.53672958608443695994e+03 -#define AV4 3.19985821950859553908e+03 -#define AV5 2.55305040643316442583e+03 -#define AV6 4.74528541206955367215e+02 -#define AV7 -2.24409524465858183362e+01 - -#define BU0 -9.86494403484714822705e-03 -#define BU1 -6.93858572707181764372e-01 -#define BU2 -1.05586262253232909814e+01 -#define BU3 -6.23753324503260060396e+01 -#define BU4 -1.62396669462573470355e+02 -#define BU5 -1.84605092906711035994e+02 -#define BU6 -8.12874355063065934246e+01 -#define BU7 -9.81432934416914548592e+00 - -#define BV1 1.96512716674392571292e+01 -#define BV2 1.37657754143519042600e+02 -#define BV3 4.34565877475229228821e+02 -#define BV4 6.45387271733267880336e+02 -#define BV5 4.29008140027567833386e+02 -#define BV6 1.08635005541779435134e+02 -#define BV7 6.57024977031928170135e+00 -#define BV8 -6.04244152148580987438e-02 - -#define CU0 -2.36211856075265944077e-03 -#define CU1 4.14856118683748331666e-01 -#define CU2 -3.72207876035701323847e-01 -#define CU3 3.18346619901161753674e-01 -#define CU4 -1.10894694282396677476e-01 -#define CU5 3.54783043256182359371e-02 -#define CU6 -2.16637559486879084300e-03 - -#define CV1 1.06420880400844228286e-01 -#define CV2 5.40397917702171048937e-01 -#define CV3 7.18286544141962662868e-02 -#define CV4 1.26171219808761642112e-01 -#define CV5 1.36370839120290507362e-02 -#define CV6 1.19844998467991074170e-02 - -#define DU0 1.28379167095512558561e-01 -#define DU1 -3.25042107247001499370e-01 -#define DU2 -2.84817495755985104766e-02 -#define DU3 -5.77027029648944159157e-03 -#define DU4 -2.37630166566501626084e-05 - -#define DV1 3.97917223959155352819e-01 -#define DV2 6.50222499887672944485e-02 -#define DV3 5.08130628187576562776e-03 -#define DV4 1.32494738004321644526e-04 -#define DV5 -3.96022827877536812320e-06 - -_CLC_OVERLOAD _CLC_DEF double erf(double y) { - double x = fabs(y); - double x2 = x * x; - double xm1 = x - 1.0; - - // Poly variable - double t = 1.0 / x2; - t = x < 1.25 ? xm1 : t; - t = x < 0.84375 ? x2 : t; - - double u, ut, v, vt; - - // Evaluate rational poly - // XXX We need to see of we can grab 16 coefficents from a table - // faster than evaluating 3 of the poly pairs - // if (x < 6.0) - u = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, AU6, AU5), AU4), AU3), AU2), AU1), AU0); - v = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, AV7, AV6), AV5), AV4), AV3), AV2), AV1); - - ut = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, BU7, BU6), BU5), BU4), BU3), BU2), BU1), BU0); - vt = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, BV8, BV7), BV6), BV5), BV4), BV3), BV2), BV1); - u = x < 0x1.6db6ep+1 ? ut : u; - v = x < 0x1.6db6ep+1 ? vt : v; - - ut = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, CU6, CU5), CU4), CU3), CU2), CU1), CU0); - vt = fma(t, fma(t, fma(t, fma(t, fma(t, CV6, CV5), CV4), CV3), CV2), CV1); - u = x < 1.25 ? ut : u; - v = x < 1.25 ? vt : v; - - ut = fma(t, fma(t, fma(t, fma(t, DU4, DU3), DU2), DU1), DU0); - vt = fma(t, fma(t, fma(t, fma(t, DV5, DV4), DV3), DV2), DV1); - u = x < 0.84375 ? ut : u; - v = x < 0.84375 ? vt : v; - - v = fma(t, v, 1.0); - - // Compute rational approximation - double q = u / v; - - // Compute results - double z = as_double(as_long(x) & 0xffffffff00000000L); - double r = exp(-z * z - 0.5625) * exp((z - x) * (z + x) + q); - r = 1.0 - r / x; - - double ret = x < 6.0 ? r : 1.0; - - r = 8.45062911510467529297e-01 + q; - ret = x < 1.25 ? r : ret; - - q = x < 0x1.0p-28 ? 1.28379167095512586316e-01 : q; - - r = fma(x, q, x); - ret = x < 0.84375 ? r : ret; - - ret = isnan(x) ? x : ret; - - return y < 0.0 ? -ret : ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, erf, double); - -#endif diff --git a/libclc/generic/lib/math/erfc.cl b/libclc/generic/lib/math/erfc.cl deleted file mode 100644 index c322f8691b38..000000000000 --- a/libclc/generic/lib/math/erfc.cl +++ /dev/null @@ -1,413 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -#define erx_f 8.4506291151e-01f /* 0x3f58560b */ - -// Coefficients for approximation to erf on [00.84375] - -#define efx 1.2837916613e-01f /* 0x3e0375d4 */ -#define efx8 1.0270333290e+00f /* 0x3f8375d4 */ - -#define pp0 1.2837916613e-01f /* 0x3e0375d4 */ -#define pp1 -3.2504209876e-01f /* 0xbea66beb */ -#define pp2 -2.8481749818e-02f /* 0xbce9528f */ -#define pp3 -5.7702702470e-03f /* 0xbbbd1489 */ -#define pp4 -2.3763017452e-05f /* 0xb7c756b1 */ -#define qq1 3.9791721106e-01f /* 0x3ecbbbce */ -#define qq2 6.5022252500e-02f /* 0x3d852a63 */ -#define qq3 5.0813062117e-03f /* 0x3ba68116 */ -#define qq4 1.3249473704e-04f /* 0x390aee49 */ -#define qq5 -3.9602282413e-06f /* 0xb684e21a */ - -// Coefficients for approximation to erf in [0.843751.25] - -#define pa0 -2.3621185683e-03f /* 0xbb1acdc6 */ -#define pa1 4.1485610604e-01f /* 0x3ed46805 */ -#define pa2 -3.7220788002e-01f /* 0xbebe9208 */ -#define pa3 3.1834661961e-01f /* 0x3ea2fe54 */ -#define pa4 -1.1089469492e-01f /* 0xbde31cc2 */ -#define pa5 3.5478305072e-02f /* 0x3d1151b3 */ -#define pa6 -2.1663755178e-03f /* 0xbb0df9c0 */ -#define qa1 1.0642088205e-01f /* 0x3dd9f331 */ -#define qa2 5.4039794207e-01f /* 0x3f0a5785 */ -#define qa3 7.1828655899e-02f /* 0x3d931ae7 */ -#define qa4 1.2617121637e-01f /* 0x3e013307 */ -#define qa5 1.3637083583e-02f /* 0x3c5f6e13 */ -#define qa6 1.1984500103e-02f /* 0x3c445aa3 */ - -// Coefficients for approximation to erfc in [1.251/0.35] - -#define ra0 -9.8649440333e-03f /* 0xbc21a093 */ -#define ra1 -6.9385856390e-01f /* 0xbf31a0b7 */ -#define ra2 -1.0558626175e+01f /* 0xc128f022 */ -#define ra3 -6.2375331879e+01f /* 0xc2798057 */ -#define ra4 -1.6239666748e+02f /* 0xc322658c */ -#define ra5 -1.8460508728e+02f /* 0xc3389ae7 */ -#define ra6 -8.1287437439e+01f /* 0xc2a2932b */ -#define ra7 -9.8143291473e+00f /* 0xc11d077e */ -#define sa1 1.9651271820e+01f /* 0x419d35ce */ -#define sa2 1.3765776062e+02f /* 0x4309a863 */ -#define sa3 4.3456588745e+02f /* 0x43d9486f */ -#define sa4 6.4538726807e+02f /* 0x442158c9 */ -#define sa5 4.2900814819e+02f /* 0x43d6810b */ -#define sa6 1.0863500214e+02f /* 0x42d9451f */ -#define sa7 6.5702495575e+00f /* 0x40d23f7c */ -#define sa8 -6.0424413532e-02f /* 0xbd777f97 */ - -// Coefficients for approximation to erfc in [1/.3528] - -#define rb0 -9.8649431020e-03f /* 0xbc21a092 */ -#define rb1 -7.9928326607e-01f /* 0xbf4c9dd4 */ -#define rb2 -1.7757955551e+01f /* 0xc18e104b */ -#define rb3 -1.6063638306e+02f /* 0xc320a2ea */ -#define rb4 -6.3756646729e+02f /* 0xc41f6441 */ -#define rb5 -1.0250950928e+03f /* 0xc480230b */ -#define rb6 -4.8351919556e+02f /* 0xc3f1c275 */ -#define sb1 3.0338060379e+01f /* 0x41f2b459 */ -#define sb2 3.2579251099e+02f /* 0x43a2e571 */ -#define sb3 1.5367296143e+03f /* 0x44c01759 */ -#define sb4 3.1998581543e+03f /* 0x4547fdbb */ -#define sb5 2.5530502930e+03f /* 0x451f90ce */ -#define sb6 4.7452853394e+02f /* 0x43ed43a7 */ -#define sb7 -2.2440952301e+01f /* 0xc1b38712 */ - -_CLC_OVERLOAD _CLC_DEF float erfc(float x) { - int hx = as_int(x); - int ix = hx & 0x7fffffff; - float absx = as_float(ix); - - // Argument for polys - float x2 = absx * absx; - float t = 1.0f / x2; - float tt = absx - 1.0f; - t = absx < 1.25f ? tt : t; - t = absx < 0.84375f ? x2 : t; - - // Evaluate polys - float tu, tv, u, v; - - u = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, rb6, rb5), rb4), rb3), rb2), rb1), rb0); - v = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, sb7, sb6), sb5), sb4), sb3), sb2), sb1); - - tu = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, ra7, ra6), ra5), ra4), ra3), ra2), ra1), ra0); - tv = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, sa8, sa7), sa6), sa5), sa4), sa3), sa2), sa1); - u = absx < 0x1.6db6dap+1f ? tu : u; - v = absx < 0x1.6db6dap+1f ? tv : v; - - tu = mad(t, mad(t, mad(t, mad(t, mad(t, mad(t, pa6, pa5), pa4), pa3), pa2), pa1), pa0); - tv = mad(t, mad(t, mad(t, mad(t, mad(t, qa6, qa5), qa4), qa3), qa2), qa1); - u = absx < 1.25f ? tu : u; - v = absx < 1.25f ? tv : v; - - tu = mad(t, mad(t, mad(t, mad(t, pp4, pp3), pp2), pp1), pp0); - tv = mad(t, mad(t, mad(t, mad(t, qq5, qq4), qq3), qq2), qq1); - u = absx < 0.84375f ? tu : u; - v = absx < 0.84375f ? tv : v; - - v = mad(t, v, 1.0f); - - float q = MATH_DIVIDE(u, v); - - float ret = 0.0f; - - float z = as_float(ix & 0xfffff000); - float r = exp(mad(-z, z, -0.5625f)) * exp(mad(z - absx, z + absx, q)); - r = MATH_DIVIDE(r, absx); - t = 2.0f - r; - r = x < 0.0f ? t : r; - ret = absx < 28.0f ? r : ret; - - r = 1.0f - erx_f - q; - t = erx_f + q + 1.0f; - r = x < 0.0f ? t : r; - ret = absx < 1.25f ? r : ret; - - r = 0.5f - mad(x, q, x - 0.5f); - ret = absx < 0.84375f ? r : ret; - - ret = x < -6.0f ? 2.0f : ret; - - ret = isnan(x) ? x : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, erfc, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -/* - * ==================================================== - * Copyright (C) 1993 by Sun Microsystems, Inc. All rights reserved. - * - * Developed at SunPro, a Sun Microsystems, Inc. business. - * Permission to use, copy, modify, and distribute this - * software is freely granted, provided that this notice - * is preserved. - * ==================================================== - */ - -/* double erf(double x) - * double erfc(double x) - * x - * 2 |\ - * erf(x) = --------- | exp(-t*t)dt - * sqrt(pi) \| - * 0 - * - * erfc(x) = 1-erf(x) - * Note that - * erf(-x) = -erf(x) - * erfc(-x) = 2 - erfc(x) - * - * Method: - * 1. For |x| in [0, 0.84375] - * erf(x) = x + x*R(x^2) - * erfc(x) = 1 - erf(x) if x in [-.84375,0.25] - * = 0.5 + ((0.5-x)-x*R) if x in [0.25,0.84375] - * where R = P/Q where P is an odd poly of degree 8 and - * Q is an odd poly of degree 10. - * -57.90 - * | R - (erf(x)-x)/x | <= 2 - * - * - * Remark. The formula is derived by noting - * erf(x) = (2/sqrt(pi))*(x - x^3/3 + x^5/10 - x^7/42 + ....) - * and that - * 2/sqrt(pi) = 1.128379167095512573896158903121545171688 - * is close to one. The interval is chosen because the fix - * point of erf(x) is near 0.6174 (i.e., erf(x)=x when x is - * near 0.6174), and by some experiment, 0.84375 is chosen to - * guarantee the error is less than one ulp for erf. - * - * 2. For |x| in [0.84375,1.25], let s = |x| - 1, and - * c = 0.84506291151 rounded to single (24 bits) - * erf(x) = sign(x) * (c + P1(s)/Q1(s)) - * erfc(x) = (1-c) - P1(s)/Q1(s) if x > 0 - * 1+(c+P1(s)/Q1(s)) if x < 0 - * |P1/Q1 - (erf(|x|)-c)| <= 2**-59.06 - * Remark: here we use the taylor series expansion at x=1. - * erf(1+s) = erf(1) + s*Poly(s) - * = 0.845.. + P1(s)/Q1(s) - * That is, we use rational approximation to approximate - * erf(1+s) - (c = (single)0.84506291151) - * Note that |P1/Q1|< 0.078 for x in [0.84375,1.25] - * where - * P1(s) = degree 6 poly in s - * Q1(s) = degree 6 poly in s - * - * 3. For x in [1.25,1/0.35(~2.857143)], - * erfc(x) = (1/x)*exp(-x*x-0.5625+R1/S1) - * erf(x) = 1 - erfc(x) - * where - * R1(z) = degree 7 poly in z, (z=1/x^2) - * S1(z) = degree 8 poly in z - * - * 4. For x in [1/0.35,28] - * erfc(x) = (1/x)*exp(-x*x-0.5625+R2/S2) if x > 0 - * = 2.0 - (1/x)*exp(-x*x-0.5625+R2/S2) if -6 x >= 28 - * erf(x) = sign(x) *(1 - tiny) (raise inexact) - * erfc(x) = tiny*tiny (raise underflow) if x > 0 - * = 2 - tiny if x<0 - * - * 7. Special case: - * erf(0) = 0, erf(inf) = 1, erf(-inf) = -1, - * erfc(0) = 1, erfc(inf) = 0, erfc(-inf) = 2, - * erfc/erf(NaN) is NaN - */ - -#define AU0 -9.86494292470009928597e-03 -#define AU1 -7.99283237680523006574e-01 -#define AU2 -1.77579549177547519889e+01 -#define AU3 -1.60636384855821916062e+02 -#define AU4 -6.37566443368389627722e+02 -#define AU5 -1.02509513161107724954e+03 -#define AU6 -4.83519191608651397019e+02 - -#define AV0 3.03380607434824582924e+01 -#define AV1 3.25792512996573918826e+02 -#define AV2 1.53672958608443695994e+03 -#define AV3 3.19985821950859553908e+03 -#define AV4 2.55305040643316442583e+03 -#define AV5 4.74528541206955367215e+02 -#define AV6 -2.24409524465858183362e+01 - -#define BU0 -9.86494403484714822705e-03 -#define BU1 -6.93858572707181764372e-01 -#define BU2 -1.05586262253232909814e+01 -#define BU3 -6.23753324503260060396e+01 -#define BU4 -1.62396669462573470355e+02 -#define BU5 -1.84605092906711035994e+02 -#define BU6 -8.12874355063065934246e+01 -#define BU7 -9.81432934416914548592e+00 - -#define BV0 1.96512716674392571292e+01 -#define BV1 1.37657754143519042600e+02 -#define BV2 4.34565877475229228821e+02 -#define BV3 6.45387271733267880336e+02 -#define BV4 4.29008140027567833386e+02 -#define BV5 1.08635005541779435134e+02 -#define BV6 6.57024977031928170135e+00 -#define BV7 -6.04244152148580987438e-02 - -#define CU0 -2.36211856075265944077e-03 -#define CU1 4.14856118683748331666e-01 -#define CU2 -3.72207876035701323847e-01 -#define CU3 3.18346619901161753674e-01 -#define CU4 -1.10894694282396677476e-01 -#define CU5 3.54783043256182359371e-02 -#define CU6 -2.16637559486879084300e-03 - -#define CV0 1.06420880400844228286e-01 -#define CV1 5.40397917702171048937e-01 -#define CV2 7.18286544141962662868e-02 -#define CV3 1.26171219808761642112e-01 -#define CV4 1.36370839120290507362e-02 -#define CV5 1.19844998467991074170e-02 - -#define DU0 1.28379167095512558561e-01 -#define DU1 -3.25042107247001499370e-01 -#define DU2 -2.84817495755985104766e-02 -#define DU3 -5.77027029648944159157e-03 -#define DU4 -2.37630166566501626084e-05 - -#define DV0 3.97917223959155352819e-01 -#define DV1 6.50222499887672944485e-02 -#define DV2 5.08130628187576562776e-03 -#define DV3 1.32494738004321644526e-04 -#define DV4 -3.96022827877536812320e-06 - -_CLC_OVERLOAD _CLC_DEF double erfc(double x) { - long lx = as_long(x); - long ax = lx & 0x7fffffffffffffffL; - double absx = as_double(ax); - int xneg = lx != ax; - - // Poly arg - double x2 = x * x; - double xm1 = absx - 1.0; - double t = 1.0 / x2; - t = absx < 1.25 ? xm1 : t; - t = absx < 0.84375 ? x2 : t; - - - // Evaluate rational poly - // XXX Need to evaluate if we can grab the 14 coefficients from a - // table faster than evaluating 3 pairs of polys - double tu, tv, u, v; - - // |x| < 28 - u = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, AU6, AU5), AU4), AU3), AU2), AU1), AU0); - v = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, AV6, AV5), AV4), AV3), AV2), AV1), AV0); - - tu = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, BU7, BU6), BU5), BU4), BU3), BU2), BU1), BU0); - tv = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, BV7, BV6), BV5), BV4), BV3), BV2), BV1), BV0); - u = absx < 0x1.6db6dp+1 ? tu : u; - v = absx < 0x1.6db6dp+1 ? tv : v; - - tu = fma(t, fma(t, fma(t, fma(t, fma(t, fma(t, CU6, CU5), CU4), CU3), CU2), CU1), CU0); - tv = fma(t, fma(t, fma(t, fma(t, fma(t, CV5, CV4), CV3), CV2), CV1), CV0); - u = absx < 1.25 ? tu : u; - v = absx < 1.25 ? tv : v; - - tu = fma(t, fma(t, fma(t, fma(t, DU4, DU3), DU2), DU1), DU0); - tv = fma(t, fma(t, fma(t, fma(t, DV4, DV3), DV2), DV1), DV0); - u = absx < 0.84375 ? tu : u; - v = absx < 0.84375 ? tv : v; - - v = fma(t, v, 1.0); - double q = u / v; - - - // Evaluate return value - - // |x| < 28 - double z = as_double(ax & 0xffffffff00000000UL); - double ret = exp(-z * z - 0.5625) * exp((z - absx) * (z + absx) + q) / absx; - t = 2.0 - ret; - ret = xneg ? t : ret; - - const double erx = 8.45062911510467529297e-01; - z = erx + q + 1.0; - t = 1.0 - erx - q; - t = xneg ? z : t; - ret = absx < 1.25 ? t : ret; - - // z = 1.0 - fma(x, q, x); - // t = 0.5 - fma(x, q, x - 0.5); - // t = xneg == 1 | absx < 0.25 ? z : t; - t = fma(-x, q, 1.0 - x); - ret = absx < 0.84375 ? t : ret; - - ret = x >= 28.0 ? 0.0 : ret; - ret = x <= -6.0 ? 2.0 : ret; - ret = ax > 0x7ff0000000000000UL ? x : ret; - - return ret; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, erfc, double); - -#endif diff --git a/libclc/generic/lib/math/exp.cl b/libclc/generic/lib/math/exp.cl deleted file mode 100644 index 37f693c39be2..000000000000 --- a/libclc/generic/lib/math/exp.cl +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float exp(float x) { - - // Reduce x - const float ln2HI = 0x1.62e300p-1f; - const float ln2LO = 0x1.2fefa2p-17f; - const float invln2 = 0x1.715476p+0f; - - float fhalF = x < 0.0f ? -0.5f : 0.5f; - int p = mad(x, invln2, fhalF); - float fp = (float)p; - float hi = mad(fp, -ln2HI, x); // t*ln2HI is exact here - float lo = -fp*ln2LO; - - // Evaluate poly - float t = hi + lo; - float tt = t*t; - float v = mad(tt, - -mad(tt, - mad(tt, - mad(tt, - mad(tt, 0x1.637698p-25f, -0x1.bbd41cp-20f), - 0x1.1566aap-14f), - -0x1.6c16c2p-9f), - 0x1.555556p-3f), - t); - - float y = 1.0f - (((-lo) - MATH_DIVIDE(t * v, 2.0f - v)) - hi); - - // Scale by 2^p - float r = as_float(as_int(y) + (p << 23)); - - const float ulim = 0x1.62e430p+6f; // ln(largest_normal) = 88.72283905206835305366 - const float llim = -0x1.5d589ep+6f; // ln(smallest_normal) = -87.33654475055310898657 - - r = x < llim ? 0.0f : r; - r = x < ulim ? r : as_float(0x7f800000); - return isnan(x) ? x : r; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, exp, float) - -#ifdef cl_khr_fp64 - -#include "exp_helper.h" - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double exp(double x) { - - const double X_MIN = -0x1.74910d52d3051p+9; // -1075*ln(2) - const double X_MAX = 0x1.62e42fefa39efp+9; // 1024*ln(2) - const double R_64_BY_LOG2 = 0x1.71547652b82fep+6; // 64/ln(2) - const double R_LOG2_BY_64_LD = 0x1.62e42fefa0000p-7; // head ln(2)/64 - const double R_LOG2_BY_64_TL = 0x1.cf79abc9e3b39p-46; // tail ln(2)/64 - - int n = convert_int(x * R_64_BY_LOG2); - double r = fma(-R_LOG2_BY_64_TL, (double)n, fma(-R_LOG2_BY_64_LD, (double)n, x)); - return __clc_exp_helper(x, X_MIN, X_MAX, r, n); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, exp, double) - -#endif diff --git a/libclc/generic/lib/math/exp10.cl b/libclc/generic/lib/math/exp10.cl deleted file mode 100644 index c8039cb8dedc..000000000000 --- a/libclc/generic/lib/math/exp10.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/exp10.inc b/libclc/generic/lib/math/exp10.inc deleted file mode 100644 index a592c1948799..000000000000 --- a/libclc/generic/lib/math/exp10.inc +++ /dev/null @@ -1,10 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE exp10(__CLC_GENTYPE val) { - // exp10(x) = exp2(x * log2(10)) -#if __CLC_FPSIZE == 32 - return exp2(val * log2(10.0f)); -#elif __CLC_FPSIZE == 64 - return exp2(val * log2(10.0)); -#else -#error unknown _CLC_FPSIZE -#endif -} diff --git a/libclc/generic/lib/math/exp2.cl b/libclc/generic/lib/math/exp2.cl deleted file mode 100644 index 1ddccbd3ee65..000000000000 --- a/libclc/generic/lib/math/exp2.cl +++ /dev/null @@ -1,86 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float exp2(float x) { - - // Reduce x - const float ln2HI = 0x1.62e300p-1f; - const float ln2LO = 0x1.2fefa2p-17f; - - float t = rint(x); - int p = (int)t; - float tt = x - t; - float hi = tt * ln2HI; - float lo = tt * ln2LO; - - // Evaluate poly - t = hi + lo; - tt = t*t; - float v = mad(tt, - -mad(tt, - mad(tt, - mad(tt, - mad(tt, 0x1.637698p-25f, -0x1.bbd41cp-20f), - 0x1.1566aap-14f), - -0x1.6c16c2p-9f), - 0x1.555556p-3f), - t); - - float y = 1.0f - (((-lo) - MATH_DIVIDE(t * v, 2.0f - v)) - hi); - - // Scale by 2^p - float r = as_float(as_int(y) + (p << 23)); - - const float ulim = 128.0f; - const float llim = -126.0f; - - r = x < llim ? 0.0f : r; - r = x < ulim ? r : as_float(0x7f800000); - return isnan(x) ? x : r; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, exp2, float) - -#ifdef cl_khr_fp64 - -#include "exp_helper.h" - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double exp2(double x) { - const double R_LN2 = 0x1.62e42fefa39efp-1; // ln(2) - const double R_1_BY_64 = 1.0 / 64.0; - - int n = convert_int(x * 64.0); - double r = R_LN2 * fma(-R_1_BY_64, (double)n, x); - return __clc_exp_helper(x, -1074.0, 1024.0, r, n); -} - - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, exp2, double) - -#endif diff --git a/libclc/generic/lib/math/exp_helper.cl b/libclc/generic/lib/math/exp_helper.cl deleted file mode 100644 index 046f306466bc..000000000000 --- a/libclc/generic/lib/math/exp_helper.cl +++ /dev/null @@ -1,69 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "tables.h" - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEF double __clc_exp_helper(double x, double x_min, double x_max, double r, int n) { - - int j = n & 0x3f; - int m = n >> 6; - - // 6 term tail of Taylor expansion of e^r - double z2 = r * fma(r, - fma(r, - fma(r, - fma(r, - fma(r, 0x1.6c16c16c16c17p-10, 0x1.1111111111111p-7), - 0x1.5555555555555p-5), - 0x1.5555555555555p-3), - 0x1.0000000000000p-1), - 1.0); - - double2 tv = USE_TABLE(two_to_jby64_ep_tbl, j); - z2 = fma(tv.s0 + tv.s1, z2, tv.s1) + tv.s0; - - int small_value = (m < -1022) || ((m == -1022) && (z2 < 1.0)); - - int n1 = m >> 2; - int n2 = m-n1; - double z3= z2 * as_double(((long)n1 + 1023) << 52); - z3 *= as_double(((long)n2 + 1023) << 52); - - z2 = ldexp(z2, m); - z2 = small_value ? z3: z2; - - z2 = isnan(x) ? x : z2; - - z2 = x > x_max ? as_double(PINFBITPATT_DP64) : z2; - z2 = x < x_min ? 0.0 : z2; - - return z2; -} - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/exp_helper.h b/libclc/generic/lib/math/exp_helper.h deleted file mode 100644 index e6df2fd905b5..000000000000 --- a/libclc/generic/lib/math/exp_helper.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014, 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -_CLC_DECL double __clc_exp_helper(double x, double x_min, double x_max, double r, int n); - -#endif diff --git a/libclc/generic/lib/math/fdim.cl b/libclc/generic/lib/math/fdim.cl deleted file mode 100644 index cf25a4ad8366..000000000000 --- a/libclc/generic/lib/math/fdim.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "math.h" - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/fdim.inc b/libclc/generic/lib/math/fdim.inc deleted file mode 100644 index 9aa3496b1890..000000000000 --- a/libclc/generic/lib/math/fdim.inc +++ /dev/null @@ -1,71 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * Copyright (c) 2016 Aaron Watry - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#if __CLC_FPSIZE == 32 -#ifdef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fdim(__CLC_GENTYPE x, __CLC_GENTYPE y) { - if (__builtin_isnan(x) || __builtin_isnan(y)) - return as_float(QNANBITPATT_SP32); - return fmax(x - y, 0.0f); -} -#define __CLC_FDIM_VEC(width) \ -_CLC_OVERLOAD _CLC_DEF float##width fdim(float##width x, float##width y) { \ - /* Determine if x or y is NaN. */ \ - /* Vector true is -1, i.e. all-bits-set, and NaN==NaN is false. */ \ - /* If either is NaN, then ~((x==x) & (y==y)) will be 0 (e.g. ~(-1)), as will n. */ \ - int##width n = ~((x == x) & (y == y)) & QNANBITPATT_SP32; \ - /* Calculate x-y if x>y, otherwise positive 0, again taking */ \ - /* advantage of vector true being all-bits-set. */ \ - int##width r = (x > y) & as_int##width(x - y); \ - return as_float##width(n | r); \ -} -__CLC_FDIM_VEC(2) -__CLC_FDIM_VEC(3) -__CLC_FDIM_VEC(4) -__CLC_FDIM_VEC(8) -__CLC_FDIM_VEC(16) -#undef __CLC_FDIM_VEC -#endif -#endif - -#if __CLC_FPSIZE == 64 -#ifdef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fdim(__CLC_GENTYPE x, private __CLC_GENTYPE y) { - long n = -(isnan(x) | isnan(y)) & QNANBITPATT_DP64; - long r = -(x > y) & as_long(x - y); - return as_double(n | r); -} -#define __CLC_FDIM_VEC(width) \ -_CLC_OVERLOAD _CLC_DEF double##width fdim(double##width x, double##width y) { \ - /* See comment in float implementation for explanation. */ \ - long##width n = ~((x == x) & (y == y)) & QNANBITPATT_DP64; \ - long##width r = (x > y) & as_long##width(x - y); \ - return as_double##width(n | r); \ -} -__CLC_FDIM_VEC(2) -__CLC_FDIM_VEC(3) -__CLC_FDIM_VEC(4) -__CLC_FDIM_VEC(8) -__CLC_FDIM_VEC(16) -#undef __CLC_FDIM_VEC -#endif -#endif diff --git a/libclc/generic/lib/math/fmax.cl b/libclc/generic/lib/math/fmax.cl deleted file mode 100644 index 239da3d3a615..000000000000 --- a/libclc/generic/lib/math/fmax.cl +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "../clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, fmax, __builtin_fmaxf, float, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, fmax, __builtin_fmax, double, double); - -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/fmax.inc b/libclc/generic/lib/math/fmax.inc deleted file mode 100644 index 8315c5fb6e09..000000000000 --- a/libclc/generic/lib/math/fmax.inc +++ /dev/null @@ -1,18 +0,0 @@ - -#if !defined(__CLC_SCALAR) - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmax(__CLC_GENTYPE x, float y) { - return fmax(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y)); -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmax(__CLC_GENTYPE x, double y) { - return fmax(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y)); -} - -#endif // ifdef cl_khr_fp64 - -#endif // !defined(__CLC_SCALAR) diff --git a/libclc/generic/lib/math/fmin.cl b/libclc/generic/lib/math/fmin.cl deleted file mode 100644 index 28c7d0125a93..000000000000 --- a/libclc/generic/lib/math/fmin.cl +++ /dev/null @@ -1,16 +0,0 @@ -#include - -#include "../clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, fmin, __builtin_fminf, float, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, fmin, __builtin_fmin, double, double); - -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/fmin.inc b/libclc/generic/lib/math/fmin.inc deleted file mode 100644 index d4b5ac2d62a7..000000000000 --- a/libclc/generic/lib/math/fmin.inc +++ /dev/null @@ -1,18 +0,0 @@ - -#if !defined(__CLC_SCALAR) - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmin(__CLC_GENTYPE x, float y) { - return fmin(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y)); -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fmin(__CLC_GENTYPE x, double y) { - return fmin(x, (__CLC_GENTYPE)((__CLC_SCALAR_GENTYPE)y)); -} - -#endif // ifdef cl_khr_fp64 - -#endif // !defined(__CLC_SCALAR) diff --git a/libclc/generic/lib/math/fmod.cl b/libclc/generic/lib/math/fmod.cl deleted file mode 100644 index f9a4e3176137..000000000000 --- a/libclc/generic/lib/math/fmod.cl +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "../clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, fmod, __builtin_fmodf, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, fmod, __builtin_fmod, double, double) - -#endif diff --git a/libclc/generic/lib/math/fract.cl b/libclc/generic/lib/math/fract.cl deleted file mode 100644 index b4340710145d..000000000000 --- a/libclc/generic/lib/math/fract.cl +++ /dev/null @@ -1,30 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/fract.inc b/libclc/generic/lib/math/fract.inc deleted file mode 100644 index 8d2a4d707a9d..000000000000 --- a/libclc/generic/lib/math/fract.inc +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#if __CLC_FPSIZE == 32 -#define MIN_CONSTANT 0x1.fffffep-1f -#else -#define MIN_CONSTANT 0x1.fffffffffffffp-1 -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fract(__CLC_GENTYPE x, private __CLC_GENTYPE *iptr) { - *iptr = floor(x); - __CLC_GENTYPE r = fmin(x - *iptr, MIN_CONSTANT); - r = isinf(x) ? 0.0f : r; - r = isnan(x) ? x : r; - return r; -} - - -#define FRACT_DEF(addrspace) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE fract(__CLC_GENTYPE x, addrspace __CLC_GENTYPE *iptr) { \ - __CLC_GENTYPE private_iptr; \ - __CLC_GENTYPE ret = fract(x, &private_iptr); \ - *iptr = private_iptr; \ - return ret; \ - } - -FRACT_DEF(local); -FRACT_DEF(global); - -#undef MIN_CONSTANT diff --git a/libclc/generic/lib/math/frexp.cl b/libclc/generic/lib/math/frexp.cl deleted file mode 100644 index acd5d93b0b23..000000000000 --- a/libclc/generic/lib/math/frexp.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -#include "math.h" - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/frexp.inc b/libclc/generic/lib/math/frexp.inc deleted file mode 100644 index 0f5ddea2b028..000000000000 --- a/libclc/generic/lib/math/frexp.inc +++ /dev/null @@ -1,110 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * Copyright (c) 2016 Aaron Watry - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ -#if __CLC_FPSIZE == 32 -#ifdef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE frexp(float x, private int *ep) { - int i = as_int(x); - int ai = i & 0x7fffffff; - int d = ai > 0 & ai < 0x00800000; - // scale subnormal by 2^26 without multiplying - float s = as_float(ai | 0x0d800000) - 0x1.0p-100F; - ai = d ? as_int(s) : ai; - int e = (ai >> 23) - 126 - (d ? 26 : 0); - int t = ai == 0 | e == 129; - i = (i & 0x80000000) | 0x3f000000 | (ai & 0x007fffff); - *ep = t ? 0 : e; - return t ? x : as_float(i); -} -#define __CLC_FREXP_VEC(width) \ -_CLC_OVERLOAD _CLC_DEF float##width frexp(float##width x, private int##width *ep) { \ - int##width i = as_int##width(x); \ - int##width ai = i & 0x7fffffff; \ - int##width d = ai > 0 & ai < 0x00800000; \ - /* scale subnormal by 2^26 without multiplying */ \ - float##width s = as_float##width(ai | 0x0d800000) - 0x1.0p-100F; \ - ai = bitselect(ai, as_int##width(s), d); \ - int##width e = (ai >> 23) - 126 - bitselect((int##width)0, (int##width)26, d); \ - int##width t = ai == (int##width)0 | e == (int##width)129; \ - i = (i & (int##width)0x80000000) | (int##width)0x3f000000 | (ai & 0x007fffff); \ - *ep = bitselect(e, (int##width)0, t); \ - return bitselect(as_float##width(i), x, as_float##width(t)); \ -} -__CLC_FREXP_VEC(2) -__CLC_FREXP_VEC(3) -__CLC_FREXP_VEC(4) -__CLC_FREXP_VEC(8) -__CLC_FREXP_VEC(16) -#undef __CLC_FREXP_VEC -#endif -#endif - -#if __CLC_FPSIZE == 64 -#ifdef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE frexp(__CLC_GENTYPE x, private __CLC_INTN *ep) { - long i = as_long(x); - long ai = i & 0x7fffffffffffffffL; - int d = ai > 0 & ai < 0x0010000000000000L; - // scale subnormal by 2^54 without multiplying - double s = as_double(ai | 0x0370000000000000L) - 0x1.0p-968; - ai = d ? as_long(s) : ai; - int e = (int)(ai >> 52) - 1022 - (d ? 54 : 0); - int t = ai == 0 | e == 1025; - i = (i & 0x8000000000000000L) | 0x3fe0000000000000L | (ai & 0x000fffffffffffffL); - *ep = t ? 0 : e; - return t ? x : as_double(i); -} -#define __CLC_FREXP_VEC(width) \ -_CLC_OVERLOAD _CLC_DEF double##width frexp(double##width x, private int##width *ep) { \ - long##width i = as_long##width(x); \ - long##width ai = i & 0x7fffffffffffffffL; \ - long##width d = ai > 0 & ai < 0x0010000000000000L; \ - /* scale subnormal by 2^54 without multiplying */ \ - double##width s = as_double##width(ai | 0x0370000000000000L) - 0x1.0p-968; \ - ai = bitselect(ai, as_long##width(s), d); \ - int##width e = convert_int##width(ai >> 52) - 1022 - bitselect((int##width)0, (int##width)54, convert_int##width(d)); \ - int##width t = convert_int##width(ai == (long##width)0) | (e == (int##width)129); \ - i = (i & (long##width)0x8000000000000000L) | (long##width)0x3fe0000000000000L | (ai & 0x000fffffffffffffL); \ - *ep = bitselect(e, (int##width)0, t); \ - return bitselect(as_double##width(i), x, as_double##width(convert_long##width(t))); \ -} -__CLC_FREXP_VEC(2) -__CLC_FREXP_VEC(3) -__CLC_FREXP_VEC(4) -__CLC_FREXP_VEC(8) -__CLC_FREXP_VEC(16) -#undef __CLC_FREXP_VEC -#endif -#endif - -#define __CLC_FREXP_DEF(addrspace) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE frexp(__CLC_GENTYPE x, addrspace __CLC_INTN *iptr) { \ - __CLC_INTN private_iptr; \ - __CLC_GENTYPE ret = frexp(x, &private_iptr); \ - *iptr = private_iptr; \ - return ret; \ -} - -__CLC_FREXP_DEF(local); -__CLC_FREXP_DEF(global); - -#undef __CLC_FREXP_DEF diff --git a/libclc/generic/lib/math/half_rsqrt.cl b/libclc/generic/lib/math/half_rsqrt.cl deleted file mode 100644 index 726f65c1dcec..000000000000 --- a/libclc/generic/lib/math/half_rsqrt.cl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/lib/math/half_rsqrt.inc b/libclc/generic/lib/math/half_rsqrt.inc deleted file mode 100644 index 33ce6c282d35..000000000000 --- a/libclc/generic/lib/math/half_rsqrt.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE half_rsqrt(__CLC_GENTYPE val) { - return rsqrt(val); -} diff --git a/libclc/generic/lib/math/half_sqrt.cl b/libclc/generic/lib/math/half_sqrt.cl deleted file mode 100644 index a02896aa290d..000000000000 --- a/libclc/generic/lib/math/half_sqrt.cl +++ /dev/null @@ -1,28 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#define __CLC_BODY -#define __FLOAT_ONLY -#include -#undef __FLOAT_ONLY diff --git a/libclc/generic/lib/math/half_sqrt.inc b/libclc/generic/lib/math/half_sqrt.inc deleted file mode 100644 index bcdc6a97b26a..000000000000 --- a/libclc/generic/lib/math/half_sqrt.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE half_sqrt(__CLC_GENTYPE val) { - return sqrt(val); -} diff --git a/libclc/generic/lib/math/hypot.cl b/libclc/generic/lib/math/hypot.cl deleted file mode 100644 index eca042c91535..000000000000 --- a/libclc/generic/lib/math/hypot.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/hypot.inc b/libclc/generic/lib/math/hypot.inc deleted file mode 100644 index 036cee7e1f06..000000000000 --- a/libclc/generic/lib/math/hypot.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE hypot(__CLC_GENTYPE x, __CLC_GENTYPE y) { - return sqrt(x*x + y*y); -} diff --git a/libclc/generic/lib/math/ilogb.cl b/libclc/generic/lib/math/ilogb.cl deleted file mode 100644 index 7ab7899e0c59..000000000000 --- a/libclc/generic/lib/math/ilogb.cl +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * Copyright (c) 2016 Aaron Watry - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "../clcmacro.h" -#include "math.h" - -_CLC_OVERLOAD _CLC_DEF int ilogb(float x) { - uint ux = as_uint(x); - uint ax = ux & EXSIGNBIT_SP32; - int rs = -118 - (int) clz(ux & MANTBITS_SP32); - int r = (int) (ax >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32; - r = ax < 0x00800000U ? rs : r; - r = ax > EXPBITS_SP32 | ax == 0 ? 0x80000000 : r; - r = ax == EXPBITS_SP32 ? 0x7fffffff : r; - return r; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, ilogb, float); - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF int ilogb(double x) { - ulong ux = as_ulong(x); - ulong ax = ux & ~SIGNBIT_DP64; - int r = (int) (ax >> EXPSHIFTBITS_DP64) - EXPBIAS_DP64; - int rs = -1011 - (int) clz(ax & MANTBITS_DP64); - r = ax < 0x0010000000000000UL ? rs : r; - r = ax > 0x7ff0000000000000UL | ax == 0UL ? 0x80000000 : r; - r = ax == 0x7ff0000000000000UL ? 0x7fffffff : r; - return r; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, int, ilogb, double); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/ldexp.cl b/libclc/generic/lib/math/ldexp.cl deleted file mode 100644 index 9be3127f46bc..000000000000 --- a/libclc/generic/lib/math/ldexp.cl +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "config.h" -#include "../clcmacro.h" -#include "math.h" -#include "math/clc_ldexp.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, ldexp, __clc_ldexp, float, int) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, ldexp, __clc_ldexp, double, int) - -#endif - -// This defines all the ldexp(GENTYPE, int) variants -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/ldexp.inc b/libclc/generic/lib/math/ldexp.inc deleted file mode 100644 index 6e28fbb94ca4..000000000000 --- a/libclc/generic/lib/math/ldexp.inc +++ /dev/null @@ -1,29 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#ifndef __CLC_SCALAR - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE ldexp(__CLC_GENTYPE x, int n) { - return ldexp(x, (__CLC_INTN)n); -} - -#endif diff --git a/libclc/generic/lib/math/log.cl b/libclc/generic/lib/math/log.cl deleted file mode 100644 index ec1faa12606a..000000000000 --- a/libclc/generic/lib/math/log.cl +++ /dev/null @@ -1,26 +0,0 @@ -#include -#include "../clcmacro.h" - -/* - *log(x) = log2(x) * (1/log2(e)) - */ - -_CLC_OVERLOAD _CLC_DEF float log(float x) -{ - return log2(x) * (1.0f / M_LOG2E_F); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, log, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double log(double x) -{ - return log2(x) * (1.0 / M_LOG2E); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, log, double); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/log10.cl b/libclc/generic/lib/math/log10.cl deleted file mode 100644 index d65764a894b3..000000000000 --- a/libclc/generic/lib/math/log10.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/log10.inc b/libclc/generic/lib/math/log10.inc deleted file mode 100644 index 423308a05ad2..000000000000 --- a/libclc/generic/lib/math/log10.inc +++ /dev/null @@ -1,13 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE log10(__CLC_GENTYPE val) { - // log10(x) = log2(x) / log2(10) - // 1 / log2(10) = 0.30102999566 = log10(2) - // SP representation is 0.30103 (0x1.344136p-2) - // DP representation is 0.301029995659999993762312442414(0x1.34413509E61D8p-2) -#if __CLC_FPSIZE == 32 - return log2(val) * 0x1.344136p-2f; -#elif __CLC_FPSIZE == 64 - return log2(val) * 0x1.34413509E61D8p-2; -#else -#error unknown _CLC_FPSIZE -#endif -} diff --git a/libclc/generic/lib/math/log1p.cl b/libclc/generic/lib/math/log1p.cl deleted file mode 100644 index be25c64bf6a4..000000000000 --- a/libclc/generic/lib/math/log1p.cl +++ /dev/null @@ -1,177 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "tables.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float log1p(float x) -{ - float w = x; - uint ux = as_uint(x); - uint ax = ux & EXSIGNBIT_SP32; - - // |x| < 2^-4 - float u2 = MATH_DIVIDE(x, 2.0f + x); - float u = u2 + u2; - float v = u * u; - // 2/(5 * 2^5), 2/(3 * 2^3) - float zsmall = mad(-u2, x, mad(v, 0x1.99999ap-7f, 0x1.555556p-4f) * v * u) + x; - - // |x| >= 2^-4 - ux = as_uint(x + 1.0f); - - int m = (int)((ux >> EXPSHIFTBITS_SP32) & 0xff) - EXPBIAS_SP32; - float mf = (float)m; - uint indx = (ux & 0x007f0000) + ((ux & 0x00008000) << 1); - float F = as_float(indx | 0x3f000000); - - // x > 2^24 - float fg24 = F - as_float(0x3f000000 | (ux & MANTBITS_SP32)); - - // x <= 2^24 - uint xhi = ux & 0xffff8000; - float xh = as_float(xhi); - float xt = (1.0f - xh) + w; - uint xnm = ((~(xhi & 0x7f800000)) - 0x00800000) & 0x7f800000; - xt = xt * as_float(xnm) * 0.5f; - float fl24 = F - as_float(0x3f000000 | (xhi & MANTBITS_SP32)) - xt; - - float f = mf > 24.0f ? fg24 : fl24; - - indx = indx >> 16; - float r = f * USE_TABLE(log_inv_tbl, indx); - - // 1/3, 1/2 - float poly = mad(mad(r, 0x1.555556p-2f, 0x1.0p-1f), r*r, r); - - const float LOG2_HEAD = 0x1.62e000p-1f; // 0.693115234 - const float LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 - - float2 tv = USE_TABLE(loge_tbl, indx); - float z1 = mad(mf, LOG2_HEAD, tv.s0); - float z2 = mad(mf, LOG2_TAIL, -poly) + tv.s1; - float z = z1 + z2; - - z = ax < 0x3d800000U ? zsmall : z; - - - - // Edge cases - z = ax >= PINFBITPATT_SP32 ? w : z; - z = w < -1.0f ? as_float(QNANBITPATT_SP32) : z; - z = w == -1.0f ? as_float(NINFBITPATT_SP32) : z; - //fix subnormals - z = ax < 0x33800000 ? x : z; - - return z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, log1p, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double log1p(double x) -{ - // Computes natural log(1+x). Algorithm based on: - // Ping-Tak Peter Tang - // "Table-driven implementation of the logarithm function in IEEE - // floating-point arithmetic" - // ACM Transactions on Mathematical Software (TOMS) - // Volume 16, Issue 4 (December 1990) - // Note that we use a lookup table of size 64 rather than 128, - // and compensate by having extra terms in the minimax polynomial - // for the kernel approximation. - - // Process Inside the threshold now - ulong ux = as_ulong(1.0 + x); - int xexp = ((as_int2(ux).hi >> 20) & 0x7ff) - EXPBIAS_DP64; - double f = as_double(ONEEXPBITS_DP64 | (ux & MANTBITS_DP64)); - - int j = as_int2(ux).hi >> 13; - j = ((0x80 | (j & 0x7e)) >> 1) + (j & 0x1); - double f1 = (double)j * 0x1.0p-6; - j -= 64; - - double f2temp = f - f1; - double m2 = as_double(convert_ulong(0x3ff - xexp) << EXPSHIFTBITS_DP64); - double f2l = fma(m2, x, m2 - f1); - double f2g = fma(m2, x, -f1) + m2; - double f2 = xexp <= MANTLENGTH_DP64-1 ? f2l : f2g; - f2 = (xexp <= -2) | (xexp >= MANTLENGTH_DP64+8) ? f2temp : f2; - - double2 tv = USE_TABLE(ln_tbl, j); - double z1 = tv.s0; - double q = tv.s1; - - double u = MATH_DIVIDE(f2, fma(0.5, f2, f1)); - double v = u * u; - - double poly = v * fma(v, - fma(v, 2.23219810758559851206e-03, 1.24999999978138668903e-02), - 8.33333333333333593622e-02); - - // log2_lead and log2_tail sum to an extra-precise version of log(2) - const double log2_lead = 6.93147122859954833984e-01; /* 0x3fe62e42e0000000 */ - const double log2_tail = 5.76999904754328540596e-08; /* 0x3e6efa39ef35793c */ - - double z2 = q + fma(u, poly, u); - double dxexp = (double)xexp; - double r1 = fma(dxexp, log2_lead, z1); - double r2 = fma(dxexp, log2_tail, z2); - double result1 = r1 + r2; - - // Process Outside the threshold now - double r = x; - u = r / (2.0 + r); - double correction = r * u; - u = u + u; - v = u * u; - r1 = r; - - poly = fma(v, - fma(v, - fma(v, 4.34887777707614552256e-04, 2.23213998791944806202e-03), - 1.25000000037717509602e-02), - 8.33333333333317923934e-02); - - r2 = fma(u*v, poly, -correction); - - // The values exp(-1/16)-1 and exp(1/16)-1 - const double log1p_thresh1 = -0x1.f0540438fd5c3p-5; - const double log1p_thresh2 = 0x1.082b577d34ed8p-4; - double result2 = r1 + r2; - result2 = x < log1p_thresh1 | x > log1p_thresh2 ? result1 : result2; - - result2 = isinf(x) ? x : result2; - result2 = x < -1.0 ? as_double(QNANBITPATT_DP64) : result2; - result2 = x == -1.0 ? as_double(NINFBITPATT_DP64) : result2; - return result2; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, log1p, double); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/log2.cl b/libclc/generic/lib/math/log2.cl deleted file mode 100644 index 8776a80ec3be..000000000000 --- a/libclc/generic/lib/math/log2.cl +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "../clcmacro.h" -#include "tables.h" - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif // cl_khr_fp64 - -#define COMPILING_LOG2 -#include "log_base.h" -#undef COMPILING_LOG2 - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, log2, float); - -#ifdef cl_khr_fp64 -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, log2, double); -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/log_base.h b/libclc/generic/lib/math/log_base.h deleted file mode 100644 index bf2f82b73025..000000000000 --- a/libclc/generic/lib/math/log_base.h +++ /dev/null @@ -1,299 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include "math.h" - -/* - Algorithm: - - Based on: - Ping-Tak Peter Tang - "Table-driven implementation of the logarithm function in IEEE - floating-point arithmetic" - ACM Transactions on Mathematical Software (TOMS) - Volume 16, Issue 4 (December 1990) - - - x very close to 1.0 is handled differently, for x everywhere else - a brief explanation is given below - - x = (2^m)*A - x = (2^m)*(G+g) with (1 <= G < 2) and (g <= 2^(-8)) - x = (2^m)*2*(G/2+g/2) - x = (2^m)*2*(F+f) with (0.5 <= F < 1) and (f <= 2^(-9)) - - Y = (2^(-1))*(2^(-m))*(2^m)*A - Now, range of Y is: 0.5 <= Y < 1 - - F = 0x80 + (first 7 mantissa bits) + (8th mantissa bit) - Now, range of F is: 128 <= F <= 256 - F = F / 256 - Now, range of F is: 0.5 <= F <= 1 - - f = -(Y-F), with (f <= 2^(-9)) - - log(x) = m*log(2) + log(2) + log(F-f) - log(x) = m*log(2) + log(2) + log(F) + log(1-(f/F)) - log(x) = m*log(2) + log(2*F) + log(1-r) - - r = (f/F), with (r <= 2^(-8)) - r = f*(1/F) with (1/F) precomputed to avoid division - - log(x) = m*log(2) + log(G) - poly - - log(G) is precomputed - poly = (r + (r^2)/2 + (r^3)/3 + (r^4)/4) + (r^5)/5)) - - log(2) and log(G) need to be maintained in extra precision - to avoid losing precision in the calculations - - - For x close to 1.0, we employ the following technique to - ensure faster convergence. - - log(x) = log((1+s)/(1-s)) = 2*s + (2/3)*s^3 + (2/5)*s^5 + (2/7)*s^7 - x = ((1+s)/(1-s)) - x = 1 + r - s = r/(2+r) - -*/ - -_CLC_OVERLOAD _CLC_DEF float -#if defined(COMPILING_LOG2) -log2(float x) -#elif defined(COMPILING_LOG10) -log10(float x) -#else -log(float x) -#endif -{ - -#if defined(COMPILING_LOG2) - const float LOG2E = 0x1.715476p+0f; // 1.4426950408889634 - const float LOG2E_HEAD = 0x1.700000p+0f; // 1.4375 - const float LOG2E_TAIL = 0x1.547652p-8f; // 0.00519504072 -#elif defined(COMPILING_LOG10) - USE_TABLE(float2, p_log, LOG10_TBL); - const float LOG10E = 0x1.bcb7b2p-2f; // 0.43429448190325182 - const float LOG10E_HEAD = 0x1.bc0000p-2f; // 0.43359375 - const float LOG10E_TAIL = 0x1.6f62a4p-11f; // 0.0007007319 - const float LOG10_2_HEAD = 0x1.340000p-2f; // 0.30078125 - const float LOG10_2_TAIL = 0x1.04d426p-12f; // 0.000248745637 -#else - USE_TABLE(float2, p_log, LOGE_TBL); - const float LOG2_HEAD = 0x1.62e000p-1f; // 0.693115234 - const float LOG2_TAIL = 0x1.0bfbe8p-15f; // 0.0000319461833 -#endif - - uint xi = as_uint(x); - uint ax = xi & EXSIGNBIT_SP32; - - // Calculations for |x-1| < 2^-4 - float r = x - 1.0f; - int near1 = fabs(r) < 0x1.0p-4f; - float u2 = MATH_DIVIDE(r, 2.0f + r); - float corr = u2 * r; - float u = u2 + u2; - float v = u * u; - float znear1, z1, z2; - - // 2/(5 * 2^5), 2/(3 * 2^3) - z2 = mad(u, mad(v, 0x1.99999ap-7f, 0x1.555556p-4f)*v, -corr); - -#if defined(COMPILING_LOG2) - z1 = as_float(as_int(r) & 0xffff0000); - z2 = z2 + (r - z1); - znear1 = mad(z1, LOG2E_HEAD, mad(z2, LOG2E_HEAD, mad(z1, LOG2E_TAIL, z2*LOG2E_TAIL))); -#elif defined(COMPILING_LOG10) - z1 = as_float(as_int(r) & 0xffff0000); - z2 = z2 + (r - z1); - znear1 = mad(z1, LOG10E_HEAD, mad(z2, LOG10E_HEAD, mad(z1, LOG10E_TAIL, z2*LOG10E_TAIL))); -#else - znear1 = z2 + r; -#endif - - // Calculations for x not near 1 - int m = (int)(xi >> EXPSHIFTBITS_SP32) - EXPBIAS_SP32; - - // Normalize subnormal - uint xis = as_uint(as_float(xi | 0x3f800000) - 1.0f); - int ms = (int)(xis >> EXPSHIFTBITS_SP32) - 253; - int c = m == -127; - m = c ? ms : m; - uint xin = c ? xis : xi; - - float mf = (float)m; - uint indx = (xin & 0x007f0000) + ((xin & 0x00008000) << 1); - - // F - Y - float f = as_float(0x3f000000 | indx) - as_float(0x3f000000 | (xin & MANTBITS_SP32)); - - indx = indx >> 16; - r = f * USE_TABLE(log_inv_tbl, indx); - - // 1/3, 1/2 - float poly = mad(mad(r, 0x1.555556p-2f, 0.5f), r*r, r); - -#if defined(COMPILING_LOG2) - float2 tv = USE_TABLE(log2_tbl, indx); - z1 = tv.s0 + mf; - z2 = mad(poly, -LOG2E, tv.s1); -#elif defined(COMPILING_LOG10) - float2 tv = p_log[indx]; - z1 = mad(mf, LOG10_2_HEAD, tv.s0); - z2 = mad(poly, -LOG10E, mf*LOG10_2_TAIL) + tv.s1; -#else - float2 tv = p_log[indx]; - z1 = mad(mf, LOG2_HEAD, tv.s0); - z2 = mad(mf, LOG2_TAIL, -poly) + tv.s1; -#endif - - float z = z1 + z2; - z = near1 ? znear1 : z; - - // Corner cases - z = ax >= PINFBITPATT_SP32 ? x : z; - z = xi != ax ? as_float(QNANBITPATT_SP32) : z; - z = ax == 0 ? as_float(NINFBITPATT_SP32) : z; - - return z; -} - -#ifdef cl_khr_fp64 - -_CLC_OVERLOAD _CLC_DEF double -#if defined(COMPILING_LOG2) -log2(double x) -#elif defined(COMPILING_LOG10) -log10(double x) -#else -log(double x) -#endif -{ - -#ifndef COMPILING_LOG2 - // log2_lead and log2_tail sum to an extra-precise version of ln(2) - const double log2_lead = 6.93147122859954833984e-01; /* 0x3fe62e42e0000000 */ - const double log2_tail = 5.76999904754328540596e-08; /* 0x3e6efa39ef35793c */ -#endif - -#if defined(COMPILING_LOG10) - // log10e_lead and log10e_tail sum to an extra-precision version of log10(e) (19 bits in lead) - const double log10e_lead = 4.34293746948242187500e-01; /* 0x3fdbcb7800000000 */ - const double log10e_tail = 7.3495500964015109100644e-7; /* 0x3ea8a93728719535 */ -#elif defined(COMPILING_LOG2) - // log2e_lead and log2e_tail sum to an extra-precision version of log2(e) (19 bits in lead) - const double log2e_lead = 1.44269180297851562500E+00; /* 0x3FF7154400000000 */ - const double log2e_tail = 3.23791044778235969970E-06; /* 0x3ECB295C17F0BBBE */ -#endif - - // log_thresh1 = 9.39412117004394531250e-1 = 0x3fee0faa00000000 - // log_thresh2 = 1.06449508666992187500 = 0x3ff1082c00000000 - const double log_thresh1 = 0x1.e0faap-1; - const double log_thresh2 = 0x1.1082cp+0; - - int is_near = x >= log_thresh1 & x <= log_thresh2; - - // Near 1 code - double r = x - 1.0; - double u = r / (2.0 + r); - double correction = r * u; - u = u + u; - double v = u * u; - double r1 = r; - - const double ca_1 = 8.33333333333317923934e-02; /* 0x3fb55555555554e6 */ - const double ca_2 = 1.25000000037717509602e-02; /* 0x3f89999999bac6d4 */ - const double ca_3 = 2.23213998791944806202e-03; /* 0x3f62492307f1519f */ - const double ca_4 = 4.34887777707614552256e-04; /* 0x3f3c8034c85dfff0 */ - - double r2 = fma(u*v, fma(v, fma(v, fma(v, ca_4, ca_3), ca_2), ca_1), -correction); - -#if defined(COMPILING_LOG10) - r = r1; - r1 = as_double(as_ulong(r1) & 0xffffffff00000000); - r2 = r2 + (r - r1); - double ret_near = fma(log10e_lead, r1, fma(log10e_lead, r2, fma(log10e_tail, r1, log10e_tail * r2))); -#elif defined(COMPILING_LOG2) - r = r1; - r1 = as_double(as_ulong(r1) & 0xffffffff00000000); - r2 = r2 + (r - r1); - double ret_near = fma(log2e_lead, r1, fma(log2e_lead, r2, fma(log2e_tail, r1, log2e_tail*r2))); -#else - double ret_near = r1 + r2; -#endif - - // This is the far from 1 code - - // Deal with subnormal - ulong ux = as_ulong(x); - ulong uxs = as_ulong(as_double(0x03d0000000000000UL | ux) - 0x1.0p-962); - int c = ux < IMPBIT_DP64; - ux = c ? uxs : ux; - int expadjust = c ? 60 : 0; - - int xexp = ((as_int2(ux).hi >> 20) & 0x7ff) - EXPBIAS_DP64 - expadjust; - double f = as_double(HALFEXPBITS_DP64 | (ux & MANTBITS_DP64)); - int index = as_int2(ux).hi >> 13; - index = ((0x80 | (index & 0x7e)) >> 1) + (index & 0x1); - - double2 tv = USE_TABLE(ln_tbl, index - 64); - double z1 = tv.s0; - double q = tv.s1; - - double f1 = index * 0x1.0p-7; - double f2 = f - f1; - u = f2 / fma(f2, 0.5, f1); - v = u * u; - - const double cb_1 = 8.33333333333333593622e-02; /* 0x3fb5555555555557 */ - const double cb_2 = 1.24999999978138668903e-02; /* 0x3f89999999865ede */ - const double cb_3 = 2.23219810758559851206e-03; /* 0x3f6249423bd94741 */ - - double poly = v * fma(v, fma(v, cb_3, cb_2), cb_1); - double z2 = q + fma(u, poly, u); - - double dxexp = (double)xexp; -#if defined (COMPILING_LOG10) - // Add xexp * log(2) to z1,z2 to get log(x) - r1 = fma(dxexp, log2_lead, z1); - r2 = fma(dxexp, log2_tail, z2); - double ret_far = fma(log10e_lead, r1, fma(log10e_lead, r2, fma(log10e_tail, r1, log10e_tail*r2))); -#elif defined(COMPILING_LOG2) - r1 = fma(log2e_lead, z1, dxexp); - r2 = fma(log2e_lead, z2, fma(log2e_tail, z1, log2e_tail*z2)); - double ret_far = r1 + r2; -#else - r1 = fma(dxexp, log2_lead, z1); - r2 = fma(dxexp, log2_tail, z2); - double ret_far = r1 + r2; -#endif - - double ret = is_near ? ret_near : ret_far; - - ret = isinf(x) ? as_double(PINFBITPATT_DP64) : ret; - ret = isnan(x) | (x < 0.0) ? as_double(QNANBITPATT_DP64) : ret; - ret = x == 0.0 ? as_double(NINFBITPATT_DP64) : ret; - return ret; -} - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/mad.cl b/libclc/generic/lib/math/mad.cl deleted file mode 100644 index 6c7b90d150d5..000000000000 --- a/libclc/generic/lib/math/mad.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/mad.inc b/libclc/generic/lib/math/mad.inc deleted file mode 100644 index d32c7839d1b9..000000000000 --- a/libclc/generic/lib/math/mad.inc +++ /dev/null @@ -1,3 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE mad(__CLC_GENTYPE a, __CLC_GENTYPE b, __CLC_GENTYPE c) { - return a * b + c; -} diff --git a/libclc/generic/lib/math/math.h b/libclc/generic/lib/math/math.h deleted file mode 100644 index f46c7ea7a7d0..000000000000 --- a/libclc/generic/lib/math/math.h +++ /dev/null @@ -1,90 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define SNAN 0x001 -#define QNAN 0x002 -#define NINF 0x004 -#define NNOR 0x008 -#define NSUB 0x010 -#define NZER 0x020 -#define PZER 0x040 -#define PSUB 0x080 -#define PNOR 0x100 -#define PINF 0x200 - -#define HAVE_HW_FMA32() (1) -#define HAVE_BITALIGN() (0) -#define HAVE_FAST_FMA32() (0) - -#define MATH_DIVIDE(X, Y) ((X) / (Y)) -#define MATH_RECIP(X) (1.0f / (X)) -#define MATH_SQRT(X) sqrt(X) - -#define SIGNBIT_SP32 0x80000000 -#define EXSIGNBIT_SP32 0x7fffffff -#define EXPBITS_SP32 0x7f800000 -#define MANTBITS_SP32 0x007fffff -#define ONEEXPBITS_SP32 0x3f800000 -#define TWOEXPBITS_SP32 0x40000000 -#define HALFEXPBITS_SP32 0x3f000000 -#define IMPBIT_SP32 0x00800000 -#define QNANBITPATT_SP32 0x7fc00000 -#define INDEFBITPATT_SP32 0xffc00000 -#define PINFBITPATT_SP32 0x7f800000 -#define NINFBITPATT_SP32 0xff800000 -#define EXPBIAS_SP32 127 -#define EXPSHIFTBITS_SP32 23 -#define BIASEDEMIN_SP32 1 -#define EMIN_SP32 -126 -#define BIASEDEMAX_SP32 254 -#define EMAX_SP32 127 -#define LAMBDA_SP32 1.0e30 -#define MANTLENGTH_SP32 24 -#define BASEDIGITS_SP32 7 - -#ifdef cl_khr_fp64 - -#define SIGNBIT_DP64 0x8000000000000000L -#define EXSIGNBIT_DP64 0x7fffffffffffffffL -#define EXPBITS_DP64 0x7ff0000000000000L -#define MANTBITS_DP64 0x000fffffffffffffL -#define ONEEXPBITS_DP64 0x3ff0000000000000L -#define TWOEXPBITS_DP64 0x4000000000000000L -#define HALFEXPBITS_DP64 0x3fe0000000000000L -#define IMPBIT_DP64 0x0010000000000000L -#define QNANBITPATT_DP64 0x7ff8000000000000L -#define INDEFBITPATT_DP64 0xfff8000000000000L -#define PINFBITPATT_DP64 0x7ff0000000000000L -#define NINFBITPATT_DP64 0xfff0000000000000L -#define EXPBIAS_DP64 1023 -#define EXPSHIFTBITS_DP64 52 -#define BIASEDEMIN_DP64 1 -#define EMIN_DP64 -1022 -#define BIASEDEMAX_DP64 2046 /* 0x7fe */ -#define EMAX_DP64 1023 /* 0x3ff */ -#define LAMBDA_DP64 1.0e300 -#define MANTLENGTH_DP64 53 -#define BASEDIGITS_DP64 15 - -#endif // cl_khr_fp64 - -#define ALIGNED(x) __attribute__((aligned(x))) diff --git a/libclc/generic/lib/math/modf.cl b/libclc/generic/lib/math/modf.cl deleted file mode 100644 index 3294fbcadbfa..000000000000 --- a/libclc/generic/lib/math/modf.cl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/modf.inc b/libclc/generic/lib/math/modf.inc deleted file mode 100644 index 1486b765bba8..000000000000 --- a/libclc/generic/lib/math/modf.inc +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE modf(__CLC_GENTYPE x, __CLC_GENTYPE *iptr) { - *iptr = trunc(x); - return copysign(isinf(x) ? 0.0f : x - *iptr, x); -} - -#define MODF_DEF(addrspace) \ - _CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE modf(__CLC_GENTYPE x, addrspace __CLC_GENTYPE *iptr) { \ - __CLC_GENTYPE private_iptr; \ - __CLC_GENTYPE ret = modf(x, &private_iptr); \ - *iptr = private_iptr; \ - return ret; \ -} - -MODF_DEF(local); -MODF_DEF(global); diff --git a/libclc/generic/lib/math/native_log.cl b/libclc/generic/lib/math/native_log.cl deleted file mode 100644 index f64f0126c497..000000000000 --- a/libclc/generic/lib/math/native_log.cl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#define __CLC_FUNCTION __clc_native_log -#define __CLC_INTRINSIC "llvm.log" -#undef cl_khr_fp64 -#include - -#define __CLC_BODY -#define __FLOAT_ONLY -#include diff --git a/libclc/generic/lib/math/native_log.inc b/libclc/generic/lib/math/native_log.inc deleted file mode 100644 index cb4db3f5f569..000000000000 --- a/libclc/generic/lib/math/native_log.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log(__CLC_GENTYPE val) { - return __clc_native_log(val); -} diff --git a/libclc/generic/lib/math/native_log2.cl b/libclc/generic/lib/math/native_log2.cl deleted file mode 100644 index 35ed18b0d5b9..000000000000 --- a/libclc/generic/lib/math/native_log2.cl +++ /dev/null @@ -1,32 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#define __CLC_FUNCTION __clc_native_log2 -#define __CLC_INTRINSIC "llvm.log2" -#undef cl_khr_fp64 -#include - -#define __CLC_BODY -#define __FLOAT_ONLY -#include diff --git a/libclc/generic/lib/math/native_log2.inc b/libclc/generic/lib/math/native_log2.inc deleted file mode 100644 index 0f6a5098c045..000000000000 --- a/libclc/generic/lib/math/native_log2.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE native_log2(__CLC_GENTYPE val) { - return __clc_native_log2(val); -} diff --git a/libclc/generic/lib/math/nextafter.cl b/libclc/generic/lib/math/nextafter.cl deleted file mode 100644 index cbe54cd4e266..000000000000 --- a/libclc/generic/lib/math/nextafter.cl +++ /dev/null @@ -1,12 +0,0 @@ -#include -#include "../clcmacro.h" - -_CLC_DEFINE_BINARY_BUILTIN(float, nextafter, __builtin_nextafterf, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_BINARY_BUILTIN(double, nextafter, __builtin_nextafter, double, double) - -#endif diff --git a/libclc/generic/lib/math/pown.cl b/libclc/generic/lib/math/pown.cl deleted file mode 100644 index f3b27d4ccab7..000000000000 --- a/libclc/generic/lib/math/pown.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include -#include "../clcmacro.h" - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, pown, float, int) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_BINARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, pown, double, int) -#endif diff --git a/libclc/generic/lib/math/sin.cl b/libclc/generic/lib/math/sin.cl deleted file mode 100644 index 3a4074925b83..000000000000 --- a/libclc/generic/lib/math/sin.cl +++ /dev/null @@ -1,79 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "sincos_helpers.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float sin(float x) -{ - int ix = as_int(x); - int ax = ix & 0x7fffffff; - float dx = as_float(ax); - - float r0, r1; - int regn = __clc_argReductionS(&r0, &r1, dx); - - float ss = __clc_sinf_piby4(r0, r1); - float cc = __clc_cosf_piby4(r0, r1); - - float s = (regn & 1) != 0 ? cc : ss; - s = as_float(as_int(s) ^ ((regn > 1) << 31) ^ (ix ^ ax)); - - s = ax >= PINFBITPATT_SP32 ? as_float(QNANBITPATT_SP32) : s; - - //Subnormals - s = x == 0.0f ? x : s; - - return s; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, sin, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double sin(double x) { - double y = fabs(x); - - double r, rr; - int regn; - - if (y < 0x1.0p+47) - __clc_remainder_piby2_medium(y, &r, &rr, ®n); - else - __clc_remainder_piby2_large(y, &r, &rr, ®n); - - double2 sc = __clc_sincos_piby4(r, rr); - - int2 s = as_int2(regn & 1 ? sc.hi : sc.lo); - s.hi ^= ((regn > 1) << 31) ^ ((x < 0.0) << 31); - - return isinf(x) | isnan(x) ? as_double(QNANBITPATT_DP64) : as_double(s); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, sin, double); - -#endif diff --git a/libclc/generic/lib/math/sincos.cl b/libclc/generic/lib/math/sincos.cl deleted file mode 100644 index eace5adcf16f..000000000000 --- a/libclc/generic/lib/math/sincos.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/sincos.inc b/libclc/generic/lib/math/sincos.inc deleted file mode 100644 index e97f0f9641c1..000000000000 --- a/libclc/generic/lib/math/sincos.inc +++ /dev/null @@ -1,11 +0,0 @@ -#define __CLC_DECLARE_SINCOS(ADDRSPACE, TYPE) \ - _CLC_OVERLOAD _CLC_DEF TYPE sincos (TYPE x, ADDRSPACE TYPE * cosval) { \ - *cosval = cos(x); \ - return sin(x); \ - } - -__CLC_DECLARE_SINCOS(global, __CLC_GENTYPE) -__CLC_DECLARE_SINCOS(local, __CLC_GENTYPE) -__CLC_DECLARE_SINCOS(private, __CLC_GENTYPE) - -#undef __CLC_DECLARE_SINCOS diff --git a/libclc/generic/lib/math/sincosD_piby4.h b/libclc/generic/lib/math/sincosD_piby4.h deleted file mode 100644 index a00db854891a..000000000000 --- a/libclc/generic/lib/math/sincosD_piby4.h +++ /dev/null @@ -1,78 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_INLINE double2 -__libclc__sincos_piby4(double x, double xx) -{ - // Taylor series for sin(x) is x - x^3/3! + x^5/5! - x^7/7! ... - // = x * (1 - x^2/3! + x^4/5! - x^6/7! ... - // = x * f(w) - // where w = x*x and f(w) = (1 - w/3! + w^2/5! - w^3/7! ... - // We use a minimax approximation of (f(w) - 1) / w - // because this produces an expansion in even powers of x. - // If xx (the tail of x) is non-zero, we add a correction - // term g(x,xx) = (1-x*x/2)*xx to the result, where g(x,xx) - // is an approximation to cos(x)*sin(xx) valid because - // xx is tiny relative to x. - - // Taylor series for cos(x) is 1 - x^2/2! + x^4/4! - x^6/6! ... - // = f(w) - // where w = x*x and f(w) = (1 - w/2! + w^2/4! - w^3/6! ... - // We use a minimax approximation of (f(w) - 1 + w/2) / (w*w) - // because this produces an expansion in even powers of x. - // If xx (the tail of x) is non-zero, we subtract a correction - // term g(x,xx) = x*xx to the result, where g(x,xx) - // is an approximation to sin(x)*sin(xx) valid because - // xx is tiny relative to x. - - const double sc1 = -0.166666666666666646259241729; - const double sc2 = 0.833333333333095043065222816e-2; - const double sc3 = -0.19841269836761125688538679e-3; - const double sc4 = 0.275573161037288022676895908448e-5; - const double sc5 = -0.25051132068021699772257377197e-7; - const double sc6 = 0.159181443044859136852668200e-9; - - const double cc1 = 0.41666666666666665390037e-1; - const double cc2 = -0.13888888888887398280412e-2; - const double cc3 = 0.248015872987670414957399e-4; - const double cc4 = -0.275573172723441909470836e-6; - const double cc5 = 0.208761463822329611076335e-8; - const double cc6 = -0.113826398067944859590880e-10; - - double x2 = x * x; - double x3 = x2 * x; - double r = 0.5 * x2; - double t = 1.0 - r; - - double sp = fma(fma(fma(fma(sc6, x2, sc5), x2, sc4), x2, sc3), x2, sc2); - - double cp = t + fma(fma(fma(fma(fma(fma(cc6, x2, cc5), x2, cc4), x2, cc3), x2, cc2), x2, cc1), - x2*x2, fma(x, xx, (1.0 - t) - r)); - - double2 ret; - ret.lo = x - fma(-x3, sc1, fma(fma(-x3, sp, 0.5*xx), x2, -xx)); - ret.hi = cp; - - return ret; -} diff --git a/libclc/generic/lib/math/sincos_helpers.cl b/libclc/generic/lib/math/sincos_helpers.cl deleted file mode 100644 index 251b7f94efdc..000000000000 --- a/libclc/generic/lib/math/sincos_helpers.cl +++ /dev/null @@ -1,545 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "tables.h" -#include "sincos_helpers.h" - -#define bitalign(hi, lo, shift) \ - ((hi) << (32 - (shift))) | ((lo) >> (shift)); - -#define bytealign(src0, src1, src2) \ - ((uint) (((((long)(src0)) << 32) | (long)(src1)) >> (((src2) & 3)*8))) - -_CLC_DEF float __clc_sinf_piby4(float x, float y) { - // Taylor series for sin(x) is x - x^3/3! + x^5/5! - x^7/7! ... - // = x * (1 - x^2/3! + x^4/5! - x^6/7! ... - // = x * f(w) - // where w = x*x and f(w) = (1 - w/3! + w^2/5! - w^3/7! ... - // We use a minimax approximation of (f(w) - 1) / w - // because this produces an expansion in even powers of x. - - const float c1 = -0.1666666666e0f; - const float c2 = 0.8333331876e-2f; - const float c3 = -0.198400874e-3f; - const float c4 = 0.272500015e-5f; - const float c5 = -2.5050759689e-08f; // 0xb2d72f34 - const float c6 = 1.5896910177e-10f; // 0x2f2ec9d3 - - float z = x * x; - float v = z * x; - float r = mad(z, mad(z, mad(z, mad(z, c6, c5), c4), c3), c2); - float ret = x - mad(v, -c1, mad(z, mad(y, 0.5f, -v*r), -y)); - - return ret; -} - -_CLC_DEF float __clc_cosf_piby4(float x, float y) { - // Taylor series for cos(x) is 1 - x^2/2! + x^4/4! - x^6/6! ... - // = f(w) - // where w = x*x and f(w) = (1 - w/2! + w^2/4! - w^3/6! ... - // We use a minimax approximation of (f(w) - 1 + w/2) / (w*w) - // because this produces an expansion in even powers of x. - - const float c1 = 0.416666666e-1f; - const float c2 = -0.138888876e-2f; - const float c3 = 0.248006008e-4f; - const float c4 = -0.2730101334e-6f; - const float c5 = 2.0875723372e-09f; // 0x310f74f6 - const float c6 = -1.1359647598e-11f; // 0xad47d74e - - float z = x * x; - float r = z * mad(z, mad(z, mad(z, mad(z, mad(z, c6, c5), c4), c3), c2), c1); - - // if |x| < 0.3 - float qx = 0.0f; - - int ix = as_int(x) & EXSIGNBIT_SP32; - - // 0.78125 > |x| >= 0.3 - float xby4 = as_float(ix - 0x01000000); - qx = (ix >= 0x3e99999a) & (ix <= 0x3f480000) ? xby4 : qx; - - // x > 0.78125 - qx = ix > 0x3f480000 ? 0.28125f : qx; - - float hz = mad(z, 0.5f, -qx); - float a = 1.0f - qx; - float ret = a - (hz - mad(z, r, -x*y)); - return ret; -} - -_CLC_DEF void __clc_fullMulS(float *hi, float *lo, float a, float b, float bh, float bt) -{ - if (HAVE_HW_FMA32()) { - float ph = a * b; - *hi = ph; - *lo = fma(a, b, -ph); - } else { - float ah = as_float(as_uint(a) & 0xfffff000U); - float at = a - ah; - float ph = a * b; - float pt = mad(at, bt, mad(at, bh, mad(ah, bt, mad(ah, bh, -ph)))); - *hi = ph; - *lo = pt; - } -} - -_CLC_DEF float __clc_removePi2S(float *hi, float *lo, float x) -{ - // 72 bits of pi/2 - const float fpiby2_1 = (float) 0xC90FDA / 0x1.0p+23f; - const float fpiby2_1_h = (float) 0xC90 / 0x1.0p+11f; - const float fpiby2_1_t = (float) 0xFDA / 0x1.0p+23f; - - const float fpiby2_2 = (float) 0xA22168 / 0x1.0p+47f; - const float fpiby2_2_h = (float) 0xA22 / 0x1.0p+35f; - const float fpiby2_2_t = (float) 0x168 / 0x1.0p+47f; - - const float fpiby2_3 = (float) 0xC234C4 / 0x1.0p+71f; - const float fpiby2_3_h = (float) 0xC23 / 0x1.0p+59f; - const float fpiby2_3_t = (float) 0x4C4 / 0x1.0p+71f; - - const float twobypi = 0x1.45f306p-1f; - - float fnpi2 = trunc(mad(x, twobypi, 0.5f)); - - // subtract n * pi/2 from x - float rhead, rtail; - __clc_fullMulS(&rhead, &rtail, fnpi2, fpiby2_1, fpiby2_1_h, fpiby2_1_t); - float v = x - rhead; - float rem = v + (((x - v) - rhead) - rtail); - - float rhead2, rtail2; - __clc_fullMulS(&rhead2, &rtail2, fnpi2, fpiby2_2, fpiby2_2_h, fpiby2_2_t); - v = rem - rhead2; - rem = v + (((rem - v) - rhead2) - rtail2); - - float rhead3, rtail3; - __clc_fullMulS(&rhead3, &rtail3, fnpi2, fpiby2_3, fpiby2_3_h, fpiby2_3_t); - v = rem - rhead3; - - *hi = v + ((rem - v) - rhead3); - *lo = -rtail3; - return fnpi2; -} - -_CLC_DEF int __clc_argReductionSmallS(float *r, float *rr, float x) -{ - float fnpi2 = __clc_removePi2S(r, rr, x); - return (int)fnpi2 & 0x3; -} - -#define FULL_MUL(A, B, HI, LO) \ - LO = A * B; \ - HI = mul_hi(A, B) - -#define FULL_MAD(A, B, C, HI, LO) \ - LO = ((A) * (B) + (C)); \ - HI = mul_hi(A, B); \ - HI += LO < C - -_CLC_DEF int __clc_argReductionLargeS(float *r, float *rr, float x) -{ - int xe = (int)(as_uint(x) >> 23) - 127; - uint xm = 0x00800000U | (as_uint(x) & 0x7fffffU); - - // 224 bits of 2/PI: . A2F9836E 4E441529 FC2757D1 F534DDC0 DB629599 3C439041 FE5163AB - const uint b6 = 0xA2F9836EU; - const uint b5 = 0x4E441529U; - const uint b4 = 0xFC2757D1U; - const uint b3 = 0xF534DDC0U; - const uint b2 = 0xDB629599U; - const uint b1 = 0x3C439041U; - const uint b0 = 0xFE5163ABU; - - uint p0, p1, p2, p3, p4, p5, p6, p7, c0, c1; - - FULL_MUL(xm, b0, c0, p0); - FULL_MAD(xm, b1, c0, c1, p1); - FULL_MAD(xm, b2, c1, c0, p2); - FULL_MAD(xm, b3, c0, c1, p3); - FULL_MAD(xm, b4, c1, c0, p4); - FULL_MAD(xm, b5, c0, c1, p5); - FULL_MAD(xm, b6, c1, p7, p6); - - uint fbits = 224 + 23 - xe; - - // shift amount to get 2 lsb of integer part at top 2 bits - // min: 25 (xe=18) max: 134 (xe=127) - uint shift = 256U - 2 - fbits; - - // Shift by up to 134/32 = 4 words - int c = shift > 31; - p7 = c ? p6 : p7; - p6 = c ? p5 : p6; - p5 = c ? p4 : p5; - p4 = c ? p3 : p4; - p3 = c ? p2 : p3; - p2 = c ? p1 : p2; - p1 = c ? p0 : p1; - shift -= (-c) & 32; - - c = shift > 31; - p7 = c ? p6 : p7; - p6 = c ? p5 : p6; - p5 = c ? p4 : p5; - p4 = c ? p3 : p4; - p3 = c ? p2 : p3; - p2 = c ? p1 : p2; - shift -= (-c) & 32; - - c = shift > 31; - p7 = c ? p6 : p7; - p6 = c ? p5 : p6; - p5 = c ? p4 : p5; - p4 = c ? p3 : p4; - p3 = c ? p2 : p3; - shift -= (-c) & 32; - - c = shift > 31; - p7 = c ? p6 : p7; - p6 = c ? p5 : p6; - p5 = c ? p4 : p5; - p4 = c ? p3 : p4; - shift -= (-c) & 32; - - // bitalign cannot handle a shift of 32 - c = shift > 0; - shift = 32 - shift; - uint t7 = bitalign(p7, p6, shift); - uint t6 = bitalign(p6, p5, shift); - uint t5 = bitalign(p5, p4, shift); - p7 = c ? t7 : p7; - p6 = c ? t6 : p6; - p5 = c ? t5 : p5; - - // Get 2 lsb of int part and msb of fraction - int i = p7 >> 29; - - // Scoot up 2 more bits so only fraction remains - p7 = bitalign(p7, p6, 30); - p6 = bitalign(p6, p5, 30); - p5 = bitalign(p5, p4, 30); - - // Subtract 1 if msb of fraction is 1, i.e. fraction >= 0.5 - uint flip = i & 1 ? 0xffffffffU : 0U; - uint sign = i & 1 ? 0x80000000U : 0U; - p7 = p7 ^ flip; - p6 = p6 ^ flip; - p5 = p5 ^ flip; - - // Find exponent and shift away leading zeroes and hidden bit - xe = clz(p7) + 1; - shift = 32 - xe; - p7 = bitalign(p7, p6, shift); - p6 = bitalign(p6, p5, shift); - - // Most significant part of fraction - float q1 = as_float(sign | ((127 - xe) << 23) | (p7 >> 9)); - - // Shift out bits we captured on q1 - p7 = bitalign(p7, p6, 32-23); - - // Get 24 more bits of fraction in another float, there are not long strings of zeroes here - int xxe = clz(p7) + 1; - p7 = bitalign(p7, p6, 32-xxe); - float q0 = as_float(sign | ((127 - (xe + 23 + xxe)) << 23) | (p7 >> 9)); - - // At this point, the fraction q1 + q0 is correct to at least 48 bits - // Now we need to multiply the fraction by pi/2 - // This loses us about 4 bits - // pi/2 = C90 FDA A22 168 C23 4C4 - - const float pio2h = (float)0xc90fda / 0x1.0p+23f; - const float pio2hh = (float)0xc90 / 0x1.0p+11f; - const float pio2ht = (float)0xfda / 0x1.0p+23f; - const float pio2t = (float)0xa22168 / 0x1.0p+47f; - - float rh, rt; - - if (HAVE_HW_FMA32()) { - rh = q1 * pio2h; - rt = fma(q0, pio2h, fma(q1, pio2t, fma(q1, pio2h, -rh))); - } else { - float q1h = as_float(as_uint(q1) & 0xfffff000); - float q1t = q1 - q1h; - rh = q1 * pio2h; - rt = mad(q1t, pio2ht, mad(q1t, pio2hh, mad(q1h, pio2ht, mad(q1h, pio2hh, -rh)))); - rt = mad(q0, pio2h, mad(q1, pio2t, rt)); - } - - float t = rh + rt; - rt = rt - (t - rh); - - *r = t; - *rr = rt; - return ((i >> 1) + (i & 1)) & 0x3; -} - -_CLC_DEF int __clc_argReductionS(float *r, float *rr, float x) -{ - if (x < 0x1.0p+23f) - return __clc_argReductionSmallS(r, rr, x); - else - return __clc_argReductionLargeS(r, rr, x); -} - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// Reduction for medium sized arguments -_CLC_DEF void __clc_remainder_piby2_medium(double x, double *r, double *rr, int *regn) { - // How many pi/2 is x a multiple of? - const double two_by_pi = 0x1.45f306dc9c883p-1; - double dnpi2 = trunc(fma(x, two_by_pi, 0.5)); - - const double piby2_h = -7074237752028440.0 / 0x1.0p+52; - const double piby2_m = -2483878800010755.0 / 0x1.0p+105; - const double piby2_t = -3956492004828932.0 / 0x1.0p+158; - - // Compute product of npi2 with 159 bits of 2/pi - double p_hh = piby2_h * dnpi2; - double p_ht = fma(piby2_h, dnpi2, -p_hh); - double p_mh = piby2_m * dnpi2; - double p_mt = fma(piby2_m, dnpi2, -p_mh); - double p_th = piby2_t * dnpi2; - double p_tt = fma(piby2_t, dnpi2, -p_th); - - // Reduce to 159 bits - double ph = p_hh; - double pm = p_ht + p_mh; - double t = p_mh - (pm - p_ht); - double pt = p_th + t + p_mt + p_tt; - t = ph + pm; pm = pm - (t - ph); ph = t; - t = pm + pt; pt = pt - (t - pm); pm = t; - - // Subtract from x - t = x + ph; - double qh = t + pm; - double qt = pm - (qh - t) + pt; - - *r = qh; - *rr = qt; - *regn = (int)(long)dnpi2 & 0x3; -} - -// Given positive argument x, reduce it to the range [-pi/4,pi/4] using -// extra precision, and return the result in r, rr. -// Return value "regn" tells how many lots of pi/2 were subtracted -// from x to put it in the range [-pi/4,pi/4], mod 4. - -_CLC_DEF void __clc_remainder_piby2_large(double x, double *r, double *rr, int *regn) { - - long ux = as_long(x); - int e = (int)(ux >> 52) - 1023; - int i = max(23, (e >> 3) + 17); - int j = 150 - i; - int j16 = j & ~0xf; - double fract_temp; - - // The following extracts 192 consecutive bits of 2/pi aligned on an arbitrary byte boundary - uint4 q0 = USE_TABLE(pibits_tbl, j16); - uint4 q1 = USE_TABLE(pibits_tbl, (j16 + 16)); - uint4 q2 = USE_TABLE(pibits_tbl, (j16 + 32)); - - int k = (j >> 2) & 0x3; - int4 c = (int4)k == (int4)(0, 1, 2, 3); - - uint u0, u1, u2, u3, u4, u5, u6; - - u0 = c.s1 ? q0.s1 : q0.s0; - u0 = c.s2 ? q0.s2 : u0; - u0 = c.s3 ? q0.s3 : u0; - - u1 = c.s1 ? q0.s2 : q0.s1; - u1 = c.s2 ? q0.s3 : u1; - u1 = c.s3 ? q1.s0 : u1; - - u2 = c.s1 ? q0.s3 : q0.s2; - u2 = c.s2 ? q1.s0 : u2; - u2 = c.s3 ? q1.s1 : u2; - - u3 = c.s1 ? q1.s0 : q0.s3; - u3 = c.s2 ? q1.s1 : u3; - u3 = c.s3 ? q1.s2 : u3; - - u4 = c.s1 ? q1.s1 : q1.s0; - u4 = c.s2 ? q1.s2 : u4; - u4 = c.s3 ? q1.s3 : u4; - - u5 = c.s1 ? q1.s2 : q1.s1; - u5 = c.s2 ? q1.s3 : u5; - u5 = c.s3 ? q2.s0 : u5; - - u6 = c.s1 ? q1.s3 : q1.s2; - u6 = c.s2 ? q2.s0 : u6; - u6 = c.s3 ? q2.s1 : u6; - - uint v0 = bytealign(u1, u0, j); - uint v1 = bytealign(u2, u1, j); - uint v2 = bytealign(u3, u2, j); - uint v3 = bytealign(u4, u3, j); - uint v4 = bytealign(u5, u4, j); - uint v5 = bytealign(u6, u5, j); - - // Place those 192 bits in 4 48-bit doubles along with correct exponent - // If i > 1018 we would get subnormals so we scale p up and x down to get the same product - i = 2 + 8*i; - x *= i > 1018 ? 0x1.0p-136 : 1.0; - i -= i > 1018 ? 136 : 0; - - uint ua = (uint)(1023 + 52 - i) << 20; - double a = as_double((uint2)(0, ua)); - double p0 = as_double((uint2)(v0, ua | (v1 & 0xffffU))) - a; - ua += 0x03000000U; - a = as_double((uint2)(0, ua)); - double p1 = as_double((uint2)((v2 << 16) | (v1 >> 16), ua | (v2 >> 16))) - a; - ua += 0x03000000U; - a = as_double((uint2)(0, ua)); - double p2 = as_double((uint2)(v3, ua | (v4 & 0xffffU))) - a; - ua += 0x03000000U; - a = as_double((uint2)(0, ua)); - double p3 = as_double((uint2)((v5 << 16) | (v4 >> 16), ua | (v5 >> 16))) - a; - - // Exact multiply - double f0h = p0 * x; - double f0l = fma(p0, x, -f0h); - double f1h = p1 * x; - double f1l = fma(p1, x, -f1h); - double f2h = p2 * x; - double f2l = fma(p2, x, -f2h); - double f3h = p3 * x; - double f3l = fma(p3, x, -f3h); - - // Accumulate product into 4 doubles - double s, t; - - double f3 = f3h + f2h; - t = f2h - (f3 - f3h); - s = f3l + t; - t = t - (s - f3l); - - double f2 = s + f1h; - t = f1h - (f2 - s) + t; - s = f2l + t; - t = t - (s - f2l); - - double f1 = s + f0h; - t = f0h - (f1 - s) + t; - s = f1l + t; - - double f0 = s + f0l; - - // Strip off unwanted large integer bits - f3 = 0x1.0p+10 * fract(f3 * 0x1.0p-10, &fract_temp); - f3 += f3 + f2 < 0.0 ? 0x1.0p+10 : 0.0; - - // Compute least significant integer bits - t = f3 + f2; - double di = t - fract(t, &fract_temp); - i = (float)di; - - // Shift out remaining integer part - f3 -= di; - s = f3 + f2; t = f2 - (s - f3); f3 = s; f2 = t; - s = f2 + f1; t = f1 - (s - f2); f2 = s; f1 = t; - f1 += f0; - - // Subtract 1 if fraction is >= 0.5, and update regn - int g = f3 >= 0.5; - i += g; - f3 -= (float)g; - - // Shift up bits - s = f3 + f2; t = f2 -(s - f3); f3 = s; f2 = t + f1; - - // Multiply precise fraction by pi/2 to get radians - const double p2h = 7074237752028440.0 / 0x1.0p+52; - const double p2t = 4967757600021510.0 / 0x1.0p+106; - - double rhi = f3 * p2h; - double rlo = fma(f2, p2h, fma(f3, p2t, fma(f3, p2h, -rhi))); - - *r = rhi + rlo; - *rr = rlo - (*r - rhi); - *regn = i & 0x3; -} - - -_CLC_DEF double2 __clc_sincos_piby4(double x, double xx) { - // Taylor series for sin(x) is x - x^3/3! + x^5/5! - x^7/7! ... - // = x * (1 - x^2/3! + x^4/5! - x^6/7! ... - // = x * f(w) - // where w = x*x and f(w) = (1 - w/3! + w^2/5! - w^3/7! ... - // We use a minimax approximation of (f(w) - 1) / w - // because this produces an expansion in even powers of x. - // If xx (the tail of x) is non-zero, we add a correction - // term g(x,xx) = (1-x*x/2)*xx to the result, where g(x,xx) - // is an approximation to cos(x)*sin(xx) valid because - // xx is tiny relative to x. - - // Taylor series for cos(x) is 1 - x^2/2! + x^4/4! - x^6/6! ... - // = f(w) - // where w = x*x and f(w) = (1 - w/2! + w^2/4! - w^3/6! ... - // We use a minimax approximation of (f(w) - 1 + w/2) / (w*w) - // because this produces an expansion in even powers of x. - // If xx (the tail of x) is non-zero, we subtract a correction - // term g(x,xx) = x*xx to the result, where g(x,xx) - // is an approximation to sin(x)*sin(xx) valid because - // xx is tiny relative to x. - - const double sc1 = -0.166666666666666646259241729; - const double sc2 = 0.833333333333095043065222816e-2; - const double sc3 = -0.19841269836761125688538679e-3; - const double sc4 = 0.275573161037288022676895908448e-5; - const double sc5 = -0.25051132068021699772257377197e-7; - const double sc6 = 0.159181443044859136852668200e-9; - - const double cc1 = 0.41666666666666665390037e-1; - const double cc2 = -0.13888888888887398280412e-2; - const double cc3 = 0.248015872987670414957399e-4; - const double cc4 = -0.275573172723441909470836e-6; - const double cc5 = 0.208761463822329611076335e-8; - const double cc6 = -0.113826398067944859590880e-10; - - double x2 = x * x; - double x3 = x2 * x; - double r = 0.5 * x2; - double t = 1.0 - r; - - double sp = fma(fma(fma(fma(sc6, x2, sc5), x2, sc4), x2, sc3), x2, sc2); - - double cp = t + fma(fma(fma(fma(fma(fma(cc6, x2, cc5), x2, cc4), x2, cc3), x2, cc2), x2, cc1), - x2*x2, fma(x, xx, (1.0 - t) - r)); - - double2 ret; - ret.lo = x - fma(-x3, sc1, fma(fma(-x3, sp, 0.5*xx), x2, -xx)); - ret.hi = cp; - - return ret; -} - -#endif diff --git a/libclc/generic/lib/math/sincos_helpers.h b/libclc/generic/lib/math/sincos_helpers.h deleted file mode 100644 index 2565d44eb024..000000000000 --- a/libclc/generic/lib/math/sincos_helpers.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_DECL float __clc_sinf_piby4(float x, float y); -_CLC_DECL float __clc_cosf_piby4(float x, float y); -_CLC_DECL int __clc_argReductionS(float *r, float *rr, float x); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DECL void __clc_remainder_piby2_medium(double x, double *r, double *rr, int *regn); -_CLC_DECL void __clc_remainder_piby2_large(double x, double *r, double *rr, int *regn); -_CLC_DECL double2 __clc_sincos_piby4(double x, double xx); - -#endif diff --git a/libclc/generic/lib/math/sincospiF_piby4.h b/libclc/generic/lib/math/sincospiF_piby4.h deleted file mode 100644 index 90ecb1d7a636..000000000000 --- a/libclc/generic/lib/math/sincospiF_piby4.h +++ /dev/null @@ -1,56 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -// Evaluate single precisions in and cos of value in interval [-pi/4, pi/4] -_CLC_INLINE float2 -__libclc__sincosf_piby4(float x) -{ - // Taylor series for sin(x) is x - x^3/3! + x^5/5! - x^7/7! ... - // = x * (1 - x^2/3! + x^4/5! - x^6/7! ... - // = x * f(w) - // where w = x*x and f(w) = (1 - w/3! + w^2/5! - w^3/7! ... - // We use a minimax approximation of (f(w) - 1) / w - // because this produces an expansion in even powers of x. - - // Taylor series for cos(x) is 1 - x^2/2! + x^4/4! - x^6/6! ... - // = f(w) - // where w = x*x and f(w) = (1 - w/2! + w^2/4! - w^3/6! ... - // We use a minimax approximation of (f(w) - 1 + w/2) / (w*w) - // because this produces an expansion in even powers of x. - - const float sc1 = -0.166666666638608441788607926e0F; - const float sc2 = 0.833333187633086262120839299e-2F; - const float sc3 = -0.198400874359527693921333720e-3F; - const float sc4 = 0.272500015145584081596826911e-5F; - - const float cc1 = 0.41666666664325175238031e-1F; - const float cc2 = -0.13888887673175665567647e-2F; - const float cc3 = 0.24800600878112441958053e-4F; - const float cc4 = -0.27301013343179832472841e-6F; - - float x2 = x * x; - - float2 ret; - ret.x = mad(x*x2, mad(x2, mad(x2, mad(x2, sc4, sc3), sc2), sc1), x); - ret.y = mad(x2*x2, mad(x2, mad(x2, mad(x2, cc4, cc3), cc2), cc1), mad(x2, -0.5f, 1.0f)); - return ret; -} diff --git a/libclc/generic/lib/math/sinpi.cl b/libclc/generic/lib/math/sinpi.cl deleted file mode 100644 index dbb995fe0cd9..000000000000 --- a/libclc/generic/lib/math/sinpi.cl +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "sincospiF_piby4.h" -#include "../clcmacro.h" -#ifdef cl_khr_fp64 -#include "sincosD_piby4.h" -#endif - -_CLC_OVERLOAD _CLC_DEF float sinpi(float x) -{ - int ix = as_int(x); - int xsgn = ix & 0x80000000; - ix ^= xsgn; - float ax = as_float(ix); - int iax = (int)ax; - float r = ax - iax; - int xodd = xsgn ^ (iax & 0x1 ? 0x80000000 : 0); - - // Initialize with return for +-Inf and NaN - int ir = 0x7fc00000; - - // 2^23 <= |x| < Inf, the result is always integer - ir = ix < 0x7f800000 ? xsgn : ir; - - // 0x1.0p-7 <= |x| < 2^23, result depends on which 0.25 interval - - // r < 1.0 - float a = 1.0f - r; - int e = 0; - - // r <= 0.75 - int c = r <= 0.75f; - a = c ? r - 0.5f : a; - e = c ? 1 : e; - - // r < 0.5 - c = r < 0.5f; - a = c ? 0.5f - r : a; - - // 0 < r <= 0.25 - c = r <= 0.25f; - a = c ? r : a; - e = c ? 0 : e; - - float2 t = __libclc__sincosf_piby4(a * M_PI_F); - int jr = xodd ^ as_int(e ? t.hi : t.lo); - - ir = ix < 0x4b000000 ? jr : ir; - - return as_float(ir); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, sinpi, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double sinpi(double x) -{ - long ix = as_long(x); - long xsgn = ix & 0x8000000000000000L; - ix ^= xsgn; - double ax = as_double(ix); - long iax = (long)ax; - double r = ax - (double)iax; - long xodd = xsgn ^ (iax & 0x1L ? 0x8000000000000000L : 0L); - - // Initialize with return for +-Inf and NaN - long ir = 0x7ff8000000000000L; - - // 2^23 <= |x| < Inf, the result is always integer - ir = ix < 0x7ff0000000000000 ? xsgn : ir; - - // 0x1.0p-7 <= |x| < 2^23, result depends on which 0.25 interval - - // r < 1.0 - double a = 1.0 - r; - int e = 0; - - // r <= 0.75 - int c = r <= 0.75; - double t = r - 0.5; - a = c ? t : a; - e = c ? 1 : e; - - // r < 0.5 - c = r < 0.5; - t = 0.5 - r; - a = c ? t : a; - - // r <= 0.25 - c = r <= 0.25; - a = c ? r : a; - e = c ? 0 : e; - - double api = a * M_PI; - double2 sc = __libclc__sincos_piby4(api, 0.0); - long jr = xodd ^ as_long(e ? sc.hi : sc.lo); - - ir = ax < 0x1.0p+52 ? jr : ir; - - return as_double(ir); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, sinpi, double) - -#endif diff --git a/libclc/generic/lib/math/sqrt.cl b/libclc/generic/lib/math/sqrt.cl deleted file mode 100644 index 300e2741ee0b..000000000000 --- a/libclc/generic/lib/math/sqrt.cl +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include -#include "../clcmacro.h" -#include "math/clc_sqrt.h" - -_CLC_DEFINE_UNARY_BUILTIN(float, sqrt, __clc_sqrt, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_DEFINE_UNARY_BUILTIN(double, sqrt, __clc_sqrt, double) - -#endif diff --git a/libclc/generic/lib/math/tables.cl b/libclc/generic/lib/math/tables.cl deleted file mode 100644 index 8286efb75185..000000000000 --- a/libclc/generic/lib/math/tables.cl +++ /dev/null @@ -1,841 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "tables.h" - -DECLARE_TABLE(float2, LOGE_TBL, 129) = { - (float2)(0x0.000000p+0f, 0x0.000000p+0f), - (float2)(0x1.fe0000p-8f, 0x1.535882p-23f), - (float2)(0x1.fc0000p-7f, 0x1.5161f8p-20f), - (float2)(0x1.7b8000p-6f, 0x1.1b07d4p-18f), - (float2)(0x1.f82000p-6f, 0x1.361cf0p-19f), - (float2)(0x1.39e000p-5f, 0x1.0f73fcp-18f), - (float2)(0x1.774000p-5f, 0x1.63d8cap-19f), - (float2)(0x1.b42000p-5f, 0x1.bae232p-18f), - (float2)(0x1.f0a000p-5f, 0x1.86008ap-20f), - (float2)(0x1.164000p-4f, 0x1.36eea2p-16f), - (float2)(0x1.340000p-4f, 0x1.d7961ap-16f), - (float2)(0x1.51a000p-4f, 0x1.073f06p-16f), - (float2)(0x1.6f0000p-4f, 0x1.a515cap-17f), - (float2)(0x1.8c2000p-4f, 0x1.45d630p-16f), - (float2)(0x1.a92000p-4f, 0x1.b4e92ap-18f), - (float2)(0x1.c5e000p-4f, 0x1.523d6ep-18f), - (float2)(0x1.e26000p-4f, 0x1.076e2ap-16f), - (float2)(0x1.fec000p-4f, 0x1.2263b6p-17f), - (float2)(0x1.0d6000p-3f, 0x1.7e7cd0p-15f), - (float2)(0x1.1b6000p-3f, 0x1.2ad52ep-15f), - (float2)(0x1.294000p-3f, 0x1.52f81ep-15f), - (float2)(0x1.370000p-3f, 0x1.fc201ep-15f), - (float2)(0x1.44c000p-3f, 0x1.2b6ccap-15f), - (float2)(0x1.526000p-3f, 0x1.cbc742p-16f), - (float2)(0x1.5fe000p-3f, 0x1.3070a6p-15f), - (float2)(0x1.6d6000p-3f, 0x1.fce33ap-20f), - (float2)(0x1.7aa000p-3f, 0x1.890210p-15f), - (float2)(0x1.87e000p-3f, 0x1.a06520p-15f), - (float2)(0x1.952000p-3f, 0x1.6a73d0p-17f), - (float2)(0x1.a22000p-3f, 0x1.bc1fe2p-15f), - (float2)(0x1.af2000p-3f, 0x1.c94e80p-15f), - (float2)(0x1.bc2000p-3f, 0x1.0ce85ap-16f), - (float2)(0x1.c8e000p-3f, 0x1.f7c79ap-15f), - (float2)(0x1.d5c000p-3f, 0x1.0b5a7cp-18f), - (float2)(0x1.e26000p-3f, 0x1.076e2ap-15f), - (float2)(0x1.ef0000p-3f, 0x1.5b97b8p-16f), - (float2)(0x1.fb8000p-3f, 0x1.186d5ep-15f), - (float2)(0x1.040000p-2f, 0x1.2ca5a6p-17f), - (float2)(0x1.0a2000p-2f, 0x1.24e272p-14f), - (float2)(0x1.104000p-2f, 0x1.8bf9aep-14f), - (float2)(0x1.166000p-2f, 0x1.5cabaap-14f), - (float2)(0x1.1c8000p-2f, 0x1.3182d2p-15f), - (float2)(0x1.228000p-2f, 0x1.41fbcep-14f), - (float2)(0x1.288000p-2f, 0x1.5a13dep-14f), - (float2)(0x1.2e8000p-2f, 0x1.c575c2p-15f), - (float2)(0x1.346000p-2f, 0x1.dd9a98p-14f), - (float2)(0x1.3a6000p-2f, 0x1.3155a4p-16f), - (float2)(0x1.404000p-2f, 0x1.843434p-17f), - (float2)(0x1.460000p-2f, 0x1.8bc21cp-14f), - (float2)(0x1.4be000p-2f, 0x1.7e55dcp-16f), - (float2)(0x1.51a000p-2f, 0x1.5b0e5ap-15f), - (float2)(0x1.576000p-2f, 0x1.dc5d14p-16f), - (float2)(0x1.5d0000p-2f, 0x1.bdbf58p-14f), - (float2)(0x1.62c000p-2f, 0x1.05e572p-15f), - (float2)(0x1.686000p-2f, 0x1.903d36p-15f), - (float2)(0x1.6e0000p-2f, 0x1.1d5456p-15f), - (float2)(0x1.738000p-2f, 0x1.d7f6bap-14f), - (float2)(0x1.792000p-2f, 0x1.4abfbap-15f), - (float2)(0x1.7ea000p-2f, 0x1.f07704p-15f), - (float2)(0x1.842000p-2f, 0x1.a3b43cp-15f), - (float2)(0x1.89a000p-2f, 0x1.9c360ap-17f), - (float2)(0x1.8f0000p-2f, 0x1.1e8736p-14f), - (float2)(0x1.946000p-2f, 0x1.941c20p-14f), - (float2)(0x1.99c000p-2f, 0x1.958116p-14f), - (float2)(0x1.9f2000p-2f, 0x1.23ecbep-14f), - (float2)(0x1.a48000p-2f, 0x1.024396p-16f), - (float2)(0x1.a9c000p-2f, 0x1.d93534p-15f), - (float2)(0x1.af0000p-2f, 0x1.293246p-14f), - (float2)(0x1.b44000p-2f, 0x1.eef798p-15f), - (float2)(0x1.b98000p-2f, 0x1.625a4cp-16f), - (float2)(0x1.bea000p-2f, 0x1.4d9da6p-14f), - (float2)(0x1.c3c000p-2f, 0x1.d7a7ccp-14f), - (float2)(0x1.c8e000p-2f, 0x1.f7c79ap-14f), - (float2)(0x1.ce0000p-2f, 0x1.af0b84p-14f), - (float2)(0x1.d32000p-2f, 0x1.fcfc00p-15f), - (float2)(0x1.d82000p-2f, 0x1.e7258ap-14f), - (float2)(0x1.dd4000p-2f, 0x1.a81306p-16f), - (float2)(0x1.e24000p-2f, 0x1.1034f8p-15f), - (float2)(0x1.e74000p-2f, 0x1.09875ap-16f), - (float2)(0x1.ec2000p-2f, 0x1.99d246p-14f), - (float2)(0x1.f12000p-2f, 0x1.1ebf5ep-15f), - (float2)(0x1.f60000p-2f, 0x1.23fa70p-14f), - (float2)(0x1.fae000p-2f, 0x1.588f78p-14f), - (float2)(0x1.ffc000p-2f, 0x1.2e0856p-14f), - (float2)(0x1.024000p-1f, 0x1.52a5a4p-13f), - (float2)(0x1.04a000p-1f, 0x1.df9da8p-13f), - (float2)(0x1.072000p-1f, 0x1.f2e0e6p-16f), - (float2)(0x1.098000p-1f, 0x1.bd3d5cp-15f), - (float2)(0x1.0be000p-1f, 0x1.cb9094p-15f), - (float2)(0x1.0e4000p-1f, 0x1.261746p-15f), - (float2)(0x1.108000p-1f, 0x1.f39e2cp-13f), - (float2)(0x1.12e000p-1f, 0x1.719592p-13f), - (float2)(0x1.154000p-1f, 0x1.87a5e8p-14f), - (float2)(0x1.178000p-1f, 0x1.eabbd8p-13f), - (float2)(0x1.19e000p-1f, 0x1.cd68cep-14f), - (float2)(0x1.1c2000p-1f, 0x1.b81f70p-13f), - (float2)(0x1.1e8000p-1f, 0x1.7d79c0p-15f), - (float2)(0x1.20c000p-1f, 0x1.b9a324p-14f), - (float2)(0x1.230000p-1f, 0x1.30d7bep-13f), - (float2)(0x1.254000p-1f, 0x1.5bce98p-13f), - (float2)(0x1.278000p-1f, 0x1.5e1288p-13f), - (float2)(0x1.29c000p-1f, 0x1.37fec2p-13f), - (float2)(0x1.2c0000p-1f, 0x1.d3da88p-14f), - (float2)(0x1.2e4000p-1f, 0x1.d0db90p-15f), - (float2)(0x1.306000p-1f, 0x1.d7334ep-13f), - (float2)(0x1.32a000p-1f, 0x1.133912p-13f), - (float2)(0x1.34e000p-1f, 0x1.44ece6p-16f), - (float2)(0x1.370000p-1f, 0x1.17b546p-13f), - (float2)(0x1.392000p-1f, 0x1.e0d356p-13f), - (float2)(0x1.3b6000p-1f, 0x1.0893fep-14f), - (float2)(0x1.3d8000p-1f, 0x1.026a70p-13f), - (float2)(0x1.3fa000p-1f, 0x1.5b84d0p-13f), - (float2)(0x1.41c000p-1f, 0x1.8fe846p-13f), - (float2)(0x1.43e000p-1f, 0x1.9fe2f8p-13f), - (float2)(0x1.460000p-1f, 0x1.8bc21cp-13f), - (float2)(0x1.482000p-1f, 0x1.53d1eap-13f), - (float2)(0x1.4a4000p-1f, 0x1.f0bb60p-14f), - (float2)(0x1.4c6000p-1f, 0x1.e6bf32p-15f), - (float2)(0x1.4e6000p-1f, 0x1.d811b6p-13f), - (float2)(0x1.508000p-1f, 0x1.13cc00p-13f), - (float2)(0x1.52a000p-1f, 0x1.6932dep-16f), - (float2)(0x1.54a000p-1f, 0x1.246798p-13f), - (float2)(0x1.56a000p-1f, 0x1.f9d5b2p-13f), - (float2)(0x1.58c000p-1f, 0x1.5b6b9ap-14f), - (float2)(0x1.5ac000p-1f, 0x1.404c34p-13f), - (float2)(0x1.5cc000p-1f, 0x1.b1dc6cp-13f), - (float2)(0x1.5ee000p-1f, 0x1.54920ap-20f), - (float2)(0x1.60e000p-1f, 0x1.97a23cp-16f), - (float2)(0x1.62e000p-1f, 0x1.0bfbe8p-15f), -}; - -DECLARE_TABLE(float, LOG_INV_TBL, 129) = { - 0x1.000000p+1f, - 0x1.fc07f0p+0f, - 0x1.f81f82p+0f, - 0x1.f4465ap+0f, - 0x1.f07c20p+0f, - 0x1.ecc07cp+0f, - 0x1.e9131ap+0f, - 0x1.e573acp+0f, - 0x1.e1e1e2p+0f, - 0x1.de5d6ep+0f, - 0x1.dae608p+0f, - 0x1.d77b66p+0f, - 0x1.d41d42p+0f, - 0x1.d0cb58p+0f, - 0x1.cd8568p+0f, - 0x1.ca4b30p+0f, - 0x1.c71c72p+0f, - 0x1.c3f8f0p+0f, - 0x1.c0e070p+0f, - 0x1.bdd2b8p+0f, - 0x1.bacf92p+0f, - 0x1.b7d6c4p+0f, - 0x1.b4e81cp+0f, - 0x1.b20364p+0f, - 0x1.af286cp+0f, - 0x1.ac5702p+0f, - 0x1.a98ef6p+0f, - 0x1.a6d01ap+0f, - 0x1.a41a42p+0f, - 0x1.a16d40p+0f, - 0x1.9ec8eap+0f, - 0x1.9c2d14p+0f, - 0x1.99999ap+0f, - 0x1.970e50p+0f, - 0x1.948b10p+0f, - 0x1.920fb4p+0f, - 0x1.8f9c18p+0f, - 0x1.8d3018p+0f, - 0x1.8acb90p+0f, - 0x1.886e60p+0f, - 0x1.861862p+0f, - 0x1.83c978p+0f, - 0x1.818182p+0f, - 0x1.7f4060p+0f, - 0x1.7d05f4p+0f, - 0x1.7ad220p+0f, - 0x1.78a4c8p+0f, - 0x1.767dcep+0f, - 0x1.745d18p+0f, - 0x1.724288p+0f, - 0x1.702e06p+0f, - 0x1.6e1f76p+0f, - 0x1.6c16c2p+0f, - 0x1.6a13cep+0f, - 0x1.681682p+0f, - 0x1.661ec6p+0f, - 0x1.642c86p+0f, - 0x1.623fa8p+0f, - 0x1.605816p+0f, - 0x1.5e75bcp+0f, - 0x1.5c9882p+0f, - 0x1.5ac056p+0f, - 0x1.58ed24p+0f, - 0x1.571ed4p+0f, - 0x1.555556p+0f, - 0x1.539094p+0f, - 0x1.51d07ep+0f, - 0x1.501502p+0f, - 0x1.4e5e0ap+0f, - 0x1.4cab88p+0f, - 0x1.4afd6ap+0f, - 0x1.49539ep+0f, - 0x1.47ae14p+0f, - 0x1.460cbcp+0f, - 0x1.446f86p+0f, - 0x1.42d662p+0f, - 0x1.414142p+0f, - 0x1.3fb014p+0f, - 0x1.3e22ccp+0f, - 0x1.3c995ap+0f, - 0x1.3b13b2p+0f, - 0x1.3991c2p+0f, - 0x1.381382p+0f, - 0x1.3698e0p+0f, - 0x1.3521d0p+0f, - 0x1.33ae46p+0f, - 0x1.323e34p+0f, - 0x1.30d190p+0f, - 0x1.2f684cp+0f, - 0x1.2e025cp+0f, - 0x1.2c9fb4p+0f, - 0x1.2b404ap+0f, - 0x1.29e412p+0f, - 0x1.288b02p+0f, - 0x1.27350cp+0f, - 0x1.25e228p+0f, - 0x1.24924ap+0f, - 0x1.234568p+0f, - 0x1.21fb78p+0f, - 0x1.20b470p+0f, - 0x1.1f7048p+0f, - 0x1.1e2ef4p+0f, - 0x1.1cf06ap+0f, - 0x1.1bb4a4p+0f, - 0x1.1a7b96p+0f, - 0x1.194538p+0f, - 0x1.181182p+0f, - 0x1.16e068p+0f, - 0x1.15b1e6p+0f, - 0x1.1485f0p+0f, - 0x1.135c82p+0f, - 0x1.12358ep+0f, - 0x1.111112p+0f, - 0x1.0fef02p+0f, - 0x1.0ecf56p+0f, - 0x1.0db20ap+0f, - 0x1.0c9714p+0f, - 0x1.0b7e6ep+0f, - 0x1.0a6810p+0f, - 0x1.0953f4p+0f, - 0x1.084210p+0f, - 0x1.073260p+0f, - 0x1.0624dep+0f, - 0x1.051980p+0f, - 0x1.041042p+0f, - 0x1.03091cp+0f, - 0x1.020408p+0f, - 0x1.010102p+0f, - 0x1.000000p+0f, -}; - -DECLARE_TABLE(float2, LOG2_TBL, 129) = { - (float2)(0x0.000000p+0f, 0x0.000000p+0f), - (float2)(0x1.6f8000p-7f, 0x1.942dbap-17f), - (float2)(0x1.6e0000p-6f, 0x1.e5a170p-16f), - (float2)(0x1.118000p-5f, 0x1.347544p-15f), - (float2)(0x1.6b8000p-5f, 0x1.69bac6p-16f), - (float2)(0x1.c48000p-5f, 0x1.7eae42p-15f), - (float2)(0x1.0e8000p-4f, 0x1.9c4fd0p-15f), - (float2)(0x1.3a8000p-4f, 0x1.17ee92p-15f), - (float2)(0x1.660000p-4f, 0x1.fb7d64p-15f), - (float2)(0x1.918000p-4f, 0x1.42dc8cp-17f), - (float2)(0x1.bc8000p-4f, 0x1.0902b6p-18f), - (float2)(0x1.e70000p-4f, 0x1.7608bep-15f), - (float2)(0x1.088000p-3f, 0x1.162336p-13f), - (float2)(0x1.1d8000p-3f, 0x1.3465d4p-13f), - (float2)(0x1.328000p-3f, 0x1.74f13cp-14f), - (float2)(0x1.470000p-3f, 0x1.aa7e60p-13f), - (float2)(0x1.5c0000p-3f, 0x1.a39fbcp-19f), - (float2)(0x1.700000p-3f, 0x1.d0b53ap-13f), - (float2)(0x1.848000p-3f, 0x1.0af40ap-13f), - (float2)(0x1.988000p-3f, 0x1.b741dep-13f), - (float2)(0x1.ac8000p-3f, 0x1.d78b6cp-13f), - (float2)(0x1.c08000p-3f, 0x1.6db376p-13f), - (float2)(0x1.d48000p-3f, 0x1.ee4c32p-15f), - (float2)(0x1.e80000p-3f, 0x1.02f9d2p-13f), - (float2)(0x1.fb8000p-3f, 0x1.05ae40p-13f), - (float2)(0x1.078000p-2f, 0x1.0adbb0p-14f), - (float2)(0x1.110000p-2f, 0x1.83ed68p-13f), - (float2)(0x1.1a8000p-2f, 0x1.016ca4p-12f), - (float2)(0x1.240000p-2f, 0x1.01eac2p-12f), - (float2)(0x1.2d8000p-2f, 0x1.887e26p-13f), - (float2)(0x1.370000p-2f, 0x1.24cea4p-14f), - (float2)(0x1.400000p-2f, 0x1.918ec6p-12f), - (float2)(0x1.498000p-2f, 0x1.3c25e6p-13f), - (float2)(0x1.528000p-2f, 0x1.6f7f12p-12f), - (float2)(0x1.5c0000p-2f, 0x1.a39fbcp-18f), - (float2)(0x1.650000p-2f, 0x1.8fe466p-14f), - (float2)(0x1.6e0000p-2f, 0x1.10e6cep-13f), - (float2)(0x1.770000p-2f, 0x1.d2ba7ep-14f), - (float2)(0x1.800000p-2f, 0x1.4ac62cp-15f), - (float2)(0x1.888000p-2f, 0x1.a71cb8p-12f), - (float2)(0x1.918000p-2f, 0x1.dd448ep-13f), - (float2)(0x1.9a8000p-2f, 0x1.1c8f10p-21f), - (float2)(0x1.a30000p-2f, 0x1.bb053ep-13f), - (float2)(0x1.ab8000p-2f, 0x1.861e5ep-12f), - (float2)(0x1.b40000p-2f, 0x1.fafdcep-12f), - (float2)(0x1.bd0000p-2f, 0x1.e5d3cep-15f), - (float2)(0x1.c58000p-2f, 0x1.2fad28p-14f), - (float2)(0x1.ce0000p-2f, 0x1.492474p-15f), - (float2)(0x1.d60000p-2f, 0x1.d4f80cp-12f), - (float2)(0x1.de8000p-2f, 0x1.4ff510p-12f), - (float2)(0x1.e70000p-2f, 0x1.3550f2p-13f), - (float2)(0x1.ef0000p-2f, 0x1.b59ccap-12f), - (float2)(0x1.f78000p-2f, 0x1.42b464p-13f), - (float2)(0x1.ff8000p-2f, 0x1.5e66a0p-12f), - (float2)(0x1.038000p-1f, 0x1.f6a2e4p-11f), - (float2)(0x1.080000p-1f, 0x1.39e4fep-14f), - (float2)(0x1.0c0000p-1f, 0x1.0500d6p-13f), - (float2)(0x1.100000p-1f, 0x1.13b152p-13f), - (float2)(0x1.140000p-1f, 0x1.93f542p-14f), - (float2)(0x1.180000p-1f, 0x1.467b94p-16f), - (float2)(0x1.1b8000p-1f, 0x1.cc47a4p-11f), - (float2)(0x1.1f8000p-1f, 0x1.78f4c2p-11f), - (float2)(0x1.238000p-1f, 0x1.107508p-11f), - (float2)(0x1.278000p-1f, 0x1.2602c2p-12f), - (float2)(0x1.2b8000p-1f, 0x1.a39fbcp-20f), - (float2)(0x1.2f0000p-1f, 0x1.5a1d7ap-11f), - (float2)(0x1.330000p-1f, 0x1.3e355ap-12f), - (float2)(0x1.368000p-1f, 0x1.cffedap-11f), - (float2)(0x1.3a8000p-1f, 0x1.d9fd50p-12f), - (float2)(0x1.3e0000p-1f, 0x1.f64de6p-11f), - (float2)(0x1.420000p-1f, 0x1.d83f4cp-12f), - (float2)(0x1.458000p-1f, 0x1.cea628p-11f), - (float2)(0x1.498000p-1f, 0x1.3c25e6p-12f), - (float2)(0x1.4d0000p-1f, 0x1.5a96ccp-11f), - (float2)(0x1.510000p-1f, 0x1.18708ap-17f), - (float2)(0x1.548000p-1f, 0x1.374652p-12f), - (float2)(0x1.580000p-1f, 0x1.2089a6p-11f), - (float2)(0x1.5b8000p-1f, 0x1.93432cp-11f), - (float2)(0x1.5f0000p-1f, 0x1.f3fd06p-11f), - (float2)(0x1.630000p-1f, 0x1.0b8f54p-13f), - (float2)(0x1.668000p-1f, 0x1.004722p-12f), - (float2)(0x1.6a0000p-1f, 0x1.57cf2cp-12f), - (float2)(0x1.6d8000p-1f, 0x1.8cb53ap-12f), - (float2)(0x1.710000p-1f, 0x1.9f4d8ap-12f), - (float2)(0x1.748000p-1f, 0x1.8feb26p-12f), - (float2)(0x1.780000p-1f, 0x1.5edfeep-12f), - (float2)(0x1.7b8000p-1f, 0x1.0c7c9ap-12f), - (float2)(0x1.7f0000p-1f, 0x1.322182p-13f), - (float2)(0x1.828000p-1f, 0x1.3ab7cep-18f), - (float2)(0x1.858000p-1f, 0x1.a82c2cp-11f), - (float2)(0x1.890000p-1f, 0x1.3dd2c0p-11f), - (float2)(0x1.8c8000p-1f, 0x1.871da4p-12f), - (float2)(0x1.900000p-1f, 0x1.cc2c00p-14f), - (float2)(0x1.930000p-1f, 0x1.9fdb68p-11f), - (float2)(0x1.968000p-1f, 0x1.ed6956p-12f), - (float2)(0x1.9a0000p-1f, 0x1.f1a760p-14f), - (float2)(0x1.9d0000p-1f, 0x1.767f54p-11f), - (float2)(0x1.a08000p-1f, 0x1.3f6d26p-12f), - (float2)(0x1.a38000p-1f, 0x1.b9fce2p-11f), - (float2)(0x1.a70000p-1f, 0x1.8ae816p-12f), - (float2)(0x1.aa0000p-1f, 0x1.c23d60p-11f), - (float2)(0x1.ad8000p-1f, 0x1.60f388p-12f), - (float2)(0x1.b08000p-1f, 0x1.9049aep-11f), - (float2)(0x1.b40000p-1f, 0x1.8734a8p-13f), - (float2)(0x1.b70000p-1f, 0x1.2523d4p-11f), - (float2)(0x1.ba0000p-1f, 0x1.da6ce6p-11f), - (float2)(0x1.bd8000p-1f, 0x1.038e62p-12f), - (float2)(0x1.c08000p-1f, 0x1.1b511ep-11f), - (float2)(0x1.c38000p-1f, 0x1.a728b8p-11f), - (float2)(0x1.c70000p-1f, 0x1.2b5d22p-14f), - (float2)(0x1.ca0000p-1f, 0x1.2c6e54p-12f), - (float2)(0x1.cd0000p-1f, 0x1.f35064p-12f), - (float2)(0x1.d00000p-1f, 0x1.4fdb48p-11f), - (float2)(0x1.d30000p-1f, 0x1.98ec9ep-11f), - (float2)(0x1.d60000p-1f, 0x1.d4f80cp-11f), - (float2)(0x1.d98000p-1f, 0x1.0643d6p-17f), - (float2)(0x1.dc8000p-1f, 0x1.33567ep-14f), - (float2)(0x1.df8000p-1f, 0x1.e0410cp-14f), - (float2)(0x1.e28000p-1f, 0x1.142e0ep-13f), - (float2)(0x1.e58000p-1f, 0x1.063c88p-13f), - (float2)(0x1.e88000p-1f, 0x1.8d66c4p-14f), - (float2)(0x1.eb8000p-1f, 0x1.57e32ap-15f), - (float2)(0x1.ee0000p-1f, 0x1.ed1c6cp-11f), - (float2)(0x1.f10000p-1f, 0x1.b8a076p-11f), - (float2)(0x1.f40000p-1f, 0x1.7822f2p-11f), - (float2)(0x1.f70000p-1f, 0x1.2bbc3ap-11f), - (float2)(0x1.fa0000p-1f, 0x1.a708bap-12f), - (float2)(0x1.fd0000p-1f, 0x1.be4c7ep-13f), - (float2)(0x1.000000p+0f, 0x0.000000p+0f) -}; - -DECLARE_TABLE(uchar, PIBITS_TBL, ) = { - 224, 241, 27, 193, 12, 88, 33, 116, 53, 126, 196, 126, 237, 175, - 169, 75, 74, 41, 222, 231, 28, 244, 236, 197, 151, 175, 31, - 235, 158, 212, 181, 168, 127, 121, 154, 253, 24, 61, 221, 38, - 44, 159, 60, 251, 217, 180, 125, 180, 41, 104, 45, 70, 188, - 188, 63, 96, 22, 120, 255, 95, 226, 127, 236, 160, 228, 247, - 46, 126, 17, 114, 210, 231, 76, 13, 230, 88, 71, 230, 4, 249, - 125, 209, 154, 192, 113, 166, 19, 18, 237, 186, 212, 215, 8, - 162, 251, 156, 166, 196, 114, 172, 119, 248, 115, 72, 70, 39, - 168, 187, 36, 25, 128, 75, 55, 9, 233, 184, 145, 220, 134, 21, - 239, 122, 175, 142, 69, 249, 7, 65, 14, 241, 100, 86, 138, 109, - 3, 119, 211, 212, 71, 95, 157, 240, 167, 84, 16, 57, 185, 13, - 230, 139, 2, 0, 0, 0, 0, 0, 0, 0 -}; - -TABLE_FUNCTION(float2, LOGE_TBL, loge_tbl); -TABLE_FUNCTION(float, LOG_INV_TBL, log_inv_tbl); -TABLE_FUNCTION(float2, LOG2_TBL, log2_tbl); - -uint4 TABLE_MANGLE(pibits_tbl)(size_t idx) { - return *(__constant uint4 *)(PIBITS_TBL + idx); -} - -#ifdef cl_khr_fp64 - -DECLARE_TABLE(double2, LN_TBL, 65) = { - (double2)(0x0.0000000000000p+0, 0x0.0000000000000p+0), - (double2)(0x1.fc0a800000000p-7, 0x1.61f807c79f3dbp-28), - (double2)(0x1.f829800000000p-6, 0x1.873c1980267c8p-25), - (double2)(0x1.7745800000000p-5, 0x1.ec65b9f88c69ep-26), - (double2)(0x1.f0a3000000000p-5, 0x1.8022c54cc2f99p-26), - (double2)(0x1.341d700000000p-4, 0x1.2c37a3a125330p-25), - (double2)(0x1.6f0d200000000p-4, 0x1.15cad69737c93p-25), - (double2)(0x1.a926d00000000p-4, 0x1.d256ab1b285e9p-27), - (double2)(0x1.e270700000000p-4, 0x1.b8abcb97a7aa2p-26), - (double2)(0x1.0d77e00000000p-3, 0x1.f34239659a5dcp-25), - (double2)(0x1.2955280000000p-3, 0x1.e07fd48d30177p-25), - (double2)(0x1.44d2b00000000p-3, 0x1.b32df4799f4f6p-25), - (double2)(0x1.5ff3000000000p-3, 0x1.c29e4f4f21cf8p-25), - (double2)(0x1.7ab8900000000p-3, 0x1.086c848df1b59p-30), - (double2)(0x1.9525a80000000p-3, 0x1.cf456b4764130p-27), - (double2)(0x1.af3c900000000p-3, 0x1.3a02ffcb63398p-25), - (double2)(0x1.c8ff780000000p-3, 0x1.1e6a6886b0976p-25), - (double2)(0x1.e270700000000p-3, 0x1.b8abcb97a7aa2p-25), - (double2)(0x1.fb91800000000p-3, 0x1.b578f8aa35552p-25), - (double2)(0x1.0a324c0000000p-2, 0x1.139c871afb9fcp-25), - (double2)(0x1.1675c80000000p-2, 0x1.5d5d30701ce64p-25), - (double2)(0x1.22941c0000000p-2, 0x1.de7bcb2d12142p-25), - (double2)(0x1.2e8e280000000p-2, 0x1.d708e984e1664p-25), - (double2)(0x1.3a64c40000000p-2, 0x1.56945e9c72f36p-26), - (double2)(0x1.4618bc0000000p-2, 0x1.0e2f613e85bdap-29), - (double2)(0x1.51aad80000000p-2, 0x1.cb7e0b42724f6p-28), - (double2)(0x1.5d1bd80000000p-2, 0x1.fac04e52846c7p-25), - (double2)(0x1.686c800000000p-2, 0x1.e9b14aec442bep-26), - (double2)(0x1.739d7c0000000p-2, 0x1.b5de8034e7126p-25), - (double2)(0x1.7eaf800000000p-2, 0x1.dc157e1b259d3p-25), - (double2)(0x1.89a3380000000p-2, 0x1.b05096ad69c62p-28), - (double2)(0x1.9479400000000p-2, 0x1.c2116faba4cddp-26), - (double2)(0x1.9f323c0000000p-2, 0x1.65fcc25f95b47p-25), - (double2)(0x1.a9cec80000000p-2, 0x1.a9a08498d4850p-26), - (double2)(0x1.b44f740000000p-2, 0x1.de647b1465f77p-25), - (double2)(0x1.beb4d80000000p-2, 0x1.da71b7bf7861dp-26), - (double2)(0x1.c8ff7c0000000p-2, 0x1.e6a6886b09760p-28), - (double2)(0x1.d32fe40000000p-2, 0x1.f0075eab0ef64p-25), - (double2)(0x1.dd46a00000000p-2, 0x1.3071282fb989bp-28), - (double2)(0x1.e744240000000p-2, 0x1.0eb43c3f1bed2p-25), - (double2)(0x1.f128f40000000p-2, 0x1.faf06ecb35c84p-26), - (double2)(0x1.faf5880000000p-2, 0x1.ef1e63db35f68p-27), - (double2)(0x1.02552a0000000p-1, 0x1.69743fb1a71a5p-27), - (double2)(0x1.0723e40000000p-1, 0x1.c1cdf404e5796p-25), - (double2)(0x1.0be72e0000000p-1, 0x1.094aa0ada625ep-27), - (double2)(0x1.109f380000000p-1, 0x1.e2d4c96fde3ecp-25), - (double2)(0x1.154c3c0000000p-1, 0x1.2f4d5e9a98f34p-25), - (double2)(0x1.19ee6a0000000p-1, 0x1.467c96ecc5cbep-25), - (double2)(0x1.1e85f40000000p-1, 0x1.e7040d03dec5ap-25), - (double2)(0x1.23130c0000000p-1, 0x1.7bebf4282de36p-25), - (double2)(0x1.2795e00000000p-1, 0x1.289b11aeb783fp-25), - (double2)(0x1.2c0e9e0000000p-1, 0x1.a891d1772f538p-26), - (double2)(0x1.307d720000000p-1, 0x1.34f10be1fb591p-25), - (double2)(0x1.34e2880000000p-1, 0x1.d9ce1d316eb93p-25), - (double2)(0x1.393e0c0000000p-1, 0x1.3562a19a9c442p-25), - (double2)(0x1.3d90260000000p-1, 0x1.4e2adf548084cp-26), - (double2)(0x1.41d8fe0000000p-1, 0x1.08ce55cc8c97ap-26), - (double2)(0x1.4618bc0000000p-1, 0x1.0e2f613e85bdap-28), - (double2)(0x1.4a4f840000000p-1, 0x1.db03ebb0227bfp-25), - (double2)(0x1.4e7d800000000p-1, 0x1.1b75bb09cb098p-25), - (double2)(0x1.52a2d20000000p-1, 0x1.96f16abb9df22p-27), - (double2)(0x1.56bf9c0000000p-1, 0x1.5b3f399411c62p-25), - (double2)(0x1.5ad4040000000p-1, 0x1.86b3e59f65355p-26), - (double2)(0x1.5ee02a0000000p-1, 0x1.2482ceae1ac12p-26), - (double2)(0x1.62e42e0000000p-1, 0x1.efa39ef35793cp-25), -}; - -TABLE_FUNCTION(double2, LN_TBL, ln_tbl); - - -// Arrays atan_jby256_lead and atan_jby256_tail contain -// leading and trailing parts respectively of precomputed -// values of atan(j/256), for j = 16, 17, ..., 256. -// atan_jby256_lead contains the first 21 bits of precision, -// and atan_jby256_tail contains a further 53 bits precision. - -DECLARE_TABLE(double2, ATAN_JBY256_TBL, 241) = { - (double2)(0x1.ff55b00000000p-5, 0x1.6e59fbd38db2cp-26), - (double2)(0x1.0f99e00000000p-4, 0x1.4e3aa54dedf96p-25), - (double2)(0x1.1f86d00000000p-4, 0x1.7e105ab1bda88p-25), - (double2)(0x1.2f71900000000p-4, 0x1.8c5254d013fd0p-27), - (double2)(0x1.3f59f00000000p-4, 0x1.cf8ab3ad62670p-29), - (double2)(0x1.4f3fd00000000p-4, 0x1.9dca4bec80468p-26), - (double2)(0x1.5f23200000000p-4, 0x1.3f4b5ec98a8dap-26), - (double2)(0x1.6f03b00000000p-4, 0x1.b9d49619d81fep-25), - (double2)(0x1.7ee1800000000p-4, 0x1.3017887460934p-27), - (double2)(0x1.8ebc500000000p-4, 0x1.11e3eca0b9944p-26), - (double2)(0x1.9e94100000000p-4, 0x1.4f3f73c5a332ep-26), - (double2)(0x1.ae68a00000000p-4, 0x1.c71c8ae0e00a6p-26), - (double2)(0x1.be39e00000000p-4, 0x1.7cde0f86fbdc7p-25), - (double2)(0x1.ce07c00000000p-4, 0x1.70f328c889c72p-26), - (double2)(0x1.ddd2100000000p-4, 0x1.c07ae9b994efep-26), - (double2)(0x1.ed98c00000000p-4, 0x1.0c8021d7b1698p-27), - (double2)(0x1.fd5ba00000000p-4, 0x1.35585edb8cb22p-25), - (double2)(0x1.068d500000000p-3, 0x1.0842567b30e96p-24), - (double2)(0x1.0e6ad00000000p-3, 0x1.99e811031472ep-24), - (double2)(0x1.1646500000000p-3, 0x1.041821416bceep-25), - (double2)(0x1.1e1fa00000000p-3, 0x1.f6086e4dc96f4p-24), - (double2)(0x1.25f6e00000000p-3, 0x1.71a535c5f1b58p-27), - (double2)(0x1.2dcbd00000000p-3, 0x1.65f743fe63ca1p-24), - (double2)(0x1.359e800000000p-3, 0x1.dbd733472d014p-24), - (double2)(0x1.3d6ee00000000p-3, 0x1.d18cc4d8b0d1dp-24), - (double2)(0x1.453ce00000000p-3, 0x1.8c12553c8fb29p-24), - (double2)(0x1.4d08700000000p-3, 0x1.53b49e2e8f991p-24), - (double2)(0x1.54d1800000000p-3, 0x1.7422ae148c141p-24), - (double2)(0x1.5c98100000000p-3, 0x1.e3ec269df56a8p-27), - (double2)(0x1.645bf00000000p-3, 0x1.ff6754e7e0ac9p-24), - (double2)(0x1.6c1d400000000p-3, 0x1.131267b1b5aadp-24), - (double2)(0x1.73dbd00000000p-3, 0x1.d14fa403a94bcp-24), - (double2)(0x1.7b97b00000000p-3, 0x1.2f396c089a3d8p-25), - (double2)(0x1.8350b00000000p-3, 0x1.c731d78fa95bbp-24), - (double2)(0x1.8b06e00000000p-3, 0x1.c50f385177399p-24), - (double2)(0x1.92ba300000000p-3, 0x1.f41409c6f2c20p-25), - (double2)(0x1.9a6a800000000p-3, 0x1.d2d90c4c39ec0p-24), - (double2)(0x1.a217e00000000p-3, 0x1.80420696f2106p-25), - (double2)(0x1.a9c2300000000p-3, 0x1.b40327943a2e8p-27), - (double2)(0x1.b169600000000p-3, 0x1.5d35e02f3d2a2p-25), - (double2)(0x1.b90d700000000p-3, 0x1.4a498288117b0p-25), - (double2)(0x1.c0ae500000000p-3, 0x1.35da119afb324p-25), - (double2)(0x1.c84bf00000000p-3, 0x1.14e85cdb9a908p-24), - (double2)(0x1.cfe6500000000p-3, 0x1.38754e5547b9ap-25), - (double2)(0x1.d77d500000000p-3, 0x1.be40ae6ce3246p-24), - (double2)(0x1.df11000000000p-3, 0x1.0c993b3bea7e7p-24), - (double2)(0x1.e6a1400000000p-3, 0x1.1d2dd89ac3359p-24), - (double2)(0x1.ee2e100000000p-3, 0x1.1476603332c46p-25), - (double2)(0x1.f5b7500000000p-3, 0x1.f25901bac55b7p-24), - (double2)(0x1.fd3d100000000p-3, 0x1.f881b7c826e28p-24), - (double2)(0x1.025fa00000000p-2, 0x1.441996d698d20p-24), - (double2)(0x1.061ee00000000p-2, 0x1.407ac521ea089p-23), - (double2)(0x1.09dc500000000p-2, 0x1.2fb0c6c4b1723p-23), - (double2)(0x1.0d97e00000000p-2, 0x1.ca135966a3e18p-23), - (double2)(0x1.1151a00000000p-2, 0x1.b1218e4d646e4p-25), - (double2)(0x1.1509700000000p-2, 0x1.d4e72a350d288p-25), - (double2)(0x1.18bf500000000p-2, 0x1.4617e2f04c329p-23), - (double2)(0x1.1c73500000000p-2, 0x1.096ec41e82650p-25), - (double2)(0x1.2025500000000p-2, 0x1.9f91f25773e6ep-24), - (double2)(0x1.23d5600000000p-2, 0x1.59c0820f1d674p-25), - (double2)(0x1.2783700000000p-2, 0x1.02bf7a2df1064p-25), - (double2)(0x1.2b2f700000000p-2, 0x1.fb36bfc40508fp-23), - (double2)(0x1.2ed9800000000p-2, 0x1.ea08f3f8dc892p-24), - (double2)(0x1.3281800000000p-2, 0x1.3ed6254656a0ep-24), - (double2)(0x1.3627700000000p-2, 0x1.b83f5e5e69c58p-25), - (double2)(0x1.39cb400000000p-2, 0x1.d6ec2af768592p-23), - (double2)(0x1.3d6d100000000p-2, 0x1.493889a226f94p-25), - (double2)(0x1.410cb00000000p-2, 0x1.5ad8fa65279bap-23), - (double2)(0x1.44aa400000000p-2, 0x1.b615784d45434p-25), - (double2)(0x1.4845a00000000p-2, 0x1.09a184368f145p-23), - (double2)(0x1.4bdee00000000p-2, 0x1.61a2439b0d91cp-24), - (double2)(0x1.4f75f00000000p-2, 0x1.ce1a65e39a978p-24), - (double2)(0x1.530ad00000000p-2, 0x1.32a39a93b6a66p-23), - (double2)(0x1.569d800000000p-2, 0x1.1c3699af804e7p-23), - (double2)(0x1.5a2e000000000p-2, 0x1.75e0f4e44ede8p-26), - (double2)(0x1.5dbc300000000p-2, 0x1.f77ced1a7a83bp-23), - (double2)(0x1.6148400000000p-2, 0x1.84e7f0cb1b500p-29), - (double2)(0x1.64d1f00000000p-2, 0x1.ec6b838b02dfep-23), - (double2)(0x1.6859700000000p-2, 0x1.3ebf4dfbeda87p-23), - (double2)(0x1.6bdea00000000p-2, 0x1.9397aed9cb475p-23), - (double2)(0x1.6f61900000000p-2, 0x1.07937bc239c54p-24), - (double2)(0x1.72e2200000000p-2, 0x1.aa754553131b6p-23), - (double2)(0x1.7660700000000p-2, 0x1.4a05d407c45dcp-24), - (double2)(0x1.79dc600000000p-2, 0x1.132231a206dd0p-23), - (double2)(0x1.7d56000000000p-2, 0x1.2d8ecfdd69c88p-24), - (double2)(0x1.80cd400000000p-2, 0x1.a852c74218606p-24), - (double2)(0x1.8442200000000p-2, 0x1.71bf2baeebb50p-23), - (double2)(0x1.87b4b00000000p-2, 0x1.83d7db7491820p-27), - (double2)(0x1.8b24d00000000p-2, 0x1.ca50d92b6da14p-25), - (double2)(0x1.8e92900000000p-2, 0x1.6f5cde8530298p-26), - (double2)(0x1.91fde00000000p-2, 0x1.f343198910740p-24), - (double2)(0x1.9566d00000000p-2, 0x1.0e8d241ccd80ap-24), - (double2)(0x1.98cd500000000p-2, 0x1.1535ac619e6c8p-24), - (double2)(0x1.9c31600000000p-2, 0x1.7316041c36cd2p-24), - (double2)(0x1.9f93000000000p-2, 0x1.985a000637d8ep-24), - (double2)(0x1.a2f2300000000p-2, 0x1.f2f29858c0a68p-25), - (double2)(0x1.a64ee00000000p-2, 0x1.879847f96d909p-23), - (double2)(0x1.a9a9200000000p-2, 0x1.ab3d319e12e42p-23), - (double2)(0x1.ad00f00000000p-2, 0x1.5088162dfc4c2p-24), - (double2)(0x1.b056400000000p-2, 0x1.05749a1cd9d8cp-25), - (double2)(0x1.b3a9100000000p-2, 0x1.da65c6c6b8618p-26), - (double2)(0x1.b6f9600000000p-2, 0x1.739bf7df1ad64p-25), - (double2)(0x1.ba47300000000p-2, 0x1.bc31252aa3340p-25), - (double2)(0x1.bd92800000000p-2, 0x1.e528191ad3aa8p-26), - (double2)(0x1.c0db400000000p-2, 0x1.929d93df19f18p-23), - (double2)(0x1.c421900000000p-2, 0x1.ff11eb693a080p-26), - (double2)(0x1.c765500000000p-2, 0x1.55ae3f145a3a0p-27), - (double2)(0x1.caa6800000000p-2, 0x1.cbcd8c6c0ca82p-24), - (double2)(0x1.cde5300000000p-2, 0x1.0cb04d425d304p-24), - (double2)(0x1.d121500000000p-2, 0x1.9adfcab5be678p-24), - (double2)(0x1.d45ae00000000p-2, 0x1.93d90c5662508p-23), - (double2)(0x1.d791f00000000p-2, 0x1.68489bd35ff40p-24), - (double2)(0x1.dac6700000000p-2, 0x1.586ed3da2b7e0p-28), - (double2)(0x1.ddf8500000000p-2, 0x1.7604d2e850eeep-23), - (double2)(0x1.e127b00000000p-2, 0x1.ac1d12bfb53d8p-24), - (double2)(0x1.e454800000000p-2, 0x1.9b3d468274740p-28), - (double2)(0x1.e77eb00000000p-2, 0x1.fc5d68d10e53cp-24), - (double2)(0x1.eaa6500000000p-2, 0x1.8f9e51884becbp-23), - (double2)(0x1.edcb600000000p-2, 0x1.a87f0869c06d1p-23), - (double2)(0x1.f0ede00000000p-2, 0x1.31e7279f685fap-23), - (double2)(0x1.f40dd00000000p-2, 0x1.6a8282f9719b0p-27), - (double2)(0x1.f72b200000000p-2, 0x1.0d2724a8a44e0p-25), - (double2)(0x1.fa45d00000000p-2, 0x1.a60524b11ad4ep-23), - (double2)(0x1.fd5e000000000p-2, 0x1.75fdf832750f0p-26), - (double2)(0x1.0039c00000000p-1, 0x1.cf06902e4cd36p-23), - (double2)(0x1.01c3400000000p-1, 0x1.e82422d4f6d10p-25), - (double2)(0x1.034b700000000p-1, 0x1.24a091063e6c0p-26), - (double2)(0x1.04d2500000000p-1, 0x1.8a1a172dc6f38p-24), - (double2)(0x1.0657e00000000p-1, 0x1.29b6619f8a92dp-22), - (double2)(0x1.07dc300000000p-1, 0x1.9274d9c1b70c8p-24), - (double2)(0x1.095f300000000p-1, 0x1.0c34b1fbb7930p-26), - (double2)(0x1.0ae0e00000000p-1, 0x1.639866c20eb50p-25), - (double2)(0x1.0c61400000000p-1, 0x1.6d6d0f6832e9ep-23), - (double2)(0x1.0de0500000000p-1, 0x1.af54def99f25ep-22), - (double2)(0x1.0f5e200000000p-1, 0x1.16cfc52a00262p-22), - (double2)(0x1.10daa00000000p-1, 0x1.dcc1e83569c32p-23), - (double2)(0x1.1255d00000000p-1, 0x1.37f7a551ed425p-22), - (double2)(0x1.13cfb00000000p-1, 0x1.f6360adc98887p-22), - (double2)(0x1.1548500000000p-1, 0x1.2c6ec8d35a2c1p-22), - (double2)(0x1.16bfa00000000p-1, 0x1.bd44df84cb036p-23), - (double2)(0x1.1835a00000000p-1, 0x1.117cf826e310ep-22), - (double2)(0x1.19aa500000000p-1, 0x1.ca533f332cfc9p-22), - (double2)(0x1.1b1dc00000000p-1, 0x1.0f208509dbc2ep-22), - (double2)(0x1.1c8fe00000000p-1, 0x1.cd07d93c945dep-23), - (double2)(0x1.1e00b00000000p-1, 0x1.57bdfd67e6d72p-22), - (double2)(0x1.1f70400000000p-1, 0x1.aab89c516c658p-24), - (double2)(0x1.20de800000000p-1, 0x1.3e823b1a1b8a0p-25), - (double2)(0x1.224b700000000p-1, 0x1.307464a9d6d3cp-23), - (double2)(0x1.23b7100000000p-1, 0x1.c5993cd438843p-22), - (double2)(0x1.2521700000000p-1, 0x1.ba2fca02ab554p-22), - (double2)(0x1.268a900000000p-1, 0x1.01a5b6983a268p-23), - (double2)(0x1.27f2600000000p-1, 0x1.273d1b350efc8p-25), - (double2)(0x1.2958e00000000p-1, 0x1.64c238c37b0c6p-23), - (double2)(0x1.2abe200000000p-1, 0x1.aded07370a300p-25), - (double2)(0x1.2c22100000000p-1, 0x1.78091197eb47ep-23), - (double2)(0x1.2d84c00000000p-1, 0x1.4b0f245e0dabcp-24), - (double2)(0x1.2ee6200000000p-1, 0x1.080d9794e2eafp-22), - (double2)(0x1.3046400000000p-1, 0x1.d4ec242b60c76p-23), - (double2)(0x1.31a5200000000p-1, 0x1.221d2f940caa0p-27), - (double2)(0x1.3302b00000000p-1, 0x1.cdbc42b2bba5cp-24), - (double2)(0x1.345f000000000p-1, 0x1.cce37bb440840p-25), - (double2)(0x1.35ba000000000p-1, 0x1.6c1d999cf1dd0p-22), - (double2)(0x1.3713d00000000p-1, 0x1.bed8a07eb0870p-26), - (double2)(0x1.386c500000000p-1, 0x1.69ed88f490e3cp-24), - (double2)(0x1.39c3900000000p-1, 0x1.cd41719b73ef0p-25), - (double2)(0x1.3b19800000000p-1, 0x1.cbc4ac95b41b7p-22), - (double2)(0x1.3c6e400000000p-1, 0x1.238f1b890f5d7p-22), - (double2)(0x1.3dc1c00000000p-1, 0x1.50c4282259cc4p-24), - (double2)(0x1.3f13f00000000p-1, 0x1.713d2de87b3e2p-22), - (double2)(0x1.4064f00000000p-1, 0x1.1d5a7d2255276p-23), - (double2)(0x1.41b4a00000000p-1, 0x1.c0dfd48227ac1p-22), - (double2)(0x1.4303200000000p-1, 0x1.1c964dab76753p-22), - (double2)(0x1.4450600000000p-1, 0x1.6de56d5704496p-23), - (double2)(0x1.459c600000000p-1, 0x1.4aeb71fd19968p-23), - (double2)(0x1.46e7200000000p-1, 0x1.fbf91c57b1918p-23), - (double2)(0x1.4830a00000000p-1, 0x1.d6bef7fbe5d9ap-22), - (double2)(0x1.4978f00000000p-1, 0x1.464d3dc249066p-22), - (double2)(0x1.4ac0000000000p-1, 0x1.638e2ec4d9073p-22), - (double2)(0x1.4c05e00000000p-1, 0x1.16f4a7247ea7cp-24), - (double2)(0x1.4d4a800000000p-1, 0x1.1a0a740f1d440p-28), - (double2)(0x1.4e8de00000000p-1, 0x1.6edbb0114a33cp-23), - (double2)(0x1.4fd0100000000p-1, 0x1.dbee8bf1d513cp-24), - (double2)(0x1.5111000000000p-1, 0x1.5b8bdb0248f73p-22), - (double2)(0x1.5250c00000000p-1, 0x1.7de3d3f5eac64p-22), - (double2)(0x1.538f500000000p-1, 0x1.ee24187ae448ap-23), - (double2)(0x1.54cca00000000p-1, 0x1.e06c591ec5192p-22), - (double2)(0x1.5608d00000000p-1, 0x1.4e3861a332738p-24), - (double2)(0x1.5743c00000000p-1, 0x1.a9599dcc2bfe4p-24), - (double2)(0x1.587d800000000p-1, 0x1.f732fbad43468p-25), - (double2)(0x1.59b6000000000p-1, 0x1.eb9f573b727d9p-22), - (double2)(0x1.5aed600000000p-1, 0x1.8b212a2eb9897p-22), - (double2)(0x1.5c23900000000p-1, 0x1.384884c167215p-22), - (double2)(0x1.5d58900000000p-1, 0x1.0e2d363020051p-22), - (double2)(0x1.5e8c600000000p-1, 0x1.2820879fbd022p-22), - (double2)(0x1.5fbf000000000p-1, 0x1.a1ab9893e4b30p-22), - (double2)(0x1.60f0800000000p-1, 0x1.2d1b817a24478p-23), - (double2)(0x1.6220d00000000p-1, 0x1.15d7b8ded4878p-25), - (double2)(0x1.634ff00000000p-1, 0x1.8968f9db3a5e4p-24), - (double2)(0x1.647de00000000p-1, 0x1.71c4171fe135fp-22), - (double2)(0x1.65aab00000000p-1, 0x1.6d80f605d0d8cp-22), - (double2)(0x1.66d6600000000p-1, 0x1.c91f043691590p-24), - (double2)(0x1.6800e00000000p-1, 0x1.39f8a15fce2b2p-23), - (double2)(0x1.692a400000000p-1, 0x1.55beda9d94b80p-27), - (double2)(0x1.6a52700000000p-1, 0x1.b12c15d60949ap-23), - (double2)(0x1.6b79800000000p-1, 0x1.24167b312bfe3p-22), - (double2)(0x1.6c9f700000000p-1, 0x1.0ab8633070277p-22), - (double2)(0x1.6dc4400000000p-1, 0x1.54554ebbc80eep-23), - (double2)(0x1.6ee7f00000000p-1, 0x1.0204aef5a4bb8p-25), - (double2)(0x1.700a700000000p-1, 0x1.8af08c679cf2cp-22), - (double2)(0x1.712be00000000p-1, 0x1.0852a330ae6c8p-22), - (double2)(0x1.724c300000000p-1, 0x1.6d3eb9ec32916p-23), - (double2)(0x1.736b600000000p-1, 0x1.685cb7fcbbafep-23), - (double2)(0x1.7489700000000p-1, 0x1.1f751c1e0bd95p-22), - (double2)(0x1.75a6700000000p-1, 0x1.705b1b0f72560p-26), - (double2)(0x1.76c2400000000p-1, 0x1.b98d8d808ca92p-22), - (double2)(0x1.77dd100000000p-1, 0x1.2ea22c75cc980p-25), - (double2)(0x1.78f6b00000000p-1, 0x1.7aba62bca0350p-22), - (double2)(0x1.7a0f400000000p-1, 0x1.d73833442278cp-22), - (double2)(0x1.7b26c00000000p-1, 0x1.5a5ca1fb18bf9p-22), - (double2)(0x1.7c3d300000000p-1, 0x1.1a6092b6ecf28p-25), - (double2)(0x1.7d52800000000p-1, 0x1.44fd049aac104p-24), - (double2)(0x1.7e66c00000000p-1, 0x1.c114fd8df5180p-29), - (double2)(0x1.7f79e00000000p-1, 0x1.5972f130feae5p-22), - (double2)(0x1.808c000000000p-1, 0x1.ca034a55fe198p-24), - (double2)(0x1.819d000000000p-1, 0x1.6e2b149990227p-22), - (double2)(0x1.82ad000000000p-1, 0x1.b00000294592cp-24), - (double2)(0x1.83bbe00000000p-1, 0x1.8b9bdc442620ep-22), - (double2)(0x1.84c9c00000000p-1, 0x1.d94fdfabf3e4ep-23), - (double2)(0x1.85d6900000000p-1, 0x1.5db30b145ad9ap-23), - (double2)(0x1.86e2500000000p-1, 0x1.e3e1eb95022b0p-23), - (double2)(0x1.87ed000000000p-1, 0x1.d5b8b45442bd6p-22), - (double2)(0x1.88f6b00000000p-1, 0x1.7a046231ecd2ep-22), - (double2)(0x1.89ff500000000p-1, 0x1.feafe3ef55232p-22), - (double2)(0x1.8b06f00000000p-1, 0x1.839e7bfd78267p-22), - (double2)(0x1.8c0d900000000p-1, 0x1.45cf49d6fa900p-25), - (double2)(0x1.8d13200000000p-1, 0x1.be3132b27f380p-27), - (double2)(0x1.8e17a00000000p-1, 0x1.533980bb84f9fp-22), - (double2)(0x1.8f1b300000000p-1, 0x1.889e2ce3ba390p-26), - (double2)(0x1.901db00000000p-1, 0x1.f7778c3ad0cc8p-24), - (double2)(0x1.911f300000000p-1, 0x1.46660cec4eba2p-23), - (double2)(0x1.921fb00000000p-1, 0x1.5110b4611a626p-23), -}; - -DECLARE_TABLE(double2, TWO_TO_JBY64_EP, 64) = { - (double2)(0x1.0000000000000p+0, 0x0.0000000000000p+0), - (double2)(0x1.02c9a30000000p+0, 0x1.cef00c1dcdef9p-25), - (double2)(0x1.059b0d0000000p+0, 0x1.8ac2ba1d73e2ap-27), - (double2)(0x1.0874510000000p+0, 0x1.0eb37901186bep-25), - (double2)(0x1.0b55860000000p+0, 0x1.9f3121ec53172p-25), - (double2)(0x1.0e3ec30000000p+0, 0x1.69e8d10103a17p-27), - (double2)(0x1.11301d0000000p+0, 0x1.25b50a4ebbf1ap-32), - (double2)(0x1.1429aa0000000p+0, 0x1.d525bbf668203p-25), - (double2)(0x1.172b830000000p+0, 0x1.8faa2f5b9bef9p-25), - (double2)(0x1.1a35be0000000p+0, 0x1.6df96ea796d31p-25), - (double2)(0x1.1d48730000000p+0, 0x1.68b9aa7805b80p-28), - (double2)(0x1.2063b80000000p+0, 0x1.0c519ac771dd6p-25), - (double2)(0x1.2387a60000000p+0, 0x1.ceac470cd83f5p-25), - (double2)(0x1.26b4560000000p+0, 0x1.789f37495e99cp-26), - (double2)(0x1.29e9df0000000p+0, 0x1.47f7b84b09745p-26), - (double2)(0x1.2d285a0000000p+0, 0x1.b900c2d002475p-26), - (double2)(0x1.306fe00000000p+0, 0x1.4636e2a5bd1abp-25), - (double2)(0x1.33c08b0000000p+0, 0x1.320b7fa64e430p-27), - (double2)(0x1.371a730000000p+0, 0x1.ceaa72a9c5154p-26), - (double2)(0x1.3a7db30000000p+0, 0x1.3967fdba86f24p-26), - (double2)(0x1.3dea640000000p+0, 0x1.82468446b6824p-25), - (double2)(0x1.4160a20000000p+0, 0x1.f72e29f84325bp-28), - (double2)(0x1.44e0860000000p+0, 0x1.8624b40c4dbd0p-30), - (double2)(0x1.486a2b0000000p+0, 0x1.704f3404f068ep-26), - (double2)(0x1.4bfdad0000000p+0, 0x1.4d8a89c750e5ep-26), - (double2)(0x1.4f9b270000000p+0, 0x1.a74b29ab4cf62p-26), - (double2)(0x1.5342b50000000p+0, 0x1.a753e077c2a0fp-26), - (double2)(0x1.56f4730000000p+0, 0x1.ad49f699bb2c0p-26), - (double2)(0x1.5ab07d0000000p+0, 0x1.a90a852b19260p-25), - (double2)(0x1.5e76f10000000p+0, 0x1.6b48521ba6f93p-26), - (double2)(0x1.6247eb0000000p+0, 0x1.d2ac258f87d03p-31), - (double2)(0x1.6623880000000p+0, 0x1.2a91124893ecfp-27), - (double2)(0x1.6a09e60000000p+0, 0x1.9fcef32422cbep-26), - (double2)(0x1.6dfb230000000p+0, 0x1.8ca345de441c5p-25), - (double2)(0x1.71f75e0000000p+0, 0x1.1d8bee7ba46e1p-25), - (double2)(0x1.75feb50000000p+0, 0x1.9099f22fdba6ap-26), - (double2)(0x1.7a11470000000p+0, 0x1.f580c36bea881p-27), - (double2)(0x1.7e2f330000000p+0, 0x1.b3d398841740ap-26), - (double2)(0x1.8258990000000p+0, 0x1.2999c25159f11p-25), - (double2)(0x1.868d990000000p+0, 0x1.68925d901c83bp-25), - (double2)(0x1.8ace540000000p+0, 0x1.15506dadd3e2ap-27), - (double2)(0x1.8f1ae90000000p+0, 0x1.22aee6c57304ep-25), - (double2)(0x1.93737b0000000p+0, 0x1.9b8bc9e8a0387p-29), - (double2)(0x1.97d8290000000p+0, 0x1.fbc9c9f173d24p-25), - (double2)(0x1.9c49180000000p+0, 0x1.51f8480e3e235p-27), - (double2)(0x1.a0c6670000000p+0, 0x1.6bbcac96535b5p-25), - (double2)(0x1.a5503b0000000p+0, 0x1.1f12ae45a1224p-27), - (double2)(0x1.a9e6b50000000p+0, 0x1.5e7f6fd0fac90p-26), - (double2)(0x1.ae89f90000000p+0, 0x1.2b5a75abd0e69p-25), - (double2)(0x1.b33a2b0000000p+0, 0x1.09e2bf5ed7fa1p-25), - (double2)(0x1.b7f76f0000000p+0, 0x1.7daf237553d84p-27), - (double2)(0x1.bcc1e90000000p+0, 0x1.2f074891ee83dp-30), - (double2)(0x1.c199bd0000000p+0, 0x1.b0aa538444196p-25), - (double2)(0x1.c67f120000000p+0, 0x1.cafa29694426fp-25), - (double2)(0x1.cb720d0000000p+0, 0x1.9df20d22a0797p-25), - (double2)(0x1.d072d40000000p+0, 0x1.40f12f71a1e45p-25), - (double2)(0x1.d5818d0000000p+0, 0x1.9f7490e4bb40bp-25), - (double2)(0x1.da9e600000000p+0, 0x1.ed9942b84600dp-27), - (double2)(0x1.dfc9730000000p+0, 0x1.bdcdaf5cb4656p-27), - (double2)(0x1.e502ee0000000p+0, 0x1.e2cffd89cf44cp-26), - (double2)(0x1.ea4afa0000000p+0, 0x1.52486cc2c7b9dp-27), - (double2)(0x1.efa1be0000000p+0, 0x1.cc2b44eee3fa4p-25), - (double2)(0x1.f507650000000p+0, 0x1.6dc8a80ce9f09p-25), - (double2)(0x1.fa7c180000000p+0, 0x1.9e90d82e90a7ep-28) - -}; - - -TABLE_FUNCTION(double2, ATAN_JBY256_TBL, atan_jby256_tbl); -TABLE_FUNCTION(double2, TWO_TO_JBY64_EP, two_to_jby64_ep_tbl); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/tables.h b/libclc/generic/lib/math/tables.h deleted file mode 100644 index 1348fe162c1e..000000000000 --- a/libclc/generic/lib/math/tables.h +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#define TABLE_SPACE __constant - -#define TABLE_MANGLE(NAME) __clc_##NAME - -#define DECLARE_TABLE(TYPE,NAME,LENGTH) \ - TABLE_SPACE TYPE NAME [ LENGTH ] - -#define TABLE_FUNCTION(TYPE,TABLE,NAME) \ - TYPE TABLE_MANGLE(NAME)(size_t idx) { \ - return TABLE[idx]; \ - } - -#define TABLE_FUNCTION_DECL(TYPE, NAME) \ - TYPE TABLE_MANGLE(NAME)(size_t idx); - -#define USE_TABLE(NAME, IDX) \ - TABLE_MANGLE(NAME)(IDX) - -TABLE_FUNCTION_DECL(float2, loge_tbl); -TABLE_FUNCTION_DECL(float, log_inv_tbl); -TABLE_FUNCTION_DECL(float2, log2_tbl); -TABLE_FUNCTION_DECL(uint4, pibits_tbl); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -TABLE_FUNCTION_DECL(double2, ln_tbl); -TABLE_FUNCTION_DECL(double2, atan_jby256_tbl); -TABLE_FUNCTION_DECL(double2, two_to_jby64_ep_tbl); -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/math/tan.cl b/libclc/generic/lib/math/tan.cl deleted file mode 100644 index a447999ea8b9..000000000000 --- a/libclc/generic/lib/math/tan.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/math/tan.inc b/libclc/generic/lib/math/tan.inc deleted file mode 100644 index b9ce33ef8231..000000000000 --- a/libclc/generic/lib/math/tan.inc +++ /dev/null @@ -1,17 +0,0 @@ -/* - * Note: tan(x) = sin(x)/cos(x) also, but the final assembly ends up being - * twice as long for R600 (maybe for others as well). - */ - -#if __CLC_FPSIZE == 32 -#define __CLC_CONST(x) x ## f -#else -#define __CLC_CONST(x) x -#endif - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE tan(__CLC_GENTYPE x) { - __CLC_GENTYPE sinx = sin(x); - return sinx / sqrt( (__CLC_GENTYPE) __CLC_CONST(1.0) - (sinx*sinx) ); -} - -#undef __CLC_CONST diff --git a/libclc/generic/lib/math/tanh.cl b/libclc/generic/lib/math/tanh.cl deleted file mode 100644 index e9c4079ff311..000000000000 --- a/libclc/generic/lib/math/tanh.cl +++ /dev/null @@ -1,146 +0,0 @@ -/* - * Copyright (c) 2014 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "math.h" -#include "../clcmacro.h" - -_CLC_OVERLOAD _CLC_DEF float tanh(float x) -{ - // The definition of tanh(x) is sinh(x)/cosh(x), which is also equivalent - // to the following three formulae: - // 1. (exp(x) - exp(-x))/(exp(x) + exp(-x)) - // 2. (1 - (2/(exp(2*x) + 1 ))) - // 3. (exp(2*x) - 1)/(exp(2*x) + 1) - // but computationally, some formulae are better on some ranges. - - const float large_threshold = 0x1.0a2b24p+3f; - - uint ux = as_uint(x); - uint aux = ux & EXSIGNBIT_SP32; - uint xs = ux ^ aux; - - float y = as_float(aux); - float y2 = y*y; - - float a1 = mad(y2, - mad(y2, 0.4891631088530669873e-4F, -0.14628356048797849e-2F), - -0.28192806108402678e0F); - float b1 = mad(y2, 0.3427017942262751343e0F, 0.845784192581041099e0F); - - float a2 = mad(y2, - mad(y2, 0.3827534993599483396e-4F, -0.12325644183611929e-2F), - -0.24069858695196524e0F); - float b2 = mad(y2, 0.292529068698052819e0F, 0.72209738473684982e0F); - - int c = y < 0.9f; - float a = c ? a1 : a2; - float b = c ? b1 : b2; - float zlo = mad(MATH_DIVIDE(a, b), y*y2, y); - - float p = exp(2.0f * y) + 1.0f; - float zhi = 1.0F - MATH_DIVIDE(2.0F, p); - - float z = y <= 1.0f ? zlo : zhi; - z = as_float(xs | as_uint(z)); - - // Edge cases - float sone = as_float(0x3f800000U | xs); - z = y > large_threshold ? sone : z; - z = aux < 0x39000000 | aux > 0x7f800000 ? x : z; - - return z; -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, float, tanh, float); - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -_CLC_OVERLOAD _CLC_DEF double tanh(double x) -{ - // The definition of tanh(x) is sinh(x)/cosh(x), which is also equivalent - // to the following three formulae: - // 1. (exp(x) - exp(-x))/(exp(x) + exp(-x)) - // 2. (1 - (2/(exp(2*x) + 1 ))) - // 3. (exp(2*x) - 1)/(exp(2*x) + 1) - // but computationally, some formulae are better on some ranges. - - // The point at which e^-x is insignificant compared to e^x = ln(2^27) - const double large_threshold = 0x1.2b708872320e2p+4; - - ulong ux = as_ulong(x); - ulong ax = ux & ~SIGNBIT_DP64; - ulong sx = ux ^ ax; - double y = as_double(ax); - double y2 = y * y; - - // y < 0.9 - double znl = fma(y2, - fma(y2, - fma(y2, -0.142077926378834722618091e-7, -0.200047621071909498730453e-3), - -0.176016349003044679402273e-1), - -0.274030424656179760118928e0); - - double zdl = fma(y2, - fma(y2, - fma(y2, 0.2091140262529164482568557e-3, 0.201562166026937652780575e-1), - 0.381641414288328849317962e0), - 0.822091273968539282568011e0); - - // 0.9 <= y <= 1 - double znm = fma(y2, - fma(y2, - fma(y2, -0.115475878996143396378318e-7, -0.165597043903549960486816e-3), - -0.146173047288731678404066e-1), - -0.227793870659088295252442e0); - - double zdm = fma(y2, - fma(y2, - fma(y2, 0.173076050126225961768710e-3, 0.167358775461896562588695e-1), - 0.317204558977294374244770e0), - 0.683381611977295894959554e0); - - int c = y < 0.9; - double zn = c ? znl : znm; - double zd = c ? zdl : zdm; - double z = y + y*y2 * MATH_DIVIDE(zn, zd); - - // y > 1 - double p = exp(2.0 * y) + 1.0; - double zg = 1.0 - 2.0 / p; - - z = y > 1.0 ? zg : z; - - // Other cases - z = y < 0x1.0p-28 | ax > PINFBITPATT_DP64 ? x : z; - - z = y > large_threshold ? 1.0 : z; - - return as_double(sx | as_ulong(z)); -} - -_CLC_UNARY_VECTORIZE(_CLC_OVERLOAD _CLC_DEF, double, tanh, double); - -#endif // cl_khr_fp64 diff --git a/libclc/generic/lib/relational/all.cl b/libclc/generic/lib/relational/all.cl deleted file mode 100644 index 607d7a9c68c4..000000000000 --- a/libclc/generic/lib/relational/all.cl +++ /dev/null @@ -1,29 +0,0 @@ -#include - -#define _CLC_ALL(v) (((v) >> ((sizeof(v) * 8) - 1)) & 0x1) -#define _CLC_ALL2(v) (_CLC_ALL((v).s0) & _CLC_ALL((v).s1)) -#define _CLC_ALL3(v) (_CLC_ALL2((v)) & _CLC_ALL((v).s2)) -#define _CLC_ALL4(v) (_CLC_ALL3((v)) & _CLC_ALL((v).s3)) -#define _CLC_ALL8(v) (_CLC_ALL4((v)) & _CLC_ALL((v).s4) & _CLC_ALL((v).s5) \ - & _CLC_ALL((v).s6) & _CLC_ALL((v).s7)) -#define _CLC_ALL16(v) (_CLC_ALL8((v)) & _CLC_ALL((v).s8) & _CLC_ALL((v).s9) \ - & _CLC_ALL((v).sA) & _CLC_ALL((v).sB) \ - & _CLC_ALL((v).sC) & _CLC_ALL((v).sD) \ - & _CLC_ALL((v).sE) & _CLC_ALL((v).sf)) - - -#define ALL_ID(TYPE) \ - _CLC_OVERLOAD _CLC_DEF int all(TYPE v) - -#define ALL_VECTORIZE(TYPE) \ - ALL_ID(TYPE) { return _CLC_ALL(v); } \ - ALL_ID(TYPE##2) { return _CLC_ALL2(v); } \ - ALL_ID(TYPE##3) { return _CLC_ALL3(v); } \ - ALL_ID(TYPE##4) { return _CLC_ALL4(v); } \ - ALL_ID(TYPE##8) { return _CLC_ALL8(v); } \ - ALL_ID(TYPE##16) { return _CLC_ALL16(v); } - -ALL_VECTORIZE(char) -ALL_VECTORIZE(short) -ALL_VECTORIZE(int) -ALL_VECTORIZE(long) diff --git a/libclc/generic/lib/relational/any.cl b/libclc/generic/lib/relational/any.cl deleted file mode 100644 index 4d372102021b..000000000000 --- a/libclc/generic/lib/relational/any.cl +++ /dev/null @@ -1,30 +0,0 @@ -#include - -#define _CLC_ANY(v) (((v) >> ((sizeof(v) * 8) - 1)) & 0x1) -#define _CLC_ANY2(v) (_CLC_ANY((v).s0) | _CLC_ANY((v).s1)) -#define _CLC_ANY3(v) (_CLC_ANY2((v)) | _CLC_ANY((v).s2)) -#define _CLC_ANY4(v) (_CLC_ANY3((v)) | _CLC_ANY((v).s3)) -#define _CLC_ANY8(v) (_CLC_ANY4((v)) | _CLC_ANY((v).s4) | _CLC_ANY((v).s5) \ - | _CLC_ANY((v).s6) | _CLC_ANY((v).s7)) -#define _CLC_ANY16(v) (_CLC_ANY8((v)) | _CLC_ANY((v).s8) | _CLC_ANY((v).s9) \ - | _CLC_ANY((v).sA) | _CLC_ANY((v).sB) \ - | _CLC_ANY((v).sC) | _CLC_ANY((v).sD) \ - | _CLC_ANY((v).sE) | _CLC_ANY((v).sf)) - - -#define ANY_ID(TYPE) \ - _CLC_OVERLOAD _CLC_DEF int any(TYPE v) - -#define ANY_VECTORIZE(TYPE) \ - ANY_ID(TYPE) { return _CLC_ANY(v); } \ - ANY_ID(TYPE##2) { return _CLC_ANY2(v); } \ - ANY_ID(TYPE##3) { return _CLC_ANY3(v); } \ - ANY_ID(TYPE##4) { return _CLC_ANY4(v); } \ - ANY_ID(TYPE##8) { return _CLC_ANY8(v); } \ - ANY_ID(TYPE##16) { return _CLC_ANY16(v); } - -ANY_VECTORIZE(char) -ANY_VECTORIZE(short) -ANY_VECTORIZE(int) -ANY_VECTORIZE(long) - diff --git a/libclc/generic/lib/relational/bitselect.cl b/libclc/generic/lib/relational/bitselect.cl deleted file mode 100644 index af4e70ccbdd6..000000000000 --- a/libclc/generic/lib/relational/bitselect.cl +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "../clcmacro.h" - -#define __CLC_BODY -#include -#undef __CLC_BODY - -#define FLOAT_BITSELECT(f_type, i_type, width) \ - _CLC_OVERLOAD _CLC_DEF f_type##width bitselect(f_type##width x, f_type##width y, f_type##width z) { \ - return as_##f_type##width(bitselect(as_##i_type##width(x), as_##i_type##width(y), as_##i_type##width(z))); \ -} - -FLOAT_BITSELECT(float, uint, ) -FLOAT_BITSELECT(float, uint, 2) -FLOAT_BITSELECT(float, uint, 3) -FLOAT_BITSELECT(float, uint, 4) -FLOAT_BITSELECT(float, uint, 8) -FLOAT_BITSELECT(float, uint, 16) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -FLOAT_BITSELECT(double, ulong, ) -FLOAT_BITSELECT(double, ulong, 2) -FLOAT_BITSELECT(double, ulong, 3) -FLOAT_BITSELECT(double, ulong, 4) -FLOAT_BITSELECT(double, ulong, 8) -FLOAT_BITSELECT(double, ulong, 16) - -#endif diff --git a/libclc/generic/lib/relational/bitselect.inc b/libclc/generic/lib/relational/bitselect.inc deleted file mode 100644 index 3a78a8c7b748..000000000000 --- a/libclc/generic/lib/relational/bitselect.inc +++ /dev/null @@ -1,25 +0,0 @@ -/* - * Copyright (c) 2014,2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE bitselect(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z) { - return ((x) ^ ((z) & ((y) ^ (x)))); -} diff --git a/libclc/generic/lib/relational/isequal.cl b/libclc/generic/lib/relational/isequal.cl deleted file mode 100644 index 9d79ba6b3dbe..000000000000 --- a/libclc/generic/lib/relational/isequal.cl +++ /dev/null @@ -1,30 +0,0 @@ -#include - -#define _CLC_DEFINE_ISEQUAL(RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ - return (x == y); \ -} \ - -_CLC_DEFINE_ISEQUAL(int, isequal, float, float) -_CLC_DEFINE_ISEQUAL(int2, isequal, float2, float2) -_CLC_DEFINE_ISEQUAL(int3, isequal, float3, float3) -_CLC_DEFINE_ISEQUAL(int4, isequal, float4, float4) -_CLC_DEFINE_ISEQUAL(int8, isequal, float8, float8) -_CLC_DEFINE_ISEQUAL(int16, isequal, float16, float16) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isequal(double) returns an int, but the vector versions -// return long. -_CLC_DEFINE_ISEQUAL(int, isequal, double, double) -_CLC_DEFINE_ISEQUAL(long2, isequal, double2, double2) -_CLC_DEFINE_ISEQUAL(long3, isequal, double3, double3) -_CLC_DEFINE_ISEQUAL(long4, isequal, double4, double4) -_CLC_DEFINE_ISEQUAL(long8, isequal, double8, double8) -_CLC_DEFINE_ISEQUAL(long16, isequal, double16, double16) - -#endif - -#undef _CLC_DEFINE_ISEQUAL \ No newline at end of file diff --git a/libclc/generic/lib/relational/isfinite.cl b/libclc/generic/lib/relational/isfinite.cl deleted file mode 100644 index d0658c01eacb..000000000000 --- a/libclc/generic/lib/relational/isfinite.cl +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include "relational.h" - -_CLC_DEFINE_RELATIONAL_UNARY(int, isfinite, __builtin_isfinite, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isfinite(double) returns an int, but the vector versions -// return long. -_CLC_DEF _CLC_OVERLOAD int isfinite(double x) { - return __builtin_isfinite(x); -} - -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, isfinite, double) - -#endif diff --git a/libclc/generic/lib/relational/isgreater.cl b/libclc/generic/lib/relational/isgreater.cl deleted file mode 100644 index 79456e56d517..000000000000 --- a/libclc/generic/lib/relational/isgreater.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_isgreater with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, isgreater, __builtin_isgreater, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isgreater(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int isgreater(double x, double y){ - return __builtin_isgreater(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isgreater, double, double) - -#endif diff --git a/libclc/generic/lib/relational/isgreaterequal.cl b/libclc/generic/lib/relational/isgreaterequal.cl deleted file mode 100644 index 2d5ebe5770c7..000000000000 --- a/libclc/generic/lib/relational/isgreaterequal.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_isgreaterequal with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, isgreaterequal, __builtin_isgreaterequal, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isgreaterequal(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int isgreaterequal(double x, double y){ - return __builtin_isgreaterequal(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isgreaterequal, double, double) - -#endif diff --git a/libclc/generic/lib/relational/isinf.cl b/libclc/generic/lib/relational/isinf.cl deleted file mode 100644 index 1452d919cb86..000000000000 --- a/libclc/generic/lib/relational/isinf.cl +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include "relational.h" - -_CLC_DEFINE_RELATIONAL_UNARY(int, isinf, __builtin_isinf, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isinf(double) returns an int, but the vector versions -// return long. -_CLC_DEF _CLC_OVERLOAD int isinf(double x) { - return __builtin_isinf(x); -} - -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, isinf, double) - -#endif diff --git a/libclc/generic/lib/relational/isless.cl b/libclc/generic/lib/relational/isless.cl deleted file mode 100644 index 56a3e1329b48..000000000000 --- a/libclc/generic/lib/relational/isless.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_isless with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, isless, __builtin_isless, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isless(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int isless(double x, double y){ - return __builtin_isless(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isless, double, double) - -#endif diff --git a/libclc/generic/lib/relational/islessequal.cl b/libclc/generic/lib/relational/islessequal.cl deleted file mode 100644 index 259c307da453..000000000000 --- a/libclc/generic/lib/relational/islessequal.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_islessequal with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, islessequal, __builtin_islessequal, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of islessequal(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int islessequal(double x, double y){ - return __builtin_islessequal(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, islessequal, double, double) - -#endif diff --git a/libclc/generic/lib/relational/islessgreater.cl b/libclc/generic/lib/relational/islessgreater.cl deleted file mode 100644 index fc029f35b73a..000000000000 --- a/libclc/generic/lib/relational/islessgreater.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_islessgreater with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, islessgreater, __builtin_islessgreater, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of islessgreater(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int islessgreater(double x, double y){ - return __builtin_islessgreater(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, islessgreater, double, double) - -#endif diff --git a/libclc/generic/lib/relational/isnan.cl b/libclc/generic/lib/relational/isnan.cl deleted file mode 100644 index f82dc5d59da5..000000000000 --- a/libclc/generic/lib/relational/isnan.cl +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include "relational.h" - -_CLC_DEFINE_RELATIONAL_UNARY(int, isnan, __builtin_isnan, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isnan(double) returns an int, but the vector versions -// return long. -_CLC_DEF _CLC_OVERLOAD int isnan(double x) { - return __builtin_isnan(x); -} - -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, isnan, double) - -#endif diff --git a/libclc/generic/lib/relational/isnormal.cl b/libclc/generic/lib/relational/isnormal.cl deleted file mode 100644 index 2e6b42d00178..000000000000 --- a/libclc/generic/lib/relational/isnormal.cl +++ /dev/null @@ -1,18 +0,0 @@ -#include -#include "relational.h" - -_CLC_DEFINE_RELATIONAL_UNARY(int, isnormal, __builtin_isnormal, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isnormal(double) returns an int, but the vector versions -// return long. -_CLC_DEF _CLC_OVERLOAD int isnormal(double x) { - return __builtin_isnormal(x); -} - -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, isnormal, double) - -#endif diff --git a/libclc/generic/lib/relational/isnotequal.cl b/libclc/generic/lib/relational/isnotequal.cl deleted file mode 100644 index 787fd8d53c20..000000000000 --- a/libclc/generic/lib/relational/isnotequal.cl +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include "relational.h" - -#define _CLC_DEFINE_ISNOTEQUAL(RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ - return (x != y); \ -} \ - -_CLC_DEFINE_ISNOTEQUAL(int, isnotequal, float, float) -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(int, isnotequal, float, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isnotequal(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEFINE_ISNOTEQUAL(int, isnotequal, double, double) -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isnotequal, double, double) - -#endif - -#undef _CLC_DEFINE_ISNOTEQUAL diff --git a/libclc/generic/lib/relational/isordered.cl b/libclc/generic/lib/relational/isordered.cl deleted file mode 100644 index ebda2eb72ba2..000000000000 --- a/libclc/generic/lib/relational/isordered.cl +++ /dev/null @@ -1,23 +0,0 @@ -#include -#include "relational.h" - -#define _CLC_DEFINE_ISORDERED(RET_TYPE, FUNCTION, ARG1_TYPE, ARG2_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG1_TYPE x, ARG2_TYPE y) { \ - return isequal(x, x) && isequal(y, y); \ -} \ - -_CLC_DEFINE_ISORDERED(int, isordered, float, float) -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(int, isordered, float, float) - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isordered(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEFINE_ISORDERED(int, isordered, double, double) -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isordered, double, double) - -#endif - -#undef _CLC_DEFINE_ISORDERED diff --git a/libclc/generic/lib/relational/isunordered.cl b/libclc/generic/lib/relational/isunordered.cl deleted file mode 100644 index 8bc5e3fa7f6d..000000000000 --- a/libclc/generic/lib/relational/isunordered.cl +++ /dev/null @@ -1,22 +0,0 @@ -#include -#include "relational.h" - -//Note: It would be nice to use __builtin_isunordered with vector inputs, but it seems to only take scalar values as -// input, which will produce incorrect output for vector input types. - -_CLC_DEFINE_RELATIONAL_BINARY(int, isunordered, __builtin_isunordered, float, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of isunordered(double, double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int isunordered(double x, double y){ - return __builtin_isunordered(x, y); -} - -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(long, isunordered, double, double) - -#endif diff --git a/libclc/generic/lib/relational/relational.h b/libclc/generic/lib/relational/relational.h deleted file mode 100644 index e492750dacb3..000000000000 --- a/libclc/generic/lib/relational/relational.h +++ /dev/null @@ -1,117 +0,0 @@ -/* - * Contains relational macros that have to return 1 for scalar and -1 for vector - * when the result is true. - */ - -#define _CLC_DEFINE_RELATIONAL_UNARY_SCALAR(RET_TYPE, FUNCTION, BUILTIN_NAME, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x){ \ - return BUILTIN_NAME(x); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)( (RET_TYPE){FUNCTION(x.lo), FUNCTION(x.hi)} != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)( (RET_TYPE){FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2)} != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), FUNCTION(x.s3) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), FUNCTION(x.s3), \ - FUNCTION(x.s4), FUNCTION(x.s5), FUNCTION(x.s6), FUNCTION(x.s7) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG_TYPE x) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0), FUNCTION(x.s1), FUNCTION(x.s2), FUNCTION(x.s3), \ - FUNCTION(x.s4), FUNCTION(x.s5), FUNCTION(x.s6), FUNCTION(x.s7), \ - FUNCTION(x.s8), FUNCTION(x.s9), FUNCTION(x.sa), FUNCTION(x.sb), \ - FUNCTION(x.sc), FUNCTION(x.sd), FUNCTION(x.se), FUNCTION(x.sf) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(RET_TYPE, FUNCTION, ARG_TYPE) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC2(RET_TYPE##2, FUNCTION, ARG_TYPE##2) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC3(RET_TYPE##3, FUNCTION, ARG_TYPE##3) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC4(RET_TYPE##4, FUNCTION, ARG_TYPE##4) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC8(RET_TYPE##8, FUNCTION, ARG_TYPE##8) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC16(RET_TYPE##16, FUNCTION, ARG_TYPE##16) - -#define _CLC_DEFINE_RELATIONAL_UNARY(RET_TYPE, FUNCTION, BUILTIN_FUNCTION, ARG_TYPE) \ -_CLC_DEFINE_RELATIONAL_UNARY_SCALAR(RET_TYPE, FUNCTION, BUILTIN_FUNCTION, ARG_TYPE) \ -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(RET_TYPE, FUNCTION, ARG_TYPE) \ - -#define _CLC_DEFINE_RELATIONAL_BINARY_SCALAR(RET_TYPE, FUNCTION, BUILTIN_NAME, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y){ \ - return BUILTIN_NAME(x, y); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( (RET_TYPE){FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)} != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC2(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( (RET_TYPE){FUNCTION(x.lo, y.lo), FUNCTION(x.hi, y.hi)} != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC3(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( (RET_TYPE){FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2)} != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC4(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2), FUNCTION(x.s3, y.s3) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC8(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2), FUNCTION(x.s3, y.s3), \ - FUNCTION(x.s4, y.s4), FUNCTION(x.s5, y.s5), FUNCTION(x.s6, y.s6), FUNCTION(x.s7, y.s7) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC16(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEF _CLC_OVERLOAD RET_TYPE FUNCTION(ARG0_TYPE x, ARG1_TYPE y) { \ - return (RET_TYPE)( \ - (RET_TYPE){ \ - FUNCTION(x.s0, y.s0), FUNCTION(x.s1, y.s1), FUNCTION(x.s2, y.s2), FUNCTION(x.s3, y.s3), \ - FUNCTION(x.s4, y.s4), FUNCTION(x.s5, y.s5), FUNCTION(x.s6, y.s6), FUNCTION(x.s7, y.s7), \ - FUNCTION(x.s8, y.s8), FUNCTION(x.s9, y.s9), FUNCTION(x.sa, y.sa), FUNCTION(x.sb, y.sb), \ - FUNCTION(x.sc, y.sc), FUNCTION(x.sd, y.sd), FUNCTION(x.se, y.se), FUNCTION(x.sf, y.sf) \ - } != (RET_TYPE)0); \ -} - -#define _CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC2(RET_TYPE##2, FUNCTION, ARG0_TYPE##2, ARG1_TYPE##2) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC3(RET_TYPE##3, FUNCTION, ARG0_TYPE##3, ARG1_TYPE##3) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC4(RET_TYPE##4, FUNCTION, ARG0_TYPE##4, ARG1_TYPE##4) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC8(RET_TYPE##8, FUNCTION, ARG0_TYPE##8, ARG1_TYPE##8) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC16(RET_TYPE##16, FUNCTION, ARG0_TYPE##16, ARG1_TYPE##16) - -#define _CLC_DEFINE_RELATIONAL_BINARY(RET_TYPE, FUNCTION, BUILTIN_FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEFINE_RELATIONAL_BINARY_SCALAR(RET_TYPE, FUNCTION, BUILTIN_FUNCTION, ARG0_TYPE, ARG1_TYPE) \ -_CLC_DEFINE_RELATIONAL_BINARY_VEC_ALL(RET_TYPE, FUNCTION, ARG0_TYPE, ARG1_TYPE) diff --git a/libclc/generic/lib/relational/signbit.cl b/libclc/generic/lib/relational/signbit.cl deleted file mode 100644 index ab37d2f1288c..000000000000 --- a/libclc/generic/lib/relational/signbit.cl +++ /dev/null @@ -1,19 +0,0 @@ -#include -#include "relational.h" - -_CLC_DEFINE_RELATIONAL_UNARY(int, signbit, __builtin_signbitf, float) - -#ifdef cl_khr_fp64 - -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -// The scalar version of signbit(double) returns an int, but the vector versions -// return long. - -_CLC_DEF _CLC_OVERLOAD int signbit(double x){ - return __builtin_signbit(x); -} - -_CLC_DEFINE_RELATIONAL_UNARY_VEC_ALL(long, signbit, double) - -#endif diff --git a/libclc/generic/lib/shared/clamp.cl b/libclc/generic/lib/shared/clamp.cl deleted file mode 100644 index c79a358e00e0..000000000000 --- a/libclc/generic/lib/shared/clamp.cl +++ /dev/null @@ -1,11 +0,0 @@ -#include - -#define __CLC_BODY -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/shared/clamp.inc b/libclc/generic/lib/shared/clamp.inc deleted file mode 100644 index c918f9c499e7..000000000000 --- a/libclc/generic/lib/shared/clamp.inc +++ /dev/null @@ -1,9 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_GENTYPE y, __CLC_GENTYPE z) { - return (x > z ? z : (x < y ? y : x)); -} - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE clamp(__CLC_GENTYPE x, __CLC_SCALAR_GENTYPE y, __CLC_SCALAR_GENTYPE z) { - return (x > (__CLC_GENTYPE)z ? (__CLC_GENTYPE)z : (x < (__CLC_GENTYPE)y ? (__CLC_GENTYPE)y : x)); -} -#endif diff --git a/libclc/generic/lib/shared/max.cl b/libclc/generic/lib/shared/max.cl deleted file mode 100644 index 1c4457c82144..000000000000 --- a/libclc/generic/lib/shared/max.cl +++ /dev/null @@ -1,11 +0,0 @@ -#include - -#define __CLC_BODY -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/shared/max.inc b/libclc/generic/lib/shared/max.inc deleted file mode 100644 index 75a24c077d1a..000000000000 --- a/libclc/generic/lib/shared/max.inc +++ /dev/null @@ -1,9 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_GENTYPE b) { - return (a > b ? a : b); -} - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE max(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b) { - return (a > (__CLC_GENTYPE)b ? a : (__CLC_GENTYPE)b); -} -#endif diff --git a/libclc/generic/lib/shared/min.cl b/libclc/generic/lib/shared/min.cl deleted file mode 100644 index 433087a1069d..000000000000 --- a/libclc/generic/lib/shared/min.cl +++ /dev/null @@ -1,11 +0,0 @@ -#include - -#define __CLC_BODY -#include - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable -#endif - -#define __CLC_BODY -#include diff --git a/libclc/generic/lib/shared/min.inc b/libclc/generic/lib/shared/min.inc deleted file mode 100644 index fe42864df257..000000000000 --- a/libclc/generic/lib/shared/min.inc +++ /dev/null @@ -1,9 +0,0 @@ -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_GENTYPE b) { - return (a < b ? a : b); -} - -#ifndef __CLC_SCALAR -_CLC_OVERLOAD _CLC_DEF __CLC_GENTYPE min(__CLC_GENTYPE a, __CLC_SCALAR_GENTYPE b) { - return (a < (__CLC_GENTYPE)b ? a : (__CLC_GENTYPE)b); -} -#endif diff --git a/libclc/generic/lib/shared/vload.cl b/libclc/generic/lib/shared/vload.cl deleted file mode 100644 index 88972005cfa2..000000000000 --- a/libclc/generic/lib/shared/vload.cl +++ /dev/null @@ -1,52 +0,0 @@ -#include - -#define VLOAD_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ - typedef PRIM_TYPE##2 less_aligned_##ADDR_SPACE##PRIM_TYPE##2 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##2 vload2(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ - return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##2*) (&x[2*offset])); \ - } \ -\ - typedef PRIM_TYPE##3 less_aligned_##ADDR_SPACE##PRIM_TYPE##3 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##3 vload3(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ - PRIM_TYPE##2 vec = *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##2*) (&x[3*offset])); \ - return (PRIM_TYPE##3)(vec.s0, vec.s1, x[offset*3+2]); \ - } \ -\ - typedef PRIM_TYPE##4 less_aligned_##ADDR_SPACE##PRIM_TYPE##4 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##4 vload4(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ - return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##4*) (&x[4*offset])); \ - } \ -\ - typedef PRIM_TYPE##8 less_aligned_##ADDR_SPACE##PRIM_TYPE##8 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##8 vload8(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ - return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##8*) (&x[8*offset])); \ - } \ -\ - typedef PRIM_TYPE##16 less_aligned_##ADDR_SPACE##PRIM_TYPE##16 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF PRIM_TYPE##16 vload16(size_t offset, const ADDR_SPACE PRIM_TYPE *x) { \ - return *((const ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&x[16*offset])); \ - } \ - -#define VLOAD_ADDR_SPACES(__CLC_SCALAR_GENTYPE) \ - VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __private) \ - VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __local) \ - VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __constant) \ - VLOAD_VECTORIZE(__CLC_SCALAR_GENTYPE, __global) \ - -#define VLOAD_TYPES() \ - VLOAD_ADDR_SPACES(char) \ - VLOAD_ADDR_SPACES(uchar) \ - VLOAD_ADDR_SPACES(short) \ - VLOAD_ADDR_SPACES(ushort) \ - VLOAD_ADDR_SPACES(int) \ - VLOAD_ADDR_SPACES(uint) \ - VLOAD_ADDR_SPACES(long) \ - VLOAD_ADDR_SPACES(ulong) \ - VLOAD_ADDR_SPACES(float) \ - -VLOAD_TYPES() - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - VLOAD_ADDR_SPACES(double) -#endif diff --git a/libclc/generic/lib/shared/vstore.cl b/libclc/generic/lib/shared/vstore.cl deleted file mode 100644 index 4777b7ea76ad..000000000000 --- a/libclc/generic/lib/shared/vstore.cl +++ /dev/null @@ -1,52 +0,0 @@ -#include - -#pragma OPENCL EXTENSION cl_khr_byte_addressable_store : enable - -#define VSTORE_VECTORIZE(PRIM_TYPE, ADDR_SPACE) \ - typedef PRIM_TYPE##2 less_aligned_##ADDR_SPACE##PRIM_TYPE##2 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF void vstore2(PRIM_TYPE##2 vec, size_t offset, ADDR_SPACE PRIM_TYPE *mem) { \ - *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##2*) (&mem[2*offset])) = vec; \ - } \ -\ - _CLC_OVERLOAD _CLC_DEF void vstore3(PRIM_TYPE##3 vec, size_t offset, ADDR_SPACE PRIM_TYPE *mem) { \ - *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##2*) (&mem[3*offset])) = (PRIM_TYPE##2)(vec.s0, vec.s1); \ - mem[3 * offset + 2] = vec.s2;\ - } \ -\ - typedef PRIM_TYPE##4 less_aligned_##ADDR_SPACE##PRIM_TYPE##4 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF void vstore4(PRIM_TYPE##4 vec, size_t offset, ADDR_SPACE PRIM_TYPE *mem) { \ - *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##4*) (&mem[4*offset])) = vec; \ - } \ -\ - typedef PRIM_TYPE##8 less_aligned_##ADDR_SPACE##PRIM_TYPE##8 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF void vstore8(PRIM_TYPE##8 vec, size_t offset, ADDR_SPACE PRIM_TYPE *mem) { \ - *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##8*) (&mem[8*offset])) = vec; \ - } \ -\ - typedef PRIM_TYPE##16 less_aligned_##ADDR_SPACE##PRIM_TYPE##16 __attribute__ ((aligned (sizeof(PRIM_TYPE))));\ - _CLC_OVERLOAD _CLC_DEF void vstore16(PRIM_TYPE##16 vec, size_t offset, ADDR_SPACE PRIM_TYPE *mem) { \ - *((ADDR_SPACE less_aligned_##ADDR_SPACE##PRIM_TYPE##16*) (&mem[16*offset])) = vec; \ - } \ - -#define VSTORE_ADDR_SPACES(__CLC_SCALAR___CLC_GENTYPE) \ - VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __private) \ - VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __local) \ - VSTORE_VECTORIZE(__CLC_SCALAR___CLC_GENTYPE, __global) \ - -#define VSTORE_TYPES() \ - VSTORE_ADDR_SPACES(char) \ - VSTORE_ADDR_SPACES(uchar) \ - VSTORE_ADDR_SPACES(short) \ - VSTORE_ADDR_SPACES(ushort) \ - VSTORE_ADDR_SPACES(int) \ - VSTORE_ADDR_SPACES(uint) \ - VSTORE_ADDR_SPACES(long) \ - VSTORE_ADDR_SPACES(ulong) \ - VSTORE_ADDR_SPACES(float) \ - -VSTORE_TYPES() - -#ifdef cl_khr_fp64 -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - VSTORE_ADDR_SPACES(double) -#endif diff --git a/libclc/generic/lib/subnormal_config.cl b/libclc/generic/lib/subnormal_config.cl deleted file mode 100644 index 4bcecfd82e18..000000000000 --- a/libclc/generic/lib/subnormal_config.cl +++ /dev/null @@ -1,37 +0,0 @@ -/* - * Copyright (c) 2015 Advanced Micro Devices, Inc. - * - * Permission is hereby granted, free of charge, to any person obtaining a copy - * of this software and associated documentation files (the "Software"), to deal - * in the Software without restriction, including without limitation the rights - * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell - * copies of the Software, and to permit persons to whom the Software is - * furnished to do so, subject to the following conditions: - * - * The above copyright notice and this permission notice shall be included in - * all copies or substantial portions of the Software. - * - * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR - * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, - * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE - * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER - * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, - * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN - * THE SOFTWARE. - */ - -#include - -#include "config.h" - -_CLC_DEF bool __clc_fp16_subnormals_supported() { - return false; -} - -_CLC_DEF bool __clc_fp32_subnormals_supported() { - return false; -} - -_CLC_DEF bool __clc_fp64_subnormals_supported() { - return !__clc_subnormals_disabled(); -} diff --git a/libclc/generic/lib/subnormal_disable.ll b/libclc/generic/lib/subnormal_disable.ll deleted file mode 100644 index b935583b5ade..000000000000 --- a/libclc/generic/lib/subnormal_disable.ll +++ /dev/null @@ -1 +0,0 @@ -@__CLC_SUBNORMAL_DISABLE = unnamed_addr constant i1 true diff --git a/libclc/generic/lib/subnormal_helper_func.ll b/libclc/generic/lib/subnormal_helper_func.ll deleted file mode 100644 index fb1b5d2b679f..000000000000 --- a/libclc/generic/lib/subnormal_helper_func.ll +++ /dev/null @@ -1,8 +0,0 @@ -@__CLC_SUBNORMAL_DISABLE = external global i1 - -define i1 @__clc_subnormals_disabled() #0 { - %disable = load i1, i1* @__CLC_SUBNORMAL_DISABLE - ret i1 %disable -} - -attributes #0 = { alwaysinline } diff --git a/libclc/generic/lib/subnormal_use_default.ll b/libclc/generic/lib/subnormal_use_default.ll deleted file mode 100644 index d70c63bc0475..000000000000 --- a/libclc/generic/lib/subnormal_use_default.ll +++ /dev/null @@ -1 +0,0 @@ -@__CLC_SUBNORMAL_DISABLE = unnamed_addr constant i1 false diff --git a/libclc/generic/lib/workitem/get_global_id.cl b/libclc/generic/lib/workitem/get_global_id.cl deleted file mode 100644 index fdd83d2953d4..000000000000 --- a/libclc/generic/lib/workitem/get_global_id.cl +++ /dev/null @@ -1,5 +0,0 @@ -#include - -_CLC_DEF size_t get_global_id(uint dim) { - return get_group_id(dim)*get_local_size(dim) + get_local_id(dim); -} diff --git a/libclc/generic/lib/workitem/get_global_size.cl b/libclc/generic/lib/workitem/get_global_size.cl deleted file mode 100644 index 5ae649e10d51..000000000000 --- a/libclc/generic/lib/workitem/get_global_size.cl +++ /dev/null @@ -1,5 +0,0 @@ -#include - -_CLC_DEF size_t get_global_size(uint dim) { - return get_num_groups(dim)*get_local_size(dim); -} diff --git a/libclc/ptx-nvidiacl/lib/SOURCES b/libclc/ptx-nvidiacl/lib/SOURCES deleted file mode 100644 index 7cdbd8507699..000000000000 --- a/libclc/ptx-nvidiacl/lib/SOURCES +++ /dev/null @@ -1,5 +0,0 @@ -synchronization/barrier.cl -workitem/get_group_id.cl -workitem/get_local_id.cl -workitem/get_local_size.cl -workitem/get_num_groups.cl diff --git a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl b/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl deleted file mode 100644 index fb36c2612be4..000000000000 --- a/libclc/ptx-nvidiacl/lib/synchronization/barrier.cl +++ /dev/null @@ -1,8 +0,0 @@ -#include - -_CLC_DEF void barrier(cl_mem_fence_flags flags) { - if (flags & CLK_LOCAL_MEM_FENCE) { - __builtin_ptx_bar_sync(0); - } -} - diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl b/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl deleted file mode 100644 index 2b35b4eaaa95..000000000000 --- a/libclc/ptx-nvidiacl/lib/workitem/get_group_id.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -_CLC_DEF size_t get_group_id(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_ctaid_x(); - case 1: return __builtin_ptx_read_ctaid_y(); - case 2: return __builtin_ptx_read_ctaid_z(); - default: return 0; - } -} diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl b/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl deleted file mode 100644 index f0cfdc005fe8..000000000000 --- a/libclc/ptx-nvidiacl/lib/workitem/get_local_id.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -_CLC_DEF size_t get_local_id(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_tid_x(); - case 1: return __builtin_ptx_read_tid_y(); - case 2: return __builtin_ptx_read_tid_z(); - default: return 0; - } -} diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl b/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl deleted file mode 100644 index c3f542595def..000000000000 --- a/libclc/ptx-nvidiacl/lib/workitem/get_local_size.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -_CLC_DEF size_t get_local_size(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_ntid_x(); - case 1: return __builtin_ptx_read_ntid_y(); - case 2: return __builtin_ptx_read_ntid_z(); - default: return 0; - } -} diff --git a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl b/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl deleted file mode 100644 index 90bdc2e41d2c..000000000000 --- a/libclc/ptx-nvidiacl/lib/workitem/get_num_groups.cl +++ /dev/null @@ -1,10 +0,0 @@ -#include - -_CLC_DEF size_t get_num_groups(uint dim) { - switch (dim) { - case 0: return __builtin_ptx_read_nctaid_x(); - case 1: return __builtin_ptx_read_nctaid_y(); - case 2: return __builtin_ptx_read_nctaid_z(); - default: return 0; - } -} diff --git a/libclc/ptx/lib/OVERRIDES b/libclc/ptx/lib/OVERRIDES deleted file mode 100644 index 475162c97cd2..000000000000 --- a/libclc/ptx/lib/OVERRIDES +++ /dev/null @@ -1,2 +0,0 @@ -integer/add_sat_if.ll -integer/sub_sat_if.ll diff --git a/libclc/ptx/lib/SOURCES b/libclc/ptx/lib/SOURCES deleted file mode 100644 index fb6e17fbc697..000000000000 --- a/libclc/ptx/lib/SOURCES +++ /dev/null @@ -1,2 +0,0 @@ -integer/add_sat.ll -integer/sub_sat.ll \ No newline at end of file diff --git a/libclc/ptx/lib/integer/add_sat.ll b/libclc/ptx/lib/integer/add_sat.ll deleted file mode 100644 index f887962c8a49..000000000000 --- a/libclc/ptx/lib/integer/add_sat.ll +++ /dev/null @@ -1,55 +0,0 @@ -declare i8 @__clc_add_sat_impl_s8(i8 %x, i8 %y) - -define ptx_device i8 @__clc_add_sat_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_add_sat_impl_s8(i8 %x, i8 %y) - ret i8 %call -} - -declare i8 @__clc_add_sat_impl_u8(i8 %x, i8 %y) - -define ptx_device i8 @__clc_add_sat_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_add_sat_impl_u8(i8 %x, i8 %y) - ret i8 %call -} - -declare i16 @__clc_add_sat_impl_s16(i16 %x, i16 %y) - -define ptx_device i16 @__clc_add_sat_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_add_sat_impl_s16(i16 %x, i16 %y) - ret i16 %call -} - -declare i16 @__clc_add_sat_impl_u16(i16 %x, i16 %y) - -define ptx_device i16 @__clc_add_sat_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_add_sat_impl_u16(i16 %x, i16 %y) - ret i16 %call -} - -declare i32 @__clc_add_sat_impl_s32(i32 %x, i32 %y) - -define ptx_device i32 @__clc_add_sat_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_add_sat_impl_s32(i32 %x, i32 %y) - ret i32 %call -} - -declare i32 @__clc_add_sat_impl_u32(i32 %x, i32 %y) - -define ptx_device i32 @__clc_add_sat_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_add_sat_impl_u32(i32 %x, i32 %y) - ret i32 %call -} - -declare i64 @__clc_add_sat_impl_s64(i64 %x, i64 %y) - -define ptx_device i64 @__clc_add_sat_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_add_sat_impl_s64(i64 %x, i64 %y) - ret i64 %call -} - -declare i64 @__clc_add_sat_impl_u64(i64 %x, i64 %y) - -define ptx_device i64 @__clc_add_sat_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_add_sat_impl_u64(i64 %x, i64 %y) - ret i64 %call -} diff --git a/libclc/ptx/lib/integer/sub_sat.ll b/libclc/ptx/lib/integer/sub_sat.ll deleted file mode 100644 index 1a66eb566b52..000000000000 --- a/libclc/ptx/lib/integer/sub_sat.ll +++ /dev/null @@ -1,55 +0,0 @@ -declare i8 @__clc_sub_sat_impl_s8(i8 %x, i8 %y) - -define ptx_device i8 @__clc_sub_sat_s8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_sub_sat_impl_s8(i8 %x, i8 %y) - ret i8 %call -} - -declare i8 @__clc_sub_sat_impl_u8(i8 %x, i8 %y) - -define ptx_device i8 @__clc_sub_sat_u8(i8 %x, i8 %y) nounwind readnone alwaysinline { - %call = call i8 @__clc_sub_sat_impl_u8(i8 %x, i8 %y) - ret i8 %call -} - -declare i16 @__clc_sub_sat_impl_s16(i16 %x, i16 %y) - -define ptx_device i16 @__clc_sub_sat_s16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_sub_sat_impl_s16(i16 %x, i16 %y) - ret i16 %call -} - -declare i16 @__clc_sub_sat_impl_u16(i16 %x, i16 %y) - -define ptx_device i16 @__clc_sub_sat_u16(i16 %x, i16 %y) nounwind readnone alwaysinline { - %call = call i16 @__clc_sub_sat_impl_u16(i16 %x, i16 %y) - ret i16 %call -} - -declare i32 @__clc_sub_sat_impl_s32(i32 %x, i32 %y) - -define ptx_device i32 @__clc_sub_sat_s32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_sub_sat_impl_s32(i32 %x, i32 %y) - ret i32 %call -} - -declare i32 @__clc_sub_sat_impl_u32(i32 %x, i32 %y) - -define ptx_device i32 @__clc_sub_sat_u32(i32 %x, i32 %y) nounwind readnone alwaysinline { - %call = call i32 @__clc_sub_sat_impl_u32(i32 %x, i32 %y) - ret i32 %call -} - -declare i64 @__clc_sub_sat_impl_s64(i64 %x, i64 %y) - -define ptx_device i64 @__clc_sub_sat_s64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_sub_sat_impl_s64(i64 %x, i64 %y) - ret i64 %call -} - -declare i64 @__clc_sub_sat_impl_u64(i64 %x, i64 %y) - -define ptx_device i64 @__clc_sub_sat_u64(i64 %x, i64 %y) nounwind readnone alwaysinline { - %call = call i64 @__clc_sub_sat_impl_u64(i64 %x, i64 %y) - ret i64 %call -} diff --git a/libclc/r600/lib/OVERRIDES b/libclc/r600/lib/OVERRIDES deleted file mode 100644 index e69de29bb2d1..000000000000 diff --git a/libclc/r600/lib/SOURCES b/libclc/r600/lib/SOURCES deleted file mode 100644 index 49c8dd53a56d..000000000000 --- a/libclc/r600/lib/SOURCES +++ /dev/null @@ -1,3 +0,0 @@ -synchronization/barrier_impl.ll -workitem/get_group_id.ll -workitem/get_local_id.ll diff --git a/libclc/r600/lib/synchronization/barrier_impl.ll b/libclc/r600/lib/synchronization/barrier_impl.ll deleted file mode 100644 index 825b2eb6c780..000000000000 --- a/libclc/r600/lib/synchronization/barrier_impl.ll +++ /dev/null @@ -1,33 +0,0 @@ -declare i32 @__clc_clk_local_mem_fence() #1 -declare i32 @__clc_clk_global_mem_fence() #1 -declare void @llvm.AMDGPU.barrier.local() #0 -declare void @llvm.AMDGPU.barrier.global() #0 - -define void @barrier(i32 %flags) #2 { -barrier_local_test: - %CLK_LOCAL_MEM_FENCE = call i32 @__clc_clk_local_mem_fence() - %0 = and i32 %flags, %CLK_LOCAL_MEM_FENCE - %1 = icmp ne i32 %0, 0 - br i1 %1, label %barrier_local, label %barrier_global_test - -barrier_local: - call void @llvm.AMDGPU.barrier.local() - br label %barrier_global_test - -barrier_global_test: - %CLK_GLOBAL_MEM_FENCE = call i32 @__clc_clk_global_mem_fence() - %2 = and i32 %flags, %CLK_GLOBAL_MEM_FENCE - %3 = icmp ne i32 %2, 0 - br i1 %3, label %barrier_global, label %done - -barrier_global: - call void @llvm.AMDGPU.barrier.global() - br label %done - -done: - ret void -} - -attributes #0 = { nounwind convergent } -attributes #1 = { nounwind alwaysinline } -attributes #2 = { nounwind convergent alwaysinline } diff --git a/libclc/r600/lib/workitem/get_group_id.ll b/libclc/r600/lib/workitem/get_group_id.ll deleted file mode 100644 index 837c799395d9..000000000000 --- a/libclc/r600/lib/workitem/get_group_id.ll +++ /dev/null @@ -1,29 +0,0 @@ -declare i32 @llvm.r600.read.tgid.x() #0 -declare i32 @llvm.r600.read.tgid.y() #0 -declare i32 @llvm.r600.read.tgid.z() #0 - -define i32 @get_group_id(i32 %dim) #1 { - switch i32 %dim, label %default [ - i32 0, label %x_dim - i32 1, label %y_dim - i32 2, label %z_dim - ] - -x_dim: - %x = tail call i32 @llvm.r600.read.tgid.x() - ret i32 %x - -y_dim: - %y = tail call i32 @llvm.r600.read.tgid.y() - ret i32 %y - -z_dim: - %z = tail call i32 @llvm.r600.read.tgid.z() - ret i32 %z - -default: - ret i32 0 -} - -attributes #0 = { nounwind readnone } -attributes #1 = { alwaysinline norecurse nounwind readnone } diff --git a/libclc/r600/lib/workitem/get_local_id.ll b/libclc/r600/lib/workitem/get_local_id.ll deleted file mode 100644 index da37ca0c7b40..000000000000 --- a/libclc/r600/lib/workitem/get_local_id.ll +++ /dev/null @@ -1,31 +0,0 @@ -declare i32 @llvm.r600.read.tidig.x() #0 -declare i32 @llvm.r600.read.tidig.y() #0 -declare i32 @llvm.r600.read.tidig.z() #0 - -define i32 @get_local_id(i32 %dim) #1 { - switch i32 %dim, label %default [ - i32 0, label %x_dim - i32 1, label %y_dim - i32 2, label %z_dim - ] - -x_dim: - %x = tail call i32 @llvm.r600.read.tidig.x(), !range !0 - ret i32 %x - -y_dim: - %y = tail call i32 @llvm.r600.read.tidig.y(), !range !0 - ret i32 %y -z_dim: - - %z = tail call i32 @llvm.r600.read.tidig.z(), !range !0 - ret i32 %z - -default: - ret i32 0 -} - -attributes #0 = { nounwind readnone } -attributes #1 = { alwaysinline norecurse nounwind readnone } - -!0 = !{ i32 0, i32 2048 } diff --git a/libclc/test/add_sat.cl b/libclc/test/add_sat.cl deleted file mode 100644 index 45c8567b4403..000000000000 --- a/libclc/test/add_sat.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(__global char *a, __global char *b, __global char *c) { - *a = add_sat(*b, *c); -} diff --git a/libclc/test/as_type.cl b/libclc/test/as_type.cl deleted file mode 100644 index e8fb1228d28d..000000000000 --- a/libclc/test/as_type.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(int4 *x, float4 *y) { - *x = as_int4(*y); -} diff --git a/libclc/test/convert.cl b/libclc/test/convert.cl deleted file mode 100644 index 928fc326b6a1..000000000000 --- a/libclc/test/convert.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(int4 *x, float4 *y) { - *x = convert_int4(*y); -} diff --git a/libclc/test/cos.cl b/libclc/test/cos.cl deleted file mode 100644 index 4230eb2a0e93..000000000000 --- a/libclc/test/cos.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(float4 *f) { - *f = cos(*f); -} diff --git a/libclc/test/cross.cl b/libclc/test/cross.cl deleted file mode 100644 index 08955cbd9af5..000000000000 --- a/libclc/test/cross.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(float4 *f) { - *f = cross(f[0], f[1]); -} diff --git a/libclc/test/fabs.cl b/libclc/test/fabs.cl deleted file mode 100644 index 91d42c466676..000000000000 --- a/libclc/test/fabs.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(float *f) { - *f = fabs(*f); -} diff --git a/libclc/test/get_group_id.cl b/libclc/test/get_group_id.cl deleted file mode 100644 index 43725cda8027..000000000000 --- a/libclc/test/get_group_id.cl +++ /dev/null @@ -1,3 +0,0 @@ -__kernel void foo(int *i) { - i[get_group_id(0)] = 1; -} diff --git a/libclc/test/rsqrt.cl b/libclc/test/rsqrt.cl deleted file mode 100644 index 13ad216b79f4..000000000000 --- a/libclc/test/rsqrt.cl +++ /dev/null @@ -1,6 +0,0 @@ -#pragma OPENCL EXTENSION cl_khr_fp64 : enable - -__kernel void foo(float4 *x, double4 *y) { - x[1] = rsqrt(x[0]); - y[1] = rsqrt(y[0]); -} diff --git a/libclc/test/subsat.cl b/libclc/test/subsat.cl deleted file mode 100644 index a83414b4dc85..000000000000 --- a/libclc/test/subsat.cl +++ /dev/null @@ -1,19 +0,0 @@ -__kernel void test_subsat_char(char *a, char x, char y) { - *a = sub_sat(x, y); - return; -} - -__kernel void test_subsat_uchar(uchar *a, uchar x, uchar y) { - *a = sub_sat(x, y); - return; -} - -__kernel void test_subsat_long(long *a, long x, long y) { - *a = sub_sat(x, y); - return; -} - -__kernel void test_subsat_ulong(ulong *a, ulong x, ulong y) { - *a = sub_sat(x, y); - return; -} \ No newline at end of file diff --git a/libclc/utils/prepare-builtins.cpp b/libclc/utils/prepare-builtins.cpp deleted file mode 100644 index 3122f485b6ef..000000000000 --- a/libclc/utils/prepare-builtins.cpp +++ /dev/null @@ -1,91 +0,0 @@ -#include "llvm/Bitcode/ReaderWriter.h" -#include "llvm/IR/Function.h" -#include "llvm/IR/GlobalVariable.h" -#include "llvm/IR/LLVMContext.h" -#include "llvm/IR/Module.h" -#include "llvm/Support/CommandLine.h" -#include "llvm/Support/ManagedStatic.h" -#include "llvm/Support/MemoryBuffer.h" -#include "llvm/Support/FileSystem.h" -#include "llvm/Support/raw_ostream.h" -#include "llvm/Support/ErrorOr.h" -#include "llvm/Support/ToolOutputFile.h" -#include "llvm/Config/llvm-config.h" - -#include - -using namespace llvm; - -static cl::opt -InputFilename(cl::Positional, cl::desc(" -libclc - - -

libclc

-

-libclc is an open source, BSD/MIT dual licensed -implementation of the library requirements of the -OpenCL C programming language, as specified by the OpenCL -1.1 Specification. The following sections of the specification -impose library requirements: -

    -
  • 6.1: Supported Data Types -
  • 6.2.3: Explicit Conversions -
  • 6.2.4.2: Reinterpreting Types Using as_type() and as_typen() -
  • 6.9: Preprocessor Directives and Macros -
  • 6.11: Built-in Functions -
  • 9.3: Double Precision Floating-Point -
  • 9.4: 64-bit Atomics -
  • 9.5: Writing to 3D image memory objects -
  • 9.6: Half Precision Floating-Point -
-

- -

-libclc is intended to be used with the Clang -compiler's OpenCL frontend. -

- -

-libclc is designed to be portable and extensible. To this end, -it provides generic implementations of most library requirements, -allowing the target to override the generic implementation at the -granularity of individual functions. -

- -

-libclc currently supports the AMDGCN, and R600 and NVPTX targets, but -support for more targets is welcome. -

- -

Download

- -svn checkout http://llvm.org/svn/llvm-project/libclc/trunk libclc (ViewVC) -
- or -
-git clone http://llvm.org/git/libclc.git - -

Mailing List

- -libclc-dev@lists.llvm.org (subscribe/unsubscribe, archives) - - - diff --git a/llgo/.arcconfig b/llgo/.arcconfig deleted file mode 100644 index 38ac2790f4ee..000000000000 --- a/llgo/.arcconfig +++ /dev/null @@ -1,4 +0,0 @@ -{ - "project_id" : "llgo", - "conduit_uri" : "https://reviews.llvm.org/" -} diff --git a/llgo/CMakeLists.txt b/llgo/CMakeLists.txt deleted file mode 100644 index c42eb4b43af5..000000000000 --- a/llgo/CMakeLists.txt +++ /dev/null @@ -1,263 +0,0 @@ -include(ExternalProject) -include(ProcessorCount) - -# Provide a config.h which exposes build system information. -configure_file( - cmd/gllgo/config.h.cmake - ${CMAKE_CURRENT_BINARY_DIR}/cmd/gllgo/config.h) -include_directories(${CMAKE_CURRENT_BINARY_DIR}/cmd/gllgo) - -llvm_add_go_executable(llgo llvm.org/llgo/cmd/gllgo ALL DEPENDS - build/context.go - cmd/gllgo/gllgo.go - debug/debug.go - driver/parser.go - irgen/annotations.go - irgen/attribute.go - irgen/builtins.go - irgen/cabi.go - irgen/call.go - irgen/channels.go - irgen/closures.go - irgen/compiler.go - irgen/errors.go - irgen/indirect.go - irgen/interfaces.go - irgen/maps.go - irgen/predicates.go - irgen/println.go - irgen/runtime.go - irgen/slice.go - irgen/ssa.go - irgen/strings.go - irgen/switches.go - irgen/targets.go - irgen/typemap.go - irgen/types.go - irgen/utils.go - irgen/value.go - irgen/version.go - ssaopt/esc.go -) - -string(REGEX MATCH "[0-9]+\\.[0-9]+(\\.[0-9]+)?" LLGO_VERSION - ${PACKAGE_VERSION}) - -configure_file( - cmd/go/zdefaultcc.go.in - ${CMAKE_CURRENT_BINARY_DIR}/cmd/go/zdefaultcc.go) - -set(LLGO_GO_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/build.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/clean.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/context.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/discovery.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/doc.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/env.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/fix.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/fmt.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/generate.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/get.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/go11.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/help.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/http.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/list.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/main.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/note.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/pkg.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/run.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/signal.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/signal_unix.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/testflag.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/test.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/tool.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/vcs.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/version.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/go/vet.go - ${CMAKE_CURRENT_BINARY_DIR}/cmd/go/zdefaultcc.go -) - -add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX} - COMMAND ${CMAKE_BINARY_DIR}/bin/llgo -static-libgo - -I ${CMAKE_CURRENT_BINARY_DIR}/libgo - -o ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX} - ${LLGO_GO_SOURCES} - ${CMAKE_CURRENT_BINARY_DIR}/libgo/zstdpkglist.go - DEPENDS llgo libgo ${LLGO_GO_SOURCES} - COMMENT "Building Go executable llgo-go" - VERBATIM) -add_custom_target(llgo-go ALL DEPENDS ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX}) - -set(LLGO_CGO_SOURCES - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/ast.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/doc.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/gcc.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/godefs.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/main.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/out.go - ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo/go/cmd/cgo/util.go - ${CMAKE_CURRENT_SOURCE_DIR}/cmd/cgo/zdefaultcc.go -) - -add_custom_command(OUTPUT ${CMAKE_BINARY_DIR}/lib/go/llgo-${LLGO_VERSION}/cgo - COMMAND ${CMAKE_BINARY_DIR}/bin/llgo -static-libgo - -o ${CMAKE_BINARY_DIR}/lib/go/llgo-${LLGO_VERSION}/cgo - ${LLGO_CGO_SOURCES} - DEPENDS llgo libgo ${LLGO_CGO_SOURCES} - COMMENT "Building Go executable cgo" - VERBATIM) -add_custom_target(cgo ALL DEPENDS ${CMAKE_BINARY_DIR}/lib/go/llgo-${LLGO_VERSION}/cgo) - -llvm_add_go_executable(llgo-stage2 llvm.org/llgo/cmd/gllgo - DEPENDS libgo ${CMAKE_BINARY_DIR}/bin/llgo${CMAKE_EXECUTABLE_SUFFIX} - ${CMAKE_BINARY_DIR}/lib/go/llgo-${LLGO_VERSION}/cgo - ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX} - GOFLAGS "cc=${CMAKE_BINARY_DIR}/bin/clang" - "cxx=${CMAKE_BINARY_DIR}/bin/clang++" - "go=${CMAKE_BINARY_DIR}/bin/llgo-go" -) - -llvm_add_go_executable(llgo-stage3 llvm.org/llgo/cmd/gllgo - DEPENDS libgo ${CMAKE_BINARY_DIR}/bin/llgo-stage2${CMAKE_EXECUTABLE_SUFFIX} - GOFLAGS "cc=${CMAKE_BINARY_DIR}/bin/clang" - "cxx=${CMAKE_BINARY_DIR}/bin/clang++" - "go=${CMAKE_BINARY_DIR}/bin/llgo-go" - "llgo=${CMAKE_BINARY_DIR}/bin/llgo-stage2${CMAKE_EXECUTABLE_SUFFIX}" -) - -llvm_add_go_executable(cc-wrapper llvm.org/llgo/cmd/cc-wrapper DEPENDS - cmd/cc-wrapper/main.go -) - -llvm_add_go_executable(llgoi llvm.org/llgo/cmd/llgoi ALL - DEPENDS libgo ${CMAKE_BINARY_DIR}/bin/llgo${CMAKE_EXECUTABLE_SUFFIX} - ${CMAKE_BINARY_DIR}/lib/go/llgo-${LLGO_VERSION}/cgo - ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX} - cmd/llgoi/llgoi.go - GOFLAGS "cc=${CMAKE_BINARY_DIR}/bin/clang" - "cxx=${CMAKE_BINARY_DIR}/bin/clang++" - "go=${CMAKE_BINARY_DIR}/bin/llgo-go" -) - -install(FILES ${CMAKE_BINARY_DIR}/bin/llgo${CMAKE_EXECUTABLE_SUFFIX} - ${CMAKE_BINARY_DIR}/bin/llgoi${CMAKE_EXECUTABLE_SUFFIX} - ${CMAKE_BINARY_DIR}/bin/llgo-go${CMAKE_EXECUTABLE_SUFFIX} - DESTINATION bin - PERMISSIONS OWNER_READ OWNER_WRITE OWNER_EXECUTE - GROUP_READ GROUP_EXECUTE - WORLD_READ WORLD_EXECUTE) - -function(add_clobber_steps name) - ExternalProject_Add_Step(${name} force-reconfigure - DEPENDERS configure - ALWAYS 1 - ) - - ExternalProject_Add_Step(${name} clobber - COMMAND ${CMAKE_COMMAND} -E remove_directory - COMMAND ${CMAKE_COMMAND} -E make_directory - COMMENT "Clobbering ${name} build directory..." - DEPENDERS configure - DEPENDS ${ARGN} - ) -endfunction() - -processorcount(PROCESSOR_COUNT) - -function(add_libgo_variant suffix cflags gocflags deps exclude_from_all) - externalproject_add(libbacktrace${suffix} - DEPENDS clang ${deps} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libbacktrace - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${suffix}/libbacktrace - CONFIGURE_COMMAND /configure --disable-multilib --enable-host-shared "CC=${CMAKE_BINARY_DIR}/bin/clang ${cflags}" - BUILD_COMMAND make -j${PROCESSOR_COUNT} - INSTALL_COMMAND "" - LOG_CONFIGURE 1 - LOG_BUILD 1 - ) - set_property(TARGET libbacktrace${suffix} - PROPERTY EXCLUDE_FROM_ALL ${exclude_from_all}) - - add_clobber_steps(libbacktrace${suffix} clang ${deps}) - - externalproject_add(libffi${suffix} - DEPENDS clang ${deps} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libffi - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${suffix}/libffi - CONFIGURE_COMMAND /configure --disable-multilib "CC=${CMAKE_BINARY_DIR}/bin/clang ${cflags}" - BUILD_COMMAND make -j${PROCESSOR_COUNT} - INSTALL_COMMAND "" - LOG_CONFIGURE 1 - LOG_BUILD 1 - ) - set_property(TARGET libffi${suffix} - PROPERTY EXCLUDE_FROM_ALL ${exclude_from_all}) - - add_clobber_steps(libffi${suffix} clang ${deps}) - - externalproject_add(libgo${suffix} - DEPENDS clang llgo cc-wrapper libbacktrace${suffix} libffi${suffix} ${deps} - SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/third_party/gofrontend/libgo - BINARY_DIR ${CMAKE_CURRENT_BINARY_DIR}/${suffix}/libgo - INSTALL_DIR ${CMAKE_BINARY_DIR} - CONFIGURE_COMMAND /configure --disable-multilib --without-libatomic --prefix= "CC=env REAL_CC=${CMAKE_BINARY_DIR}/bin/clang@SPACE@${cflags} ${CMAKE_BINARY_DIR}/bin/cc-wrapper" "GOC=${CMAKE_BINARY_DIR}/bin/llgo -no-prefix -fcompilerrt-prefix=${CMAKE_BINARY_DIR} ${gocflags}" - BUILD_COMMAND make -j${PROCESSOR_COUNT} - LOG_CONFIGURE 1 - LOG_BUILD 1 - LOG_INSTALL 1 - ) - set_property(TARGET libgo${suffix} - PROPERTY EXCLUDE_FROM_ALL ${exclude_from_all}) - - add_clobber_steps(libgo${suffix} clang - ${CMAKE_BINARY_DIR}/bin/llgo${CMAKE_EXECUTABLE_SUFFIX} - ${CMAKE_BINARY_DIR}/bin/cc-wrapper${CMAKE_EXECUTABLE_SUFFIX}) -endfunction() - -add_libgo_variant("" "" "" "" FALSE) - -if(TARGET asan) - add_libgo_variant("_asan" "-fsanitize=address" "-fsanitize=address" asan TRUE) -endif() - -if(TARGET tsan) - add_libgo_variant("_tsan" "-fsanitize=thread" "-fsanitize=thread" tsan TRUE) -endif() - -if(TARGET msan) - add_libgo_variant("_msan" "-fsanitize=memory" "-fsanitize=memory" msan TRUE) -endif() - -if(TARGET dfsan) - add_libgo_variant("_dfsan" "-fsanitize=dataflow" "-fsanitize=dataflow" dfsan TRUE) -endif() - -set(LLGO_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX}) - -install(FILES ${LLGO_LIBRARY_DIR}/libgo-llgo.a - ${LLGO_LIBRARY_DIR}/libgo-llgo.so - ${LLGO_LIBRARY_DIR}/libgo-llgo.so.8 - ${LLGO_LIBRARY_DIR}/libgo-llgo.so.8.0.0 - ${LLGO_LIBRARY_DIR}/libgobegin-llgo.a - DESTINATION lib${LLVM_LIBDIR_SUFFIX}) - -install(DIRECTORY ${LLGO_LIBRARY_DIR}/go - DESTINATION lib${LLVM_LIBDIR_SUFFIX}) - -add_custom_target(check-libgo - COMMAND make -C ${CMAKE_CURRENT_BINARY_DIR}/libgo -j${PROCESSOR_COUNT} check - DEPENDS libgo - ${cmake_3_2_USES_TERMINAL} - COMMENT "Running libgo tests") - -add_custom_target(check-llgo-bootstrap - COMMAND strip -R .note.gnu.build-id -o ${CMAKE_CURRENT_BINARY_DIR}/llgo-stage2.stripped - ${CMAKE_BINARY_DIR}/bin/llgo-stage2${CMAKE_EXECUTABLE_SUFFIX} - COMMAND strip -R .note.gnu.build-id -o ${CMAKE_CURRENT_BINARY_DIR}/llgo-stage3.stripped - ${CMAKE_BINARY_DIR}/bin/llgo-stage3${CMAKE_EXECUTABLE_SUFFIX} - COMMAND cmp ${CMAKE_CURRENT_BINARY_DIR}/llgo-stage2.stripped - ${CMAKE_CURRENT_BINARY_DIR}/llgo-stage3.stripped - DEPENDS llgo-stage2 llgo-stage3 - COMMENT "Checking llgo bootstrap") - -add_subdirectory(test) diff --git a/llgo/LICENSE.TXT b/llgo/LICENSE.TXT deleted file mode 100644 index 95010fc56938..000000000000 --- a/llgo/LICENSE.TXT +++ /dev/null @@ -1,94 +0,0 @@ -The llgo distribution, excluding the contents of the 'include' and -'third_party' directories, is licensed under the University of Illinois -"BSD-Like" license. - -The contents of the 'include' directory are dual licensed under both the -University of Illinois "BSD-Like" license and the MIT license. As a user of -this code you may choose to use it under either license. As a contributor, -you agree to allow your code to be used under both. - -Full text of the relevant licenses is included below. - -============================================================================== -LLVM Release License -============================================================================== -University of Illinois/NCSA -Open Source License - -Copyright (c) 2007-2015 University of Illinois at Urbana-Champaign. -All rights reserved. - -Developed by: - - LLVM Team - - http://llvm.org - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal with -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - - * Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimers. - - * Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimers in the - documentation and/or other materials provided with the distribution. - - * Neither the names of the LLVM Team, University of Illinois at - Urbana-Champaign, nor the names of its contributors may be used to - endorse or promote products derived from this Software without specific - prior written permission. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS -FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -CONTRIBUTORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS WITH THE -SOFTWARE. - -============================================================================== - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in -all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN -THE SOFTWARE. - -============================================================================== -The LLVM software contains code written by third parties. Such software will -have its own individual LICENSE or COPYING file in the directory in which it -appears. This file will describe the copyrights, license, and restrictions -which apply to that code. - -The disclaimer of warranty in the University of Illinois Open Source License -applies to all code in the LLVM Distribution, and nothing in any of the -other licenses gives permission to use the names of the LLVM Team or the -University of Illinois to endorse or promote products derived from this -Software. - -The following pieces of software have additional or alternate copyrights, -licenses, and/or restrictions: - -Program Directory -------- --------- -go.tools third_party/gotools -gofrontend third_party/gofrontend -liner third_party/liner - diff --git a/llgo/README.TXT b/llgo/README.TXT deleted file mode 100644 index 8fc60cb4231e..000000000000 --- a/llgo/README.TXT +++ /dev/null @@ -1,80 +0,0 @@ -llgo -==== - -llgo is a Go (http://golang.org) frontend for LLVM, written in Go. - -llgo is under active development. It compiles and passes most of the -standard library test suite and a substantial portion of the gc test suite, -but there are some corner cases that are known not to be handled correctly -yet. Nevertheless it can compile modestly substantial programs (including -itself; it is self hosting on x86-64 Linux). - -Mailing list: https://groups.google.com/d/forum/llgo-dev - -Supported platforms -------------------- - -llgo is currently only supported on the x86-64 Linux platform. Contributions -that add support for other platforms are welcome. - -There are two components which would need to be ported to new platforms: the -compiler and the runtime library. The compiler has little platform-specific -code; the most significant is in irgen/cabi.go. The main limiting factor -for new platforms is the runtime library in third_party/gofrontend/libgo, -which inherits some support for other platforms from the gc compiler's -runtime library, but this support tends to be incomplete. - -Installation ------------- - -llgo requires: -* Go 1.3 or later. -* CMake 2.8.8 or later (to build LLVM). -* A modern C++ toolchain (to build LLVM). - http://llvm.org/docs/GettingStarted.html#getting-a-modern-host-c-toolchain - -Note that Ubuntu Precise is one Linux distribution which does not package -a sufficiently new CMake or C++ toolchain. - -To build and install llgo: - - # Checkout LLVM: - svn co http://llvm.org/svn/llvm-project/llvm/trunk /path/to/llvm - - # Checkout Clang: - cd /path/to/llvm/tools - svn co http://llvm.org/svn/llvm-project/cfe/trunk clang - - # Checkout llgo: - svn co http://llvm.org/svn/llvm-project/llgo/trunk llgo - - # Build LLVM, Clang and llgo: (see also http://llvm.org/docs/CMake.html) - mkdir /path/to/llvm-build - cd /path/to/llvm-build - cmake /path/to/llvm -DCMAKE_INSTALL_PREFIX=/path/to/llvm-inst - make install - -Running -------- - -llgo-go is llgo's version of the "go" command. It has the same command line -interface as go, and works the same way, but it uses llgo to compile. - -llgoi is an interactive REPL for Go. It supports expressions, statements, most -declarations and imports, including binary imports from the standard library -and source imports from $GOPATH. See docs/llgoi.rst for more information. - -llgo is the compiler binary. It has a command line interface that is intended -to be compatible to a large extent with gccgo. - -Contributing ------------- - -Changes to code outside the third_party directory should be contributed in -the normal way by sending patches to . - -Changes to code in the third_party directory must first be made in the -respective upstream project, from which they will be mirrored into the llgo -repository. See the script update_third_party.sh for the locations of the -upstream projects and details of how the mirroring works. - diff --git a/llgo/autoconf/config.sub b/llgo/autoconf/config.sub deleted file mode 100644 index 2583c901235a..000000000000 --- a/llgo/autoconf/config.sub +++ /dev/null @@ -1,1770 +0,0 @@ -#! /bin/sh -# Configuration validation subroutine script. -# Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, -# 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, -# 2011 Free Software Foundation, Inc. - -timestamp='2011-11-02' - -# This file is (in principle) common to ALL GNU software. -# The presence of a machine in this file suggests that SOME GNU software -# can handle that machine. It does not imply ALL GNU software can. -# -# This file is free software; you can redistribute it and/or modify -# it under the terms of the GNU General Public License as published by -# the Free Software Foundation; either version 2 of the License, or -# (at your option) any later version. -# -# This program is distributed in the hope that it will be useful, -# but WITHOUT ANY WARRANTY; without even the implied warranty of -# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -# GNU General Public License for more details. -# -# You should have received a copy of the GNU General Public License -# along with this program; if not, write to the Free Software -# Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA -# 02110-1301, USA. -# -# As a special exception to the GNU General Public License, if you -# distribute this file as part of a program that contains a -# configuration script generated by Autoconf, you may include it under -# the same distribution terms that you use for the rest of that program. - - -# Please send patches to . Submit a context -# diff and a properly formatted GNU ChangeLog entry. -# -# Configuration subroutine to validate and canonicalize a configuration type. -# Supply the specified configuration type as an argument. -# If it is invalid, we print an error message on stderr and exit with code 1. -# Otherwise, we print the canonical config type on stdout and succeed. - -# You can get the latest version of this script from: -# http://git.savannah.gnu.org/gitweb/?p=config.git;a=blob_plain;f=config.sub;hb=HEAD - -# This file is supposed to be the same for all GNU packages -# and recognize all the CPU types, system types and aliases -# that are meaningful with *any* GNU software. -# Each package is responsible for reporting which valid configurations -# it does not support. The user should be able to distinguish -# a failure to support a valid configuration from a meaningless -# configuration. - -# The goal of this file is to map all the various variations of a given -# machine specification into a single specification in the form: -# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM -# or in some cases, the newer four-part form: -# CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM -# It is wrong to echo any other type of specification. - -me=`echo "$0" | sed -e 's,.*/,,'` - -usage="\ -Usage: $0 [OPTION] CPU-MFR-OPSYS - $0 [OPTION] ALIAS - -Canonicalize a configuration name. - -Operation modes: - -h, --help print this help, then exit - -t, --time-stamp print date of last modification, then exit - -v, --version print version number, then exit - -Report bugs and patches to ." - -version="\ -GNU config.sub ($timestamp) - -Copyright (C) 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, -2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011 Free -Software Foundation, Inc. - -This is free software; see the source for copying conditions. There is NO -warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE." - -help=" -Try \`$me --help' for more information." - -# Parse command line -while test $# -gt 0 ; do - case $1 in - --time-stamp | --time* | -t ) - echo "$timestamp" ; exit ;; - --version | -v ) - echo "$version" ; exit ;; - --help | --h* | -h ) - echo "$usage"; exit ;; - -- ) # Stop option processing - shift; break ;; - - ) # Use stdin as input. - break ;; - -* ) - echo "$me: invalid option $1$help" - exit 1 ;; - - *local*) - # First pass through any local machine types. - echo $1 - exit ;; - - * ) - break ;; - esac -done - -case $# in - 0) echo "$me: missing argument$help" >&2 - exit 1;; - 1) ;; - *) echo "$me: too many arguments$help" >&2 - exit 1;; -esac - -# Separate what the user gave into CPU-COMPANY and OS or KERNEL-OS (if any). -# Here we must recognize all the valid KERNEL-OS combinations. -maybe_os=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\2/'` -case $maybe_os in - nto-qnx* | linux-gnu* | linux-android* | linux-dietlibc | linux-newlib* | \ - linux-uclibc* | uclinux-uclibc* | uclinux-gnu* | kfreebsd*-gnu* | \ - knetbsd*-gnu* | netbsd*-gnu* | \ - kopensolaris*-gnu* | \ - storm-chaos* | os2-emx* | rtmk-nova*) - os=-$maybe_os - basic_machine=`echo $1 | sed 's/^\(.*\)-\([^-]*-[^-]*\)$/\1/'` - ;; - *) - basic_machine=`echo $1 | sed 's/-[^-]*$//'` - if [ $basic_machine != $1 ] - then os=`echo $1 | sed 's/.*-/-/'` - else os=; fi - ;; -esac - -### Let's recognize common machines as not being operating systems so -### that things like config.sub decstation-3100 work. We also -### recognize some manufacturers as not being operating systems, so we -### can provide default operating systems below. -case $os in - -sun*os*) - # Prevent following clause from handling this invalid input. - ;; - -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \ - -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \ - -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \ - -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\ - -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \ - -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp | \ - -apple | -axis | -knuth | -cray | -microblaze) - os= - basic_machine=$1 - ;; - -bluegene*) - os=-cnk - ;; - -sim | -cisco | -oki | -wec | -winbond) - os= - basic_machine=$1 - ;; - -scout) - ;; - -wrs) - os=-vxworks - basic_machine=$1 - ;; - -chorusos*) - os=-chorusos - basic_machine=$1 - ;; - -chorusrdb) - os=-chorusrdb - basic_machine=$1 - ;; - -hiux*) - os=-hiuxwe2 - ;; - -sco6) - os=-sco5v6 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5) - os=-sco3.2v5 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco4) - os=-sco3.2v4 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2.[4-9]*) - os=`echo $os | sed -e 's/sco3.2./sco3.2v/'` - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco3.2v[4-9]*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco5v6*) - # Don't forget version if it is 3.2v4 or newer. - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -sco*) - os=-sco3.2v2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -udk*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -isc) - os=-isc2.2 - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -clix*) - basic_machine=clipper-intergraph - ;; - -isc*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-pc/'` - ;; - -lynx*) - os=-lynxos - ;; - -ptx*) - basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'` - ;; - -windowsnt*) - os=`echo $os | sed -e 's/windowsnt/winnt/'` - ;; - -psos*) - os=-psos - ;; - -mint | -mint[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; -esac - -# Decode aliases for certain CPU-COMPANY combinations. -case $basic_machine in - # Recognize the basic CPU types without company name. - # Some are omitted here because they have special meanings below. - 1750a | 580 \ - | a29k \ - | alpha | alphaev[4-8] | alphaev56 | alphaev6[78] | alphapca5[67] \ - | alpha64 | alpha64ev[4-8] | alpha64ev56 | alpha64ev6[78] | alpha64pca5[67] \ - | am33_2.0 \ - | arc | arm | arm[bl]e | arme[lb] | armv[2345] | armv[345][lb] | avr | avr32 \ - | aarch64 | aarch64_be \ - | be32 | be64 \ - | bfin \ - | c4x | clipper \ - | d10v | d30v | dlx | dsp16xx \ - | fido | fr30 | frv \ - | hexagon \ - | h8300 | h8500 | hppa | hppa1.[01] | hppa2.0 | hppa2.0[nw] | hppa64 \ - | i370 | i860 | i960 | ia64 \ - | ip2k | iq2000 \ - | le32 | le64 \ - | lm32 \ - | m32c | m32r | m32rle | m68000 | m68k | m88k \ - | maxq | mb | microblaze | mcore | mep | metag \ - | mips | mipsbe | mipseb | mipsel | mipsle \ - | mips16 \ - | mips64 | mips64el \ - | mips64octeon | mips64octeonel \ - | mips64orion | mips64orionel \ - | mips64r5900 | mips64r5900el \ - | mips64vr | mips64vrel \ - | mips64vr4100 | mips64vr4100el \ - | mips64vr4300 | mips64vr4300el \ - | mips64vr5000 | mips64vr5000el \ - | mips64vr5900 | mips64vr5900el \ - | mipsisa32 | mipsisa32el \ - | mipsisa32r2 | mipsisa32r2el \ - | mipsisa64 | mipsisa64el \ - | mipsisa64r2 | mipsisa64r2el \ - | mipsisa64sb1 | mipsisa64sb1el \ - | mipsisa64sr71k | mipsisa64sr71kel \ - | mipstx39 | mipstx39el \ - | mn10200 | mn10300 \ - | moxie \ - | mt \ - | msp430 \ - | nds32 | nds32le | nds32be \ - | nios | nios2 \ - | ns16k | ns32k \ - | open8 \ - | or32 \ - | pdp10 | pdp11 | pj | pjl \ - | powerpc | powerpc64 | powerpc64le | powerpcle \ - | pyramid \ - | rx \ - | score \ - | sh | sh[1234] | sh[24]a | sh[24]aeb | sh[23]e | sh[34]eb | sheb | shbe | shle | sh[1234]le | sh3ele \ - | sh64 | sh64le \ - | sparc | sparc64 | sparc64b | sparc64v | sparc86x | sparclet | sparclite \ - | sparcv8 | sparcv9 | sparcv9b | sparcv9v \ - | spu \ - | tahoe | tic4x | tic54x | tic55x | tic6x | tic80 | tron \ - | ubicom32 \ - | v850 | v850e | v850e1 | v850e2 | v850es | v850e2v3 \ - | we32k \ - | x86 | xc16x | xstormy16 | xtensa \ - | z8k | z80) - basic_machine=$basic_machine-unknown - ;; - c54x) - basic_machine=tic54x-unknown - ;; - c55x) - basic_machine=tic55x-unknown - ;; - c6x) - basic_machine=tic6x-unknown - ;; - m6811 | m68hc11 | m6812 | m68hc12 | picochip) - # Motorola 68HC11/12. - basic_machine=$basic_machine-unknown - os=-none - ;; - m88110 | m680[12346]0 | m683?2 | m68360 | m5200 | v70 | w65 | z8k) - ;; - ms1) - basic_machine=mt-unknown - ;; - - strongarm | thumb | xscale) - basic_machine=arm-unknown - ;; - - xscaleeb) - basic_machine=armeb-unknown - ;; - - xscaleel) - basic_machine=armel-unknown - ;; - - # We use `pc' rather than `unknown' - # because (1) that's what they normally are, and - # (2) the word "unknown" tends to confuse beginning users. - i*86 | x86_64) - basic_machine=$basic_machine-pc - ;; - # Object if more than one company name word. - *-*-*) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; - # Recognize the basic CPU types with company name. - 580-* \ - | a29k-* \ - | alpha-* | alphaev[4-8]-* | alphaev56-* | alphaev6[78]-* \ - | alpha64-* | alpha64ev[4-8]-* | alpha64ev56-* | alpha64ev6[78]-* \ - | alphapca5[67]-* | alpha64pca5[67]-* | arc-* \ - | arm-* | armbe-* | armle-* | armeb-* | armv*-* \ - | aarch64-* | aarch64_be-* \ - | avr-* | avr32-* \ - | be32-* | be64-* \ - | bfin-* | bs2000-* \ - | c[123]* | c30-* | [cjt]90-* | c4x-* \ - | clipper-* | craynv-* | cydra-* \ - | d10v-* | d30v-* | dlx-* \ - | elxsi-* \ - | f30[01]-* | f700-* | fido-* | fr30-* | frv-* | fx80-* \ - | h8300-* | h8500-* \ - | hexagon-* \ - | hppa-* | hppa1.[01]-* | hppa2.0-* | hppa2.0[nw]-* | hppa64-* \ - | i*86-* | i860-* | i960-* | ia64-* \ - | ip2k-* | iq2000-* \ - | le32-* | le64-* \ - | lm32-* \ - | m32c-* | m32r-* | m32rle-* \ - | m68000-* | m680[012346]0-* | m68360-* | m683?2-* | m68k-* \ - | m88110-* | m88k-* | maxq-* | mcore-* | metag-* | microblaze-* \ - | mips-* | mipsbe-* | mipseb-* | mipsel-* | mipsle-* \ - | mips16-* \ - | mips64-* | mips64el-* \ - | mips64octeon-* | mips64octeonel-* \ - | mips64orion-* | mips64orionel-* \ - | mips64r5900-* | mips64r5900el-* \ - | mips64vr-* | mips64vrel-* \ - | mips64vr4100-* | mips64vr4100el-* \ - | mips64vr4300-* | mips64vr4300el-* \ - | mips64vr5000-* | mips64vr5000el-* \ - | mips64vr5900-* | mips64vr5900el-* \ - | mipsisa32-* | mipsisa32el-* \ - | mipsisa32r2-* | mipsisa32r2el-* \ - | mipsisa64-* | mipsisa64el-* \ - | mipsisa64r2-* | mipsisa64r2el-* \ - | mipsisa64sb1-* | mipsisa64sb1el-* \ - | mipsisa64sr71k-* | mipsisa64sr71kel-* \ - | mipstx39-* | mipstx39el-* \ - | mmix-* \ - | mt-* \ - | msp430-* \ - | nds32-* | nds32le-* | nds32be-* \ - | nios-* | nios2-* \ - | none-* | np1-* | ns16k-* | ns32k-* \ - | open8-* \ - | orion-* \ - | pdp10-* | pdp11-* | pj-* | pjl-* | pn-* | power-* \ - | powerpc-* | powerpc64-* | powerpc64le-* | powerpcle-* \ - | pyramid-* \ - | romp-* | rs6000-* | rx-* \ - | sh-* | sh[1234]-* | sh[24]a-* | sh[24]aeb-* | sh[23]e-* | sh[34]eb-* | sheb-* | shbe-* \ - | shle-* | sh[1234]le-* | sh3ele-* | sh64-* | sh64le-* \ - | sparc-* | sparc64-* | sparc64b-* | sparc64v-* | sparc86x-* | sparclet-* \ - | sparclite-* \ - | sparcv8-* | sparcv9-* | sparcv9b-* | sparcv9v-* | sv1-* | sx?-* \ - | tahoe-* \ - | tic30-* | tic4x-* | tic54x-* | tic55x-* | tic6x-* | tic80-* \ - | tile*-* \ - | tron-* \ - | ubicom32-* \ - | v850-* | v850e-* | v850e1-* | v850es-* | v850e2-* | v850e2v3-* \ - | vax-* \ - | we32k-* \ - | x86-* | x86_64-* | xc16x-* | xps100-* \ - | xstormy16-* | xtensa*-* \ - | ymp-* \ - | z8k-* | z80-*) - ;; - # Recognize the basic CPU types without company name, with glob match. - xtensa*) - basic_machine=$basic_machine-unknown - ;; - # Recognize the various machine names and aliases which stand - # for a CPU type and a company and sometimes even an OS. - 386bsd) - basic_machine=i386-unknown - os=-bsd - ;; - 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc) - basic_machine=m68000-att - ;; - 3b*) - basic_machine=we32k-att - ;; - a29khif) - basic_machine=a29k-amd - os=-udi - ;; - abacus) - basic_machine=abacus-unknown - ;; - adobe68k) - basic_machine=m68010-adobe - os=-scout - ;; - alliant | fx80) - basic_machine=fx80-alliant - ;; - altos | altos3068) - basic_machine=m68k-altos - ;; - am29k) - basic_machine=a29k-none - os=-bsd - ;; - amd64) - basic_machine=x86_64-pc - ;; - amd64-*) - basic_machine=x86_64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - amdahl) - basic_machine=580-amdahl - os=-sysv - ;; - amiga | amiga-*) - basic_machine=m68k-unknown - ;; - amigaos | amigados) - basic_machine=m68k-unknown - os=-amigaos - ;; - amigaunix | amix) - basic_machine=m68k-unknown - os=-sysv4 - ;; - apollo68) - basic_machine=m68k-apollo - os=-sysv - ;; - apollo68bsd) - basic_machine=m68k-apollo - os=-bsd - ;; - aros) - basic_machine=i386-pc - os=-aros - ;; - aux) - basic_machine=m68k-apple - os=-aux - ;; - balance) - basic_machine=ns32k-sequent - os=-dynix - ;; - blackfin) - basic_machine=bfin-unknown - os=-linux - ;; - blackfin-*) - basic_machine=bfin-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - bluegene*) - basic_machine=powerpc-ibm - os=-cnk - ;; - c54x-*) - basic_machine=tic54x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c55x-*) - basic_machine=tic55x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c6x-*) - basic_machine=tic6x-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - c90) - basic_machine=c90-cray - os=-unicos - ;; - cegcc) - basic_machine=arm-unknown - os=-cegcc - ;; - convex-c1) - basic_machine=c1-convex - os=-bsd - ;; - convex-c2) - basic_machine=c2-convex - os=-bsd - ;; - convex-c32) - basic_machine=c32-convex - os=-bsd - ;; - convex-c34) - basic_machine=c34-convex - os=-bsd - ;; - convex-c38) - basic_machine=c38-convex - os=-bsd - ;; - cray | j90) - basic_machine=j90-cray - os=-unicos - ;; - craynv) - basic_machine=craynv-cray - os=-unicosmp - ;; - cr16 | cr16-*) - basic_machine=cr16-unknown - os=-elf - ;; - crds | unos) - basic_machine=m68k-crds - ;; - crisv32 | crisv32-* | etraxfs*) - basic_machine=crisv32-axis - ;; - cris | cris-* | etrax*) - basic_machine=cris-axis - ;; - crx) - basic_machine=crx-unknown - os=-elf - ;; - da30 | da30-*) - basic_machine=m68k-da30 - ;; - decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn) - basic_machine=mips-dec - ;; - decsystem10* | dec10*) - basic_machine=pdp10-dec - os=-tops10 - ;; - decsystem20* | dec20*) - basic_machine=pdp10-dec - os=-tops20 - ;; - delta | 3300 | motorola-3300 | motorola-delta \ - | 3300-motorola | delta-motorola) - basic_machine=m68k-motorola - ;; - delta88) - basic_machine=m88k-motorola - os=-sysv3 - ;; - dicos) - basic_machine=i686-pc - os=-dicos - ;; - djgpp) - basic_machine=i586-pc - os=-msdosdjgpp - ;; - dpx20 | dpx20-*) - basic_machine=rs6000-bull - os=-bosx - ;; - dpx2* | dpx2*-bull) - basic_machine=m68k-bull - os=-sysv3 - ;; - ebmon29k) - basic_machine=a29k-amd - os=-ebmon - ;; - elxsi) - basic_machine=elxsi-elxsi - os=-bsd - ;; - encore | umax | mmax) - basic_machine=ns32k-encore - ;; - es1800 | OSE68k | ose68k | ose | OSE) - basic_machine=m68k-ericsson - os=-ose - ;; - fx2800) - basic_machine=i860-alliant - ;; - genix) - basic_machine=ns32k-ns - ;; - gmicro) - basic_machine=tron-gmicro - os=-sysv - ;; - go32) - basic_machine=i386-pc - os=-go32 - ;; - h3050r* | hiux*) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - h8300hms) - basic_machine=h8300-hitachi - os=-hms - ;; - h8300xray) - basic_machine=h8300-hitachi - os=-xray - ;; - h8500hms) - basic_machine=h8500-hitachi - os=-hms - ;; - harris) - basic_machine=m88k-harris - os=-sysv3 - ;; - hp300-*) - basic_machine=m68k-hp - ;; - hp300bsd) - basic_machine=m68k-hp - os=-bsd - ;; - hp300hpux) - basic_machine=m68k-hp - os=-hpux - ;; - hp3k9[0-9][0-9] | hp9[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k2[0-9][0-9] | hp9k31[0-9]) - basic_machine=m68000-hp - ;; - hp9k3[2-9][0-9]) - basic_machine=m68k-hp - ;; - hp9k6[0-9][0-9] | hp6[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hp9k7[0-79][0-9] | hp7[0-79][0-9]) - basic_machine=hppa1.1-hp - ;; - hp9k78[0-9] | hp78[0-9]) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[67]1 | hp8[67]1 | hp9k80[24] | hp80[24] | hp9k8[78]9 | hp8[78]9 | hp9k893 | hp893) - # FIXME: really hppa2.0-hp - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][13679] | hp8[0-9][13679]) - basic_machine=hppa1.1-hp - ;; - hp9k8[0-9][0-9] | hp8[0-9][0-9]) - basic_machine=hppa1.0-hp - ;; - hppa-next) - os=-nextstep3 - ;; - hppaosf) - basic_machine=hppa1.1-hp - os=-osf - ;; - hppro) - basic_machine=hppa1.1-hp - os=-proelf - ;; - i370-ibm* | ibm*) - basic_machine=i370-ibm - ;; -# I'm not sure what "Sysv32" means. Should this be sysv3.2? - i*86v32) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv32 - ;; - i*86v4*) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv4 - ;; - i*86v) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-sysv - ;; - i*86sol2) - basic_machine=`echo $1 | sed -e 's/86.*/86-pc/'` - os=-solaris2 - ;; - i386mach) - basic_machine=i386-mach - os=-mach - ;; - i386-vsta | vsta) - basic_machine=i386-unknown - os=-vsta - ;; - iris | iris4d) - basic_machine=mips-sgi - case $os in - -irix*) - ;; - *) - os=-irix4 - ;; - esac - ;; - isi68 | isi) - basic_machine=m68k-isi - os=-sysv - ;; - m68knommu) - basic_machine=m68k-unknown - os=-linux - ;; - m68knommu-*) - basic_machine=m68k-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - m88k-omron*) - basic_machine=m88k-omron - ;; - magnum | m3230) - basic_machine=mips-mips - os=-sysv - ;; - merlin) - basic_machine=ns32k-utek - os=-sysv - ;; - microblaze) - basic_machine=microblaze-xilinx - ;; - mingw32) - basic_machine=i386-pc - os=-mingw32 - ;; - mingw32ce) - basic_machine=arm-unknown - os=-mingw32ce - ;; - miniframe) - basic_machine=m68000-convergent - ;; - *mint | -mint[0-9]* | *MiNT | *MiNT[0-9]*) - basic_machine=m68k-atari - os=-mint - ;; - mips3*-*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'` - ;; - mips3*) - basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown - ;; - monitor) - basic_machine=m68k-rom68k - os=-coff - ;; - morphos) - basic_machine=powerpc-unknown - os=-morphos - ;; - msdos) - basic_machine=i386-pc - os=-msdos - ;; - ms1-*) - basic_machine=`echo $basic_machine | sed -e 's/ms1-/mt-/'` - ;; - mvs) - basic_machine=i370-ibm - os=-mvs - ;; - nacl) - basic_machine=le32-unknown - os=-nacl - ;; - ncr3000) - basic_machine=i486-ncr - os=-sysv4 - ;; - netbsd386) - basic_machine=i386-unknown - os=-netbsd - ;; - netwinder) - basic_machine=armv4l-rebel - os=-linux - ;; - news | news700 | news800 | news900) - basic_machine=m68k-sony - os=-newsos - ;; - news1000) - basic_machine=m68030-sony - os=-newsos - ;; - news-3600 | risc-news) - basic_machine=mips-sony - os=-newsos - ;; - necv70) - basic_machine=v70-nec - os=-sysv - ;; - next | m*-next ) - basic_machine=m68k-next - case $os in - -nextstep* ) - ;; - -ns2*) - os=-nextstep2 - ;; - *) - os=-nextstep3 - ;; - esac - ;; - nh3000) - basic_machine=m68k-harris - os=-cxux - ;; - nh[45]000) - basic_machine=m88k-harris - os=-cxux - ;; - nindy960) - basic_machine=i960-intel - os=-nindy - ;; - mon960) - basic_machine=i960-intel - os=-mon960 - ;; - nonstopux) - basic_machine=mips-compaq - os=-nonstopux - ;; - np1) - basic_machine=np1-gould - ;; - neo-tandem) - basic_machine=neo-tandem - ;; - nse-tandem) - basic_machine=nse-tandem - ;; - nsr-tandem) - basic_machine=nsr-tandem - ;; - op50n-* | op60c-*) - basic_machine=hppa1.1-oki - os=-proelf - ;; - openrisc | openrisc-*) - basic_machine=or32-unknown - ;; - os400) - basic_machine=powerpc-ibm - os=-os400 - ;; - OSE68000 | ose68000) - basic_machine=m68000-ericsson - os=-ose - ;; - os68k) - basic_machine=m68k-none - os=-os68k - ;; - pa-hitachi) - basic_machine=hppa1.1-hitachi - os=-hiuxwe2 - ;; - paragon) - basic_machine=i860-intel - os=-osf - ;; - parisc) - basic_machine=hppa-unknown - os=-linux - ;; - parisc-*) - basic_machine=hppa-`echo $basic_machine | sed 's/^[^-]*-//'` - os=-linux - ;; - pbd) - basic_machine=sparc-tti - ;; - pbb) - basic_machine=m68k-tti - ;; - pc532 | pc532-*) - basic_machine=ns32k-pc532 - ;; - pc98) - basic_machine=i386-pc - ;; - pc98-*) - basic_machine=i386-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium | p5 | k5 | k6 | nexgen | viac3) - basic_machine=i586-pc - ;; - pentiumpro | p6 | 6x86 | athlon | athlon_*) - basic_machine=i686-pc - ;; - pentiumii | pentium2 | pentiumiii | pentium3) - basic_machine=i686-pc - ;; - pentium4) - basic_machine=i786-pc - ;; - pentium-* | p5-* | k5-* | k6-* | nexgen-* | viac3-*) - basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumpro-* | p6-* | 6x86-* | athlon-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentiumii-* | pentium2-* | pentiumiii-* | pentium3-*) - basic_machine=i686-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pentium4-*) - basic_machine=i786-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - pn) - basic_machine=pn-gould - ;; - power) basic_machine=power-ibm - ;; - ppc | ppcbe) basic_machine=powerpc-unknown - ;; - ppc-* | ppcbe-*) - basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppcle | powerpclittle | ppc-le | powerpc-little) - basic_machine=powerpcle-unknown - ;; - ppcle-* | powerpclittle-*) - basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64) basic_machine=powerpc64-unknown - ;; - ppc64-*) basic_machine=powerpc64-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ppc64le | powerpc64little | ppc64-le | powerpc64-little) - basic_machine=powerpc64le-unknown - ;; - ppc64le-* | powerpc64little-*) - basic_machine=powerpc64le-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - ps2) - basic_machine=i386-ibm - ;; - pw32) - basic_machine=i586-unknown - os=-pw32 - ;; - rdos) - basic_machine=i386-pc - os=-rdos - ;; - rom68k) - basic_machine=m68k-rom68k - os=-coff - ;; - rm[46]00) - basic_machine=mips-siemens - ;; - rtpc | rtpc-*) - basic_machine=romp-ibm - ;; - s390 | s390-*) - basic_machine=s390-ibm - ;; - s390x | s390x-*) - basic_machine=s390x-ibm - ;; - sa29200) - basic_machine=a29k-amd - os=-udi - ;; - sb1) - basic_machine=mipsisa64sb1-unknown - ;; - sb1el) - basic_machine=mipsisa64sb1el-unknown - ;; - sde) - basic_machine=mipsisa32-sde - os=-elf - ;; - sei) - basic_machine=mips-sei - os=-seiux - ;; - sequent) - basic_machine=i386-sequent - ;; - sh) - basic_machine=sh-hitachi - os=-hms - ;; - sh5el) - basic_machine=sh5le-unknown - ;; - sh64) - basic_machine=sh64-unknown - ;; - sparclite-wrs | simso-wrs) - basic_machine=sparclite-wrs - os=-vxworks - ;; - sps7) - basic_machine=m68k-bull - os=-sysv2 - ;; - spur) - basic_machine=spur-unknown - ;; - st2000) - basic_machine=m68k-tandem - ;; - stratus) - basic_machine=i860-stratus - os=-sysv4 - ;; - strongarm-* | thumb-*) - basic_machine=arm-`echo $basic_machine | sed 's/^[^-]*-//'` - ;; - sun2) - basic_machine=m68000-sun - ;; - sun2os3) - basic_machine=m68000-sun - os=-sunos3 - ;; - sun2os4) - basic_machine=m68000-sun - os=-sunos4 - ;; - sun3os3) - basic_machine=m68k-sun - os=-sunos3 - ;; - sun3os4) - basic_machine=m68k-sun - os=-sunos4 - ;; - sun4os3) - basic_machine=sparc-sun - os=-sunos3 - ;; - sun4os4) - basic_machine=sparc-sun - os=-sunos4 - ;; - sun4sol2) - basic_machine=sparc-sun - os=-solaris2 - ;; - sun3 | sun3-*) - basic_machine=m68k-sun - ;; - sun4) - basic_machine=sparc-sun - ;; - sun386 | sun386i | roadrunner) - basic_machine=i386-sun - ;; - sv1) - basic_machine=sv1-cray - os=-unicos - ;; - symmetry) - basic_machine=i386-sequent - os=-dynix - ;; - t3e) - basic_machine=alphaev5-cray - os=-unicos - ;; - t90) - basic_machine=t90-cray - os=-unicos - ;; - tile*) - basic_machine=$basic_machine-unknown - os=-linux-gnu - ;; - tx39) - basic_machine=mipstx39-unknown - ;; - tx39el) - basic_machine=mipstx39el-unknown - ;; - toad1) - basic_machine=pdp10-xkl - os=-tops20 - ;; - tower | tower-32) - basic_machine=m68k-ncr - ;; - tpf) - basic_machine=s390x-ibm - os=-tpf - ;; - udi29k) - basic_machine=a29k-amd - os=-udi - ;; - ultra3) - basic_machine=a29k-nyu - os=-sym1 - ;; - v810 | necv810) - basic_machine=v810-nec - os=-none - ;; - vaxv) - basic_machine=vax-dec - os=-sysv - ;; - vms) - basic_machine=vax-dec - os=-vms - ;; - vpp*|vx|vx-*) - basic_machine=f301-fujitsu - ;; - vxworks960) - basic_machine=i960-wrs - os=-vxworks - ;; - vxworks68) - basic_machine=m68k-wrs - os=-vxworks - ;; - vxworks29k) - basic_machine=a29k-wrs - os=-vxworks - ;; - w65*) - basic_machine=w65-wdc - os=-none - ;; - w89k-*) - basic_machine=hppa1.1-winbond - os=-proelf - ;; - xbox) - basic_machine=i686-pc - os=-mingw32 - ;; - xps | xps100) - basic_machine=xps100-honeywell - ;; - xscale-* | xscalee[bl]-*) - basic_machine=`echo $basic_machine | sed 's/^xscale/arm/'` - ;; - ymp) - basic_machine=ymp-cray - os=-unicos - ;; - z8k-*-coff) - basic_machine=z8k-unknown - os=-sim - ;; - z80-*-coff) - basic_machine=z80-unknown - os=-sim - ;; - none) - basic_machine=none-none - os=-none - ;; - -# Here we handle the default manufacturer of certain CPU types. It is in -# some cases the only manufacturer, in others, it is the most popular. - w89k) - basic_machine=hppa1.1-winbond - ;; - op50n) - basic_machine=hppa1.1-oki - ;; - op60c) - basic_machine=hppa1.1-oki - ;; - romp) - basic_machine=romp-ibm - ;; - mmix) - basic_machine=mmix-knuth - ;; - rs6000) - basic_machine=rs6000-ibm - ;; - vax) - basic_machine=vax-dec - ;; - pdp10) - # there are many clones, so DEC is not a safe bet - basic_machine=pdp10-unknown - ;; - pdp11) - basic_machine=pdp11-dec - ;; - we32k) - basic_machine=we32k-att - ;; - sh[1234] | sh[24]a | sh[24]aeb | sh[34]eb | sh[1234]le | sh[23]ele) - basic_machine=sh-unknown - ;; - sparc | sparcv8 | sparcv9 | sparcv9b | sparcv9v) - basic_machine=sparc-sun - ;; - cydra) - basic_machine=cydra-cydrome - ;; - orion) - basic_machine=orion-highlevel - ;; - orion105) - basic_machine=clipper-highlevel - ;; - mac | mpw | mac-mpw) - basic_machine=m68k-apple - ;; - pmac | pmac-mpw) - basic_machine=powerpc-apple - ;; - *-unknown) - # Make sure to match an already-canonicalized machine name. - ;; - *) - echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2 - exit 1 - ;; -esac - -# Here we canonicalize certain aliases for manufacturers. -case $basic_machine in - *-digital*) - basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'` - ;; - *-commodore*) - basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'` - ;; - *) - ;; -esac - -# Decode manufacturer-specific aliases for certain operating systems. - -if [ x"$os" != x"" ] -then -case $os in - # First match some system type aliases - # that might get confused with valid system types. - # -solaris* is a basic system type, with this one exception. - -auroraux) - os=-auroraux - ;; - -solaris1 | -solaris1.*) - os=`echo $os | sed -e 's|solaris1|sunos4|'` - ;; - -solaris) - os=-solaris2 - ;; - -svr4*) - os=-sysv4 - ;; - -unixware*) - os=-sysv4.2uw - ;; - -gnu/linux*) - os=`echo $os | sed -e 's|gnu/linux|linux-gnu|'` - ;; - # First accept the basic system types. - # The portable systems comes first. - # Each alternative MUST END IN A *, to match a version number. - # -sysv* is not here because it comes later, after sysvr4. - -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \ - | -*vms* | -sco* | -esix* | -isc* | -aix* | -cnk* | -sunos | -sunos[34]*\ - | -hpux* | -unos* | -osf* | -luna* | -dgux* | -auroraux* | -solaris* \ - | -sym* | -kopensolaris* \ - | -amigaos* | -amigados* | -msdos* | -newsos* | -unicos* | -aof* \ - | -aos* | -aros* \ - | -nindy* | -vxsim* | -vxworks* | -ebmon* | -hms* | -mvs* \ - | -clix* | -riscos* | -uniplus* | -iris* | -rtu* | -xenix* \ - | -hiux* | -386bsd* | -knetbsd* | -mirbsd* | -netbsd* \ - | -openbsd* | -solidbsd* \ - | -ekkobsd* | -kfreebsd* | -freebsd* | -riscix* | -lynxos* \ - | -bosx* | -nextstep* | -cxux* | -aout* | -elf* | -oabi* \ - | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \ - | -udi* | -eabi* | -lites* | -ieee* | -go32* | -aux* \ - | -chorusos* | -chorusrdb* | -cegcc* \ - | -cygwin* | -pe* | -psos* | -moss* | -proelf* | -rtems* \ - | -mingw32* | -linux-gnu* | -linux-android* \ - | -linux-newlib* | -linux-uclibc* \ - | -uxpv* | -beos* | -mpeix* | -udk* \ - | -interix* | -uwin* | -mks* | -rhapsody* | -darwin* | -opened* \ - | -openstep* | -oskit* | -conix* | -pw32* | -nonstopux* \ - | -storm-chaos* | -tops10* | -tenex* | -tops20* | -its* \ - | -os2* | -vos* | -palmos* | -uclinux* | -nucleus* \ - | -morphos* | -superux* | -rtmk* | -rtmk-nova* | -windiss* \ - | -powermax* | -dnix* | -nx6 | -nx7 | -sei* | -dragonfly* \ - | -skyos* | -haiku* | -rdos* | -toppers* | -drops* | -es* | -bitrig*) - # Remember, each alternative MUST END IN *, to match a version number. - ;; - -qnx*) - case $basic_machine in - x86-* | i*86-*) - ;; - *) - os=-nto$os - ;; - esac - ;; - -nto-qnx*) - ;; - -nto*) - os=`echo $os | sed -e 's|nto|nto-qnx|'` - ;; - -sim | -es1800* | -hms* | -xray | -os68k* | -none* | -v88r* \ - | -windows* | -osx | -abug | -netware* | -os9* | -beos* | -haiku* \ - | -macos* | -mpw* | -magic* | -mmixware* | -mon960* | -lnews*) - ;; - -mac*) - os=`echo $os | sed -e 's|mac|macos|'` - ;; - -linux-dietlibc) - os=-linux-dietlibc - ;; - -linux*) - os=`echo $os | sed -e 's|linux|linux-gnu|'` - ;; - -sunos5*) - os=`echo $os | sed -e 's|sunos5|solaris2|'` - ;; - -sunos6*) - os=`echo $os | sed -e 's|sunos6|solaris3|'` - ;; - -opened*) - os=-openedition - ;; - -os400*) - os=-os400 - ;; - -wince*) - os=-wince - ;; - -osfrose*) - os=-osfrose - ;; - -osf*) - os=-osf - ;; - -utek*) - os=-bsd - ;; - -dynix*) - os=-bsd - ;; - -acis*) - os=-aos - ;; - -atheos*) - os=-atheos - ;; - -syllable*) - os=-syllable - ;; - -386bsd) - os=-bsd - ;; - -ctix* | -uts*) - os=-sysv - ;; - -nova*) - os=-rtmk-nova - ;; - -ns2 ) - os=-nextstep2 - ;; - -nsk*) - os=-nsk - ;; - # Preserve the version number of sinix5. - -sinix5.*) - os=`echo $os | sed -e 's|sinix|sysv|'` - ;; - -sinix*) - os=-sysv4 - ;; - -tpf*) - os=-tpf - ;; - -triton*) - os=-sysv3 - ;; - -oss*) - os=-sysv3 - ;; - -svr4) - os=-sysv4 - ;; - -svr3) - os=-sysv3 - ;; - -sysvr4) - os=-sysv4 - ;; - # This must come after -sysvr4. - -sysv*) - ;; - -ose*) - os=-ose - ;; - -es1800*) - os=-ose - ;; - -xenix) - os=-xenix - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - os=-mint - ;; - -aros*) - os=-aros - ;; - -kaos*) - os=-kaos - ;; - -zvmoe) - os=-zvmoe - ;; - -dicos*) - os=-dicos - ;; - -nacl*) - ;; - -ps4) - ;; - -none) - ;; - *) - # Get rid of the `-' at the beginning of $os. - os=`echo $os | sed 's/[^-]*-//'` - echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2 - exit 1 - ;; -esac -else - -# Here we handle the default operating systems that come with various machines. -# The value should be what the vendor currently ships out the door with their -# machine or put another way, the most popular os provided with the machine. - -# Note that if you're going to try to match "-MANUFACTURER" here (say, -# "-sun"), then you have to tell the case statement up towards the top -# that MANUFACTURER isn't an operating system. Otherwise, code above -# will signal an error saying that MANUFACTURER isn't an operating -# system, and we'll never get to this point. - -case $basic_machine in - score-*) - os=-elf - ;; - spu-*) - os=-elf - ;; - *-acorn) - os=-riscix1.2 - ;; - arm*-rebel) - os=-linux - ;; - arm*-semi) - os=-aout - ;; - c4x-* | tic4x-*) - os=-coff - ;; - tic54x-*) - os=-coff - ;; - tic55x-*) - os=-coff - ;; - tic6x-*) - os=-coff - ;; - # This must come before the *-dec entry. - pdp10-*) - os=-tops20 - ;; - pdp11-*) - os=-none - ;; - *-dec | vax-*) - os=-ultrix4.2 - ;; - m68*-apollo) - os=-domain - ;; - i386-sun) - os=-sunos4.0.2 - ;; - m68000-sun) - os=-sunos3 - # This also exists in the configure program, but was not the - # default. - # os=-sunos4 - ;; - m68*-cisco) - os=-aout - ;; - mep-*) - os=-elf - ;; - mips*-cisco) - os=-elf - ;; - mips*-*) - os=-elf - ;; - or32-*) - os=-coff - ;; - *-tti) # must be before sparc entry or we get the wrong os. - os=-sysv3 - ;; - sparc-* | *-sun) - os=-sunos4.1.1 - ;; - *-be) - os=-beos - ;; - *-haiku) - os=-haiku - ;; - *-ibm) - os=-aix - ;; - *-knuth) - os=-mmixware - ;; - *-wec) - os=-proelf - ;; - *-winbond) - os=-proelf - ;; - *-oki) - os=-proelf - ;; - *-hp) - os=-hpux - ;; - *-hitachi) - os=-hiux - ;; - i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent) - os=-sysv - ;; - *-cbm) - os=-amigaos - ;; - *-dg) - os=-dgux - ;; - *-dolphin) - os=-sysv3 - ;; - m68k-ccur) - os=-rtu - ;; - m88k-omron*) - os=-luna - ;; - *-next ) - os=-nextstep - ;; - *-sequent) - os=-ptx - ;; - *-crds) - os=-unos - ;; - *-ns) - os=-genix - ;; - i370-*) - os=-mvs - ;; - *-next) - os=-nextstep3 - ;; - *-gould) - os=-sysv - ;; - *-highlevel) - os=-bsd - ;; - *-encore) - os=-bsd - ;; - *-sgi) - os=-irix - ;; - *-siemens) - os=-sysv4 - ;; - *-masscomp) - os=-rtu - ;; - f30[01]-fujitsu | f700-fujitsu) - os=-uxpv - ;; - *-rom68k) - os=-coff - ;; - *-*bug) - os=-coff - ;; - *-apple) - os=-macos - ;; - *-atari*) - os=-mint - ;; - *) - os=-none - ;; -esac -fi - -# Here we handle the case where we know the os, and the CPU type, but not the -# manufacturer. We pick the logical manufacturer. -vendor=unknown -case $basic_machine in - *-unknown) - case $os in - -riscix*) - vendor=acorn - ;; - -sunos*) - vendor=sun - ;; - -cnk*|-aix*) - vendor=ibm - ;; - -beos*) - vendor=be - ;; - -hpux*) - vendor=hp - ;; - -mpeix*) - vendor=hp - ;; - -hiux*) - vendor=hitachi - ;; - -unos*) - vendor=crds - ;; - -dgux*) - vendor=dg - ;; - -luna*) - vendor=omron - ;; - -genix*) - vendor=ns - ;; - -mvs* | -opened*) - vendor=ibm - ;; - -os400*) - vendor=ibm - ;; - -ptx*) - vendor=sequent - ;; - -tpf*) - vendor=ibm - ;; - -vxsim* | -vxworks* | -windiss*) - vendor=wrs - ;; - -aux*) - vendor=apple - ;; - -hms*) - vendor=hitachi - ;; - -mpw* | -macos*) - vendor=apple - ;; - -*mint | -mint[0-9]* | -*MiNT | -MiNT[0-9]*) - vendor=atari - ;; - -vos*) - vendor=stratus - ;; - esac - basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"` - ;; -esac - -echo $basic_machine$os -exit - -# Local variables: -# eval: (add-hook 'write-file-hooks 'time-stamp) -# time-stamp-start: "timestamp='" -# time-stamp-format: "%:y-%02m-%02d" -# time-stamp-end: "'" -# End: diff --git a/llgo/build/context.go b/llgo/build/context.go deleted file mode 100644 index c1ed935e5643..000000000000 --- a/llgo/build/context.go +++ /dev/null @@ -1,95 +0,0 @@ -//===- context.go - Build context utilities for llgo ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// Build context utilities for llgo. -// -//===----------------------------------------------------------------------===// - -package build - -import ( - "errors" - "go/build" - "regexp" - "strings" -) - -type Context struct { - build.Context - - // LLVM triple - Triple string -} - -// ContextFromTriple returns a new go/build.Context with GOOS and GOARCH -// configured from the given triple. -func ContextFromTriple(triple string) (*Context, error) { - goos, goarch, err := parseTriple(triple) - if err != nil { - return nil, err - } - ctx := &Context{Context: build.Default, Triple: triple} - ctx.GOOS = goos - ctx.GOARCH = goarch - ctx.BuildTags = append(ctx.BuildTags, "llgo") - if triple == "pnacl" { - ctx.BuildTags = append(ctx.BuildTags, "pnacl") - } - return ctx, nil -} - -func parseTriple(triple string) (goos string, goarch string, err error) { - if strings.ToLower(triple) == "pnacl" { - return "nacl", "le32", nil - } - - type REs struct{ re, out string } - // reference: http://llvm.org/docs/doxygen/html/Triple_8cpp_source.html - goarchREs := []REs{ - {"amd64|x86_64", "amd64"}, - {"i[3-9]86", "386"}, - {"xscale|((arm|thumb)(v.*)?)", "arm"}, - } - goosREs := []REs{ - {"linux.*", "linux"}, - {"(darwin|macosx|ios).*", "darwin"}, - {"k?freebsd.*", "freebsd"}, - {"netbsd.*", "netbsd"}, - {"openbsd.*", "openbsd"}, - } - match := func(list []REs, s string) string { - for _, t := range list { - if matched, _ := regexp.MatchString(t.re, s); matched { - return t.out - } - } - return "" - } - - s := strings.Split(triple, "-") - switch l := len(s); l { - default: - return "", "", errors.New("triple should be made up of 2, 3, or 4 parts.") - case 2, 3: // ARCHITECTURE-(VENDOR-)OPERATING_SYSTEM - goarch = s[0] - goos = s[l-1] - case 4: // ARCHITECTURE-VENDOR-OPERATING_SYSTEM-ENVIRONMENT - goarch = s[0] - goos = s[2] - } - goarch = match(goarchREs, goarch) - if goarch == "" { - return "", "", errors.New("unknown architecture in triple") - } - goos = match(goosREs, goos) - if goos == "" { - return "", "", errors.New("unknown OS in triple") - } - return goos, goarch, nil -} diff --git a/llgo/buildslave-config.yaml b/llgo/buildslave-config.yaml deleted file mode 100644 index 76e2403765da..000000000000 --- a/llgo/buildslave-config.yaml +++ /dev/null @@ -1,31 +0,0 @@ -# This file contains llgo's configuration for the buildbot-slave Juju charm. -# -# The slave is deployed with the following command in a Juju environment: -# juju deploy cs:~axwalk/buildbot-slave --config buildslave-config.yaml -# -# The charm generates a random password on first run, in the file -# /srv/buildbot/password. If the password is regenerated, it must -# be updated in the buildbot master. -# -buildbot-slave: - name: llgo-builder - master: lab.llvm.org:9990 - admin-info: Andrew Wilkins - apt-packages: subversion git cmake gcc g++ gccgo python-dev - pip-versions: sqlalchemy==0.7.9 buildbot==0.8.5 buildbot_slave==0.8.5 twisted==12.0.0 - post-install: | - #!/bin/bash - # - # Fetch, build and install Ninja. - rm -fr /tmp/ninja - cd /tmp && git clone git://github.com/martine/ninja.git - cd /tmp/ninja && ./configure.py --bootstrap - cp /tmp/ninja/ninja /usr/local/bin - # Fetch and unpack Go. - cd /tmp && wget https://storage.googleapis.com/golang/go1.4.2.linux-amd64.tar.gz - sha1sum < 0 { - consumedArgs := 1 - - switch { - case !strings.HasPrefix(args[0], "-"): - if strings.HasSuffix(args[0], ".go") { - goInputs = append(goInputs, args[0]) - } else { - hasOtherNonFlagInputs = true - otherInputs = append(otherInputs, args[0]) - } - - case strings.HasPrefix(args[0], "-Wl,"), strings.HasPrefix(args[0], "-l"), strings.HasPrefix(args[0], "--sysroot="): - // TODO(pcc): Handle these correctly. - otherInputs = append(otherInputs, args[0]) - - case args[0] == "-B": - if len(args) == 1 { - return opts, errors.New("missing argument after '-B'") - } - opts.bprefix = args[1] - consumedArgs = 2 - - case args[0] == "-D": - if len(args) == 1 { - return opts, errors.New("missing argument after '-D'") - } - otherInputs = append(otherInputs, args[0], args[1]) - consumedArgs = 2 - - case strings.HasPrefix(args[0], "-D"): - otherInputs = append(otherInputs, args[0]) - - case args[0] == "-I": - if len(args) == 1 { - return opts, errors.New("missing argument after '-I'") - } - opts.importPaths = append(opts.importPaths, args[1]) - consumedArgs = 2 - - case strings.HasPrefix(args[0], "-I"): - opts.importPaths = append(opts.importPaths, args[0][2:]) - - case args[0] == "-isystem": - if len(args) == 1 { - return opts, errors.New("missing argument after '-isystem'") - } - otherInputs = append(otherInputs, args[0], args[1]) - consumedArgs = 2 - - case args[0] == "-L": - if len(args) == 1 { - return opts, errors.New("missing argument after '-L'") - } - opts.libPaths = append(opts.libPaths, args[1]) - consumedArgs = 2 - - case strings.HasPrefix(args[0], "-L"): - opts.libPaths = append(opts.libPaths, args[0][2:]) - - case args[0] == "-O0": - opts.optLevel = 0 - - case args[0] == "-O1", args[0] == "-O": - opts.optLevel = 1 - - case args[0] == "-O2": - opts.optLevel = 2 - - case args[0] == "-Os": - opts.optLevel = 2 - opts.sizeLevel = 1 - - case args[0] == "-O3": - opts.optLevel = 3 - - case args[0] == "-S": - actionKind = actionAssemble - - case args[0] == "-c": - actionKind = actionCompile - - case strings.HasPrefix(args[0], "-fcompilerrt-prefix="): - opts.sanitizer.crtPrefix = args[0][20:] - - case strings.HasPrefix(args[0], "-fdebug-prefix-map="): - split := strings.SplitN(args[0][19:], "=", 2) - if len(split) < 2 { - return opts, fmt.Errorf("argument '%s' must be of form '-fdebug-prefix-map=SOURCE=REPLACEMENT'", args[0]) - } - opts.debugPrefixMaps = append(opts.debugPrefixMaps, debug.PrefixMap{split[0], split[1]}) - - case args[0] == "-fdump-ssa": - opts.dumpSSA = true - - case args[0] == "-fdump-trace": - opts.dumpTrace = true - - case strings.HasPrefix(args[0], "-fgccgo-path="): - opts.gccgoPath = args[0][13:] - - case strings.HasPrefix(args[0], "-fgo-pkgpath="): - opts.pkgpath = args[0][13:] - - case strings.HasPrefix(args[0], "-fgo-relative-import-path="): - // TODO(pcc): Handle this. - - case strings.HasPrefix(args[0], "-fstack-protector"): - // TODO(axw) set ssp function attributes. This can be useful - // even for Go, if it interfaces with code written in a non- - // memory safe language (e.g. via cgo). - - case strings.HasPrefix(args[0], "-W"): - // Go doesn't do warnings. Ignore. - - case args[0] == "-fload-plugin": - if len(args) == 1 { - return opts, errors.New("missing argument after '-fload-plugin'") - } - opts.plugins = append(opts.plugins, args[1]) - consumedArgs = 2 - - case args[0] == "-fno-toplevel-reorder": - // This is a GCC-specific code generation option. Ignore. - - case args[0] == "-emit-llvm": - opts.emitIR = true - - case args[0] == "-flto": - opts.lto = true - - case args[0] == "-fPIC": - opts.pic = true - - case strings.HasPrefix(args[0], "-fsanitize-blacklist="): - opts.sanitizer.blacklist = args[0][21:] - - // TODO(pcc): Enforce mutual exclusion between sanitizers. - - case args[0] == "-fsanitize=address": - opts.sanitizer.address = true - - case args[0] == "-fsanitize=thread": - opts.sanitizer.thread = true - - case args[0] == "-fsanitize=memory": - opts.sanitizer.memory = true - - case args[0] == "-fsanitize=dataflow": - opts.sanitizer.dataflow = true - - case args[0] == "-g": - opts.generateDebug = true - - case args[0] == "-mllvm": - if len(args) == 1 { - return opts, errors.New("missing argument after '-mllvm'") - } - opts.llvmArgs = append(opts.llvmArgs, args[1]) - consumedArgs = 2 - - case strings.HasPrefix(args[0], "-m"), args[0] == "-funsafe-math-optimizations", args[0] == "-ffp-contract=off": - // TODO(pcc): Handle code generation options. - - case args[0] == "-no-prefix": - noPrefix = true - - case args[0] == "-o": - if len(args) == 1 { - return opts, errors.New("missing argument after '-o'") - } - opts.output = args[1] - consumedArgs = 2 - - case args[0] == "-pie": - opts.pieLink = true - - case args[0] == "-dumpversion", - args[0] == "-print-libgcc-file-name", - args[0] == "-print-multi-os-directory", - args[0] == "--version": - actionKind = actionPrint - opts.output = args[0] - - case args[0] == "-static": - opts.staticLink = true - - case args[0] == "-static-libgcc": - opts.staticLibgcc = true - - case args[0] == "-static-libgo": - opts.staticLibgo = true - - default: - return opts, fmt.Errorf("unrecognized command line option '%s'", args[0]) - } - - args = args[consumedArgs:] - } - - if actionKind != actionPrint && len(goInputs) == 0 && !hasOtherNonFlagInputs { - return opts, errors.New("no input files") - } - - if !noPrefix { - opts.prefix, err = getInstPrefix() - if err != nil { - return opts, err - } - } - - if opts.sanitizer.crtPrefix == "" { - opts.sanitizer.crtPrefix = opts.prefix - } - - if opts.sanitizer.isPIEDefault() { - // This should really only be turning on -fPIE, but this isn't - // easy to do from Go, and -fPIC is a superset of it anyway. - opts.pic = true - opts.pieLink = true - } - - switch actionKind { - case actionLink: - if len(goInputs) != 0 { - opts.actions = []action{action{actionCompile, goInputs}} - } - opts.actions = append(opts.actions, action{actionLink, otherInputs}) - - case actionCompile, actionAssemble: - if len(goInputs) != 0 { - opts.actions = []action{action{actionKind, goInputs}} - } - - case actionPrint: - opts.actions = []action{action{actionKind, nil}} - } - - if opts.output == "" && len(opts.actions) != 0 { - switch actionKind { - case actionCompile, actionAssemble: - base := filepath.Base(goInputs[0]) - base = base[0 : len(base)-3] - if actionKind == actionCompile { - opts.output = base + ".o" - } else { - opts.output = base + ".s" - } - - case actionLink: - opts.output = "a.out" - } - } - - return opts, nil -} - -func runPasses(opts *driverOptions, tm llvm.TargetMachine, m llvm.Module) { - fpm := llvm.NewFunctionPassManagerForModule(m) - defer fpm.Dispose() - - mpm := llvm.NewPassManager() - defer mpm.Dispose() - - pmb := llvm.NewPassManagerBuilder() - defer pmb.Dispose() - - pmb.SetOptLevel(opts.optLevel) - pmb.SetSizeLevel(opts.sizeLevel) - - tm.AddAnalysisPasses(mpm) - tm.AddAnalysisPasses(fpm) - - mpm.AddVerifierPass() - fpm.AddVerifierPass() - - pmb.Populate(mpm) - pmb.PopulateFunc(fpm) - - if opts.optLevel == 0 { - // Remove references (via the descriptor) to dead functions, - // for compatibility with other compilers. - mpm.AddGlobalDCEPass() - } - - opts.sanitizer.addPasses(mpm, fpm) - - fpm.InitializeFunc() - for fn := m.FirstFunction(); !fn.IsNil(); fn = llvm.NextFunction(fn) { - fpm.RunFunc(fn) - } - fpm.FinalizeFunc() - - mpm.Run(m) -} - -func getMetadataSectionInlineAsm(name string) string { - // ELF: creates a non-allocated excluded section. - return ".section \"" + name + "\", \"e\"\n" -} - -func getDataInlineAsm(data []byte) string { - edata := make([]byte, 0, len(data)*4+10) - - edata = append(edata, ".ascii \""...) - for i := range data { - switch data[i] { - case '\000': - edata = append(edata, "\\000"...) - continue - case '\n': - edata = append(edata, "\\n"...) - continue - case '"', '\\': - edata = append(edata, '\\') - } - edata = append(edata, data[i]) - } - edata = append(edata, "\"\n"...) - return string(edata) -} - -// Get the lib path to the standard libraries for the given driver options. -// This is normally 'lib' but can vary for cross compilation, LTO, sanitizers -// etc. -func getLibDir(opts *driverOptions) string { - lib := "lib" + LibDirSuffix - switch { - case opts.lto: - return filepath.Join(lib, "llvm-lto.0") - case opts.sanitizer.address: - return filepath.Join(lib, "llvm-asan.0") - case opts.sanitizer.thread: - return filepath.Join(lib, "llvm-tsan.0") - case opts.sanitizer.memory: - return filepath.Join(lib, "llvm-msan.0") - case opts.sanitizer.dataflow: - return filepath.Join(lib, "llvm-dfsan.0") - default: - return lib - } -} - -func performAction(opts *driverOptions, kind actionKind, inputs []string, output string) error { - switch kind { - case actionPrint: - switch opts.output { - case "-dumpversion": - fmt.Println("llgo-" + llvmVersion()) - return nil - case "-print-libgcc-file-name": - cmd := exec.Command(opts.bprefix+"gcc", "-print-libgcc-file-name") - out, err := cmd.CombinedOutput() - os.Stdout.Write(out) - return err - case "-print-multi-os-directory": - fmt.Println(filepath.Join("..", getLibDir(opts))) - return nil - case "--version": - displayVersion() - return nil - default: - panic("unexpected print command") - } - - case actionCompile, actionAssemble: - compiler, err := initCompiler(opts) - if err != nil { - return err - } - - fset := token.NewFileSet() - files, err := driver.ParseFiles(fset, inputs) - if err != nil { - return err - } - - module, err := compiler.Compile(fset, files, opts.pkgpath) - if err != nil { - return err - } - - defer module.Dispose() - - target, err := llvm.GetTargetFromTriple(opts.triple) - if err != nil { - return err - } - - optLevel := [...]llvm.CodeGenOptLevel{ - llvm.CodeGenLevelNone, - llvm.CodeGenLevelLess, - llvm.CodeGenLevelDefault, - llvm.CodeGenLevelAggressive, - }[opts.optLevel] - - relocMode := llvm.RelocStatic - if opts.pic { - relocMode = llvm.RelocPIC - } - - tm := target.CreateTargetMachine(opts.triple, "", "", optLevel, - relocMode, llvm.CodeModelDefault) - defer tm.Dispose() - - runPasses(opts, tm, module.Module) - - var file *os.File - if output == "-" { - file = os.Stdout - } else { - file, err = os.Create(output) - if err != nil { - return err - } - defer file.Close() - } - - switch { - case !opts.lto && !opts.emitIR: - if module.ExportData != nil { - asm := getMetadataSectionInlineAsm(".go_export") - asm += getDataInlineAsm(module.ExportData) - module.Module.SetInlineAsm(asm) - } - - fileType := llvm.AssemblyFile - if kind == actionCompile { - fileType = llvm.ObjectFile - } - mb, err := tm.EmitToMemoryBuffer(module.Module, fileType) - if err != nil { - return err - } - defer mb.Dispose() - - bytes := mb.Bytes() - _, err = file.Write(bytes) - return err - - case opts.lto: - bcmb := llvm.WriteBitcodeToMemoryBuffer(module.Module) - defer bcmb.Dispose() - - // This is a bit of a hack. We just want an object file - // containing some metadata sections. This might be simpler - // if we had bindings for the MC library, but for now we create - // a fresh module containing only inline asm that creates the - // sections. - outmodule := llvm.NewModule("") - defer outmodule.Dispose() - asm := getMetadataSectionInlineAsm(".llvmbc") - asm += getDataInlineAsm(bcmb.Bytes()) - if module.ExportData != nil { - asm += getMetadataSectionInlineAsm(".go_export") - asm += getDataInlineAsm(module.ExportData) - } - outmodule.SetInlineAsm(asm) - - fileType := llvm.AssemblyFile - if kind == actionCompile { - fileType = llvm.ObjectFile - } - mb, err := tm.EmitToMemoryBuffer(outmodule, fileType) - if err != nil { - return err - } - defer mb.Dispose() - - bytes := mb.Bytes() - _, err = file.Write(bytes) - return err - - case kind == actionCompile: - err := llvm.WriteBitcodeToFile(module.Module, file) - return err - - case kind == actionAssemble: - _, err := file.WriteString(module.Module.String()) - return err - - default: - panic("unexpected action kind") - } - - case actionLink: - // TODO(pcc): Teach this to do LTO. - args := []string{"-o", output} - if opts.pic { - args = append(args, "-fPIC") - } - if opts.pieLink { - args = append(args, "-pie") - } - if opts.staticLink { - args = append(args, "-static") - } - if opts.staticLibgcc { - args = append(args, "-static-libgcc") - } - for _, p := range opts.libPaths { - args = append(args, "-L", p) - } - for _, p := range opts.importPaths { - args = append(args, "-I", p) - } - args = append(args, inputs...) - var linkerPath string - if opts.gccgoPath == "" { - // TODO(pcc): See if we can avoid calling gcc here. - // We currently rely on it to find crt*.o and compile - // any C source files passed as arguments. - linkerPath = opts.bprefix + "gcc" - - if opts.prefix != "" { - libdir := filepath.Join(opts.prefix, getLibDir(opts)) - args = append(args, "-L", libdir) - if !opts.staticLibgo { - args = append(args, "-Wl,-rpath,"+libdir) - } - } - - args = append(args, "-lgobegin-llgo") - if opts.staticLibgo { - args = append(args, "-Wl,-Bstatic", "-lgo-llgo", "-Wl,-Bdynamic", "-lpthread", "-lm") - } else { - args = append(args, "-lgo-llgo", "-lm") - } - } else { - linkerPath = opts.gccgoPath - if opts.staticLibgo { - args = append(args, "-static-libgo") - } - } - - args = opts.sanitizer.addLibs(opts.triple, args) - - cmd := exec.Command(linkerPath, args...) - out, err := cmd.CombinedOutput() - if err != nil { - os.Stderr.Write(out) - } - return err - - default: - panic("unexpected action kind") - } -} - -func performActions(opts *driverOptions) error { - var extraInput string - - for _, plugin := range opts.plugins { - err := llvm.LoadLibraryPermanently(plugin) - if err != nil { - return err - } - } - - llvm.ParseCommandLineOptions(append([]string{"llgo"}, opts.llvmArgs...), "llgo (LLVM option parsing)\n") - - for i, action := range opts.actions { - var output string - if i == len(opts.actions)-1 { - output = opts.output - } else { - tmpfile, err := ioutil.TempFile("", "llgo") - if err != nil { - return err - } - output = tmpfile.Name() + ".o" - tmpfile.Close() - err = os.Remove(tmpfile.Name()) - if err != nil { - return err - } - defer os.Remove(output) - } - - inputs := action.inputs - if extraInput != "" { - inputs = append([]string{extraInput}, inputs...) - } - - err := performAction(opts, action.kind, inputs, output) - if err != nil { - return err - } - - extraInput = output - } - - return nil -} - -func main() { - llvm.InitializeAllTargets() - llvm.InitializeAllTargetMCs() - llvm.InitializeAllTargetInfos() - llvm.InitializeAllAsmParsers() - llvm.InitializeAllAsmPrinters() - - opts, err := parseArguments(os.Args[1:]) - if err != nil { - report(err) - os.Exit(1) - } - - err = performActions(&opts) - if err != nil { - report(err) - os.Exit(1) - } -} diff --git a/llgo/cmd/go/zdefaultcc.go.in b/llgo/cmd/go/zdefaultcc.go.in deleted file mode 100644 index 2ca6c9468e1a..000000000000 --- a/llgo/cmd/go/zdefaultcc.go.in +++ /dev/null @@ -1,55 +0,0 @@ -//===- zdefaultcc.go - default compiler locations -------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file provides default locations for cc, cxx and llgo. -// -//===----------------------------------------------------------------------===// - -package main - -import ( - "path/filepath" - "os" - "os/exec" -) - -var defaultGCCGO, defaultCC, defaultCXX string - -func getInstPrefix() (string, error) { - path, err := exec.LookPath(os.Args[0]) - if err != nil { - return "", err - } - - path, err = filepath.EvalSymlinks(path) - if err != nil { - return "", err - } - - prefix := filepath.Join(path, "..", "..") - return prefix, nil -} - -func init() { - prefix, err := getInstPrefix() - if err != nil { - panic(err.Error()) - } - - defaultCC = filepath.Join(prefix, "bin", "clang") - defaultCXX = filepath.Join(prefix, "bin", "clang++") - defaultGCCGO = filepath.Join(prefix, "bin", "llgo") - toolDir = filepath.Join(prefix, "lib", "go", "llgo-@LLGO_VERSION@") - - gccgoName = os.Getenv("GCCGO") - if gccgoName == "" { - gccgoName = defaultGCCGO - } - gccgoBin, _ = exec.LookPath(gccgoName) -} diff --git a/llgo/cmd/llgoi/llgoi.go b/llgo/cmd/llgoi/llgoi.go deleted file mode 100644 index 4aa774d63637..000000000000 --- a/llgo/cmd/llgoi/llgoi.go +++ /dev/null @@ -1,597 +0,0 @@ -//===- llgoi.go - llgo-based Go REPL --------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This is llgoi, a Go REPL based on llgo and the LLVM JIT. -// -//===----------------------------------------------------------------------===// - -package main - -import ( - "bytes" - "errors" - "fmt" - "go/ast" - "go/build" - "go/parser" - "go/scanner" - "go/token" - "io" - "os" - "os/exec" - "path/filepath" - "runtime/debug" - "strconv" - "strings" - "unsafe" - - "llvm.org/llgo/driver" - "llvm.org/llgo/irgen" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llgo/third_party/liner" - "llvm.org/llvm/bindings/go/llvm" -) - -// /* Force exporting __morestack if it's available, so that it is -// available to the engine when linking with libLLVM.so. */ -// -// void *__morestack __attribute__((weak)); -import "C" - -func getInstPrefix() (string, error) { - path, err := exec.LookPath(os.Args[0]) - if err != nil { - return "", err - } - - path, err = filepath.EvalSymlinks(path) - if err != nil { - return "", err - } - - prefix := filepath.Join(path, "..", "..") - return prefix, nil -} - -func llvmVersion() string { - return strings.Replace(llvm.Version, "svn", "", 1) -} - -type line struct { - line string - isStmt bool - declName string - assigns []string - - parens, bracks, braces int -} - -type interp struct { - engine llvm.ExecutionEngine - - liner *liner.State - pendingLine line - - copts irgen.CompilerOptions - - imports []*types.Package - scope map[string]types.Object - - modules map[string]llvm.Module - pkgmap map[string]*types.Package - pkgnum int -} - -func (in *interp) makeCompilerOptions() error { - prefix, err := getInstPrefix() - if err != nil { - return err - } - - importPaths := []string{filepath.Join(prefix, "lib", "go", "llgo-"+llvmVersion())} - in.copts = irgen.CompilerOptions{ - TargetTriple: llvm.DefaultTargetTriple(), - ImportPaths: importPaths, - GenerateDebug: true, - Packages: in.pkgmap, - } - err = in.copts.MakeImporter() - if err != nil { - return err - } - - origImporter := in.copts.Importer - in.copts.Importer = func(pkgmap map[string]*types.Package, pkgpath string) (*types.Package, error) { - if pkg, ok := pkgmap[pkgpath]; ok && pkg.Complete() { - return pkg, nil - } - return origImporter(pkgmap, pkgpath) - } - return nil -} - -func (in *interp) init() error { - in.liner = liner.NewLiner() - in.scope = make(map[string]types.Object) - in.pkgmap = make(map[string]*types.Package) - in.modules = make(map[string]llvm.Module) - - err := in.makeCompilerOptions() - if err != nil { - return err - } - - return nil -} - -func (in *interp) dispose() { - in.liner.Close() - in.engine.Dispose() -} - -func (in *interp) loadSourcePackageFromCode(pkgcode, pkgpath string, copts irgen.CompilerOptions) (*types.Package, error) { - fset := token.NewFileSet() - file, err := parser.ParseFile(fset, "", pkgcode, parser.DeclarationErrors|parser.ParseComments) - if err != nil { - return nil, err - } - files := []*ast.File{file} - return in.loadSourcePackage(fset, files, pkgpath, copts) -} - -func (in *interp) loadSourcePackage(fset *token.FileSet, files []*ast.File, pkgpath string, copts irgen.CompilerOptions) (_ *types.Package, resultErr error) { - compiler, err := irgen.NewCompiler(copts) - if err != nil { - return nil, err - } - - module, err := compiler.Compile(fset, files, pkgpath) - if err != nil { - return nil, err - } - in.modules[pkgpath] = module.Module - - if in.engine.C != nil { - in.engine.AddModule(module.Module) - } else { - options := llvm.NewMCJITCompilerOptions() - in.engine, err = llvm.NewMCJITCompiler(module.Module, options) - if err != nil { - return nil, err - } - } - - var importFunc func() - importAddress := in.getPackageSymbol(pkgpath, ".import$descriptor") - *(*unsafe.Pointer)(unsafe.Pointer(&importFunc)) = importAddress - - defer func() { - p := recover() - if p != nil { - resultErr = fmt.Errorf("panic: %v\n%v", p, string(debug.Stack())) - } - }() - importFunc() - in.pkgmap[pkgpath] = module.Package - - return module.Package, nil -} - -func (in *interp) getPackageSymbol(pkgpath, name string) unsafe.Pointer { - symbolName := irgen.ManglePackagePath(pkgpath) + "." + name - global := in.modules[pkgpath].NamedGlobal(symbolName) - if global.IsNil() { - return nil - } - return in.engine.PointerToGlobal(global) -} - -func (in *interp) augmentPackageScope(pkg *types.Package) { - for _, obj := range in.scope { - pkg.Scope().Insert(obj) - } -} - -func (l *line) append(str string, assigns []string) { - var s scanner.Scanner - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(str)) - s.Init(file, []byte(str), nil, 0) - - _, tok, _ := s.Scan() - if l.line == "" { - switch tok { - case token.FOR, token.GO, token.IF, token.LBRACE, token.SELECT, token.SWITCH: - l.isStmt = true - case token.CONST, token.FUNC, token.TYPE, token.VAR: - var lit string - _, tok, lit = s.Scan() - if tok == token.IDENT { - l.declName = lit - } - } - } - - for tok != token.EOF { - switch tok { - case token.LPAREN: - l.parens++ - case token.RPAREN: - l.parens-- - case token.LBRACE: - l.braces++ - case token.RBRACE: - l.braces-- - case token.LBRACK: - l.bracks++ - case token.RBRACK: - l.bracks-- - case token.DEC, token.INC, - token.ASSIGN, token.ADD_ASSIGN, token.SUB_ASSIGN, - token.MUL_ASSIGN, token.QUO_ASSIGN, token.REM_ASSIGN, - token.AND_ASSIGN, token.OR_ASSIGN, token.XOR_ASSIGN, - token.SHL_ASSIGN, token.SHR_ASSIGN, token.AND_NOT_ASSIGN: - if l.parens == 0 && l.bracks == 0 && l.braces == 0 { - l.isStmt = true - } - } - _, tok, _ = s.Scan() - } - - if l.line == "" { - l.assigns = assigns - } - l.line += str -} - -func (l *line) ready() bool { - return l.parens <= 0 && l.bracks <= 0 && l.braces <= 0 -} - -func (in *interp) readExprLine(str string, assigns []string) ([]interface{}, error) { - in.pendingLine.append(str, assigns) - if !in.pendingLine.ready() { - return nil, nil - } - results, err := in.interpretLine(in.pendingLine) - in.pendingLine = line{} - return results, err -} - -func (in *interp) interpretLine(l line) ([]interface{}, error) { - pkgname := fmt.Sprintf("input%05d", in.pkgnum) - in.pkgnum++ - - pkg := types.NewPackage(pkgname, pkgname) - scope := pkg.Scope() - - for _, imppkg := range in.imports { - obj := types.NewPkgName(token.NoPos, pkg, imppkg.Name(), imppkg) - scope.Insert(obj) - } - - in.augmentPackageScope(pkg) - - var tv types.TypeAndValue - if l.declName == "" && !l.isStmt { - var err error - tv, err = types.Eval(l.line, pkg, scope) - if err != nil { - return nil, err - } - } - - var code bytes.Buffer - fmt.Fprintf(&code, "package %s\n", pkgname) - - for _, pkg := range in.imports { - fmt.Fprintf(&code, "import %q\n", pkg.Path()) - } - - if l.declName != "" { - code.WriteString(l.line) - } else if !l.isStmt && tv.IsValue() { - var typs []types.Type - if tuple, ok := tv.Type.(*types.Tuple); ok { - typs = make([]types.Type, tuple.Len()) - for i := range typs { - typs[i] = tuple.At(i).Type() - } - } else { - typs = []types.Type{tv.Type} - } - if len(l.assigns) == 2 && tv.HasOk() { - typs = append(typs, types.Typ[types.Bool]) - } - if len(l.assigns) != 0 && len(l.assigns) != len(typs) { - return nil, errors.New("return value mismatch") - } - - code.WriteString("var ") - for i := range typs { - if i != 0 { - code.WriteString(", ") - } - if len(l.assigns) != 0 && l.assigns[i] != "" { - if _, ok := in.scope[l.assigns[i]]; ok { - fmt.Fprintf(&code, "__llgoiV%d", i) - } else { - code.WriteString(l.assigns[i]) - } - } else { - fmt.Fprintf(&code, "__llgoiV%d", i) - } - } - fmt.Fprintf(&code, " = %s\n", l.line) - - code.WriteString("func init() {\n") - varnames := make([]string, len(typs)) - for i := range typs { - var varname string - if len(l.assigns) != 0 && l.assigns[i] != "" { - if _, ok := in.scope[l.assigns[i]]; ok { - fmt.Fprintf(&code, "\t%s = __llgoiV%d\n", l.assigns[i], i) - } - varname = l.assigns[i] - } else { - varname = fmt.Sprintf("__llgoiV%d", i) - } - varnames[i] = varname - } - code.WriteString("}\n\n") - - code.WriteString("func __llgoiResults() []interface{} {\n") - code.WriteString("\treturn []interface{}{\n") - for _, varname := range varnames { - fmt.Fprintf(&code, "\t\t%s,\n", varname) - } - code.WriteString("\t}\n") - code.WriteString("}\n") - } else { - if len(l.assigns) != 0 { - return nil, errors.New("return value mismatch") - } - - fmt.Fprintf(&code, "func init() {\n\t%s}", l.line) - } - - copts := in.copts - copts.PackageCreated = in.augmentPackageScope - copts.DisableUnusedImportCheck = true - pkg, err := in.loadSourcePackageFromCode(code.String(), pkgname, copts) - if err != nil { - return nil, err - } - in.imports = append(in.imports, pkg) - - var results []interface{} - llgoiResultsAddress := in.getPackageSymbol(pkgname, "__llgoiResults$descriptor") - if llgoiResultsAddress != nil { - var resultsFunc func() []interface{} - *(*unsafe.Pointer)(unsafe.Pointer(&resultsFunc)) = llgoiResultsAddress - results = resultsFunc() - } - - for _, assign := range l.assigns { - if assign != "" { - if _, ok := in.scope[assign]; !ok { - in.scope[assign] = pkg.Scope().Lookup(assign) - } - } - } - - if l.declName != "" { - in.scope[l.declName] = pkg.Scope().Lookup(l.declName) - } - - return results, nil -} - -func (in *interp) maybeReadAssignment(line string, s *scanner.Scanner, initial string, base int) (bool, error) { - if initial == "_" { - initial = "" - } - assigns := []string{initial} - - pos, tok, lit := s.Scan() - for tok == token.COMMA { - pos, tok, lit = s.Scan() - if tok != token.IDENT { - return false, nil - } - - if lit == "_" { - lit = "" - } - assigns = append(assigns, lit) - - pos, tok, lit = s.Scan() - } - - if tok != token.DEFINE { - return false, nil - } - - // It's an assignment statement, there are no results. - _, err := in.readExprLine(line[int(pos)-base+2:], assigns) - return true, err -} - -func (in *interp) loadPackage(pkgpath string) (*types.Package, error) { - pkg, err := in.copts.Importer(in.pkgmap, pkgpath) - if err == nil { - return pkg, nil - } - - buildpkg, err := build.Import(pkgpath, ".", 0) - if err != nil { - return nil, err - } - if len(buildpkg.CgoFiles) != 0 { - return nil, fmt.Errorf("%s: cannot load cgo package", pkgpath) - } - - for _, imp := range buildpkg.Imports { - _, err := in.loadPackage(imp) - if err != nil { - return nil, err - } - } - - inputs := make([]string, len(buildpkg.GoFiles)) - for i, file := range buildpkg.GoFiles { - inputs[i] = filepath.Join(buildpkg.Dir, file) - } - - fset := token.NewFileSet() - files, err := driver.ParseFiles(fset, inputs) - if err != nil { - return nil, err - } - - return in.loadSourcePackage(fset, files, pkgpath, in.copts) -} - -// readLine accumulates lines of input, including trailing newlines, -// executing statements as they are completed. -func (in *interp) readLine(line string) ([]interface{}, error) { - if !in.pendingLine.ready() { - return in.readExprLine(line, nil) - } - - var s scanner.Scanner - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(line)) - s.Init(file, []byte(line), nil, 0) - - _, tok, lit := s.Scan() - switch tok { - case token.EOF: - return nil, nil - - case token.IMPORT: - _, tok, lit = s.Scan() - if tok != token.STRING { - return nil, errors.New("expected string literal") - } - pkgpath, err := strconv.Unquote(lit) - if err != nil { - return nil, err - } - pkg, err := in.loadPackage(pkgpath) - if err != nil { - return nil, err - } - in.imports = append(in.imports, pkg) - return nil, nil - - case token.IDENT: - ok, err := in.maybeReadAssignment(line, &s, lit, file.Base()) - if err != nil { - return nil, err - } - if ok { - return nil, nil - } - fallthrough - - default: - return in.readExprLine(line, nil) - } -} - -// printResult prints a value that was the result of an expression evaluated -// by the interpreter. -func printResult(w io.Writer, v interface{}) { - // TODO the result should be formatted in Go syntax, without - // package qualifiers for types defined within the interpreter. - fmt.Fprintf(w, "%+v", v) -} - -// formatHistory reformats the provided Go source by collapsing all lines -// and adding semicolons where required, suitable for adding to line history. -func formatHistory(input []byte) string { - var buf bytes.Buffer - var s scanner.Scanner - fset := token.NewFileSet() - file := fset.AddFile("", fset.Base(), len(input)) - s.Init(file, input, nil, 0) - pos, tok, lit := s.Scan() - for tok != token.EOF { - if int(pos)-1 > buf.Len() { - n := int(pos) - 1 - buf.Len() - buf.WriteString(strings.Repeat(" ", n)) - } - var semicolon bool - if tok == token.SEMICOLON { - semicolon = true - } else if lit != "" { - buf.WriteString(lit) - } else { - buf.WriteString(tok.String()) - } - pos, tok, lit = s.Scan() - if semicolon { - switch tok { - case token.RBRACE, token.RPAREN, token.EOF: - default: - buf.WriteRune(';') - } - } - } - return buf.String() -} - -func main() { - llvm.LinkInMCJIT() - llvm.InitializeNativeTarget() - llvm.InitializeNativeAsmPrinter() - - var in interp - err := in.init() - if err != nil { - panic(err) - } - defer in.dispose() - - var buf bytes.Buffer - for { - if in.pendingLine.ready() && buf.Len() > 0 { - history := formatHistory(buf.Bytes()) - in.liner.AppendHistory(history) - buf.Reset() - } - prompt := "(llgo) " - if !in.pendingLine.ready() { - prompt = strings.Repeat(" ", len(prompt)) - } - line, err := in.liner.Prompt(prompt) - if err == io.EOF { - break - } else if err != nil { - panic(err) - } - if line == "" { - continue - } - buf.WriteString(line + "\n") - results, err := in.readLine(line + "\n") - if err != nil { - fmt.Println(err) - } - for _, result := range results { - printResult(os.Stdout, result) - fmt.Println() - } - } - - if liner.TerminalSupported() { - fmt.Println() - } -} diff --git a/llgo/debug/debug.go b/llgo/debug/debug.go deleted file mode 100644 index cf5f40be7f0a..000000000000 --- a/llgo/debug/debug.go +++ /dev/null @@ -1,437 +0,0 @@ -//===- debug.go - debug info builder --------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This package builds LLVM debug info from go/* data structures. -// -//===----------------------------------------------------------------------===// - -package debug - -import ( - "debug/dwarf" - "fmt" - "go/token" - "os" - "strings" - - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llgo/third_party/gotools/go/types/typeutil" - - "llvm.org/llvm/bindings/go/llvm" -) - -const ( - // non-standard debug metadata tags - tagAutoVariable dwarf.Tag = 0x100 - tagArgVariable dwarf.Tag = 0x101 -) - -type PrefixMap struct { - Source, Replacement string -} - -// DIBuilder builds debug metadata for Go programs. -type DIBuilder struct { - // builder is the current builder; there is one per CU. - builder *llvm.DIBuilder - module llvm.Module - files map[*token.File]llvm.Metadata - cu, fn, lb llvm.Metadata - fnFile string - sizes types.Sizes - fset *token.FileSet - prefixMaps []PrefixMap - types typeutil.Map - voidType llvm.Metadata -} - -// NewDIBuilder creates a new debug information builder. -func NewDIBuilder(sizes types.Sizes, module llvm.Module, fset *token.FileSet, prefixMaps []PrefixMap) *DIBuilder { - var d DIBuilder - d.module = module - d.files = make(map[*token.File]llvm.Metadata) - d.sizes = sizes - d.fset = fset - d.prefixMaps = prefixMaps - d.builder = llvm.NewDIBuilder(d.module) - d.cu = d.createCompileUnit() - return &d -} - -// Destroy destroys the DIBuilder. -func (d *DIBuilder) Destroy() { - d.builder.Destroy() -} - -func (d *DIBuilder) scope() llvm.Metadata { - if d.lb.C != nil { - return d.lb - } - if d.fn.C != nil { - return d.fn - } - return d.cu -} - -func (d *DIBuilder) remapFilePath(path string) string { - for _, pm := range d.prefixMaps { - if strings.HasPrefix(path, pm.Source) { - return pm.Replacement + path[len(pm.Source):] - } - } - return path -} - -func (d *DIBuilder) getFile(file *token.File) llvm.Metadata { - if diFile := d.files[file]; diFile.C != nil { - return diFile - } - diFile := d.builder.CreateFile(d.remapFilePath(file.Name()), "") - d.files[file] = diFile - return diFile -} - -// createCompileUnit creates and returns debug metadata for the compile -// unit as a whole, using the first file in the file set as a representative -// (the choice of file is arbitrary). -func (d *DIBuilder) createCompileUnit() llvm.Metadata { - var file *token.File - d.fset.Iterate(func(f *token.File) bool { - file = f - return false - }) - dir, err := os.Getwd() - if err != nil { - panic("could not get current directory: " + err.Error()) - } - return d.builder.CreateCompileUnit(llvm.DICompileUnit{ - Language: llvm.DW_LANG_Go, - File: d.remapFilePath(file.Name()), - Dir: dir, - Producer: "llgo", - }) -} - -// PushFunction creates debug metadata for the specified function, -// and pushes it onto the scope stack. -func (d *DIBuilder) PushFunction(fnptr llvm.Value, sig *types.Signature, pos token.Pos) { - var diFile llvm.Metadata - var line int - if file := d.fset.File(pos); file != nil { - d.fnFile = file.Name() - diFile = d.getFile(file) - line = file.Line(pos) - } - d.fn = d.builder.CreateFunction(d.scope(), llvm.DIFunction{ - Name: fnptr.Name(), // TODO(axw) unmangled name? - LinkageName: fnptr.Name(), - File: diFile, - Line: line, - Type: d.DIType(sig), - IsDefinition: true, - }) - fnptr.SetSubprogram(d.fn) -} - -// PopFunction pops the previously pushed function off the scope stack. -func (d *DIBuilder) PopFunction() { - d.lb = llvm.Metadata{} - d.fn = llvm.Metadata{} - d.fnFile = "" -} - -// Value creates an llvm.dbg.value call for the specified register value. -func (d *DIBuilder) Value(b llvm.Builder, v ssa.Value, llv llvm.Value, paramIndex int) { - // TODO(axw) -} - -// SetLocation sets the current debug location. -func (d *DIBuilder) SetLocation(b llvm.Builder, pos token.Pos) { - if !pos.IsValid() { - return - } - position := d.fset.Position(pos) - d.lb = llvm.Metadata{} - if position.Filename != d.fnFile && position.Filename != "" { - // This can happen rarely, e.g. in init functions. - diFile := d.builder.CreateFile(d.remapFilePath(position.Filename), "") - d.lb = d.builder.CreateLexicalBlockFile(d.scope(), diFile, 0) - } - b.SetCurrentDebugLocation(uint(position.Line), uint(position.Column), d.scope(), llvm.Metadata{}) -} - -// Finalize must be called after all compilation units are translated, -// generating the final debug metadata for the module. -func (d *DIBuilder) Finalize() { - d.module.AddNamedMetadataOperand( - "llvm.module.flags", - llvm.GlobalContext().MDNode([]llvm.Metadata{ - llvm.ConstInt(llvm.Int32Type(), 2, false).ConstantAsMetadata(), // Warn on mismatch - llvm.GlobalContext().MDString("Dwarf Version"), - llvm.ConstInt(llvm.Int32Type(), 4, false).ConstantAsMetadata(), - }), - ) - d.module.AddNamedMetadataOperand( - "llvm.module.flags", - llvm.GlobalContext().MDNode([]llvm.Metadata{ - llvm.ConstInt(llvm.Int32Type(), 1, false).ConstantAsMetadata(), // Error on mismatch - llvm.GlobalContext().MDString("Debug Info Version"), - llvm.ConstInt(llvm.Int32Type(), 3, false).ConstantAsMetadata(), - }), - ) - d.builder.Finalize() -} - -// DIType maps a Go type to DIType debug metadata value. -func (d *DIBuilder) DIType(t types.Type) llvm.Metadata { - return d.typeDebugDescriptor(t, types.TypeString(nil, t)) -} - -func (d *DIBuilder) typeDebugDescriptor(t types.Type, name string) llvm.Metadata { - // Signature needs to be handled specially, to preprocess - // methods, moving the receiver to the parameter list. - if t, ok := t.(*types.Signature); ok { - return d.descriptorSignature(t, name) - } - if t == nil { - if d.voidType.C == nil { - d.voidType = d.builder.CreateBasicType(llvm.DIBasicType{Name: "void"}) - } - return d.voidType - } - if dt, ok := d.types.At(t).(llvm.Metadata); ok { - return dt - } - dt := d.descriptor(t, name) - d.types.Set(t, dt) - return dt -} - -func (d *DIBuilder) descriptor(t types.Type, name string) llvm.Metadata { - switch t := t.(type) { - case *types.Basic: - return d.descriptorBasic(t, name) - case *types.Pointer: - return d.descriptorPointer(t) - case *types.Struct: - return d.descriptorStruct(t, name) - case *types.Named: - return d.descriptorNamed(t) - case *types.Array: - return d.descriptorArray(t, name) - case *types.Slice: - return d.descriptorSlice(t, name) - case *types.Map: - return d.descriptorMap(t, name) - case *types.Chan: - return d.descriptorChan(t, name) - case *types.Interface: - return d.descriptorInterface(t, name) - default: - panic(fmt.Sprintf("unhandled type: %T", t)) - } -} - -func (d *DIBuilder) descriptorBasic(t *types.Basic, name string) llvm.Metadata { - switch t.Kind() { - case types.String: - return d.typeDebugDescriptor(types.NewStruct([]*types.Var{ - types.NewVar(0, nil, "ptr", types.NewPointer(types.Typ[types.Uint8])), - types.NewVar(0, nil, "len", types.Typ[types.Int]), - }, nil), name) - case types.UnsafePointer: - return d.builder.CreateBasicType(llvm.DIBasicType{ - Name: name, - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - Encoding: llvm.DW_ATE_unsigned, - }) - default: - bt := llvm.DIBasicType{ - Name: t.String(), - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - } - switch bi := t.Info(); { - case bi&types.IsBoolean != 0: - bt.Encoding = llvm.DW_ATE_boolean - case bi&types.IsUnsigned != 0: - bt.Encoding = llvm.DW_ATE_unsigned - case bi&types.IsInteger != 0: - bt.Encoding = llvm.DW_ATE_signed - case bi&types.IsFloat != 0: - bt.Encoding = llvm.DW_ATE_float - case bi&types.IsComplex != 0: - bt.Encoding = llvm.DW_ATE_imaginary_float - case bi&types.IsUnsigned != 0: - bt.Encoding = llvm.DW_ATE_unsigned - default: - panic(fmt.Sprintf("unhandled: %#v", t)) - } - return d.builder.CreateBasicType(bt) - } -} - -func (d *DIBuilder) descriptorPointer(t *types.Pointer) llvm.Metadata { - return d.builder.CreatePointerType(llvm.DIPointerType{ - Pointee: d.DIType(t.Elem()), - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - }) -} - -func (d *DIBuilder) descriptorStruct(t *types.Struct, name string) llvm.Metadata { - fields := make([]*types.Var, t.NumFields()) - for i := range fields { - fields[i] = t.Field(i) - } - offsets := d.sizes.Offsetsof(fields) - members := make([]llvm.Metadata, len(fields)) - for i, f := range fields { - // TODO(axw) file/line where member is defined. - t := f.Type() - members[i] = d.builder.CreateMemberType(d.cu, llvm.DIMemberType{ - Name: f.Name(), - Type: d.DIType(t), - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - OffsetInBits: uint64(offsets[i] * 8), - }) - } - // TODO(axw) file/line where struct is defined. - return d.builder.CreateStructType(d.cu, llvm.DIStructType{ - Name: name, - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - Elements: members, - }) -} - -func (d *DIBuilder) descriptorNamed(t *types.Named) llvm.Metadata { - var diFile llvm.Metadata - var line int - if file := d.fset.File(t.Obj().Pos()); file != nil { - line = file.Line(t.Obj().Pos()) - diFile = d.getFile(file) - } - - // Create a placeholder for the named type, to terminate cycles. - name := t.Obj().Name() - placeholder := d.builder.CreateReplaceableCompositeType(d.scope(), llvm.DIReplaceableCompositeType{ - Tag: dwarf.TagStructType, - Name: name, - File: diFile, - Line: line, - }) - d.types.Set(t, placeholder) - - typedef := d.builder.CreateTypedef(llvm.DITypedef{ - Type: d.DIType(t.Underlying()), - Name: name, - File: diFile, - Line: line, - }) - placeholder.ReplaceAllUsesWith(typedef) - return typedef -} - -func (d *DIBuilder) descriptorArray(t *types.Array, name string) llvm.Metadata { - return d.builder.CreateArrayType(llvm.DIArrayType{ - SizeInBits: uint64(d.sizes.Sizeof(t) * 8), - AlignInBits: uint64(d.sizes.Alignof(t) * 8), - ElementType: d.DIType(t.Elem()), - Subscripts: []llvm.DISubrange{{Count: t.Len()}}, - }) -} - -func (d *DIBuilder) descriptorSlice(t *types.Slice, name string) llvm.Metadata { - sliceStruct := types.NewStruct([]*types.Var{ - types.NewVar(0, nil, "ptr", types.NewPointer(t.Elem())), - types.NewVar(0, nil, "len", types.Typ[types.Int]), - types.NewVar(0, nil, "cap", types.Typ[types.Int]), - }, nil) - return d.typeDebugDescriptor(sliceStruct, name) -} - -func (d *DIBuilder) descriptorMap(t *types.Map, name string) llvm.Metadata { - // FIXME: This should be DW_TAG_pointer_type to __go_map. - return d.descriptorBasic(types.Typ[types.Uintptr], name) -} - -func (d *DIBuilder) descriptorChan(t *types.Chan, name string) llvm.Metadata { - // FIXME: This should be DW_TAG_pointer_type to __go_channel. - return d.descriptorBasic(types.Typ[types.Uintptr], name) -} - -func (d *DIBuilder) descriptorInterface(t *types.Interface, name string) llvm.Metadata { - ifaceStruct := types.NewStruct([]*types.Var{ - types.NewVar(0, nil, "type", types.NewPointer(types.Typ[types.Uint8])), - types.NewVar(0, nil, "data", types.NewPointer(types.Typ[types.Uint8])), - }, nil) - return d.typeDebugDescriptor(ifaceStruct, name) -} - -func (d *DIBuilder) descriptorSignature(t *types.Signature, name string) llvm.Metadata { - // If there's a receiver change the receiver to an - // additional (first) parameter, and take the value of - // the resulting signature instead. - if recv := t.Recv(); recv != nil { - params := t.Params() - paramvars := make([]*types.Var, int(params.Len()+1)) - paramvars[0] = recv - for i := 0; i < int(params.Len()); i++ { - paramvars[i+1] = params.At(i) - } - params = types.NewTuple(paramvars...) - t := types.NewSignature(nil, nil, params, t.Results(), t.Variadic()) - return d.typeDebugDescriptor(t, name) - } - if dt, ok := d.types.At(t).(llvm.Metadata); ok { - return dt - } - - var returnType llvm.Metadata - results := t.Results() - switch n := results.Len(); n { - case 0: - returnType = d.DIType(nil) // void - case 1: - returnType = d.DIType(results.At(0).Type()) - default: - fields := make([]*types.Var, results.Len()) - for i := range fields { - f := results.At(i) - // Structs may not have multiple fields - // with the same name, excepting "_". - if f.Name() == "" { - f = types.NewVar(f.Pos(), f.Pkg(), "_", f.Type()) - } - fields[i] = f - } - returnType = d.typeDebugDescriptor(types.NewStruct(fields, nil), "") - } - - var paramTypes []llvm.Metadata - params := t.Params() - if params != nil && params.Len() > 0 { - paramTypes = make([]llvm.Metadata, params.Len()+1) - paramTypes[0] = returnType - for i := range paramTypes[1:] { - paramTypes[i+1] = d.DIType(params.At(i).Type()) - } - } else { - paramTypes = []llvm.Metadata{returnType} - } - - // TODO(axw) get position of type definition for File field - return d.builder.CreateSubroutineType(llvm.DISubroutineType{ - Parameters: paramTypes, - }) -} diff --git a/llgo/docs/Makefile.sphinx b/llgo/docs/Makefile.sphinx deleted file mode 100644 index b3083d5f90ad..000000000000 --- a/llgo/docs/Makefile.sphinx +++ /dev/null @@ -1,177 +0,0 @@ -# Makefile for Sphinx documentation -# - -# You can set these variables from the command line. -SPHINXOPTS = -SPHINXBUILD = sphinx-build -PAPER = -BUILDDIR = _build - -# User-friendly check for sphinx-build -ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) -$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) -endif - -# Internal variables. -PAPEROPT_a4 = -D latex_paper_size=a4 -PAPEROPT_letter = -D latex_paper_size=letter -ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . -# the i18n builder cannot share the environment and doctrees with the others -I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . - -.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext - -help: - @echo "Please use \`make ' where is one of" - @echo " html to make standalone HTML files" - @echo " dirhtml to make HTML files named index.html in directories" - @echo " singlehtml to make a single large HTML file" - @echo " pickle to make pickle files" - @echo " json to make JSON files" - @echo " htmlhelp to make HTML files and a HTML help project" - @echo " qthelp to make HTML files and a qthelp project" - @echo " devhelp to make HTML files and a Devhelp project" - @echo " epub to make an epub" - @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" - @echo " latexpdf to make LaTeX files and run them through pdflatex" - @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" - @echo " text to make text files" - @echo " man to make manual pages" - @echo " texinfo to make Texinfo files" - @echo " info to make Texinfo files and run them through makeinfo" - @echo " gettext to make PO message catalogs" - @echo " changes to make an overview of all changed/added/deprecated items" - @echo " xml to make Docutils-native XML files" - @echo " pseudoxml to make pseudoxml-XML files for display purposes" - @echo " linkcheck to check all external links for integrity" - @echo " doctest to run all doctests embedded in the documentation (if enabled)" - -clean: - rm -rf $(BUILDDIR)/* - -html: - $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." - -dirhtml: - $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml - @echo - @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." - -singlehtml: - $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml - @echo - @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." - -pickle: - $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle - @echo - @echo "Build finished; now you can process the pickle files." - -json: - $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json - @echo - @echo "Build finished; now you can process the JSON files." - -htmlhelp: - $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp - @echo - @echo "Build finished; now you can run HTML Help Workshop with the" \ - ".hhp project file in $(BUILDDIR)/htmlhelp." - -qthelp: - $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp - @echo - @echo "Build finished; now you can run "qcollectiongenerator" with the" \ - ".qhcp project file in $(BUILDDIR)/qthelp, like this:" - @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/llgo.qhcp" - @echo "To view the help file:" - @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/llgo.qhc" - -devhelp: - $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp - @echo - @echo "Build finished." - @echo "To view the help file:" - @echo "# mkdir -p $$HOME/.local/share/devhelp/llgo" - @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/llgo" - @echo "# devhelp" - -epub: - $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub - @echo - @echo "Build finished. The epub file is in $(BUILDDIR)/epub." - -latex: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo - @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." - @echo "Run \`make' in that directory to run these through (pdf)latex" \ - "(use \`make latexpdf' here to do that automatically)." - -latexpdf: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through pdflatex..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -latexpdfja: - $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex - @echo "Running LaTeX files through platex and dvipdfmx..." - $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja - @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." - -text: - $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text - @echo - @echo "Build finished. The text files are in $(BUILDDIR)/text." - -man: - $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man - @echo - @echo "Build finished. The manual pages are in $(BUILDDIR)/man." - -texinfo: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo - @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." - @echo "Run \`make' in that directory to run these through makeinfo" \ - "(use \`make info' here to do that automatically)." - -info: - $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo - @echo "Running Texinfo files through makeinfo..." - make -C $(BUILDDIR)/texinfo info - @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." - -gettext: - $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale - @echo - @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." - -changes: - $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes - @echo - @echo "The overview file is in $(BUILDDIR)/changes." - -linkcheck: - $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck - @echo - @echo "Link check complete; look for any errors in the above output " \ - "or in $(BUILDDIR)/linkcheck/output.txt." - -doctest: - $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest - @echo "Testing of doctests in the sources finished, look at the " \ - "results in $(BUILDDIR)/doctest/output.txt." - -xml: - $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml - @echo - @echo "Build finished. The XML files are in $(BUILDDIR)/xml." - -pseudoxml: - $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml - @echo - @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/llgo/docs/conf.py b/llgo/docs/conf.py deleted file mode 100644 index 11a5e5143660..000000000000 --- a/llgo/docs/conf.py +++ /dev/null @@ -1,258 +0,0 @@ -# -*- coding: utf-8 -*- -# -# llgo documentation build configuration file, created by -# sphinx-quickstart on Sun Apr 5 16:02:16 2015. -# -# This file is execfile()d with the current directory set to its -# containing dir. -# -# Note that not all possible configuration values are present in this -# autogenerated file. -# -# All configuration values have a default; values that are commented out -# serve to show the default. - -import sys -import os - -# If extensions (or modules to document with autodoc) are in another directory, -# add these directories to sys.path here. If the directory is relative to the -# documentation root, use os.path.abspath to make it absolute, like shown here. -#sys.path.insert(0, os.path.abspath('.')) - -# -- General configuration ------------------------------------------------ - -# If your documentation needs a minimal Sphinx version, state it here. -#needs_sphinx = '1.0' - -# Add any Sphinx extension module names here, as strings. They can be -# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom -# ones. -extensions = [] - -# Add any paths that contain templates here, relative to this directory. -templates_path = ['_templates'] - -# The suffix of source filenames. -source_suffix = '.rst' - -# The encoding of source files. -#source_encoding = 'utf-8-sig' - -# The master toctree document. -master_doc = 'index' - -# General information about the project. -project = u'llgo' -copyright = u'2015, LLVM Team' - -# The version info for the project you're documenting, acts as replacement for -# |version| and |release|, also used in various other places throughout the -# built documents. -# -# The short X.Y version. -version = '3.7' -# The full version, including alpha/beta/rc tags. -release = '3.7' - -# The language for content autogenerated by Sphinx. Refer to documentation -# for a list of supported languages. -#language = None - -# There are two options for replacing |today|: either, you set today to some -# non-false value, then it is used: -#today = '' -# Else, today_fmt is used as the format for a strftime call. -#today_fmt = '%B %d, %Y' - -# List of patterns, relative to source directory, that match files and -# directories to ignore when looking for source files. -exclude_patterns = ['_build'] - -# The reST default role (used for this markup: `text`) to use for all -# documents. -#default_role = None - -# If true, '()' will be appended to :func: etc. cross-reference text. -#add_function_parentheses = True - -# If true, the current module name will be prepended to all description -# unit titles (such as .. function::). -#add_module_names = True - -# If true, sectionauthor and moduleauthor directives will be shown in the -# output. They are ignored by default. -#show_authors = False - -# The name of the Pygments (syntax highlighting) style to use. -pygments_style = 'sphinx' - -# A list of ignored prefixes for module index sorting. -#modindex_common_prefix = [] - -# If true, keep warnings as "system message" paragraphs in the built documents. -#keep_warnings = False - - -# -- Options for HTML output ---------------------------------------------- - -# The theme to use for HTML and HTML Help pages. See the documentation for -# a list of builtin themes. -html_theme = 'default' - -# Theme options are theme-specific and customize the look and feel of a theme -# further. For a list of options available for each theme, see the -# documentation. -#html_theme_options = {} - -# Add any paths that contain custom themes here, relative to this directory. -#html_theme_path = [] - -# The name for this set of Sphinx documents. If None, it defaults to -# " v documentation". -#html_title = None - -# A shorter title for the navigation bar. Default is the same as html_title. -#html_short_title = None - -# The name of an image file (relative to this directory) to place at the top -# of the sidebar. -#html_logo = None - -# The name of an image file (within the static path) to use as favicon of the -# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 -# pixels large. -#html_favicon = None - -# Add any paths that contain custom static files (such as style sheets) here, -# relative to this directory. They are copied after the builtin static files, -# so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] - -# Add any extra paths that contain custom files (such as robots.txt or -# .htaccess) here, relative to this directory. These files are copied -# directly to the root of the documentation. -#html_extra_path = [] - -# If not '', a 'Last updated on:' timestamp is inserted at every page bottom, -# using the given strftime format. -#html_last_updated_fmt = '%b %d, %Y' - -# If true, SmartyPants will be used to convert quotes and dashes to -# typographically correct entities. -#html_use_smartypants = True - -# Custom sidebar templates, maps document names to template names. -#html_sidebars = {} - -# Additional templates that should be rendered to pages, maps page names to -# template names. -#html_additional_pages = {} - -# If false, no module index is generated. -#html_domain_indices = True - -# If false, no index is generated. -#html_use_index = True - -# If true, the index is split into individual pages for each letter. -#html_split_index = False - -# If true, links to the reST sources are added to the pages. -#html_show_sourcelink = True - -# If true, "Created using Sphinx" is shown in the HTML footer. Default is True. -#html_show_sphinx = True - -# If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. -#html_show_copyright = True - -# If true, an OpenSearch description file will be output, and all pages will -# contain a tag referring to it. The value of this option must be the -# base URL from which the finished HTML is served. -#html_use_opensearch = '' - -# This is the file name suffix for HTML files (e.g. ".xhtml"). -#html_file_suffix = None - -# Output file base name for HTML help builder. -htmlhelp_basename = 'llgodoc' - - -# -- Options for LaTeX output --------------------------------------------- - -latex_elements = { -# The paper size ('letterpaper' or 'a4paper'). -#'papersize': 'letterpaper', - -# The font size ('10pt', '11pt' or '12pt'). -#'pointsize': '10pt', - -# Additional stuff for the LaTeX preamble. -#'preamble': '', -} - -# Grouping the document tree into LaTeX files. List of tuples -# (source start file, target name, title, -# author, documentclass [howto, manual, or own class]). -latex_documents = [ - ('index', 'llgo.tex', u'llgo Documentation', - u'LLVM Team', 'manual'), -] - -# The name of an image file (relative to this directory) to place at the top of -# the title page. -#latex_logo = None - -# For "manual" documents, if this is true, then toplevel headings are parts, -# not chapters. -#latex_use_parts = False - -# If true, show page references after internal links. -#latex_show_pagerefs = False - -# If true, show URL addresses after external links. -#latex_show_urls = False - -# Documents to append as an appendix to all manuals. -#latex_appendices = [] - -# If false, no module index is generated. -#latex_domain_indices = True - - -# -- Options for manual page output --------------------------------------- - -# One entry per manual page. List of tuples -# (source start file, name, description, authors, manual section). -man_pages = [ - ('index', 'llgo', u'llgo Documentation', - [u'LLVM Team'], 1) -] - -# If true, show URL addresses after external links. -#man_show_urls = False - - -# -- Options for Texinfo output ------------------------------------------- - -# Grouping the document tree into Texinfo files. List of tuples -# (source start file, target name, title, author, -# dir menu entry, description, category) -texinfo_documents = [ - ('index', 'llgo', u'llgo Documentation', - u'LLVM Team', 'llgo', 'One line description of project.', - 'Miscellaneous'), -] - -# Documents to append as an appendix to all manuals. -#texinfo_appendices = [] - -# If false, no module index is generated. -#texinfo_domain_indices = True - -# How to display URL addresses: 'footnote', 'no', or 'inline'. -#texinfo_show_urls = 'footnote' - -# If true, do not generate a @detailmenu in the "Top" node's menu. -#texinfo_no_detailmenu = False diff --git a/llgo/docs/index.rst b/llgo/docs/index.rst deleted file mode 100644 index 40cfc43fd237..000000000000 --- a/llgo/docs/index.rst +++ /dev/null @@ -1,23 +0,0 @@ -.. llgo documentation master file, created by - sphinx-quickstart on Sun Apr 5 16:02:16 2015. - You can adapt this file completely to your liking, but it should at least - contain the root `toctree` directive. - -Welcome to llgo's documentation! -================================ - -Contents: - -.. toctree:: - :maxdepth: 2 - - llgoi - - -Indices and tables -================== - -* :ref:`genindex` -* :ref:`modindex` -* :ref:`search` - diff --git a/llgo/docs/llgoi.rst b/llgo/docs/llgoi.rst deleted file mode 100644 index c7def7dde436..000000000000 --- a/llgo/docs/llgoi.rst +++ /dev/null @@ -1,80 +0,0 @@ -===== -llgoi -===== - -Introduction -============ - -llgoi is an interactive REPL for Go. It supports expressions, statements, -most declarations and imports, including binary imports from the standard -library and source imports from ``$GOPATH``. - -Example usage -============= - -.. code-block:: none - - (llgo) 1+1 - #0 untyped int = 2 - (llgo) x := 1 - x untyped int = 1 - (llgo) x++ - (llgo) x - #0 int = 2 - (llgo) import "fmt" - (llgo) fmt.Println("hello world") - hello world - #0 int = 12 - #1 error () = - (llgo) for i := 0; i != 3; i++ { - fmt.Println(i) - } - 0 - 1 - 2 - (llgo) func foo() { - fmt.Println("hello decl") - } - (llgo) foo() - hello decl - (llgo) import "golang.org/x/tools/go/types" - # golang.org/x/tools/go/ast/astutil - # golang.org/x/tools/go/exact - # golang.org/x/tools/go/types - (llgo) types.Eval("1+1", nil, nil) - #0 golang.org/x/tools/go/types.TypeAndValue = {mode:4 Type:untyped int Value:2} - #1 error () = - -Expressions -=========== - -Expressions can be evaluated by entering them at the llgoi prompt. The -result of evaluating the expression is displayed as if printed with the -format string ``"%+v"``. If the expression has multiple values (e.g. calls), -each value is displayed separately. - -Declarations -============ - -Declarations introduce new entities into llgoi's scope. For example, entering -``x := 1`` introduces into the scope a variable named ``x`` with an initial -value of 1. In addition to short variable declarations (i.e. variables declared -with ``:=``), llgoi supports constant declarations, function declarations, -variable declarations and type declarations. - -Imports -======= - -To import a package, enter ``import`` followed by the name of a package -surrounded by quotes. This introduces the package name into llgoi's -scope. The package may be a standard library package, or a source package on -``$GOPATH``. In the latter case, llgoi will first compile the package and -its dependencies. - -Statements -========== - -Aside from declarations and expressions, the following kinds of statements -can be evaluated by entering them at the llgoi prompt: IncDec statements, -assignments, go statements, blocks, if statements, switch statements, select -statements and for statements. diff --git a/llgo/docs/make.bat b/llgo/docs/make.bat deleted file mode 100644 index 449a79dcc891..000000000000 --- a/llgo/docs/make.bat +++ /dev/null @@ -1,242 +0,0 @@ -@ECHO OFF - -REM Command file for Sphinx documentation - -if "%SPHINXBUILD%" == "" ( - set SPHINXBUILD=sphinx-build -) -set BUILDDIR=_build -set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . -set I18NSPHINXOPTS=%SPHINXOPTS% . -if NOT "%PAPER%" == "" ( - set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% - set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% -) - -if "%1" == "" goto help - -if "%1" == "help" ( - :help - echo.Please use `make ^` where ^ is one of - echo. html to make standalone HTML files - echo. dirhtml to make HTML files named index.html in directories - echo. singlehtml to make a single large HTML file - echo. pickle to make pickle files - echo. json to make JSON files - echo. htmlhelp to make HTML files and a HTML help project - echo. qthelp to make HTML files and a qthelp project - echo. devhelp to make HTML files and a Devhelp project - echo. epub to make an epub - echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter - echo. text to make text files - echo. man to make manual pages - echo. texinfo to make Texinfo files - echo. gettext to make PO message catalogs - echo. changes to make an overview over all changed/added/deprecated items - echo. xml to make Docutils-native XML files - echo. pseudoxml to make pseudoxml-XML files for display purposes - echo. linkcheck to check all external links for integrity - echo. doctest to run all doctests embedded in the documentation if enabled - goto end -) - -if "%1" == "clean" ( - for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i - del /q /s %BUILDDIR%\* - goto end -) - - -%SPHINXBUILD% 2> nul -if errorlevel 9009 ( - echo. - echo.The 'sphinx-build' command was not found. Make sure you have Sphinx - echo.installed, then set the SPHINXBUILD environment variable to point - echo.to the full path of the 'sphinx-build' executable. Alternatively you - echo.may add the Sphinx directory to PATH. - echo. - echo.If you don't have Sphinx installed, grab it from - echo.http://sphinx-doc.org/ - exit /b 1 -) - -if "%1" == "html" ( - %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/html. - goto end -) - -if "%1" == "dirhtml" ( - %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. - goto end -) - -if "%1" == "singlehtml" ( - %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. - goto end -) - -if "%1" == "pickle" ( - %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the pickle files. - goto end -) - -if "%1" == "json" ( - %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can process the JSON files. - goto end -) - -if "%1" == "htmlhelp" ( - %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run HTML Help Workshop with the ^ -.hhp project file in %BUILDDIR%/htmlhelp. - goto end -) - -if "%1" == "qthelp" ( - %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; now you can run "qcollectiongenerator" with the ^ -.qhcp project file in %BUILDDIR%/qthelp, like this: - echo.^> qcollectiongenerator %BUILDDIR%\qthelp\llgo.qhcp - echo.To view the help file: - echo.^> assistant -collectionFile %BUILDDIR%\qthelp\llgo.ghc - goto end -) - -if "%1" == "devhelp" ( - %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. - goto end -) - -if "%1" == "epub" ( - %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The epub file is in %BUILDDIR%/epub. - goto end -) - -if "%1" == "latex" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - if errorlevel 1 exit /b 1 - echo. - echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdf" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "latexpdfja" ( - %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex - cd %BUILDDIR%/latex - make all-pdf-ja - cd %BUILDDIR%/.. - echo. - echo.Build finished; the PDF files are in %BUILDDIR%/latex. - goto end -) - -if "%1" == "text" ( - %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The text files are in %BUILDDIR%/text. - goto end -) - -if "%1" == "man" ( - %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The manual pages are in %BUILDDIR%/man. - goto end -) - -if "%1" == "texinfo" ( - %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. - goto end -) - -if "%1" == "gettext" ( - %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The message catalogs are in %BUILDDIR%/locale. - goto end -) - -if "%1" == "changes" ( - %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes - if errorlevel 1 exit /b 1 - echo. - echo.The overview file is in %BUILDDIR%/changes. - goto end -) - -if "%1" == "linkcheck" ( - %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck - if errorlevel 1 exit /b 1 - echo. - echo.Link check complete; look for any errors in the above output ^ -or in %BUILDDIR%/linkcheck/output.txt. - goto end -) - -if "%1" == "doctest" ( - %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest - if errorlevel 1 exit /b 1 - echo. - echo.Testing of doctests in the sources finished, look at the ^ -results in %BUILDDIR%/doctest/output.txt. - goto end -) - -if "%1" == "xml" ( - %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The XML files are in %BUILDDIR%/xml. - goto end -) - -if "%1" == "pseudoxml" ( - %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml - if errorlevel 1 exit /b 1 - echo. - echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. - goto end -) - -:end diff --git a/llgo/driver/parser.go b/llgo/driver/parser.go deleted file mode 100644 index 07600f41d441..000000000000 --- a/llgo/driver/parser.go +++ /dev/null @@ -1,43 +0,0 @@ -//===- parser.go - parser wrapper -----------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains functions for calling the parser in an appropriate way for -// llgo. -// -//===----------------------------------------------------------------------===// - -package driver - -import ( - "fmt" - "go/ast" - "go/parser" - "go/scanner" - "go/token" -) - -func parseFile(fset *token.FileSet, filename string) (*ast.File, error) { - // Retain comments; this is important for annotation processing. - mode := parser.DeclarationErrors | parser.ParseComments - return parser.ParseFile(fset, filename, nil, mode) -} - -func ParseFiles(fset *token.FileSet, filenames []string) ([]*ast.File, error) { - files := make([]*ast.File, len(filenames)) - for i, filename := range filenames { - file, err := parseFile(fset, filename) - if _, ok := err.(scanner.ErrorList); ok { - return nil, err - } else if err != nil { - return nil, fmt.Errorf("%q: %v", filename, err) - } - files[i] = file - } - return files, nil -} diff --git a/llgo/include/dwarf2.h b/llgo/include/dwarf2.h deleted file mode 100644 index 928822645b6f..000000000000 --- a/llgo/include/dwarf2.h +++ /dev/null @@ -1,94 +0,0 @@ -//===----------------------------- dwarf2.h -------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -// DWARF constants. Derived from: -// - libcxxabi/src/Unwind/dwarf2.h -// - DWARF 4 specification -// -//===----------------------------------------------------------------------===// - -#ifndef DWARF2_H -#define DWARF2_H - -enum dwarf_attribute { - DW_AT_name = 0x03, - DW_AT_stmt_list = 0x10, - DW_AT_low_pc = 0x11, - DW_AT_high_pc = 0x12, - DW_AT_comp_dir = 0x1b, - DW_AT_abstract_origin = 0x31, - DW_AT_specification = 0x47, - DW_AT_ranges = 0x55, - DW_AT_call_file = 0x58, - DW_AT_call_line = 0x59, - DW_AT_linkage_name = 0x6e, - DW_AT_MIPS_linkage_name = 0x2007 -}; - -enum dwarf_form { - DW_FORM_addr = 0x01, - DW_FORM_block2 = 0x03, - DW_FORM_block4 = 0x04, - DW_FORM_data2 = 0x05, - DW_FORM_data4 = 0x06, - DW_FORM_data8 = 0x07, - DW_FORM_string = 0x08, - DW_FORM_block = 0x09, - DW_FORM_block1 = 0x0a, - DW_FORM_data1 = 0x0b, - DW_FORM_flag = 0x0c, - DW_FORM_sdata = 0x0d, - DW_FORM_strp = 0x0e, - DW_FORM_udata = 0x0f, - DW_FORM_ref_addr = 0x10, - DW_FORM_ref1 = 0x11, - DW_FORM_ref2 = 0x12, - DW_FORM_ref4 = 0x13, - DW_FORM_ref8 = 0x14, - DW_FORM_ref_udata = 0x15, - DW_FORM_indirect = 0x16, - DW_FORM_sec_offset = 0x17, - DW_FORM_exprloc = 0x18, - DW_FORM_flag_present = 0x19, - DW_FORM_ref_sig8 = 0x20, - DW_FORM_GNU_addr_index = 0x1f01, - DW_FORM_GNU_str_index = 0x1f02, - DW_FORM_GNU_ref_alt = 0x1f20, - DW_FORM_GNU_strp_alt = 0x1f21 -}; - -enum dwarf_tag { - DW_TAG_entry_point = 0x03, - DW_TAG_compile_unit = 0x11, - DW_TAG_inlined_subroutine = 0x1d, - DW_TAG_subprogram = 0x2e -}; - -enum dwarf_lns { - DW_LNS_extended_op = 0x00, - DW_LNS_copy = 0x01, - DW_LNS_advance_pc = 0x02, - DW_LNS_advance_line = 0x03, - DW_LNS_set_file = 0x04, - DW_LNS_set_column = 0x05, - DW_LNS_negate_stmt = 0x06, - DW_LNS_set_basic_block = 0x07, - DW_LNS_const_add_pc = 0x08, - DW_LNS_fixed_advance_pc = 0x09, - DW_LNS_set_prologue_end = 0x0a, - DW_LNS_set_epilogue_begin = 0x0b, - DW_LNS_set_isa = 0x0c -}; - -enum dwarf_lne { - DW_LNE_end_sequence = 0x01, - DW_LNE_set_address = 0x02, - DW_LNE_define_file = 0x03, - DW_LNE_set_discriminator = 0x04 -}; - -#endif // DWARF2_H diff --git a/llgo/include/filenames.h b/llgo/include/filenames.h deleted file mode 100644 index 726b6adde41d..000000000000 --- a/llgo/include/filenames.h +++ /dev/null @@ -1,15 +0,0 @@ -//===----------------------------- filenames.h ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// - -#ifndef FILENAMES_H -#define FILENAMES_H - -#define IS_ABSOLUTE_PATH(path) ((path)[0] == '/') - -#endif diff --git a/llgo/include/unwind-pe.h b/llgo/include/unwind-pe.h deleted file mode 100644 index a460d556e059..000000000000 --- a/llgo/include/unwind-pe.h +++ /dev/null @@ -1,201 +0,0 @@ -//===----------------------------- unwind-pe.h ----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is dual licensed under the MIT and the University of Illinois Open -// Source Licenses. See LICENSE.TXT for details. -// -// Pointer-Encoding decoder. Derived from: -// - libcxxabi/src/Unwind/dwarf2.h -// - libcxxabi/src/Unwind/AddressSpace.h -// -//===----------------------------------------------------------------------===// - -#ifndef UNWIND_PE_H -#define UNWIND_PE_H - -#include -#include -#include - -// FSF exception handling Pointer-Encoding constants -// Used in CFI augmentation by GCC -enum { - DW_EH_PE_ptr = 0x00, - DW_EH_PE_uleb128 = 0x01, - DW_EH_PE_udata2 = 0x02, - DW_EH_PE_udata4 = 0x03, - DW_EH_PE_udata8 = 0x04, - DW_EH_PE_signed = 0x08, - DW_EH_PE_sleb128 = 0x09, - DW_EH_PE_sdata2 = 0x0A, - DW_EH_PE_sdata4 = 0x0B, - DW_EH_PE_sdata8 = 0x0C, - DW_EH_PE_absptr = 0x00, - DW_EH_PE_pcrel = 0x10, - DW_EH_PE_textrel = 0x20, - DW_EH_PE_datarel = 0x30, - DW_EH_PE_funcrel = 0x40, - DW_EH_PE_aligned = 0x50, - DW_EH_PE_indirect = 0x80, - DW_EH_PE_omit = 0xFF -}; - -/// Read a ULEB128 into a 64-bit word. -static uint64_t unw_getULEB128(uintptr_t *addr) { - const uint8_t *p = (uint8_t *)*addr; - uint64_t result = 0; - int bit = 0; - do { - uint64_t b; - - b = *p & 0x7f; - - if (bit >= 64 || b << bit >> bit != b) { - assert(!"malformed uleb128 expression"); - } else { - result |= b << bit; - bit += 7; - } - } while (*p++ >= 0x80); - *addr = (uintptr_t) p; - return result; -} - -/// Read a SLEB128 into a 64-bit word. -static int64_t unw_getSLEB128(uintptr_t *addr) { - const uint8_t *p = (uint8_t *)addr; - int64_t result = 0; - int bit = 0; - uint8_t byte; - do { - byte = *p++; - result |= ((byte & 0x7f) << bit); - bit += 7; - } while (byte & 0x80); - // sign extend negative numbers - if ((byte & 0x40) != 0) - result |= (-1LL) << bit; - *addr = (uintptr_t) p; - return result; -} - -static uint16_t unw_get16(uintptr_t addr) { - uint16_t val; - memcpy(&val, (void *)addr, sizeof(val)); - return val; -} - -static uint32_t unw_get32(uintptr_t addr) { - uint32_t val; - memcpy(&val, (void *)addr, sizeof(val)); - return val; -} - -static uint64_t unw_get64(uintptr_t addr) { - uint64_t val; - memcpy(&val, (void *)addr, sizeof(val)); - return val; -} - -static uintptr_t unw_getP(uintptr_t addr) { - if (sizeof(uintptr_t) == 8) - return unw_get64(addr); - else - return unw_get32(addr); -} - -static const unsigned char *read_uleb128(const unsigned char *p, - _uleb128_t *ret) { - uintptr_t addr = (uintptr_t)p; - *ret = unw_getULEB128(&addr); - return (unsigned char *)addr; -} - -static const unsigned char *read_encoded_value(struct _Unwind_Context *ctx, - unsigned char encoding, - const unsigned char *p, - _Unwind_Ptr *ret) { - uintptr_t addr = (uintptr_t)p; - uintptr_t startAddr = addr; - uintptr_t result; - - (void)ctx; - - // first get value - switch (encoding & 0x0F) { - case DW_EH_PE_ptr: - result = unw_getP(addr); - p += sizeof(uintptr_t); - break; - case DW_EH_PE_uleb128: - result = (uintptr_t)unw_getULEB128(&addr); - p = (const unsigned char *)addr; - break; - case DW_EH_PE_udata2: - result = unw_get16(addr); - p += 2; - break; - case DW_EH_PE_udata4: - result = unw_get32(addr); - p += 4; - break; - case DW_EH_PE_udata8: - result = (uintptr_t)unw_get64(addr); - p += 8; - break; - case DW_EH_PE_sleb128: - result = (uintptr_t)unw_getSLEB128(&addr); - p = (const unsigned char *)addr; - break; - case DW_EH_PE_sdata2: - // Sign extend from signed 16-bit value. - result = (uintptr_t)(int16_t)unw_get16(addr); - p += 2; - break; - case DW_EH_PE_sdata4: - // Sign extend from signed 32-bit value. - result = (uintptr_t)(int32_t)unw_get32(addr); - p += 4; - break; - case DW_EH_PE_sdata8: - result = (uintptr_t)unw_get64(addr); - p += 8; - break; - default: - assert(!"unknown pointer encoding"); - } - - // then add relative offset - switch (encoding & 0x70) { - case DW_EH_PE_absptr: - // do nothing - break; - case DW_EH_PE_pcrel: - result += startAddr; - break; - case DW_EH_PE_textrel: - assert(!"DW_EH_PE_textrel pointer encoding not supported"); - break; - case DW_EH_PE_datarel: - assert(!"DW_EH_PE_datarel pointer encoding not supported"); - break; - case DW_EH_PE_funcrel: - assert(!"DW_EH_PE_funcrel pointer encoding not supported"); - break; - case DW_EH_PE_aligned: - assert(!"DW_EH_PE_aligned pointer encoding not supported"); - break; - default: - assert(!"unknown pointer encoding"); - break; - } - - if (encoding & DW_EH_PE_indirect) - result = unw_getP(result); - - *ret = result; - return p; -} - -#endif // UNWIND_PE_H diff --git a/llgo/irgen/annotations.go b/llgo/irgen/annotations.go deleted file mode 100644 index 4976a625a5ff..000000000000 --- a/llgo/irgen/annotations.go +++ /dev/null @@ -1,64 +0,0 @@ -//===- annotations.go - annotation processor ------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file converts llgo annotations into attributes. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "go/ast" - "go/token" - "llvm.org/llgo/third_party/gotools/go/loader" - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// processAnnotations takes an *ssa.Package and a -// *importer.PackageInfo, and processes all of the -// llgo source annotations attached to each top-level -// function and global variable. -func (c *compiler) processAnnotations(u *unit, pkginfo *loader.PackageInfo) { - members := make(map[types.Object]llvm.Value, len(u.globals)) - for k, v := range u.globals { - members[k.(ssa.Member).Object()] = v - } - applyAttributes := func(attrs []Attribute, idents ...*ast.Ident) { - if len(attrs) == 0 { - return - } - for _, ident := range idents { - if v := members[pkginfo.ObjectOf(ident)]; !v.IsNil() { - for _, attr := range attrs { - attr.Apply(v) - } - } - } - } - for _, f := range pkginfo.Files { - for _, decl := range f.Decls { - switch decl := decl.(type) { - case *ast.FuncDecl: - attrs := parseAttributes(decl.Doc) - applyAttributes(attrs, decl.Name) - case *ast.GenDecl: - if decl.Tok != token.VAR { - continue - } - for _, spec := range decl.Specs { - varspec := spec.(*ast.ValueSpec) - attrs := parseAttributes(decl.Doc) - applyAttributes(attrs, varspec.Names...) - } - } - } - } -} diff --git a/llgo/irgen/attribute.go b/llgo/irgen/attribute.go deleted file mode 100644 index c9d539309cd9..000000000000 --- a/llgo/irgen/attribute.go +++ /dev/null @@ -1,177 +0,0 @@ -//===- attribute.go - attribute processor ---------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file processes llgo and //extern attributes. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "fmt" - "go/ast" - "llvm.org/llvm/bindings/go/llvm" - "strings" -) - -const AttributeCommentPrefix = "#llgo " - -// Attribute represents an attribute associated with a -// global variable or function. -type Attribute interface { - Apply(llvm.Value) -} - -// parseAttribute parses zero or more #llgo comment attributes associated with -// a global variable or function. The comment group provided will be processed -// one line at a time using parseAttribute. -func parseAttributes(doc *ast.CommentGroup) []Attribute { - var attributes []Attribute - if doc == nil { - return attributes - } - for _, comment := range doc.List { - if strings.HasPrefix(comment.Text, "//extern ") { - nameattr := nameAttribute(strings.TrimSpace(comment.Text[9:])) - attributes = append(attributes, nameattr) - continue - } - text := comment.Text[2:] - if strings.HasPrefix(comment.Text, "/*") { - text = text[:len(text)-2] - } - attr := parseAttribute(strings.TrimSpace(text)) - if attr != nil { - attributes = append(attributes, attr) - } - } - return attributes -} - -// parseAttribute parses a single #llgo comment attribute associated with -// a global variable or function. The string provided will be parsed -// if it begins with AttributeCommentPrefix, otherwise nil is returned. -func parseAttribute(line string) Attribute { - if !strings.HasPrefix(line, AttributeCommentPrefix) { - return nil - } - line = strings.TrimSpace(line[len(AttributeCommentPrefix):]) - colon := strings.IndexRune(line, ':') - var key, value string - if colon == -1 { - key = line - } else { - key, value = line[:colon], line[colon+1:] - } - switch key { - case "linkage": - return parseLinkageAttribute(value) - case "name": - return nameAttribute(strings.TrimSpace(value)) - case "attr": - return parseLLVMAttribute(strings.TrimSpace(value)) - case "thread_local": - return tlsAttribute{} - default: - // FIXME decide what to do here. return error? log warning? - panic("unknown attribute key: " + key) - } - return nil -} - -type linkageAttribute llvm.Linkage - -func (a linkageAttribute) Apply(v llvm.Value) { - v.SetLinkage(llvm.Linkage(a)) -} - -func parseLinkageAttribute(value string) linkageAttribute { - var result linkageAttribute - value = strings.Replace(value, ",", " ", -1) - for _, field := range strings.Fields(value) { - switch strings.ToLower(field) { - case "private": - result |= linkageAttribute(llvm.PrivateLinkage) - case "internal": - result |= linkageAttribute(llvm.InternalLinkage) - case "available_externally": - result |= linkageAttribute(llvm.AvailableExternallyLinkage) - case "linkonce": - result |= linkageAttribute(llvm.LinkOnceAnyLinkage) - case "common": - result |= linkageAttribute(llvm.CommonLinkage) - case "weak": - result |= linkageAttribute(llvm.WeakAnyLinkage) - case "appending": - result |= linkageAttribute(llvm.AppendingLinkage) - case "extern_weak": - result |= linkageAttribute(llvm.ExternalWeakLinkage) - case "linkonce_odr": - result |= linkageAttribute(llvm.LinkOnceODRLinkage) - case "weak_odr": - result |= linkageAttribute(llvm.WeakODRLinkage) - case "external": - result |= linkageAttribute(llvm.ExternalLinkage) - } - } - return result -} - -type nameAttribute string - -func (a nameAttribute) Apply(v llvm.Value) { - if !v.IsAFunction().IsNil() { - name := string(a) - curr := v.GlobalParent().NamedFunction(name) - if !curr.IsNil() && curr != v { - if curr.BasicBlocksCount() != 0 { - panic(fmt.Errorf("Want to take the name %s from a function that has a body!", name)) - } - curr.SetName(name + "_llgo_replaced") - curr.ReplaceAllUsesWith(llvm.ConstBitCast(v, curr.Type())) - } - v.SetName(name) - } else { - v.SetName(string(a)) - } -} - -func parseLLVMAttribute(value string) llvmAttribute { - var result llvmAttribute - value = strings.Replace(value, ",", " ", -1) - for _, field := range strings.Fields(value) { - switch strings.ToLower(field) { - case "noreturn": - result |= llvmAttribute(llvm.NoReturnAttribute) - case "nounwind": - result |= llvmAttribute(llvm.NoUnwindAttribute) - case "noinline": - result |= llvmAttribute(llvm.NoInlineAttribute) - case "alwaysinline": - result |= llvmAttribute(llvm.AlwaysInlineAttribute) - } - } - return result -} - -type llvmAttribute llvm.Attribute - -func (a llvmAttribute) Apply(v llvm.Value) { - if !v.IsAFunction().IsNil() { - v.AddFunctionAttr(llvm.Attribute(a)) - } else { - v.AddAttribute(llvm.Attribute(a)) - } -} - -type tlsAttribute struct{} - -func (tlsAttribute) Apply(v llvm.Value) { - v.SetThreadLocal(true) -} diff --git a/llgo/irgen/builtins.go b/llgo/irgen/builtins.go deleted file mode 100644 index 64d1c6d4ffb3..000000000000 --- a/llgo/irgen/builtins.go +++ /dev/null @@ -1,118 +0,0 @@ -//===- builtins.go - IR generation for builtins ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for the built-in functions. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -func (fr *frame) callCap(arg *govalue) *govalue { - var v llvm.Value - switch typ := arg.Type().Underlying().(type) { - case *types.Array: - v = llvm.ConstInt(fr.llvmtypes.inttype, uint64(typ.Len()), false) - case *types.Pointer: - atyp := typ.Elem().Underlying().(*types.Array) - v = llvm.ConstInt(fr.llvmtypes.inttype, uint64(atyp.Len()), false) - case *types.Slice: - v = fr.builder.CreateExtractValue(arg.value, 2, "") - case *types.Chan: - v = fr.runtime.chanCap.call(fr, arg.value)[0] - } - return newValue(v, types.Typ[types.Int]) -} - -func (fr *frame) callLen(arg *govalue) *govalue { - var lenvalue llvm.Value - switch typ := arg.Type().Underlying().(type) { - case *types.Array: - lenvalue = llvm.ConstInt(fr.llvmtypes.inttype, uint64(typ.Len()), false) - case *types.Pointer: - atyp := typ.Elem().Underlying().(*types.Array) - lenvalue = llvm.ConstInt(fr.llvmtypes.inttype, uint64(atyp.Len()), false) - case *types.Slice: - lenvalue = fr.builder.CreateExtractValue(arg.value, 1, "") - case *types.Map: - lenvalue = fr.runtime.mapLen.call(fr, arg.value)[0] - case *types.Basic: - if isString(typ) { - lenvalue = fr.builder.CreateExtractValue(arg.value, 1, "") - } - case *types.Chan: - lenvalue = fr.runtime.chanLen.call(fr, arg.value)[0] - } - return newValue(lenvalue, types.Typ[types.Int]) -} - -// callAppend takes two slices of the same type, and yields -// the result of appending the second to the first. -func (fr *frame) callAppend(a, b *govalue) *govalue { - bptr := fr.builder.CreateExtractValue(b.value, 0, "") - blen := fr.builder.CreateExtractValue(b.value, 1, "") - elemsizeInt64 := fr.types.Sizeof(a.Type().Underlying().(*types.Slice).Elem()) - elemsize := llvm.ConstInt(fr.target.IntPtrType(), uint64(elemsizeInt64), false) - result := fr.runtime.append.call(fr, a.value, bptr, blen, elemsize)[0] - return newValue(result, a.Type()) -} - -// callCopy takes two slices a and b of the same type, and -// yields the result of calling "copy(a, b)". -func (fr *frame) callCopy(dest, source *govalue) *govalue { - aptr := fr.builder.CreateExtractValue(dest.value, 0, "") - alen := fr.builder.CreateExtractValue(dest.value, 1, "") - bptr := fr.builder.CreateExtractValue(source.value, 0, "") - blen := fr.builder.CreateExtractValue(source.value, 1, "") - aless := fr.builder.CreateICmp(llvm.IntULT, alen, blen, "") - minlen := fr.builder.CreateSelect(aless, alen, blen, "") - elemsizeInt64 := fr.types.Sizeof(dest.Type().Underlying().(*types.Slice).Elem()) - elemsize := llvm.ConstInt(fr.types.inttype, uint64(elemsizeInt64), false) - bytes := fr.builder.CreateMul(minlen, elemsize, "") - fr.runtime.copy.call(fr, aptr, bptr, bytes) - return newValue(minlen, types.Typ[types.Int]) -} - -func (fr *frame) callRecover(isDeferredRecover bool) *govalue { - startbb := fr.builder.GetInsertBlock() - recoverbb := llvm.AddBasicBlock(fr.function, "") - contbb := llvm.AddBasicBlock(fr.function, "") - canRecover := fr.builder.CreateTrunc(fr.canRecover, llvm.Int1Type(), "") - fr.builder.CreateCondBr(canRecover, recoverbb, contbb) - - fr.builder.SetInsertPointAtEnd(recoverbb) - var recovered llvm.Value - if isDeferredRecover { - recovered = fr.runtime.deferredRecover.call(fr)[0] - } else { - recovered = fr.runtime.recover.call(fr)[0] - } - recoverbb = fr.builder.GetInsertBlock() - fr.builder.CreateBr(contbb) - - fr.builder.SetInsertPointAtEnd(contbb) - eface := types.NewInterface(nil, nil) - llv := fr.builder.CreatePHI(fr.types.ToLLVM(eface), "") - llv.AddIncoming( - []llvm.Value{llvm.ConstNull(llv.Type()), recovered}, - []llvm.BasicBlock{startbb, recoverbb}, - ) - return newValue(llv, eface) -} - -func (fr *frame) callPanic(arg *govalue, term bool) { - fr.runtime.panic.call(fr, arg.value) - if term { - fr.builder.CreateUnreachable() - } -} diff --git a/llgo/irgen/cabi.go b/llgo/irgen/cabi.go deleted file mode 100644 index ba3b09fdcb5a..000000000000 --- a/llgo/irgen/cabi.go +++ /dev/null @@ -1,679 +0,0 @@ -//===- cabi.go - C ABI abstraction layer ----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements an abstraction layer for the platform's C ABI (currently -// supports only Linux/x86_64). -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -type abiArgInfo int - -const ( - AIK_Direct = abiArgInfo(iota) - AIK_Indirect -) - -type backendType interface { - ToLLVM(llvm.Context) llvm.Type -} - -type ptrBType struct { -} - -func (t ptrBType) ToLLVM(c llvm.Context) llvm.Type { - return llvm.PointerType(c.Int8Type(), 0) -} - -type intBType struct { - width int - signed bool -} - -func (t intBType) ToLLVM(c llvm.Context) llvm.Type { - return c.IntType(t.width * 8) -} - -type floatBType struct { - isDouble bool -} - -func (t floatBType) ToLLVM(c llvm.Context) llvm.Type { - if t.isDouble { - return c.DoubleType() - } else { - return c.FloatType() - } -} - -type structBType struct { - fields []backendType -} - -func (t structBType) ToLLVM(c llvm.Context) llvm.Type { - var lfields []llvm.Type - for _, f := range t.fields { - lfields = append(lfields, f.ToLLVM(c)) - } - return c.StructType(lfields, false) -} - -type arrayBType struct { - length uint64 - elem backendType -} - -func (t arrayBType) ToLLVM(c llvm.Context) llvm.Type { - return llvm.ArrayType(t.elem.ToLLVM(c), int(t.length)) -} - -// align returns the smallest y >= x such that y % a == 0. -func align(x, a int64) int64 { - y := x + a - 1 - return y - y%a -} - -func (tm *llvmTypeMap) sizeofStruct(fields ...types.Type) int64 { - var o int64 - for _, f := range fields { - a := tm.Alignof(f) - o = align(o, a) - o += tm.Sizeof(f) - } - return o -} - -// This decides whether the x86_64 classification algorithm produces MEMORY for -// the given type. Given the subset of types that Go supports, this is exactly -// equivalent to testing the type's size. See in particular the first step of -// the algorithm and its footnote. -func (tm *llvmTypeMap) classify(t ...types.Type) abiArgInfo { - if tm.sizeofStruct(t...) > 16 { - return AIK_Indirect - } - return AIK_Direct -} - -func (tm *llvmTypeMap) sliceBackendType() backendType { - i8ptr := &ptrBType{} - uintptr := &intBType{tm.target.PointerSize(), false} - return &structBType{[]backendType{i8ptr, uintptr, uintptr}} -} - -func (tm *llvmTypeMap) getBackendType(t types.Type) backendType { - switch t := t.(type) { - case *types.Named: - return tm.getBackendType(t.Underlying()) - - case *types.Basic: - switch t.Kind() { - case types.Bool, types.Uint8: - return &intBType{1, false} - case types.Int8: - return &intBType{1, true} - case types.Uint16: - return &intBType{2, false} - case types.Int16: - return &intBType{2, true} - case types.Uint32: - return &intBType{4, false} - case types.Int32: - return &intBType{4, true} - case types.Uint64: - return &intBType{8, false} - case types.Int64: - return &intBType{8, true} - case types.Uint, types.Uintptr: - return &intBType{tm.target.PointerSize(), false} - case types.Int: - return &intBType{tm.target.PointerSize(), true} - case types.Float32: - return &floatBType{false} - case types.Float64: - return &floatBType{true} - case types.UnsafePointer: - return &ptrBType{} - case types.Complex64: - f32 := &floatBType{false} - return &structBType{[]backendType{f32, f32}} - case types.Complex128: - f64 := &floatBType{true} - return &structBType{[]backendType{f64, f64}} - case types.String: - return &structBType{[]backendType{&ptrBType{}, &intBType{tm.target.PointerSize(), false}}} - } - - case *types.Struct: - var fields []backendType - for i := 0; i != t.NumFields(); i++ { - f := t.Field(i) - fields = append(fields, tm.getBackendType(f.Type())) - } - return &structBType{fields} - - case *types.Pointer, *types.Signature, *types.Map, *types.Chan: - return &ptrBType{} - - case *types.Interface: - i8ptr := &ptrBType{} - return &structBType{[]backendType{i8ptr, i8ptr}} - - case *types.Slice: - return tm.sliceBackendType() - - case *types.Array: - return &arrayBType{uint64(t.Len()), tm.getBackendType(t.Elem())} - } - - panic("unhandled type: " + t.String()) -} - -type offsetedType struct { - typ backendType - offset uint64 -} - -func (tm *llvmTypeMap) getBackendOffsets(bt backendType) (offsets []offsetedType) { - switch bt := bt.(type) { - case *structBType: - t := bt.ToLLVM(tm.ctx) - for i, f := range bt.fields { - offset := tm.target.ElementOffset(t, i) - fieldOffsets := tm.getBackendOffsets(f) - for _, fo := range fieldOffsets { - offsets = append(offsets, offsetedType{fo.typ, offset + fo.offset}) - } - } - - case *arrayBType: - size := tm.target.TypeAllocSize(bt.elem.ToLLVM(tm.ctx)) - fieldOffsets := tm.getBackendOffsets(bt.elem) - for i := uint64(0); i != bt.length; i++ { - for _, fo := range fieldOffsets { - offsets = append(offsets, offsetedType{fo.typ, i*size + fo.offset}) - } - } - - default: - offsets = []offsetedType{offsetedType{bt, 0}} - } - - return -} - -func (tm *llvmTypeMap) classifyEightbyte(offsets []offsetedType, numInt, numSSE *int) llvm.Type { - if len(offsets) == 1 { - if _, ok := offsets[0].typ.(*floatBType); ok { - *numSSE++ - } else { - *numInt++ - } - return offsets[0].typ.ToLLVM(tm.ctx) - } - // This implements classification for the basic types and step 4 of the - // classification algorithm. At this point, the only two possible - // classifications are SSE (floats) and INTEGER (everything else). - sse := true - for _, ot := range offsets { - if _, ok := ot.typ.(*floatBType); !ok { - sse = false - break - } - } - if sse { - // This can only be (float, float), which uses an SSE vector. - *numSSE++ - return llvm.VectorType(tm.ctx.FloatType(), 2) - } else { - *numInt++ - width := offsets[len(offsets)-1].offset + tm.target.TypeAllocSize(offsets[len(offsets)-1].typ.ToLLVM(tm.ctx)) - offsets[0].offset - return tm.ctx.IntType(int(width) * 8) - } -} - -func (tm *llvmTypeMap) expandType(argTypes []llvm.Type, argAttrs []llvm.Attribute, bt backendType) ([]llvm.Type, []llvm.Attribute, int, int) { - var numInt, numSSE int - var argAttr llvm.Attribute - - switch bt := bt.(type) { - case *structBType, *arrayBType: - bo := tm.getBackendOffsets(bt) - sp := 0 - for sp != len(bo) && bo[sp].offset < 8 { - sp++ - } - eb1 := bo[0:sp] - eb2 := bo[sp:] - if len(eb2) > 0 { - argTypes = append(argTypes, tm.classifyEightbyte(eb1, &numInt, &numSSE), tm.classifyEightbyte(eb2, &numInt, &numSSE)) - argAttrs = append(argAttrs, 0, 0) - } else { - argTypes = append(argTypes, tm.classifyEightbyte(eb1, &numInt, &numSSE)) - argAttrs = append(argAttrs, 0) - } - - return argTypes, argAttrs, numInt, numSSE - - case *intBType: - if bt.width < 4 { - if bt.signed { - argAttr = llvm.SExtAttribute - } else { - argAttr = llvm.ZExtAttribute - } - } - } - - argTypes = append(argTypes, tm.classifyEightbyte([]offsetedType{{bt, 0}}, &numInt, &numSSE)) - argAttrs = append(argAttrs, argAttr) - - return argTypes, argAttrs, numInt, numSSE -} - -type argInfo interface { - // Emit instructions to builder to ABI encode val and store result to args. - encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, args []llvm.Value, val llvm.Value) - - // Emit instructions to builder to ABI decode and return the resulting Value. - decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder) llvm.Value -} - -type retInfo interface { - // Prepare args to receive a value. allocaBuilder refers to a builder in the entry block. - prepare(ctx llvm.Context, allocaBuilder llvm.Builder, args []llvm.Value) - - // Emit instructions to builder to ABI decode the return value(s), if any. call is the - // call instruction. Must be called after prepare(). - decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, call llvm.Value) []llvm.Value - - // Emit instructions to builder to ABI encode the return value(s), if any, and return. - encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, vals []llvm.Value) -} - -type directArgInfo struct { - argOffset int - argTypes []llvm.Type - valType llvm.Type -} - -func directEncode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, argTypes []llvm.Type, args []llvm.Value, val llvm.Value) { - valType := val.Type() - - switch len(argTypes) { - case 0: - // do nothing - - case 1: - if argTypes[0].C == valType.C { - args[0] = val - return - } - alloca := allocaBuilder.CreateAlloca(valType, "") - bitcast := builder.CreateBitCast(alloca, llvm.PointerType(argTypes[0], 0), "") - builder.CreateStore(val, alloca) - args[0] = builder.CreateLoad(bitcast, "") - - case 2: - encodeType := llvm.StructType(argTypes, false) - alloca := allocaBuilder.CreateAlloca(valType, "") - bitcast := builder.CreateBitCast(alloca, llvm.PointerType(encodeType, 0), "") - builder.CreateStore(val, alloca) - args[0] = builder.CreateLoad(builder.CreateStructGEP(bitcast, 0, ""), "") - args[1] = builder.CreateLoad(builder.CreateStructGEP(bitcast, 1, ""), "") - - default: - panic("unexpected argTypes size") - } -} - -func (ai *directArgInfo) encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, args []llvm.Value, val llvm.Value) { - directEncode(ctx, allocaBuilder, builder, ai.argTypes, args[ai.argOffset:ai.argOffset+len(ai.argTypes)], val) -} - -func directDecode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, valType llvm.Type, args []llvm.Value) llvm.Value { - var alloca llvm.Value - - switch len(args) { - case 0: - return llvm.ConstNull(ctx.StructType(nil, false)) - - case 1: - if args[0].Type().C == valType.C { - return args[0] - } - alloca = allocaBuilder.CreateAlloca(valType, "") - bitcast := builder.CreateBitCast(alloca, llvm.PointerType(args[0].Type(), 0), "") - builder.CreateStore(args[0], bitcast) - - case 2: - alloca = allocaBuilder.CreateAlloca(valType, "") - var argTypes []llvm.Type - for _, a := range args { - argTypes = append(argTypes, a.Type()) - } - encodeType := ctx.StructType(argTypes, false) - bitcast := builder.CreateBitCast(alloca, llvm.PointerType(encodeType, 0), "") - builder.CreateStore(args[0], builder.CreateStructGEP(bitcast, 0, "")) - builder.CreateStore(args[1], builder.CreateStructGEP(bitcast, 1, "")) - - default: - panic("unexpected argTypes size") - } - - return builder.CreateLoad(alloca, "") -} - -func (ai *directArgInfo) decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder) llvm.Value { - var args []llvm.Value - fn := builder.GetInsertBlock().Parent() - for i, _ := range ai.argTypes { - args = append(args, fn.Param(ai.argOffset+i)) - } - return directDecode(ctx, allocaBuilder, builder, ai.valType, args) -} - -type indirectArgInfo struct { - argOffset int -} - -func (ai *indirectArgInfo) encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, args []llvm.Value, val llvm.Value) { - alloca := allocaBuilder.CreateAlloca(val.Type(), "") - builder.CreateStore(val, alloca) - args[ai.argOffset] = alloca -} - -func (ai *indirectArgInfo) decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder) llvm.Value { - fn := builder.GetInsertBlock().Parent() - return builder.CreateLoad(fn.Param(ai.argOffset), "") -} - -type directRetInfo struct { - numResults int - retTypes []llvm.Type - resultsType llvm.Type -} - -func (ri *directRetInfo) prepare(ctx llvm.Context, allocaBuilder llvm.Builder, args []llvm.Value) { -} - -func (ri *directRetInfo) decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, call llvm.Value) []llvm.Value { - var args []llvm.Value - switch len(ri.retTypes) { - case 0: - return nil - case 1: - args = []llvm.Value{call} - default: - args = make([]llvm.Value, len(ri.retTypes)) - for i := 0; i != len(ri.retTypes); i++ { - args[i] = builder.CreateExtractValue(call, i, "") - } - } - - d := directDecode(ctx, allocaBuilder, builder, ri.resultsType, args) - - if ri.numResults == 1 { - return []llvm.Value{d} - } else { - results := make([]llvm.Value, ri.numResults) - for i := 0; i != ri.numResults; i++ { - results[i] = builder.CreateExtractValue(d, i, "") - } - return results - } -} - -func (ri *directRetInfo) encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, vals []llvm.Value) { - if len(ri.retTypes) == 0 { - builder.CreateRetVoid() - return - } - - var val llvm.Value - switch ri.numResults { - case 1: - val = vals[0] - default: - val = llvm.Undef(ri.resultsType) - for i, v := range vals { - val = builder.CreateInsertValue(val, v, i, "") - } - } - - args := make([]llvm.Value, len(ri.retTypes)) - directEncode(ctx, allocaBuilder, builder, ri.retTypes, args, val) - - var retval llvm.Value - switch len(ri.retTypes) { - case 1: - retval = args[0] - default: - retval = llvm.Undef(ctx.StructType(ri.retTypes, false)) - for i, a := range args { - retval = builder.CreateInsertValue(retval, a, i, "") - } - } - builder.CreateRet(retval) -} - -type indirectRetInfo struct { - numResults int - sretSlot llvm.Value - resultsType llvm.Type -} - -func (ri *indirectRetInfo) prepare(ctx llvm.Context, allocaBuilder llvm.Builder, args []llvm.Value) { - ri.sretSlot = allocaBuilder.CreateAlloca(ri.resultsType, "") - args[0] = ri.sretSlot -} - -func (ri *indirectRetInfo) decode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, call llvm.Value) []llvm.Value { - if ri.numResults == 1 { - return []llvm.Value{builder.CreateLoad(ri.sretSlot, "")} - } else { - vals := make([]llvm.Value, ri.numResults) - for i, _ := range vals { - vals[i] = builder.CreateLoad(builder.CreateStructGEP(ri.sretSlot, i, ""), "") - } - return vals - } -} - -func (ri *indirectRetInfo) encode(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, vals []llvm.Value) { - fn := builder.GetInsertBlock().Parent() - sretSlot := fn.Param(0) - - if ri.numResults == 1 { - builder.CreateStore(vals[0], sretSlot) - } else { - for i, v := range vals { - builder.CreateStore(v, builder.CreateStructGEP(sretSlot, i, "")) - } - } - builder.CreateRetVoid() -} - -type functionTypeInfo struct { - functionType llvm.Type - argAttrs []llvm.Attribute - retAttr llvm.Attribute - argInfos []argInfo - retInf retInfo - chainIndex int -} - -func (fi *functionTypeInfo) declare(m llvm.Module, name string) llvm.Value { - fn := llvm.AddFunction(m, name, fi.functionType) - fn.AddFunctionAttr(fi.retAttr) - for i, a := range fi.argAttrs { - if a != 0 { - fn.Param(i).AddAttribute(a) - } - } - return fn -} - -func (fi *functionTypeInfo) call(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, callee llvm.Value, chain llvm.Value, args []llvm.Value) []llvm.Value { - callArgs := make([]llvm.Value, len(fi.argAttrs)) - if chain.C == nil { - chain = llvm.Undef(llvm.PointerType(ctx.Int8Type(), 0)) - } - callArgs[fi.chainIndex] = chain - for i, a := range args { - fi.argInfos[i].encode(ctx, allocaBuilder, builder, callArgs, a) - } - fi.retInf.prepare(ctx, allocaBuilder, callArgs) - typedCallee := builder.CreateBitCast(callee, llvm.PointerType(fi.functionType, 0), "") - call := builder.CreateCall(typedCallee, callArgs, "") - call.AddInstrAttribute(0, fi.retAttr) - for i, a := range fi.argAttrs { - call.AddInstrAttribute(i+1, a) - } - return fi.retInf.decode(ctx, allocaBuilder, builder, call) -} - -func (fi *functionTypeInfo) invoke(ctx llvm.Context, allocaBuilder llvm.Builder, builder llvm.Builder, callee llvm.Value, chain llvm.Value, args []llvm.Value, cont, lpad llvm.BasicBlock) []llvm.Value { - callArgs := make([]llvm.Value, len(fi.argAttrs)) - if chain.C == nil { - chain = llvm.Undef(llvm.PointerType(ctx.Int8Type(), 0)) - } - callArgs[fi.chainIndex] = chain - for i, a := range args { - fi.argInfos[i].encode(ctx, allocaBuilder, builder, callArgs, a) - } - fi.retInf.prepare(ctx, allocaBuilder, callArgs) - typedCallee := builder.CreateBitCast(callee, llvm.PointerType(fi.functionType, 0), "") - call := builder.CreateInvoke(typedCallee, callArgs, cont, lpad, "") - call.AddInstrAttribute(0, fi.retAttr) - for i, a := range fi.argAttrs { - call.AddInstrAttribute(i+1, a) - } - builder.SetInsertPointAtEnd(cont) - return fi.retInf.decode(ctx, allocaBuilder, builder, call) -} - -func (tm *llvmTypeMap) getFunctionTypeInfo(args []types.Type, results []types.Type) (fi functionTypeInfo) { - var returnType llvm.Type - var argTypes []llvm.Type - if len(results) == 0 { - returnType = llvm.VoidType() - fi.retInf = &directRetInfo{} - } else { - aik := tm.classify(results...) - - var resultsType llvm.Type - if len(results) == 1 { - resultsType = tm.ToLLVM(results[0]) - } else { - elements := make([]llvm.Type, len(results)) - for i := range elements { - elements[i] = tm.ToLLVM(results[i]) - } - resultsType = tm.ctx.StructType(elements, false) - } - - switch aik { - case AIK_Direct: - var retFields []backendType - for _, t := range results { - retFields = append(retFields, tm.getBackendType(t)) - } - bt := &structBType{retFields} - - retTypes, retAttrs, _, _ := tm.expandType(nil, nil, bt) - switch len(retTypes) { - case 0: // e.g., empty struct - returnType = llvm.VoidType() - case 1: - returnType = retTypes[0] - fi.retAttr = retAttrs[0] - case 2: - returnType = llvm.StructType(retTypes, false) - default: - panic("unexpected expandType result") - } - fi.retInf = &directRetInfo{numResults: len(results), retTypes: retTypes, resultsType: resultsType} - - case AIK_Indirect: - returnType = llvm.VoidType() - argTypes = []llvm.Type{llvm.PointerType(resultsType, 0)} - fi.argAttrs = []llvm.Attribute{llvm.StructRetAttribute} - fi.retInf = &indirectRetInfo{numResults: len(results), resultsType: resultsType} - } - } - - // Allocate an argument for the call chain. - fi.chainIndex = len(argTypes) - argTypes = append(argTypes, llvm.PointerType(tm.ctx.Int8Type(), 0)) - fi.argAttrs = append(fi.argAttrs, llvm.NestAttribute) - - // Keep track of the number of INTEGER/SSE class registers remaining. - remainingInt := 6 - remainingSSE := 8 - - for _, arg := range args { - aik := tm.classify(arg) - - isDirect := aik == AIK_Direct - if isDirect { - bt := tm.getBackendType(arg) - directArgTypes, directArgAttrs, numInt, numSSE := tm.expandType(argTypes, fi.argAttrs, bt) - - // Check if the argument can fit into the remaining registers, or if - // it would just occupy one register (which pushes the whole argument - // onto the stack anyway). - if numInt <= remainingInt && numSSE <= remainingSSE || numInt+numSSE == 1 { - remainingInt -= numInt - remainingSSE -= numSSE - argInfo := &directArgInfo{argOffset: len(argTypes), valType: bt.ToLLVM(tm.ctx)} - fi.argInfos = append(fi.argInfos, argInfo) - argTypes = directArgTypes - fi.argAttrs = directArgAttrs - argInfo.argTypes = argTypes[argInfo.argOffset:len(argTypes)] - } else { - // No remaining registers; pass on the stack. - isDirect = false - } - } - - if !isDirect { - fi.argInfos = append(fi.argInfos, &indirectArgInfo{len(argTypes)}) - argTypes = append(argTypes, llvm.PointerType(tm.ToLLVM(arg), 0)) - fi.argAttrs = append(fi.argAttrs, llvm.ByValAttribute) - } - } - - fi.functionType = llvm.FunctionType(returnType, argTypes, false) - return -} - -func (tm *llvmTypeMap) getSignatureInfo(sig *types.Signature) functionTypeInfo { - var args, results []types.Type - if sig.Recv() != nil { - recvtype := sig.Recv().Type() - if _, ok := recvtype.Underlying().(*types.Pointer); !ok && recvtype != types.Typ[types.UnsafePointer] { - recvtype = types.NewPointer(recvtype) - } - args = []types.Type{recvtype} - } - - for i := 0; i != sig.Params().Len(); i++ { - args = append(args, sig.Params().At(i).Type()) - } - for i := 0; i != sig.Results().Len(); i++ { - results = append(results, sig.Results().At(i).Type()) - } - return tm.getFunctionTypeInfo(args, results) -} diff --git a/llgo/irgen/call.go b/llgo/irgen/call.go deleted file mode 100644 index 9f29ac61dc17..000000000000 --- a/llgo/irgen/call.go +++ /dev/null @@ -1,44 +0,0 @@ -//===- call.go - IR generation for calls ----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for calls. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// createCall emits the code for a function call, -// taking into account receivers, and panic/defer. -func (fr *frame) createCall(fn *govalue, chain llvm.Value, argValues []*govalue) []*govalue { - fntyp := fn.Type().Underlying().(*types.Signature) - typinfo := fr.types.getSignatureInfo(fntyp) - - args := make([]llvm.Value, len(argValues)) - for i, arg := range argValues { - args[i] = arg.value - } - var results []llvm.Value - if fr.unwindBlock.IsNil() { - results = typinfo.call(fr.types.ctx, fr.allocaBuilder, fr.builder, fn.value, chain, args) - } else { - contbb := llvm.AddBasicBlock(fr.function, "") - results = typinfo.invoke(fr.types.ctx, fr.allocaBuilder, fr.builder, fn.value, chain, args, contbb, fr.unwindBlock) - } - - resultValues := make([]*govalue, len(results)) - for i, res := range results { - resultValues[i] = newValue(res, fntyp.Results().At(i).Type()) - } - return resultValues -} diff --git a/llgo/irgen/channels.go b/llgo/irgen/channels.go deleted file mode 100644 index c5cc322d910b..000000000000 --- a/llgo/irgen/channels.go +++ /dev/null @@ -1,134 +0,0 @@ -//===- channels.go - IR generation for channels ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for channels. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// makeChan implements make(chantype[, size]) -func (fr *frame) makeChan(chantyp types.Type, size *govalue) *govalue { - // TODO(pcc): call __go_new_channel_big here if needed - dyntyp := fr.types.ToRuntime(chantyp) - size = fr.convert(size, types.Typ[types.Uintptr]) - ch := fr.runtime.newChannel.call(fr, dyntyp, size.value)[0] - return newValue(ch, chantyp) -} - -// chanSend implements ch<- x -func (fr *frame) chanSend(ch *govalue, elem *govalue) { - elemtyp := ch.Type().Underlying().(*types.Chan).Elem() - elem = fr.convert(elem, elemtyp) - elemptr := fr.allocaBuilder.CreateAlloca(elem.value.Type(), "") - fr.builder.CreateStore(elem.value, elemptr) - elemptr = fr.builder.CreateBitCast(elemptr, llvm.PointerType(llvm.Int8Type(), 0), "") - chantyp := fr.types.ToRuntime(ch.Type()) - fr.runtime.sendBig.call(fr, chantyp, ch.value, elemptr) -} - -// chanRecv implements x[, ok] = <-ch -func (fr *frame) chanRecv(ch *govalue, commaOk bool) (x, ok *govalue) { - elemtyp := ch.Type().Underlying().(*types.Chan).Elem() - ptr := fr.allocaBuilder.CreateAlloca(fr.types.ToLLVM(elemtyp), "") - ptri8 := fr.builder.CreateBitCast(ptr, llvm.PointerType(llvm.Int8Type(), 0), "") - chantyp := fr.types.ToRuntime(ch.Type()) - - if commaOk { - okval := fr.runtime.chanrecv2.call(fr, chantyp, ch.value, ptri8)[0] - ok = newValue(okval, types.Typ[types.Bool]) - } else { - fr.runtime.receive.call(fr, chantyp, ch.value, ptri8) - } - x = newValue(fr.builder.CreateLoad(ptr, ""), elemtyp) - return -} - -// chanClose implements close(ch) -func (fr *frame) chanClose(ch *govalue) { - fr.runtime.builtinClose.call(fr, ch.value) -} - -func (fr *frame) chanSelect(sel *ssa.Select) (index, recvOk *govalue, recvElems []*govalue) { - n := uint64(len(sel.States)) - if !sel.Blocking { - // non-blocking means there's a default case - n++ - } - size := llvm.ConstInt(llvm.Int32Type(), n, false) - selectp := fr.runtime.newSelect.call(fr, size)[0] - - // Allocate stack for the values to send and receive. - ptrs := make([]llvm.Value, len(sel.States)) - for i, state := range sel.States { - chantyp := state.Chan.Type().Underlying().(*types.Chan) - elemtyp := fr.types.ToLLVM(chantyp.Elem()) - if state.Dir == types.SendOnly { - ptrs[i] = fr.allocaBuilder.CreateAlloca(elemtyp, "") - fr.builder.CreateStore(fr.llvmvalue(state.Send), ptrs[i]) - } else { - // Only allocate stack space if the received value is used. - used := chanSelectStateUsed(sel, len(recvElems)) - if used { - ptrs[i] = fr.allocaBuilder.CreateAlloca(elemtyp, "") - } else { - ptrs[i] = llvm.ConstNull(llvm.PointerType(llvm.Int8Type(), 0)) - } - recvElems = append(recvElems, newValue(ptrs[i], chantyp.Elem())) - } - } - - // Create select{send,recv2} calls. - var receivedp llvm.Value - if len(recvElems) > 0 { - receivedp = fr.allocaBuilder.CreateAlloca(fr.types.ToLLVM(types.Typ[types.Bool]), "") - } - if !sel.Blocking { - // If the default case is chosen, the index must be -1. - fr.runtime.selectdefault.call(fr, selectp, llvm.ConstAllOnes(llvm.Int32Type())) - } - for i, state := range sel.States { - ch := fr.llvmvalue(state.Chan) - index := llvm.ConstInt(llvm.Int32Type(), uint64(i), false) - if state.Dir == types.SendOnly { - fr.runtime.selectsend.call(fr, selectp, ch, ptrs[i], index) - } else { - fr.runtime.selectrecv2.call(fr, selectp, ch, ptrs[i], receivedp, index) - } - } - - // Fire off the select. - index = newValue(fr.runtime.selectgo.call(fr, selectp)[0], types.Typ[types.Int]) - if len(recvElems) > 0 { - recvOk = newValue(fr.builder.CreateLoad(receivedp, ""), types.Typ[types.Bool]) - for _, recvElem := range recvElems { - recvElem.value = fr.builder.CreateLoad(recvElem.value, "") - } - } - return index, recvOk, recvElems -} - -func chanSelectStateUsed(sel *ssa.Select, recvIndex int) bool { - for _, instr := range *sel.Referrers() { - extract, ok := instr.(*ssa.Extract) - if !ok || extract.Index != (recvIndex+2) { - continue - } - if len(*extract.Referrers()) > 0 { - return true - } - } - return false -} diff --git a/llgo/irgen/closures.go b/llgo/irgen/closures.go deleted file mode 100644 index bc21dd324e8c..000000000000 --- a/llgo/irgen/closures.go +++ /dev/null @@ -1,37 +0,0 @@ -//===- closures.go - IR generation for closures ---------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for closures. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" -) - -// makeClosure creates a closure from a function pointer and -// a set of bindings. The bindings are addresses of captured -// variables. -func (fr *frame) makeClosure(fn *govalue, bindings []*govalue) *govalue { - govalues := append([]*govalue{fn}, bindings...) - fields := make([]*types.Var, len(govalues)) - for i, v := range govalues { - field := types.NewField(0, nil, "_", v.Type(), false) - fields[i] = field - } - block := fr.createTypeMalloc(types.NewStruct(fields, nil)) - for i, v := range govalues { - addressPtr := fr.builder.CreateStructGEP(block, i, "") - fr.builder.CreateStore(v.value, addressPtr) - } - closure := fr.builder.CreateBitCast(block, fn.value.Type(), "") - return newValue(closure, fn.Type()) -} diff --git a/llgo/irgen/compiler.go b/llgo/irgen/compiler.go deleted file mode 100644 index c00a881a42a2..000000000000 --- a/llgo/irgen/compiler.go +++ /dev/null @@ -1,395 +0,0 @@ -//===- compiler.go - IR generator entry point -----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the main IR generator entry point, (*Compiler).Compile. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "bytes" - "go/ast" - "go/token" - "log" - "sort" - "strconv" - - llgobuild "llvm.org/llgo/build" - "llvm.org/llgo/debug" - "llvm.org/llvm/bindings/go/llvm" - - "llvm.org/llgo/third_party/gotools/go/gccgoimporter" - "llvm.org/llgo/third_party/gotools/go/importer" - "llvm.org/llgo/third_party/gotools/go/loader" - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/types" -) - -type Module struct { - llvm.Module - Path string - ExportData []byte - Package *types.Package - disposed bool -} - -func (m *Module) Dispose() { - if m.disposed { - return - } - m.Module.Dispose() - m.disposed = true -} - -/////////////////////////////////////////////////////////////////////////////// - -type CompilerOptions struct { - // TargetTriple is the LLVM triple for the target. - TargetTriple string - - // GenerateDebug decides whether debug data is - // generated in the output module. - GenerateDebug bool - - // DebugPrefixMaps is a list of mappings from source prefixes to - // replacement prefixes, to be applied in debug info. - DebugPrefixMaps []debug.PrefixMap - - // Logger is a logger used for tracing compilation. - Logger *log.Logger - - // DumpSSA is a debugging option that dumps each SSA function - // to stderr before generating code for it. - DumpSSA bool - - // GccgoPath is the path to the gccgo binary whose libgo we read import - // data from. If blank, the caller is expected to supply an import - // path in ImportPaths. - GccgoPath string - - // Whether to use the gccgo ABI. - GccgoABI bool - - // ImportPaths is the list of additional import paths - ImportPaths []string - - // SanitizerAttribute is an attribute to apply to functions to enable - // dynamic instrumentation using a sanitizer. - SanitizerAttribute llvm.Attribute - - // Importer is the importer. If nil, the compiler will set this field - // automatically using MakeImporter(). - Importer types.Importer - - // InitMap is the init map used by Importer. If Importer is nil, the - // compiler will set this field automatically using MakeImporter(). - // If Importer is non-nil, InitMap must be non-nil also. - InitMap map[*types.Package]gccgoimporter.InitData - - // PackageCreated is a hook passed to the go/loader package via - // loader.Config, see the documentation for that package for more - // information. - PackageCreated func(*types.Package) - - // DisableUnusedImportCheck disables the unused import check performed - // by go/types if set to true. - DisableUnusedImportCheck bool - - // Packages is used by go/types as the imported package map if non-nil. - Packages map[string]*types.Package -} - -type Compiler struct { - opts CompilerOptions - dataLayout string -} - -func NewCompiler(opts CompilerOptions) (*Compiler, error) { - compiler := &Compiler{opts: opts} - dataLayout, err := llvmDataLayout(compiler.opts.TargetTriple) - if err != nil { - return nil, err - } - compiler.dataLayout = dataLayout - return compiler, nil -} - -func (c *Compiler) Compile(fset *token.FileSet, astFiles []*ast.File, importpath string) (m *Module, err error) { - target := llvm.NewTargetData(c.dataLayout) - compiler := &compiler{ - CompilerOptions: c.opts, - dataLayout: c.dataLayout, - target: target, - llvmtypes: NewLLVMTypeMap(llvm.GlobalContext(), target), - } - return compiler.compile(fset, astFiles, importpath) -} - -type compiler struct { - CompilerOptions - - module *Module - dataLayout string - target llvm.TargetData - fileset *token.FileSet - - runtime *runtimeInterface - llvmtypes *llvmTypeMap - types *TypeMap - - debug *debug.DIBuilder -} - -func (c *compiler) logf(format string, v ...interface{}) { - if c.Logger != nil { - c.Logger.Printf(format, v...) - } -} - -func (c *compiler) addCommonFunctionAttrs(fn llvm.Value) { - fn.AddTargetDependentFunctionAttr("disable-tail-calls", "true") - fn.AddTargetDependentFunctionAttr("split-stack", "") - if attr := c.SanitizerAttribute; attr != 0 { - fn.AddFunctionAttr(attr) - } -} - -// MakeImporter sets CompilerOptions.Importer to an appropriate importer -// for the search paths given in CompilerOptions.ImportPaths, and sets -// CompilerOptions.InitMap to an init map belonging to that importer. -// If CompilerOptions.GccgoPath is non-empty, the importer will also use -// the search paths for that gccgo installation. -func (opts *CompilerOptions) MakeImporter() error { - opts.InitMap = make(map[*types.Package]gccgoimporter.InitData) - if opts.GccgoPath == "" { - paths := append(append([]string{}, opts.ImportPaths...), ".") - opts.Importer = gccgoimporter.GetImporter(paths, opts.InitMap) - } else { - var inst gccgoimporter.GccgoInstallation - err := inst.InitFromDriver(opts.GccgoPath) - if err != nil { - return err - } - opts.Importer = inst.GetImporter(opts.ImportPaths, opts.InitMap) - } - return nil -} - -func (compiler *compiler) compile(fset *token.FileSet, astFiles []*ast.File, importpath string) (m *Module, err error) { - buildctx, err := llgobuild.ContextFromTriple(compiler.TargetTriple) - if err != nil { - return nil, err - } - - if compiler.Importer == nil { - err = compiler.MakeImporter() - if err != nil { - return nil, err - } - } - - impcfg := &loader.Config{ - Fset: fset, - TypeChecker: types.Config{ - Packages: compiler.Packages, - Import: compiler.Importer, - Sizes: compiler.llvmtypes, - DisableUnusedImportCheck: compiler.DisableUnusedImportCheck, - }, - ImportFromBinary: true, - Build: &buildctx.Context, - PackageCreated: compiler.PackageCreated, - } - // If no import path is specified, then set the import - // path to be the same as the package's name. - if importpath == "" { - importpath = astFiles[0].Name.String() - } - impcfg.CreateFromFiles(importpath, astFiles...) - iprog, err := impcfg.Load() - if err != nil { - return nil, err - } - program := ssa.Create(iprog, ssa.BareInits) - mainPkginfo := iprog.InitialPackages()[0] - mainPkg := program.CreatePackage(mainPkginfo) - - // Create a Module, which contains the LLVM module. - modulename := importpath - compiler.module = &Module{Module: llvm.NewModule(modulename), Path: modulename, Package: mainPkg.Object} - compiler.module.SetTarget(compiler.TargetTriple) - compiler.module.SetDataLayout(compiler.dataLayout) - - // Create a new translation unit. - unit := newUnit(compiler, mainPkg) - - // Create the runtime interface. - compiler.runtime, err = newRuntimeInterface(compiler.module.Module, compiler.llvmtypes) - if err != nil { - return nil, err - } - - mainPkg.Build() - - // Create a struct responsible for mapping static types to LLVM types, - // and to runtime/dynamic type values. - compiler.types = NewTypeMap( - mainPkg, - compiler.llvmtypes, - compiler.module.Module, - compiler.runtime, - MethodResolver(unit), - ) - - if compiler.GenerateDebug { - compiler.debug = debug.NewDIBuilder( - types.Sizes(compiler.llvmtypes), - compiler.module.Module, - impcfg.Fset, - compiler.DebugPrefixMaps, - ) - defer compiler.debug.Destroy() - defer compiler.debug.Finalize() - } - - unit.translatePackage(mainPkg) - compiler.processAnnotations(unit, mainPkginfo) - - if importpath == "main" { - compiler.createInitMainFunction(mainPkg) - } else { - compiler.module.ExportData = compiler.buildExportData(mainPkg) - } - - return compiler.module, nil -} - -type byPriorityThenFunc []gccgoimporter.PackageInit - -func (a byPriorityThenFunc) Len() int { return len(a) } -func (a byPriorityThenFunc) Swap(i, j int) { a[i], a[j] = a[j], a[i] } -func (a byPriorityThenFunc) Less(i, j int) bool { - switch { - case a[i].Priority < a[j].Priority: - return true - case a[i].Priority > a[j].Priority: - return false - case a[i].InitFunc < a[j].InitFunc: - return true - default: - return false - } -} - -func (c *compiler) buildPackageInitData(mainPkg *ssa.Package) gccgoimporter.InitData { - var inits []gccgoimporter.PackageInit - for _, imp := range mainPkg.Object.Imports() { - inits = append(inits, c.InitMap[imp].Inits...) - } - sort.Sort(byPriorityThenFunc(inits)) - - // Deduplicate init entries. We want to preserve the entry with the highest priority. - // Normally a package's priorities will be consistent among its dependencies, but it is - // possible for them to be different. For example, if a standard library test augments a - // package which is a dependency of 'regexp' (which is imported by every test main package) - // with additional dependencies, those dependencies may cause the package under test to - // receive a higher priority than indicated by its init clause in 'regexp'. - uniqinits := make([]gccgoimporter.PackageInit, len(inits)) - uniqinitpos := len(inits) - uniqinitnames := make(map[string]struct{}) - for i, _ := range inits { - init := inits[len(inits)-1-i] - if _, ok := uniqinitnames[init.InitFunc]; !ok { - uniqinitnames[init.InitFunc] = struct{}{} - uniqinitpos-- - uniqinits[uniqinitpos] = init - } - } - uniqinits = uniqinits[uniqinitpos:] - - ourprio := 1 - if len(uniqinits) != 0 { - ourprio = uniqinits[len(uniqinits)-1].Priority + 1 - } - - if imp := mainPkg.Func("init"); imp != nil { - impname := c.types.mc.mangleFunctionName(imp) - uniqinits = append(uniqinits, gccgoimporter.PackageInit{mainPkg.Object.Name(), impname, ourprio}) - } - - return gccgoimporter.InitData{ourprio, uniqinits} -} - -func (c *compiler) createInitMainFunction(mainPkg *ssa.Package) { - int8ptr := llvm.PointerType(c.types.ctx.Int8Type(), 0) - ftyp := llvm.FunctionType(llvm.VoidType(), []llvm.Type{int8ptr}, false) - initMain := llvm.AddFunction(c.module.Module, "__go_init_main", ftyp) - c.addCommonFunctionAttrs(initMain) - entry := llvm.AddBasicBlock(initMain, "entry") - - builder := llvm.GlobalContext().NewBuilder() - defer builder.Dispose() - builder.SetInsertPointAtEnd(entry) - - args := []llvm.Value{llvm.Undef(int8ptr)} - - if !c.GccgoABI { - initfn := c.module.Module.NamedFunction("main..import") - if !initfn.IsNil() { - builder.CreateCall(initfn, args, "") - } - builder.CreateRetVoid() - return - } - - initdata := c.buildPackageInitData(mainPkg) - - for _, init := range initdata.Inits { - initfn := c.module.Module.NamedFunction(init.InitFunc) - if initfn.IsNil() { - initfn = llvm.AddFunction(c.module.Module, init.InitFunc, ftyp) - } - builder.CreateCall(initfn, args, "") - } - - builder.CreateRetVoid() -} - -func (c *compiler) buildExportData(mainPkg *ssa.Package) []byte { - exportData := importer.ExportData(mainPkg.Object) - b := bytes.NewBuffer(exportData) - - b.WriteString("v1;\n") - if !c.GccgoABI { - return b.Bytes() - } - - initdata := c.buildPackageInitData(mainPkg) - b.WriteString("priority ") - b.WriteString(strconv.Itoa(initdata.Priority)) - b.WriteString(";\n") - - if len(initdata.Inits) != 0 { - b.WriteString("init") - for _, init := range initdata.Inits { - b.WriteRune(' ') - b.WriteString(init.Name) - b.WriteRune(' ') - b.WriteString(init.InitFunc) - b.WriteRune(' ') - b.WriteString(strconv.Itoa(init.Priority)) - } - b.WriteString(";\n") - } - - return b.Bytes() -} - -// vim: set ft=go : diff --git a/llgo/irgen/errors.go b/llgo/irgen/errors.go deleted file mode 100644 index a4e6dc6cf875..000000000000 --- a/llgo/irgen/errors.go +++ /dev/null @@ -1,72 +0,0 @@ -//===- errors.go - IR generation for run-time panics ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for triggering run-time panics. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llvm/bindings/go/llvm" -) - -const ( - // From go-runtime-error.c - gccgoRuntimeErrorSLICE_INDEX_OUT_OF_BOUNDS = 0 - gccgoRuntimeErrorARRAY_INDEX_OUT_OF_BOUNDS = 1 - gccgoRuntimeErrorSTRING_INDEX_OUT_OF_BOUNDS = 2 - gccgoRuntimeErrorSLICE_SLICE_OUT_OF_BOUNDS = 3 - gccgoRuntimeErrorARRAY_SLICE_OUT_OF_BOUNDS = 4 - gccgoRuntimeErrorSTRING_SLICE_OUT_OF_BOUNDS = 5 - gccgoRuntimeErrorNIL_DEREFERENCE = 6 - gccgoRuntimeErrorMAKE_SLICE_OUT_OF_BOUNDS = 7 - gccgoRuntimeErrorMAKE_MAP_OUT_OF_BOUNDS = 8 - gccgoRuntimeErrorMAKE_CHAN_OUT_OF_BOUNDS = 9 - gccgoRuntimeErrorDIVISION_BY_ZERO = 10 - gccgoRuntimeErrorCount = 11 -) - -func (fr *frame) setBranchWeightMetadata(br llvm.Value, trueweight, falseweight uint64) { - mdprof := llvm.MDKindID("prof") - - mdnode := llvm.GlobalContext().MDNode([]llvm.Metadata{ - llvm.GlobalContext().MDString("branch_weights"), - llvm.ConstInt(llvm.Int32Type(), trueweight, false).ConstantAsMetadata(), - llvm.ConstInt(llvm.Int32Type(), falseweight, false).ConstantAsMetadata(), - }) - - br.SetMetadata(mdprof, mdnode) -} - -func (fr *frame) condBrRuntimeError(cond llvm.Value, errcode uint64) { - if cond.IsNull() { - return - } - - errorbb := fr.runtimeErrorBlocks[errcode] - newbb := errorbb.C == nil - if newbb { - errorbb = llvm.AddBasicBlock(fr.function, "") - fr.runtimeErrorBlocks[errcode] = errorbb - } - - contbb := llvm.AddBasicBlock(fr.function, "") - - br := fr.builder.CreateCondBr(cond, errorbb, contbb) - fr.setBranchWeightMetadata(br, 1, 1000) - - if newbb { - fr.builder.SetInsertPointAtEnd(errorbb) - fr.runtime.runtimeError.call(fr, llvm.ConstInt(llvm.Int32Type(), errcode, false)) - fr.builder.CreateUnreachable() - } - - fr.builder.SetInsertPointAtEnd(contbb) -} diff --git a/llgo/irgen/indirect.go b/llgo/irgen/indirect.go deleted file mode 100644 index d01df25ae150..000000000000 --- a/llgo/irgen/indirect.go +++ /dev/null @@ -1,125 +0,0 @@ -//===- indirect.go - IR generation for thunks -----------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for thunks required by the "defer" and -// "go" builtins. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// createThunk creates a thunk from a -// given function and arguments, suitable for use with -// "defer" and "go". -func (fr *frame) createThunk(call ssa.CallInstruction) (thunk llvm.Value, arg llvm.Value) { - seenarg := make(map[ssa.Value]bool) - var args []ssa.Value - var argtypes []*types.Var - - packArg := func(arg ssa.Value) { - switch arg.(type) { - case *ssa.Builtin, *ssa.Function, *ssa.Const, *ssa.Global: - // Do nothing: we can generate these in the thunk - default: - if !seenarg[arg] { - seenarg[arg] = true - args = append(args, arg) - field := types.NewField(0, nil, "_", arg.Type(), true) - argtypes = append(argtypes, field) - } - } - } - - packArg(call.Common().Value) - for _, arg := range call.Common().Args { - packArg(arg) - } - - var isRecoverCall bool - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - var structllptr llvm.Type - if len(args) == 0 { - if builtin, ok := call.Common().Value.(*ssa.Builtin); ok { - isRecoverCall = builtin.Name() == "recover" - } - if isRecoverCall { - // When creating a thunk for recover(), we must pass fr.canRecover. - arg = fr.builder.CreateZExt(fr.canRecover, fr.target.IntPtrType(), "") - arg = fr.builder.CreateIntToPtr(arg, i8ptr, "") - } else { - arg = llvm.ConstPointerNull(i8ptr) - } - } else { - structtype := types.NewStruct(argtypes, nil) - arg = fr.createTypeMalloc(structtype) - structllptr = arg.Type() - for i, ssaarg := range args { - argptr := fr.builder.CreateStructGEP(arg, i, "") - fr.builder.CreateStore(fr.llvmvalue(ssaarg), argptr) - } - arg = fr.builder.CreateBitCast(arg, i8ptr, "") - } - - thunkfntype := llvm.FunctionType(llvm.VoidType(), []llvm.Type{i8ptr}, false) - thunkfn := llvm.AddFunction(fr.module.Module, "", thunkfntype) - thunkfn.SetLinkage(llvm.InternalLinkage) - fr.addCommonFunctionAttrs(thunkfn) - - thunkfr := newFrame(fr.unit, thunkfn) - defer thunkfr.dispose() - - prologuebb := llvm.AddBasicBlock(thunkfn, "prologue") - thunkfr.builder.SetInsertPointAtEnd(prologuebb) - - if isRecoverCall { - thunkarg := thunkfn.Param(0) - thunkarg = thunkfr.builder.CreatePtrToInt(thunkarg, fr.target.IntPtrType(), "") - thunkfr.canRecover = thunkfr.builder.CreateTrunc(thunkarg, llvm.Int1Type(), "") - } else if len(args) > 0 { - thunkarg := thunkfn.Param(0) - thunkarg = thunkfr.builder.CreateBitCast(thunkarg, structllptr, "") - for i, ssaarg := range args { - thunkargptr := thunkfr.builder.CreateStructGEP(thunkarg, i, "") - thunkarg := thunkfr.builder.CreateLoad(thunkargptr, "") - thunkfr.env[ssaarg] = newValue(thunkarg, ssaarg.Type()) - } - } - - _, isDefer := call.(*ssa.Defer) - - entrybb := llvm.AddBasicBlock(thunkfn, "entry") - br := thunkfr.builder.CreateBr(entrybb) - thunkfr.allocaBuilder.SetInsertPointBefore(br) - - thunkfr.builder.SetInsertPointAtEnd(entrybb) - var exitbb llvm.BasicBlock - if isDefer { - exitbb = llvm.AddBasicBlock(thunkfn, "exit") - thunkfr.runtime.setDeferRetaddr.call(thunkfr, llvm.BlockAddress(thunkfn, exitbb)) - } - if isDefer && isRecoverCall { - thunkfr.callRecover(true) - } else { - thunkfr.callInstruction(call) - } - if isDefer { - thunkfr.builder.CreateBr(exitbb) - thunkfr.builder.SetInsertPointAtEnd(exitbb) - } - thunkfr.builder.CreateRetVoid() - - thunk = fr.builder.CreateBitCast(thunkfn, i8ptr, "") - return -} diff --git a/llgo/irgen/interfaces.go b/llgo/irgen/interfaces.go deleted file mode 100644 index fba95ba5aa0f..000000000000 --- a/llgo/irgen/interfaces.go +++ /dev/null @@ -1,196 +0,0 @@ -//===- interfaces.go - IR generation for interfaces -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for dealing with interface values. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// interfaceMethod returns a function and receiver pointer for the specified -// interface and method pair. -func (fr *frame) interfaceMethod(lliface llvm.Value, ifacety types.Type, method *types.Func) (fn, recv *govalue) { - llitab := fr.builder.CreateExtractValue(lliface, 0, "") - recv = newValue(fr.builder.CreateExtractValue(lliface, 1, ""), types.Typ[types.UnsafePointer]) - methodset := fr.types.MethodSet(ifacety) - // TODO(axw) cache ordered method index - index := -1 - for i, m := range orderedMethodSet(methodset) { - if m.Obj() == method { - index = i - break - } - } - if index == -1 { - panic("could not find method index") - } - llitab = fr.builder.CreateBitCast(llitab, llvm.PointerType(llvm.PointerType(llvm.Int8Type(), 0), 0), "") - // Skip runtime type pointer. - llifnptr := fr.builder.CreateGEP(llitab, []llvm.Value{ - llvm.ConstInt(llvm.Int32Type(), uint64(index+1), false), - }, "") - - llifn := fr.builder.CreateLoad(llifnptr, "") - // Replace receiver type with unsafe.Pointer. - recvparam := types.NewParam(0, nil, "", types.Typ[types.UnsafePointer]) - sig := method.Type().(*types.Signature) - sig = types.NewSignature(nil, recvparam, sig.Params(), sig.Results(), sig.Variadic()) - fn = newValue(llifn, sig) - return -} - -// compareInterfaces emits code to compare two interfaces for -// equality. -func (fr *frame) compareInterfaces(a, b *govalue) *govalue { - aNull := a.value.IsNull() - bNull := b.value.IsNull() - if aNull && bNull { - return newValue(boolLLVMValue(true), types.Typ[types.Bool]) - } - - compare := fr.runtime.emptyInterfaceCompare - aI := a.Type().Underlying().(*types.Interface).NumMethods() > 0 - bI := b.Type().Underlying().(*types.Interface).NumMethods() > 0 - switch { - case aI && bI: - compare = fr.runtime.interfaceCompare - case aI: - a = fr.convertI2E(a) - case bI: - b = fr.convertI2E(b) - } - - result := compare.call(fr, a.value, b.value)[0] - result = fr.builder.CreateIsNull(result, "") - result = fr.builder.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) -} - -func (fr *frame) makeInterface(llv llvm.Value, vty types.Type, iface types.Type) *govalue { - if _, ok := vty.Underlying().(*types.Pointer); !ok { - ptr := fr.createTypeMalloc(vty) - fr.builder.CreateStore(llv, ptr) - llv = ptr - } - return fr.makeInterfaceFromPointer(llv, vty, iface) -} - -func (fr *frame) makeInterfaceFromPointer(vptr llvm.Value, vty types.Type, iface types.Type) *govalue { - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - llv := fr.builder.CreateBitCast(vptr, i8ptr, "") - value := llvm.Undef(fr.types.ToLLVM(iface)) - itab := fr.types.getItabPointer(vty, iface.Underlying().(*types.Interface)) - value = fr.builder.CreateInsertValue(value, itab, 0, "") - value = fr.builder.CreateInsertValue(value, llv, 1, "") - return newValue(value, iface) -} - -// Reads the type descriptor from the given interface type. -func (fr *frame) getInterfaceTypeDescriptor(v *govalue) llvm.Value { - isempty := v.Type().Underlying().(*types.Interface).NumMethods() == 0 - itab := fr.builder.CreateExtractValue(v.value, 0, "") - if isempty { - return itab - } else { - itabnonnull := fr.builder.CreateIsNotNull(itab, "") - return fr.loadOrNull(itabnonnull, itab, types.Typ[types.UnsafePointer]).value - } -} - -// Reads the value from the given interface type, assuming that the -// interface holds a value of the correct type. -func (fr *frame) getInterfaceValue(v *govalue, ty types.Type) *govalue { - val := fr.builder.CreateExtractValue(v.value, 1, "") - if _, ok := ty.Underlying().(*types.Pointer); !ok { - typedval := fr.builder.CreateBitCast(val, llvm.PointerType(fr.types.ToLLVM(ty), 0), "") - val = fr.builder.CreateLoad(typedval, "") - } - return newValue(val, ty) -} - -// If cond is true, reads the value from the given interface type, otherwise -// returns a nil value. -func (fr *frame) getInterfaceValueOrNull(cond llvm.Value, v *govalue, ty types.Type) *govalue { - val := fr.builder.CreateExtractValue(v.value, 1, "") - if _, ok := ty.Underlying().(*types.Pointer); ok { - val = fr.builder.CreateSelect(cond, val, llvm.ConstNull(val.Type()), "") - } else { - val = fr.loadOrNull(cond, val, ty).value - } - return newValue(val, ty) -} - -func (fr *frame) interfaceTypeCheck(val *govalue, ty types.Type) (v *govalue, okval *govalue) { - tytd := fr.types.ToRuntime(ty) - if _, ok := ty.Underlying().(*types.Interface); ok { - var result []llvm.Value - if val.Type().Underlying().(*types.Interface).NumMethods() > 0 { - result = fr.runtime.ifaceI2I2.call(fr, tytd, val.value) - } else { - result = fr.runtime.ifaceE2I2.call(fr, tytd, val.value) - } - v = newValue(result[0], ty) - okval = newValue(result[1], types.Typ[types.Bool]) - } else { - valtd := fr.getInterfaceTypeDescriptor(val) - tyequal := fr.runtime.typeDescriptorsEqual.call(fr, valtd, tytd)[0] - okval = newValue(tyequal, types.Typ[types.Bool]) - tyequal = fr.builder.CreateTrunc(tyequal, llvm.Int1Type(), "") - - v = fr.getInterfaceValueOrNull(tyequal, val, ty) - } - return -} - -func (fr *frame) interfaceTypeAssert(val *govalue, ty types.Type) *govalue { - if _, ok := ty.Underlying().(*types.Interface); ok { - return fr.changeInterface(val, ty, true) - } else { - valtytd := fr.types.ToRuntime(val.Type()) - valtd := fr.getInterfaceTypeDescriptor(val) - tytd := fr.types.ToRuntime(ty) - fr.runtime.checkInterfaceType.call(fr, valtd, tytd, valtytd) - - return fr.getInterfaceValue(val, ty) - } -} - -// convertI2E converts a non-empty interface value to an empty interface. -func (fr *frame) convertI2E(v *govalue) *govalue { - td := fr.getInterfaceTypeDescriptor(v) - val := fr.builder.CreateExtractValue(v.value, 1, "") - - typ := types.NewInterface(nil, nil) - intf := llvm.Undef(fr.types.ToLLVM(typ)) - intf = fr.builder.CreateInsertValue(intf, td, 0, "") - intf = fr.builder.CreateInsertValue(intf, val, 1, "") - return newValue(intf, typ) -} - -func (fr *frame) changeInterface(v *govalue, ty types.Type, assert bool) *govalue { - td := fr.getInterfaceTypeDescriptor(v) - tytd := fr.types.ToRuntime(ty) - var itab llvm.Value - if assert { - itab = fr.runtime.assertInterface.call(fr, tytd, td)[0] - } else { - itab = fr.runtime.convertInterface.call(fr, tytd, td)[0] - } - val := fr.builder.CreateExtractValue(v.value, 1, "") - - intf := llvm.Undef(fr.types.ToLLVM(ty)) - intf = fr.builder.CreateInsertValue(intf, itab, 0, "") - intf = fr.builder.CreateInsertValue(intf, val, 1, "") - return newValue(intf, ty) -} diff --git a/llgo/irgen/maps.go b/llgo/irgen/maps.go deleted file mode 100644 index b694bdedebbd..000000000000 --- a/llgo/irgen/maps.go +++ /dev/null @@ -1,153 +0,0 @@ -//===- maps.go - IR generation for maps -----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for maps. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// makeMap implements make(maptype[, initial space]) -func (fr *frame) makeMap(typ types.Type, cap_ *govalue) *govalue { - // TODO(pcc): call __go_new_map_big here if needed - dyntyp := fr.types.getMapDescriptorPointer(typ) - dyntyp = fr.builder.CreateBitCast(dyntyp, llvm.PointerType(llvm.Int8Type(), 0), "") - var cap llvm.Value - if cap_ != nil { - cap = fr.convert(cap_, types.Typ[types.Uintptr]).value - } else { - cap = llvm.ConstNull(fr.types.inttype) - } - m := fr.runtime.newMap.call(fr, dyntyp, cap) - return newValue(m[0], typ) -} - -// mapLookup implements v[, ok] = m[k] -func (fr *frame) mapLookup(m, k *govalue) (v *govalue, ok *govalue) { - llk := k.value - pk := fr.allocaBuilder.CreateAlloca(llk.Type(), "") - fr.builder.CreateStore(llk, pk) - valptr := fr.runtime.mapIndex.call(fr, m.value, pk, boolLLVMValue(false))[0] - valptr.AddInstrAttribute(2, llvm.NoCaptureAttribute) - valptr.AddInstrAttribute(2, llvm.ReadOnlyAttribute) - okbit := fr.builder.CreateIsNotNull(valptr, "") - - elemtyp := m.Type().Underlying().(*types.Map).Elem() - ok = newValue(fr.builder.CreateZExt(okbit, llvm.Int8Type(), ""), types.Typ[types.Bool]) - v = fr.loadOrNull(okbit, valptr, elemtyp) - return -} - -// mapUpdate implements m[k] = v -func (fr *frame) mapUpdate(m, k, v *govalue) { - llk := k.value - pk := fr.allocaBuilder.CreateAlloca(llk.Type(), "") - fr.builder.CreateStore(llk, pk) - valptr := fr.runtime.mapIndex.call(fr, m.value, pk, boolLLVMValue(true))[0] - valptr.AddInstrAttribute(2, llvm.NoCaptureAttribute) - valptr.AddInstrAttribute(2, llvm.ReadOnlyAttribute) - - elemtyp := m.Type().Underlying().(*types.Map).Elem() - llelemtyp := fr.types.ToLLVM(elemtyp) - typedvalptr := fr.builder.CreateBitCast(valptr, llvm.PointerType(llelemtyp, 0), "") - fr.builder.CreateStore(v.value, typedvalptr) -} - -// mapDelete implements delete(m, k) -func (fr *frame) mapDelete(m, k *govalue) { - llk := k.value - pk := fr.allocaBuilder.CreateAlloca(llk.Type(), "") - fr.builder.CreateStore(llk, pk) - fr.runtime.mapdelete.call(fr, m.value, pk) -} - -// mapIterInit creates a map iterator -func (fr *frame) mapIterInit(m *govalue) []*govalue { - // We represent an iterator as a tuple (map, *bool). The second element - // controls whether the code we generate for "next" (below) calls the - // runtime function for the first or the next element. We let the - // optimizer reorganize this into something more sensible. - isinit := fr.allocaBuilder.CreateAlloca(llvm.Int1Type(), "") - fr.builder.CreateStore(llvm.ConstNull(llvm.Int1Type()), isinit) - - return []*govalue{m, newValue(isinit, types.NewPointer(types.Typ[types.Bool]))} -} - -// mapIterNext advances the iterator, and returns the tuple (ok, k, v). -func (fr *frame) mapIterNext(iter []*govalue) []*govalue { - maptyp := iter[0].Type().Underlying().(*types.Map) - ktyp := maptyp.Key() - klltyp := fr.types.ToLLVM(ktyp) - vtyp := maptyp.Elem() - vlltyp := fr.types.ToLLVM(vtyp) - - m, isinitptr := iter[0], iter[1] - - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - mapiterbufty := llvm.ArrayType(i8ptr, 4) - mapiterbuf := fr.allocaBuilder.CreateAlloca(mapiterbufty, "") - mapiterbufelem0ptr := fr.builder.CreateStructGEP(mapiterbuf, 0, "") - - keybuf := fr.allocaBuilder.CreateAlloca(klltyp, "") - keyptr := fr.builder.CreateBitCast(keybuf, i8ptr, "") - valbuf := fr.allocaBuilder.CreateAlloca(vlltyp, "") - valptr := fr.builder.CreateBitCast(valbuf, i8ptr, "") - - isinit := fr.builder.CreateLoad(isinitptr.value, "") - - initbb := llvm.AddBasicBlock(fr.function, "") - nextbb := llvm.AddBasicBlock(fr.function, "") - contbb := llvm.AddBasicBlock(fr.function, "") - - fr.builder.CreateCondBr(isinit, nextbb, initbb) - - fr.builder.SetInsertPointAtEnd(initbb) - fr.builder.CreateStore(llvm.ConstAllOnes(llvm.Int1Type()), isinitptr.value) - fr.runtime.mapiterinit.call(fr, m.value, mapiterbufelem0ptr) - fr.builder.CreateBr(contbb) - - fr.builder.SetInsertPointAtEnd(nextbb) - fr.runtime.mapiternext.call(fr, mapiterbufelem0ptr) - fr.builder.CreateBr(contbb) - - fr.builder.SetInsertPointAtEnd(contbb) - mapiterbufelem0 := fr.builder.CreateLoad(mapiterbufelem0ptr, "") - okbit := fr.builder.CreateIsNotNull(mapiterbufelem0, "") - ok := fr.builder.CreateZExt(okbit, llvm.Int8Type(), "") - - loadbb := llvm.AddBasicBlock(fr.function, "") - cont2bb := llvm.AddBasicBlock(fr.function, "") - fr.builder.CreateCondBr(okbit, loadbb, cont2bb) - - fr.builder.SetInsertPointAtEnd(loadbb) - fr.runtime.mapiter2.call(fr, mapiterbufelem0ptr, keyptr, valptr) - loadbb = fr.builder.GetInsertBlock() - loadedkey := fr.builder.CreateLoad(keybuf, "") - loadedval := fr.builder.CreateLoad(valbuf, "") - fr.builder.CreateBr(cont2bb) - - fr.builder.SetInsertPointAtEnd(cont2bb) - k := fr.builder.CreatePHI(klltyp, "") - k.AddIncoming( - []llvm.Value{llvm.ConstNull(klltyp), loadedkey}, - []llvm.BasicBlock{contbb, loadbb}, - ) - v := fr.builder.CreatePHI(vlltyp, "") - v.AddIncoming( - []llvm.Value{llvm.ConstNull(vlltyp), loadedval}, - []llvm.BasicBlock{contbb, loadbb}, - ) - - return []*govalue{newValue(ok, types.Typ[types.Bool]), newValue(k, ktyp), newValue(v, vtyp)} -} diff --git a/llgo/irgen/predicates.go b/llgo/irgen/predicates.go deleted file mode 100644 index 2ef133647e1d..000000000000 --- a/llgo/irgen/predicates.go +++ /dev/null @@ -1,58 +0,0 @@ -//===- predicates.go - type predicates ------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements commonly used type predicates. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" -) - -func isBoolean(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsBoolean != 0 -} - -func isInteger(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsInteger != 0 -} - -func isUnsigned(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsUnsigned != 0 -} - -func isFloat(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsFloat != 0 -} - -func isComplex(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsComplex != 0 -} - -func isString(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsString != 0 -} - -func isUntyped(typ types.Type) bool { - t, ok := typ.Underlying().(*types.Basic) - return ok && t.Info()&types.IsUntyped != 0 -} - -func isSlice(typ types.Type, bkind types.BasicKind) bool { - t, ok := typ.Underlying().(*types.Slice) - return ok && types.Identical(t.Elem().Underlying(), types.Typ[bkind]) -} diff --git a/llgo/irgen/println.go b/llgo/irgen/println.go deleted file mode 100644 index 2d4e42cffced..000000000000 --- a/llgo/irgen/println.go +++ /dev/null @@ -1,93 +0,0 @@ -//===- println.go - IR generation for print and println -------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for the print and println built-in -// functions. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "fmt" - - "llvm.org/llgo/third_party/gotools/go/types" -) - -func (fr *frame) printValues(println_ bool, values ...*govalue) { - for i, value := range values { - llvm_value := value.value - - typ := value.Type().Underlying() - if name, isname := typ.(*types.Named); isname { - typ = name.Underlying() - } - - if println_ && i > 0 { - fr.runtime.printSpace.call(fr) - } - switch typ := typ.(type) { - case *types.Basic: - switch typ.Kind() { - case types.Uint8, types.Uint16, types.Uint32, types.Uintptr, types.Uint, types.Uint64: - i64 := fr.llvmtypes.ctx.Int64Type() - zext := fr.builder.CreateZExt(llvm_value, i64, "") - fr.runtime.printUint64.call(fr, zext) - - case types.Int, types.Int8, types.Int16, types.Int32, types.Int64: - i64 := fr.llvmtypes.ctx.Int64Type() - sext := fr.builder.CreateSExt(llvm_value, i64, "") - fr.runtime.printInt64.call(fr, sext) - - case types.Float32: - llvm_value = fr.builder.CreateFPExt(llvm_value, fr.llvmtypes.ctx.DoubleType(), "") - fallthrough - case types.Float64: - fr.runtime.printDouble.call(fr, llvm_value) - - case types.Complex64: - llvm_value = fr.convert(value, types.Typ[types.Complex128]).value - fallthrough - case types.Complex128: - fr.runtime.printComplex.call(fr, llvm_value) - - case types.String, types.UntypedString: - fr.runtime.printString.call(fr, llvm_value) - - case types.Bool: - fr.runtime.printBool.call(fr, llvm_value) - - case types.UnsafePointer: - fr.runtime.printPointer.call(fr, llvm_value) - - default: - panic(fmt.Sprint("Unhandled Basic Kind: ", typ.Kind)) - } - - case *types.Interface: - if typ.Empty() { - fr.runtime.printEmptyInterface.call(fr, llvm_value) - } else { - fr.runtime.printInterface.call(fr, llvm_value) - } - - case *types.Slice: - fr.runtime.printSlice.call(fr, llvm_value) - - case *types.Pointer, *types.Map, *types.Chan, *types.Signature: - fr.runtime.printPointer.call(fr, llvm_value) - - default: - panic(fmt.Sprintf("Unhandled type kind: %s (%T)", typ, typ)) - } - } - if println_ { - fr.runtime.printNl.call(fr) - } -} diff --git a/llgo/irgen/runtime.go b/llgo/irgen/runtime.go deleted file mode 100644 index 6e131ce23afd..000000000000 --- a/llgo/irgen/runtime.go +++ /dev/null @@ -1,607 +0,0 @@ -//===- runtime.go - IR generation for runtime calls -----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for calls to the runtime library. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "strconv" - - "llvm.org/llgo/third_party/gotools/go/types" - - "llvm.org/llvm/bindings/go/llvm" -) - -type runtimeFnInfo struct { - fi *functionTypeInfo - fn llvm.Value -} - -func (rfi *runtimeFnInfo) init(tm *llvmTypeMap, m llvm.Module, name string, args []types.Type, results []types.Type) { - rfi.fi = new(functionTypeInfo) - *rfi.fi = tm.getFunctionTypeInfo(args, results) - rfi.fn = rfi.fi.declare(m, name) -} - -func (rfi *runtimeFnInfo) call(f *frame, args ...llvm.Value) []llvm.Value { - if f.unwindBlock.IsNil() { - return rfi.callOnly(f, args...) - } else { - return rfi.invoke(f, f.unwindBlock, args...) - } -} - -func (rfi *runtimeFnInfo) callOnly(f *frame, args ...llvm.Value) []llvm.Value { - return rfi.fi.call(f.llvmtypes.ctx, f.allocaBuilder, f.builder, rfi.fn, llvm.Value{nil}, args) -} - -func (rfi *runtimeFnInfo) invoke(f *frame, lpad llvm.BasicBlock, args ...llvm.Value) []llvm.Value { - contbb := llvm.AddBasicBlock(f.function, "") - return rfi.fi.invoke(f.llvmtypes.ctx, f.allocaBuilder, f.builder, rfi.fn, llvm.Value{nil}, args, contbb, lpad) -} - -// runtimeInterface is a struct containing references to -// runtime types and intrinsic function declarations. -type runtimeInterface struct { - // LLVM intrinsics - memcpy, - memset, - returnaddress llvm.Value - - // Exception handling support - gccgoPersonality llvm.Value - gccgoExceptionType llvm.Type - - // Runtime intrinsics - append, - assertInterface, - byteArrayToString, - canRecover, - chanCap, - chanLen, - chanrecv2, - checkDefer, - checkInterfaceType, - builtinClose, - convertInterface, - copy, - Defer, - deferredRecover, - emptyInterfaceCompare, - Go, - ifaceE2I2, - ifaceI2I2, - intArrayToString, - interfaceCompare, - intToString, - makeSlice, - mapdelete, - mapiter2, - mapiterinit, - mapiternext, - mapIndex, - mapLen, - New, - newChannel, - newMap, - newSelect, - panic, - printBool, - printComplex, - printDouble, - printEmptyInterface, - printInterface, - printInt64, - printNl, - printPointer, - printSlice, - printSpace, - printString, - printUint64, - receive, - recover, - registerGcRoots, - runtimeError, - selectdefault, - selectrecv2, - selectsend, - selectgo, - sendBig, - setDeferRetaddr, - strcmp, - stringiter2, - stringPlus, - stringSlice, - stringToByteArray, - stringToIntArray, - typeDescriptorsEqual, - undefer runtimeFnInfo -} - -func newRuntimeInterface(module llvm.Module, tm *llvmTypeMap) (*runtimeInterface, error) { - var ri runtimeInterface - - Bool := types.Typ[types.Bool] - Complex128 := types.Typ[types.Complex128] - Float64 := types.Typ[types.Float64] - Int32 := types.Typ[types.Int32] - Int64 := types.Typ[types.Int64] - Int := types.Typ[types.Int] - Rune := types.Typ[types.Rune] - String := types.Typ[types.String] - Uintptr := types.Typ[types.Uintptr] - UnsafePointer := types.Typ[types.UnsafePointer] - - EmptyInterface := types.NewInterface(nil, nil) - ByteSlice := types.NewSlice(types.Typ[types.Byte]) - IntSlice := types.NewSlice(types.Typ[types.Int]) - - for _, rt := range [...]struct { - name string - rfi *runtimeFnInfo - args, res []types.Type - attrs []llvm.Attribute - }{ - { - name: "__go_append", - rfi: &ri.append, - args: []types.Type{IntSlice, UnsafePointer, Uintptr, Uintptr}, - res: []types.Type{IntSlice}, - }, - { - name: "__go_assert_interface", - rfi: &ri.assertInterface, - args: []types.Type{UnsafePointer, UnsafePointer}, - res: []types.Type{UnsafePointer}, - }, - { - name: "__go_byte_array_to_string", - rfi: &ri.byteArrayToString, - args: []types.Type{UnsafePointer, Int}, - res: []types.Type{String}, - attrs: []llvm.Attribute{llvm.NoUnwindAttribute}, - }, - { - name: "__go_can_recover", - rfi: &ri.canRecover, - args: []types.Type{UnsafePointer}, - res: []types.Type{Bool}, - }, - { - name: "__go_chan_cap", - rfi: &ri.chanCap, - args: []types.Type{UnsafePointer}, - res: []types.Type{Int}, - }, - { - name: "__go_chan_len", - rfi: &ri.chanLen, - args: []types.Type{UnsafePointer}, - res: []types.Type{Int}, - }, - { - name: "runtime.chanrecv2", - rfi: &ri.chanrecv2, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - res: []types.Type{Bool}, - }, - { - name: "__go_check_defer", - rfi: &ri.checkDefer, - args: []types.Type{UnsafePointer}, - }, - { - name: "__go_check_interface_type", - rfi: &ri.checkInterfaceType, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - }, - { - name: "__go_builtin_close", - rfi: &ri.builtinClose, - args: []types.Type{UnsafePointer}, - }, - { - name: "__go_convert_interface", - rfi: &ri.convertInterface, - args: []types.Type{UnsafePointer, UnsafePointer}, - res: []types.Type{UnsafePointer}, - }, - { - name: "__go_copy", - rfi: &ri.copy, - args: []types.Type{UnsafePointer, UnsafePointer, Uintptr}, - }, - { - name: "__go_defer", - rfi: &ri.Defer, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - }, - { - name: "__go_deferred_recover", - rfi: &ri.deferredRecover, - res: []types.Type{EmptyInterface}, - }, - { - name: "__go_empty_interface_compare", - rfi: &ri.emptyInterfaceCompare, - args: []types.Type{EmptyInterface, EmptyInterface}, - res: []types.Type{Int}, - }, - { - name: "__go_go", - rfi: &ri.Go, - args: []types.Type{UnsafePointer, UnsafePointer}, - }, - { - name: "runtime.ifaceE2I2", - rfi: &ri.ifaceE2I2, - args: []types.Type{UnsafePointer, EmptyInterface}, - res: []types.Type{EmptyInterface, Bool}, - }, - { - name: "runtime.ifaceI2I2", - rfi: &ri.ifaceI2I2, - args: []types.Type{UnsafePointer, EmptyInterface}, - res: []types.Type{EmptyInterface, Bool}, - }, - { - name: "__go_int_array_to_string", - rfi: &ri.intArrayToString, - args: []types.Type{UnsafePointer, Int}, - res: []types.Type{String}, - }, - { - name: "__go_int_to_string", - rfi: &ri.intToString, - args: []types.Type{Int}, - res: []types.Type{String}, - }, - { - name: "__go_interface_compare", - rfi: &ri.interfaceCompare, - args: []types.Type{EmptyInterface, EmptyInterface}, - res: []types.Type{Int}, - }, - { - name: "__go_make_slice2", - rfi: &ri.makeSlice, - args: []types.Type{UnsafePointer, Uintptr, Uintptr}, - res: []types.Type{IntSlice}, - }, - { - name: "runtime.mapdelete", - rfi: &ri.mapdelete, - args: []types.Type{UnsafePointer, UnsafePointer}, - }, - { - name: "runtime.mapiter2", - rfi: &ri.mapiter2, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - }, - { - name: "runtime.mapiterinit", - rfi: &ri.mapiterinit, - args: []types.Type{UnsafePointer, UnsafePointer}, - }, - { - name: "runtime.mapiternext", - rfi: &ri.mapiternext, - args: []types.Type{UnsafePointer}, - }, - { - name: "__go_map_index", - rfi: &ri.mapIndex, - args: []types.Type{UnsafePointer, UnsafePointer, Bool}, - res: []types.Type{UnsafePointer}, - }, - { - name: "__go_map_len", - rfi: &ri.mapLen, - args: []types.Type{UnsafePointer}, - res: []types.Type{Int}, - }, - { - name: "__go_new", - rfi: &ri.New, - args: []types.Type{UnsafePointer, Uintptr}, - res: []types.Type{UnsafePointer}, - attrs: []llvm.Attribute{llvm.NoUnwindAttribute}, - }, - { - name: "__go_new_channel", - rfi: &ri.newChannel, - args: []types.Type{UnsafePointer, Uintptr}, - res: []types.Type{UnsafePointer}, - }, - { - name: "__go_new_map", - rfi: &ri.newMap, - args: []types.Type{UnsafePointer, Uintptr}, - res: []types.Type{UnsafePointer}, - }, - { - name: "runtime.newselect", - rfi: &ri.newSelect, - args: []types.Type{Int32}, - res: []types.Type{UnsafePointer}, - }, - { - name: "__go_panic", - rfi: &ri.panic, - args: []types.Type{EmptyInterface}, - attrs: []llvm.Attribute{llvm.NoReturnAttribute}, - }, - { - name: "__go_print_bool", - rfi: &ri.printBool, - args: []types.Type{Bool}, - }, - { - name: "__go_print_complex", - rfi: &ri.printComplex, - args: []types.Type{Complex128}, - }, - { - name: "__go_print_double", - rfi: &ri.printDouble, - args: []types.Type{Float64}, - }, - { - name: "__go_print_empty_interface", - rfi: &ri.printEmptyInterface, - args: []types.Type{EmptyInterface}, - }, - { - name: "__go_print_interface", - rfi: &ri.printInterface, - args: []types.Type{EmptyInterface}, - }, - { - name: "__go_print_int64", - rfi: &ri.printInt64, - args: []types.Type{Int64}, - }, - { - name: "__go_print_nl", - rfi: &ri.printNl, - }, - { - name: "__go_print_pointer", - rfi: &ri.printPointer, - args: []types.Type{UnsafePointer}, - }, - { - name: "__go_print_slice", - rfi: &ri.printSlice, - args: []types.Type{IntSlice}, - }, - { - name: "__go_print_space", - rfi: &ri.printSpace, - }, - { - name: "__go_print_string", - rfi: &ri.printString, - args: []types.Type{String}, - }, - { - name: "__go_print_uint64", - rfi: &ri.printUint64, - args: []types.Type{Int64}, - }, - { - name: "__go_receive", - rfi: &ri.receive, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - }, - { - name: "__go_recover", - rfi: &ri.recover, - res: []types.Type{EmptyInterface}, - }, - { - name: "__go_register_gc_roots", - rfi: &ri.registerGcRoots, - args: []types.Type{UnsafePointer}, - }, - { - name: "__go_runtime_error", - rfi: &ri.runtimeError, - args: []types.Type{Int32}, - attrs: []llvm.Attribute{llvm.NoReturnAttribute}, - }, - { - name: "runtime.selectdefault", - rfi: &ri.selectdefault, - args: []types.Type{UnsafePointer, Int32}, - }, - { - name: "runtime.selectgo", - rfi: &ri.selectgo, - args: []types.Type{UnsafePointer}, - res: []types.Type{Int}, - }, - { - name: "runtime.selectrecv2", - rfi: &ri.selectrecv2, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer, UnsafePointer, Int32}, - }, - { - name: "runtime.selectsend", - rfi: &ri.selectsend, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer, Int32}, - }, - { - name: "__go_send_big", - rfi: &ri.sendBig, - args: []types.Type{UnsafePointer, UnsafePointer, UnsafePointer}, - }, - { - name: "__go_set_defer_retaddr", - rfi: &ri.setDeferRetaddr, - args: []types.Type{UnsafePointer}, - res: []types.Type{Bool}, - }, - { - name: "__go_strcmp", - rfi: &ri.strcmp, - args: []types.Type{String, String}, - res: []types.Type{Int}, - }, - { - name: "__go_string_plus", - rfi: &ri.stringPlus, - args: []types.Type{String, String}, - res: []types.Type{String}, - }, - { - name: "__go_string_slice", - rfi: &ri.stringSlice, - args: []types.Type{String, Int, Int}, - res: []types.Type{String}, - }, - { - name: "__go_string_to_byte_array", - rfi: &ri.stringToByteArray, - args: []types.Type{String}, - res: []types.Type{ByteSlice}, - attrs: []llvm.Attribute{llvm.NoUnwindAttribute}, - }, - { - name: "__go_string_to_int_array", - rfi: &ri.stringToIntArray, - args: []types.Type{String}, - res: []types.Type{IntSlice}, - }, - { - name: "runtime.stringiter2", - rfi: &ri.stringiter2, - args: []types.Type{String, Int}, - res: []types.Type{Int, Rune}, - }, - { - name: "__go_type_descriptors_equal", - rfi: &ri.typeDescriptorsEqual, - args: []types.Type{UnsafePointer, UnsafePointer}, - res: []types.Type{Bool}, - }, - { - name: "__go_undefer", - rfi: &ri.undefer, - args: []types.Type{UnsafePointer}, - }, - } { - rt.rfi.init(tm, module, rt.name, rt.args, rt.res) - for _, attr := range rt.attrs { - rt.rfi.fn.AddFunctionAttr(attr) - } - } - - memsetName := "llvm.memset.p0i8.i" + strconv.Itoa(tm.target.IntPtrType().IntTypeWidth()) - memsetType := llvm.FunctionType( - llvm.VoidType(), - []llvm.Type{ - llvm.PointerType(llvm.Int8Type(), 0), - llvm.Int8Type(), - tm.target.IntPtrType(), - llvm.Int32Type(), - llvm.Int1Type(), - }, - false, - ) - ri.memset = llvm.AddFunction(module, memsetName, memsetType) - - memcpyName := "llvm.memcpy.p0i8.p0i8.i" + strconv.Itoa(tm.target.IntPtrType().IntTypeWidth()) - memcpyType := llvm.FunctionType( - llvm.VoidType(), - []llvm.Type{ - llvm.PointerType(llvm.Int8Type(), 0), - llvm.PointerType(llvm.Int8Type(), 0), - tm.target.IntPtrType(), - llvm.Int32Type(), - llvm.Int1Type(), - }, - false, - ) - ri.memcpy = llvm.AddFunction(module, memcpyName, memcpyType) - - returnaddressType := llvm.FunctionType( - llvm.PointerType(llvm.Int8Type(), 0), - []llvm.Type{llvm.Int32Type()}, - false, - ) - ri.returnaddress = llvm.AddFunction(module, "llvm.returnaddress", returnaddressType) - - gccgoPersonalityType := llvm.FunctionType( - llvm.Int32Type(), - []llvm.Type{ - llvm.Int32Type(), - llvm.Int64Type(), - llvm.PointerType(llvm.Int8Type(), 0), - llvm.PointerType(llvm.Int8Type(), 0), - }, - false, - ) - ri.gccgoPersonality = llvm.AddFunction(module, "__gccgo_personality_v0", gccgoPersonalityType) - - ri.gccgoExceptionType = llvm.StructType( - []llvm.Type{ - llvm.PointerType(llvm.Int8Type(), 0), - llvm.Int32Type(), - }, - false, - ) - - return &ri, nil -} - -func (fr *frame) createZExtOrTrunc(v llvm.Value, t llvm.Type, name string) llvm.Value { - switch n := v.Type().IntTypeWidth() - t.IntTypeWidth(); { - case n < 0: - v = fr.builder.CreateZExt(v, fr.target.IntPtrType(), name) - case n > 0: - v = fr.builder.CreateTrunc(v, fr.target.IntPtrType(), name) - } - return v -} - -func (fr *frame) createTypeMalloc(t types.Type) llvm.Value { - size := llvm.ConstInt(fr.target.IntPtrType(), uint64(fr.llvmtypes.Sizeof(t)), false) - malloc := fr.runtime.New.callOnly(fr, fr.types.ToRuntime(t), size)[0] - return fr.builder.CreateBitCast(malloc, llvm.PointerType(fr.types.ToLLVM(t), 0), "") -} - -func (fr *frame) memsetZero(ptr llvm.Value, size llvm.Value) { - memset := fr.runtime.memset - ptr = fr.builder.CreateBitCast(ptr, llvm.PointerType(llvm.Int8Type(), 0), "") - fill := llvm.ConstNull(llvm.Int8Type()) - size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "") - align := llvm.ConstInt(llvm.Int32Type(), 1, false) - isvolatile := llvm.ConstNull(llvm.Int1Type()) - fr.builder.CreateCall(memset, []llvm.Value{ptr, fill, size, align, isvolatile}, "") -} - -func (fr *frame) memcpy(dest llvm.Value, src llvm.Value, size llvm.Value) { - memcpy := fr.runtime.memcpy - dest = fr.builder.CreateBitCast(dest, llvm.PointerType(llvm.Int8Type(), 0), "") - src = fr.builder.CreateBitCast(src, llvm.PointerType(llvm.Int8Type(), 0), "") - size = fr.createZExtOrTrunc(size, fr.target.IntPtrType(), "") - align := llvm.ConstInt(llvm.Int32Type(), 1, false) - isvolatile := llvm.ConstNull(llvm.Int1Type()) - fr.builder.CreateCall(memcpy, []llvm.Value{dest, src, size, align, isvolatile}, "") -} - -func (fr *frame) returnAddress(level uint64) llvm.Value { - returnaddress := fr.runtime.returnaddress - levelValue := llvm.ConstInt(llvm.Int32Type(), level, false) - return fr.builder.CreateCall(returnaddress, []llvm.Value{levelValue}, "") -} diff --git a/llgo/irgen/slice.go b/llgo/irgen/slice.go deleted file mode 100644 index 49cde636b38f..000000000000 --- a/llgo/irgen/slice.go +++ /dev/null @@ -1,106 +0,0 @@ -//===- slice.go - IR generation for slices --------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for slices. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// makeSlice allocates a new slice with the optional length and capacity, -// initialising its contents to their zero values. -func (fr *frame) makeSlice(sliceType types.Type, length, capacity *govalue) *govalue { - length = fr.convert(length, types.Typ[types.Uintptr]) - capacity = fr.convert(capacity, types.Typ[types.Uintptr]) - runtimeType := fr.types.ToRuntime(sliceType) - llslice := fr.runtime.makeSlice.call(fr, runtimeType, length.value, capacity.value) - return newValue(llslice[0], sliceType) -} - -func (fr *frame) slice(x llvm.Value, xtyp types.Type, low, high, max llvm.Value) llvm.Value { - if !low.IsNil() { - low = fr.createZExtOrTrunc(low, fr.types.inttype, "") - } else { - low = llvm.ConstNull(fr.types.inttype) - } - if !high.IsNil() { - high = fr.createZExtOrTrunc(high, fr.types.inttype, "") - } - if !max.IsNil() { - max = fr.createZExtOrTrunc(max, fr.types.inttype, "") - } - - var arrayptr, arraylen, arraycap llvm.Value - var elemtyp types.Type - var errcode uint64 - switch typ := xtyp.Underlying().(type) { - case *types.Pointer: // *array - errcode = gccgoRuntimeErrorARRAY_SLICE_OUT_OF_BOUNDS - arraytyp := typ.Elem().Underlying().(*types.Array) - elemtyp = arraytyp.Elem() - arrayptr = x - arrayptr = fr.builder.CreateBitCast(arrayptr, llvm.PointerType(llvm.Int8Type(), 0), "") - arraylen = llvm.ConstInt(fr.llvmtypes.inttype, uint64(arraytyp.Len()), false) - arraycap = arraylen - case *types.Slice: - errcode = gccgoRuntimeErrorSLICE_SLICE_OUT_OF_BOUNDS - elemtyp = typ.Elem() - arrayptr = fr.builder.CreateExtractValue(x, 0, "") - arraylen = fr.builder.CreateExtractValue(x, 1, "") - arraycap = fr.builder.CreateExtractValue(x, 2, "") - case *types.Basic: - if high.IsNil() { - high = llvm.ConstAllOnes(fr.types.inttype) // -1 - } - result := fr.runtime.stringSlice.call(fr, x, low, high) - return result[0] - default: - panic("unimplemented") - } - if high.IsNil() { - high = arraylen - } - if max.IsNil() { - max = arraycap - } - - // Bounds checking: 0 <= low <= high <= max <= cap - zero := llvm.ConstNull(fr.types.inttype) - l0 := fr.builder.CreateICmp(llvm.IntSLT, low, zero, "") - hl := fr.builder.CreateICmp(llvm.IntSLT, high, low, "") - mh := fr.builder.CreateICmp(llvm.IntSLT, max, high, "") - cm := fr.builder.CreateICmp(llvm.IntSLT, arraycap, max, "") - - cond := fr.builder.CreateOr(l0, hl, "") - cond = fr.builder.CreateOr(cond, mh, "") - cond = fr.builder.CreateOr(cond, cm, "") - - fr.condBrRuntimeError(cond, errcode) - - slicelen := fr.builder.CreateSub(high, low, "") - slicecap := fr.builder.CreateSub(max, low, "") - - elemsize := llvm.ConstInt(fr.llvmtypes.inttype, uint64(fr.llvmtypes.Sizeof(elemtyp)), false) - offset := fr.builder.CreateMul(low, elemsize, "") - - sliceptr := fr.builder.CreateInBoundsGEP(arrayptr, []llvm.Value{offset}, "") - - llslicetyp := fr.llvmtypes.sliceBackendType().ToLLVM(fr.llvmtypes.ctx) - sliceValue := llvm.Undef(llslicetyp) - sliceValue = fr.builder.CreateInsertValue(sliceValue, sliceptr, 0, "") - sliceValue = fr.builder.CreateInsertValue(sliceValue, slicelen, 1, "") - sliceValue = fr.builder.CreateInsertValue(sliceValue, slicecap, 2, "") - - return sliceValue -} diff --git a/llgo/irgen/ssa.go b/llgo/irgen/ssa.go deleted file mode 100644 index 4c7b1a6c95c1..000000000000 --- a/llgo/irgen/ssa.go +++ /dev/null @@ -1,1341 +0,0 @@ -//===- ssa.go - IR generation from go/ssa ---------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the top-level LLVM IR generation from go/ssa form. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "fmt" - "go/ast" - "go/token" - "os" - "sort" - - "llvm.org/llgo/ssaopt" - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/ssa/ssautil" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// A globalInit is used to temporarily store a global's initializer until -// we are ready to build it. -type globalInit struct { - val llvm.Value - elems []globalInit -} - -func (gi *globalInit) update(typ llvm.Type, indices []uint32, val llvm.Value) { - if len(indices) == 0 { - gi.val = val - return - } - - if gi.val.C != nil { - gi.val = llvm.ConstInsertValue(gi.val, val, indices) - } - - tk := typ.TypeKind() - - if len(gi.elems) == 0 { - switch tk { - case llvm.StructTypeKind: - gi.elems = make([]globalInit, typ.StructElementTypesCount()) - case llvm.ArrayTypeKind: - gi.elems = make([]globalInit, typ.ArrayLength()) - default: - panic("unexpected type") - } - } - - var eltyp llvm.Type - switch tk { - case llvm.StructTypeKind: - eltyp = typ.StructElementTypes()[indices[0]] - case llvm.ArrayTypeKind: - eltyp = typ.ElementType() - default: - panic("unexpected type") - } - - gi.elems[indices[0]].update(eltyp, indices[1:], val) -} - -func (gi *globalInit) build(typ llvm.Type) llvm.Value { - if gi.val.C != nil { - return gi.val - } - if len(gi.elems) == 0 { - return llvm.ConstNull(typ) - } - - switch typ.TypeKind() { - case llvm.StructTypeKind: - eltypes := typ.StructElementTypes() - elems := make([]llvm.Value, len(eltypes)) - for i, eltyp := range eltypes { - elems[i] = gi.elems[i].build(eltyp) - } - return llvm.ConstStruct(elems, false) - case llvm.ArrayTypeKind: - eltyp := typ.ElementType() - elems := make([]llvm.Value, len(gi.elems)) - for i := range gi.elems { - elems[i] = gi.elems[i].build(eltyp) - } - return llvm.ConstArray(eltyp, elems) - default: - panic("unexpected type") - } -} - -type unit struct { - *compiler - pkg *ssa.Package - globals map[ssa.Value]llvm.Value - globalInits map[llvm.Value]*globalInit - - // funcDescriptors maps *ssa.Functions to function descriptors, - // the first-class representation of functions. - funcDescriptors map[*ssa.Function]llvm.Value - - // undefinedFuncs contains functions that have been resolved - // (declared) but not defined. - undefinedFuncs map[*ssa.Function]bool - - gcRoots []llvm.Value -} - -func newUnit(c *compiler, pkg *ssa.Package) *unit { - u := &unit{ - compiler: c, - pkg: pkg, - globals: make(map[ssa.Value]llvm.Value), - globalInits: make(map[llvm.Value]*globalInit), - funcDescriptors: make(map[*ssa.Function]llvm.Value), - undefinedFuncs: make(map[*ssa.Function]bool), - } - return u -} - -type byMemberName []ssa.Member - -func (ms byMemberName) Len() int { return len(ms) } -func (ms byMemberName) Swap(i, j int) { - ms[i], ms[j] = ms[j], ms[i] -} -func (ms byMemberName) Less(i, j int) bool { - return ms[i].Name() < ms[j].Name() -} - -type byFunctionString []*ssa.Function - -func (fns byFunctionString) Len() int { return len(fns) } -func (fns byFunctionString) Swap(i, j int) { - fns[i], fns[j] = fns[j], fns[i] -} -func (fns byFunctionString) Less(i, j int) bool { - return fns[i].String() < fns[j].String() -} - -// Emit functions in order of their fully qualified names. This is so that a -// bootstrap build can be verified by comparing the stage2 and stage3 binaries. -func (u *unit) defineFunctionsInOrder(functions map[*ssa.Function]bool) { - fns := []*ssa.Function{} - for f, _ := range functions { - fns = append(fns, f) - } - sort.Sort(byFunctionString(fns)) - for _, f := range fns { - u.defineFunction(f) - } -} - -// translatePackage translates an *ssa.Package into an LLVM module, and returns -// the translation unit information. -func (u *unit) translatePackage(pkg *ssa.Package) { - ms := make([]ssa.Member, len(pkg.Members)) - i := 0 - for _, m := range pkg.Members { - ms[i] = m - i++ - } - - sort.Sort(byMemberName(ms)) - - // Initialize global storage and type descriptors for this package. - // We must create globals regardless of whether they're referenced, - // hence the duplication in frame.value. - for _, m := range ms { - switch v := m.(type) { - case *ssa.Global: - elemtyp := deref(v.Type()) - llelemtyp := u.llvmtypes.ToLLVM(elemtyp) - vname := u.types.mc.mangleGlobalName(v) - global := llvm.AddGlobal(u.module.Module, llelemtyp, vname) - if !v.Object().Exported() { - global.SetLinkage(llvm.InternalLinkage) - } - u.addGlobal(global, elemtyp) - global = llvm.ConstBitCast(global, u.llvmtypes.ToLLVM(v.Type())) - u.globals[v] = global - case *ssa.Type: - u.types.getTypeDescriptorPointer(v.Type()) - } - } - - // Define functions. - u.defineFunctionsInOrder(ssautil.AllFunctions(pkg.Prog)) - - // Emit initializers for type descriptors, which may trigger - // the resolution of additional functions. - u.types.emitTypeDescInitializers() - - // Define remaining functions that were resolved during - // runtime type mapping, but not defined. - u.defineFunctionsInOrder(u.undefinedFuncs) - - // Set initializers for globals. - for global, init := range u.globalInits { - initval := init.build(global.Type().ElementType()) - global.SetInitializer(initval) - } -} - -func (u *unit) addGlobal(global llvm.Value, ty types.Type) { - u.globalInits[global] = new(globalInit) - - if hasPointers(ty) { - global = llvm.ConstBitCast(global, llvm.PointerType(llvm.Int8Type(), 0)) - size := llvm.ConstInt(u.types.inttype, uint64(u.types.Sizeof(ty)), false) - root := llvm.ConstStruct([]llvm.Value{global, size}, false) - u.gcRoots = append(u.gcRoots, root) - } -} - -// ResolveMethod implements MethodResolver.ResolveMethod. -func (u *unit) ResolveMethod(s *types.Selection) *govalue { - m := u.pkg.Prog.Method(s) - llfn := u.resolveFunctionGlobal(m) - llfn = llvm.ConstBitCast(llfn, llvm.PointerType(llvm.Int8Type(), 0)) - return newValue(llfn, m.Signature) -} - -// resolveFunctionDescriptorGlobal returns a reference to the LLVM global -// storing the function's descriptor. -func (u *unit) resolveFunctionDescriptorGlobal(f *ssa.Function) llvm.Value { - llfd, ok := u.funcDescriptors[f] - if !ok { - name := u.types.mc.mangleFunctionName(f) + "$descriptor" - llfd = llvm.AddGlobal(u.module.Module, llvm.PointerType(llvm.Int8Type(), 0), name) - llfd.SetGlobalConstant(true) - u.funcDescriptors[f] = llfd - } - return llfd -} - -// resolveFunctionDescriptor returns a function's -// first-class value representation. -func (u *unit) resolveFunctionDescriptor(f *ssa.Function) *govalue { - llfd := u.resolveFunctionDescriptorGlobal(f) - llfd = llvm.ConstBitCast(llfd, llvm.PointerType(llvm.Int8Type(), 0)) - return newValue(llfd, f.Signature) -} - -// resolveFunctionGlobal returns an llvm.Value for a function global. -func (u *unit) resolveFunctionGlobal(f *ssa.Function) llvm.Value { - if v, ok := u.globals[f]; ok { - return v - } - name := u.types.mc.mangleFunctionName(f) - // It's possible that the function already exists in the module; - // for example, if it's a runtime intrinsic that the compiler - // has already referenced. - llvmFunction := u.module.Module.NamedFunction(name) - if llvmFunction.IsNil() { - fti := u.llvmtypes.getSignatureInfo(f.Signature) - llvmFunction = fti.declare(u.module.Module, name) - u.undefinedFuncs[f] = true - } - u.globals[f] = llvmFunction - return llvmFunction -} - -func (u *unit) getFunctionLinkage(f *ssa.Function) llvm.Linkage { - switch { - case f.Pkg == nil: - // Synthetic functions outside packages may appear in multiple packages. - return llvm.LinkOnceODRLinkage - - case f.Parent() != nil: - // Anonymous. - return llvm.InternalLinkage - - case f.Signature.Recv() == nil && !ast.IsExported(f.Name()) && - !(f.Name() == "main" && f.Pkg.Object.Path() == "main") && - f.Name() != "init": - // Unexported methods may be referenced as part of an interface method - // table in another package. TODO(pcc): detect when this cannot happen. - return llvm.InternalLinkage - - default: - return llvm.ExternalLinkage - } -} - -func (u *unit) defineFunction(f *ssa.Function) { - // Only define functions from this package, or synthetic - // wrappers (which do not have a package). - if f.Pkg != nil && f.Pkg != u.pkg { - return - } - - llfn := u.resolveFunctionGlobal(f) - linkage := u.getFunctionLinkage(f) - - isMethod := f.Signature.Recv() != nil - - // Methods cannot be referred to via a descriptor. - if !isMethod { - llfd := u.resolveFunctionDescriptorGlobal(f) - llfd.SetInitializer(llvm.ConstBitCast(llfn, llvm.PointerType(llvm.Int8Type(), 0))) - llfd.SetLinkage(linkage) - } - - // We only need to emit a descriptor for functions without bodies. - if len(f.Blocks) == 0 { - return - } - - ssaopt.LowerAllocsToStack(f) - - if u.DumpSSA { - f.WriteTo(os.Stderr) - } - - fr := newFrame(u, llfn) - defer fr.dispose() - fr.addCommonFunctionAttrs(fr.function) - fr.function.SetLinkage(linkage) - - fr.logf("Define function: %s", f.String()) - fti := u.llvmtypes.getSignatureInfo(f.Signature) - delete(u.undefinedFuncs, f) - fr.retInf = fti.retInf - - // Push the compile unit and function onto the debug context. - if u.GenerateDebug { - u.debug.PushFunction(fr.function, f.Signature, f.Pos()) - defer u.debug.PopFunction() - u.debug.SetLocation(fr.builder, f.Pos()) - } - - // If a function calls recover, we create a separate function to - // hold the real function, and this function calls __go_can_recover - // and bridges to it. - if callsRecover(f) { - fr = fr.bridgeRecoverFunc(fr.function, fti) - } - - fr.blocks = make([]llvm.BasicBlock, len(f.Blocks)) - fr.lastBlocks = make([]llvm.BasicBlock, len(f.Blocks)) - for i, block := range f.Blocks { - fr.blocks[i] = llvm.AddBasicBlock(fr.function, fmt.Sprintf(".%d.%s", i, block.Comment)) - } - fr.builder.SetInsertPointAtEnd(fr.blocks[0]) - fr.transformSwitches(f) - - prologueBlock := llvm.InsertBasicBlock(fr.blocks[0], "prologue") - fr.builder.SetInsertPointAtEnd(prologueBlock) - - for i, param := range f.Params { - llparam := fti.argInfos[i].decode(llvm.GlobalContext(), fr.builder, fr.builder) - if isMethod && i == 0 { - if _, ok := param.Type().Underlying().(*types.Pointer); !ok { - llparam = fr.builder.CreateBitCast(llparam, llvm.PointerType(fr.types.ToLLVM(param.Type()), 0), "") - llparam = fr.builder.CreateLoad(llparam, "") - } - } - fr.env[param] = newValue(llparam, param.Type()) - } - - // Load closure, extract free vars. - if len(f.FreeVars) > 0 { - for _, fv := range f.FreeVars { - fr.env[fv] = newValue(llvm.ConstNull(u.llvmtypes.ToLLVM(fv.Type())), fv.Type()) - } - elemTypes := make([]llvm.Type, len(f.FreeVars)+1) - elemTypes[0] = llvm.PointerType(llvm.Int8Type(), 0) // function pointer - for i, fv := range f.FreeVars { - elemTypes[i+1] = u.llvmtypes.ToLLVM(fv.Type()) - } - structType := llvm.StructType(elemTypes, false) - closure := fr.function.Param(fti.chainIndex) - closure = fr.builder.CreateBitCast(closure, llvm.PointerType(structType, 0), "") - for i, fv := range f.FreeVars { - ptr := fr.builder.CreateStructGEP(closure, i+1, "") - ptr = fr.builder.CreateLoad(ptr, "") - fr.env[fv] = newValue(ptr, fv.Type()) - } - } - - // Allocate stack space for locals in the prologue block. - for _, local := range f.Locals { - typ := fr.llvmtypes.ToLLVM(deref(local.Type())) - alloca := fr.builder.CreateAlloca(typ, local.Comment) - fr.memsetZero(alloca, llvm.SizeOf(typ)) - bcalloca := fr.builder.CreateBitCast(alloca, llvm.PointerType(llvm.Int8Type(), 0), "") - value := newValue(bcalloca, local.Type()) - fr.env[local] = value - } - - // If the function contains any defers, we must first create - // an unwind block. We can short-circuit the check for defers with - // f.Recover != nil. - if f.Recover != nil || hasDefer(f) { - fr.unwindBlock = llvm.AddBasicBlock(fr.function, "unwind") - fr.frameptr = fr.builder.CreateAlloca(llvm.Int8Type(), "") - } - - // Keep track of the block into which we need to insert the call - // to __go_register_gc_roots. This needs to be inserted after the - // init guard check under the llgo ABI. - var registerGcBlock llvm.BasicBlock - - // If this is the "init" function, emit the init guard check and - // enable init-specific optimizations. - if !isMethod && f.Name() == "init" { - registerGcBlock = fr.emitInitPrologue() - fr.isInit = true - } - - fr.builder.CreateBr(fr.blocks[0]) - fr.allocaBuilder.SetInsertPointBefore(prologueBlock.FirstInstruction()) - - for _, block := range f.DomPreorder() { - llblock := fr.blocks[block.Index] - if llblock.IsNil() { - continue - } - fr.translateBlock(block, llblock) - } - - fr.fixupPhis() - - if !fr.unwindBlock.IsNil() { - fr.setupUnwindBlock(f.Recover) - } - - // The init function needs to register the GC roots first. We do this - // after generating code for it because allocations may have caused - // additional GC roots to be created. - if fr.isInit { - fr.builder.SetInsertPointBefore(registerGcBlock.FirstInstruction()) - fr.registerGcRoots() - } -} - -type pendingPhi struct { - ssa *ssa.Phi - llvm llvm.Value -} - -type frame struct { - *unit - function llvm.Value - builder, allocaBuilder llvm.Builder - retInf retInfo - blocks []llvm.BasicBlock - lastBlocks []llvm.BasicBlock - runtimeErrorBlocks [gccgoRuntimeErrorCount]llvm.BasicBlock - unwindBlock llvm.BasicBlock - frameptr llvm.Value - env map[ssa.Value]*govalue - ptr map[ssa.Value]llvm.Value - tuples map[ssa.Value][]*govalue - phis []pendingPhi - canRecover llvm.Value - isInit bool -} - -func newFrame(u *unit, fn llvm.Value) *frame { - return &frame{ - unit: u, - function: fn, - builder: llvm.GlobalContext().NewBuilder(), - allocaBuilder: llvm.GlobalContext().NewBuilder(), - env: make(map[ssa.Value]*govalue), - ptr: make(map[ssa.Value]llvm.Value), - tuples: make(map[ssa.Value][]*govalue), - } -} - -func (fr *frame) dispose() { - fr.builder.Dispose() - fr.allocaBuilder.Dispose() -} - -// emitInitPrologue emits the init-specific function prologue (guard check and -// initialization of dependent packages under the llgo native ABI), and returns -// the basic block into which the GC registration call should be emitted. -func (fr *frame) emitInitPrologue() llvm.BasicBlock { - if fr.GccgoABI { - return fr.builder.GetInsertBlock() - } - - initGuard := llvm.AddGlobal(fr.module.Module, llvm.Int1Type(), "init$guard") - initGuard.SetLinkage(llvm.InternalLinkage) - initGuard.SetInitializer(llvm.ConstNull(llvm.Int1Type())) - - returnBlock := llvm.AddBasicBlock(fr.function, "") - initBlock := llvm.AddBasicBlock(fr.function, "") - - initGuardVal := fr.builder.CreateLoad(initGuard, "") - fr.builder.CreateCondBr(initGuardVal, returnBlock, initBlock) - - fr.builder.SetInsertPointAtEnd(returnBlock) - fr.builder.CreateRetVoid() - - fr.builder.SetInsertPointAtEnd(initBlock) - fr.builder.CreateStore(llvm.ConstInt(llvm.Int1Type(), 1, false), initGuard) - int8ptr := llvm.PointerType(fr.types.ctx.Int8Type(), 0) - ftyp := llvm.FunctionType(llvm.VoidType(), []llvm.Type{int8ptr}, false) - for _, pkg := range fr.pkg.Object.Imports() { - initname := ManglePackagePath(pkg.Path()) + "..import" - initfn := fr.module.Module.NamedFunction(initname) - if initfn.IsNil() { - initfn = llvm.AddFunction(fr.module.Module, initname, ftyp) - } - args := []llvm.Value{llvm.Undef(int8ptr)} - fr.builder.CreateCall(initfn, args, "") - } - - return initBlock -} - -// bridgeRecoverFunc creates a function that may call recover(), and creates -// a call to it from the current frame. The created function will be called -// with a boolean parameter that indicates whether it may call recover(). -// -// The created function will have the same name as the current frame's function -// with "$recover" appended, having the same return types and parameters with -// an additional boolean parameter appended. -// -// A new frame will be returned for the newly created function. -func (fr *frame) bridgeRecoverFunc(llfn llvm.Value, fti functionTypeInfo) *frame { - // The bridging function must not be inlined, or the return address - // may not correspond to the source function. - llfn.AddFunctionAttr(llvm.NoInlineAttribute) - - // Call __go_can_recover, passing in the function's return address. - entry := llvm.AddBasicBlock(llfn, "entry") - fr.builder.SetInsertPointAtEnd(entry) - canRecover := fr.runtime.canRecover.call(fr, fr.returnAddress(0))[0] - returnType := fti.functionType.ReturnType() - argTypes := fti.functionType.ParamTypes() - argTypes = append(argTypes, canRecover.Type()) - - // Create and call the $recover function. - ftiRecover := fti - ftiRecover.functionType = llvm.FunctionType(returnType, argTypes, false) - llfnRecover := ftiRecover.declare(fr.module.Module, llfn.Name()+"$recover") - fr.addCommonFunctionAttrs(llfnRecover) - llfnRecover.SetLinkage(llvm.InternalLinkage) - args := make([]llvm.Value, len(argTypes)-1, len(argTypes)) - for i := range args { - args[i] = llfn.Param(i) - } - args = append(args, canRecover) - result := fr.builder.CreateCall(llfnRecover, args, "") - if returnType.TypeKind() == llvm.VoidTypeKind { - fr.builder.CreateRetVoid() - } else { - fr.builder.CreateRet(result) - } - - // The $recover function must condition calls to __go_recover on - // the result of __go_can_recover passed in as an argument. - fr = newFrame(fr.unit, llfnRecover) - fr.retInf = ftiRecover.retInf - fr.canRecover = fr.function.Param(len(argTypes) - 1) - return fr -} - -func (fr *frame) registerGcRoots() { - if len(fr.gcRoots) != 0 { - rootty := fr.gcRoots[0].Type() - roots := append(fr.gcRoots, llvm.ConstNull(rootty)) - rootsarr := llvm.ConstArray(rootty, roots) - rootsstruct := llvm.ConstStruct([]llvm.Value{llvm.ConstNull(llvm.PointerType(llvm.Int8Type(), 0)), rootsarr}, false) - - rootsglobal := llvm.AddGlobal(fr.module.Module, rootsstruct.Type(), "") - rootsglobal.SetInitializer(rootsstruct) - rootsglobal.SetLinkage(llvm.InternalLinkage) - fr.runtime.registerGcRoots.callOnly(fr, llvm.ConstBitCast(rootsglobal, llvm.PointerType(llvm.Int8Type(), 0))) - } -} - -func (fr *frame) fixupPhis() { - for _, phi := range fr.phis { - values := make([]llvm.Value, len(phi.ssa.Edges)) - blocks := make([]llvm.BasicBlock, len(phi.ssa.Edges)) - block := phi.ssa.Block() - for i, edge := range phi.ssa.Edges { - values[i] = fr.llvmvalue(edge) - blocks[i] = fr.lastBlock(block.Preds[i]) - } - phi.llvm.AddIncoming(values, blocks) - } -} - -func (fr *frame) createLandingPad(cleanup bool) llvm.Value { - fr.function.SetPersonality(fr.runtime.gccgoPersonality) - lp := fr.builder.CreateLandingPad(fr.runtime.gccgoExceptionType, 0, "") - if cleanup { - lp.SetCleanup(true) - } else { - lp.AddClause(llvm.ConstNull(llvm.PointerType(llvm.Int8Type(), 0))) - } - return lp -} - -// Runs defers. If a defer panics, check for recovers in later defers. -func (fr *frame) runDefers() { - loopbb := llvm.AddBasicBlock(fr.function, "") - fr.builder.CreateBr(loopbb) - - retrylpad := llvm.AddBasicBlock(fr.function, "") - fr.builder.SetInsertPointAtEnd(retrylpad) - fr.createLandingPad(false) - fr.runtime.checkDefer.callOnly(fr, fr.frameptr) - fr.builder.CreateBr(loopbb) - - fr.builder.SetInsertPointAtEnd(loopbb) - fr.runtime.undefer.invoke(fr, retrylpad, fr.frameptr) -} - -func (fr *frame) setupUnwindBlock(rec *ssa.BasicBlock) { - var recoverbb llvm.BasicBlock - if rec != nil { - recoverbb = fr.blocks[rec.Index] - } else { - recoverbb = llvm.AddBasicBlock(fr.function, "recover") - fr.builder.SetInsertPointAtEnd(recoverbb) - fr.builder.CreateUnreachable() - } - - checkunwindbb := llvm.AddBasicBlock(fr.function, "") - fr.builder.SetInsertPointAtEnd(checkunwindbb) - exc := fr.createLandingPad(true) - fr.runDefers() - - frame := fr.builder.CreateLoad(fr.frameptr, "") - shouldresume := fr.builder.CreateIsNull(frame, "") - - resumebb := llvm.AddBasicBlock(fr.function, "") - fr.builder.CreateCondBr(shouldresume, resumebb, recoverbb) - - fr.builder.SetInsertPointAtEnd(resumebb) - fr.builder.CreateResume(exc) - - fr.builder.SetInsertPointAtEnd(fr.unwindBlock) - fr.createLandingPad(false) - fr.runtime.checkDefer.invoke(fr, checkunwindbb, fr.frameptr) - fr.runDefers() - fr.builder.CreateBr(recoverbb) -} - -func (fr *frame) translateBlock(b *ssa.BasicBlock, llb llvm.BasicBlock) { - fr.builder.SetInsertPointAtEnd(llb) - for _, instr := range b.Instrs { - fr.instruction(instr) - } - fr.lastBlocks[b.Index] = fr.builder.GetInsertBlock() -} - -func (fr *frame) block(b *ssa.BasicBlock) llvm.BasicBlock { - return fr.blocks[b.Index] -} - -func (fr *frame) lastBlock(b *ssa.BasicBlock) llvm.BasicBlock { - return fr.lastBlocks[b.Index] -} - -func (fr *frame) value(v ssa.Value) (result *govalue) { - switch v := v.(type) { - case nil: - return nil - case *ssa.Function: - return fr.resolveFunctionDescriptor(v) - case *ssa.Const: - return fr.newValueFromConst(v.Value, v.Type()) - case *ssa.Global: - if g, ok := fr.globals[v]; ok { - return newValue(g, v.Type()) - } - // Create an external global. Globals for this package are defined - // on entry to translatePackage, and have initialisers. - llelemtyp := fr.llvmtypes.ToLLVM(deref(v.Type())) - vname := fr.types.mc.mangleGlobalName(v) - llglobal := llvm.AddGlobal(fr.module.Module, llelemtyp, vname) - llglobal = llvm.ConstBitCast(llglobal, fr.llvmtypes.ToLLVM(v.Type())) - fr.globals[v] = llglobal - return newValue(llglobal, v.Type()) - } - if value, ok := fr.env[v]; ok { - return value - } - - panic(fmt.Errorf("Instruction %q not visited yet", v.Name())) -} - -func (fr *frame) llvmvalue(v ssa.Value) llvm.Value { - if gv := fr.value(v); gv != nil { - return gv.value - } else { - return llvm.Value{nil} - } -} - -func (fr *frame) isNonNull(v ssa.Value) bool { - switch v.(type) { - case - // Globals have a fixed (non-nil) address. - *ssa.Global, - // The language does not specify what happens if an allocation fails. - *ssa.Alloc, - // These have already been nil checked. - *ssa.FieldAddr, *ssa.IndexAddr: - return true - default: - return false - } -} - -func (fr *frame) nilCheck(v ssa.Value, llptr llvm.Value) { - if !fr.isNonNull(v) { - ptrnull := fr.builder.CreateIsNull(llptr, "") - fr.condBrRuntimeError(ptrnull, gccgoRuntimeErrorNIL_DEREFERENCE) - } -} - -func (fr *frame) canAvoidElementLoad(ptr ssa.Value) bool { - for _, ref := range *ptr.Referrers() { - switch ref := ref.(type) { - case *ssa.Field: - case *ssa.Index: - if ref.X != ptr { - return false - } - // ok - default: - return false - } - } - - return true -} - -// If this value is sufficiently large, look through referrers to see if we can -// avoid a load. -func (fr *frame) canAvoidLoad(instr *ssa.UnOp, op llvm.Value) bool { - if fr.types.Sizeof(instr.Type()) < 2*fr.types.Sizeof(types.Typ[types.Int]) { - // Don't bother with small values. - return false - } - - // Keep track of whether our pointer may escape. We conservatively assume - // that MakeInterfaces will escape. - esc := false - - // We only know how to avoid loads if they are used to create an interface - // or read an element of the structure. If we see any other referrer, abort. - for _, ref := range *instr.Referrers() { - switch ref := ref.(type) { - case *ssa.MakeInterface: - esc = true - case *ssa.Field: - case *ssa.Index: - if ref.X != instr { - // This should never happen, as indices are always of type int - // and we don't bother with values smaller than 2*sizeof(int). - panic("impossible") - } - // ok - default: - return false - } - } - - var opcopy llvm.Value - if esc { - opcopy = fr.createTypeMalloc(instr.Type()) - } else { - opcopy = fr.allocaBuilder.CreateAlloca(fr.types.ToLLVM(instr.Type()), "") - } - fr.memcpy(opcopy, op, llvm.ConstInt(fr.types.inttype, uint64(fr.types.Sizeof(instr.Type())), false)) - - fr.ptr[instr] = opcopy - return true -} - -// Return true iff we think it might be beneficial to turn this alloc instruction -// into a statically allocated global. -// Precondition: we are compiling the init function. -func (fr *frame) shouldStaticallyAllocate(alloc *ssa.Alloc) bool { - // First, see if the allocated type is an array or struct, and if so determine - // the number of elements in the type. If the type is anything else, we - // statically allocate unconditionally. - var numElems int64 - switch ty := deref(alloc.Type()).Underlying().(type) { - case *types.Array: - numElems = ty.Len() - case *types.Struct: - numElems = int64(ty.NumFields()) - default: - return true - } - - // We treat the number of referrers to the alloc instruction as a rough - // proxy for the number of elements initialized. If the data structure - // is densely initialized (> 1/4 elements initialized), enable the - // optimization. - return int64(len(*alloc.Referrers()))*4 > numElems -} - -// If val is a constant and addr refers to a global variable which is defined in -// this module or an element thereof, simulate the effect of storing val at addr -// in the global variable's initializer and return true, otherwise return false. -// Precondition: we are compiling the init function. -func (fr *frame) maybeStoreInInitializer(val, addr llvm.Value) bool { - if val.IsAConstant().IsNil() { - return false - } - - if !addr.IsAConstantExpr().IsNil() && addr.OperandsCount() >= 2 && - // TODO(pcc): Explicitly check that this is a constant GEP. - // I don't think there are any other kinds of constantexpr which - // satisfy the conditions we test for here, so this is probably safe. - !addr.Operand(0).IsAGlobalVariable().IsNil() && - addr.Operand(1).IsNull() { - gv := addr.Operand(0) - globalInit, ok := fr.globalInits[gv] - if !ok { - return false - } - indices := make([]uint32, addr.OperandsCount()-2) - for i := range indices { - op := addr.Operand(i + 2) - if op.IsAConstantInt().IsNil() { - return false - } - indices[i] = uint32(op.ZExtValue()) - } - globalInit.update(gv.Type().ElementType(), indices, val) - return true - } else if !addr.IsAGlobalVariable().IsNil() { - if globalInit, ok := fr.globalInits[addr]; ok { - globalInit.update(addr.Type().ElementType(), nil, val) - return true - } - return false - } else { - return false - } -} - -func (fr *frame) instruction(instr ssa.Instruction) { - fr.logf("[%T] %v @ %s\n", instr, instr, fr.pkg.Prog.Fset.Position(instr.Pos())) - if fr.GenerateDebug { - fr.debug.SetLocation(fr.builder, instr.Pos()) - } - - switch instr := instr.(type) { - case *ssa.Alloc: - typ := deref(instr.Type()) - llvmtyp := fr.llvmtypes.ToLLVM(typ) - var value llvm.Value - if !instr.Heap { - value = fr.env[instr].value - fr.memsetZero(value, llvm.SizeOf(llvmtyp)) - } else if fr.isInit && fr.shouldStaticallyAllocate(instr) { - // If this is the init function and we think it may be beneficial, - // allocate memory statically in the object file rather than on the - // heap. This allows us to optimize constant stores into such - // variables as static initializations. - global := llvm.AddGlobal(fr.module.Module, llvmtyp, "") - global.SetLinkage(llvm.InternalLinkage) - fr.addGlobal(global, typ) - ptr := llvm.ConstBitCast(global, llvm.PointerType(llvm.Int8Type(), 0)) - fr.env[instr] = newValue(ptr, instr.Type()) - } else { - value = fr.createTypeMalloc(typ) - value.SetName(instr.Comment) - value = fr.builder.CreateBitCast(value, llvm.PointerType(llvm.Int8Type(), 0), "") - fr.env[instr] = newValue(value, instr.Type()) - } - - case *ssa.BinOp: - lhs, rhs := fr.value(instr.X), fr.value(instr.Y) - fr.env[instr] = fr.binaryOp(lhs, instr.Op, rhs) - - case *ssa.Call: - tuple := fr.callInstruction(instr) - if len(tuple) == 1 { - fr.env[instr] = tuple[0] - } else { - fr.tuples[instr] = tuple - } - - case *ssa.ChangeInterface: - x := fr.value(instr.X) - // The source type must be a non-empty interface, - // as ChangeInterface cannot fail (E2I may fail). - if instr.Type().Underlying().(*types.Interface).NumMethods() > 0 { - x = fr.changeInterface(x, instr.Type(), false) - } else { - x = fr.convertI2E(x) - } - fr.env[instr] = x - - case *ssa.ChangeType: - value := fr.llvmvalue(instr.X) - if _, ok := instr.Type().Underlying().(*types.Pointer); ok { - value = fr.builder.CreateBitCast(value, fr.llvmtypes.ToLLVM(instr.Type()), "") - } - fr.env[instr] = newValue(value, instr.Type()) - - case *ssa.Convert: - v := fr.value(instr.X) - fr.env[instr] = fr.convert(v, instr.Type()) - - case *ssa.Defer: - fn, arg := fr.createThunk(instr) - fr.runtime.Defer.call(fr, fr.frameptr, fn, arg) - - case *ssa.Extract: - var elem llvm.Value - if t, ok := fr.tuples[instr.Tuple]; ok { - elem = t[instr.Index].value - } else { - tuple := fr.llvmvalue(instr.Tuple) - elem = fr.builder.CreateExtractValue(tuple, instr.Index, instr.Name()) - } - elemtyp := instr.Type() - fr.env[instr] = newValue(elem, elemtyp) - - case *ssa.Field: - fieldtyp := instr.Type() - if p, ok := fr.ptr[instr.X]; ok { - field := fr.builder.CreateStructGEP(p, instr.Field, instr.Name()) - if fr.canAvoidElementLoad(instr) { - fr.ptr[instr] = field - } else { - fr.env[instr] = newValue(fr.builder.CreateLoad(field, ""), fieldtyp) - } - } else { - value := fr.llvmvalue(instr.X) - field := fr.builder.CreateExtractValue(value, instr.Field, instr.Name()) - fr.env[instr] = newValue(field, fieldtyp) - } - - case *ssa.FieldAddr: - ptr := fr.llvmvalue(instr.X) - fr.nilCheck(instr.X, ptr) - xtyp := instr.X.Type().Underlying().(*types.Pointer).Elem() - ptrtyp := llvm.PointerType(fr.llvmtypes.ToLLVM(xtyp), 0) - ptr = fr.builder.CreateBitCast(ptr, ptrtyp, "") - fieldptr := fr.builder.CreateStructGEP(ptr, instr.Field, instr.Name()) - fieldptr = fr.builder.CreateBitCast(fieldptr, llvm.PointerType(llvm.Int8Type(), 0), "") - fieldptrtyp := instr.Type() - fr.env[instr] = newValue(fieldptr, fieldptrtyp) - - case *ssa.Go: - fn, arg := fr.createThunk(instr) - fr.runtime.Go.call(fr, fn, arg) - - case *ssa.If: - cond := fr.llvmvalue(instr.Cond) - block := instr.Block() - trueBlock := fr.block(block.Succs[0]) - falseBlock := fr.block(block.Succs[1]) - cond = fr.builder.CreateTrunc(cond, llvm.Int1Type(), "") - fr.builder.CreateCondBr(cond, trueBlock, falseBlock) - - case *ssa.Index: - var arrayptr llvm.Value - - if ptr, ok := fr.ptr[instr.X]; ok { - arrayptr = ptr - } else { - array := fr.llvmvalue(instr.X) - arrayptr = fr.allocaBuilder.CreateAlloca(array.Type(), "") - - fr.builder.CreateStore(array, arrayptr) - } - index := fr.llvmvalue(instr.Index) - - arraytyp := instr.X.Type().Underlying().(*types.Array) - arraylen := llvm.ConstInt(fr.llvmtypes.inttype, uint64(arraytyp.Len()), false) - - // The index may not have been promoted to int (for example, if it - // came from a composite literal). - index = fr.createZExtOrTrunc(index, fr.types.inttype, "") - - // Bounds checking: 0 <= index < len - zero := llvm.ConstNull(fr.types.inttype) - i0 := fr.builder.CreateICmp(llvm.IntSLT, index, zero, "") - li := fr.builder.CreateICmp(llvm.IntSLE, arraylen, index, "") - - cond := fr.builder.CreateOr(i0, li, "") - - fr.condBrRuntimeError(cond, gccgoRuntimeErrorARRAY_INDEX_OUT_OF_BOUNDS) - - addr := fr.builder.CreateGEP(arrayptr, []llvm.Value{zero, index}, "") - if fr.canAvoidElementLoad(instr) { - fr.ptr[instr] = addr - } else { - fr.env[instr] = newValue(fr.builder.CreateLoad(addr, ""), instr.Type()) - } - - case *ssa.IndexAddr: - x := fr.llvmvalue(instr.X) - index := fr.llvmvalue(instr.Index) - var arrayptr, arraylen llvm.Value - var elemtyp types.Type - var errcode uint64 - switch typ := instr.X.Type().Underlying().(type) { - case *types.Slice: - elemtyp = typ.Elem() - arrayptr = fr.builder.CreateExtractValue(x, 0, "") - arraylen = fr.builder.CreateExtractValue(x, 1, "") - errcode = gccgoRuntimeErrorSLICE_INDEX_OUT_OF_BOUNDS - case *types.Pointer: // *array - arraytyp := typ.Elem().Underlying().(*types.Array) - elemtyp = arraytyp.Elem() - fr.nilCheck(instr.X, x) - arrayptr = x - arraylen = llvm.ConstInt(fr.llvmtypes.inttype, uint64(arraytyp.Len()), false) - errcode = gccgoRuntimeErrorARRAY_INDEX_OUT_OF_BOUNDS - } - - // The index may not have been promoted to int (for example, if it - // came from a composite literal). - index = fr.createZExtOrTrunc(index, fr.types.inttype, "") - - // Bounds checking: 0 <= index < len - zero := llvm.ConstNull(fr.types.inttype) - i0 := fr.builder.CreateICmp(llvm.IntSLT, index, zero, "") - li := fr.builder.CreateICmp(llvm.IntSLE, arraylen, index, "") - - cond := fr.builder.CreateOr(i0, li, "") - - fr.condBrRuntimeError(cond, errcode) - - ptrtyp := llvm.PointerType(fr.llvmtypes.ToLLVM(elemtyp), 0) - arrayptr = fr.builder.CreateBitCast(arrayptr, ptrtyp, "") - addr := fr.builder.CreateGEP(arrayptr, []llvm.Value{index}, "") - addr = fr.builder.CreateBitCast(addr, llvm.PointerType(llvm.Int8Type(), 0), "") - fr.env[instr] = newValue(addr, types.NewPointer(elemtyp)) - - case *ssa.Jump: - succ := instr.Block().Succs[0] - fr.builder.CreateBr(fr.block(succ)) - - case *ssa.Lookup: - x := fr.value(instr.X) - index := fr.value(instr.Index) - if isString(x.Type().Underlying()) { - fr.env[instr] = fr.stringIndex(x, index) - } else { - v, ok := fr.mapLookup(x, index) - if instr.CommaOk { - fr.tuples[instr] = []*govalue{v, ok} - } else { - fr.env[instr] = v - } - } - - case *ssa.MakeChan: - fr.env[instr] = fr.makeChan(instr.Type(), fr.value(instr.Size)) - - case *ssa.MakeClosure: - llfn := fr.resolveFunctionGlobal(instr.Fn.(*ssa.Function)) - llfn = llvm.ConstBitCast(llfn, llvm.PointerType(llvm.Int8Type(), 0)) - fn := newValue(llfn, instr.Fn.(*ssa.Function).Signature) - bindings := make([]*govalue, len(instr.Bindings)) - for i, binding := range instr.Bindings { - bindings[i] = fr.value(binding) - } - fr.env[instr] = fr.makeClosure(fn, bindings) - - case *ssa.MakeInterface: - // fr.ptr[instr.X] will be set if a pointer load was elided by canAvoidLoad - if ptr, ok := fr.ptr[instr.X]; ok { - fr.env[instr] = fr.makeInterfaceFromPointer(ptr, instr.X.Type(), instr.Type()) - } else { - receiver := fr.llvmvalue(instr.X) - fr.env[instr] = fr.makeInterface(receiver, instr.X.Type(), instr.Type()) - } - - case *ssa.MakeMap: - fr.env[instr] = fr.makeMap(instr.Type(), fr.value(instr.Reserve)) - - case *ssa.MakeSlice: - length := fr.value(instr.Len) - capacity := fr.value(instr.Cap) - fr.env[instr] = fr.makeSlice(instr.Type(), length, capacity) - - case *ssa.MapUpdate: - m := fr.value(instr.Map) - k := fr.value(instr.Key) - v := fr.value(instr.Value) - fr.mapUpdate(m, k, v) - - case *ssa.Next: - iter := fr.tuples[instr.Iter] - if instr.IsString { - fr.tuples[instr] = fr.stringIterNext(iter) - } else { - fr.tuples[instr] = fr.mapIterNext(iter) - } - - case *ssa.Panic: - arg := fr.value(instr.X) - fr.callPanic(arg, true) - - case *ssa.Phi: - typ := instr.Type() - phi := fr.builder.CreatePHI(fr.llvmtypes.ToLLVM(typ), instr.Comment) - fr.env[instr] = newValue(phi, typ) - fr.phis = append(fr.phis, pendingPhi{instr, phi}) - - case *ssa.Range: - x := fr.value(instr.X) - switch x.Type().Underlying().(type) { - case *types.Map: - fr.tuples[instr] = fr.mapIterInit(x) - case *types.Basic: // string - fr.tuples[instr] = fr.stringIterInit(x) - default: - panic(fmt.Sprintf("unhandled range for type %T", x.Type())) - } - - case *ssa.Return: - vals := make([]llvm.Value, len(instr.Results)) - for i, res := range instr.Results { - vals[i] = fr.llvmvalue(res) - } - fr.retInf.encode(llvm.GlobalContext(), fr.allocaBuilder, fr.builder, vals) - - case *ssa.RunDefers: - fr.runDefers() - - case *ssa.Select: - index, recvOk, recvElems := fr.chanSelect(instr) - tuple := append([]*govalue{index, recvOk}, recvElems...) - fr.tuples[instr] = tuple - - case *ssa.Send: - fr.chanSend(fr.value(instr.Chan), fr.value(instr.X)) - - case *ssa.Slice: - x := fr.llvmvalue(instr.X) - low := fr.llvmvalue(instr.Low) - high := fr.llvmvalue(instr.High) - max := fr.llvmvalue(instr.Max) - slice := fr.slice(x, instr.X.Type(), low, high, max) - fr.env[instr] = newValue(slice, instr.Type()) - - case *ssa.Store: - addr := fr.llvmvalue(instr.Addr) - value := fr.llvmvalue(instr.Val) - addr = fr.builder.CreateBitCast(addr, llvm.PointerType(value.Type(), 0), "") - // If this is the init function, see if we can simulate the effect - // of the store in a global's initializer, in which case we can avoid - // generating code for it. - if !fr.isInit || !fr.maybeStoreInInitializer(value, addr) { - fr.nilCheck(instr.Addr, addr) - fr.builder.CreateStore(value, addr) - } - - case *switchInstr: - fr.emitSwitch(instr) - - case *ssa.TypeAssert: - x := fr.value(instr.X) - if instr.CommaOk { - v, ok := fr.interfaceTypeCheck(x, instr.AssertedType) - fr.tuples[instr] = []*govalue{v, ok} - } else { - fr.env[instr] = fr.interfaceTypeAssert(x, instr.AssertedType) - } - - case *ssa.UnOp: - operand := fr.value(instr.X) - switch instr.Op { - case token.ARROW: - x, ok := fr.chanRecv(operand, instr.CommaOk) - if instr.CommaOk { - fr.tuples[instr] = []*govalue{x, ok} - } else { - fr.env[instr] = x - } - case token.MUL: - fr.nilCheck(instr.X, operand.value) - if !fr.canAvoidLoad(instr, operand.value) { - // The bitcast is necessary to handle recursive pointer loads. - llptr := fr.builder.CreateBitCast(operand.value, llvm.PointerType(fr.llvmtypes.ToLLVM(instr.Type()), 0), "") - fr.env[instr] = newValue(fr.builder.CreateLoad(llptr, ""), instr.Type()) - } - default: - fr.env[instr] = fr.unaryOp(operand, instr.Op) - } - - default: - panic(fmt.Sprintf("unhandled: %v", instr)) - } -} - -func (fr *frame) callBuiltin(typ types.Type, builtin *ssa.Builtin, args []ssa.Value) []*govalue { - switch builtin.Name() { - case "print", "println": - llargs := make([]*govalue, len(args)) - for i, arg := range args { - llargs[i] = fr.value(arg) - } - fr.printValues(builtin.Name() == "println", llargs...) - return nil - - case "panic": - fr.callPanic(fr.value(args[0]), false) - return nil - - case "recover": - return []*govalue{fr.callRecover(false)} - - case "append": - return []*govalue{fr.callAppend(fr.value(args[0]), fr.value(args[1]))} - - case "close": - fr.chanClose(fr.value(args[0])) - return nil - - case "cap": - return []*govalue{fr.callCap(fr.value(args[0]))} - - case "len": - return []*govalue{fr.callLen(fr.value(args[0]))} - - case "copy": - return []*govalue{fr.callCopy(fr.value(args[0]), fr.value(args[1]))} - - case "delete": - fr.mapDelete(fr.value(args[0]), fr.value(args[1])) - return nil - - case "real": - return []*govalue{fr.extractRealValue(fr.value(args[0]))} - - case "imag": - return []*govalue{fr.extractImagValue(fr.value(args[0]))} - - case "complex": - r := fr.llvmvalue(args[0]) - i := fr.llvmvalue(args[1]) - cmplx := llvm.Undef(fr.llvmtypes.ToLLVM(typ)) - cmplx = fr.builder.CreateInsertValue(cmplx, r, 0, "") - cmplx = fr.builder.CreateInsertValue(cmplx, i, 1, "") - return []*govalue{newValue(cmplx, typ)} - - case "ssa:wrapnilchk": - ptr := fr.value(args[0]) - fr.nilCheck(args[0], ptr.value) - return []*govalue{ptr} - - default: - panic("unimplemented: " + builtin.Name()) - } -} - -// callInstruction translates function call instructions. -func (fr *frame) callInstruction(instr ssa.CallInstruction) []*govalue { - call := instr.Common() - if builtin, ok := call.Value.(*ssa.Builtin); ok { - var typ types.Type - if v := instr.Value(); v != nil { - typ = v.Type() - } - return fr.callBuiltin(typ, builtin, call.Args) - } - - args := make([]*govalue, len(call.Args)) - for i, arg := range call.Args { - args[i] = fr.value(arg) - } - - var fn *govalue - var chain llvm.Value - if call.IsInvoke() { - var recv *govalue - fn, recv = fr.interfaceMethod(fr.llvmvalue(call.Value), call.Value.Type(), call.Method) - args = append([]*govalue{recv}, args...) - } else { - if ssafn, ok := call.Value.(*ssa.Function); ok { - llfn := fr.resolveFunctionGlobal(ssafn) - llfn = llvm.ConstBitCast(llfn, llvm.PointerType(llvm.Int8Type(), 0)) - fn = newValue(llfn, ssafn.Type()) - } else { - // First-class function values are stored as *{*fnptr}, so - // we must extract the function pointer. We must also - // set the chain, in case the function is a closure. - fn = fr.value(call.Value) - chain = fn.value - fnptr := fr.builder.CreateBitCast(fn.value, llvm.PointerType(fn.value.Type(), 0), "") - fnptr = fr.builder.CreateLoad(fnptr, "") - fn = newValue(fnptr, fn.Type()) - } - if recv := call.Signature().Recv(); recv != nil { - if _, ok := recv.Type().Underlying().(*types.Pointer); !ok { - recvalloca := fr.allocaBuilder.CreateAlloca(args[0].value.Type(), "") - fr.builder.CreateStore(args[0].value, recvalloca) - args[0] = newValue(recvalloca, types.NewPointer(args[0].Type())) - } - } - } - return fr.createCall(fn, chain, args) -} - -func hasDefer(f *ssa.Function) bool { - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - if _, ok := instr.(*ssa.Defer); ok { - return true - } - } - } - return false -} - -func callsRecover(f *ssa.Function) bool { - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - if instr, ok := instr.(ssa.CallInstruction); ok { - b, ok := instr.Common().Value.(*ssa.Builtin) - if ok && b.Name() == "recover" { - return true - } - } - } - } - return false -} diff --git a/llgo/irgen/strings.go b/llgo/irgen/strings.go deleted file mode 100644 index 5762485d807f..000000000000 --- a/llgo/irgen/strings.go +++ /dev/null @@ -1,114 +0,0 @@ -//===- strings.go - IR generation for string ops --------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements IR generation for string operations. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "go/token" - - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -func (fr *frame) concatenateStrings(lhs, rhs *govalue) *govalue { - result := fr.runtime.stringPlus.call(fr, lhs.value, rhs.value) - return newValue(result[0], types.Typ[types.String]) -} - -func (fr *frame) compareStringEmpty(v llvm.Value) *govalue { - len := fr.builder.CreateExtractValue(v, 1, "") - result := fr.builder.CreateIsNull(len, "") - result = fr.builder.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) -} - -func (fr *frame) compareStrings(lhs, rhs *govalue, op token.Token) *govalue { - if op == token.EQL { - if lhs.value.IsNull() { - return fr.compareStringEmpty(rhs.value) - } - if rhs.value.IsNull() { - return fr.compareStringEmpty(lhs.value) - } - } - - result := fr.runtime.strcmp.call(fr, lhs.value, rhs.value)[0] - zero := llvm.ConstNull(fr.types.inttype) - var pred llvm.IntPredicate - switch op { - case token.EQL: - pred = llvm.IntEQ - case token.LSS: - pred = llvm.IntSLT - case token.GTR: - pred = llvm.IntSGT - case token.LEQ: - pred = llvm.IntSLE - case token.GEQ: - pred = llvm.IntSGE - case token.NEQ: - panic("NEQ is handled in govalue.BinaryOp") - default: - panic("unreachable") - } - result = fr.builder.CreateICmp(pred, result, zero, "") - result = fr.builder.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) -} - -// stringIndex implements v = m[i] -func (fr *frame) stringIndex(s, i *govalue) *govalue { - ptr := fr.builder.CreateExtractValue(s.value, 0, "") - ptr = fr.builder.CreateGEP(ptr, []llvm.Value{i.value}, "") - return newValue(fr.builder.CreateLoad(ptr, ""), types.Typ[types.Byte]) -} - -func (fr *frame) stringIterInit(str *govalue) []*govalue { - indexptr := fr.allocaBuilder.CreateAlloca(fr.types.inttype, "") - fr.builder.CreateStore(llvm.ConstNull(fr.types.inttype), indexptr) - return []*govalue{str, newValue(indexptr, types.Typ[types.Int])} -} - -// stringIterNext advances the iterator, and returns the tuple (ok, k, v). -func (fr *frame) stringIterNext(iter []*govalue) []*govalue { - str, indexptr := iter[0], iter[1] - k := fr.builder.CreateLoad(indexptr.value, "") - - result := fr.runtime.stringiter2.call(fr, str.value, k) - fr.builder.CreateStore(result[0], indexptr.value) - ok := fr.builder.CreateIsNotNull(result[0], "") - ok = fr.builder.CreateZExt(ok, llvm.Int8Type(), "") - v := result[1] - - return []*govalue{newValue(ok, types.Typ[types.Bool]), newValue(k, types.Typ[types.Int]), newValue(v, types.Typ[types.Rune])} -} - -func (fr *frame) runeToString(v *govalue) *govalue { - v = fr.convert(v, types.Typ[types.Int]) - result := fr.runtime.intToString.call(fr, v.value) - return newValue(result[0], types.Typ[types.String]) -} - -func (fr *frame) stringToRuneSlice(v *govalue) *govalue { - result := fr.runtime.stringToIntArray.call(fr, v.value) - runeslice := types.NewSlice(types.Typ[types.Rune]) - return newValue(result[0], runeslice) -} - -func (fr *frame) runeSliceToString(v *govalue) *govalue { - llv := v.value - ptr := fr.builder.CreateExtractValue(llv, 0, "") - len := fr.builder.CreateExtractValue(llv, 1, "") - result := fr.runtime.intArrayToString.call(fr, ptr, len) - return newValue(result[0], types.Typ[types.String]) -} diff --git a/llgo/irgen/switches.go b/llgo/irgen/switches.go deleted file mode 100644 index e4bf9a65fbbc..000000000000 --- a/llgo/irgen/switches.go +++ /dev/null @@ -1,145 +0,0 @@ -//===- switches.go - misc utils -------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements transformations and IR generation for switches. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "go/token" - - "llvm.org/llgo/third_party/gotools/go/exact" - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/ssa/ssautil" - "llvm.org/llvm/bindings/go/llvm" -) - -// switchInstr is an instruction representing a switch on constant -// integer values. -type switchInstr struct { - ssa.Instruction - ssautil.Switch -} - -func (sw *switchInstr) String() string { - return sw.Switch.String() -} - -func (sw *switchInstr) Parent() *ssa.Function { - return sw.Default.Instrs[0].Parent() -} - -func (sw *switchInstr) Block() *ssa.BasicBlock { - return sw.Start -} - -func (sw *switchInstr) Operands(rands []*ssa.Value) []*ssa.Value { - return nil -} - -func (sw *switchInstr) Pos() token.Pos { - return token.NoPos -} - -// emitSwitch emits an LLVM switch instruction. -func (fr *frame) emitSwitch(instr *switchInstr) { - cases, _ := dedupConstCases(fr, instr.ConstCases) - ncases := len(cases) - elseblock := fr.block(instr.Default) - llswitch := fr.builder.CreateSwitch(fr.llvmvalue(instr.X), elseblock, ncases) - for _, c := range cases { - llswitch.AddCase(fr.llvmvalue(c.Value), fr.block(c.Body)) - } -} - -// transformSwitches replaces the final If statement in start blocks -// with a high-level switch instruction, and erases chained condition -// blocks. -func (fr *frame) transformSwitches(f *ssa.Function) { - for _, sw := range ssautil.Switches(f) { - if sw.ConstCases == nil { - // TODO(axw) investigate switch - // on hashes in type switches. - continue - } - if !isInteger(sw.X.Type()) && !isBoolean(sw.X.Type()) { - // LLVM switches can only operate on integers. - continue - } - instr := &switchInstr{Switch: sw} - sw.Start.Instrs[len(sw.Start.Instrs)-1] = instr - for _, c := range sw.ConstCases[1:] { - fr.blocks[c.Block.Index].EraseFromParent() - fr.blocks[c.Block.Index] = llvm.BasicBlock{} - } - - // Fix predecessors in successor blocks for fixupPhis. - cases, duplicates := dedupConstCases(fr, instr.ConstCases) - for _, c := range cases { - for _, succ := range c.Block.Succs { - for i, pred := range succ.Preds { - if pred == c.Block { - succ.Preds[i] = sw.Start - break - } - } - } - } - - // Remove redundant edges corresponding to duplicate cases - // that will not feature in the LLVM switch instruction. - for _, c := range duplicates { - for _, succ := range c.Block.Succs { - for i, pred := range succ.Preds { - if pred == c.Block { - head := succ.Preds[:i] - tail := succ.Preds[i+1:] - succ.Preds = append(head, tail...) - removePhiEdge(succ, i) - break - } - } - } - } - } -} - -// dedupConstCases separates duplicate const cases. -// -// TODO(axw) fix this in go/ssa/ssautil. -func dedupConstCases(fr *frame, in []ssautil.ConstCase) (unique, duplicates []ssautil.ConstCase) { - unique = make([]ssautil.ConstCase, 0, len(in)) -dedup: - for i, c1 := range in { - for _, c2 := range in[i+1:] { - if exact.Compare(c1.Value.Value, token.EQL, c2.Value.Value) { - duplicates = append(duplicates, c1) - continue dedup - } - } - unique = append(unique, c1) - } - return unique, duplicates -} - -// removePhiEdge removes the i'th edge from each PHI -// instruction in the specified basic block. -func removePhiEdge(bb *ssa.BasicBlock, i int) { - for _, instr := range bb.Instrs { - instr, ok := instr.(*ssa.Phi) - if !ok { - return - } - head := instr.Edges[:i] - tail := instr.Edges[i+1:] - instr.Edges = append(head, tail...) - } -} diff --git a/llgo/irgen/targets.go b/llgo/irgen/targets.go deleted file mode 100644 index 2f4fccb540d1..000000000000 --- a/llgo/irgen/targets.go +++ /dev/null @@ -1,89 +0,0 @@ -//===- targets.go - target data -------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file contains functions for retrieving target-specific data. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "fmt" - "strings" - - "llvm.org/llvm/bindings/go/llvm" -) - -// llvmDataLayout returns the data layout string -// representation for the specified LLVM triple. -func llvmDataLayout(triple string) (string, error) { - // Triples are several fields separated by '-' characters. - // The first field is the architecture. The architecture's - // canonical form may include a '-' character, which would - // have been translated to '_' for inclusion in a triple. - arch := parseArch(triple[:strings.IndexRune(triple, '-')]) - for target := llvm.FirstTarget(); target.C != nil; target = target.NextTarget() { - if arch == target.Name() { - machine := target.CreateTargetMachine( - triple, "", "", - llvm.CodeGenLevelDefault, - llvm.RelocDefault, - llvm.CodeModelDefault, - ) - targetData := machine.CreateTargetData() - targetDataLayout := targetData.String() - targetData.Dispose() - machine.Dispose() - return targetDataLayout, nil - } - } - return "", fmt.Errorf("Invalid target triple: %s", triple) -} - -// Based on parseArch from LLVM's lib/Support/Triple.cpp. -// This is used to match the target machine type. -func parseArch(arch string) string { - switch arch { - case "i386", "i486", "i586", "i686", "i786", "i886", "i986": - return "x86" - case "amd64", "x86_64": - return "x86-64" - case "powerpc": - return "ppc" - case "powerpc64", "ppu": - return "ppc64" - case "mblaze": - return "mblaze" - case "arm", "xscale": - return "arm" - case "thumb": - return "thumb" - case "spu", "cellspu": - return "cellspu" - case "msp430": - return "msp430" - case "mips", "mipseb", "mipsallegrex": - return "mips" - case "mipsel", "mipsallegrexel": - return "mipsel" - case "mips64", "mips64eb": - return "mips64" - case "mipsel64": - return "mipsel64" - case "r600", "hexagon", "sparc", "sparcv9", "tce", - "xcore", "nvptx", "nvptx64", "le32", "amdil": - return arch - } - if strings.HasPrefix(arch, "armv") { - return "arm" - } else if strings.HasPrefix(arch, "thumbv") { - return "thumb" - } - return "unknown" -} diff --git a/llgo/irgen/typemap.go b/llgo/irgen/typemap.go deleted file mode 100644 index 2ae1a4e2b93d..000000000000 --- a/llgo/irgen/typemap.go +++ /dev/null @@ -1,2053 +0,0 @@ -//===- typemap.go - type and type descriptor mapping ----------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements the mapping from go/types types to LLVM types and to -// type descriptors. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "bytes" - "fmt" - "sort" - "strconv" - "strings" - - "llvm.org/llgo/third_party/gotools/go/ssa" - "llvm.org/llgo/third_party/gotools/go/ssa/ssautil" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llgo/third_party/gotools/go/types/typeutil" - "llvm.org/llvm/bindings/go/llvm" -) - -type MethodResolver interface { - ResolveMethod(*types.Selection) *govalue -} - -// llvmTypeMap is provides a means of mapping from a types.Map -// to llgo's corresponding LLVM type representation. -type llvmTypeMap struct { - sizes *types.StdSizes - ctx llvm.Context - target llvm.TargetData - inttype llvm.Type - stringType llvm.Type - - types typeutil.Map -} - -type typeDescInfo struct { - global llvm.Value - commonTypePtr llvm.Value - mapDescPtr llvm.Value - gc, gcPtr llvm.Value - - interfaceMethodTables typeutil.Map -} - -type TypeMap struct { - *llvmTypeMap - mc manglerContext - - module llvm.Module - pkgpath string - types, algs typeutil.Map - runtime *runtimeInterface - methodResolver MethodResolver - types.MethodSetCache - - commonTypeType, uncommonTypeType, ptrTypeType, funcTypeType, arrayTypeType, sliceTypeType, mapTypeType, chanTypeType, interfaceTypeType, structTypeType llvm.Type - mapDescType llvm.Type - - methodType, imethodType, structFieldType llvm.Type - - typeSliceType, methodSliceType, imethodSliceType, structFieldSliceType llvm.Type - - funcValType llvm.Type - hashFnType, equalFnType llvm.Type - - algsEmptyInterface, - algsInterface, - algsFloat, - algsComplex, - algsString, - algsIdentity, - algsError algorithms -} - -type algorithms struct { - hash, hashDescriptor, equal, equalDescriptor llvm.Value -} - -func NewLLVMTypeMap(ctx llvm.Context, target llvm.TargetData) *llvmTypeMap { - // spec says int is either 32-bit or 64-bit. - // ABI currently requires sizeof(int) == sizeof(uint) == sizeof(uintptr). - inttype := ctx.IntType(8 * target.PointerSize()) - - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - elements := []llvm.Type{i8ptr, inttype} - stringType := llvm.StructType(elements, false) - - return &llvmTypeMap{ - ctx: ctx, - sizes: &types.StdSizes{ - WordSize: int64(target.PointerSize()), - MaxAlign: 8, - }, - target: target, - inttype: inttype, - stringType: stringType, - } -} - -func NewTypeMap(pkg *ssa.Package, llvmtm *llvmTypeMap, module llvm.Module, r *runtimeInterface, mr MethodResolver) *TypeMap { - tm := &TypeMap{ - llvmTypeMap: llvmtm, - module: module, - pkgpath: pkg.Object.Path(), - runtime: r, - methodResolver: mr, - } - - tm.mc.init(pkg.Prog, &tm.MethodSetCache) - - uintptrType := tm.inttype - voidPtrType := llvm.PointerType(tm.ctx.Int8Type(), 0) - boolType := llvm.Int8Type() - stringPtrType := llvm.PointerType(tm.stringType, 0) - - tm.funcValType = tm.ctx.StructCreateNamed("funcVal") - tm.funcValType.StructSetBody([]llvm.Type{ - llvm.PointerType(llvm.FunctionType(llvm.VoidType(), []llvm.Type{}, false), 0), - }, false) - - params := []llvm.Type{voidPtrType, uintptrType} - tm.hashFnType = llvm.FunctionType(uintptrType, params, false) - params = []llvm.Type{voidPtrType, voidPtrType, uintptrType} - tm.equalFnType = llvm.FunctionType(boolType, params, false) - - typeAlgorithms := [...]struct { - Name string - *algorithms - }{ - {"empty_interface", &tm.algsEmptyInterface}, - {"interface", &tm.algsInterface}, - {"float", &tm.algsFloat}, - {"complex", &tm.algsComplex}, - {"string", &tm.algsString}, - {"identity", &tm.algsIdentity}, - {"error", &tm.algsError}, - } - for _, typeAlgs := range typeAlgorithms { - hashFnName := "__go_type_hash_" + typeAlgs.Name - hashDescriptorName := hashFnName + "_descriptor" - equalFnName := "__go_type_equal_" + typeAlgs.Name - equalDescriptorName := equalFnName + "_descriptor" - typeAlgs.hash = llvm.AddGlobal(tm.module, tm.hashFnType, hashFnName) - typeAlgs.hashDescriptor = llvm.AddGlobal(tm.module, tm.funcValType, hashDescriptorName) - typeAlgs.equal = llvm.AddGlobal(tm.module, tm.equalFnType, equalFnName) - typeAlgs.equalDescriptor = llvm.AddGlobal(tm.module, tm.funcValType, equalDescriptorName) - } - - tm.commonTypeType = tm.ctx.StructCreateNamed("commonType") - commonTypeTypePtr := llvm.PointerType(tm.commonTypeType, 0) - - tm.methodType = tm.ctx.StructCreateNamed("method") - tm.methodType.StructSetBody([]llvm.Type{ - stringPtrType, // name - stringPtrType, // pkgPath - commonTypeTypePtr, // mtype (without receiver) - commonTypeTypePtr, // type (with receiver) - voidPtrType, // function - }, false) - - tm.methodSliceType = tm.makeNamedSliceType("methodSlice", tm.methodType) - - tm.uncommonTypeType = tm.ctx.StructCreateNamed("uncommonType") - tm.uncommonTypeType.StructSetBody([]llvm.Type{ - stringPtrType, // name - stringPtrType, // pkgPath - tm.methodSliceType, // methods - }, false) - - tm.commonTypeType.StructSetBody([]llvm.Type{ - tm.ctx.Int8Type(), // Kind - tm.ctx.Int8Type(), // align - tm.ctx.Int8Type(), // fieldAlign - uintptrType, // size - tm.ctx.Int32Type(), // hash - llvm.PointerType(tm.funcValType, 0), // hashfn - llvm.PointerType(tm.funcValType, 0), // equalfn - voidPtrType, // gc - stringPtrType, // string - llvm.PointerType(tm.uncommonTypeType, 0), // uncommonType - commonTypeTypePtr, // ptrToThis - }, false) - - tm.typeSliceType = tm.makeNamedSliceType("typeSlice", commonTypeTypePtr) - - tm.ptrTypeType = tm.ctx.StructCreateNamed("ptrType") - tm.ptrTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - commonTypeTypePtr, - }, false) - - tm.funcTypeType = tm.ctx.StructCreateNamed("funcType") - tm.funcTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - tm.ctx.Int8Type(), // dotdotdot - tm.typeSliceType, // in - tm.typeSliceType, // out - }, false) - - tm.arrayTypeType = tm.ctx.StructCreateNamed("arrayType") - tm.arrayTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - commonTypeTypePtr, // elem - commonTypeTypePtr, // slice - tm.inttype, // len - }, false) - - tm.sliceTypeType = tm.ctx.StructCreateNamed("sliceType") - tm.sliceTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - commonTypeTypePtr, // elem - }, false) - - tm.mapTypeType = tm.ctx.StructCreateNamed("mapType") - tm.mapTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - commonTypeTypePtr, // key - commonTypeTypePtr, // elem - }, false) - - tm.chanTypeType = tm.ctx.StructCreateNamed("chanType") - tm.chanTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - commonTypeTypePtr, // elem - tm.inttype, // dir - }, false) - - tm.imethodType = tm.ctx.StructCreateNamed("imethod") - tm.imethodType.StructSetBody([]llvm.Type{ - stringPtrType, // name - stringPtrType, // pkgPath - commonTypeTypePtr, // typ - }, false) - - tm.imethodSliceType = tm.makeNamedSliceType("imethodSlice", tm.imethodType) - - tm.interfaceTypeType = tm.ctx.StructCreateNamed("interfaceType") - tm.interfaceTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - tm.imethodSliceType, - }, false) - - tm.structFieldType = tm.ctx.StructCreateNamed("structField") - tm.structFieldType.StructSetBody([]llvm.Type{ - stringPtrType, // name - stringPtrType, // pkgPath - commonTypeTypePtr, // typ - stringPtrType, // tag - tm.inttype, // offset - }, false) - - tm.structFieldSliceType = tm.makeNamedSliceType("structFieldSlice", tm.structFieldType) - - tm.structTypeType = tm.ctx.StructCreateNamed("structType") - tm.structTypeType.StructSetBody([]llvm.Type{ - tm.commonTypeType, - tm.structFieldSliceType, // fields - }, false) - - tm.mapDescType = tm.ctx.StructCreateNamed("mapDesc") - tm.mapDescType.StructSetBody([]llvm.Type{ - commonTypeTypePtr, // map_descriptor - tm.inttype, // entry_size - tm.inttype, // key_offset - tm.inttype, // value_offset - }, false) - - return tm -} - -func (tm *llvmTypeMap) ToLLVM(t types.Type) llvm.Type { - return tm.toLLVM(t, "") -} - -func (tm *llvmTypeMap) toLLVM(t types.Type, name string) llvm.Type { - lt, ok := tm.types.At(t).(llvm.Type) - if !ok { - lt = tm.makeLLVMType(t, name) - if lt.IsNil() { - panic(fmt.Sprint("Failed to create LLVM type for: ", t)) - } - tm.types.Set(t, lt) - } - return lt -} - -func (tm *llvmTypeMap) makeLLVMType(t types.Type, name string) llvm.Type { - return tm.getBackendType(t).ToLLVM(tm.ctx) -} - -func (tm *llvmTypeMap) Offsetsof(fields []*types.Var) []int64 { - offsets := make([]int64, len(fields)) - var o int64 - for i, f := range fields { - a := tm.Alignof(f.Type()) - o = align(o, a) - offsets[i] = o - o += tm.Sizeof(f.Type()) - } - return offsets -} - -var basicSizes = [...]byte{ - types.Bool: 1, - types.Int8: 1, - types.Int16: 2, - types.Int32: 4, - types.Int64: 8, - types.Uint8: 1, - types.Uint16: 2, - types.Uint32: 4, - types.Uint64: 8, - types.Float32: 4, - types.Float64: 8, - types.Complex64: 8, - types.Complex128: 16, -} - -func (tm *llvmTypeMap) Sizeof(T types.Type) int64 { - switch t := T.Underlying().(type) { - case *types.Basic: - k := t.Kind() - if int(k) < len(basicSizes) { - if s := basicSizes[k]; s > 0 { - return int64(s) - } - } - if k == types.String { - return tm.sizes.WordSize * 2 - } - case *types.Array: - a := tm.Alignof(t.Elem()) - z := tm.Sizeof(t.Elem()) - return align(z, a) * t.Len() // may be 0 - case *types.Slice: - return tm.sizes.WordSize * 3 - case *types.Struct: - n := t.NumFields() - if n == 0 { - return 0 - } - fields := make([]*types.Var, t.NumFields()) - for i := 0; i != t.NumFields(); i++ { - fields[i] = t.Field(i) - } - offsets := tm.Offsetsof(fields) - return align(offsets[n-1]+tm.Sizeof(t.Field(n-1).Type()), tm.Alignof(t)) - case *types.Interface: - return tm.sizes.WordSize * 2 - } - return tm.sizes.WordSize // catch-all -} - -func (tm *llvmTypeMap) Alignof(t types.Type) int64 { - return tm.sizes.Alignof(t) -} - -/////////////////////////////////////////////////////////////////////////////// - -func (tm *TypeMap) ToRuntime(t types.Type) llvm.Value { - return llvm.ConstBitCast(tm.getTypeDescriptorPointer(t), llvm.PointerType(llvm.Int8Type(), 0)) -} - -type localNamedTypeInfo struct { - functionName string - scopeNum int -} - -type namedTypeInfo struct { - pkgname, pkgpath string - name string - localNamedTypeInfo -} - -type manglerContext struct { - ti map[*types.Named]localNamedTypeInfo - msc *types.MethodSetCache -} - -// Assembles the method set into the order that gccgo uses (unexported methods first). -// TODO(pcc): cache this. -func orderedMethodSet(ms *types.MethodSet) []*types.Selection { - oms := make([]*types.Selection, ms.Len()) - omsi := 0 - for i := 0; i != ms.Len(); i++ { - if sel := ms.At(i); !sel.Obj().Exported() { - oms[omsi] = sel - omsi++ - } - } - for i := 0; i != ms.Len(); i++ { - if sel := ms.At(i); sel.Obj().Exported() { - oms[omsi] = sel - omsi++ - } - } - return oms -} - -func (ctx *manglerContext) init(prog *ssa.Program, msc *types.MethodSetCache) { - ctx.msc = msc - ctx.ti = make(map[*types.Named]localNamedTypeInfo) - for f, _ := range ssautil.AllFunctions(prog) { - scopeNum := 0 - var addNamedTypesToMap func(*types.Scope) - addNamedTypesToMap = func(scope *types.Scope) { - hasNamedTypes := false - for _, n := range scope.Names() { - if tn, ok := scope.Lookup(n).(*types.TypeName); ok { - hasNamedTypes = true - ctx.ti[tn.Type().(*types.Named)] = localNamedTypeInfo{f.Name(), scopeNum} - } - } - if hasNamedTypes { - scopeNum++ - } - for i := 0; i != scope.NumChildren(); i++ { - addNamedTypesToMap(scope.Child(i)) - } - } - if fobj, ok := f.Object().(*types.Func); ok && fobj.Scope() != nil { - addNamedTypesToMap(fobj.Scope()) - } - } -} - -func (ctx *manglerContext) getNamedTypeInfo(t types.Type) (nti namedTypeInfo) { - switch t := t.(type) { - case *types.Basic: - switch t.Kind() { - case types.Byte: - nti.name = "uint8" - case types.Rune: - nti.name = "int32" - case types.UnsafePointer: - nti.pkgname = "unsafe" - nti.pkgpath = "unsafe" - nti.name = "Pointer" - default: - nti.name = t.Name() - } - - case *types.Named: - obj := t.Obj() - if pkg := obj.Pkg(); pkg != nil { - nti.pkgname = obj.Pkg().Name() - nti.pkgpath = obj.Pkg().Path() - } - nti.name = obj.Name() - nti.localNamedTypeInfo = ctx.ti[t] - - default: - panic("not a named type") - } - - return -} - -func (ctx *manglerContext) mangleSignature(s *types.Signature, recv *types.Var, b *bytes.Buffer) { - b.WriteRune('F') - if recv != nil { - b.WriteRune('m') - ctx.mangleType(recv.Type(), b) - } - - if p := s.Params(); p.Len() != 0 { - b.WriteRune('p') - for i := 0; i != p.Len(); i++ { - ctx.mangleType(p.At(i).Type(), b) - } - if s.Variadic() { - b.WriteRune('V') - } - b.WriteRune('e') - } - - if r := s.Results(); r.Len() != 0 { - b.WriteRune('r') - for i := 0; i != r.Len(); i++ { - ctx.mangleType(r.At(i).Type(), b) - } - b.WriteRune('e') - } - - b.WriteRune('e') -} - -func ManglePackagePath(pkgpath string) string { - pkgpath = strings.Replace(pkgpath, "/", "_", -1) - pkgpath = strings.Replace(pkgpath, ".", "_", -1) - return pkgpath -} - -func (ctx *manglerContext) mangleType(t types.Type, b *bytes.Buffer) { - switch t := t.(type) { - case *types.Basic, *types.Named: - var nb bytes.Buffer - ti := ctx.getNamedTypeInfo(t) - if ti.pkgpath != "" { - nb.WriteString(ManglePackagePath(ti.pkgpath)) - nb.WriteRune('.') - } - if ti.functionName != "" { - nb.WriteString(ti.functionName) - nb.WriteRune('$') - if ti.scopeNum != 0 { - nb.WriteString(strconv.Itoa(ti.scopeNum)) - nb.WriteRune('$') - } - } - nb.WriteString(ti.name) - - b.WriteRune('N') - b.WriteString(strconv.Itoa(nb.Len())) - b.WriteRune('_') - b.WriteString(nb.String()) - - case *types.Pointer: - b.WriteRune('p') - ctx.mangleType(t.Elem(), b) - - case *types.Map: - b.WriteRune('M') - ctx.mangleType(t.Key(), b) - b.WriteString("__") - ctx.mangleType(t.Elem(), b) - - case *types.Chan: - b.WriteRune('C') - ctx.mangleType(t.Elem(), b) - switch t.Dir() { - case types.SendOnly: - b.WriteRune('s') - case types.RecvOnly: - b.WriteRune('r') - case types.SendRecv: - b.WriteString("sr") - } - b.WriteRune('e') - - case *types.Signature: - ctx.mangleSignature(t, t.Recv(), b) - - case *types.Array: - b.WriteRune('A') - ctx.mangleType(t.Elem(), b) - b.WriteString(strconv.FormatInt(t.Len(), 10)) - b.WriteRune('e') - - case *types.Slice: - b.WriteRune('A') - ctx.mangleType(t.Elem(), b) - b.WriteRune('e') - - case *types.Struct: - b.WriteRune('S') - for i := 0; i != t.NumFields(); i++ { - f := t.Field(i) - if f.Anonymous() { - b.WriteString("0_") - } else { - b.WriteString(strconv.Itoa(len(f.Name()))) - b.WriteRune('_') - b.WriteString(f.Name()) - } - ctx.mangleType(f.Type(), b) - // TODO: tags are mangled here - } - b.WriteRune('e') - - case *types.Interface: - b.WriteRune('I') - methodset := ctx.msc.MethodSet(t) - for _, m := range orderedMethodSet(methodset) { - method := m.Obj() - var nb bytes.Buffer - if !method.Exported() { - nb.WriteRune('.') - nb.WriteString(method.Pkg().Path()) - nb.WriteRune('.') - } - nb.WriteString(method.Name()) - - b.WriteString(strconv.Itoa(nb.Len())) - b.WriteRune('_') - b.WriteString(nb.String()) - - ctx.mangleSignature(method.Type().(*types.Signature), nil, b) - } - b.WriteRune('e') - - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } -} - -func (ctx *manglerContext) mangleTypeDescriptorName(t types.Type, b *bytes.Buffer) { - switch t := t.(type) { - case *types.Basic, *types.Named: - b.WriteString("__go_tdn_") - ti := ctx.getNamedTypeInfo(t) - if ti.pkgpath != "" { - b.WriteString(ManglePackagePath(ti.pkgpath)) - b.WriteRune('.') - } - if ti.functionName != "" { - b.WriteString(ti.functionName) - b.WriteRune('.') - if ti.scopeNum != 0 { - b.WriteString(strconv.Itoa(ti.scopeNum)) - b.WriteRune('.') - } - } - b.WriteString(ti.name) - - default: - b.WriteString("__go_td_") - ctx.mangleType(t, b) - } -} - -func (ctx *manglerContext) mangleMapDescriptorName(t types.Type, b *bytes.Buffer) { - b.WriteString("__go_map_") - ctx.mangleType(t, b) -} - -func (ctx *manglerContext) mangleImtName(srctype types.Type, targettype *types.Interface, b *bytes.Buffer) { - b.WriteString("__go_imt_") - ctx.mangleType(targettype, b) - b.WriteString("__") - ctx.mangleType(srctype, b) -} - -func (ctx *manglerContext) mangleHashFunctionName(t types.Type) string { - var b bytes.Buffer - b.WriteString("__go_type_hash_") - ctx.mangleType(t, &b) - return b.String() -} - -func (ctx *manglerContext) mangleEqualFunctionName(t types.Type) string { - var b bytes.Buffer - b.WriteString("__go_type_equal_") - ctx.mangleType(t, &b) - return b.String() -} - -func (ctx *manglerContext) mangleFunctionName(f *ssa.Function) string { - var b bytes.Buffer - - if f.Parent() != nil { - // Anonymous functions are not guaranteed to - // have unique identifiers at the global scope. - b.WriteString(ctx.mangleFunctionName(f.Parent())) - b.WriteRune(':') - b.WriteString(f.String()) - return b.String() - } - - // Synthetic bound and thunk functions are special cases; they can only be - // distinguished using private data that is only exposed via String(). - if strings.HasSuffix(f.Name(), "$bound") || strings.HasSuffix(f.Name(), "$thunk") { - b.WriteString(f.String()) - return b.String() - } - - var pkg *types.Package - if f.Pkg != nil { - pkg = f.Pkg.Object - } else if !f.Object().Exported() { - pkg = f.Object().Pkg() - } - - if pkg != nil { - b.WriteString(ManglePackagePath(pkg.Path())) - b.WriteRune('.') - } - - if f.Signature.Recv() == nil && f.Name() == "init" { - b.WriteString(".import") - } else { - b.WriteString(f.Name()) - } - if f.Signature.Recv() != nil { - b.WriteRune('.') - ctx.mangleType(f.Signature.Recv().Type(), &b) - } - - return b.String() -} - -func (ctx *manglerContext) mangleGlobalName(g *ssa.Global) string { - var b bytes.Buffer - - b.WriteString(ManglePackagePath(g.Pkg.Object.Path())) - b.WriteRune('.') - b.WriteString(g.Name()) - - return b.String() -} - -const ( - // From gofrontend/types.h - gccgoTypeClassERROR = iota - gccgoTypeClassVOID - gccgoTypeClassBOOLEAN - gccgoTypeClassINTEGER - gccgoTypeClassFLOAT - gccgoTypeClassCOMPLEX - gccgoTypeClassSTRING - gccgoTypeClassSINK - gccgoTypeClassFUNCTION - gccgoTypeClassPOINTER - gccgoTypeClassNIL - gccgoTypeClassCALL_MULTIPLE_RESULT - gccgoTypeClassSTRUCT - gccgoTypeClassARRAY - gccgoTypeClassMAP - gccgoTypeClassCHANNEL - gccgoTypeClassINTERFACE - gccgoTypeClassNAMED - gccgoTypeClassFORWARD -) - -func getStringHash(s string, h uint32) uint32 { - for _, c := range []byte(s) { - h ^= uint32(c) - h += 16777619 - } - return h -} - -func (tm *TypeMap) getTypeHash(t types.Type) uint32 { - switch t := t.(type) { - case *types.Basic, *types.Named: - nti := tm.mc.getNamedTypeInfo(t) - h := getStringHash(nti.functionName+nti.name+nti.pkgpath, 0) - h ^= uint32(nti.scopeNum) - return gccgoTypeClassNAMED + h - - case *types.Signature: - var h uint32 - - p := t.Params() - for i := 0; i != p.Len(); i++ { - h += tm.getTypeHash(p.At(i).Type()) << uint32(i+1) - } - - r := t.Results() - for i := 0; i != r.Len(); i++ { - h += tm.getTypeHash(r.At(i).Type()) << uint32(i+2) - } - - if t.Variadic() { - h += 1 - } - h <<= 4 - return gccgoTypeClassFUNCTION + h - - case *types.Pointer: - return gccgoTypeClassPOINTER + (tm.getTypeHash(t.Elem()) << 4) - - case *types.Struct: - var h uint32 - for i := 0; i != t.NumFields(); i++ { - h = (h << 1) + tm.getTypeHash(t.Field(i).Type()) - } - h <<= 2 - return gccgoTypeClassSTRUCT + h - - case *types.Array: - return gccgoTypeClassARRAY + tm.getTypeHash(t.Elem()) + 1 - - case *types.Slice: - return gccgoTypeClassARRAY + tm.getTypeHash(t.Elem()) + 1 - - case *types.Map: - return gccgoTypeClassMAP + tm.getTypeHash(t.Key()) + tm.getTypeHash(t.Elem()) + 2 - - case *types.Chan: - var h uint32 - - switch t.Dir() { - case types.SendOnly: - h = 1 - case types.RecvOnly: - h = 2 - case types.SendRecv: - h = 3 - } - - h += tm.getTypeHash(t.Elem()) << 2 - h <<= 3 - return gccgoTypeClassCHANNEL + h - - case *types.Interface: - var h uint32 - for _, m := range orderedMethodSet(tm.MethodSet(t)) { - h = getStringHash(m.Obj().Name(), h) - h <<= 1 - } - return gccgoTypeClassINTERFACE + h - - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } -} - -func (tm *TypeMap) writeType(typ types.Type, b *bytes.Buffer) { - switch t := typ.(type) { - case *types.Basic, *types.Named: - ti := tm.mc.getNamedTypeInfo(t) - if ti.pkgpath != "" { - b.WriteByte('\t') - b.WriteString(ManglePackagePath(ti.pkgpath)) - b.WriteByte('\t') - b.WriteString(ti.pkgname) - b.WriteByte('.') - } - if ti.functionName != "" { - b.WriteByte('\t') - b.WriteString(ti.functionName) - b.WriteByte('$') - if ti.scopeNum != 0 { - b.WriteString(strconv.Itoa(ti.scopeNum)) - b.WriteByte('$') - } - b.WriteByte('\t') - } - b.WriteString(ti.name) - - case *types.Array: - fmt.Fprintf(b, "[%d]", t.Len()) - tm.writeType(t.Elem(), b) - - case *types.Slice: - b.WriteString("[]") - tm.writeType(t.Elem(), b) - - case *types.Struct: - if t.NumFields() == 0 { - b.WriteString("struct {}") - return - } - b.WriteString("struct { ") - for i := 0; i != t.NumFields(); i++ { - f := t.Field(i) - if i > 0 { - b.WriteString("; ") - } - if !f.Anonymous() { - b.WriteString(f.Name()) - b.WriteByte(' ') - } - tm.writeType(f.Type(), b) - if tag := t.Tag(i); tag != "" { - fmt.Fprintf(b, " %q", tag) - } - } - b.WriteString(" }") - - case *types.Pointer: - b.WriteByte('*') - tm.writeType(t.Elem(), b) - - case *types.Signature: - b.WriteString("func") - tm.writeSignature(t, b) - - case *types.Interface: - if t.NumMethods() == 0 && t.NumEmbeddeds() == 0 { - b.WriteString("interface {}") - return - } - // We write the source-level methods and embedded types rather - // than the actual method set since resolved method signatures - // may have non-printable cycles if parameters have anonymous - // interface types that (directly or indirectly) embed the - // current interface. For instance, consider the result type - // of m: - // - // type T interface{ - // m() interface{ T } - // } - // - b.WriteString("interface { ") - // print explicit interface methods and embedded types - for i := 0; i != t.NumMethods(); i++ { - m := t.Method(i) - if i > 0 { - b.WriteString("; ") - } - if !m.Exported() { - b.WriteString(m.Pkg().Path()) - b.WriteByte('.') - } - b.WriteString(m.Name()) - tm.writeSignature(m.Type().(*types.Signature), b) - } - for i := 0; i != t.NumEmbeddeds(); i++ { - typ := t.Embedded(i) - if i > 0 || t.NumMethods() > 0 { - b.WriteString("; ") - } - tm.writeType(typ, b) - } - b.WriteString(" }") - - case *types.Map: - b.WriteString("map[") - tm.writeType(t.Key(), b) - b.WriteByte(']') - tm.writeType(t.Elem(), b) - - case *types.Chan: - var s string - var parens bool - switch t.Dir() { - case types.SendRecv: - s = "chan " - // chan (<-chan T) requires parentheses - if c, _ := t.Elem().(*types.Chan); c != nil && c.Dir() == types.RecvOnly { - parens = true - } - case types.SendOnly: - s = "chan<- " - case types.RecvOnly: - s = "<-chan " - default: - panic("unreachable") - } - b.WriteString(s) - if parens { - b.WriteByte('(') - } - tm.writeType(t.Elem(), b) - if parens { - b.WriteByte(')') - } - - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } -} - -func (tm *TypeMap) writeTuple(tup *types.Tuple, variadic bool, b *bytes.Buffer) { - b.WriteByte('(') - if tup != nil { - for i := 0; i != tup.Len(); i++ { - v := tup.At(i) - if i > 0 { - b.WriteString(", ") - } - typ := v.Type() - if variadic && i == tup.Len()-1 { - b.WriteString("...") - typ = typ.(*types.Slice).Elem() - } - tm.writeType(typ, b) - } - } - b.WriteByte(')') -} - -func (tm *TypeMap) writeSignature(sig *types.Signature, b *bytes.Buffer) { - tm.writeTuple(sig.Params(), sig.Variadic(), b) - - n := sig.Results().Len() - if n == 0 { - // no result - return - } - - b.WriteByte(' ') - if n == 1 { - tm.writeType(sig.Results().At(0).Type(), b) - return - } - - // multiple results - tm.writeTuple(sig.Results(), false, b) -} - -func (tm *TypeMap) getTypeDescType(t types.Type) llvm.Type { - switch t.Underlying().(type) { - case *types.Basic: - return tm.commonTypeType - case *types.Pointer: - return tm.ptrTypeType - case *types.Signature: - return tm.funcTypeType - case *types.Array: - return tm.arrayTypeType - case *types.Slice: - return tm.sliceTypeType - case *types.Map: - return tm.mapTypeType - case *types.Chan: - return tm.chanTypeType - case *types.Struct: - return tm.structTypeType - case *types.Interface: - return tm.interfaceTypeType - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } -} - -func (tm *TypeMap) getNamedTypeLinkage(nt *types.Named) (linkage llvm.Linkage, emit bool) { - if pkg := nt.Obj().Pkg(); pkg != nil { - linkage = llvm.ExternalLinkage - emit = pkg.Path() == tm.pkgpath - } else { - linkage = llvm.LinkOnceODRLinkage - emit = true - } - - return -} - -func (tm *TypeMap) getTypeDescLinkage(t types.Type) (linkage llvm.Linkage, emit bool) { - switch t := t.(type) { - case *types.Named: - linkage, emit = tm.getNamedTypeLinkage(t) - - case *types.Pointer: - elem := t.Elem() - if nt, ok := elem.(*types.Named); ok { - // Thanks to the ptrToThis member, pointers to named types appear - // in exactly the same objects as the named types themselves, so - // we can give them the same linkage. - linkage, emit = tm.getNamedTypeLinkage(nt) - return - } - linkage = llvm.LinkOnceODRLinkage - emit = true - - default: - linkage = llvm.LinkOnceODRLinkage - emit = true - } - - return -} - -type typeAndInfo struct { - typ types.Type - typeString string - tdi *typeDescInfo -} - -type byTypeName []typeAndInfo - -func (ts byTypeName) Len() int { return len(ts) } -func (ts byTypeName) Swap(i, j int) { - ts[i], ts[j] = ts[j], ts[i] -} -func (ts byTypeName) Less(i, j int) bool { - return ts[i].typeString < ts[j].typeString -} - -func (tm *TypeMap) emitTypeDescInitializers() { - var maxSize, maxAlign int64 - maxAlign = 1 - - for changed := true; changed; { - changed = false - - var ts []typeAndInfo - - tm.types.Iterate(func(key types.Type, value interface{}) { - tdi := value.(*typeDescInfo) - if tdi.global.Initializer().C == nil { - linkage, emit := tm.getTypeDescLinkage(key) - tdi.global.SetLinkage(linkage) - tdi.gc.SetLinkage(linkage) - if emit { - changed = true - ts = append(ts, typeAndInfo{key, key.String(), tdi}) - } - } - }) - - if changed { - sort.Sort(byTypeName(ts)) - for _, t := range ts { - tm.emitTypeDescInitializer(t.typ, t.tdi) - if size := tm.Sizeof(t.typ); size > maxSize { - maxSize = size - } - if align := tm.Alignof(t.typ); align > maxAlign { - maxAlign = align - } - } - } - } -} - -const ( - // From libgo/runtime/mgc0.h - gcOpcodeEND = iota - gcOpcodePTR - gcOpcodeAPTR - gcOpcodeARRAY_START - gcOpcodeARRAY_NEXT - gcOpcodeCALL - gcOpcodeCHAN_PTR - gcOpcodeSTRING - gcOpcodeEFACE - gcOpcodeIFACE - gcOpcodeSLICE - gcOpcodeREGION - - gcStackCapacity = 8 -) - -func (tm *TypeMap) makeGcInst(val int64) llvm.Value { - c := llvm.ConstInt(tm.inttype, uint64(val), false) - return llvm.ConstIntToPtr(c, llvm.PointerType(tm.ctx.Int8Type(), 0)) -} - -func (tm *TypeMap) appendGcInsts(insts []llvm.Value, t types.Type, offset, stackSize int64) []llvm.Value { - switch u := t.Underlying().(type) { - case *types.Basic: - switch u.Kind() { - case types.String: - insts = append(insts, tm.makeGcInst(gcOpcodeSTRING), tm.makeGcInst(offset)) - case types.UnsafePointer: - insts = append(insts, tm.makeGcInst(gcOpcodeAPTR), tm.makeGcInst(offset)) - } - case *types.Pointer: - insts = append(insts, tm.makeGcInst(gcOpcodePTR), tm.makeGcInst(offset), - tm.getGcPointer(u.Elem())) - case *types.Signature, *types.Map: - insts = append(insts, tm.makeGcInst(gcOpcodeAPTR), tm.makeGcInst(offset)) - case *types.Array: - if u.Len() == 0 { - return insts - } else if stackSize >= gcStackCapacity { - insts = append(insts, tm.makeGcInst(gcOpcodeREGION), tm.makeGcInst(offset), - tm.makeGcInst(tm.Sizeof(t)), tm.getGcPointer(t)) - } else { - insts = append(insts, tm.makeGcInst(gcOpcodeARRAY_START), tm.makeGcInst(offset), - tm.makeGcInst(u.Len()), tm.makeGcInst(tm.Sizeof(u.Elem()))) - insts = tm.appendGcInsts(insts, u.Elem(), 0, stackSize+1) - insts = append(insts, tm.makeGcInst(gcOpcodeARRAY_NEXT)) - } - case *types.Slice: - if tm.Sizeof(u.Elem()) == 0 { - insts = append(insts, tm.makeGcInst(gcOpcodeAPTR), tm.makeGcInst(offset)) - } else { - insts = append(insts, tm.makeGcInst(gcOpcodeSLICE), tm.makeGcInst(offset), - tm.getGcPointer(u.Elem())) - } - case *types.Chan: - insts = append(insts, tm.makeGcInst(gcOpcodeCHAN_PTR), tm.makeGcInst(offset), - tm.ToRuntime(t)) - case *types.Struct: - fields := make([]*types.Var, u.NumFields()) - for i := range fields { - fields[i] = u.Field(i) - } - offsets := tm.Offsetsof(fields) - - for i, field := range fields { - insts = tm.appendGcInsts(insts, field.Type(), offset+offsets[i], stackSize) - } - case *types.Interface: - if u.NumMethods() == 0 { - insts = append(insts, tm.makeGcInst(gcOpcodeEFACE), tm.makeGcInst(offset)) - } else { - insts = append(insts, tm.makeGcInst(gcOpcodeIFACE), tm.makeGcInst(offset)) - } - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } - - return insts -} - -func (tm *TypeMap) emitTypeDescInitializer(t types.Type, tdi *typeDescInfo) { - // initialize type descriptor - tdi.global.SetInitializer(tm.makeTypeDescInitializer(t)) - - // initialize GC program - insts := []llvm.Value{tm.makeGcInst(tm.Sizeof(t))} - insts = tm.appendGcInsts(insts, t, 0, 0) - insts = append(insts, tm.makeGcInst(gcOpcodeEND)) - - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - instArray := llvm.ConstArray(i8ptr, insts) - - newGc := llvm.AddGlobal(tm.module, instArray.Type(), "") - newGc.SetGlobalConstant(true) - newGc.SetInitializer(instArray) - gcName := tdi.gc.Name() - tdi.gc.SetName("") - newGc.SetName(gcName) - newGc.SetLinkage(tdi.gc.Linkage()) - - tdi.gc.ReplaceAllUsesWith(llvm.ConstBitCast(newGc, tdi.gc.Type())) - tdi.gc.EraseFromParentAsGlobal() - tdi.gc = llvm.Value{nil} - tdi.gcPtr = llvm.ConstBitCast(newGc, i8ptr) -} - -func (tm *TypeMap) makeTypeDescInitializer(t types.Type) llvm.Value { - switch u := t.Underlying().(type) { - case *types.Basic: - return tm.makeBasicType(t, u) - case *types.Pointer: - return tm.makePointerType(t, u) - case *types.Signature: - return tm.makeFuncType(t, u) - case *types.Array: - return tm.makeArrayType(t, u) - case *types.Slice: - return tm.makeSliceType(t, u) - case *types.Map: - return tm.makeMapType(t, u) - case *types.Chan: - return tm.makeChanType(t, u) - case *types.Struct: - return tm.makeStructType(t, u) - case *types.Interface: - return tm.makeInterfaceType(t, u) - default: - panic(fmt.Sprintf("unhandled type: %#v", t)) - } -} - -func (tm *TypeMap) getStructAlgorithms(st *types.Struct) algorithms { - if algs, ok := tm.algs.At(st).(algorithms); ok { - return algs - } - - hashes := make([]llvm.Value, st.NumFields()) - equals := make([]llvm.Value, st.NumFields()) - - for i := range hashes { - algs := tm.getAlgorithms(st.Field(i).Type()) - if algs.hashDescriptor == tm.algsError.hashDescriptor { - return algs - } - hashes[i], equals[i] = algs.hash, algs.equal - } - - i8ptr := llvm.PointerType(tm.ctx.Int8Type(), 0) - llsptrty := llvm.PointerType(tm.ToLLVM(st), 0) - - builder := tm.ctx.NewBuilder() - defer builder.Dispose() - - hashFunctionName := tm.mc.mangleHashFunctionName(st) - hash := llvm.AddFunction(tm.module, hashFunctionName, tm.hashFnType) - hash.SetLinkage(llvm.LinkOnceODRLinkage) - hashDescriptor := tm.createAlgorithmDescriptor(hashFunctionName+"_descriptor", hash) - - builder.SetInsertPointAtEnd(llvm.AddBasicBlock(hash, "entry")) - sptr := builder.CreateBitCast(hash.Param(0), llsptrty, "") - - hashval := llvm.ConstNull(tm.inttype) - i33 := llvm.ConstInt(tm.inttype, 33, false) - - for i, fhash := range hashes { - fptr := builder.CreateStructGEP(sptr, i, "") - fptr = builder.CreateBitCast(fptr, i8ptr, "") - fsize := llvm.ConstInt(tm.inttype, uint64(tm.sizes.Sizeof(st.Field(i).Type())), false) - hashcall := builder.CreateCall(fhash, []llvm.Value{fptr, fsize}, "") - hashval = builder.CreateMul(hashval, i33, "") - hashval = builder.CreateAdd(hashval, hashcall, "") - } - - builder.CreateRet(hashval) - - equalFunctionName := tm.mc.mangleEqualFunctionName(st) - equal := llvm.AddFunction(tm.module, equalFunctionName, tm.equalFnType) - equal.SetLinkage(llvm.LinkOnceODRLinkage) - equalDescriptor := tm.createAlgorithmDescriptor(equalFunctionName+"_descriptor", equal) - - eqentrybb := llvm.AddBasicBlock(equal, "entry") - eqretzerobb := llvm.AddBasicBlock(equal, "retzero") - builder.SetInsertPointAtEnd(eqentrybb) - s1ptr := builder.CreateBitCast(equal.Param(0), llsptrty, "") - s2ptr := builder.CreateBitCast(equal.Param(1), llsptrty, "") - - zerobool := llvm.ConstNull(tm.ctx.Int8Type()) - onebool := llvm.ConstInt(tm.ctx.Int8Type(), 1, false) - - for i, fequal := range equals { - f1ptr := builder.CreateStructGEP(s1ptr, i, "") - f1ptr = builder.CreateBitCast(f1ptr, i8ptr, "") - f2ptr := builder.CreateStructGEP(s2ptr, i, "") - f2ptr = builder.CreateBitCast(f2ptr, i8ptr, "") - fsize := llvm.ConstInt(tm.inttype, uint64(tm.sizes.Sizeof(st.Field(i).Type())), false) - equalcall := builder.CreateCall(fequal, []llvm.Value{f1ptr, f2ptr, fsize}, "") - equaleqzero := builder.CreateICmp(llvm.IntEQ, equalcall, zerobool, "") - contbb := llvm.AddBasicBlock(equal, "cont") - builder.CreateCondBr(equaleqzero, eqretzerobb, contbb) - builder.SetInsertPointAtEnd(contbb) - } - - builder.CreateRet(onebool) - - builder.SetInsertPointAtEnd(eqretzerobb) - builder.CreateRet(zerobool) - - algs := algorithms{ - hash: hash, - hashDescriptor: hashDescriptor, - equal: equal, - equalDescriptor: equalDescriptor, - } - tm.algs.Set(st, algs) - return algs -} - -func (tm *TypeMap) getArrayAlgorithms(at *types.Array) algorithms { - if algs, ok := tm.algs.At(at).(algorithms); ok { - return algs - } - - elemAlgs := tm.getAlgorithms(at.Elem()) - if elemAlgs.hashDescriptor == tm.algsError.hashDescriptor { - return elemAlgs - } - - i8ptr := llvm.PointerType(tm.ctx.Int8Type(), 0) - llelemty := llvm.PointerType(tm.ToLLVM(at.Elem()), 0) - - i1 := llvm.ConstInt(tm.inttype, 1, false) - alen := llvm.ConstInt(tm.inttype, uint64(at.Len()), false) - esize := llvm.ConstInt(tm.inttype, uint64(tm.sizes.Sizeof(at.Elem())), false) - - builder := tm.ctx.NewBuilder() - defer builder.Dispose() - - hashFunctionName := tm.mc.mangleHashFunctionName(at) - hash := llvm.AddFunction(tm.module, hashFunctionName, tm.hashFnType) - hash.SetLinkage(llvm.LinkOnceODRLinkage) - hashDescriptor := tm.createAlgorithmDescriptor(hashFunctionName+"_descriptor", hash) - equalFunctionName := tm.mc.mangleHashFunctionName(at) - equal := llvm.AddFunction(tm.module, equalFunctionName, tm.equalFnType) - equal.SetLinkage(llvm.LinkOnceODRLinkage) - equalDescriptor := tm.createAlgorithmDescriptor(equalFunctionName+"_descriptor", equal) - algs := algorithms{ - hash: hash, - hashDescriptor: hashDescriptor, - equal: equal, - equalDescriptor: equalDescriptor, - } - tm.algs.Set(at, algs) - - hashentrybb := llvm.AddBasicBlock(hash, "entry") - builder.SetInsertPointAtEnd(hashentrybb) - if at.Len() == 0 { - builder.CreateRet(llvm.ConstNull(tm.inttype)) - } else { - i33 := llvm.ConstInt(tm.inttype, 33, false) - - aptr := builder.CreateBitCast(hash.Param(0), llelemty, "") - loopbb := llvm.AddBasicBlock(hash, "loop") - builder.CreateBr(loopbb) - - exitbb := llvm.AddBasicBlock(hash, "exit") - - builder.SetInsertPointAtEnd(loopbb) - indexphi := builder.CreatePHI(tm.inttype, "") - index := indexphi - hashvalphi := builder.CreatePHI(tm.inttype, "") - hashval := hashvalphi - - eptr := builder.CreateGEP(aptr, []llvm.Value{index}, "") - eptr = builder.CreateBitCast(eptr, i8ptr, "") - - hashcall := builder.CreateCall(elemAlgs.hash, []llvm.Value{eptr, esize}, "") - hashval = builder.CreateMul(hashval, i33, "") - hashval = builder.CreateAdd(hashval, hashcall, "") - - index = builder.CreateAdd(index, i1, "") - - indexphi.AddIncoming( - []llvm.Value{llvm.ConstNull(tm.inttype), index}, - []llvm.BasicBlock{hashentrybb, loopbb}, - ) - hashvalphi.AddIncoming( - []llvm.Value{llvm.ConstNull(tm.inttype), hashval}, - []llvm.BasicBlock{hashentrybb, loopbb}, - ) - - exit := builder.CreateICmp(llvm.IntEQ, index, alen, "") - builder.CreateCondBr(exit, exitbb, loopbb) - - builder.SetInsertPointAtEnd(exitbb) - builder.CreateRet(hashval) - } - - zerobool := llvm.ConstNull(tm.ctx.Int8Type()) - onebool := llvm.ConstInt(tm.ctx.Int8Type(), 1, false) - - eqentrybb := llvm.AddBasicBlock(equal, "entry") - builder.SetInsertPointAtEnd(eqentrybb) - if at.Len() == 0 { - builder.CreateRet(onebool) - } else { - a1ptr := builder.CreateBitCast(equal.Param(0), llelemty, "") - a2ptr := builder.CreateBitCast(equal.Param(1), llelemty, "") - loopbb := llvm.AddBasicBlock(equal, "loop") - builder.CreateBr(loopbb) - - exitbb := llvm.AddBasicBlock(equal, "exit") - retzerobb := llvm.AddBasicBlock(equal, "retzero") - - builder.SetInsertPointAtEnd(loopbb) - indexphi := builder.CreatePHI(tm.inttype, "") - index := indexphi - - e1ptr := builder.CreateGEP(a1ptr, []llvm.Value{index}, "") - e1ptr = builder.CreateBitCast(e1ptr, i8ptr, "") - e2ptr := builder.CreateGEP(a2ptr, []llvm.Value{index}, "") - e2ptr = builder.CreateBitCast(e2ptr, i8ptr, "") - - equalcall := builder.CreateCall(elemAlgs.equal, []llvm.Value{e1ptr, e2ptr, esize}, "") - equaleqzero := builder.CreateICmp(llvm.IntEQ, equalcall, zerobool, "") - - contbb := llvm.AddBasicBlock(equal, "cont") - builder.CreateCondBr(equaleqzero, retzerobb, contbb) - - builder.SetInsertPointAtEnd(contbb) - - index = builder.CreateAdd(index, i1, "") - - indexphi.AddIncoming( - []llvm.Value{llvm.ConstNull(tm.inttype), index}, - []llvm.BasicBlock{eqentrybb, contbb}, - ) - - exit := builder.CreateICmp(llvm.IntEQ, index, alen, "") - builder.CreateCondBr(exit, exitbb, loopbb) - - builder.SetInsertPointAtEnd(exitbb) - builder.CreateRet(onebool) - - builder.SetInsertPointAtEnd(retzerobb) - builder.CreateRet(zerobool) - } - - return algs -} - -func (tm *TypeMap) createAlgorithmDescriptor(name string, fn llvm.Value) llvm.Value { - d := llvm.AddGlobal(tm.module, tm.funcValType, name) - d.SetLinkage(llvm.LinkOnceODRLinkage) - d.SetGlobalConstant(true) - fn = llvm.ConstBitCast(fn, tm.funcValType.StructElementTypes()[0]) - init := llvm.ConstNull(tm.funcValType) - init = llvm.ConstInsertValue(init, fn, []uint32{0}) - d.SetInitializer(init) - return d -} - -func (tm *TypeMap) getAlgorithms(t types.Type) algorithms { - switch t := t.Underlying().(type) { - case *types.Interface: - if t.NumMethods() == 0 { - return tm.algsEmptyInterface - } - return tm.algsInterface - case *types.Basic: - switch t.Kind() { - case types.Float32, types.Float64: - return tm.algsFloat - case types.Complex64, types.Complex128: - return tm.algsComplex - case types.String: - return tm.algsString - } - return tm.algsIdentity - case *types.Signature, *types.Map, *types.Slice: - return tm.algsError - case *types.Struct: - return tm.getStructAlgorithms(t) - case *types.Array: - return tm.getArrayAlgorithms(t) - } - return tm.algsIdentity -} - -func (tm *TypeMap) getTypeDescInfo(t types.Type) *typeDescInfo { - if tdi, ok := tm.types.At(t).(*typeDescInfo); ok { - return tdi - } - - var b bytes.Buffer - tm.mc.mangleTypeDescriptorName(t, &b) - - global := llvm.AddGlobal(tm.module, tm.getTypeDescType(t), b.String()) - global.SetGlobalConstant(true) - ptr := llvm.ConstBitCast(global, llvm.PointerType(tm.commonTypeType, 0)) - - gc := llvm.AddGlobal(tm.module, llvm.PointerType(llvm.Int8Type(), 0), b.String()+"$gc") - gc.SetGlobalConstant(true) - gcPtr := llvm.ConstBitCast(gc, llvm.PointerType(tm.ctx.Int8Type(), 0)) - - var mapDescPtr llvm.Value - if m, ok := t.Underlying().(*types.Map); ok { - var mapb bytes.Buffer - tm.mc.mangleMapDescriptorName(t, &mapb) - - mapDescPtr = llvm.AddGlobal(tm.module, tm.mapDescType, mapb.String()) - mapDescPtr.SetGlobalConstant(true) - mapDescPtr.SetLinkage(llvm.LinkOnceODRLinkage) - mapDescPtr.SetInitializer(tm.makeMapDesc(ptr, m)) - } - - tdi := &typeDescInfo{ - global: global, - commonTypePtr: ptr, - mapDescPtr: mapDescPtr, - gc: gc, - gcPtr: gcPtr, - } - tm.types.Set(t, tdi) - return tdi -} - -func (tm *TypeMap) getTypeDescriptorPointer(t types.Type) llvm.Value { - return tm.getTypeDescInfo(t).commonTypePtr -} - -func (tm *TypeMap) getMapDescriptorPointer(t types.Type) llvm.Value { - return tm.getTypeDescInfo(t).mapDescPtr -} - -func (tm *TypeMap) getGcPointer(t types.Type) llvm.Value { - return tm.getTypeDescInfo(t).gcPtr -} - -func (tm *TypeMap) getItabPointer(srctype types.Type, targettype *types.Interface) llvm.Value { - if targettype.NumMethods() == 0 { - return tm.ToRuntime(srctype) - } else { - return tm.getImtPointer(srctype, targettype) - } -} - -func (tm *TypeMap) getImtPointer(srctype types.Type, targettype *types.Interface) llvm.Value { - tdi := tm.getTypeDescInfo(srctype) - - if ptr, ok := tdi.interfaceMethodTables.At(targettype).(llvm.Value); ok { - return ptr - } - - srcms := tm.MethodSet(srctype) - targetms := tm.MethodSet(targettype) - - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - - elems := make([]llvm.Value, targetms.Len()+1) - elems[0] = tm.ToRuntime(srctype) - for i, targetm := range orderedMethodSet(targetms) { - srcm := srcms.Lookup(targetm.Obj().Pkg(), targetm.Obj().Name()) - - elems[i+1] = tm.methodResolver.ResolveMethod(srcm).value - } - imtinit := llvm.ConstArray(i8ptr, elems) - - var b bytes.Buffer - tm.mc.mangleImtName(srctype, targettype, &b) - imt := llvm.AddGlobal(tm.module, imtinit.Type(), b.String()) - imt.SetGlobalConstant(true) - imt.SetInitializer(imtinit) - imt.SetLinkage(llvm.LinkOnceODRLinkage) - - imtptr := llvm.ConstBitCast(imt, i8ptr) - tdi.interfaceMethodTables.Set(targettype, imtptr) - return imtptr -} - -const ( - // From gofrontend/types.h - gccgoRuntimeTypeKindBOOL = 1 - gccgoRuntimeTypeKindINT = 2 - gccgoRuntimeTypeKindINT8 = 3 - gccgoRuntimeTypeKindINT16 = 4 - gccgoRuntimeTypeKindINT32 = 5 - gccgoRuntimeTypeKindINT64 = 6 - gccgoRuntimeTypeKindUINT = 7 - gccgoRuntimeTypeKindUINT8 = 8 - gccgoRuntimeTypeKindUINT16 = 9 - gccgoRuntimeTypeKindUINT32 = 10 - gccgoRuntimeTypeKindUINT64 = 11 - gccgoRuntimeTypeKindUINTPTR = 12 - gccgoRuntimeTypeKindFLOAT32 = 13 - gccgoRuntimeTypeKindFLOAT64 = 14 - gccgoRuntimeTypeKindCOMPLEX64 = 15 - gccgoRuntimeTypeKindCOMPLEX128 = 16 - gccgoRuntimeTypeKindARRAY = 17 - gccgoRuntimeTypeKindCHAN = 18 - gccgoRuntimeTypeKindFUNC = 19 - gccgoRuntimeTypeKindINTERFACE = 20 - gccgoRuntimeTypeKindMAP = 21 - gccgoRuntimeTypeKindPTR = 22 - gccgoRuntimeTypeKindSLICE = 23 - gccgoRuntimeTypeKindSTRING = 24 - gccgoRuntimeTypeKindSTRUCT = 25 - gccgoRuntimeTypeKindUNSAFE_POINTER = 26 - gccgoRuntimeTypeKindDIRECT_IFACE = (1 << 5) - gccgoRuntimeTypeKindNO_POINTERS = (1 << 7) -) - -func hasPointers(t types.Type) bool { - switch t := t.(type) { - case *types.Basic: - return t.Kind() == types.String || t.Kind() == types.UnsafePointer - - case *types.Signature, *types.Pointer, *types.Slice, *types.Map, *types.Chan, *types.Interface: - return true - - case *types.Struct: - for i := 0; i != t.NumFields(); i++ { - if hasPointers(t.Field(i).Type()) { - return true - } - } - return false - - case *types.Named: - return hasPointers(t.Underlying()) - - case *types.Array: - return hasPointers(t.Elem()) - - default: - panic("unrecognized type") - } -} - -func runtimeTypeKind(t types.Type) (k uint8) { - switch t := t.(type) { - case *types.Basic: - switch t.Kind() { - case types.Bool: - k = gccgoRuntimeTypeKindBOOL - case types.Int: - k = gccgoRuntimeTypeKindINT - case types.Int8: - k = gccgoRuntimeTypeKindINT8 - case types.Int16: - k = gccgoRuntimeTypeKindINT16 - case types.Int32: - k = gccgoRuntimeTypeKindINT32 - case types.Int64: - k = gccgoRuntimeTypeKindINT64 - case types.Uint: - k = gccgoRuntimeTypeKindUINT - case types.Uint8: - k = gccgoRuntimeTypeKindUINT8 - case types.Uint16: - k = gccgoRuntimeTypeKindUINT16 - case types.Uint32: - k = gccgoRuntimeTypeKindUINT32 - case types.Uint64: - k = gccgoRuntimeTypeKindUINT64 - case types.Uintptr: - k = gccgoRuntimeTypeKindUINTPTR - case types.Float32: - k = gccgoRuntimeTypeKindFLOAT32 - case types.Float64: - k = gccgoRuntimeTypeKindFLOAT64 - case types.Complex64: - k = gccgoRuntimeTypeKindCOMPLEX64 - case types.Complex128: - k = gccgoRuntimeTypeKindCOMPLEX128 - case types.String: - k = gccgoRuntimeTypeKindSTRING - case types.UnsafePointer: - k = gccgoRuntimeTypeKindUNSAFE_POINTER | gccgoRuntimeTypeKindDIRECT_IFACE - default: - panic("unrecognized builtin type") - } - case *types.Array: - k = gccgoRuntimeTypeKindARRAY - case *types.Slice: - k = gccgoRuntimeTypeKindSLICE - case *types.Struct: - k = gccgoRuntimeTypeKindSTRUCT - case *types.Pointer: - k = gccgoRuntimeTypeKindPTR | gccgoRuntimeTypeKindDIRECT_IFACE - case *types.Signature: - k = gccgoRuntimeTypeKindFUNC - case *types.Interface: - k = gccgoRuntimeTypeKindINTERFACE - case *types.Map: - k = gccgoRuntimeTypeKindMAP - case *types.Chan: - k = gccgoRuntimeTypeKindCHAN - case *types.Named: - return runtimeTypeKind(t.Underlying()) - default: - panic("unrecognized type") - } - - if !hasPointers(t) { - k |= gccgoRuntimeTypeKindNO_POINTERS - } - - return -} - -func (tm *TypeMap) makeCommonType(t types.Type) llvm.Value { - var vals [11]llvm.Value - vals[0] = llvm.ConstInt(tm.ctx.Int8Type(), uint64(runtimeTypeKind(t)), false) - vals[1] = llvm.ConstInt(tm.ctx.Int8Type(), uint64(tm.Alignof(t)), false) - vals[2] = vals[1] - vals[3] = llvm.ConstInt(tm.inttype, uint64(tm.Sizeof(t)), false) - vals[4] = llvm.ConstInt(tm.ctx.Int32Type(), uint64(tm.getTypeHash(t)), false) - algs := tm.getAlgorithms(t) - vals[5] = algs.hashDescriptor - vals[6] = algs.equalDescriptor - vals[7] = tm.getGcPointer(t) - var b bytes.Buffer - tm.writeType(t, &b) - vals[8] = tm.globalStringPtr(b.String()) - vals[9] = tm.makeUncommonTypePtr(t) - switch t.(type) { - case *types.Named, *types.Struct: - vals[10] = tm.getTypeDescriptorPointer(types.NewPointer(t)) - default: - vals[10] = llvm.ConstPointerNull(llvm.PointerType(tm.commonTypeType, 0)) - } - return llvm.ConstNamedStruct(tm.commonTypeType, vals[:]) -} - -func (tm *TypeMap) makeBasicType(t types.Type, u *types.Basic) llvm.Value { - return tm.makeCommonType(t) -} - -func (tm *TypeMap) makeArrayType(t types.Type, a *types.Array) llvm.Value { - var vals [4]llvm.Value - vals[0] = tm.makeCommonType(t) - vals[1] = tm.getTypeDescriptorPointer(a.Elem()) - vals[2] = tm.getTypeDescriptorPointer(types.NewSlice(a.Elem())) - vals[3] = llvm.ConstInt(tm.inttype, uint64(a.Len()), false) - - return llvm.ConstNamedStruct(tm.arrayTypeType, vals[:]) -} - -func (tm *TypeMap) makeSliceType(t types.Type, s *types.Slice) llvm.Value { - var vals [2]llvm.Value - vals[0] = tm.makeCommonType(t) - vals[1] = tm.getTypeDescriptorPointer(s.Elem()) - - return llvm.ConstNamedStruct(tm.sliceTypeType, vals[:]) -} - -func (tm *TypeMap) makeStructType(t types.Type, s *types.Struct) llvm.Value { - var vals [2]llvm.Value - vals[0] = tm.makeCommonType(t) - - fieldVars := make([]*types.Var, s.NumFields()) - for i := range fieldVars { - fieldVars[i] = s.Field(i) - } - offsets := tm.Offsetsof(fieldVars) - structFields := make([]llvm.Value, len(fieldVars)) - for i, field := range fieldVars { - var sfvals [5]llvm.Value - if !field.Anonymous() { - sfvals[0] = tm.globalStringPtr(field.Name()) - } else { - sfvals[0] = llvm.ConstPointerNull(llvm.PointerType(tm.stringType, 0)) - } - if !field.Exported() && field.Pkg() != nil { - sfvals[1] = tm.globalStringPtr(field.Pkg().Path()) - } else { - sfvals[1] = llvm.ConstPointerNull(llvm.PointerType(tm.stringType, 0)) - } - sfvals[2] = tm.getTypeDescriptorPointer(field.Type()) - if tag := s.Tag(i); tag != "" { - sfvals[3] = tm.globalStringPtr(tag) - } else { - sfvals[3] = llvm.ConstPointerNull(llvm.PointerType(tm.stringType, 0)) - } - sfvals[4] = llvm.ConstInt(tm.inttype, uint64(offsets[i]), false) - - structFields[i] = llvm.ConstNamedStruct(tm.structFieldType, sfvals[:]) - } - vals[1] = tm.makeSlice(structFields, tm.structFieldSliceType) - - return llvm.ConstNamedStruct(tm.structTypeType, vals[:]) -} - -func (tm *TypeMap) makePointerType(t types.Type, p *types.Pointer) llvm.Value { - var vals [2]llvm.Value - vals[0] = tm.makeCommonType(t) - vals[1] = tm.getTypeDescriptorPointer(p.Elem()) - - return llvm.ConstNamedStruct(tm.ptrTypeType, vals[:]) -} - -func (tm *TypeMap) rtypeSlice(t *types.Tuple) llvm.Value { - rtypes := make([]llvm.Value, t.Len()) - for i := range rtypes { - rtypes[i] = tm.getTypeDescriptorPointer(t.At(i).Type()) - } - return tm.makeSlice(rtypes, tm.typeSliceType) -} - -func (tm *TypeMap) makeFuncType(t types.Type, f *types.Signature) llvm.Value { - var vals [4]llvm.Value - vals[0] = tm.makeCommonType(t) - // dotdotdot - variadic := 0 - if f.Variadic() { - variadic = 1 - } - vals[1] = llvm.ConstInt(llvm.Int8Type(), uint64(variadic), false) - // in - vals[2] = tm.rtypeSlice(f.Params()) - // out - vals[3] = tm.rtypeSlice(f.Results()) - - return llvm.ConstNamedStruct(tm.funcTypeType, vals[:]) -} - -func (tm *TypeMap) makeInterfaceType(t types.Type, i *types.Interface) llvm.Value { - var vals [2]llvm.Value - vals[0] = tm.makeCommonType(t) - - methodset := tm.MethodSet(i) - imethods := make([]llvm.Value, methodset.Len()) - for index, ms := range orderedMethodSet(methodset) { - method := ms.Obj() - var imvals [3]llvm.Value - imvals[0] = tm.globalStringPtr(method.Name()) - if !method.Exported() && method.Pkg() != nil { - imvals[1] = tm.globalStringPtr(method.Pkg().Path()) - } else { - imvals[1] = llvm.ConstPointerNull(llvm.PointerType(tm.stringType, 0)) - } - mtyp := method.Type().(*types.Signature) - mftyp := types.NewSignature(nil, nil, mtyp.Params(), mtyp.Results(), mtyp.Variadic()) - imvals[2] = tm.getTypeDescriptorPointer(mftyp) - - imethods[index] = llvm.ConstNamedStruct(tm.imethodType, imvals[:]) - } - vals[1] = tm.makeSlice(imethods, tm.imethodSliceType) - - return llvm.ConstNamedStruct(tm.interfaceTypeType, vals[:]) -} - -func (tm *TypeMap) makeMapType(t types.Type, m *types.Map) llvm.Value { - var vals [3]llvm.Value - vals[0] = tm.makeCommonType(t) - vals[1] = tm.getTypeDescriptorPointer(m.Key()) - vals[2] = tm.getTypeDescriptorPointer(m.Elem()) - - return llvm.ConstNamedStruct(tm.mapTypeType, vals[:]) -} - -func (tm *TypeMap) makeMapDesc(ptr llvm.Value, m *types.Map) llvm.Value { - mapEntryType := structBType{[]backendType{ - tm.getBackendType(types.Typ[types.UnsafePointer]), - tm.getBackendType(m.Key()), - tm.getBackendType(m.Elem()), - }}.ToLLVM(tm.ctx) - - var vals [4]llvm.Value - // map_descriptor - vals[0] = ptr - // entry_size - vals[1] = llvm.ConstInt(tm.inttype, tm.target.TypeAllocSize(mapEntryType), false) - // key_offset - vals[2] = llvm.ConstInt(tm.inttype, tm.target.ElementOffset(mapEntryType, 1), false) - // value_offset - vals[3] = llvm.ConstInt(tm.inttype, tm.target.ElementOffset(mapEntryType, 2), false) - - return llvm.ConstNamedStruct(tm.mapDescType, vals[:]) -} - -func (tm *TypeMap) makeChanType(t types.Type, c *types.Chan) llvm.Value { - var vals [3]llvm.Value - vals[0] = tm.makeCommonType(t) - vals[1] = tm.getTypeDescriptorPointer(c.Elem()) - - // From gofrontend/go/types.cc - // These bits must match the ones in libgo/runtime/go-type.h. - var dir int - switch c.Dir() { - case types.RecvOnly: - dir = 1 - case types.SendOnly: - dir = 2 - case types.SendRecv: - dir = 3 - } - vals[2] = llvm.ConstInt(tm.inttype, uint64(dir), false) - - return llvm.ConstNamedStruct(tm.chanTypeType, vals[:]) -} - -func (tm *TypeMap) makeUncommonTypePtr(t types.Type) llvm.Value { - _, isbasic := t.(*types.Basic) - _, isnamed := t.(*types.Named) - - var mset types.MethodSet - // We store interface methods on the interface type. - if _, ok := t.Underlying().(*types.Interface); !ok { - mset = *tm.MethodSet(t) - } - - if !isbasic && !isnamed && mset.Len() == 0 { - return llvm.ConstPointerNull(llvm.PointerType(tm.uncommonTypeType, 0)) - } - - var vals [3]llvm.Value - - nullStringPtr := llvm.ConstPointerNull(llvm.PointerType(tm.stringType, 0)) - vals[0] = nullStringPtr - vals[1] = nullStringPtr - - if isbasic || isnamed { - nti := tm.mc.getNamedTypeInfo(t) - vals[0] = tm.globalStringPtr(nti.name) - if nti.pkgpath != "" { - path := nti.pkgpath - if nti.functionName != "" { - path += "." + nti.functionName - if nti.scopeNum != 0 { - path += "$" + strconv.Itoa(nti.scopeNum) - } - } - vals[1] = tm.globalStringPtr(path) - } - } - - // Store methods. All methods must be stored, not only exported ones; - // this is to allow satisfying of interfaces with non-exported methods. - methods := make([]llvm.Value, mset.Len()) - omset := orderedMethodSet(&mset) - for i := range methods { - var mvals [5]llvm.Value - - sel := omset[i] - mname := sel.Obj().Name() - mfunc := tm.methodResolver.ResolveMethod(sel) - ftyp := mfunc.Type().(*types.Signature) - - // name - mvals[0] = tm.globalStringPtr(mname) - - // pkgPath - mvals[1] = nullStringPtr - if pkg := sel.Obj().Pkg(); pkg != nil && !sel.Obj().Exported() { - mvals[1] = tm.globalStringPtr(pkg.Path()) - } - - // mtyp (method type, no receiver) - mftyp := types.NewSignature(nil, nil, ftyp.Params(), ftyp.Results(), ftyp.Variadic()) - mvals[2] = tm.getTypeDescriptorPointer(mftyp) - - // typ (function type, with receiver) - recvparam := types.NewParam(0, nil, "", t) - params := ftyp.Params() - rfparams := make([]*types.Var, params.Len()+1) - rfparams[0] = recvparam - for i := 0; i != ftyp.Params().Len(); i++ { - rfparams[i+1] = params.At(i) - } - rftyp := types.NewSignature(nil, nil, types.NewTuple(rfparams...), ftyp.Results(), ftyp.Variadic()) - mvals[3] = tm.getTypeDescriptorPointer(rftyp) - - // function - mvals[4] = mfunc.value - - methods[i] = llvm.ConstNamedStruct(tm.methodType, mvals[:]) - } - - vals[2] = tm.makeSlice(methods, tm.methodSliceType) - - uncommonType := llvm.ConstNamedStruct(tm.uncommonTypeType, vals[:]) - - uncommonTypePtr := llvm.AddGlobal(tm.module, tm.uncommonTypeType, "") - uncommonTypePtr.SetGlobalConstant(true) - uncommonTypePtr.SetInitializer(uncommonType) - uncommonTypePtr.SetLinkage(llvm.InternalLinkage) - return uncommonTypePtr -} - -// globalStringPtr returns a *string with the specified value. -func (tm *TypeMap) globalStringPtr(value string) llvm.Value { - strval := llvm.ConstString(value, false) - strglobal := llvm.AddGlobal(tm.module, strval.Type(), "") - strglobal.SetGlobalConstant(true) - strglobal.SetLinkage(llvm.InternalLinkage) - strglobal.SetInitializer(strval) - strglobal = llvm.ConstBitCast(strglobal, llvm.PointerType(llvm.Int8Type(), 0)) - strlen := llvm.ConstInt(tm.inttype, uint64(len(value)), false) - str := llvm.ConstStruct([]llvm.Value{strglobal, strlen}, false) - g := llvm.AddGlobal(tm.module, str.Type(), "") - g.SetGlobalConstant(true) - g.SetLinkage(llvm.InternalLinkage) - g.SetInitializer(str) - return g -} - -func (tm *TypeMap) makeNamedSliceType(tname string, elemtyp llvm.Type) llvm.Type { - t := tm.ctx.StructCreateNamed(tname) - t.StructSetBody([]llvm.Type{ - llvm.PointerType(elemtyp, 0), - tm.inttype, - tm.inttype, - }, false) - return t -} - -func (tm *TypeMap) makeSlice(values []llvm.Value, slicetyp llvm.Type) llvm.Value { - ptrtyp := slicetyp.StructElementTypes()[0] - var globalptr llvm.Value - if len(values) > 0 { - array := llvm.ConstArray(ptrtyp.ElementType(), values) - globalptr = llvm.AddGlobal(tm.module, array.Type(), "") - globalptr.SetGlobalConstant(true) - globalptr.SetLinkage(llvm.InternalLinkage) - globalptr.SetInitializer(array) - globalptr = llvm.ConstBitCast(globalptr, ptrtyp) - } else { - globalptr = llvm.ConstNull(ptrtyp) - } - len_ := llvm.ConstInt(tm.inttype, uint64(len(values)), false) - slice := llvm.ConstNull(slicetyp) - slice = llvm.ConstInsertValue(slice, globalptr, []uint32{0}) - slice = llvm.ConstInsertValue(slice, len_, []uint32{1}) - slice = llvm.ConstInsertValue(slice, len_, []uint32{2}) - return slice -} - -func isGlobalObject(obj types.Object) bool { - pkg := obj.Pkg() - return pkg == nil || obj.Parent() == pkg.Scope() -} diff --git a/llgo/irgen/types.go b/llgo/irgen/types.go deleted file mode 100644 index acbbdfc346d2..000000000000 --- a/llgo/irgen/types.go +++ /dev/null @@ -1,22 +0,0 @@ -//===- types.go - convenience functions for types -------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements convenience functions for dealing with types. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" -) - -func deref(t types.Type) types.Type { - return t.Underlying().(*types.Pointer).Elem() -} diff --git a/llgo/irgen/utils.go b/llgo/irgen/utils.go deleted file mode 100644 index 37cecd7d74cd..000000000000 --- a/llgo/irgen/utils.go +++ /dev/null @@ -1,40 +0,0 @@ -//===- utils.go - misc utils ----------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file implements misellaneous utilities for IR generation. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -func (fr *frame) loadOrNull(cond, ptr llvm.Value, ty types.Type) *govalue { - startbb := fr.builder.GetInsertBlock() - loadbb := llvm.AddBasicBlock(fr.function, "") - contbb := llvm.AddBasicBlock(fr.function, "") - fr.builder.CreateCondBr(cond, loadbb, contbb) - - fr.builder.SetInsertPointAtEnd(loadbb) - llty := fr.types.ToLLVM(ty) - typedptr := fr.builder.CreateBitCast(ptr, llvm.PointerType(llty, 0), "") - loadedval := fr.builder.CreateLoad(typedptr, "") - fr.builder.CreateBr(contbb) - - fr.builder.SetInsertPointAtEnd(contbb) - llv := fr.builder.CreatePHI(llty, "") - llv.AddIncoming( - []llvm.Value{llvm.ConstNull(llty), loadedval}, - []llvm.BasicBlock{startbb, loadbb}, - ) - return newValue(llv, ty) -} diff --git a/llgo/irgen/value.go b/llgo/irgen/value.go deleted file mode 100644 index e6bc5898e570..000000000000 --- a/llgo/irgen/value.go +++ /dev/null @@ -1,638 +0,0 @@ -//===- value.go - govalue and operations ----------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file defines the govalue type, which combines an LLVM value with its Go -// type, and implements various basic operations on govalues. -// -//===----------------------------------------------------------------------===// - -package irgen - -import ( - "fmt" - "go/token" - - "llvm.org/llgo/third_party/gotools/go/exact" - "llvm.org/llgo/third_party/gotools/go/types" - "llvm.org/llvm/bindings/go/llvm" -) - -// govalue contains an LLVM value and a Go type, -// representing the result of a Go expression. -type govalue struct { - value llvm.Value - typ types.Type -} - -func (v *govalue) String() string { - return fmt.Sprintf("[llgo.govalue typ:%s value:%v]", v.typ, v.value) -} - -// Create a new dynamic value from a (LLVM Value, Type) pair. -func newValue(v llvm.Value, t types.Type) *govalue { - return &govalue{v, t} -} - -// TODO(axw) remove this, use .typ directly -func (v *govalue) Type() types.Type { - return v.typ -} - -// newValueFromConst converts a constant value to an LLVM value. -func (fr *frame) newValueFromConst(v exact.Value, typ types.Type) *govalue { - switch { - case v == nil: - llvmtyp := fr.types.ToLLVM(typ) - return newValue(llvm.ConstNull(llvmtyp), typ) - - case isString(typ): - if isUntyped(typ) { - typ = types.Typ[types.String] - } - llvmtyp := fr.types.ToLLVM(typ) - strval := exact.StringVal(v) - strlen := len(strval) - i8ptr := llvm.PointerType(llvm.Int8Type(), 0) - var ptr llvm.Value - if strlen > 0 { - init := llvm.ConstString(strval, false) - ptr = llvm.AddGlobal(fr.module.Module, init.Type(), "") - ptr.SetInitializer(init) - ptr.SetLinkage(llvm.InternalLinkage) - ptr = llvm.ConstBitCast(ptr, i8ptr) - } else { - ptr = llvm.ConstNull(i8ptr) - } - len_ := llvm.ConstInt(fr.types.inttype, uint64(strlen), false) - llvmvalue := llvm.Undef(llvmtyp) - llvmvalue = llvm.ConstInsertValue(llvmvalue, ptr, []uint32{0}) - llvmvalue = llvm.ConstInsertValue(llvmvalue, len_, []uint32{1}) - return newValue(llvmvalue, typ) - - case isInteger(typ): - if isUntyped(typ) { - typ = types.Typ[types.Int] - } - llvmtyp := fr.types.ToLLVM(typ) - var llvmvalue llvm.Value - if isUnsigned(typ) { - v, _ := exact.Uint64Val(v) - llvmvalue = llvm.ConstInt(llvmtyp, v, false) - } else { - v, _ := exact.Int64Val(v) - llvmvalue = llvm.ConstInt(llvmtyp, uint64(v), true) - } - return newValue(llvmvalue, typ) - - case isBoolean(typ): - if isUntyped(typ) { - typ = types.Typ[types.Bool] - } - return newValue(boolLLVMValue(exact.BoolVal(v)), typ) - - case isFloat(typ): - if isUntyped(typ) { - typ = types.Typ[types.Float64] - } - llvmtyp := fr.types.ToLLVM(typ) - floatval, _ := exact.Float64Val(v) - llvmvalue := llvm.ConstFloat(llvmtyp, floatval) - return newValue(llvmvalue, typ) - - case typ == types.Typ[types.UnsafePointer]: - llvmtyp := fr.types.ToLLVM(typ) - v, _ := exact.Uint64Val(v) - llvmvalue := llvm.ConstInt(fr.types.inttype, v, false) - llvmvalue = llvm.ConstIntToPtr(llvmvalue, llvmtyp) - return newValue(llvmvalue, typ) - - case isComplex(typ): - if isUntyped(typ) { - typ = types.Typ[types.Complex128] - } - llvmtyp := fr.types.ToLLVM(typ) - floattyp := llvmtyp.StructElementTypes()[0] - llvmvalue := llvm.ConstNull(llvmtyp) - realv := exact.Real(v) - imagv := exact.Imag(v) - realfloatval, _ := exact.Float64Val(realv) - imagfloatval, _ := exact.Float64Val(imagv) - llvmre := llvm.ConstFloat(floattyp, realfloatval) - llvmim := llvm.ConstFloat(floattyp, imagfloatval) - llvmvalue = llvm.ConstInsertValue(llvmvalue, llvmre, []uint32{0}) - llvmvalue = llvm.ConstInsertValue(llvmvalue, llvmim, []uint32{1}) - return newValue(llvmvalue, typ) - } - - // Special case for string -> [](byte|rune) - if u, ok := typ.Underlying().(*types.Slice); ok && isInteger(u.Elem()) { - if v.Kind() == exact.String { - strval := fr.newValueFromConst(v, types.Typ[types.String]) - return fr.convert(strval, typ) - } - } - - panic(fmt.Sprintf("unhandled: t=%s(%T), v=%v(%T)", typ, typ, v, v)) -} - -func (fr *frame) binaryOp(lhs *govalue, op token.Token, rhs *govalue) *govalue { - if op == token.NEQ { - result := fr.binaryOp(lhs, token.EQL, rhs) - return fr.unaryOp(result, token.NOT) - } - - var result llvm.Value - b := fr.builder - - switch typ := lhs.typ.Underlying().(type) { - case *types.Struct: - // TODO(axw) use runtime equality algorithm (will be suitably inlined). - // For now, we use compare all fields unconditionally and bitwise AND - // to avoid branching (i.e. so we don't create additional blocks). - value := newValue(boolLLVMValue(true), types.Typ[types.Bool]) - for i := 0; i < typ.NumFields(); i++ { - t := typ.Field(i).Type() - lhs := newValue(b.CreateExtractValue(lhs.value, i, ""), t) - rhs := newValue(b.CreateExtractValue(rhs.value, i, ""), t) - value = fr.binaryOp(value, token.AND, fr.binaryOp(lhs, token.EQL, rhs)) - } - return value - - case *types.Array: - // TODO(pcc): as above. - value := newValue(boolLLVMValue(true), types.Typ[types.Bool]) - t := typ.Elem() - for i := int64(0); i < typ.Len(); i++ { - lhs := newValue(b.CreateExtractValue(lhs.value, int(i), ""), t) - rhs := newValue(b.CreateExtractValue(rhs.value, int(i), ""), t) - value = fr.binaryOp(value, token.AND, fr.binaryOp(lhs, token.EQL, rhs)) - } - return value - - case *types.Slice: - // []T == nil or nil == []T - lhsptr := b.CreateExtractValue(lhs.value, 0, "") - rhsptr := b.CreateExtractValue(rhs.value, 0, "") - isnil := b.CreateICmp(llvm.IntEQ, lhsptr, rhsptr, "") - isnil = b.CreateZExt(isnil, llvm.Int8Type(), "") - return newValue(isnil, types.Typ[types.Bool]) - - case *types.Signature: - // func == nil or nil == func - isnil := b.CreateICmp(llvm.IntEQ, lhs.value, rhs.value, "") - isnil = b.CreateZExt(isnil, llvm.Int8Type(), "") - return newValue(isnil, types.Typ[types.Bool]) - - case *types.Interface: - return fr.compareInterfaces(lhs, rhs) - } - - // Strings. - if isString(lhs.typ) { - if isString(rhs.typ) { - switch op { - case token.ADD: - return fr.concatenateStrings(lhs, rhs) - case token.EQL, token.LSS, token.GTR, token.LEQ, token.GEQ: - return fr.compareStrings(lhs, rhs, op) - default: - panic(fmt.Sprint("Unimplemented operator: ", op)) - } - } - panic("unimplemented") - } - - // Complex numbers. - if isComplex(lhs.typ) { - // XXX Should we represent complex numbers as vectors? - lhsval := lhs.value - rhsval := rhs.value - a_ := b.CreateExtractValue(lhsval, 0, "") - b_ := b.CreateExtractValue(lhsval, 1, "") - c_ := b.CreateExtractValue(rhsval, 0, "") - d_ := b.CreateExtractValue(rhsval, 1, "") - switch op { - case token.QUO: - // (a+bi)/(c+di) = (ac+bd)/(c**2+d**2) + (bc-ad)/(c**2+d**2)i - ac := b.CreateFMul(a_, c_, "") - bd := b.CreateFMul(b_, d_, "") - bc := b.CreateFMul(b_, c_, "") - ad := b.CreateFMul(a_, d_, "") - cpow2 := b.CreateFMul(c_, c_, "") - dpow2 := b.CreateFMul(d_, d_, "") - denom := b.CreateFAdd(cpow2, dpow2, "") - realnumer := b.CreateFAdd(ac, bd, "") - imagnumer := b.CreateFSub(bc, ad, "") - real_ := b.CreateFDiv(realnumer, denom, "") - imag_ := b.CreateFDiv(imagnumer, denom, "") - lhsval = b.CreateInsertValue(lhsval, real_, 0, "") - result = b.CreateInsertValue(lhsval, imag_, 1, "") - case token.MUL: - // (a+bi)(c+di) = (ac-bd)+(bc+ad)i - ac := b.CreateFMul(a_, c_, "") - bd := b.CreateFMul(b_, d_, "") - bc := b.CreateFMul(b_, c_, "") - ad := b.CreateFMul(a_, d_, "") - real_ := b.CreateFSub(ac, bd, "") - imag_ := b.CreateFAdd(bc, ad, "") - lhsval = b.CreateInsertValue(lhsval, real_, 0, "") - result = b.CreateInsertValue(lhsval, imag_, 1, "") - case token.ADD: - real_ := b.CreateFAdd(a_, c_, "") - imag_ := b.CreateFAdd(b_, d_, "") - lhsval = b.CreateInsertValue(lhsval, real_, 0, "") - result = b.CreateInsertValue(lhsval, imag_, 1, "") - case token.SUB: - real_ := b.CreateFSub(a_, c_, "") - imag_ := b.CreateFSub(b_, d_, "") - lhsval = b.CreateInsertValue(lhsval, real_, 0, "") - result = b.CreateInsertValue(lhsval, imag_, 1, "") - case token.EQL: - realeq := b.CreateFCmp(llvm.FloatOEQ, a_, c_, "") - imageq := b.CreateFCmp(llvm.FloatOEQ, b_, d_, "") - result = b.CreateAnd(realeq, imageq, "") - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - default: - panic(fmt.Errorf("unhandled operator: %v", op)) - } - return newValue(result, lhs.typ) - } - - // Floats and integers. - // TODO determine the NaN rules. - - switch op { - case token.MUL: - if isFloat(lhs.typ) { - result = b.CreateFMul(lhs.value, rhs.value, "") - } else { - result = b.CreateMul(lhs.value, rhs.value, "") - } - return newValue(result, lhs.typ) - case token.QUO: - switch { - case isFloat(lhs.typ): - result = b.CreateFDiv(lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateSDiv(lhs.value, rhs.value, "") - default: - result = b.CreateUDiv(lhs.value, rhs.value, "") - } - return newValue(result, lhs.typ) - case token.REM: - switch { - case isFloat(lhs.typ): - result = b.CreateFRem(lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateSRem(lhs.value, rhs.value, "") - default: - result = b.CreateURem(lhs.value, rhs.value, "") - } - return newValue(result, lhs.typ) - case token.ADD: - if isFloat(lhs.typ) { - result = b.CreateFAdd(lhs.value, rhs.value, "") - } else { - result = b.CreateAdd(lhs.value, rhs.value, "") - } - return newValue(result, lhs.typ) - case token.SUB: - if isFloat(lhs.typ) { - result = b.CreateFSub(lhs.value, rhs.value, "") - } else { - result = b.CreateSub(lhs.value, rhs.value, "") - } - return newValue(result, lhs.typ) - case token.SHL, token.SHR: - return fr.shift(lhs, rhs, op) - case token.EQL: - if isFloat(lhs.typ) { - result = b.CreateFCmp(llvm.FloatOEQ, lhs.value, rhs.value, "") - } else { - result = b.CreateICmp(llvm.IntEQ, lhs.value, rhs.value, "") - } - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - case token.LSS: - switch { - case isFloat(lhs.typ): - result = b.CreateFCmp(llvm.FloatOLT, lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateICmp(llvm.IntSLT, lhs.value, rhs.value, "") - default: - result = b.CreateICmp(llvm.IntULT, lhs.value, rhs.value, "") - } - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - case token.LEQ: - switch { - case isFloat(lhs.typ): - result = b.CreateFCmp(llvm.FloatOLE, lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateICmp(llvm.IntSLE, lhs.value, rhs.value, "") - default: - result = b.CreateICmp(llvm.IntULE, lhs.value, rhs.value, "") - } - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - case token.GTR: - switch { - case isFloat(lhs.typ): - result = b.CreateFCmp(llvm.FloatOGT, lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateICmp(llvm.IntSGT, lhs.value, rhs.value, "") - default: - result = b.CreateICmp(llvm.IntUGT, lhs.value, rhs.value, "") - } - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - case token.GEQ: - switch { - case isFloat(lhs.typ): - result = b.CreateFCmp(llvm.FloatOGE, lhs.value, rhs.value, "") - case !isUnsigned(lhs.typ): - result = b.CreateICmp(llvm.IntSGE, lhs.value, rhs.value, "") - default: - result = b.CreateICmp(llvm.IntUGE, lhs.value, rhs.value, "") - } - result = b.CreateZExt(result, llvm.Int8Type(), "") - return newValue(result, types.Typ[types.Bool]) - case token.AND: // a & b - result = b.CreateAnd(lhs.value, rhs.value, "") - return newValue(result, lhs.typ) - case token.AND_NOT: // a &^ b - rhsval := rhs.value - rhsval = b.CreateXor(rhsval, llvm.ConstAllOnes(rhsval.Type()), "") - result = b.CreateAnd(lhs.value, rhsval, "") - return newValue(result, lhs.typ) - case token.OR: // a | b - result = b.CreateOr(lhs.value, rhs.value, "") - return newValue(result, lhs.typ) - case token.XOR: // a ^ b - result = b.CreateXor(lhs.value, rhs.value, "") - return newValue(result, lhs.typ) - default: - panic(fmt.Sprint("Unimplemented operator: ", op)) - } - panic("unreachable") -} - -func (fr *frame) shift(lhs *govalue, rhs *govalue, op token.Token) *govalue { - rhs = fr.convert(rhs, lhs.Type()) - lhsval := lhs.value - bits := rhs.value - unsigned := isUnsigned(lhs.Type()) - // Shifting >= width of lhs yields undefined behaviour, so we must select. - max := llvm.ConstInt(bits.Type(), uint64(lhsval.Type().IntTypeWidth()-1), false) - var result llvm.Value - lessEqualWidth := fr.builder.CreateICmp(llvm.IntULE, bits, max, "") - if !unsigned && op == token.SHR { - bits := fr.builder.CreateSelect(lessEqualWidth, bits, max, "") - result = fr.builder.CreateAShr(lhsval, bits, "") - } else { - if op == token.SHL { - result = fr.builder.CreateShl(lhsval, bits, "") - } else { - result = fr.builder.CreateLShr(lhsval, bits, "") - } - zero := llvm.ConstNull(lhsval.Type()) - result = fr.builder.CreateSelect(lessEqualWidth, result, zero, "") - } - return newValue(result, lhs.typ) -} - -func (fr *frame) unaryOp(v *govalue, op token.Token) *govalue { - switch op { - case token.SUB: - var value llvm.Value - if isComplex(v.typ) { - realv := fr.builder.CreateExtractValue(v.value, 0, "") - imagv := fr.builder.CreateExtractValue(v.value, 1, "") - negzero := llvm.ConstFloatFromString(realv.Type(), "-0") - realv = fr.builder.CreateFSub(negzero, realv, "") - imagv = fr.builder.CreateFSub(negzero, imagv, "") - value = llvm.Undef(v.value.Type()) - value = fr.builder.CreateInsertValue(value, realv, 0, "") - value = fr.builder.CreateInsertValue(value, imagv, 1, "") - } else if isFloat(v.typ) { - negzero := llvm.ConstFloatFromString(fr.types.ToLLVM(v.Type()), "-0") - value = fr.builder.CreateFSub(negzero, v.value, "") - } else { - value = fr.builder.CreateNeg(v.value, "") - } - return newValue(value, v.typ) - case token.ADD: - return v // No-op - case token.NOT: - value := fr.builder.CreateXor(v.value, boolLLVMValue(true), "") - return newValue(value, v.typ) - case token.XOR: - lhs := v.value - rhs := llvm.ConstAllOnes(lhs.Type()) - value := fr.builder.CreateXor(lhs, rhs, "") - return newValue(value, v.typ) - default: - panic(fmt.Sprintf("Unhandled operator: %s", op)) - } -} - -func (fr *frame) convert(v *govalue, dsttyp types.Type) *govalue { - b := fr.builder - - // If it's a stack allocated value, we'll want to compare the - // value type, not the pointer type. - srctyp := v.typ - - // Get the underlying type, if any. - origdsttyp := dsttyp - dsttyp = dsttyp.Underlying() - srctyp = srctyp.Underlying() - - // Identical (underlying) types? Just swap in the destination type. - if types.Identical(srctyp, dsttyp) { - return newValue(v.value, origdsttyp) - } - - // Both pointer types with identical underlying types? Same as above. - if srctyp, ok := srctyp.(*types.Pointer); ok { - if dsttyp, ok := dsttyp.(*types.Pointer); ok { - srctyp := srctyp.Elem().Underlying() - dsttyp := dsttyp.Elem().Underlying() - if types.Identical(srctyp, dsttyp) { - return newValue(v.value, origdsttyp) - } - } - } - - // string -> - if isString(srctyp) { - // (untyped) string -> string - // XXX should untyped strings be able to escape go/types? - if isString(dsttyp) { - return newValue(v.value, origdsttyp) - } - - // string -> []byte - if isSlice(dsttyp, types.Byte) { - sliceValue := fr.runtime.stringToByteArray.callOnly(fr, v.value)[0] - return newValue(sliceValue, origdsttyp) - } - - // string -> []rune - if isSlice(dsttyp, types.Rune) { - return fr.stringToRuneSlice(v) - } - } - - // []byte -> string - if isSlice(srctyp, types.Byte) && isString(dsttyp) { - data := fr.builder.CreateExtractValue(v.value, 0, "") - len := fr.builder.CreateExtractValue(v.value, 1, "") - stringValue := fr.runtime.byteArrayToString.callOnly(fr, data, len)[0] - return newValue(stringValue, dsttyp) - } - - // []rune -> string - if isSlice(srctyp, types.Rune) && isString(dsttyp) { - return fr.runeSliceToString(v) - } - - // rune -> string - if isString(dsttyp) && isInteger(srctyp) { - return fr.runeToString(v) - } - - // Unsafe pointer conversions. - llvm_type := fr.types.ToLLVM(dsttyp) - if dsttyp == types.Typ[types.UnsafePointer] { // X -> unsafe.Pointer - if _, isptr := srctyp.(*types.Pointer); isptr { - return newValue(v.value, origdsttyp) - } else if srctyp == types.Typ[types.Uintptr] { - value := b.CreateIntToPtr(v.value, llvm_type, "") - return newValue(value, origdsttyp) - } - } else if srctyp == types.Typ[types.UnsafePointer] { // unsafe.Pointer -> X - if _, isptr := dsttyp.(*types.Pointer); isptr { - return newValue(v.value, origdsttyp) - } else if dsttyp == types.Typ[types.Uintptr] { - value := b.CreatePtrToInt(v.value, llvm_type, "") - return newValue(value, origdsttyp) - } - } - - lv := v.value - srcType := lv.Type() - switch srcType.TypeKind() { - case llvm.IntegerTypeKind: - switch llvm_type.TypeKind() { - case llvm.IntegerTypeKind: - srcBits := srcType.IntTypeWidth() - dstBits := llvm_type.IntTypeWidth() - delta := srcBits - dstBits - switch { - case delta < 0: - if !isUnsigned(srctyp) { - lv = b.CreateSExt(lv, llvm_type, "") - } else { - lv = b.CreateZExt(lv, llvm_type, "") - } - case delta > 0: - lv = b.CreateTrunc(lv, llvm_type, "") - } - return newValue(lv, origdsttyp) - case llvm.FloatTypeKind, llvm.DoubleTypeKind: - if !isUnsigned(v.Type()) { - lv = b.CreateSIToFP(lv, llvm_type, "") - } else { - lv = b.CreateUIToFP(lv, llvm_type, "") - } - return newValue(lv, origdsttyp) - } - case llvm.DoubleTypeKind: - switch llvm_type.TypeKind() { - case llvm.FloatTypeKind: - lv = b.CreateFPTrunc(lv, llvm_type, "") - return newValue(lv, origdsttyp) - case llvm.IntegerTypeKind: - if !isUnsigned(dsttyp) { - lv = b.CreateFPToSI(lv, llvm_type, "") - } else { - lv = b.CreateFPToUI(lv, llvm_type, "") - } - return newValue(lv, origdsttyp) - } - case llvm.FloatTypeKind: - switch llvm_type.TypeKind() { - case llvm.DoubleTypeKind: - lv = b.CreateFPExt(lv, llvm_type, "") - return newValue(lv, origdsttyp) - case llvm.IntegerTypeKind: - if !isUnsigned(dsttyp) { - lv = b.CreateFPToSI(lv, llvm_type, "") - } else { - lv = b.CreateFPToUI(lv, llvm_type, "") - } - return newValue(lv, origdsttyp) - } - } - - // Complex -> complex. Complexes are only convertible to other - // complexes, contant conversions aside. So we can just check the - // source type here; given that the types are not identical - // (checked above), we can assume the destination type is the alternate - // complex type. - if isComplex(srctyp) { - var fpcast func(llvm.Builder, llvm.Value, llvm.Type, string) llvm.Value - var fptype llvm.Type - if srctyp == types.Typ[types.Complex64] { - fpcast = (llvm.Builder).CreateFPExt - fptype = llvm.DoubleType() - } else { - fpcast = (llvm.Builder).CreateFPTrunc - fptype = llvm.FloatType() - } - if fpcast != nil { - realv := b.CreateExtractValue(lv, 0, "") - imagv := b.CreateExtractValue(lv, 1, "") - realv = fpcast(b, realv, fptype, "") - imagv = fpcast(b, imagv, fptype, "") - lv = llvm.Undef(fr.types.ToLLVM(dsttyp)) - lv = b.CreateInsertValue(lv, realv, 0, "") - lv = b.CreateInsertValue(lv, imagv, 1, "") - return newValue(lv, origdsttyp) - } - } - panic(fmt.Sprintf("unimplemented conversion: %s (%s) -> %s", v.typ, lv.Type(), origdsttyp)) -} - -// extractRealValue extracts the real component of a complex number. -func (fr *frame) extractRealValue(v *govalue) *govalue { - component := fr.builder.CreateExtractValue(v.value, 0, "") - if component.Type().TypeKind() == llvm.FloatTypeKind { - return newValue(component, types.Typ[types.Float32]) - } - return newValue(component, types.Typ[types.Float64]) -} - -// extractRealValue extracts the imaginary component of a complex number. -func (fr *frame) extractImagValue(v *govalue) *govalue { - component := fr.builder.CreateExtractValue(v.value, 1, "") - if component.Type().TypeKind() == llvm.FloatTypeKind { - return newValue(component, types.Typ[types.Float32]) - } - return newValue(component, types.Typ[types.Float64]) -} - -func boolLLVMValue(v bool) (lv llvm.Value) { - if v { - return llvm.ConstInt(llvm.Int8Type(), 1, false) - } - return llvm.ConstNull(llvm.Int8Type()) -} diff --git a/llgo/irgen/version.go b/llgo/irgen/version.go deleted file mode 100644 index c59eb6f64656..000000000000 --- a/llgo/irgen/version.go +++ /dev/null @@ -1,23 +0,0 @@ -//===- version.go - version info ------------------------------------------===// -// -// The LLVM Compiler Infrastructure -// -// This file is distributed under the University of Illinois Open Source -// License. See LICENSE.TXT for details. -// -//===----------------------------------------------------------------------===// -// -// This file specifies the Go version supported by the IR generator. -// -//===----------------------------------------------------------------------===// - -package irgen - -const ( - goVersion = "go1.4.2" -) - -// GoVersion returns the version of Go that we are targeting. -func GoVersion() string { - return goVersion -} diff --git a/llgo/libgo-check-failures.diff b/llgo/libgo-check-failures.diff deleted file mode 100644 index 519bddfce449..000000000000 --- a/llgo/libgo-check-failures.diff +++ /dev/null @@ -1,49 +0,0 @@ -diff -r a6e10414311a libgo/Makefile.am ---- a/libgo/Makefile.am Fri Jan 16 07:57:02 2015 -0800 -+++ b/libgo/Makefile.am Fri Apr 03 15:07:47 2015 -0700 -@@ -3738,7 +3738,6 @@ - os/check \ - path/check \ - reflect/check \ -- regexp/check \ - runtime/check \ - sort/check \ - strconv/check \ -@@ -3838,7 +3837,6 @@ - os/user/check \ - path/filepath/check \ - regexp/syntax/check \ -- runtime/pprof/check \ - sync/atomic/check \ - text/scanner/check \ - text/tabwriter/check \ -diff -r a6e10414311a libgo/Makefile.in ---- a/libgo/Makefile.in Fri Jan 16 07:57:02 2015 -0800 -+++ b/libgo/Makefile.in Fri Apr 03 15:07:47 2015 -0700 -@@ -2212,7 +2212,6 @@ - os/check \ - path/check \ - reflect/check \ -- regexp/check \ - runtime/check \ - sort/check \ - strconv/check \ -@@ -2312,7 +2311,6 @@ - os/user/check \ - path/filepath/check \ - regexp/syntax/check \ -- runtime/pprof/check \ - sync/atomic/check \ - text/scanner/check \ - text/tabwriter/check \ -diff -r a6e10414311a libgo/go/runtime/mfinal_test.go ---- a/libgo/go/runtime/mfinal_test.go Fri Jan 16 07:57:02 2015 -0800 -+++ b/libgo/go/runtime/mfinal_test.go Fri Apr 03 15:07:47 2015 -0700 -@@ -62,6 +62,7 @@ - }() - <-done - runtime.GC() -+ runtime.GC() - select { - case <-ch: - case <-time.After(time.Second * 4): diff --git a/llgo/libgo-noext.diff b/llgo/libgo-noext.diff deleted file mode 100644 index 86312bb469f2..000000000000 --- a/llgo/libgo-noext.diff +++ /dev/null @@ -1,1790 +0,0 @@ -diff -r bb70e852004f libgo/runtime/chan.goc ---- a/libgo/runtime/chan.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/chan.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -111,7 +111,7 @@ - mysg.releasetime = -1; - } - -- runtime_lock(c); -+ runtime_lock(&c->lock); - if(c->closed) - goto closed; - -@@ -120,7 +120,7 @@ - - sg = dequeue(&c->recvq); - if(sg != nil) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - - gp = sg->g; - gp->param = sg; -@@ -133,7 +133,7 @@ - } - - if(!block) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return false; - } - -@@ -142,10 +142,10 @@ - mysg.selectdone = nil; - g->param = nil; - enqueue(&c->sendq, &mysg); -- runtime_parkunlock(c, "chan send"); -+ runtime_parkunlock(&c->lock, "chan send"); - - if(g->param == nil) { -- runtime_lock(c); -+ runtime_lock(&c->lock); - if(!c->closed) - runtime_throw("chansend: spurious wakeup"); - goto closed; -@@ -162,16 +162,16 @@ - - if(c->qcount >= c->dataqsiz) { - if(!block) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return false; - } - mysg.g = g; - mysg.elem = nil; - mysg.selectdone = nil; - enqueue(&c->sendq, &mysg); -- runtime_parkunlock(c, "chan send"); -+ runtime_parkunlock(&c->lock, "chan send"); - -- runtime_lock(c); -+ runtime_lock(&c->lock); - goto asynch; - } - -@@ -183,18 +183,18 @@ - sg = dequeue(&c->recvq); - if(sg != nil) { - gp = sg->g; -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - if(sg->releasetime) - sg->releasetime = runtime_cputicks(); - runtime_ready(gp); - } else -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - if(mysg.releasetime > 0) - runtime_blockevent(mysg.releasetime - t0, 2); - return true; - - closed: -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_panicstring("send on closed channel"); - return false; // not reached - } -@@ -232,7 +232,7 @@ - mysg.releasetime = -1; - } - -- runtime_lock(c); -+ runtime_lock(&c->lock); - if(c->dataqsiz > 0) - goto asynch; - -@@ -241,7 +241,7 @@ - - sg = dequeue(&c->sendq); - if(sg != nil) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - - if(ep != nil) - runtime_memmove(ep, sg->elem, c->elemsize); -@@ -257,7 +257,7 @@ - } - - if(!block) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return false; - } - -@@ -266,10 +266,10 @@ - mysg.selectdone = nil; - g->param = nil; - enqueue(&c->recvq, &mysg); -- runtime_parkunlock(c, "chan receive"); -+ runtime_parkunlock(&c->lock, "chan receive"); - - if(g->param == nil) { -- runtime_lock(c); -+ runtime_lock(&c->lock); - if(!c->closed) - runtime_throw("chanrecv: spurious wakeup"); - goto closed; -@@ -287,7 +287,7 @@ - goto closed; - - if(!block) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - if(received != nil) - *received = false; - return false; -@@ -296,9 +296,9 @@ - mysg.elem = nil; - mysg.selectdone = nil; - enqueue(&c->recvq, &mysg); -- runtime_parkunlock(c, "chan receive"); -+ runtime_parkunlock(&c->lock, "chan receive"); - -- runtime_lock(c); -+ runtime_lock(&c->lock); - goto asynch; - } - -@@ -312,12 +312,12 @@ - sg = dequeue(&c->sendq); - if(sg != nil) { - gp = sg->g; -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - if(sg->releasetime) - sg->releasetime = runtime_cputicks(); - runtime_ready(gp); - } else -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - - if(received != nil) - *received = true; -@@ -330,7 +330,7 @@ - runtime_memclr(ep, c->elemsize); - if(received != nil) - *received = false; -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - if(mysg.releasetime > 0) - runtime_blockevent(mysg.releasetime - t0, 2); - return true; -@@ -604,7 +604,7 @@ - c0 = sel->lockorder[i]; - if(c0 && c0 != c) { - c = sel->lockorder[i]; -- runtime_lock(c); -+ runtime_lock(&c->lock); - } - } - } -@@ -632,7 +632,7 @@ - c = sel->lockorder[i]; - if(i>0 && sel->lockorder[i-1] == c) - continue; // will unlock it on the next iteration -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - } - } - -@@ -1017,9 +1017,9 @@ - if(runtime_gcwaiting()) - runtime_gosched(); - -- runtime_lock(c); -+ runtime_lock(&c->lock); - if(c->closed) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_panicstring("close of closed channel"); - } - c->closed = true; -@@ -1048,7 +1048,7 @@ - runtime_ready(gp); - } - -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - } - - void -diff -r bb70e852004f libgo/runtime/chan.h ---- a/libgo/runtime/chan.h Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/chan.h Fri Apr 03 17:31:02 2015 -0700 -@@ -39,7 +39,7 @@ - uintgo recvx; // receive index - WaitQ recvq; // list of recv waiters - WaitQ sendq; // list of send waiters -- Lock; -+ Lock lock; - }; - - // Buffer follows Hchan immediately in memory. -diff -r bb70e852004f libgo/runtime/heapdump.c ---- a/libgo/runtime/heapdump.c Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/heapdump.c Fri Apr 03 17:31:02 2015 -0700 -@@ -387,7 +387,7 @@ - if(sp->kind != KindSpecialFinalizer) - continue; - spf = (SpecialFinalizer*)sp; -- p = (byte*)((s->start << PageShift) + spf->offset); -+ p = (byte*)((s->start << PageShift) + spf->special.offset); - dumpfinalizer(p, spf->fn, spf->ft, spf->ot); - } - } -@@ -566,7 +566,7 @@ - if(sp->kind != KindSpecialProfile) - continue; - spp = (SpecialProfile*)sp; -- p = (byte*)((s->start << PageShift) + spp->offset); -+ p = (byte*)((s->start << PageShift) + spp->special.offset); - dumpint(TagAllocSample); - dumpint((uintptr)p); - dumpint((uintptr)spp->b); -diff -r bb70e852004f libgo/runtime/malloc.goc ---- a/libgo/runtime/malloc.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/malloc.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -429,9 +429,9 @@ - m->mcache->local_nlookup++; - if (sizeof(void*) == 4 && m->mcache->local_nlookup >= (1<<30)) { - // purge cache stats to prevent overflow -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - runtime_purgecachedstats(m->mcache); -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - } - - s = runtime_MHeap_LookupMaybe(&runtime_mheap, v); -@@ -728,7 +728,7 @@ - - static struct - { -- Lock; -+ Lock lock; - byte* pos; - byte* end; - } persistent; -@@ -757,19 +757,19 @@ - align = 8; - if(size >= PersistentAllocMaxBlock) - return runtime_SysAlloc(size, stat); -- runtime_lock(&persistent); -+ runtime_lock(&persistent.lock); - persistent.pos = (byte*)ROUND((uintptr)persistent.pos, align); - if(persistent.pos + size > persistent.end) { - persistent.pos = runtime_SysAlloc(PersistentAllocChunk, &mstats.other_sys); - if(persistent.pos == nil) { -- runtime_unlock(&persistent); -+ runtime_unlock(&persistent.lock); - runtime_throw("runtime: cannot allocate memory"); - } - persistent.end = persistent.pos + PersistentAllocChunk; - } - p = persistent.pos; - persistent.pos += size; -- runtime_unlock(&persistent); -+ runtime_unlock(&persistent.lock); - if(stat != &mstats.other_sys) { - // reaccount the allocation against provided stat - runtime_xadd64(stat, size); -diff -r bb70e852004f libgo/runtime/malloc.h ---- a/libgo/runtime/malloc.h Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/malloc.h Fri Apr 03 17:31:02 2015 -0700 -@@ -390,7 +390,7 @@ - typedef struct SpecialFinalizer SpecialFinalizer; - struct SpecialFinalizer - { -- Special; -+ Special special; - FuncVal* fn; - const FuncType* ft; - const PtrType* ot; -@@ -401,7 +401,7 @@ - typedef struct SpecialProfile SpecialProfile; - struct SpecialProfile - { -- Special; -+ Special special; - Bucket* b; - }; - -@@ -458,7 +458,7 @@ - // Central list of free objects of a given size. - struct MCentral - { -- Lock; -+ Lock lock; - int32 sizeclass; - MSpan nonempty; // list of spans with a free object - MSpan empty; // list of spans with no free objects (or cached in an MCache) -@@ -476,7 +476,7 @@ - // but all the other global data is here too. - struct MHeap - { -- Lock; -+ Lock lock; - MSpan free[MaxMHeapList]; // free lists of given length - MSpan freelarge; // free lists length >= MaxMHeapList - MSpan busy[MaxMHeapList]; // busy lists of large objects of given length -@@ -505,7 +505,7 @@ - // spaced CacheLineSize bytes apart, so that each MCentral.Lock - // gets its own cache line. - struct { -- MCentral; -+ MCentral mcentral; - byte pad[64]; - } central[NumSizeClasses]; - -diff -r bb70e852004f libgo/runtime/mcache.c ---- a/libgo/runtime/mcache.c Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/mcache.c Fri Apr 03 17:31:02 2015 -0700 -@@ -23,9 +23,9 @@ - MCache *c; - int32 i; - -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - c = runtime_FixAlloc_Alloc(&runtime_mheap.cachealloc); -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - runtime_memclr((byte*)c, sizeof(*c)); - for(i = 0; i < NumSizeClasses; i++) - c->alloc[i] = &emptymspan; -@@ -44,10 +44,10 @@ - runtime_freemcache(MCache *c) - { - runtime_MCache_ReleaseAll(c); -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - runtime_purgecachedstats(c); - runtime_FixAlloc_Free(&runtime_mheap.cachealloc, c); -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - } - - // Gets a span that has a free object in it and assigns it -@@ -64,19 +64,19 @@ - if(s->freelist != nil) - runtime_throw("refill on a nonempty span"); - if(s != &emptymspan) -- runtime_MCentral_UncacheSpan(&runtime_mheap.central[sizeclass], s); -+ runtime_MCentral_UncacheSpan(&runtime_mheap.central[sizeclass].mcentral, s); - - // Push any explicitly freed objects to the central lists. - // Not required, but it seems like a good time to do it. - l = &c->free[sizeclass]; - if(l->nlist > 0) { -- runtime_MCentral_FreeList(&runtime_mheap.central[sizeclass], l->list); -+ runtime_MCentral_FreeList(&runtime_mheap.central[sizeclass].mcentral, l->list); - l->list = nil; - l->nlist = 0; - } - - // Get a new cached span from the central lists. -- s = runtime_MCentral_CacheSpan(&runtime_mheap.central[sizeclass]); -+ s = runtime_MCentral_CacheSpan(&runtime_mheap.central[sizeclass].mcentral); - if(s == nil) - runtime_throw("out of memory"); - if(s->freelist == nil) { -@@ -102,7 +102,7 @@ - // We transfer a span at a time from MCentral to MCache, - // so we'll do the same in the other direction. - if(l->nlist >= (runtime_class_to_allocnpages[sizeclass]<list); -+ runtime_MCentral_FreeList(&runtime_mheap.central[sizeclass].mcentral, l->list); - l->list = nil; - l->nlist = 0; - } -@@ -118,12 +118,12 @@ - for(i=0; ialloc[i]; - if(s != &emptymspan) { -- runtime_MCentral_UncacheSpan(&runtime_mheap.central[i], s); -+ runtime_MCentral_UncacheSpan(&runtime_mheap.central[i].mcentral, s); - c->alloc[i] = &emptymspan; - } - l = &c->free[i]; - if(l->nlist > 0) { -- runtime_MCentral_FreeList(&runtime_mheap.central[i], l->list); -+ runtime_MCentral_FreeList(&runtime_mheap.central[i].mcentral, l->list); - l->list = nil; - l->nlist = 0; - } -diff -r bb70e852004f libgo/runtime/mcentral.c ---- a/libgo/runtime/mcentral.c Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/mcentral.c Fri Apr 03 17:31:02 2015 -0700 -@@ -39,14 +39,14 @@ - int32 cap, n; - uint32 sg; - -- runtime_lock(c); -+ runtime_lock(&c->lock); - sg = runtime_mheap.sweepgen; - retry: - for(s = c->nonempty.next; s != &c->nonempty; s = s->next) { - if(s->sweepgen == sg-2 && runtime_cas(&s->sweepgen, sg-2, sg-1)) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_MSpan_Sweep(s); -- runtime_lock(c); -+ runtime_lock(&c->lock); - // the span could have been moved to heap, retry - goto retry; - } -@@ -65,9 +65,9 @@ - runtime_MSpanList_Remove(s); - // swept spans are at the end of the list - runtime_MSpanList_InsertBack(&c->empty, s); -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_MSpan_Sweep(s); -- runtime_lock(c); -+ runtime_lock(&c->lock); - // the span could be moved to nonempty or heap, retry - goto retry; - } -@@ -82,7 +82,7 @@ - - // Replenish central list if empty. - if(!MCentral_Grow(c)) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return nil; - } - goto retry; -@@ -98,7 +98,7 @@ - runtime_MSpanList_Remove(s); - runtime_MSpanList_InsertBack(&c->empty, s); - s->incache = true; -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return s; - } - -@@ -109,7 +109,7 @@ - MLink *v; - int32 cap, n; - -- runtime_lock(c); -+ runtime_lock(&c->lock); - - s->incache = false; - -@@ -135,7 +135,7 @@ - runtime_MSpanList_Remove(s); - runtime_MSpanList_Insert(&c->nonempty, s); - } -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - } - - // Free the list of objects back into the central free list c. -@@ -145,12 +145,12 @@ - { - MLink *next; - -- runtime_lock(c); -+ runtime_lock(&c->lock); - for(; start != nil; start = next) { - next = start->next; - MCentral_Free(c, start); - } -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - } - - // Helper: free one object back into the central free list. -@@ -193,7 +193,7 @@ - // If s is completely freed, return it to the heap. - if(s->ref == 0) { - MCentral_ReturnToHeap(c, s); // unlocks c -- runtime_lock(c); -+ runtime_lock(&c->lock); - } - } - -@@ -206,7 +206,7 @@ - { - if(s->incache) - runtime_throw("freespan into cached span"); -- runtime_lock(c); -+ runtime_lock(&c->lock); - - // Move to nonempty if necessary. - if(s->freelist == nil) { -@@ -227,7 +227,7 @@ - runtime_atomicstore(&s->sweepgen, runtime_mheap.sweepgen); - - if(s->ref != 0) { -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - return false; - } - -@@ -260,12 +260,12 @@ - byte *p; - MSpan *s; - -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_MGetSizeClassInfo(c->sizeclass, &size, &npages, &n); - s = runtime_MHeap_Alloc(&runtime_mheap, npages, c->sizeclass, 0, 1); - if(s == nil) { - // TODO(rsc): Log out of memory -- runtime_lock(c); -+ runtime_lock(&c->lock); - return false; - } - -@@ -282,7 +282,7 @@ - *tailp = nil; - runtime_markspan((byte*)(s->start<npages<lock); - c->nfree += n; - runtime_MSpanList_Insert(&c->nonempty, s); - return true; -@@ -301,7 +301,7 @@ - if(s->ref != 0) - runtime_throw("ref wrong"); - c->nfree -= (s->npages << PageShift) / size; -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - runtime_unmarkspan((byte*)(s->start<npages<start << PageShift) + spf->offset/s->elemsize*s->elemsize); -+ p = (void*)((s->start << PageShift) + spf->special.offset/s->elemsize*s->elemsize); - enqueue1(&wbuf, (Obj){p, s->elemsize, 0}); - enqueue1(&wbuf, (Obj){(void*)&spf->fn, PtrSize, 0}); - enqueue1(&wbuf, (Obj){(void*)&spf->ft, PtrSize, 0}); -@@ -1378,7 +1378,7 @@ - b = (Workbuf*)runtime_lfstackpop(&work.empty); - if(b == nil) { - // Need to allocate. -- runtime_lock(&work); -+ runtime_lock(&work.lock); - if(work.nchunk < sizeof *b) { - work.nchunk = 1<<20; - work.chunk = runtime_SysAlloc(work.nchunk, &mstats.gc_sys); -@@ -1388,7 +1388,7 @@ - b = (Workbuf*)work.chunk; - work.chunk += sizeof *b; - work.nchunk -= sizeof *b; -- runtime_unlock(&work); -+ runtime_unlock(&work.lock); - } - b->nobj = 0; - return b; -@@ -1802,7 +1802,7 @@ - c->local_nsmallfree[cl] += nfree; - c->local_cachealloc -= nfree * size; - runtime_xadd64(&mstats.next_gc, -(uint64)(nfree * size * (gcpercent + 100)/100)); -- res = runtime_MCentral_FreeSpan(&runtime_mheap.central[cl], s, nfree, head.next, end); -+ res = runtime_MCentral_FreeSpan(&runtime_mheap.central[cl].mcentral, s, nfree, head.next, end); - //MCentral_FreeSpan updates sweepgen - } - return res; -@@ -2147,10 +2147,10 @@ - return; - - if(gcpercent == GcpercentUnknown) { // first time through -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - if(gcpercent == GcpercentUnknown) - gcpercent = readgogc(); -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - } - if(gcpercent < 0) - return; -@@ -2423,7 +2423,7 @@ - - // Pass back: pauses, last gc (absolute time), number of gc, total pause ns. - p = (uint64*)pauses->array; -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - n = mstats.numgc; - if(n > nelem(mstats.pause_ns)) - n = nelem(mstats.pause_ns); -@@ -2438,7 +2438,7 @@ - p[n] = mstats.last_gc; - p[n+1] = mstats.numgc; - p[n+2] = mstats.pause_total_ns; -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - pauses->__count = n+3; - } - -@@ -2446,14 +2446,14 @@ - runtime_setgcpercent(int32 in) { - int32 out; - -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - if(gcpercent == GcpercentUnknown) - gcpercent = readgogc(); - out = gcpercent; - if(in < 0) - in = -1; - gcpercent = in; -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - return out; - } - -diff -r bb70e852004f libgo/runtime/mheap.c ---- a/libgo/runtime/mheap.c Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/mheap.c Fri Apr 03 17:31:02 2015 -0700 -@@ -70,7 +70,7 @@ - runtime_MSpanList_Init(&h->freelarge); - runtime_MSpanList_Init(&h->busylarge); - for(i=0; icentral); i++) -- runtime_MCentral_Init(&h->central[i], i); -+ runtime_MCentral_Init(&h->central[i].mcentral, i); - } - - void -@@ -109,9 +109,9 @@ - runtime_MSpanList_Remove(s); - // swept spans are at the end of the list - runtime_MSpanList_InsertBack(list, s); -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - n += runtime_MSpan_Sweep(s); -- runtime_lock(h); -+ runtime_lock(&h->lock); - if(n >= npages) - return n; - // the span could have been moved elsewhere -@@ -156,7 +156,7 @@ - } - - // Now sweep everything that is not yet swept. -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - for(;;) { - n = runtime_sweepone(); - if(n == (uintptr)-1) // all spans are swept -@@ -165,7 +165,7 @@ - if(reclaimed >= npage) - break; - } -- runtime_lock(h); -+ runtime_lock(&h->lock); - } - - // Allocate a new span of npage pages from the heap -@@ -175,7 +175,7 @@ - { - MSpan *s; - -- runtime_lock(h); -+ runtime_lock(&h->lock); - mstats.heap_alloc += runtime_m()->mcache->local_cachealloc; - runtime_m()->mcache->local_cachealloc = 0; - s = MHeap_AllocLocked(h, npage, sizeclass); -@@ -191,7 +191,7 @@ - runtime_MSpanList_InsertBack(&h->busylarge, s); - } - } -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - if(s != nil) { - if(needzero && s->needzero) - runtime_memclr((byte*)(s->start<npages<lock); - mstats.heap_alloc += runtime_m()->mcache->local_cachealloc; - runtime_m()->mcache->local_cachealloc = 0; - mstats.heap_inuse -= s->npages<lock); - } - - static void -@@ -548,10 +548,10 @@ - runtime_noteclear(¬e); - runtime_notetsleepg(¬e, tick); - -- runtime_lock(h); -+ runtime_lock(&h->lock); - unixnow = runtime_unixnanotime(); - if(unixnow - mstats.last_gc > forcegc) { -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - // The scavenger can not block other goroutines, - // otherwise deadlock detector can fire spuriously. - // GC blocks other goroutines via the runtime_worldsema. -@@ -561,11 +561,11 @@ - runtime_notetsleepg(¬e, -1); - if(runtime_debug.gctrace > 0) - runtime_printf("scvg%d: GC forced\n", k); -- runtime_lock(h); -+ runtime_lock(&h->lock); - } - now = runtime_nanotime(); - scavenge(k, now, limit); -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - } - } - -@@ -575,9 +575,9 @@ - runtime_debug_freeOSMemory(void) - { - runtime_gc(2); // force GC and do eager sweep -- runtime_lock(&runtime_mheap); -+ runtime_lock(&runtime_mheap.lock); - scavenge(-1, ~(uintptr)0, 0); -- runtime_unlock(&runtime_mheap); -+ runtime_unlock(&runtime_mheap.lock); - } - - // Initialize a new span with the given start and npages. -@@ -752,11 +752,11 @@ - runtime_lock(&runtime_mheap.speciallock); - s = runtime_FixAlloc_Alloc(&runtime_mheap.specialfinalizeralloc); - runtime_unlock(&runtime_mheap.speciallock); -- s->kind = KindSpecialFinalizer; -+ s->special.kind = KindSpecialFinalizer; - s->fn = f; - s->ft = ft; - s->ot = ot; -- if(addspecial(p, s)) -+ if(addspecial(p, &s->special)) - return true; - - // There was an old finalizer -@@ -789,9 +789,9 @@ - runtime_lock(&runtime_mheap.speciallock); - s = runtime_FixAlloc_Alloc(&runtime_mheap.specialprofilealloc); - runtime_unlock(&runtime_mheap.speciallock); -- s->kind = KindSpecialProfile; -+ s->special.kind = KindSpecialProfile; - s->b = b; -- if(!addspecial(p, s)) -+ if(!addspecial(p, &s->special)) - runtime_throw("setprofilebucket: profile already set"); - } - -@@ -879,14 +879,14 @@ - // remove the span from whatever list it is in now - if(s->sizeclass > 0) { - // must be in h->central[x].empty -- c = &h->central[s->sizeclass]; -- runtime_lock(c); -+ c = &h->central[s->sizeclass].mcentral; -+ runtime_lock(&c->lock); - runtime_MSpanList_Remove(s); -- runtime_unlock(c); -- runtime_lock(h); -+ runtime_unlock(&c->lock); -+ runtime_lock(&h->lock); - } else { - // must be in h->busy/busylarge -- runtime_lock(h); -+ runtime_lock(&h->lock); - runtime_MSpanList_Remove(s); - } - // heap is locked now -@@ -933,18 +933,18 @@ - - // place the span into a new list - if(s->sizeclass > 0) { -- runtime_unlock(h); -- c = &h->central[s->sizeclass]; -- runtime_lock(c); -+ runtime_unlock(&h->lock); -+ c = &h->central[s->sizeclass].mcentral; -+ runtime_lock(&c->lock); - // swept spans are at the end of the list - runtime_MSpanList_InsertBack(&c->empty, s); -- runtime_unlock(c); -+ runtime_unlock(&c->lock); - } else { - // Swept spans are at the end of lists. - if(s->npages < nelem(h->free)) - runtime_MSpanList_InsertBack(&h->busy[s->npages], s); - else - runtime_MSpanList_InsertBack(&h->busylarge, s); -- runtime_unlock(h); -+ runtime_unlock(&h->lock); - } - } -diff -r bb70e852004f libgo/runtime/netpoll.goc ---- a/libgo/runtime/netpoll.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/netpoll.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -53,7 +53,7 @@ - // pollReset, pollWait, pollWaitCanceled and runtime_netpollready (IO rediness notification) - // proceed w/o taking the lock. So closing, rg, rd, wg and wd are manipulated - // in a lock-free way by all operations. -- Lock; // protectes the following fields -+ Lock lock; // protectes the following fields - uintptr fd; - bool closing; - uintptr seq; // protects from stale timers and ready notifications -@@ -68,7 +68,7 @@ - - static struct - { -- Lock; -+ Lock lock; - PollDesc* first; - // PollDesc objects must be type-stable, - // because we can get ready notification from epoll/kqueue -@@ -100,7 +100,7 @@ - - func runtime_pollOpen(fd uintptr) (pd *PollDesc, errno int) { - pd = allocPollDesc(); -- runtime_lock(pd); -+ runtime_lock(&pd->lock); - if(pd->wg != nil && pd->wg != READY) - runtime_throw("runtime_pollOpen: blocked write on free descriptor"); - if(pd->rg != nil && pd->rg != READY) -@@ -112,7 +112,7 @@ - pd->rd = 0; - pd->wg = nil; - pd->wd = 0; -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - - errno = runtime_netpollopen(fd, pd); - } -@@ -125,10 +125,10 @@ - if(pd->rg != nil && pd->rg != READY) - runtime_throw("runtime_pollClose: blocked read on closing descriptor"); - runtime_netpollclose(pd->fd); -- runtime_lock(&pollcache); -+ runtime_lock(&pollcache.lock); - pd->link = pollcache.first; - pollcache.first = pd; -- runtime_unlock(&pollcache); -+ runtime_unlock(&pollcache.lock); - } - - func runtime_pollReset(pd *PollDesc, mode int) (err int) { -@@ -169,9 +169,9 @@ - func runtime_pollSetDeadline(pd *PollDesc, d int64, mode int) { - G *rg, *wg; - -- runtime_lock(pd); -+ runtime_lock(&pd->lock); - if(pd->closing) { -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - return; - } - pd->seq++; // invalidate current timers -@@ -226,7 +226,7 @@ - rg = netpollunblock(pd, 'r', false); - if(pd->wd < 0) - wg = netpollunblock(pd, 'w', false); -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - if(rg) - runtime_ready(rg); - if(wg) -@@ -236,7 +236,7 @@ - func runtime_pollUnblock(pd *PollDesc) { - G *rg, *wg; - -- runtime_lock(pd); -+ runtime_lock(&pd->lock); - if(pd->closing) - runtime_throw("runtime_pollUnblock: already closing"); - pd->closing = true; -@@ -252,7 +252,7 @@ - runtime_deltimer(&pd->wt); - pd->wt.fv = nil; - } -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - if(rg) - runtime_ready(rg); - if(wg) -@@ -280,13 +280,13 @@ - void - runtime_netpolllock(PollDesc *pd) - { -- runtime_lock(pd); -+ runtime_lock(&pd->lock); - } - - void - runtime_netpollunlock(PollDesc *pd) - { -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - } - - // make pd ready, newly runnable goroutines (if any) are enqueued info gpp list -@@ -399,12 +399,12 @@ - - pd = (PollDesc*)arg.data; - rg = wg = nil; -- runtime_lock(pd); -+ runtime_lock(&pd->lock); - // Seq arg is seq when the timer was set. - // If it's stale, ignore the timer event. - if(seq != pd->seq) { - // The descriptor was reused or timers were reset. -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - return; - } - if(read) { -@@ -421,7 +421,7 @@ - runtime_atomicstorep(&pd->wt.fv, nil); // full memory barrier between store to wd and load of wg in netpollunblock - wg = netpollunblock(pd, 'w', false); - } -- runtime_unlock(pd); -+ runtime_unlock(&pd->lock); - if(rg) - runtime_ready(rg); - if(wg) -@@ -452,7 +452,7 @@ - PollDesc *pd; - uint32 i, n; - -- runtime_lock(&pollcache); -+ runtime_lock(&pollcache.lock); - if(pollcache.first == nil) { - n = PollBlockSize/sizeof(*pd); - if(n == 0) -@@ -467,6 +467,6 @@ - } - pd = pollcache.first; - pollcache.first = pd->link; -- runtime_unlock(&pollcache); -+ runtime_unlock(&pollcache.lock); - return pd; - } -diff -r bb70e852004f libgo/runtime/proc.c ---- a/libgo/runtime/proc.c Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/proc.c Fri Apr 03 17:31:02 2015 -0700 -@@ -302,7 +302,7 @@ - - typedef struct Sched Sched; - struct Sched { -- Lock; -+ Lock lock; - - uint64 goidgen; - M* midle; // idle m's waiting for work -@@ -709,7 +709,7 @@ - - mp->fastrand = 0x49f6428aUL + mp->id + runtime_cputicks(); - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - mp->id = runtime_sched.mcount++; - checkmcount(); - runtime_mpreinit(mp); -@@ -720,7 +720,7 @@ - // runtime_NumCgoCall() iterates over allm w/o schedlock, - // so we need to publish it safely. - runtime_atomicstorep(&runtime_allm, mp); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - // Mark gp ready to run. -@@ -747,7 +747,7 @@ - - // Figure out how many CPUs to use during GC. - // Limited by gomaxprocs, number of actual CPUs, and MaxGcproc. -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - n = runtime_gomaxprocs; - if(n > runtime_ncpu) - n = runtime_ncpu > 0 ? runtime_ncpu : 1; -@@ -755,7 +755,7 @@ - n = MaxGcproc; - if(n > runtime_sched.nmidle+1) // one M is currently running - n = runtime_sched.nmidle+1; -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return n; - } - -@@ -764,14 +764,14 @@ - { - int32 n; - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - n = runtime_gomaxprocs; - if(n > runtime_ncpu) - n = runtime_ncpu; - if(n > MaxGcproc) - n = MaxGcproc; - n -= runtime_sched.nmidle+1; // one M is currently running -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return n > 0; - } - -@@ -781,7 +781,7 @@ - M *mp; - int32 n, pos; - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - pos = 0; - for(n = 1; n < nproc; n++) { // one M is currently running - if(runtime_allp[pos]->mcache == m->mcache) -@@ -794,7 +794,7 @@ - pos++; - runtime_notewakeup(&mp->park); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - // Similar to stoptheworld but best-effort and can be called several times. -@@ -833,7 +833,7 @@ - P *p; - bool wait; - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - runtime_sched.stopwait = runtime_gomaxprocs; - runtime_atomicstore((uint32*)&runtime_sched.gcwaiting, 1); - preemptall(); -@@ -853,7 +853,7 @@ - runtime_sched.stopwait--; - } - wait = runtime_sched.stopwait > 0; -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - - // wait for remaining P's to stop voluntarily - if(wait) { -@@ -887,7 +887,7 @@ - gp = runtime_netpoll(false); // non-blocking - injectglist(gp); - add = needaddgcproc(); -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(newprocs) { - procresize(newprocs); - newprocs = 0; -@@ -911,7 +911,7 @@ - runtime_sched.sysmonwait = false; - runtime_notewakeup(&runtime_sched.sysmonnote); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - - while(p1) { - p = p1; -@@ -1346,9 +1346,9 @@ - } - - retry: -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - mput(m); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - runtime_notesleep(&m->park); - runtime_noteclear(&m->park); - if(m->helpgc) { -@@ -1375,18 +1375,18 @@ - M *mp; - void (*fn)(void); - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(p == nil) { - p = pidleget(); - if(p == nil) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(spinning) - runtime_xadd(&runtime_sched.nmspinning, -1); - return; - } - } - mp = mget(); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(mp == nil) { - fn = nil; - if(spinning) -@@ -1419,28 +1419,28 @@ - startm(p, true); - return; - } -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(runtime_sched.gcwaiting) { - p->status = Pgcstop; - if(--runtime_sched.stopwait == 0) - runtime_notewakeup(&runtime_sched.stopnote); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return; - } - if(runtime_sched.runqsize) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - startm(p, false); - return; - } - // If this is the last running P and nobody is polling network, - // need to wakeup another M to poll network. - if(runtime_sched.npidle == (uint32)runtime_gomaxprocs-1 && runtime_atomicload64(&runtime_sched.lastpoll) != 0) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - startm(p, false); - return; - } - pidleput(p); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - // Tries to add one more P to execute G's. -@@ -1512,11 +1512,11 @@ - runtime_xadd(&runtime_sched.nmspinning, -1); - } - p = releasep(); -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - p->status = Pgcstop; - if(--runtime_sched.stopwait == 0) - runtime_notewakeup(&runtime_sched.stopnote); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - stopm(); - } - -@@ -1567,9 +1567,9 @@ - return gp; - // global runq - if(runtime_sched.runqsize) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - gp = globrunqget(m->p, 0); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(gp) - return gp; - } -@@ -1603,19 +1603,19 @@ - } - stop: - // return P and block -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(runtime_sched.gcwaiting) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - goto top; - } - if(runtime_sched.runqsize) { - gp = globrunqget(m->p, 0); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return gp; - } - p = releasep(); - pidleput(p); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(m->spinning) { - m->spinning = false; - runtime_xadd(&runtime_sched.nmspinning, -1); -@@ -1624,9 +1624,9 @@ - for(i = 0; i < runtime_gomaxprocs; i++) { - p = runtime_allp[i]; - if(p && p->runqhead != p->runqtail) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - p = pidleget(); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(p) { - acquirep(p); - goto top; -@@ -1643,9 +1643,9 @@ - gp = runtime_netpoll(true); // block until new work is available - runtime_atomicstore64(&runtime_sched.lastpoll, runtime_nanotime()); - if(gp) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - p = pidleget(); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(p) { - acquirep(p); - injectglist(gp->schedlink); -@@ -1688,14 +1688,14 @@ - - if(glist == nil) - return; -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - for(n = 0; glist; n++) { - gp = glist; - glist = gp->schedlink; - gp->status = Grunnable; - globrunqput(gp); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - - for(; n && runtime_sched.npidle; n--) - startm(nil, false); -@@ -1726,9 +1726,9 @@ - // This is a fancy way to say tick%61==0, - // it uses 2 MUL instructions instead of a single DIV and so is faster on modern processors. - if(tick - (((uint64)tick*0x4325c53fu)>>36)*61 == 0 && runtime_sched.runqsize > 0) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - gp = globrunqget(m->p, 1); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(gp) - resetspinning(); - } -@@ -1822,9 +1822,9 @@ - gp->status = Grunnable; - gp->m = nil; - m->curg = nil; -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - globrunqput(gp); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(m->lockedg) { - stoplockedm(); - execute(gp); // Never returns. -@@ -1925,24 +1925,24 @@ - g->status = Gsyscall; - - if(runtime_atomicload(&runtime_sched.sysmonwait)) { // TODO: fast atomic -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(runtime_atomicload(&runtime_sched.sysmonwait)) { - runtime_atomicstore(&runtime_sched.sysmonwait, 0); - runtime_notewakeup(&runtime_sched.sysmonnote); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - m->mcache = nil; - m->p->m = nil; - runtime_atomicstore(&m->p->status, Psyscall); - if(runtime_sched.gcwaiting) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if (runtime_sched.stopwait > 0 && runtime_cas(&m->p->status, Psyscall, Pgcstop)) { - if(--runtime_sched.stopwait == 0) - runtime_notewakeup(&runtime_sched.stopnote); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - m->locks--; -@@ -2053,13 +2053,13 @@ - // Try to get any other idle P. - m->p = nil; - if(runtime_sched.pidle) { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - p = pidleget(); - if(p && runtime_atomicload(&runtime_sched.sysmonwait)) { - runtime_atomicstore(&runtime_sched.sysmonwait, 0); - runtime_notewakeup(&runtime_sched.sysmonnote); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(p) { - acquirep(p); - return true; -@@ -2078,7 +2078,7 @@ - gp->status = Grunnable; - gp->m = nil; - m->curg = nil; -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - p = pidleget(); - if(p == nil) - globrunqput(gp); -@@ -2086,7 +2086,7 @@ - runtime_atomicstore(&runtime_sched.sysmonwait, 0); - runtime_notewakeup(&runtime_sched.sysmonnote); - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - if(p) { - acquirep(p); - execute(gp); // Never returns. -@@ -2365,13 +2365,13 @@ - - if(n > MaxGomaxprocs) - n = MaxGomaxprocs; -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - ret = runtime_gomaxprocs; - if(n <= 0 || n == ret) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return ret; - } -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - - runtime_semacquire(&runtime_worldsema, false); - m->gcing = 1; -@@ -2476,7 +2476,7 @@ - } - - static struct { -- Lock; -+ Lock lock; - void (*fn)(uintptr*, int32); - int32 hz; - uintptr pcbuf[TracebackMaxFrames]; -@@ -2508,9 +2508,9 @@ - if(mp->mcache == nil) - traceback = false; - -- runtime_lock(&prof); -+ runtime_lock(&prof.lock); - if(prof.fn == nil) { -- runtime_unlock(&prof); -+ runtime_unlock(&prof.lock); - mp->mallocing--; - return; - } -@@ -2538,7 +2538,7 @@ - prof.pcbuf[1] = (uintptr)System; - } - prof.fn(prof.pcbuf, n); -- runtime_unlock(&prof); -+ runtime_unlock(&prof.lock); - mp->mallocing--; - } - -@@ -2563,13 +2563,13 @@ - // it would deadlock. - runtime_resetcpuprofiler(0); - -- runtime_lock(&prof); -+ runtime_lock(&prof.lock); - prof.fn = fn; - prof.hz = hz; -- runtime_unlock(&prof); -- runtime_lock(&runtime_sched); -+ runtime_unlock(&prof.lock); -+ runtime_lock(&runtime_sched.lock); - runtime_sched.profilehz = hz; -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - - if(hz != 0) - runtime_resetcpuprofiler(hz); -@@ -2707,11 +2707,11 @@ - static void - incidlelocked(int32 v) - { -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - runtime_sched.nmidlelocked += v; - if(v > 0) - checkdead(); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - // Check for deadlock situation. -@@ -2780,16 +2780,16 @@ - runtime_usleep(delay); - if(runtime_debug.schedtrace <= 0 && - (runtime_sched.gcwaiting || runtime_atomicload(&runtime_sched.npidle) == (uint32)runtime_gomaxprocs)) { // TODO: fast atomic -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - if(runtime_atomicload(&runtime_sched.gcwaiting) || runtime_atomicload(&runtime_sched.npidle) == (uint32)runtime_gomaxprocs) { - runtime_atomicstore(&runtime_sched.sysmonwait, 1); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - runtime_notesleep(&runtime_sched.sysmonnote); - runtime_noteclear(&runtime_sched.sysmonnote); - idle = 0; - delay = 20; - } else -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - // poll network if not polled for more than 10ms - lastpoll = runtime_atomicload64(&runtime_sched.lastpoll); -@@ -2918,7 +2918,7 @@ - if(starttime == 0) - starttime = now; - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - runtime_printf("SCHED %Dms: gomaxprocs=%d idleprocs=%d threads=%d idlethreads=%d runqueue=%d", - (now-starttime)/1000000, runtime_gomaxprocs, runtime_sched.npidle, runtime_sched.mcount, - runtime_sched.nmidle, runtime_sched.runqsize); -@@ -2954,7 +2954,7 @@ - } - } - if(!detailed) { -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return; - } - for(mp = runtime_allm; mp; mp = mp->alllink) { -@@ -2986,7 +2986,7 @@ - lockedm ? lockedm->id : -1); - } - runtime_unlock(&allglock); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - } - - // Put mp on midle list. -@@ -3142,9 +3142,9 @@ - for(i=0; ischedlink = batch[i+1]; - // Now put the batch on global queue. -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - globrunqputbatch(batch[0], batch[n], n+1); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return true; - } - -@@ -3296,11 +3296,11 @@ - { - int32 out; - -- runtime_lock(&runtime_sched); -+ runtime_lock(&runtime_sched.lock); - out = runtime_sched.maxmcount; - runtime_sched.maxmcount = in; - checkmcount(); -- runtime_unlock(&runtime_sched); -+ runtime_unlock(&runtime_sched.lock); - return out; - } - -diff -r bb70e852004f libgo/runtime/runtime.h ---- a/libgo/runtime/runtime.h Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/runtime.h Fri Apr 03 17:31:02 2015 -0700 -@@ -285,7 +285,7 @@ - - struct P - { -- Lock; -+ Lock lock; - - int32 id; - uint32 status; // one of Pidle/Prunning/... -@@ -383,7 +383,7 @@ - - struct Timers - { -- Lock; -+ Lock lock; - G *timerproc; - bool sleeping; - bool rescheduling; -diff -r bb70e852004f libgo/runtime/sema.goc ---- a/libgo/runtime/sema.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/sema.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -35,7 +35,7 @@ - typedef struct SemaRoot SemaRoot; - struct SemaRoot - { -- Lock; -+ Lock lock; - SemaWaiter* head; - SemaWaiter* tail; - // Number of waiters. Read w/o the lock. -@@ -47,7 +47,7 @@ - - struct semtable - { -- SemaRoot; -+ SemaRoot root; - uint8 pad[CacheLineSize-sizeof(SemaRoot)]; - }; - static struct semtable semtable[SEMTABLESZ]; -@@ -55,7 +55,7 @@ - static SemaRoot* - semroot(uint32 volatile *addr) - { -- return &semtable[((uintptr)addr >> 3) % SEMTABLESZ]; -+ return &semtable[((uintptr)addr >> 3) % SEMTABLESZ].root; - } - - static void -@@ -124,19 +124,19 @@ - } - for(;;) { - -- runtime_lock(root); -+ runtime_lock(&root->lock); - // Add ourselves to nwait to disable "easy case" in semrelease. - runtime_xadd(&root->nwait, 1); - // Check cansemacquire to avoid missed wakeup. - if(cansemacquire(addr)) { - runtime_xadd(&root->nwait, -1); -- runtime_unlock(root); -+ runtime_unlock(&root->lock); - return; - } - // Any semrelease after the cansemacquire knows we're waiting - // (we set nwait above), so go to sleep. - semqueue(root, addr, &s); -- runtime_parkunlock(root, "semacquire"); -+ runtime_parkunlock(&root->lock, "semacquire"); - if(cansemacquire(addr)) { - if(t0) - runtime_blockevent(s.releasetime - t0, 3); -@@ -161,11 +161,11 @@ - return; - - // Harder case: search for a waiter and wake it. -- runtime_lock(root); -+ runtime_lock(&root->lock); - if(runtime_atomicload(&root->nwait) == 0) { - // The count is already consumed by another goroutine, - // so no need to wake up another goroutine. -- runtime_unlock(root); -+ runtime_unlock(&root->lock); - return; - } - for(s = root->head; s; s = s->next) { -@@ -175,7 +175,7 @@ - break; - } - } -- runtime_unlock(root); -+ runtime_unlock(&root->lock); - if(s) { - if(s->releasetime) - s->releasetime = runtime_cputicks(); -@@ -211,7 +211,7 @@ - typedef struct SyncSema SyncSema; - struct SyncSema - { -- Lock; -+ Lock lock; - SemaWaiter* head; - SemaWaiter* tail; - }; -@@ -238,7 +238,7 @@ - w.releasetime = -1; - } - -- runtime_lock(s); -+ runtime_lock(&s->lock); - if(s->head && s->head->nrelease > 0) { - // have pending release, consume it - wake = nil; -@@ -249,7 +249,7 @@ - if(s->head == nil) - s->tail = nil; - } -- runtime_unlock(s); -+ runtime_unlock(&s->lock); - if(wake) - runtime_ready(wake->g); - } else { -@@ -259,7 +259,7 @@ - else - s->tail->next = &w; - s->tail = &w; -- runtime_parkunlock(s, "semacquire"); -+ runtime_parkunlock(&s->lock, "semacquire"); - if(t0) - runtime_blockevent(w.releasetime - t0, 2); - } -@@ -274,7 +274,7 @@ - w.next = nil; - w.releasetime = 0; - -- runtime_lock(s); -+ runtime_lock(&s->lock); - while(w.nrelease > 0 && s->head && s->head->nrelease < 0) { - // have pending acquire, satisfy it - wake = s->head; -@@ -293,7 +293,7 @@ - else - s->tail->next = &w; - s->tail = &w; -- runtime_parkunlock(s, "semarelease"); -+ runtime_parkunlock(&s->lock, "semarelease"); - } else -- runtime_unlock(s); -+ runtime_unlock(&s->lock); - } -diff -r bb70e852004f libgo/runtime/sigqueue.goc ---- a/libgo/runtime/sigqueue.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/sigqueue.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -32,7 +32,7 @@ - #include "defs.h" - - static struct { -- Note; -+ Note note; - uint32 mask[(NSIG+31)/32]; - uint32 wanted[(NSIG+31)/32]; - uint32 state; -@@ -70,7 +70,7 @@ - new = HASSIGNAL; - if(runtime_cas(&sig.state, old, new)) { - if (old == HASWAITER) -- runtime_notewakeup(&sig); -+ runtime_notewakeup(&sig.note); - break; - } - } -@@ -107,8 +107,8 @@ - new = HASWAITER; - if(runtime_cas(&sig.state, old, new)) { - if (new == HASWAITER) { -- runtime_notetsleepg(&sig, -1); -- runtime_noteclear(&sig); -+ runtime_notetsleepg(&sig.note, -1); -+ runtime_noteclear(&sig.note); - } - break; - } -@@ -138,7 +138,7 @@ - // to use for initialization. It does not pass - // signal information in m. - sig.inuse = true; // enable reception of signals; cannot disable -- runtime_noteclear(&sig); -+ runtime_noteclear(&sig.note); - return; - } - -diff -r bb70e852004f libgo/runtime/time.goc ---- a/libgo/runtime/time.goc Fri Jan 16 13:28:21 2015 -0800 -+++ b/libgo/runtime/time.goc Fri Apr 03 17:31:02 2015 -0700 -@@ -92,17 +92,17 @@ - t.fv = &readyv; - t.arg.__object = g; - t.seq = 0; -- runtime_lock(&timers); -+ runtime_lock(&timers.lock); - addtimer(&t); -- runtime_parkunlock(&timers, reason); -+ runtime_parkunlock(&timers.lock, reason); - } - - void - runtime_addtimer(Timer *t) - { -- runtime_lock(&timers); -+ runtime_lock(&timers.lock); - addtimer(t); -- runtime_unlock(&timers); -+ runtime_unlock(&timers.lock); - } - - // Add a timer to the heap and start or kick the timer proc -@@ -167,14 +167,14 @@ - i = t->i; - gi = i; - -- runtime_lock(&timers); -+ runtime_lock(&timers.lock); - - // t may not be registered anymore and may have - // a bogus i (typically 0, if generated by Go). - // Verify it before proceeding. - i = t->i; - if(i < 0 || i >= timers.len || timers.t[i] != t) { -- runtime_unlock(&timers); -+ runtime_unlock(&timers.lock); - return false; - } - -@@ -190,7 +190,7 @@ - } - if(debug) - dumptimers("deltimer"); -- runtime_unlock(&timers); -+ runtime_unlock(&timers.lock); - return true; - } - -@@ -209,7 +209,7 @@ - uintptr seq; - - for(;;) { -- runtime_lock(&timers); -+ runtime_lock(&timers.lock); - timers.sleeping = false; - now = runtime_nanotime(); - for(;;) { -@@ -236,7 +236,7 @@ - f = (void*)t->fv->fn; - arg = t->arg; - seq = t->seq; -- runtime_unlock(&timers); -+ runtime_unlock(&timers.lock); - __builtin_call_with_static_chain(f(arg, seq), fv); - - // clear f and arg to avoid leak while sleeping for next timer -@@ -246,20 +246,20 @@ - arg.__object = nil; - USED(&arg); - -- runtime_lock(&timers); -+ runtime_lock(&timers.lock); - } - if(delta < 0) { - // No timers left - put goroutine to sleep. - timers.rescheduling = true; - runtime_g()->isbackground = true; -- runtime_parkunlock(&timers, "timer goroutine (idle)"); -+ runtime_parkunlock(&timers.lock, "timer goroutine (idle)"); - runtime_g()->isbackground = false; - continue; - } - // At least one timer pending. Sleep until then. - timers.sleeping = true; - runtime_noteclear(&timers.waitnote); -- runtime_unlock(&timers); -+ runtime_unlock(&timers.lock); - runtime_notetsleepg(&timers.waitnote, delta); - } - } diff --git a/llgo/llgo-go.sh b/llgo/llgo-go.sh deleted file mode 100644 index a29be01a55e3..000000000000 --- a/llgo/llgo-go.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/bin/sh -e - -scriptpath=$(which "$0") -scriptpath=$(readlink -f "$scriptpath") -bindir=$(dirname "$scriptpath") -prefix=$(dirname "$bindir") - -cmd="$1" - -case "$cmd" in -build | get | install | run | test) - shift - PATH="$prefix/lib/llgo/go-path:$PATH" exec go "$cmd" -compiler gccgo "$@" - ;; - -*) - exec go "$@" - ;; -esac diff --git a/llgo/ssaopt/esc.go b/llgo/ssaopt/esc.go deleted file mode 100644 index 34a86e1f2518..000000000000 --- a/llgo/ssaopt/esc.go +++ /dev/null @@ -1,94 +0,0 @@ -// Copyright 2014 The llgo Authors. -// Use of this source code is governed by an MIT-style -// license that can be found in the LICENSE file. - -package ssaopt - -import ( - "go/token" - - "llvm.org/llgo/third_party/gotools/go/ssa" -) - -func escapes(val ssa.Value, bb *ssa.BasicBlock, pending []ssa.Value) bool { - for _, p := range pending { - if val == p { - return false - } - } - - for _, ref := range *val.Referrers() { - switch ref := ref.(type) { - case *ssa.Phi: - // We must consider the variable to have escaped if it is - // possible for the program to see more than one "version" - // of the variable at once, as this requires the program - // to use heap allocation for the multiple versions. - // - // I (pcc) think that this is only possible (without stores) - // in the case where a phi node that (directly or indirectly) - // refers to the allocation dominates the allocation. - if ref.Block().Dominates(bb) { - return true - } - if escapes(ref, bb, append(pending, val)) { - return true - } - - case *ssa.BinOp, *ssa.ChangeType, *ssa.Convert, *ssa.ChangeInterface, *ssa.MakeInterface, *ssa.Slice, *ssa.FieldAddr, *ssa.IndexAddr, *ssa.TypeAssert, *ssa.Extract: - if escapes(ref.(ssa.Value), bb, append(pending, val)) { - return true - } - - case *ssa.Range, *ssa.DebugRef: - continue - - case *ssa.UnOp: - if ref.Op == token.MUL || ref.Op == token.ARROW { - continue - } - if escapes(ref, bb, append(pending, val)) { - return true - } - - case *ssa.Store: - if val == ref.Val { - return true - } - - case *ssa.Call: - if builtin, ok := ref.Call.Value.(*ssa.Builtin); ok { - switch builtin.Name() { - case "cap", "len", "copy", "ssa:wrapnilchk": - continue - case "append": - if ref.Call.Args[0] == val && escapes(ref, bb, append(pending, val)) { - return true - } - default: - return true - } - } else { - return true - } - - default: - return true - } - } - - return false -} - -func LowerAllocsToStack(f *ssa.Function) { - pending := make([]ssa.Value, 0, 10) - - for _, b := range f.Blocks { - for _, instr := range b.Instrs { - if alloc, ok := instr.(*ssa.Alloc); ok && alloc.Heap && !escapes(alloc, alloc.Block(), pending) { - alloc.Heap = false - f.Locals = append(f.Locals, alloc) - } - } - } -} diff --git a/llgo/test/CMakeLists.txt b/llgo/test/CMakeLists.txt deleted file mode 100644 index c8a346f3db63..000000000000 --- a/llgo/test/CMakeLists.txt +++ /dev/null @@ -1,16 +0,0 @@ -configure_lit_site_cfg( - ${CMAKE_CURRENT_SOURCE_DIR}/lit.site.cfg.in - ${CMAKE_CURRENT_BINARY_DIR}/lit.site.cfg - ) - -add_lit_testsuite(check-llgo "Running the llgo regression tests" - ${CMAKE_CURRENT_BINARY_DIR} - DEPENDS - FileCheck - count - llgo - llgoi - libgo - not - ) -set_target_properties(check-llgo PROPERTIES FOLDER "Tests") diff --git a/llgo/test/debuginfo/emptyname.go b/llgo/test/debuginfo/emptyname.go deleted file mode 100644 index 28ad10df5140..000000000000 --- a/llgo/test/debuginfo/emptyname.go +++ /dev/null @@ -1,7 +0,0 @@ -// RUN: llgo -c -o /dev/null -g %s - -package main - -//line :1 -func main() { -} diff --git a/llgo/test/driver/parse-arguments.go b/llgo/test/driver/parse-arguments.go deleted file mode 100644 index 36b3c5c615cd..000000000000 --- a/llgo/test/driver/parse-arguments.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: not llgo -B 2>&1 | FileCheck --check-prefix=B %s -// RUN: not llgo -D 2>&1 | FileCheck --check-prefix=D %s -// RUN: not llgo -I 2>&1 | FileCheck --check-prefix=I %s -// RUN: not llgo -isystem 2>&1 | FileCheck --check-prefix=isystem %s -// RUN: not llgo -L 2>&1 | FileCheck --check-prefix=L %s -// RUN: not llgo -fload-plugin 2>&1 | FileCheck --check-prefix=fload-plugin %s -// RUN: not llgo -mllvm 2>&1 | FileCheck --check-prefix=mllvm %s -// RUN: not llgo -o 2>&1 | FileCheck --check-prefix=o %s - -// B: missing argument after '-B' -// D: missing argument after '-D' -// I: missing argument after '-I' -// isystem: missing argument after '-isystem' -// L: missing argument after '-L' -// fload-plugin: missing argument after '-fload-plugin' -// mllvm: missing argument after '-mllvm' -// o: missing argument after '-o' diff --git a/llgo/test/execution/Inputs/init2.go b/llgo/test/execution/Inputs/init2.go deleted file mode 100644 index 041d7647b3e9..000000000000 --- a/llgo/test/execution/Inputs/init2.go +++ /dev/null @@ -1,5 +0,0 @@ -package main - -func init() { - println("do some other stuff before main") -} diff --git a/llgo/test/execution/arrays/compare.go b/llgo/test/execution/arrays/compare.go deleted file mode 100644 index b99d4fd8f8e7..000000000000 --- a/llgo/test/execution/arrays/compare.go +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: false -// CHECK-NEXT: true -// CHECK-NEXT: false - -package main - -func main() { - a := [...]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} - b := [...]int{10, 1, 2, 3, 4, 5, 6, 7, 8, 9} - c := [...]int{1, 2, 3, 4, 5, 6, 7, 8, 9, 10} - - println(a == b) - println(a == c) - println(b == c) -} diff --git a/llgo/test/execution/arrays/index.go b/llgo/test/execution/arrays/index.go deleted file mode 100644 index 78c53150aa2e..000000000000 --- a/llgo/test/execution/arrays/index.go +++ /dev/null @@ -1,288 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 6 -// CHECK-NEXT: 7 -// CHECK-NEXT: 8 -// CHECK-NEXT: 9 -// CHECK-NEXT: 10 -// CHECK-NEXT: 11 -// CHECK-NEXT: 12 -// CHECK-NEXT: 13 -// CHECK-NEXT: 14 -// CHECK-NEXT: 15 -// CHECK-NEXT: 16 -// CHECK-NEXT: 17 -// CHECK-NEXT: 18 -// CHECK-NEXT: 19 -// CHECK-NEXT: 20 -// CHECK-NEXT: 21 -// CHECK-NEXT: 22 -// CHECK-NEXT: 23 -// CHECK-NEXT: 24 -// CHECK-NEXT: 25 -// CHECK-NEXT: 26 -// CHECK-NEXT: 27 -// CHECK-NEXT: 28 -// CHECK-NEXT: 29 -// CHECK-NEXT: 30 -// CHECK-NEXT: 31 -// CHECK-NEXT: 32 -// CHECK-NEXT: 33 -// CHECK-NEXT: 34 -// CHECK-NEXT: 35 -// CHECK-NEXT: 36 -// CHECK-NEXT: 37 -// CHECK-NEXT: 38 -// CHECK-NEXT: 39 -// CHECK-NEXT: 40 -// CHECK-NEXT: 41 -// CHECK-NEXT: 42 -// CHECK-NEXT: 43 -// CHECK-NEXT: 44 -// CHECK-NEXT: 45 -// CHECK-NEXT: 46 -// CHECK-NEXT: 47 -// CHECK-NEXT: 48 -// CHECK-NEXT: 49 -// CHECK-NEXT: 50 -// CHECK-NEXT: 51 -// CHECK-NEXT: 52 -// CHECK-NEXT: 53 -// CHECK-NEXT: 54 -// CHECK-NEXT: 55 -// CHECK-NEXT: 56 -// CHECK-NEXT: 57 -// CHECK-NEXT: 58 -// CHECK-NEXT: 59 -// CHECK-NEXT: 60 -// CHECK-NEXT: 61 -// CHECK-NEXT: 62 -// CHECK-NEXT: 63 -// CHECK-NEXT: 64 -// CHECK-NEXT: 65 -// CHECK-NEXT: 66 -// CHECK-NEXT: 67 -// CHECK-NEXT: 68 -// CHECK-NEXT: 69 -// CHECK-NEXT: 70 -// CHECK-NEXT: 71 -// CHECK-NEXT: 72 -// CHECK-NEXT: 73 -// CHECK-NEXT: 74 -// CHECK-NEXT: 75 -// CHECK-NEXT: 76 -// CHECK-NEXT: 77 -// CHECK-NEXT: 78 -// CHECK-NEXT: 79 -// CHECK-NEXT: 80 -// CHECK-NEXT: 81 -// CHECK-NEXT: 82 -// CHECK-NEXT: 83 -// CHECK-NEXT: 84 -// CHECK-NEXT: 85 -// CHECK-NEXT: 86 -// CHECK-NEXT: 87 -// CHECK-NEXT: 88 -// CHECK-NEXT: 89 -// CHECK-NEXT: 90 -// CHECK-NEXT: 91 -// CHECK-NEXT: 92 -// CHECK-NEXT: 93 -// CHECK-NEXT: 94 -// CHECK-NEXT: 95 -// CHECK-NEXT: 96 -// CHECK-NEXT: 97 -// CHECK-NEXT: 98 -// CHECK-NEXT: 99 -// CHECK-NEXT: 100 -// CHECK-NEXT: 101 -// CHECK-NEXT: 102 -// CHECK-NEXT: 103 -// CHECK-NEXT: 104 -// CHECK-NEXT: 105 -// CHECK-NEXT: 106 -// CHECK-NEXT: 107 -// CHECK-NEXT: 108 -// CHECK-NEXT: 109 -// CHECK-NEXT: 110 -// CHECK-NEXT: 111 -// CHECK-NEXT: 112 -// CHECK-NEXT: 113 -// CHECK-NEXT: 114 -// CHECK-NEXT: 115 -// CHECK-NEXT: 116 -// CHECK-NEXT: 117 -// CHECK-NEXT: 118 -// CHECK-NEXT: 119 -// CHECK-NEXT: 120 -// CHECK-NEXT: 121 -// CHECK-NEXT: 122 -// CHECK-NEXT: 123 -// CHECK-NEXT: 124 -// CHECK-NEXT: 125 -// CHECK-NEXT: 126 -// CHECK-NEXT: 127 -// CHECK-NEXT: 128 -// CHECK-NEXT: 129 -// CHECK-NEXT: 130 -// CHECK-NEXT: 131 -// CHECK-NEXT: 132 -// CHECK-NEXT: 133 -// CHECK-NEXT: 134 -// CHECK-NEXT: 135 -// CHECK-NEXT: 136 -// CHECK-NEXT: 137 -// CHECK-NEXT: 138 -// CHECK-NEXT: 139 -// CHECK-NEXT: 140 -// CHECK-NEXT: 141 -// CHECK-NEXT: 142 -// CHECK-NEXT: 143 -// CHECK-NEXT: 144 -// CHECK-NEXT: 145 -// CHECK-NEXT: 146 -// CHECK-NEXT: 147 -// CHECK-NEXT: 148 -// CHECK-NEXT: 149 -// CHECK-NEXT: 150 -// CHECK-NEXT: 151 -// CHECK-NEXT: 152 -// CHECK-NEXT: 153 -// CHECK-NEXT: 154 -// CHECK-NEXT: 155 -// CHECK-NEXT: 156 -// CHECK-NEXT: 157 -// CHECK-NEXT: 158 -// CHECK-NEXT: 159 -// CHECK-NEXT: 160 -// CHECK-NEXT: 161 -// CHECK-NEXT: 162 -// CHECK-NEXT: 163 -// CHECK-NEXT: 164 -// CHECK-NEXT: 165 -// CHECK-NEXT: 166 -// CHECK-NEXT: 167 -// CHECK-NEXT: 168 -// CHECK-NEXT: 169 -// CHECK-NEXT: 170 -// CHECK-NEXT: 171 -// CHECK-NEXT: 172 -// CHECK-NEXT: 173 -// CHECK-NEXT: 174 -// CHECK-NEXT: 175 -// CHECK-NEXT: 176 -// CHECK-NEXT: 177 -// CHECK-NEXT: 178 -// CHECK-NEXT: 179 -// CHECK-NEXT: 180 -// CHECK-NEXT: 181 -// CHECK-NEXT: 182 -// CHECK-NEXT: 183 -// CHECK-NEXT: 184 -// CHECK-NEXT: 185 -// CHECK-NEXT: 186 -// CHECK-NEXT: 187 -// CHECK-NEXT: 188 -// CHECK-NEXT: 189 -// CHECK-NEXT: 190 -// CHECK-NEXT: 191 -// CHECK-NEXT: 192 -// CHECK-NEXT: 193 -// CHECK-NEXT: 194 -// CHECK-NEXT: 195 -// CHECK-NEXT: 196 -// CHECK-NEXT: 197 -// CHECK-NEXT: 198 -// CHECK-NEXT: 199 -// CHECK-NEXT: 200 -// CHECK-NEXT: 201 -// CHECK-NEXT: 202 -// CHECK-NEXT: 203 -// CHECK-NEXT: 204 -// CHECK-NEXT: 205 -// CHECK-NEXT: 206 -// CHECK-NEXT: 207 -// CHECK-NEXT: 208 -// CHECK-NEXT: 209 -// CHECK-NEXT: 210 -// CHECK-NEXT: 211 -// CHECK-NEXT: 212 -// CHECK-NEXT: 213 -// CHECK-NEXT: 214 -// CHECK-NEXT: 215 -// CHECK-NEXT: 216 -// CHECK-NEXT: 217 -// CHECK-NEXT: 218 -// CHECK-NEXT: 219 -// CHECK-NEXT: 220 -// CHECK-NEXT: 221 -// CHECK-NEXT: 222 -// CHECK-NEXT: 223 -// CHECK-NEXT: 224 -// CHECK-NEXT: 225 -// CHECK-NEXT: 226 -// CHECK-NEXT: 227 -// CHECK-NEXT: 228 -// CHECK-NEXT: 229 -// CHECK-NEXT: 230 -// CHECK-NEXT: 231 -// CHECK-NEXT: 232 -// CHECK-NEXT: 233 -// CHECK-NEXT: 234 -// CHECK-NEXT: 235 -// CHECK-NEXT: 236 -// CHECK-NEXT: 237 -// CHECK-NEXT: 238 -// CHECK-NEXT: 239 -// CHECK-NEXT: 240 -// CHECK-NEXT: 241 -// CHECK-NEXT: 242 -// CHECK-NEXT: 243 -// CHECK-NEXT: 244 -// CHECK-NEXT: 245 -// CHECK-NEXT: 246 -// CHECK-NEXT: 247 -// CHECK-NEXT: 248 -// CHECK-NEXT: 249 -// CHECK-NEXT: 250 -// CHECK-NEXT: 251 -// CHECK-NEXT: 252 -// CHECK-NEXT: 253 -// CHECK-NEXT: 254 - -package main - -func testBasics() { - var i [2]int - j := &i - i[0] = 123 - i[1] = 456 - println(i[0], i[1]) - println(j[0], j[1]) - i[0]++ - i[1]-- - println(i[0], i[1]) - println(j[0], j[1]) -} - -func testByteIndex() { - var a [255]int - for i := 0; i < len(a); i++ { - a[i] = i - } - for i := byte(0); i < byte(len(a)); i++ { - println(a[i]) - } -} - -func main() { - //testBasics() - testByteIndex() -} diff --git a/llgo/test/execution/arrays/range.go b/llgo/test/execution/arrays/range.go deleted file mode 100644 index 37d22f62bdae..000000000000 --- a/llgo/test/execution/arrays/range.go +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 0 0 -// CHECK-NEXT: 1 1 1 -// CHECK-NEXT: 2 2 2 -// CHECK-NEXT: 3 0 0 -// CHECK-NEXT: 4 4 4 -// CHECK-NEXT: 0 10 -// CHECK-NEXT: 1 20 -// CHECK-NEXT: 2 30 - -package main - -func main() { - a := [...]int{1: 1, 2: 2, 4: 4} - for i, val := range a { - println(i, val, a[i]) - } - for i, val := range [...]int{10, 20, 30} { - println(i, val) - } -} diff --git a/llgo/test/execution/arrays/slice.go b/llgo/test/execution/arrays/slice.go deleted file mode 100644 index e2880906d92c..000000000000 --- a/llgo/test/execution/arrays/slice.go +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 10 -// CHECK-NEXT: 9 - -package main - -func main() { - var a [10]int - b := a[1:] - println(len(a)) - println(len(b)) -} diff --git a/llgo/test/execution/assignment/arrays.go b/llgo/test/execution/assignment/arrays.go deleted file mode 100644 index 30921a4cabd0..000000000000 --- a/llgo/test/execution/assignment/arrays.go +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: +1.000000e+000 -// CHECK-NEXT: +2.000000e+000 -// CHECK-NEXT: +3.000000e+000 - -package main - -var a1 = [...]float32{1.0, 2.0, 3.0} - -func main() { - var a2 [3]float32 - a2 = a1 - println(a2[0]) - println(a2[1]) - println(a2[2]) - - // broken due to lack of promotion of - // stack to heap. - //println(a2[0], a2[1], a2[2]) -} diff --git a/llgo/test/execution/assignment/binop.go b/llgo/test/execution/assignment/binop.go deleted file mode 100644 index 51793ff4c5c5..000000000000 --- a/llgo/test/execution/assignment/binop.go +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 246 -// CHECK-NEXT: 123 -// CHECK-NEXT: 124 -// CHECK-NEXT: 123 - -package main - -func main() { - x := 123 - x *= 2 - println(x) - x /= 2 - println(x) - x += 1 - println(x) - x -= 1 - println(x) -} diff --git a/llgo/test/execution/assignment/dereferencing.go b/llgo/test/execution/assignment/dereferencing.go deleted file mode 100644 index 607e28d59093..000000000000 --- a/llgo/test/execution/assignment/dereferencing.go +++ /dev/null @@ -1,13 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 123 - -package main - -func main() { - var x int - px := &x - *px = 123 - println(x) -} diff --git a/llgo/test/execution/assignment/multi.go b/llgo/test/execution/assignment/multi.go deleted file mode 100644 index 60b8805debfd..000000000000 --- a/llgo/test/execution/assignment/multi.go +++ /dev/null @@ -1,40 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 123 456 -// CHECK-NEXT: 456 123 -// CHECK-NEXT: 456 123 -// CHECK-NEXT: 123 456 -// CHECK-NEXT: 123 456 - -package main - -func xyz() (int, int) { - return 123, 456 -} - -func abc() (int, int) { - var a, b = xyz() - return a, b -} - -type S struct { - a int - b int -} - -func main() { - a, b := xyz() - println(a, b) - b, a = abc() - println(a, b) - - // swap - println(a, b) - a, b = b, a - println(a, b) - - var s S - s.a, s.b = a, b - println(s.a, s.b) -} diff --git a/llgo/test/execution/assignment/namedresult.go b/llgo/test/execution/assignment/namedresult.go deleted file mode 100644 index daf9b003c618..000000000000 --- a/llgo/test/execution/assignment/namedresult.go +++ /dev/null @@ -1,42 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 123 -// CHECK-NEXT: 456 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: 666 0 - -package main - -func f1() (x int) { - x = 123 - return -} - -func f2() (x int) { - return 456 -} - -func f3() (x, y int) { - y, x = 2, 1 - return -} - -func f4() (x, _ int) { - x = 666 - return -} - -func main() { - x := f1() - println(x) - x = f2() - println(x) - - var y int - x, y = f3() - println(x, y) - - x, y = f4() - println(x, y) -} diff --git a/llgo/test/execution/branching/goto.go b/llgo/test/execution/branching/goto.go deleted file mode 100644 index 748c666da42e..000000000000 --- a/llgo/test/execution/branching/goto.go +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 6 -// CHECK-NEXT: 7 -// CHECK-NEXT: 8 -// CHECK-NEXT: 9 -// CHECK-NEXT: done -// CHECK-NEXT: ! - -package main - -func f1() { - goto labeled -labeled: - goto done - return -done: - println("!") -} - -func main() { - i := 0 -start: - if i < 10 { - println(i) - i++ - goto start - } else { - goto end - } - return -end: - println("done") - f1() - return -} diff --git a/llgo/test/execution/branching/labeled.go b/llgo/test/execution/branching/labeled.go deleted file mode 100644 index efff5ef1d21b..000000000000 --- a/llgo/test/execution/branching/labeled.go +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 - -package main - -func labeledBreak() { - var i int -L: - for ; i < 10; i++ { - switch { - default: - break L - } - } - println(i) -} - -func main() { - labeledBreak() -} diff --git a/llgo/test/execution/chan/buffered.go b/llgo/test/execution/chan/buffered.go deleted file mode 100644 index 9247ce32e045..000000000000 --- a/llgo/test/execution/chan/buffered.go +++ /dev/null @@ -1,41 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 0 -// CHECK-NEXT: 0 1 -// CHECK-NEXT: 10 -// CHECK-NEXT: 20 -// CHECK-NEXT: 30 -// CHECK-NEXT: 40 -// CHECK-NEXT: 50 -// CHECK-NEXT: 60 -// CHECK-NEXT: 70 -// CHECK-NEXT: 80 -// CHECK-NEXT: 90 -// CHECK-NEXT: 100 -// CHECK-NEXT: -1 - -package main - -func main() { - c := make(chan int) - println(len(c), cap(c)) - c1 := make(chan int, 1) - println(len(c1), cap(c1)) - f := func() { - n, ok := <-c - if ok { - c1 <- n * 10 - } else { - c1 <- -1 - } - } - for i := 0; i < 10; i++ { - go f() - c <- i + 1 - println(<-c1) - } - go f() - close(c) - println(<-c1) -} diff --git a/llgo/test/execution/chan/range.go b/llgo/test/execution/chan/range.go deleted file mode 100644 index eeaedb7f9823..000000000000 --- a/llgo/test/execution/chan/range.go +++ /dev/null @@ -1,28 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 6 -// CHECK-NEXT: 7 -// CHECK-NEXT: 8 -// CHECK-NEXT: 9 - -package main - -func main() { - ch := make(chan int) - go func() { - for i := 0; i < 10; i++ { - ch <- i - } - close(ch) - }() - for n := range ch { - println(n) - } -} diff --git a/llgo/test/execution/chan/select.go b/llgo/test/execution/chan/select.go deleted file mode 100644 index 80872f578ce3..000000000000 --- a/llgo/test/execution/chan/select.go +++ /dev/null @@ -1,27 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: sent a value -// CHECK-NEXT: received 123 -// CHECK-NEXT: default - -package main - -func f1() { - c := make(chan int, 1) - for i := 0; i < 3; i++ { - select { - case n, _ := <-c: - println("received", n) - c = nil - case c <- 123: - println("sent a value") - default: - println("default") - } - } -} - -func main() { - f1() -} diff --git a/llgo/test/execution/chan/self.go b/llgo/test/execution/chan/self.go deleted file mode 100644 index d26ee4a22f3c..000000000000 --- a/llgo/test/execution/chan/self.go +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: true - -package main - -func main() { - ch := make(chan int, uint8(1)) - - ch <- 1 - println(<-ch) - - ch <- 2 - x, ok := <-ch - println(x) - println(ok) -} diff --git a/llgo/test/execution/circulartype.go b/llgo/test/execution/circulartype.go deleted file mode 100644 index 01e9ce44493e..000000000000 --- a/llgo/test/execution/circulartype.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | count 0 - -package main - -type A struct { - b1, b2 B -} - -type B struct { - a1, a2 *A -} - -func main() { - var a A - _ = a -} diff --git a/llgo/test/execution/closures/basic.go b/llgo/test/execution/closures/basic.go deleted file mode 100644 index 2a84fc130e8b..000000000000 --- a/llgo/test/execution/closures/basic.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: abc - -package main - -func cat(a, b string) func(string) string { - return func(c string) string { return a + b + c } -} - -func main() { - f := cat("a", "b") - println(f("c")) -} diff --git a/llgo/test/execution/closures/issue176.go b/llgo/test/execution/closures/issue176.go deleted file mode 100644 index 4a505ca19b0c..000000000000 --- a/llgo/test/execution/closures/issue176.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: false - -package main - -func main() { - a := false - f := func() { - make(chan *bool, 1) <- &a - } - f() - println(a) -} diff --git a/llgo/test/execution/complex.go b/llgo/test/execution/complex.go deleted file mode 100644 index ad2a87bbd3cd..000000000000 --- a/llgo/test/execution/complex.go +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: (+1.000000e+000+2.000000e+000i) -// CHECK-NEXT: (-1.000000e+000-2.000000e+000i) -// CHECK-NEXT: true -// CHECK-NEXT: (+1.000000e+000+2.000000e+000i) -// CHECK-NEXT: (-1.000000e+000-2.000000e+000i) -// CHECK-NEXT: true - -package main - -func main() { - var f32 float32 = 1 - var f64 float64 = 1 - c64 := complex(f32, f32+1) - println(c64) - println(-c64) - println(c64 == c64) - c128 := complex(f64, f64+1) - println(c128) - println(-c128) - println(c128 == c128) -} diff --git a/llgo/test/execution/const.go b/llgo/test/execution/const.go deleted file mode 100644 index 45dbb0f03cda..000000000000 --- a/llgo/test/execution/const.go +++ /dev/null @@ -1,78 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 1 1 -// CHECK-NEXT: 1 1 1 4 -// CHECK-NEXT: 2147483647 -// CHECK-NEXT: -2147483648 -// CHECK-NEXT: 2147483647 -// CHECK-NEXT: -127 -// CHECK-NEXT: false -// CHECK-NEXT: 10000000000 -// CHECK-NEXT: 1 -// CHECK-NEXT: 3 - -package main - -import "runtime" - -const ( - a = iota * 2 - A = 1 - B - C - D = Z + iota -) - -const ( - Z = iota - Big = 1<<31 - 1 - Big2 = -2147483648 - Big3 = 2147483647 -) - -const ( - expbits32 uint = 8 - bias32 = -1<<(expbits32-1) + 1 - darwinAMD64 = runtime.GOOS == "darwin" && runtime.GOARCH == "amd64" -) - -func f1() float32 { - return 0 -} - -func constArrayLen() { - a := [...]int{1, 2, 3} - const x = len(a) - println(x) -} - -func main() { - println(a) - println(B) - println(A, A) - println(A, B, C, D) - println(Big) - println(Big2) - println(Big3) - println(bias32) - - // Currently fails, due to difference in C printf and Go's println - // formatting of the exponent. - //println(10 * 1e9) - println(darwinAMD64) - - // Test conversion. - println(int64(10) * 1e9) - - // Ensure consts work just as well when declared inside a function. - const ( - x_ = iota - y_ - ) - println(y_) - - constArrayLen() -} diff --git a/llgo/test/execution/conversions/complex.go b/llgo/test/execution/conversions/complex.go deleted file mode 100644 index 91dd366c4344..000000000000 --- a/llgo/test/execution/conversions/complex.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | count 0 - -package main - -func constIntToComplex() complex128 { - return 0 -} - -func main() { - var c64 complex64 - var c128 complex128 - c128 = complex128(c64) - c64 = complex64(c128) -} diff --git a/llgo/test/execution/conversions/float.go b/llgo/test/execution/conversions/float.go deleted file mode 100644 index def11d1699a9..000000000000 --- a/llgo/test/execution/conversions/float.go +++ /dev/null @@ -1,103 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: 133 -// CHECK-NEXT: 65413 -// CHECK-NEXT: 4294967173 -// CHECK-NEXT: 18446744073709551493 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: 123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: -123 -// CHECK-NEXT: 133 -// CHECK-NEXT: 65413 -// CHECK-NEXT: 4294967173 -// CHECK-NEXT: 18446744073709551493 -// CHECK-NEXT: +1.230000e+002 -// CHECK-NEXT: +1.230000e+002 -// CHECK-NEXT: +1.230000e+002 -// CHECK-NEXT: +1.230000e+002 -// CHECK-NEXT: +1.234500e+004 -// CHECK-NEXT: +1.234500e+004 -// CHECK-NEXT: +1.234500e+004 -// CHECK-NEXT: +1.234500e+004 -// CHECK-NEXT: +1.234560e+005 -// CHECK-NEXT: +1.234560e+005 -// CHECK-NEXT: +1.234560e+005 -// CHECK-NEXT: +1.234560e+005 -// CHECK-NEXT: +1.234568e+010 -// CHECK-NEXT: +1.234568e+010 -// CHECK-NEXT: +1.234568e+010 -// CHECK-NEXT: +1.234568e+010 - -package main - -func main() { - // float to int - for _, f32 := range []float32{123.456, -123.456} { - println(int8(f32)) - println(int16(f32)) - println(int32(f32)) - println(int64(f32)) - println(uint8(f32)) - println(uint16(f32)) - println(uint32(f32)) - println(uint64(f32)) - } - for _, f64 := range []float64{123.456, -123.456} { - println(int8(f64)) - println(int16(f64)) - println(int32(f64)) - println(int64(f64)) - println(uint8(f64)) - println(uint16(f64)) - println(uint32(f64)) - println(uint64(f64)) - } - - // int to float - var i8 int8 = 123 - println(float32(i8)) - println(float64(i8)) - var ui8 uint8 = 123 - println(float32(ui8)) - println(float64(ui8)) - var i16 int32 = 12345 - println(float32(i16)) - println(float64(i16)) - var ui16 uint32 = 12345 - println(float32(ui16)) - println(float64(ui16)) - var i32 int32 = 123456 - println(float32(i32)) - println(float64(i32)) - var ui32 uint32 = 123456 - println(float32(ui32)) - println(float64(ui32)) - var i64 int64 = 12345678910 - println(float32(i64)) - println(float64(i64)) - var ui64 uint64 = 12345678910 - println(float32(ui64)) - println(float64(ui64)) -} diff --git a/llgo/test/execution/conversions/int.go b/llgo/test/execution/conversions/int.go deleted file mode 100644 index 092003b3b899..000000000000 --- a/llgo/test/execution/conversions/int.go +++ /dev/null @@ -1,44 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 2147483647 -// CHECK-NEXT: 2147483647 -// CHECK-NEXT: 2147483647 -// CHECK-NEXT: 2147483648 -// CHECK-NEXT: -2147483648 -// CHECK-NEXT: 18446744071562067968 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: -1 -// CHECK-NEXT: 4294967295 -// CHECK-NEXT: 4294967295 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 1 -// CHECK-NEXT: 1 - -package main - -func signed(i32 int32) { - println(uint32(i32)) - println(int64(i32)) - println(uint64(i32)) -} - -func unsigned(u32 uint32) { - println(int32(u32)) - println(int64(u32)) - println(uint64(u32)) -} - -func main() { - signed(1<<31 - 1) - signed(-1 << 31) - signed(0) - unsigned(1<<32 - 1) - unsigned(0) - unsigned(1) -} diff --git a/llgo/test/execution/conversions/sameunderlying.go b/llgo/test/execution/conversions/sameunderlying.go deleted file mode 100644 index 8208cfba116a..000000000000 --- a/llgo/test/execution/conversions/sameunderlying.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | count 0 - -package main - -type X struct{} -type Y X - -func main() { - var x X - px := &x - py := (*Y)(&x) - py = (*Y)(px) - _ = py -} diff --git a/llgo/test/execution/defer.go b/llgo/test/execution/defer.go deleted file mode 100644 index ba1b63217b8e..000000000000 --- a/llgo/test/execution/defer.go +++ /dev/null @@ -1,125 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: f2.1 -// CHECK-NEXT: f5 -// CHECK-NEXT: recovered no error -// CHECK-NEXT: f5 -// CHECK-NEXT: recovered: meep meep -// CHECK-NEXT: 888 -// CHECK-NEXT: f5 -// CHECK-NEXT: recovered no error -// CHECK-NEXT: f5 -// CHECK-NEXT: recovered no error -// CHECK-NEXT: 888 -// CHECK-NEXT: 456 -// CHECK-NEXT: 999 -// CHECK-NEXT: 999 -// CHECK-NEXT: 123 -// CHECK-NEXT: 999 -// CHECK-NEXT: 999 -// CHECK-NEXT: 246 -// CHECK-NEXT: f2.2 -// CHECK-NEXT: f2.3 -// CHECK-NEXT: f1.1 -// CHECK-NEXT: f1.2 -// CHECK-NEXT: recovered: second -// CHECK-NEXT: ahoy - -package main - -type T struct { - value int -} - -type T1 struct { - T -} - -func (t T) abc() { - println(t.value) -} - -func (t *T) def() { - println(t.value) -} - -func (t *T) ghi(v int) { - println(v) -} - -func printerr(err interface{}) { - if err != nil { - println("recovered:", err.(string)) - } else { - println("recovered no error") - } -} - -func f6() { - defer func() { printerr(recover()) }() - defer func() { panic("second") }() - panic("first") -} - -func f5(panic_ bool) { - var t1 T1 - t1.T.value = 888 - defer t1.abc() - var f func(int) - f = func(recursion int) { - if recursion > 0 { - f(recursion - 1) - return - } - println("f5") - printerr(recover()) - } - defer f(0) // will recover (after f(1)) - defer f(1) // won't recover - if panic_ { - panic("meep meep") - } -} - -func f4() { - var a T = T{999} - var b *T = &a - defer a.abc() - defer a.def() - defer a.ghi(123) - defer b.abc() - defer b.def() - defer b.ghi(456) - f5(true) - f5(false) // verify the recover in f5 works -} - -func f3() (a int) { - defer func() { a *= 2 }() - f4() - return 123 -} - -func f2() { - defer func() { println("f2.3") }() - defer func(s string) { println(s) }("f2.2") - println("f2.1") - println(f3()) -} - -func f1() { - defer func() { println("f1.2") }() - defer func() { println("f1.1") }() - f2() -} - -func builtins() { - defer println("ahoy") -} - -func main() { - f1() - f6() - builtins() -} diff --git a/llgo/test/execution/errors/recover.go b/llgo/test/execution/errors/recover.go deleted file mode 100644 index 70ee2ac15a78..000000000000 --- a/llgo/test/execution/errors/recover.go +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: (0x0,0x0) - -package main - -func main() { - err := recover() - println(err) -} diff --git a/llgo/test/execution/for/branch.go b/llgo/test/execution/for/branch.go deleted file mode 100644 index 5484c891adf1..000000000000 --- a/llgo/test/execution/for/branch.go +++ /dev/null @@ -1,41 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 0 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 - -package main - -func main() { - for i := 0; true; i++ { - println(i) - if i == 2 { - println(3) - break - } - println(1) - i++ - continue - println("unreachable") - } - - nums := [...]int{0, 1, 2, 3, 4, 5} - for n := range nums { - if n == 1 { - continue - } - println(n) - if n == 4 { - { - break - } - println("!") - } - } -} diff --git a/llgo/test/execution/fun.go b/llgo/test/execution/fun.go deleted file mode 100644 index c70fe69172d2..000000000000 --- a/llgo/test/execution/fun.go +++ /dev/null @@ -1,28 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 246 -// CHECK-NEXT: 123 true false - -// vim: set ft=go : - -package main - -func test() func() int { - return blah -} - -func blah() int { - return 123 -} - -func sret() (int, bool, bool) { - return 123, true, false -} - -func main() { - f := test() - println(2 * f()) - a, b, c := sret() - println(a, b, c) -} diff --git a/llgo/test/execution/functions/compare.go b/llgo/test/execution/functions/compare.go deleted file mode 100644 index 9daa062efe91..000000000000 --- a/llgo/test/execution/functions/compare.go +++ /dev/null @@ -1,26 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: true - -package main - -func main() { - var f func() - println(f == nil) - println(f != nil) - println(nil == f) - println(nil != f) - f = func() {} - println(f == nil) - println(f != nil) - println(nil == f) - println(nil != f) -} diff --git a/llgo/test/execution/functions/multivalue.go b/llgo/test/execution/functions/multivalue.go deleted file mode 100644 index a3ce79b3fc0e..000000000000 --- a/llgo/test/execution/functions/multivalue.go +++ /dev/null @@ -1,28 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 20 -// CHECK-NEXT: extra: 10 - -package main - -func swap(a, b int) (int, int) { - return b, a -} - -func sub(a, b int) int { - return a - b -} - -func printint(a int, extra ...int) { - println(a) - for _, b := range extra { - println("extra:", b) - } -} - -func main() { - println(sub(swap(1, 2))) - printint(swap(10, 20)) -} diff --git a/llgo/test/execution/functions/unreachable.go b/llgo/test/execution/functions/unreachable.go deleted file mode 100644 index 436012c4e417..000000000000 --- a/llgo/test/execution/functions/unreachable.go +++ /dev/null @@ -1,53 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: f1 -// CHECK-NEXT: f2 -// CHECK-NEXT: f3 -// CHECK-NEXT: f4 -// CHECK-NEXT: 123 - -package main - -func f1() { - if true { - println("f1") - return - } - for { - } -} - -func f2() { - defer func() { println("f2") }() - if true { - return - } - for { - } -} - -func f3() int { - if true { - println("f3") - return 123 - } - for { - } -} - -func f4() int { - defer func() { println("f4") }() - if true { - return 123 - } - for { - } -} - -func main() { - f1() - f2() - f3() - println(f4()) -} diff --git a/llgo/test/execution/go.go b/llgo/test/execution/go.go deleted file mode 100644 index 2bfe775ff924..000000000000 --- a/llgo/test/execution/go.go +++ /dev/null @@ -1,34 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: hello from T 1 -// CHECK-NEXT: hello from T 2 - -package main - -type T struct { - val int -} - -func (t T) Hello(done chan bool) { - println("hello from T", t.val) - done <- true -} - -type I interface { - Hello(chan bool) -} - -func main() { - done := make(chan bool) - - t := T{1} - go t.Hello(done) - <-done - - var i I = T{2} - go i.Hello(done) - <-done - - go println("hello builtin") -} diff --git a/llgo/test/execution/if/lazy.go b/llgo/test/execution/if/lazy.go deleted file mode 100644 index 5171a774fa9b..000000000000 --- a/llgo/test/execution/if/lazy.go +++ /dev/null @@ -1,46 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: False() -// CHECK-NEXT: False() -// CHECK-NEXT: false -// CHECK-NEXT: False() -// CHECK-NEXT: True() -// CHECK-NEXT: true -// CHECK-NEXT: True() -// CHECK-NEXT: true -// CHECK-NEXT: True() -// CHECK-NEXT: true -// CHECK-NEXT: False() -// CHECK-NEXT: false -// CHECK-NEXT: False() -// CHECK-NEXT: false -// CHECK-NEXT: True() -// CHECK-NEXT: False() -// CHECK-NEXT: false -// CHECK-NEXT: True() -// CHECK-NEXT: True() -// CHECK-NEXT: true - -package main - -func False() bool { - println("False()") - return false -} - -func True() bool { - println("True()") - return true -} - -func main() { - println(False() || False()) - println(False() || True()) - println(True() || False()) - println(True() || True()) - println(False() && False()) - println(False() && True()) - println(True() && False()) - println(True() && True()) -} diff --git a/llgo/test/execution/init.go b/llgo/test/execution/init.go deleted file mode 100644 index 46c7fa16212e..000000000000 --- a/llgo/test/execution/init.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s %p/Inputs/init2.go -// RUN: %t 2>&1 | FileCheck %s - -package main - -// CHECK-DAG: do some other stuff before main -//func init() - -// CHECK-DAG: do some stuff before main -func init() { - println("do some stuff before main") -} - -// CHECK: main has been called -func main() { - println("main has been called") -} diff --git a/llgo/test/execution/interfaces/assert.go b/llgo/test/execution/interfaces/assert.go deleted file mode 100644 index 4c5db7dad77d..000000000000 --- a/llgo/test/execution/interfaces/assert.go +++ /dev/null @@ -1,61 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: x is nil -// CHECK-NEXT: i2v: 123456 -// CHECK-NEXT: ! -// CHECK-NEXT: (*X).F1: 123456 - -package main - -type X struct{ x int } - -func (x *X) F1() { println("(*X).F1:", x.x) } -func (x *X) F2() { println("(*X).F2") } - -type I interface { - F1() - F2() -} - -func main() { - var x interface{} - - // x is nil. Let's make sure an assertion on it - // won't cause a panic. - if x, ok := x.(int32); ok { - println("i2v:", x) - } - if x == nil { - println("x is nil") - } - - x = int32(123456) - - // Let's try an interface-to-value assertion. - if x, ok := x.(int32); ok { - println("i2v:", x) - } - if x, ok := x.(int64); ok { - println("i2v:", x) - } - - // This will fail the assertion. - if i, ok := x.(I); ok { - i.F1() - _ = i - } else { - println("!") - } - - // Assign an *X, which should pass the assertion. - x_ := new(X) - x_.x = 123456 - x = x_ //&X{x: 123456} - if i, ok := x.(I); ok { - i.F1() - _ = i - } else { - println("!") - } -} diff --git a/llgo/test/execution/interfaces/basic.go b/llgo/test/execution/interfaces/basic.go deleted file mode 100644 index 6c754dae1c9b..000000000000 --- a/llgo/test/execution/interfaces/basic.go +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: expected: y != z - -package main - -type any interface{} - -type Stringer interface { - String() string -} - -type lessThanAWord struct { - a byte -} - -func (l lessThanAWord) String() string { - return "!" -} - -func makeAStringer() Stringer { - return lessThanAWord{} -} - -func main() { - var x1, x2 int = 1, 2 - var y any = x1 - var z any = x2 - if y != z { - println("expected: y != z") - } else { - println("unexpected: y == z") - } - /* - if y == x1 { - println("expected: y == x1") - } else { - println("unexpected: y == x1") - } - */ - //println(y.(int)) -} diff --git a/llgo/test/execution/interfaces/comparei2i.go b/llgo/test/execution/interfaces/comparei2i.go deleted file mode 100644 index 5a1f2660e210..000000000000 --- a/llgo/test/execution/interfaces/comparei2i.go +++ /dev/null @@ -1,30 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: true - -package main - -import "unsafe" - -type I interface { - X() -} - -type T int - -func (t T) X() { -} - -func main() { - var highbit uint32 = 1 << 31 - var pos0 float32 = 0 - var neg0 float32 = *(*float32)(unsafe.Pointer(&highbit)) - var i1 interface{} = pos0 - var i2 interface{} = neg0 - println(i1 == i2) - var i3 interface{} = T(123) - var i4 I = T(123) - println(i3 == i4) -} diff --git a/llgo/test/execution/interfaces/comparei2v.go b/llgo/test/execution/interfaces/comparei2v.go deleted file mode 100644 index 6547360e60e9..000000000000 --- a/llgo/test/execution/interfaces/comparei2v.go +++ /dev/null @@ -1,13 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false - -package main - -func main() { - var x interface{} = 123 - println(x == 123) - println(x != 123) -} diff --git a/llgo/test/execution/interfaces/e2i_conversion.go b/llgo/test/execution/interfaces/e2i_conversion.go deleted file mode 100644 index 6596e7806783..000000000000 --- a/llgo/test/execution/interfaces/e2i_conversion.go +++ /dev/null @@ -1,22 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | count 0 - -package main - -import "io" - -type rdr struct{} - -func (r rdr) Read(b []byte) (int, error) { - return 0, nil -} - -func F(i interface{}) { - _ = i.(io.Reader) -} - -func main() { - var r rdr - F(r) - F(&r) -} diff --git a/llgo/test/execution/interfaces/embedded.go b/llgo/test/execution/interfaces/embedded.go deleted file mode 100644 index 053afb1c6025..000000000000 --- a/llgo/test/execution/interfaces/embedded.go +++ /dev/null @@ -1,32 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: A -// CHECK-NEXT: B - -package main - -type BI interface { - B() -} - -type AI interface { - A() - BI -} - -type S struct{} - -func (s S) A() { - println("A") -} - -func (s S) B() { - println("B") -} - -func main() { - var ai AI = S{} - ai.A() - ai.B() -} diff --git a/llgo/test/execution/interfaces/error.go b/llgo/test/execution/interfaces/error.go deleted file mode 100644 index 17244360e0b9..000000000000 --- a/llgo/test/execution/interfaces/error.go +++ /dev/null @@ -1,43 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: !!!! 123 -// CHECK-NEXT: errno 123 - -package main - -var errors = [...]string{} - -func itoa(val int) string { // do it here rather than with fmt to avoid dependency - if val < 0 { - return "-" + itoa(-val) - } - var buf [32]byte // big enough for int64 - i := len(buf) - 1 - for val >= 10 { - buf[i] = byte(val%10 + '0') - i-- - val /= 10 - } - buf[i] = byte(val + '0') - return string(buf[i:]) -} - -type Errno uintptr - -func (e Errno) Error() string { - println("!!!!", uintptr(e)) - if 0 <= int(e) && int(e) < len(errors) { - s := errors[e] - if s != "" { - return s - } - } - return "errno " + itoa(int(e)) -} - -func main() { - e := Errno(123) - i := (interface{})(e) - println(i.(error).Error()) -} diff --git a/llgo/test/execution/interfaces/i2i_conversion.go b/llgo/test/execution/interfaces/i2i_conversion.go deleted file mode 100644 index b55d8404a126..000000000000 --- a/llgo/test/execution/interfaces/i2i_conversion.go +++ /dev/null @@ -1,33 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 666 -// CHECK-NEXT: The Beast - -package main - -type Numbered interface { - Number() int -} - -type Named interface { - Name() string -} - -type Beast struct{} - -func (b *Beast) Number() int { - return 666 -} - -func (b *Beast) Name() string { - return "The Beast" -} - -func main() { - var b Beast - var numbered Numbered = &b - var named Named = numbered.(Named) - println(numbered.Number()) - println(named.Name()) -} diff --git a/llgo/test/execution/interfaces/import.go b/llgo/test/execution/interfaces/import.go deleted file mode 100644 index 3305ee6a8498..000000000000 --- a/llgo/test/execution/interfaces/import.go +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -package main - -import "syscall" - -type Signal interface { - Signal() -} - -func main() { - var s Signal = syscall.SIGINT - // CHECK: ({{.*}},{{.*}}) - println(s) -} diff --git a/llgo/test/execution/interfaces/methods.go b/llgo/test/execution/interfaces/methods.go deleted file mode 100644 index 5fb704cd9b1a..000000000000 --- a/llgo/test/execution/interfaces/methods.go +++ /dev/null @@ -1,53 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: X() -// CHECK-NEXT: Y() -// CHECK-NEXT: X() -// CHECK-NEXT: Y() -// CHECK-NEXT: X() - -package main - -type Stringer interface { - String() string -} - -type X int -type Y int - -type Z1 struct { - X -} - -type Z2 struct { - Stringer -} - -func (x X) String() string { - return "X()" -} - -func (y *Y) String() string { - return "Y()" -} - -func makeX() X { - return X(0) -} - -func main() { - var z Stringer = X(0) - println(z.String()) - - z = new(Y) - println(z.String()) - - z = Z1{} - println(z.String()) - - z = Z2{new(Y)} - println(z.String()) - - println(makeX().String()) -} diff --git a/llgo/test/execution/interfaces/static_conversion.go b/llgo/test/execution/interfaces/static_conversion.go deleted file mode 100644 index e63f10d64add..000000000000 --- a/llgo/test/execution/interfaces/static_conversion.go +++ /dev/null @@ -1,35 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 666 -// CHECK-NEXT: 3 - -package main - -type Blah interface{} -type Numbered interface { - Blah - Number() int -} - -type Beast struct{} - -func (b *Beast) Number() int { - return 666 -} - -type MagicNumber int - -func (m MagicNumber) Number() int { - return int(m) -} - -func main() { - var b Beast - var m MagicNumber = 3 - var n Numbered = &b - println(n.Number()) - - n = m - println(n.Number()) -} diff --git a/llgo/test/execution/interfaces/wordsize.go b/llgo/test/execution/interfaces/wordsize.go deleted file mode 100644 index e2de5d54895c..000000000000 --- a/llgo/test/execution/interfaces/wordsize.go +++ /dev/null @@ -1,40 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: StringStringer(abc) -// CHECK-NEXT: abc 1 2 3 - -package main - -type Stringer interface { - String() string -} - -type StringStringer string - -func (s StringStringer) String() string { - return "StringStringer(" + string(s) + ")" -} - -func (s StringStringer) MethodWithArgs(a, b, c int) { - println(s, a, b, c) -} - -type I interface { - MethodWithArgs(a, b, c int) -} - -func testLargerThanWord() { - // string is larger than a word. Make sure it works - // well as a method receiver when using interfaces. - var s Stringer = StringStringer("abc") - println(s.String()) - - // Test calling a method which takes parameters - // beyond the receiver. - s.(I).MethodWithArgs(1, 2, 3) -} - -func main() { - testLargerThanWord() -} diff --git a/llgo/test/execution/literals/array.go b/llgo/test/execution/literals/array.go deleted file mode 100644 index 975ec02760ff..000000000000 --- a/llgo/test/execution/literals/array.go +++ /dev/null @@ -1,78 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 9223372036854775808 -63 false -// CHECK-NEXT: 11529215046068469760 -60 false -// CHECK-NEXT: 14411518807585587200 -57 false -// CHECK-NEXT: 18014398509481984000 -54 false -// CHECK-NEXT: 11258999068426240000 -50 false -// CHECK-NEXT: 14073748835532800000 -47 false -// CHECK-NEXT: 17592186044416000000 -44 false -// CHECK-NEXT: 10995116277760000000 -40 false -// CHECK-NEXT: 0 0 -// CHECK-NEXT: 1 0 -// CHECK-NEXT: 2 1 -// CHECK-NEXT: 3 0 -// CHECK-NEXT: 4 2 -// CHECK-NEXT: 5 0 -// CHECK-NEXT: 6 3 -// CHECK-NEXT: 7 0 -// CHECK-NEXT: 8 4 -// CHECK-NEXT: 9 0 -// CHECK-NEXT: 0 1 -// CHECK-NEXT: 1 2 - -package main - -// An extFloat represents an extended floating-point number, with more -// precision than a float64. It does not try to save bits: the -// number represented by the structure is mant*(2^exp), with a negative -// sign if neg is true. -type extFloat struct { - mant uint64 - exp int - neg bool -} - -var smallPowersOfTen = [...]extFloat{ - {1 << 63, -63, false}, // 1 - {0xa << 60, -60, false}, // 1e1 - {0x64 << 57, -57, false}, // 1e2 - {0x3e8 << 54, -54, false}, // 1e3 - {0x2710 << 50, -50, false}, // 1e4 - {0x186a0 << 47, -47, false}, // 1e5 - {0xf4240 << 44, -44, false}, // 1e6 - {0x989680 << 40, -40, false}, // 1e7 -} - -var arrayWithHoles = [10]int{ - 2: 1, - 4: 2, - 6: 3, - 8: 4, -} - -type namedInt int32 - -const N0 namedInt = 0 -const N1 namedInt = 1 - -var arrayWithNamedIndices = [...]int{ - N0: 1, - N1: 2, -} - -func main() { - for i := range smallPowersOfTen { - s := smallPowersOfTen[i] - println(s.mant, s.exp, s.neg) - } - - for i, value := range arrayWithHoles { - println(i, value) - } - - for i, value := range arrayWithNamedIndices { - println(i, value) - } -} diff --git a/llgo/test/execution/literals/func.go b/llgo/test/execution/literals/func.go deleted file mode 100644 index b8dbef340fad..000000000000 --- a/llgo/test/execution/literals/func.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false - -package main - -func main() { - f := func(x bool) { - println(x) - } - f(true) - f(false) -} diff --git a/llgo/test/execution/literals/map.go b/llgo/test/execution/literals/map.go deleted file mode 100644 index 32173f50d932..000000000000 --- a/llgo/test/execution/literals/map.go +++ /dev/null @@ -1,24 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: false -// CHECK-NEXT: 2 -// CHECK-NEXT: 1 0 3 -// CHECK-NEXT: 0.1 -// CHECK-NEXT: 0.2 -// CHECK-NEXT: 0.3 - -package main - -func main() { - type IntMap map[int]int - m := IntMap{0: 1, 2: 3} - println(m == nil) - println(len(m)) - println(m[0], m[1], m[2]) - - f32tostr := map[float32]string{0.1: "0.1", 0.2: "0.2", 0.3: "0.3"} - println(f32tostr[0.1]) - println(f32tostr[0.2]) - println(f32tostr[0.3]) -} diff --git a/llgo/test/execution/literals/slice.go b/llgo/test/execution/literals/slice.go deleted file mode 100644 index dbb02bff718d..000000000000 --- a/llgo/test/execution/literals/slice.go +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: abc -// CHECK-NEXT: 123 -// CHECK-NEXT: abc -// CHECK-NEXT: 123 - -package main - -func main() { - x := []string{"abc", "123"} - println(x[0]) - println(x[1]) - - // Elements are composite literals, so the '&' can be elided. - type S struct{ string } - y := []*S{{"abc"}, {"123"}} - println(y[0].string) - println(y[1].string) -} diff --git a/llgo/test/execution/literals/struct.go b/llgo/test/execution/literals/struct.go deleted file mode 100644 index 4fede950784b..000000000000 --- a/llgo/test/execution/literals/struct.go +++ /dev/null @@ -1,62 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 2 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: 0 1 2 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: 3 4 - -package main - -type E struct { - e *E -} - -type S struct { - *E - a, b int -} - -type File struct { -} - -type Reader struct { -} - -type Response struct { -} - -type reader struct { - *Reader - fd *File - resp *Response -} - -type Range32 struct { - Lo uint32 - Hi uint32 - Stride uint32 -} - -func main() { - s := &S{nil, 1, 2} - println(s.a, s.b) - s = &S{a: 1, b: 2} - println(s.a, s.b) - - _ = &reader{} - - r := Range32{ - Lo: 0, - Stride: 2, - Hi: 1, - } - println(r.Lo, r.Hi, r.Stride) - - // slice of structs - ss := []S{{nil, 1, 2}, {nil, 3, 4}} - for _, s := range ss { - println(s.a, s.b) - } -} diff --git a/llgo/test/execution/maps/delete.go b/llgo/test/execution/maps/delete.go deleted file mode 100644 index 6879974e9c9a..000000000000 --- a/llgo/test/execution/maps/delete.go +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 1 1 -// CHECK-NEXT: 0 0 - -package main - -func main() { - m := make(map[int]int) - delete(m, 0) // no-op - m[0] = 1 - println(len(m)) - delete(m, 1) // no-op - println(len(m), m[0]) - delete(m, 0) // delete element in map - println(len(m), m[0]) -} diff --git a/llgo/test/execution/maps/insert.go b/llgo/test/execution/maps/insert.go deleted file mode 100644 index 90b31cc96c14..000000000000 --- a/llgo/test/execution/maps/insert.go +++ /dev/null @@ -1,29 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 456 -// CHECK-NEXT: 1 -// CHECK-NEXT: 789 - -package main - -func main() { - { - var m map[int]int - println(len(m)) // 0 - println(m[123]) // 0, despite map being nil - } - - { - m := make(map[int]int) - m[123] = 456 - println(len(m)) // 1 - println(m[123]) - m[123] = 789 - println(len(m)) // 1 - println(m[123]) - } -} diff --git a/llgo/test/execution/maps/lookup.go b/llgo/test/execution/maps/lookup.go deleted file mode 100644 index 69d28788205f..000000000000 --- a/llgo/test/execution/maps/lookup.go +++ /dev/null @@ -1,30 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 false -// CHECK-NEXT: 1 true -// CHECK-NEXT: 1 true -// CHECK-NEXT: 1 true - -package main - -func main() { - m := make(map[int]int) - v, ok := m[8] - println(v, ok) - m[8] = 1 - v, ok = m[8] - println(v, ok) - - type S struct{ s1, s2 string } - sm := make(map[S]int) - sm[S{"ABC", "DEF"}] = 1 - sv, ok := sm[S{string([]byte{65, 66, 67}), string([]byte{68, 69, 70})}] - println(sv, ok) - - type A [2]string - am := make(map[A]int) - am[A{"ABC", "DEF"}] = 1 - av, ok := am[A{string([]byte{65, 66, 67}), string([]byte{68, 69, 70})}] - println(av, ok) -} diff --git a/llgo/test/execution/maps/range.go b/llgo/test/execution/maps/range.go deleted file mode 100644 index f3dc03fbd9e3..000000000000 --- a/llgo/test/execution/maps/range.go +++ /dev/null @@ -1,48 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 0 3 -// CHECK-NEXT: 1 4 -// CHECK-NEXT: 2 5 -// CHECK-NEXT: 1 -// CHECK-NEXT: done - -package main - -func main() { - defer println("done") - m := make(map[int]int) - m[0] = 3 - m[1] = 4 - m[2] = 5 - for k := range m { - println(k) - } - for k, _ := range m { - println(k) - } - for _, v := range m { - println(v) - } - for k, v := range m { - println(k, v) - } - - // test deletion. - i := 0 - for k, _ := range m { - i++ - delete(m, (k+1)%3) - delete(m, (k+2)%3) - } - println(i) -} diff --git a/llgo/test/execution/methods/methodvalues.go b/llgo/test/execution/methods/methodvalues.go deleted file mode 100644 index cf8a980df08b..000000000000 --- a/llgo/test/execution/methods/methodvalues.go +++ /dev/null @@ -1,64 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 246 -// CHECK-NEXT: T2.f() -// CHECK-NEXT: 10 -// CHECK-NEXT: abc - -package main - -type T1 struct { - value int -} - -func (t *T1) f(m int) int { - return m * t.value -} - -func f1() { - var t T1 - var f func(int) int = t.f - t.value = 2 - println(f(123)) -} - -type T2 struct{} - -func (T2) f() { - println("T2.f()") -} - -func f2() { - var f func() = T2{}.f - f() -} - -type T3 complex128 - -func (t T3) f() int { - return int(real(t)) -} - -func f3() { - var f func() int = T3(10).f - println(f()) -} - -type T4 string - -func (t T4) f() string { - return string(t) -} - -func f4() { - var f func() string = T4("abc").f - println(f()) -} - -func main() { - f1() - f2() - f3() - f4() -} diff --git a/llgo/test/execution/methods/nilrecv.go b/llgo/test/execution/methods/nilrecv.go deleted file mode 100644 index defe2f437231..000000000000 --- a/llgo/test/execution/methods/nilrecv.go +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false - -package main - -type T1 int - -func (t *T1) t1() { println(t == nil) } - -func constNilRecv() { - (*T1)(nil).t1() -} - -func nonConstNilRecv() { - var v1 T1 - v1.t1() - var v2 *T1 - v2.t1() - v2 = &v1 - v2.t1() -} - -func main() { - constNilRecv() - nonConstNilRecv() -} diff --git a/llgo/test/execution/methods/selectors.go b/llgo/test/execution/methods/selectors.go deleted file mode 100644 index bcd417366fbf..000000000000 --- a/llgo/test/execution/methods/selectors.go +++ /dev/null @@ -1,45 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: F1 -// CHECK-NEXT: F2 -// CHECK-NEXT: F1 -// CHECK-NEXT: F2 - -package main - -type S1 struct{} -type S2 struct { - S1 -} - -func (s S1) F1() { - println("F1") -} - -func (s *S2) F2() { - println("F2") -} - -func testUnnamedStructMethods() { - // Test method lookup on an unnamed struct type. - var x struct { - S1 - S2 - } - x.F1() - x.F2() -} - -func main() { - var s S2 - - // Derive pointer-receiver function. - f1 := (*S2).F1 - f1(&s) - - f2 := (*S2).F2 - f2(&s) - - testUnnamedStructMethods() -} diff --git a/llgo/test/execution/new.go b/llgo/test/execution/new.go deleted file mode 100644 index 24773de7f350..000000000000 --- a/llgo/test/execution/new.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 2 -// CHECK-NEXT: 4 - -package main - -func main() { - x := new(int) - println(*x) - *x = 2 - println(*x) - *x = *x * *x - println(*x) -} diff --git a/llgo/test/execution/nil.go b/llgo/test/execution/nil.go deleted file mode 100644 index 0aa94e7c0d47..000000000000 --- a/llgo/test/execution/nil.go +++ /dev/null @@ -1,32 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0x0 -// CHECK-NEXT: x is nil -// CHECK-NEXT: y is nil -// CHECK-NEXT: z is nil - -package main - -func main() { - var x *int = nil - println(x) - - if x == nil { - println("x is nil") - } - - var y interface{} - var z interface{} = y - if y == nil { - println("y is nil") - } else { - println("y is not nil") - } - - if z == nil { - println("z is nil") - } else { - println("z is not nil") - } -} diff --git a/llgo/test/execution/operators/basics.go b/llgo/test/execution/operators/basics.go deleted file mode 100644 index 19425868f556..000000000000 --- a/llgo/test/execution/operators/basics.go +++ /dev/null @@ -1,133 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 4096 -// CHECK-NEXT: 256 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 4096 -// CHECK-NEXT: 256 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 65280 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 61184 -// CHECK-NEXT: 65024 -// CHECK-NEXT: 65296 -// CHECK-NEXT: 65281 -// CHECK-NEXT: 61184 -// CHECK-NEXT: 65024 -// CHECK-NEXT: 65296 -// CHECK-NEXT: 65281 -// CHECK-NEXT: -62 -// CHECK-NEXT: -246 -// CHECK-NEXT: +1.224560e+002 -// CHECK-NEXT: 3 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 122 -// CHECK-NEXT: -124 -// CHECK-NEXT: 120 -// CHECK-NEXT: 18446744073709547520 -// CHECK-NEXT: false -// CHECK-NEXT: 2147483648 -// CHECK-NEXT: 9223372036854775808 -// CHECK-NEXT: 2147483648 2147483648 -// CHECK-NEXT: 9223372036854775808 9223372036854775808 - -package main - -import "unsafe" - -var global string - -var hi = 0xFF00 -var lo = 0xFF00 - -// borrowed from math package to avoid dependency on standard library -func float32bits(f float32) uint32 { return *(*uint32)(unsafe.Pointer(&f)) } -func float64bits(f float64) uint64 { return *(*uint64)(unsafe.Pointer(&f)) } - -func main() { - println(hi & 0x1000) - println(hi & 0x0100) - println(hi & 0x0010) - println(hi & 0x0001) - println(lo & 0x1000) - println(lo & 0x0100) - println(lo & 0x0010) - println(lo & 0x0001) - println(hi | lo) - println(hi ^ hi) - println(hi ^ lo) - println(lo ^ lo) - println(hi ^ 0x1000) - println(hi ^ 0x0100) - println(hi ^ 0x0010) - println(hi ^ 0x0001) - println(lo ^ 0x1000) - println(lo ^ 0x0100) - println(lo ^ 0x0010) - println(lo ^ 0x0001) - println(-123 >> 1) - println(-123 << 1) - - var f float64 = 123.456 - f-- - println(f) - - // context of '&' op is used to type the untyped lhs - // operand of the shift expression. - shift := uint(2) - println(uint64(0xFFFFFFFF) & (1<> (63 - _uint) - if x == 2<<_uint { - println("!") - } - } - - // There was a bug related to compound expressions involving - // multiple binary logical operators. - var a, b, c int - if a == 0 && (b != 0 || c != 0) { - println("!") - } - - var si int = -123 - var ui int = 123 - println(^si) - println(^ui) - println(ui &^ 3) - - // test case from math/modf.go - var x uint64 = 0xFFFFFFFFFFFFFFFF - var e uint = 40 - x &^= 1<<(64-12-e) - 1 - println(x) - - // compare global to non-global - println(new(string) == &global) - - // negative zero - var f32 float32 - var f64 float64 - var c64 complex64 - var c128 complex128 - f32 = -f32 - f64 = -f64 - c64 = -c64 - c128 = -c128 - println(float32bits(f32)) - println(float64bits(f64)) - println(float32bits(real(c64)), float32bits(imag(c64))) - println(float64bits(real(c128)), float64bits(imag(c128))) -} diff --git a/llgo/test/execution/operators/binary_untyped.go b/llgo/test/execution/operators/binary_untyped.go deleted file mode 100644 index f152985ffb52..000000000000 --- a/llgo/test/execution/operators/binary_untyped.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true - -package main - -func f1(b bool) bool { - return b -} - -func main() { - x := false - y := x - x = !y - println(x || y) -} diff --git a/llgo/test/execution/operators/shifts.go b/llgo/test/execution/operators/shifts.go deleted file mode 100644 index 728b32b57bf4..000000000000 --- a/llgo/test/execution/operators/shifts.go +++ /dev/null @@ -1,290 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 4294967295 -// CHECK-NEXT: 4294967295 -// CHECK-NEXT: 2147483647 -// CHECK-NEXT: 4294967294 -// CHECK-NEXT: 1073741823 -// CHECK-NEXT: 4294967292 -// CHECK-NEXT: 536870911 -// CHECK-NEXT: 4294967288 -// CHECK-NEXT: 268435455 -// CHECK-NEXT: 4294967280 -// CHECK-NEXT: 134217727 -// CHECK-NEXT: 4294967264 -// CHECK-NEXT: 67108863 -// CHECK-NEXT: 4294967232 -// CHECK-NEXT: 33554431 -// CHECK-NEXT: 4294967168 -// CHECK-NEXT: 16777215 -// CHECK-NEXT: 4294967040 -// CHECK-NEXT: 8388607 -// CHECK-NEXT: 4294966784 -// CHECK-NEXT: 4194303 -// CHECK-NEXT: 4294966272 -// CHECK-NEXT: 2097151 -// CHECK-NEXT: 4294965248 -// CHECK-NEXT: 1048575 -// CHECK-NEXT: 4294963200 -// CHECK-NEXT: 524287 -// CHECK-NEXT: 4294959104 -// CHECK-NEXT: 262143 -// CHECK-NEXT: 4294950912 -// CHECK-NEXT: 131071 -// CHECK-NEXT: 4294934528 -// CHECK-NEXT: 65535 -// CHECK-NEXT: 4294901760 -// CHECK-NEXT: 32767 -// CHECK-NEXT: 4294836224 -// CHECK-NEXT: 16383 -// CHECK-NEXT: 4294705152 -// CHECK-NEXT: 8191 -// CHECK-NEXT: 4294443008 -// CHECK-NEXT: 4095 -// CHECK-NEXT: 4293918720 -// CHECK-NEXT: 2047 -// CHECK-NEXT: 4292870144 -// CHECK-NEXT: 1023 -// CHECK-NEXT: 4290772992 -// CHECK-NEXT: 511 -// CHECK-NEXT: 4286578688 -// CHECK-NEXT: 255 -// CHECK-NEXT: 4278190080 -// CHECK-NEXT: 127 -// CHECK-NEXT: 4261412864 -// CHECK-NEXT: 63 -// CHECK-NEXT: 4227858432 -// CHECK-NEXT: 31 -// CHECK-NEXT: 4160749568 -// CHECK-NEXT: 15 -// CHECK-NEXT: 4026531840 -// CHECK-NEXT: 7 -// CHECK-NEXT: 3758096384 -// CHECK-NEXT: 3 -// CHECK-NEXT: 3221225472 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2147483648 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: 4026531839 -// CHECK-NEXT: 4026531839 -// CHECK-NEXT: 2013265919 -// CHECK-NEXT: 3758096382 -// CHECK-NEXT: 1006632959 -// CHECK-NEXT: 3221225468 -// CHECK-NEXT: 503316479 -// CHECK-NEXT: 2147483640 -// CHECK-NEXT: 251658239 -// CHECK-NEXT: 4294967280 -// CHECK-NEXT: 125829119 -// CHECK-NEXT: 4294967264 -// CHECK-NEXT: 62914559 -// CHECK-NEXT: 4294967232 -// CHECK-NEXT: 31457279 -// CHECK-NEXT: 4294967168 -// CHECK-NEXT: 15728639 -// CHECK-NEXT: 4294967040 -// CHECK-NEXT: 7864319 -// CHECK-NEXT: 4294966784 -// CHECK-NEXT: 3932159 -// CHECK-NEXT: 4294966272 -// CHECK-NEXT: 1966079 -// CHECK-NEXT: 4294965248 -// CHECK-NEXT: 983039 -// CHECK-NEXT: 4294963200 -// CHECK-NEXT: 491519 -// CHECK-NEXT: 4294959104 -// CHECK-NEXT: 245759 -// CHECK-NEXT: 4294950912 -// CHECK-NEXT: 122879 -// CHECK-NEXT: 4294934528 -// CHECK-NEXT: 61439 -// CHECK-NEXT: 4294901760 -// CHECK-NEXT: 30719 -// CHECK-NEXT: 4294836224 -// CHECK-NEXT: 15359 -// CHECK-NEXT: 4294705152 -// CHECK-NEXT: 7679 -// CHECK-NEXT: 4294443008 -// CHECK-NEXT: 3839 -// CHECK-NEXT: 4293918720 -// CHECK-NEXT: 1919 -// CHECK-NEXT: 4292870144 -// CHECK-NEXT: 959 -// CHECK-NEXT: 4290772992 -// CHECK-NEXT: 479 -// CHECK-NEXT: 4286578688 -// CHECK-NEXT: 239 -// CHECK-NEXT: 4278190080 -// CHECK-NEXT: 119 -// CHECK-NEXT: 4261412864 -// CHECK-NEXT: 59 -// CHECK-NEXT: 4227858432 -// CHECK-NEXT: 29 -// CHECK-NEXT: 4160749568 -// CHECK-NEXT: 14 -// CHECK-NEXT: 4026531840 -// CHECK-NEXT: 7 -// CHECK-NEXT: 3758096384 -// CHECK-NEXT: 3 -// CHECK-NEXT: 3221225472 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2147483648 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 -// CHECK-NEXT: -1 -// CHECK-NEXT: -1 -// CHECK-NEXT: -1 -// CHECK-NEXT: -2 -// CHECK-NEXT: -1 -// CHECK-NEXT: -4 -// CHECK-NEXT: -1 -// CHECK-NEXT: -8 -// CHECK-NEXT: -1 -// CHECK-NEXT: -16 -// CHECK-NEXT: -1 -// CHECK-NEXT: -32 -// CHECK-NEXT: -1 -// CHECK-NEXT: -64 -// CHECK-NEXT: -1 -// CHECK-NEXT: -128 -// CHECK-NEXT: -1 -// CHECK-NEXT: -256 -// CHECK-NEXT: -1 -// CHECK-NEXT: -512 -// CHECK-NEXT: -1 -// CHECK-NEXT: -1024 -// CHECK-NEXT: -1 -// CHECK-NEXT: -2048 -// CHECK-NEXT: -1 -// CHECK-NEXT: -4096 -// CHECK-NEXT: -1 -// CHECK-NEXT: -8192 -// CHECK-NEXT: -1 -// CHECK-NEXT: -16384 -// CHECK-NEXT: -1 -// CHECK-NEXT: -32768 -// CHECK-NEXT: -1 -// CHECK-NEXT: -65536 -// CHECK-NEXT: -1 -// CHECK-NEXT: -131072 -// CHECK-NEXT: -1 -// CHECK-NEXT: -262144 -// CHECK-NEXT: -1 -// CHECK-NEXT: -524288 -// CHECK-NEXT: -1 -// CHECK-NEXT: -1048576 -// CHECK-NEXT: -1 -// CHECK-NEXT: -2097152 -// CHECK-NEXT: -1 -// CHECK-NEXT: -4194304 -// CHECK-NEXT: -1 -// CHECK-NEXT: -8388608 -// CHECK-NEXT: -1 -// CHECK-NEXT: -16777216 -// CHECK-NEXT: -1 -// CHECK-NEXT: -33554432 -// CHECK-NEXT: -1 -// CHECK-NEXT: -67108864 -// CHECK-NEXT: -1 -// CHECK-NEXT: -134217728 -// CHECK-NEXT: -1 -// CHECK-NEXT: -268435456 -// CHECK-NEXT: -1 -// CHECK-NEXT: -536870912 -// CHECK-NEXT: -1 -// CHECK-NEXT: -1073741824 -// CHECK-NEXT: -1 -// CHECK-NEXT: -2147483648 -// CHECK-NEXT: -1 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 1 -// CHECK-NEXT: 0 -// CHECK-NEXT: 2 -// CHECK-NEXT: 0 -// CHECK-NEXT: 4 -// CHECK-NEXT: 0 -// CHECK-NEXT: 8 -// CHECK-NEXT: 0 -// CHECK-NEXT: 16 -// CHECK-NEXT: 0 -// CHECK-NEXT: 32 -// CHECK-NEXT: 0 -// CHECK-NEXT: 64 -// CHECK-NEXT: 0 -// CHECK-NEXT: 128 -// CHECK-NEXT: 0 -// CHECK-NEXT: 256 -// CHECK-NEXT: 0 -// CHECK-NEXT: 512 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1024 -// CHECK-NEXT: 0 -// CHECK-NEXT: 2048 -// CHECK-NEXT: 0 -// CHECK-NEXT: 4096 -// CHECK-NEXT: 0 -// CHECK-NEXT: 8192 -// CHECK-NEXT: 0 -// CHECK-NEXT: 16384 -// CHECK-NEXT: 0 -// CHECK-NEXT: 32768 -// CHECK-NEXT: 0 -// CHECK-NEXT: 65536 -// CHECK-NEXT: 0 -// CHECK-NEXT: 131072 -// CHECK-NEXT: 0 -// CHECK-NEXT: 262144 -// CHECK-NEXT: 0 -// CHECK-NEXT: 524288 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1048576 -// CHECK-NEXT: 0 -// CHECK-NEXT: 2097152 -// CHECK-NEXT: 0 -// CHECK-NEXT: 4194304 -// CHECK-NEXT: 0 -// CHECK-NEXT: 8388608 -// CHECK-NEXT: 0 -// CHECK-NEXT: 16777216 -// CHECK-NEXT: 0 -// CHECK-NEXT: 33554432 -// CHECK-NEXT: 0 -// CHECK-NEXT: 67108864 -// CHECK-NEXT: 0 -// CHECK-NEXT: 134217728 -// CHECK-NEXT: 0 -// CHECK-NEXT: 268435456 -// CHECK-NEXT: 0 -// CHECK-NEXT: 536870912 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1073741824 -// CHECK-NEXT: 0 -// CHECK-NEXT: -2147483648 -// CHECK-NEXT: 0 -// CHECK-NEXT: 0 - -package main - -func testShrUint32(v uint32) { - for i := uint(0); i <= 32; i++ { - println(v >> i) - println(v << i) - } -} - -func testShrInt32(v int32) { - for i := uint(0); i <= 32; i++ { - println(v >> i) - println(v << i) - } -} - -func main() { - testShrUint32(0xFFFFFFFF) - testShrUint32(0xEFFFFFFF) - testShrInt32(-1) - testShrInt32(1) -} diff --git a/llgo/test/execution/slices/append.go b/llgo/test/execution/slices/append.go deleted file mode 100644 index 50db2ac27f62..000000000000 --- a/llgo/test/execution/slices/append.go +++ /dev/null @@ -1,254 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 6 -// CHECK-NEXT: 7 -// CHECK-NEXT: 8 -// CHECK-NEXT: 9 -// CHECK-NEXT: 10 -// CHECK-NEXT: 11 -// CHECK-NEXT: 12 -// CHECK-NEXT: 13 -// CHECK-NEXT: 14 -// CHECK-NEXT: 15 -// CHECK-NEXT: 16 -// CHECK-NEXT: 17 -// CHECK-NEXT: 18 -// CHECK-NEXT: 19 -// CHECK-NEXT: 20 -// CHECK-NEXT: 21 -// CHECK-NEXT: 22 -// CHECK-NEXT: 23 -// CHECK-NEXT: 24 -// CHECK-NEXT: 25 -// CHECK-NEXT: 26 -// CHECK-NEXT: 27 -// CHECK-NEXT: 28 -// CHECK-NEXT: 29 -// CHECK-NEXT: 30 -// CHECK-NEXT: 31 -// CHECK-NEXT: 32 -// CHECK-NEXT: 33 -// CHECK-NEXT: 34 -// CHECK-NEXT: 35 -// CHECK-NEXT: 36 -// CHECK-NEXT: 37 -// CHECK-NEXT: 38 -// CHECK-NEXT: 39 -// CHECK-NEXT: 40 -// CHECK-NEXT: 41 -// CHECK-NEXT: 42 -// CHECK-NEXT: 43 -// CHECK-NEXT: 44 -// CHECK-NEXT: 45 -// CHECK-NEXT: 46 -// CHECK-NEXT: 47 -// CHECK-NEXT: 48 -// CHECK-NEXT: 49 -// CHECK-NEXT: 50 -// CHECK-NEXT: 51 -// CHECK-NEXT: 52 -// CHECK-NEXT: 53 -// CHECK-NEXT: 54 -// CHECK-NEXT: 55 -// CHECK-NEXT: 56 -// CHECK-NEXT: 57 -// CHECK-NEXT: 58 -// CHECK-NEXT: 59 -// CHECK-NEXT: 60 -// CHECK-NEXT: 61 -// CHECK-NEXT: 62 -// CHECK-NEXT: 63 -// CHECK-NEXT: 64 -// CHECK-NEXT: 65 -// CHECK-NEXT: 66 -// CHECK-NEXT: 67 -// CHECK-NEXT: 68 -// CHECK-NEXT: 69 -// CHECK-NEXT: 70 -// CHECK-NEXT: 71 -// CHECK-NEXT: 72 -// CHECK-NEXT: 73 -// CHECK-NEXT: 74 -// CHECK-NEXT: 75 -// CHECK-NEXT: 76 -// CHECK-NEXT: 77 -// CHECK-NEXT: 78 -// CHECK-NEXT: 79 -// CHECK-NEXT: 80 -// CHECK-NEXT: 81 -// CHECK-NEXT: 82 -// CHECK-NEXT: 83 -// CHECK-NEXT: 84 -// CHECK-NEXT: 85 -// CHECK-NEXT: 86 -// CHECK-NEXT: 87 -// CHECK-NEXT: 88 -// CHECK-NEXT: 89 -// CHECK-NEXT: 90 -// CHECK-NEXT: 91 -// CHECK-NEXT: 92 -// CHECK-NEXT: 93 -// CHECK-NEXT: 94 -// CHECK-NEXT: 95 -// CHECK-NEXT: 96 -// CHECK-NEXT: 97 -// CHECK-NEXT: 98 -// CHECK-NEXT: 99 -// CHECK-NEXT: 0 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: 4 -// CHECK-NEXT: 5 -// CHECK-NEXT: 6 -// CHECK-NEXT: 7 -// CHECK-NEXT: 8 -// CHECK-NEXT: 9 -// CHECK-NEXT: 10 -// CHECK-NEXT: 11 -// CHECK-NEXT: 12 -// CHECK-NEXT: 13 -// CHECK-NEXT: 14 -// CHECK-NEXT: 15 -// CHECK-NEXT: 16 -// CHECK-NEXT: 17 -// CHECK-NEXT: 18 -// CHECK-NEXT: 19 -// CHECK-NEXT: 20 -// CHECK-NEXT: 21 -// CHECK-NEXT: 22 -// CHECK-NEXT: 23 -// CHECK-NEXT: 24 -// CHECK-NEXT: 25 -// CHECK-NEXT: 26 -// CHECK-NEXT: 27 -// CHECK-NEXT: 28 -// CHECK-NEXT: 29 -// CHECK-NEXT: 30 -// CHECK-NEXT: 31 -// CHECK-NEXT: 32 -// CHECK-NEXT: 33 -// CHECK-NEXT: 34 -// CHECK-NEXT: 35 -// CHECK-NEXT: 36 -// CHECK-NEXT: 37 -// CHECK-NEXT: 38 -// CHECK-NEXT: 39 -// CHECK-NEXT: 40 -// CHECK-NEXT: 41 -// CHECK-NEXT: 42 -// CHECK-NEXT: 43 -// CHECK-NEXT: 44 -// CHECK-NEXT: 45 -// CHECK-NEXT: 46 -// CHECK-NEXT: 47 -// CHECK-NEXT: 48 -// CHECK-NEXT: 49 -// CHECK-NEXT: 50 -// CHECK-NEXT: 51 -// CHECK-NEXT: 52 -// CHECK-NEXT: 53 -// CHECK-NEXT: 54 -// CHECK-NEXT: 55 -// CHECK-NEXT: 56 -// CHECK-NEXT: 57 -// CHECK-NEXT: 58 -// CHECK-NEXT: 59 -// CHECK-NEXT: 60 -// CHECK-NEXT: 61 -// CHECK-NEXT: 62 -// CHECK-NEXT: 63 -// CHECK-NEXT: 64 -// CHECK-NEXT: 65 -// CHECK-NEXT: 66 -// CHECK-NEXT: 67 -// CHECK-NEXT: 68 -// CHECK-NEXT: 69 -// CHECK-NEXT: 70 -// CHECK-NEXT: 71 -// CHECK-NEXT: 72 -// CHECK-NEXT: 73 -// CHECK-NEXT: 74 -// CHECK-NEXT: 75 -// CHECK-NEXT: 76 -// CHECK-NEXT: 77 -// CHECK-NEXT: 78 -// CHECK-NEXT: 79 -// CHECK-NEXT: 80 -// CHECK-NEXT: 81 -// CHECK-NEXT: 82 -// CHECK-NEXT: 83 -// CHECK-NEXT: 84 -// CHECK-NEXT: 85 -// CHECK-NEXT: 86 -// CHECK-NEXT: 87 -// CHECK-NEXT: 88 -// CHECK-NEXT: 89 -// CHECK-NEXT: 90 -// CHECK-NEXT: 91 -// CHECK-NEXT: 92 -// CHECK-NEXT: 93 -// CHECK-NEXT: 94 -// CHECK-NEXT: 95 -// CHECK-NEXT: 96 -// CHECK-NEXT: 97 -// CHECK-NEXT: 98 -// CHECK-NEXT: 99 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 -// CHECK-NEXT: abcdef -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: false false -// CHECK-NEXT: true true -// CHECK-NEXT: false false - -package main - -func stringtobytes() { - var b []byte - b = append(b, "abc"...) - b = append(b, "def"...) - println(string(b)) -} - -func appendnothing() { - var x []string - println(append(x) == nil) - x = append(x, "!") - println(len(append(x)) == 1) -} - -func appendmulti() { - a := append([]bool{}, []bool{false, true, false}...) - b := append([]bool{}, false, true, false) - for i := range a { - println(a[i], b[i]) - } -} - -func main() { - x := []int{} - for i := 0; i < 100; i++ { - x = append(x, i) - } - for i := 0; i < len(x); i++ { - println(x[i]) - } - y := []int{1, 2, 3} - x = append(x, y...) - for i := 0; i < len(x); i++ { - println(x[i]) - } - stringtobytes() - appendnothing() - appendmulti() -} diff --git a/llgo/test/execution/slices/cap.go b/llgo/test/execution/slices/cap.go deleted file mode 100644 index 33a34ff1a38c..000000000000 --- a/llgo/test/execution/slices/cap.go +++ /dev/null @@ -1,50 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 0 -// CHECK-NEXT: 0 0 -// CHECK-NEXT: 0 0 -// CHECK-NEXT: 1 1 -// CHECK-NEXT: 1 1 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: 2 9 -// CHECK-NEXT: 3 9 -// CHECK-NEXT: 999 -// CHECK-NEXT: 999 -// CHECK-NEXT: 1 2 - -package main - -func test(l, c int) { - var s []int - if l != -1 { - if c == -1 { - s = make([]int, l) - } else { - s = make([]int, l, c) - } - } - println(len(s), cap(s)) -} - -func main() { - test(-1, -1) - test(0, -1) - test(0, 0) - test(1, -1) - test(1, 1) - test(1, 2) - - // make sure capacity is transferred to slice - s := make([]int, 5, 10) - s1 := s[1:3] - println(len(s1), cap(s1)) - - s2 := append(s1, 999) - println(len(s2), cap(s2)) - println(s2[2]) - println(s[3]) - - s3 := s1[0:1:2] - println(len(s3), cap(s3)) -} diff --git a/llgo/test/execution/slices/compare.go b/llgo/test/execution/slices/compare.go deleted file mode 100644 index 93e3071397ee..000000000000 --- a/llgo/test/execution/slices/compare.go +++ /dev/null @@ -1,26 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: true - -package main - -func main() { - var s []int - println(s == nil) - println(s != nil) - println(nil == s) - println(nil != s) - s = make([]int, 0) - println(s == nil) - println(s != nil) - println(nil == s) - println(nil != s) -} diff --git a/llgo/test/execution/slices/copy.go b/llgo/test/execution/slices/copy.go deleted file mode 100644 index a6bf6c56454a..000000000000 --- a/llgo/test/execution/slices/copy.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 5 -// CHECK-NEXT: 0 - -package main - -func main() { - a := make([]int, 10) - b := make([]int, 10) - for i, _ := range b { - b[i] = 1 - } - println(copy(a[:5], b)) // expect 5 - println(a[5]) // expect 0 -} diff --git a/llgo/test/execution/slices/index.go b/llgo/test/execution/slices/index.go deleted file mode 100644 index 20d213e1a4ee..000000000000 --- a/llgo/test/execution/slices/index.go +++ /dev/null @@ -1,14 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 - -package main - -func blah() []int { - return make([]int, 1) -} - -func main() { - println(blah()[0]) -} diff --git a/llgo/test/execution/slices/literal.go b/llgo/test/execution/slices/literal.go deleted file mode 100644 index 42adabf76bdc..000000000000 --- a/llgo/test/execution/slices/literal.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 - -package main - -func main() { - x := []int{1, 2, 3} - for i := 0; i < len(x); i++ { - println(x[i]) - } -} diff --git a/llgo/test/execution/slices/make.go b/llgo/test/execution/slices/make.go deleted file mode 100644 index 30ecd6cbb0e8..000000000000 --- a/llgo/test/execution/slices/make.go +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 0 -// CHECK-NEXT: 1 0 -// CHECK-NEXT: 2 0 -// CHECK-NEXT: 3 0 -// CHECK-NEXT: 4 0 -// CHECK-NEXT: 5 666 -// CHECK-NEXT: 6 0 -// CHECK-NEXT: 7 0 -// CHECK-NEXT: 8 0 -// CHECK-NEXT: 9 0 - -package main - -func main() { - x := make([]int, 10) - x[5] = 666 - for i, val := range x { - println(i, val) - } -} diff --git a/llgo/test/execution/slices/sliceexpr.go b/llgo/test/execution/slices/sliceexpr.go deleted file mode 100644 index 56a7b528d9f0..000000000000 --- a/llgo/test/execution/slices/sliceexpr.go +++ /dev/null @@ -1,39 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: a -// CHECK-NEXT: 0 2 -// CHECK-NEXT: 1 3 -// CHECK-NEXT: b -// CHECK-NEXT: 0 3 -// CHECK-NEXT: 1 4 -// CHECK-NEXT: c -// CHECK-NEXT: 0 1 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: d -// CHECK-NEXT: 0 1 -// CHECK-NEXT: 1 2 -// CHECK-NEXT: 2 3 -// CHECK-NEXT: 3 4 - -package main - -func main() { - x := []int{1, 2, 3, 4} - println("a") - for i, val := range x[1:3] { - println(i, val) - } - println("b") - for i, val := range x[2:] { - println(i, val) - } - println("c") - for i, val := range x[:2] { - println(i, val) - } - println("d") - for i, val := range x[:] { - println(i, val) - } -} diff --git a/llgo/test/execution/strings/add.go b/llgo/test/execution/strings/add.go deleted file mode 100644 index daf692155912..000000000000 --- a/llgo/test/execution/strings/add.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 3 3 6 -// CHECK-NEXT: abc123 - -package main - -func main() { - a := "abc" - b := "123" - c := a + b - println(len(a), len(b), len(c)) - println(c) -} diff --git a/llgo/test/execution/strings/bytes.go b/llgo/test/execution/strings/bytes.go deleted file mode 100644 index a2c450a17478..000000000000 --- a/llgo/test/execution/strings/bytes.go +++ /dev/null @@ -1,41 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: testBytesConversion: true -// CHECK-NEXT: 97 -// CHECK-NEXT: 98 -// CHECK-NEXT: 99 -// CHECK-NEXT: abc -// CHECK-NEXT: !bc -// CHECK-NEXT: testBytesCopy: true - -package main - -type namedByte byte - -func testBytesConversion() { - s := "abc" - b := []byte(s) - println("testBytesConversion:", s == string(b)) - nb := []namedByte(s) - for _, v := range nb { - println(v) - } - b[0] = '!' - println(s) - s = string(b) - b[0] = 'a' - println(s) -} - -func testBytesCopy() { - s := "abc" - b := make([]byte, len(s)) - copy(b, s) - println("testBytesCopy:", string(b) == s) -} - -func main() { - testBytesConversion() - testBytesCopy() -} diff --git a/llgo/test/execution/strings/compare.go b/llgo/test/execution/strings/compare.go deleted file mode 100644 index c8e4f0914d28..000000000000 --- a/llgo/test/execution/strings/compare.go +++ /dev/null @@ -1,54 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true - -package main - -func main() { - x := "abc" - y := "def" - z := "abcd" - - println(x == x) // true - println(x == y) // false - println(x != x) // false - println(x != y) // true - println(x < x) // false - println(x < y) // true - println(y < x) // false - println(x > x) // false - println(x > y) // false - println(y > x) // true - - println(x == z) // false - println(z == x) // false - println(x < z) // true - println(x > z) // false - println(z < x) // false - println(z > x) // true - - println(x <= x) // true - println(x <= y) // true - println(x >= x) // true - println(y >= x) // true -} diff --git a/llgo/test/execution/strings/index.go b/llgo/test/execution/strings/index.go deleted file mode 100644 index dca7ddf8f106..000000000000 --- a/llgo/test/execution/strings/index.go +++ /dev/null @@ -1,11 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 97 98 99 - -package main - -func main() { - s := "abc" - println(s[0], s[1], s[2]) -} diff --git a/llgo/test/execution/strings/range.go b/llgo/test/execution/strings/range.go deleted file mode 100644 index c68b02a6680a..000000000000 --- a/llgo/test/execution/strings/range.go +++ /dev/null @@ -1,86 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 46 1 -// CHECK-NEXT: 0 46 -// CHECK-NEXT: 0 169 1 -// CHECK-NEXT: 0 169 -// CHECK-NEXT: 0 8364 1 -// CHECK-NEXT: 0 8364 -// CHECK-NEXT: 0 66560 1 -// CHECK-NEXT: 0 66560 -// CHECK-NEXT: 0 83 1 -// CHECK-NEXT: 1 97 2 -// CHECK-NEXT: 2 108 3 -// CHECK-NEXT: 3 101 4 -// CHECK-NEXT: 4 32 5 -// CHECK-NEXT: 5 112 6 -// CHECK-NEXT: 6 114 7 -// CHECK-NEXT: 7 105 8 -// CHECK-NEXT: 8 99 9 -// CHECK-NEXT: 9 101 10 -// CHECK-NEXT: 10 58 11 -// CHECK-NEXT: 11 32 12 -// CHECK-NEXT: 12 8364 13 -// CHECK-NEXT: 15 48 14 -// CHECK-NEXT: 16 46 15 -// CHECK-NEXT: 17 57 16 -// CHECK-NEXT: 18 57 17 -// CHECK-NEXT: 0 83 -// CHECK-NEXT: 1 97 -// CHECK-NEXT: 2 108 -// CHECK-NEXT: 3 101 -// CHECK-NEXT: 4 32 -// CHECK-NEXT: 5 112 -// CHECK-NEXT: 6 114 -// CHECK-NEXT: 7 105 -// CHECK-NEXT: 8 99 -// CHECK-NEXT: 9 101 -// CHECK-NEXT: 10 58 -// CHECK-NEXT: 11 32 -// CHECK-NEXT: 12 8364 -// CHECK-NEXT: 15 48 -// CHECK-NEXT: 16 46 -// CHECK-NEXT: 17 57 -// CHECK-NEXT: 18 57 - -package main - -func printchars(s string) { - var x int - for i, c := range s { - // test loop-carried dependence (x++), introducing a Phi node - x++ - println(i, c, x) - } - - // now test with plain old assignment - var i int - var c rune - for i, c = range s { - println(i, c) - if i == len(s)-1 { - // test multiple branches to loop header - continue - } - } -} - -func main() { - // 1 bytes - printchars(".") - - // 2 bytes - printchars("©") - - // 3 bytes - printchars("€") - - // 4 bytes - printchars("𐐀") - - // mixed - printchars("Sale price: €0.99") - - // TODO add test cases for invalid sequences -} diff --git a/llgo/test/execution/strings/runetostring.go b/llgo/test/execution/strings/runetostring.go deleted file mode 100644 index e6a8c5de413d..000000000000 --- a/llgo/test/execution/strings/runetostring.go +++ /dev/null @@ -1,74 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: test( 46 ) -// CHECK-NEXT: . -// CHECK-NEXT: 46 -// CHECK-NEXT: 0 46 -// CHECK-NEXT: test( 169 ) -// CHECK-NEXT: © -// CHECK-NEXT: 194 -// CHECK-NEXT: 169 -// CHECK-NEXT: 0 169 -// CHECK-NEXT: test( 8364 ) -// CHECK-NEXT: € -// CHECK-NEXT: 226 -// CHECK-NEXT: 130 -// CHECK-NEXT: 172 -// CHECK-NEXT: 0 8364 -// CHECK-NEXT: test( 66560 ) -// CHECK-NEXT: 𐐀 -// CHECK-NEXT: 240 -// CHECK-NEXT: 144 -// CHECK-NEXT: 144 -// CHECK-NEXT: 128 -// CHECK-NEXT: 0 66560 -// CHECK-NEXT: .©€𐐀 -// CHECK-NEXT: 4 4 4 -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: true - -package main - -func test(r rune) { - println("test(", r, ")") - s := string(r) - println(s) - for i := 0; i < len(s); i++ { - println(s[i]) - } - for i, r := range s { - println(i, r) - } -} - -type namedRune rune - -func testslice(r1 []rune) { - s := string(r1) - println(s) - r2 := []rune(s) - r3 := []namedRune(s) - println(len(r1), len(r2), len(r3)) - if len(r2) == len(r1) && len(r3) == len(r1) { - for i := range r2 { - println(r1[i] == r2[i]) - println(r1[i] == rune(r3[i])) - } - } -} - -func main() { - var runes = []rune{'.', '©', '€', '𐐀'} - test(runes[0]) - test(runes[1]) - test(runes[2]) - test(runes[3]) - testslice(runes) -} diff --git a/llgo/test/execution/strings/slice.go b/llgo/test/execution/strings/slice.go deleted file mode 100644 index ec1b40ce7192..000000000000 --- a/llgo/test/execution/strings/slice.go +++ /dev/null @@ -1,17 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: abcdef -// CHECK-NEXT: bcdef -// CHECK-NEXT: abc -// CHECK-NEXT: bcd - -package main - -func main() { - s := "abcdef" - println(s[:]) - println(s[1:]) - println(s[:3]) - println(s[1:4]) -} diff --git a/llgo/test/execution/structs/compare.go b/llgo/test/execution/structs/compare.go deleted file mode 100644 index 20a8ead72f72..000000000000 --- a/llgo/test/execution/structs/compare.go +++ /dev/null @@ -1,52 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true -// CHECK-NEXT: true -// CHECK-NEXT: false -// CHECK-NEXT: false -// CHECK-NEXT: true - -package main - -type S0 struct{} - -type S1 struct { - a int -} - -type S2 struct { - a, b int -} - -func testS0() { - println(S0{} == S0{}) - println(S0{} != S0{}) -} - -func testS1() { - println(S1{1} == S1{1}) - println(S1{1} != S1{1}) - println(S1{1} == S1{2}) - println(S1{1} != S1{2}) -} - -func testS2() { - s1 := S2{1, 2} - s2 := S2{1, 3} - println(s1 == s1) - println(s1 == s2) - println(s1 != s1) - println(s1 != s2) -} - -func main() { - testS0() - testS1() - testS2() -} diff --git a/llgo/test/execution/structs/embed.go b/llgo/test/execution/structs/embed.go deleted file mode 100644 index d5197945eefc..000000000000 --- a/llgo/test/execution/structs/embed.go +++ /dev/null @@ -1,58 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: A.test 1 -// CHECK-NEXT: A.testA -// CHECK-NEXT: A.testA2 -// CHECK-NEXT: B.test 2 -// CHECK-NEXT: A.testA -// CHECK-NEXT: A.testA2 -// CHECK-NEXT: A.testA - -package main - -type A struct{ aval int } - -func (a *A) test() { - println("A.test", a.aval) -} - -func (a *A) testA() { - println("A.testA") -} - -func (a A) testA2() { - println("A.testA2") -} - -type B struct { - A - bval int -} - -func (b B) test() { - println("B.test", b.bval) -} - -type C struct { - *B - cval int -} - -func main() { - var b B - b.aval = 1 - b.bval = 2 - b.A.test() - b.A.testA() - b.A.testA2() - b.test() - b.testA() - b.testA2() - - var c C - c.B = &b - c.cval = 3 - c.testA() - //c.testA2() -} diff --git a/llgo/test/execution/switch/branch.go b/llgo/test/execution/switch/branch.go deleted file mode 100644 index a7bca9a7bed4..000000000000 --- a/llgo/test/execution/switch/branch.go +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: true -// CHECK-NEXT: false - -package main - -func main() { - switch true { - default: - break - println("default") - } - - switch true { - case true: - println("true") - fallthrough - case false: - println("false") - } -} diff --git a/llgo/test/execution/switch/default.go b/llgo/test/execution/switch/default.go deleted file mode 100644 index 2ae850970701..000000000000 --- a/llgo/test/execution/switch/default.go +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: default -// CHECK-NEXT: true - -package main - -func main() { - switch true { - default: - println("default") - } - - switch { - default: - println("default") - case true: - println("true") - } -} diff --git a/llgo/test/execution/switch/empty.go b/llgo/test/execution/switch/empty.go deleted file mode 100644 index 4d20679e4b1a..000000000000 --- a/llgo/test/execution/switch/empty.go +++ /dev/null @@ -1,16 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: f was called - -package main - -func f() int { - println("f was called") - return 123 -} - -func main() { - switch f() { - } -} diff --git a/llgo/test/execution/switch/scope.go b/llgo/test/execution/switch/scope.go deleted file mode 100644 index 73bab3cd7474..000000000000 --- a/llgo/test/execution/switch/scope.go +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 2 - -package main - -func main() { - // case clauses have their own scope. - switch { - case true, false: - x := 1 - println(x) - fallthrough - default: - x := 2 - println(x) - } -} diff --git a/llgo/test/execution/switch/strings.go b/llgo/test/execution/switch/strings.go deleted file mode 100644 index 7f0c99d441cf..000000000000 --- a/llgo/test/execution/switch/strings.go +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: abc -// CHECK-NEXT: def, abc - -package main - -func main() { - switch "abc" { - case "def": - println("def") - case "abc": - println("abc") - } - - switch "abc" { - case "def", "abc": - println("def, abc") - } -} diff --git a/llgo/test/execution/switch/type.go b/llgo/test/execution/switch/type.go deleted file mode 100644 index b43231cd935e..000000000000 --- a/llgo/test/execution/switch/type.go +++ /dev/null @@ -1,72 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: int64 123 -// CHECK-NEXT: default -// CHECK-NEXT: uint8 or int8 -// CHECK-NEXT: uint8 or int8 -// CHECK-NEXT: N - -package main - -func test(i interface{}) { - switch x := i.(type) { - case int64: - println("int64", x) - // FIXME - //case string: - // println("string", x) - default: - println("default") - } -} - -type stringer interface { - String() string -} - -func printany(i interface{}) { - switch v := i.(type) { - case nil: - print("nil", v) - case stringer: - print(v.String()) - case error: - print(v.Error()) - case int: - print(v) - case string: - print(v) - } -} - -func multi(i interface{}) { - switch i.(type) { - case uint8, int8: - println("uint8 or int8") - default: - println("something else") - } -} - -type N int - -func (n N) String() string { return "N" } - -func named() { - var x interface{} = N(123) - switch x := x.(type) { - case N: - // Test for bug: previously, type switch was - // assigning underlying type of N (int). - println(x.String()) - } -} - -func main() { - test(int64(123)) - test("abc") - multi(uint8(123)) - multi(int8(123)) - named() -} diff --git a/llgo/test/execution/types/named.go b/llgo/test/execution/types/named.go deleted file mode 100644 index 08fd791ec833..000000000000 --- a/llgo/test/execution/types/named.go +++ /dev/null @@ -1,37 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 24 -// CHECK-NEXT: 16 -// CHECK-NEXT: 0 - -package main - -import "unsafe" - -func f1() { - type T struct { - a, b, c int - } - var t T - println(unsafe.Sizeof(t)) -} - -func f2() { - type T interface{} - var t T - t = 1 - println(unsafe.Sizeof(t)) -} - -func f3() { - type T struct{} - var t T - println(unsafe.Sizeof(t)) -} - -func main() { - f1() - f2() - f3() -} diff --git a/llgo/test/execution/types/recursive.go b/llgo/test/execution/types/recursive.go deleted file mode 100644 index 69ac09b45fb2..000000000000 --- a/llgo/test/execution/types/recursive.go +++ /dev/null @@ -1,29 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 3 -// CHECK-NEXT: 4 - -package main - -type T1 *T1 - -func count(t T1) int { - if t == nil { - return 1 - } - return 1 + count(*t) -} - -func testSelfPointer() { - var a T1 - var b T1 - var c T1 = &b - *c = &a - println(count(c)) - println(count(&c)) -} - -func main() { - testSelfPointer() -} diff --git a/llgo/test/execution/unsafe/const_sizeof.go b/llgo/test/execution/unsafe/const_sizeof.go deleted file mode 100644 index ade9d0bc22ba..000000000000 --- a/llgo/test/execution/unsafe/const_sizeof.go +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 8 -// CHECK-NEXT: 8 - -package main - -import "unsafe" - -const ptrSize = unsafe.Sizeof((*byte)(nil)) - -var x [ptrSize]int - -func main() { - println(ptrSize) - println(len(x)) -} diff --git a/llgo/test/execution/unsafe/offsetof.go b/llgo/test/execution/unsafe/offsetof.go deleted file mode 100644 index 88b313ab5e13..000000000000 --- a/llgo/test/execution/unsafe/offsetof.go +++ /dev/null @@ -1,26 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 0 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 16 - -package main - -import "unsafe" - -type S struct { - a int16 - b int32 - c int8 - d int64 -} - -func main() { - var s S - println(unsafe.Offsetof(s.a)) - println(unsafe.Offsetof(s.b)) - println(unsafe.Offsetof(s.c)) - println(unsafe.Offsetof(s.d)) -} diff --git a/llgo/test/execution/unsafe/pointer.go b/llgo/test/execution/unsafe/pointer.go deleted file mode 100644 index 20dc64f073f2..000000000000 --- a/llgo/test/execution/unsafe/pointer.go +++ /dev/null @@ -1,21 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 123 -// CHECK-NEXT: 456 - -package main - -import "unsafe" - -func main() { - var i [2]int - i[0] = 123 - i[1] = 456 - ptr := &i[0] - println(*ptr) - ptr_i := unsafe.Pointer(ptr) - ptr_i = unsafe.Pointer(uintptr(ptr_i) + unsafe.Sizeof(i[0])) - ptr = (*int)(ptr_i) - println(*ptr) -} diff --git a/llgo/test/execution/unsafe/sizeof_array.go b/llgo/test/execution/unsafe/sizeof_array.go deleted file mode 100644 index 2928de793275..000000000000 --- a/llgo/test/execution/unsafe/sizeof_array.go +++ /dev/null @@ -1,18 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 12 - -package main - -import "unsafe" - -type uint24 struct { - a uint16 - b uint8 -} - -func main() { - var a [3]uint24 - println(unsafe.Sizeof(a)) -} diff --git a/llgo/test/execution/unsafe/sizeof_basic.go b/llgo/test/execution/unsafe/sizeof_basic.go deleted file mode 100644 index a9a467bd114b..000000000000 --- a/llgo/test/execution/unsafe/sizeof_basic.go +++ /dev/null @@ -1,102 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 1 -// CHECK-NEXT: 8 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 16 -// CHECK-NEXT: 16 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 1 -// CHECK-NEXT: 8 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 4 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 -// CHECK-NEXT: 8 - -package main - -import "unsafe" - -func main() { - var b bool - var i int - var i8 int8 - var i16 int16 - var i32 int32 - var i64 int64 - var u uint - var u8 uint8 - var u16 uint16 - var u32 uint32 - var u64 uint64 - var f32 float32 - var f64 float64 - var c64 complex64 - var c128 complex128 - var s string - var p unsafe.Pointer - var up uintptr - - println(unsafe.Sizeof(b)) - println(unsafe.Sizeof(i)) - println(unsafe.Sizeof(i8)) - println(unsafe.Sizeof(i16)) - println(unsafe.Sizeof(i32)) - println(unsafe.Sizeof(i64)) - println(unsafe.Sizeof(u)) - println(unsafe.Sizeof(u8)) - println(unsafe.Sizeof(u16)) - println(unsafe.Sizeof(u32)) - println(unsafe.Sizeof(u64)) - println(unsafe.Sizeof(f32)) - println(unsafe.Sizeof(f64)) - println(unsafe.Sizeof(c64)) - println(unsafe.Sizeof(c128)) - println(unsafe.Sizeof(s)) - println(unsafe.Sizeof(p)) - println(unsafe.Sizeof(up)) - - println(unsafe.Alignof(b)) - println(unsafe.Alignof(i)) - println(unsafe.Alignof(i8)) - println(unsafe.Alignof(i16)) - println(unsafe.Alignof(i32)) - println(unsafe.Alignof(i64)) - println(unsafe.Alignof(u)) - println(unsafe.Alignof(u8)) - println(unsafe.Alignof(u16)) - println(unsafe.Alignof(u32)) - println(unsafe.Alignof(u64)) - println(unsafe.Alignof(f32)) - println(unsafe.Alignof(f64)) - println(unsafe.Alignof(c64)) - println(unsafe.Alignof(c128)) - println(unsafe.Alignof(s)) - println(unsafe.Alignof(p)) - println(unsafe.Alignof(up)) -} diff --git a/llgo/test/execution/unsafe/sizeof_struct.go b/llgo/test/execution/unsafe/sizeof_struct.go deleted file mode 100644 index e8612d2ea6cc..000000000000 --- a/llgo/test/execution/unsafe/sizeof_struct.go +++ /dev/null @@ -1,19 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 24 - -package main - -import "unsafe" - -type a struct { - a int16 - b int32 - c int8 - d int64 -} - -func main() { - println(unsafe.Sizeof(a{})) -} diff --git a/llgo/test/execution/var.go b/llgo/test/execution/var.go deleted file mode 100644 index 71b025df45b2..000000000000 --- a/llgo/test/execution/var.go +++ /dev/null @@ -1,37 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: woobie -// CHECK-NEXT: 579 456 -// CHECK-NEXT: 12 +3.450000e+000 -// CHECK-NEXT: -1 - -package main - -func Blah() int { - println("woobie") - return 123 -} - -func F1() (int, float64) { - return 12, 3.45 -} - -var X = Y + Blah() // == 579 -var Y = 123 + Z // == 456 - -var X1, Y1 = F1() - -const ( - _ = 333 * iota - Z -) - -var I interface{} = -1 -var I1 = I.(int) - -func main() { - println(X, Y) - println(X1, Y1) - println(I1) -} diff --git a/llgo/test/execution/varargs.go b/llgo/test/execution/varargs.go deleted file mode 100644 index ca994164e46e..000000000000 --- a/llgo/test/execution/varargs.go +++ /dev/null @@ -1,31 +0,0 @@ -// RUN: llgo -o %t %s -// RUN: %t 2>&1 | FileCheck %s - -// CHECK: 3 -// CHECK-NEXT: 123 -// CHECK-NEXT: 456 -// CHECK-NEXT: 789 -// CHECK-NEXT: 4 -// CHECK-NEXT: 123 -// CHECK-NEXT: 456 -// CHECK-NEXT: 789 -// CHECK-NEXT: 101112 -// CHECK-NEXT: 3 -// CHECK-NEXT: 1 -// CHECK-NEXT: 2 -// CHECK-NEXT: 3 - -package main - -func p(i ...int) { - println(len(i)) - for j := 0; j < len(i); j++ { - println(i[j]) - } -} - -func main() { - p(123, 456, 789) - p(123, 456, 789, 101112) - p([]int{1, 2, 3}...) -} diff --git a/llgo/test/gllgo/dead.go b/llgo/test/gllgo/dead.go deleted file mode 100644 index 31d0de85487f..000000000000 --- a/llgo/test/gllgo/dead.go +++ /dev/null @@ -1,6 +0,0 @@ -// RUN: llgo -O0 -S -o - %s | FileCheck %s - -package gotest - -// CHECK-NOT: deadfunc -func deadfunc() diff --git a/llgo/test/irgen/Inputs/mangling-synthetic-p.go b/llgo/test/irgen/Inputs/mangling-synthetic-p.go deleted file mode 100644 index c59588a51ba6..000000000000 --- a/llgo/test/irgen/Inputs/mangling-synthetic-p.go +++ /dev/null @@ -1,4 +0,0 @@ -package p - -type U struct{} -func (U) f() diff --git a/llgo/test/irgen/avoidload.go b/llgo/test/irgen/avoidload.go deleted file mode 100644 index 0dec74eb92f2..000000000000 --- a/llgo/test/irgen/avoidload.go +++ /dev/null @@ -1,15 +0,0 @@ -// RUN: llgo -S -emit-llvm -o - %s | FileCheck %s - -package foo - -type X struct { - indices [1]int -} - -// CHECK-NOT: load [200 x i64] -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}, i64 160000, i32 1, i1 false) -var _ = [100][200]int{}[0][0] - -// CHECK-NOT: load [1024 x i64] -// CHECK: call void @llvm.memcpy.p0i8.p0i8.i64({{.*}}, i64 8192, i32 1, i1 false) -var _ = [1024]int{}[X{}.indices[0]] diff --git a/llgo/test/irgen/cabi.go b/llgo/test/irgen/cabi.go deleted file mode 100644 index bff2d7c8f89c..000000000000 --- a/llgo/test/irgen/cabi.go +++ /dev/null @@ -1,23 +0,0 @@ -// RUN: llgo -S -emit-llvm -o - %s | FileCheck %s - -package foo - -// CHECK: define void @foo.Test01_SI8(i8* nest, i8 signext) -func Test01_SI8(x int8) {} -// CHECK: define void @foo.Test02_UI8(i8* nest, i8 zeroext) -func Test02_UI8(x uint8) {} - -// CHECK: define void @foo.Test03_SI16(i8* nest, i16 signext) -func Test03_SI16(x int16) {} -// CHECK: define void @foo.Test04_UI16(i8* nest, i16 zeroext) -func Test04_UI16(x uint16) {} - -// CHECK: define void @foo.Test05_SI32(i8* nest, i32) -func Test05_SI32(x int32) {} -// CHECK: define void @foo.Test06_UI32(i8* nest, i32) -func Test06_UI32(x uint32) {} - -// CHECK: define void @foo.Test07_SI64(i8* nest, i64) -func Test07_SI64(x int64) {} -// CHECK: define void @foo.Test08_UI64(i8* nest, i64) -func Test08_UI64(x uint64) {} diff --git a/llgo/test/irgen/go-panic.go b/llgo/test/irgen/go-panic.go deleted file mode 100644 index 35b0a47bb9b5..000000000000 --- a/llgo/test/irgen/go-panic.go +++ /dev/null @@ -1,10 +0,0 @@ -// RUN: llgo -S -emit-llvm -o - %s | FileCheck %s - -package foo - -func F() { - // CHECK: call void @__go_panic - // CHECK-NEXT: ret void - // CHECK-NEXT: } - go panic("") -} diff --git a/llgo/test/irgen/imports.go b/llgo/test/irgen/imports.go deleted file mode 100644 index ae6498a8cbe0..000000000000 --- a/llgo/test/irgen/imports.go +++ /dev/null @@ -1,20 +0,0 @@ -// RUN: llgo -S -emit-llvm -o - %s | FileCheck %s - -package foo - -import _ "fmt" - -var X interface{} - -// CHECK: @"init$guard" = internal global i1 false - -// CHECK: define void @foo..import(i8* nest) -// CHECK-NEXT: : -// CHECK-NEXT: %[[N:.*]] = load i1, i1* @"init$guard" -// CHECK-NEXT: br i1 %[[N]], label %{{.*}}, label %[[L:.*]] - -// CHECK: ;