Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 30 Jun 2016 01:03:40 -0700
From:      Mark Millard <markmi@dsl-only.net>
To:        freebsd-arm <freebsd-arm@freebsd.org>
Subject:   Just FYI: clang 3.8.0 macros on arm comparison: with and without -march=armv7-a --mcpu=cortext-a7
Message-ID:  <C880CC58-5970-4B28-8FA5-94D095354ACE@dsl-only.net>

next in thread | raw e-mail | index | archive | help
# clang -E -dM  - < /dev/null | grep -i align
#define __BIGGEST_ALIGNMENT__ 8

# clang -munaligned-access -E -dM  - < /dev/null | grep -i align
#define __ARM_FEATURE_UNALIGNED 1
#define __BIGGEST_ALIGNMENT__ 8

It appears that an explicit -munaligned-access is required to have =
__ARM_FEATURE_UNALIGNED defined.
=20

Below I diff the following clang compiler outputs. . .

# clang -march=3Darmv7-a -mcpu=3Dcortex-a7 -E -dM  - < /dev/null > =
~/clang380_rpi2_macros_armv7-a_cortex-a7.txt
# clang -std=3Dc11 -march=3Darmv7-a -mcpu=3Dcortex-a7 -E -dM  - < =
/dev/null > ~/clang_c11_380_rpi2_macros_armv7-a_cortex-a7.txt
# clang -E -dM  - < /dev/null > ~/clang380_rpi2_macros_default.txt
# clang -march=3Darmv7-a -E -dM  - < /dev/null > =
~/clang380_rpi2_macros_armv7-a.txt
# clang -mcpu=3Dcortex-a7 -E -dM  - < /dev/null > =
~/clang380_rpi2_macros_cortex-a7.txt
# clang -xc++ -std=3Dc++14 -march=3Darmv7-a -mcpu=3Dcortex-a7 -E -dM  - =
< /dev/null > ~/clang++14_380_rpi2_macros_armv7-a_cortex-a7.txt

# diff ~/clang380_rpi2_macros_armv7-a_cortex-a7.txt =
~/clang380_rpi2_macros_default.txt
6,8c6,7
< #define __ARM_ARCH 7
< #define __ARM_ARCH_7A__ 1
< #define __ARM_ARCH_EXT_IDIV__ 1
---
> #define __ARM_ARCH 6
> #define __ARM_ARCH_6KZ__ 1
10,11c9
< #define __ARM_ARCH_ISA_THUMB 2
< #define __ARM_ARCH_PROFILE 'A'
---
> #define __ARM_ARCH_ISA_THUMB 1
15,17c13
< #define __ARM_FEATURE_FMA 1
< #define __ARM_FEATURE_IDIV 1
< #define __ARM_FEATURE_LDREX 0xF
---
> #define __ARM_FEATURE_LDREX 0x4
21c17
< #define __ARM_FP 0xE
---
> #define __ARM_FP 0xC
24,26d19
< #define __ARM_NEON 1
< #define __ARM_NEON_FP 0x6
< #define __ARM_NEON__ 1
31c24
< #define __ARM_VFPV4__ 1
---
> #define __ARM_VFPV2__ 1


# diff ~/clang380_rpi2_macros_armv7-a_cortex-a7.txt =
~/clang_c11_380_rpi2_macros_armv7-a_cortex-a7.txt=20
224a225
> #define __STRICT_ANSI__ 1
336d336
< #define unix 1


# diff ~/clang380_rpi2_macros_armv7-a_cortex-a7.txt =
~/clang380_arpi2_macros_armv7-a.txt=20
8d7
< #define __ARM_ARCH_EXT_IDIV__ 1
16d14
< #define __ARM_FEATURE_IDIV 1
21c19
< #define __ARM_FP 0xE
---
> #define __ARM_FP 0xC
25c23
< #define __ARM_NEON_FP 0x6
---
> #define __ARM_NEON_FP 0x4
31c29
< #define __ARM_VFPV4__ 1
---
> #define __ARM_VFPV3__ 1


# diff ~/clang380_rpi2_macros_armv7-a_cortex-a7.txt =
~/clang380_rpi2_macros_cortex-a7.txt

(Yep: nothing different.)

# diff ~/clang380_rpi2_macros_armv7-a_cortex-a7.txt =
~/clang++14_380_rpi2_macros_armv7-a_cortex-a7.txt                        =
                                 =20
59a60
> #define __DEPRECATED 1
60a62
> #define __EXCEPTIONS 1
94a97
> #define __GNUC_GNU_INLINE__ 1
97d99
< #define __GNUC_STDC_INLINE__ 1
98a101
> #define __GNUG__ 4
99a103
> #define __GXX_EXPERIMENTAL_CXX0X__ 1
100a105
> #define __GXX_WEAK__ 1
223d227
< #define __STDC_VERSION__ 201112L
224a229
> #define __STRICT_ANSI__ 1
332a338,366
> #define __cplusplus 201402L
> #define __cpp_aggregate_nsdmi 201304
> #define __cpp_alias_templates 200704
> #define __cpp_attributes 200809
> #define __cpp_binary_literals 201304
> #define __cpp_constexpr 201304
> #define __cpp_decltype 200707
> #define __cpp_decltype_auto 201304
> #define __cpp_delegating_constructors 200604
> #define __cpp_digit_separators 201309
> #define __cpp_exceptions 199711
> #define __cpp_generic_lambdas 201304
> #define __cpp_inheriting_constructors 200802
> #define __cpp_init_captures 201304
> #define __cpp_initializer_lists 200806
> #define __cpp_lambdas 200907
> #define __cpp_nsdmi 200809
> #define __cpp_range_based_for 200907
> #define __cpp_raw_strings 200710
> #define __cpp_ref_qualifiers 200710
> #define __cpp_return_type_deduction 201304
> #define __cpp_rtti 199711
> #define __cpp_rvalue_references 200610
> #define __cpp_static_assert 200410
> #define __cpp_unicode_characters 200704
> #define __cpp_unicode_literals 200710
> #define __cpp_user_defined_literals 200809
> #define __cpp_variable_templates 201304
> #define __cpp_variadic_templates 200704
333a368
> #define __private_extern__ extern
336d370
< #define unix 1



Some other points of note:

#define __FreeBSD_cc_version 1100004
#define _ILP32 1
#define __ARM_SIZEOF_MINIMAL_ENUM 4
#define __ARM_SIZEOF_WCHAR_T 4
#define __BIGGEST_ALIGNMENT__ 8
#define __BYTE_ORDER__ __ORDER_LITTLE_ENDIAN__
#define __CHAR16_TYPE__ unsigned short
#define __CHAR32_TYPE__ unsigned int
#define __CHAR_BIT__ 8
#define __CHAR_UNSIGNED__ 1

=3D=3D=3D
Mark Millard
markmi at dsl-only.net




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?C880CC58-5970-4B28-8FA5-94D095354ACE>