Commit 4603941e by Richard Sandiford Committed by Richard Sandiford

Use scalar_int/float_mode in brig_langhook_type_for_mode

This follows on from similar changes a couple of months ago and
is needed when general modes have variable size.

2017-10-23  Richard Sandiford  <richard.sandiford@linaro.org>

gcc/brig/
	* brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode
	and scalar_float_mode.

From-SVN: r254000
parent a85cf8e9
2017-10-23 Richard Sandiford <richard.sandiford@linaro.org>
* brig-lang.c (brig_langhook_type_for_mode): Use scalar_int_mode
and scalar_float_mode.
2017-10-09 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com> 2017-10-09 Pekka Jääskeläinen <pekka.jaaskelainen@parmance.com>
* brigfrontend/brig-to-generic.cc: Support BRIG_KIND_NONE * brigfrontend/brig-to-generic.cc: Support BRIG_KIND_NONE
......
...@@ -278,10 +278,11 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp) ...@@ -278,10 +278,11 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp)
return NULL_TREE; return NULL_TREE;
} }
enum mode_class mc = GET_MODE_CLASS (mode); scalar_int_mode imode;
if (mc == MODE_FLOAT) scalar_float_mode fmode;
if (is_int_mode (mode, &imode))
{ {
switch (GET_MODE_BITSIZE (mode)) switch (GET_MODE_BITSIZE (imode))
{ {
case 32: case 32:
return float_type_node; return float_type_node;
...@@ -290,15 +291,15 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp) ...@@ -290,15 +291,15 @@ brig_langhook_type_for_mode (machine_mode mode, int unsignedp)
default: default:
/* We have to check for long double in order to support /* We have to check for long double in order to support
i386 excess precision. */ i386 excess precision. */
if (mode == TYPE_MODE (long_double_type_node)) if (imode == TYPE_MODE (long_double_type_node))
return long_double_type_node; return long_double_type_node;
gcc_unreachable (); gcc_unreachable ();
return NULL_TREE; return NULL_TREE;
} }
} }
else if (mc == MODE_INT) else if (is_float_mode (mode, &fmode))
return brig_langhook_type_for_size(GET_MODE_BITSIZE(mode), unsignedp); return brig_langhook_type_for_size (GET_MODE_BITSIZE (fmode), unsignedp);
else else
{ {
/* E.g., build_common_builtin_nodes () asks for modes/builtins /* E.g., build_common_builtin_nodes () asks for modes/builtins
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment